Planeshift
|
The main server class. More...
#include <psserver.h>
Public Member Functions | |
bool | AddBuddy (PID self, PID buddy) |
Adds a buddy to this players list of buddies. | |
bool | CheckAccess (Client *client, const char *command, bool returnError=true) |
Check if a client is authorized to execute a command. | |
ActionManager * | GetActionManager () |
Returns the Advice manager. | |
AdminManager * | GetAdminManager () |
Returns the Administration Manager. | |
AdviceManager * | GetAdviceManager () |
Returns the Advice manager. | |
iResultSet * | GetAllResponses (csString &trigger) |
iResultSet * | GetAllTriggersInArea (csString data) |
Gets all the triggers from a particular knowledge area. | |
AuthenticationServer * | GetAuthServer () |
Returns a pointer to the AuthenticationServer. | |
BankManager * | GetBankManager () |
Returns the Bank Manager. | |
CacheManager * | GetCacheManager () |
Returns the Chace Manager. | |
ServerCharManager * | GetCharManager () |
Returns the character manager. | |
ChatManager * | GetChatManager () |
Returns the Chat manager. | |
CombatManager * | GetCombatManager () |
Returns the Combat Manager. | |
iConfigManager * | GetConfig () |
Returns the configuration manager. | |
ClientConnectionSet * | GetConnections () |
Gets a list of all connected clients. | |
psDatabase * | GetDatabase () |
Returns the database manager. | |
EconomyManager * | GetEconomyManager () |
Returns the economy manager. | |
EventManager * | GetEventManager () |
Returns the event manager. | |
ExchangeManager * | GetExchangeManager () |
Returns the Exchange Manager. | |
GMEventManager * | GetGMEventManager () |
Returns the GM Event Manager. | |
GuildManager * | GetGuildManager () |
Returns the guild manager. | |
HireManager * | GetHireManager () |
Returns the Hire Manager. | |
IntroductionManager * | GetIntroductionManager () |
Returns the Introduction Manager. | |
LogCSV * | GetLogCSV () |
psMarriageManager * | GetMarriageManager () |
Returns the Marriage Manager. | |
MathScriptEngine * | GetMathScriptEngine () |
Returns the Math Scripting Engine. | |
MiniGameManager * | GetMiniGameManager () |
Returns the minigame manager. | |
const char * | GetMOTD () |
Gets the MOTD string. | |
NetManager * | GetNetManager () |
Returns the server's network thread. | |
NPCManager * | GetNPCManager () |
Returns the NPC Superclient manager. | |
iObjectRegistry * | GetObjectReg () |
Returns the object registry. | |
ProgressionManager * | GetProgressionManager () |
Returns the Progression Manager. | |
QuestManager * | GetQuestManager () |
Return the quest manager. | |
float | GetRandom () |
Returns a random number. | |
uint32 | GetRandom (uint32 limit) |
Returns a random number with a limit. | |
float | GetRandomRange (const float pos, const float range) |
Returns a random position within a range. | |
bool | GetServerOption (const char *option_name, csString &value) |
Check for options in table 'server_options'. | |
ServerSongManager * | GetSongManager () |
Returns the Song Manager. | |
SpawnManager * | GetSpawnManager () |
Returns the spawn manager. | |
SpellManager * | GetSpellManager () |
Returns the spell manager. | |
iResultSet * | GetSuperclientNPCs (int superclientID) |
Return a list of NPCs (with their info) managed by a particular superclient. | |
TutorialManager * | GetTutorialManager () |
Returns the Tutorial Manager. | |
PID | GetUnusedPID () |
Return a unused PID for temporary usage. | |
UserManager * | GetUserManager () |
Returns the User Manager. | |
WeatherManager * | GetWeatherManager () |
Returns the Weather manager. | |
WorkManager * | GetWorkManager () |
Returns the work manager. | |
bool | HasBeenReady () |
Checks to see if a world has loaded in the past. | |
bool | Initialize (iObjectRegistry *objreg) |
Initialize the server. | |
bool | IsFull (size_t numclients, Client *client) |
Checks if the server is full. | |
bool | IsMapLoaded () |
Checks to see if a world is loaded. | |
bool | IsReady () |
Checks to see if a world is loaded ready to go. | |
void | LoadLogSettings () |
Used to load the log settings. | |
bool | LoadMap (const char *mapname) |
Loads a map and changes the MapLoaded. | |
void | MainLoop () |
Runs a script file to set up server and goes to the consoles main loop. | |
void | MutePlayer (uint32_t clientnum, const char *reason) |
Mutes a player from the world. | |
psServer () | |
Default constructor. | |
void | QuitServer (int time, Client *client) |
Quits the server and sends informative messages. | |
bool | RemoveBuddy (PID self, PID buddy) |
Removes a buddy from this character's list of buddies. | |
void | RemovePlayer (uint32_t clientnum, const char *reason) |
Removes a player from the world. | |
void | SaveLogSettings () |
Used to save the log settings. | |
void | SendSystemBaseInfo (int clientnum, const char *fmt,...) |
Similar to SendSystemInfo(), but the message is shown also on the "Main" tab. | |
void | SendSystemError (int clientnum, const char *fmt,...) |
Convenience command to send a client an error psSystemMessage. | |
void | SendSystemInfo (int clientnum, const char *fmt,...) |
Convenience command to send a client a psSystemMessage. | |
void | SendSystemOK (int clientnum, const char *fmt,...) |
Convenience command to send a client a psSystemMessage with the MSG_OK type. | |
void | SendSystemResult (int clientnum, const char *fmt,...) |
Convenience command to send a client a psSystemMessage with the MSG_RESULT type. | |
void | SetMOTD (const char *str) |
Sets the MOTD string. | |
bool | SetServerOption (const char *option_name, const csString &value) |
Set an option in table 'server_options'. | |
void | UnmutePlayer (uint32_t clientnum, const char *reason) |
Unmutes player. | |
void | UpdateDialog (const char *area, const char *trigger, const char *response, int num) |
Change the dialog responses for that trigger in the area. | |
void | UpdateDialog (const char *area, const char *trigger, const char *prohim, const char *proher, const char *it, const char *them) |
Changes the pronoun set for that trigger in that area. | |
~psServer () | |
Destructor. | |
Public Attributes | |
CacheManager * | cachemanager |
CharCreationManager * | charCreationManager |
CombatManager * | combatmanager |
EntityManager * | entitymanager |
ExchangeManager * | exchangemanager |
csRef< GroupManager > | groupmanager |
csRef< GuildManager > | guildmanager |
psMarriageManager * | marriageManager |
NPCManager * | npcmanager |
csRef< QuestionManager > | questionmanager |
QuestManager * | questmanager |
csRandomGen * | rng |
UserManager * | usermanager |
csRef< iVFS > | vfs |
Static Public Attributes | |
static psCharacterLoader | CharacterLoader |
Protected Attributes | |
csRef< ActionManager > | actionmanager |
AdminManager * | adminmanager |
csRef< AdviceManager > | advicemanager |
csRef< AuthenticationServer > | authserver |
BankManager * | bankmanager |
ServerCharManager * | charmanager |
csRef< ChatManager > | chatmanager |
csRef< iConfigManager > | configmanager |
psDatabase * | database |
EconomyManager * | economymanager |
csRef< EventManager > | eventmanager |
GMEventManager * | gmeventManager |
HireManager * | hiremanager |
IntroductionManager * | intromanager |
LogCSV * | logcsv |
bool | MapLoaded |
MathScriptEngine * | mathscriptengine |
MiniGameManager * | minigamemanager |
csString | motd |
NetManager * | netmanager |
iObjectRegistry * | objreg |
ProgressionManager * | progression |
psQuitEvent * | server_quit_event |
Used to keep track of the shut down event. | |
ServerConsole * | serverconsole |
ServerSongManager * | songManager |
SpawnManager * | spawnmanager |
SpellManager * | spellmanager |
TutorialManager * | tutorialmanager |
uint32_t | unused_pid |
Unused PID. | |
WeatherManager * | weathermanager |
WorkManager * | workmanager |
The main server class.
The main server class holding references to important server objects.
Definition at line 102 of file psserver.h.
psServer::psServer | ( | ) |
Default constructor.
Just sets all the pointers to NULL.
psServer::~psServer | ( | ) |
Destructor.
Cleans up all allocated memory and removes all the players from the world.
bool psServer::AddBuddy | ( | PID | self, |
PID | buddy | ||
) |
Adds a buddy to this players list of buddies.
Takes the player ID of us and the player ID of the buddy. When you have a buddy, you will be able to see when they come online and leave.
self,: | Is the player ID for the current player we are adding buddy to. |
buddy,: | Is the player ID for the buddy you wish to add. |
bool psServer::CheckAccess | ( | Client * | client, |
const char * | command, | ||
bool | returnError = true |
||
) |
Check if a client is authorized to execute a command.
client | the client we are checking |
command | the command we are checking for |
returnError | tells whether the command outputs an error |
ActionManager* psServer::GetActionManager | ( | ) | [inline] |
Returns the Advice manager.
Definition at line 286 of file psserver.h.
AdminManager* psServer::GetAdminManager | ( | ) | [inline] |
Returns the Administration Manager.
Definition at line 376 of file psserver.h.
AdviceManager* psServer::GetAdviceManager | ( | ) | [inline] |
Returns the Advice manager.
Definition at line 276 of file psserver.h.
iResultSet* psServer::GetAllResponses | ( | csString & | trigger | ) |
iResultSet* psServer::GetAllTriggersInArea | ( | csString | data | ) |
Gets all the triggers from a particular knowledge area.
data | Is a string containing the name of the data area we want the triggers for. |
AuthenticationServer* psServer::GetAuthServer | ( | ) | [inline] |
Returns a pointer to the AuthenticationServer.
Definition at line 567 of file psserver.h.
BankManager* psServer::GetBankManager | ( | ) | [inline] |
Returns the Bank Manager.
Definition at line 499 of file psserver.h.
CacheManager* psServer::GetCacheManager | ( | ) | [inline] |
Returns the Chace Manager.
Definition at line 529 of file psserver.h.
ServerCharManager* psServer::GetCharManager | ( | ) | [inline] |
Returns the character manager.
Definition at line 387 of file psserver.h.
ChatManager* psServer::GetChatManager | ( | ) | [inline] |
Returns the Chat manager.
Definition at line 266 of file psserver.h.
CombatManager* psServer::GetCombatManager | ( | ) | [inline] |
Returns the Combat Manager.
Definition at line 423 of file psserver.h.
iConfigManager* psServer::GetConfig | ( | ) | [inline] |
Returns the configuration manager.
Definition at line 316 of file psserver.h.
ClientConnectionSet* psServer::GetConnections | ( | ) |
Gets a list of all connected clients.
psDatabase* psServer::GetDatabase | ( | ) | [inline] |
Returns the database manager.
Definition at line 306 of file psserver.h.
EconomyManager* psServer::GetEconomyManager | ( | ) | [inline] |
Returns the economy manager.
Definition at line 467 of file psserver.h.
EventManager* psServer::GetEventManager | ( | ) | [inline] |
Returns the event manager.
Definition at line 346 of file psserver.h.
ExchangeManager* psServer::GetExchangeManager | ( | ) | [inline] |
Returns the Exchange Manager.
Definition at line 413 of file psserver.h.
GMEventManager* psServer::GetGMEventManager | ( | ) | [inline] |
Returns the GM Event Manager.
Definition at line 489 of file psserver.h.
GuildManager* psServer::GetGuildManager | ( | ) | [inline] |
Returns the guild manager.
Definition at line 456 of file psserver.h.
HireManager* psServer::GetHireManager | ( | ) | [inline] |
Returns the Hire Manager.
Definition at line 509 of file psserver.h.
IntroductionManager* psServer::GetIntroductionManager | ( | ) | [inline] |
Returns the Introduction Manager.
Definition at line 539 of file psserver.h.
LogCSV* psServer::GetLogCSV | ( | ) | [inline] |
Definition at line 634 of file psserver.h.
psMarriageManager* psServer::GetMarriageManager | ( | ) | [inline] |
Returns the Marriage Manager.
Definition at line 405 of file psserver.h.
MathScriptEngine* psServer::GetMathScriptEngine | ( | ) | [inline] |
Returns the Math Scripting Engine.
Definition at line 366 of file psserver.h.
MiniGameManager* psServer::GetMiniGameManager | ( | ) | [inline] |
Returns the minigame manager.
Definition at line 478 of file psserver.h.
const char* psServer::GetMOTD | ( | ) | [inline] |
Gets the MOTD string.
Definition at line 238 of file psserver.h.
NetManager* psServer::GetNetManager | ( | ) | [inline] |
Returns the server's network thread.
Definition at line 256 of file psserver.h.
NPCManager* psServer::GetNPCManager | ( | ) | [inline] |
Returns the NPC Superclient manager.
Definition at line 296 of file psserver.h.
iObjectRegistry* psServer::GetObjectReg | ( | ) | [inline] |
Returns the object registry.
Definition at line 326 of file psserver.h.
ProgressionManager* psServer::GetProgressionManager | ( | ) | [inline] |
Returns the Progression Manager.
Definition at line 397 of file psserver.h.
QuestManager* psServer::GetQuestManager | ( | ) | [inline] |
Return the quest manager.
Definition at line 785 of file psserver.h.
float psServer::GetRandom | ( | ) | [inline] |
Returns a random number.
Definition at line 584 of file psserver.h.
uint32 psServer::GetRandom | ( | uint32 | limit | ) | [inline] |
Returns a random number with a limit.
Definition at line 604 of file psserver.h.
Returns a random position within a range.
Definition at line 594 of file psserver.h.
bool psServer::GetServerOption | ( | const char * | option_name, |
csString & | value | ||
) |
Check for options in table 'server_options'.
option_name | the desired option |
value | Value of the found option will be placed in this string. |
ServerSongManager* psServer::GetSongManager | ( | ) | [inline] |
Returns the Song Manager.
Definition at line 549 of file psserver.h.
SpawnManager* psServer::GetSpawnManager | ( | ) | [inline] |
Returns the spawn manager.
Definition at line 336 of file psserver.h.
SpellManager* psServer::GetSpellManager | ( | ) | [inline] |
Returns the spell manager.
Definition at line 434 of file psserver.h.
iResultSet* psServer::GetSuperclientNPCs | ( | int | superclientID | ) |
Return a list of NPCs (with their info) managed by a particular superclient.
superclientID | is the playerID of the superclient |
TutorialManager* psServer::GetTutorialManager | ( | ) | [inline] |
Returns the Tutorial Manager.
Definition at line 559 of file psserver.h.
PID psServer::GetUnusedPID | ( | ) | [inline] |
Return a unused PID for temporary usage.
Definition at line 778 of file psserver.h.
UserManager* psServer::GetUserManager | ( | ) | [inline] |
Returns the User Manager.
Definition at line 519 of file psserver.h.
WeatherManager* psServer::GetWeatherManager | ( | ) | [inline] |
Returns the Weather manager.
Definition at line 356 of file psserver.h.
WorkManager* psServer::GetWorkManager | ( | ) | [inline] |
Returns the work manager.
Definition at line 445 of file psserver.h.
bool psServer::HasBeenReady | ( | ) |
Checks to see if a world has loaded in the past.
bool psServer::Initialize | ( | iObjectRegistry * | objreg | ) |
Initialize the server.
Initializes the following modules:
Starts a thread for:
objreg,: | Is a reference to the object registry. |
bool psServer::IsFull | ( | size_t | numclients, |
Client * | client | ||
) |
Checks if the server is full.
numclients | Current number of connected clients |
client | Will say no if client is GM |
bool psServer::IsMapLoaded | ( | ) | [inline] |
Checks to see if a world is loaded.
Definition at line 169 of file psserver.h.
bool psServer::IsReady | ( | ) |
Checks to see if a world is loaded ready to go.
void psServer::LoadLogSettings | ( | ) |
Used to load the log settings.
bool psServer::LoadMap | ( | const char * | mapname | ) |
Loads a map and changes the MapLoaded.
mapname | The name of the map to load. |
void psServer::MainLoop | ( | ) |
Runs a script file to set up server and goes to the consoles main loop.
Load and starts an optional script file whose name was given on the command line using the "run script_filename" option. This script sets up the server by executing console commands. After that the function jumps into the server console's main loop, accepting commands from the user.
void psServer::MutePlayer | ( | uint32_t | clientnum, |
const char * | reason | ||
) |
Mutes a player from the world.
It will prevent them from being heard, until they log back in
clientnum | Is the number of the client whose player we wish to remove from the world. |
reason | Is a string representing the reason we are removing the player from the world. |
Quits the server and sends informative messages.
time | -1 to stop the quit, 0 to quit the server immediately, > 0 to delay the server quit |
client | the client we are checking. If null messages are sent only to server console |
bool psServer::RemoveBuddy | ( | PID | self, |
PID | buddy | ||
) |
Removes a buddy from this character's list of buddies.
Takes the unique player ID of us and the player ID of the buddy. Returns false if buddy diddnt exist.
self,: | Is the player ID for the current player we are removing the buddy from. |
buddy,: | Is the player ID for the buddy you wish to remove. |
void psServer::RemovePlayer | ( | uint32_t | clientnum, |
const char * | reason | ||
) |
Removes a player from the world.
It will save the players state information and remove them from the world.
clientnum | Is the number of the client whose player we wish to remove from the world. |
reason | Is a string representing the reason we are removing the player from the world. |
void psServer::SaveLogSettings | ( | ) |
Used to save the log settings.
void psServer::SendSystemBaseInfo | ( | int | clientnum, |
const char * | fmt, | ||
... | |||
) |
Similar to SendSystemInfo(), but the message is shown also on the "Main" tab.
void psServer::SendSystemError | ( | int | clientnum, |
const char * | fmt, | ||
... | |||
) |
Convenience command to send a client an error psSystemMessage.
void psServer::SendSystemInfo | ( | int | clientnum, |
const char * | fmt, | ||
... | |||
) |
Convenience command to send a client a psSystemMessage.
void psServer::SendSystemOK | ( | int | clientnum, |
const char * | fmt, | ||
... | |||
) |
Convenience command to send a client a psSystemMessage with the MSG_OK type.
void psServer::SendSystemResult | ( | int | clientnum, |
const char * | fmt, | ||
... | |||
) |
Convenience command to send a client a psSystemMessage with the MSG_RESULT type.
void psServer::SetMOTD | ( | const char * | str | ) | [inline] |
Sets the MOTD string.
Definition at line 246 of file psserver.h.
bool psServer::SetServerOption | ( | const char * | option_name, |
const csString & | value | ||
) |
Set an option in table 'server_options'.
option_name | the desired option |
value | Value of the found option will be replaced with this string. |
void psServer::UnmutePlayer | ( | uint32_t | clientnum, |
const char * | reason | ||
) |
Unmutes player.
void psServer::UpdateDialog | ( | const char * | area, |
const char * | trigger, | ||
const char * | prohim, | ||
const char * | proher, | ||
const char * | it, | ||
const char * | them | ||
) |
Changes the pronoun set for that trigger in that area.
area | Is the name of the area associated with the trigger. |
trigger | Is the trigger we want to modify a response for. |
prohim | |
proher | |
it | |
them |
void psServer::UpdateDialog | ( | const char * | area, |
const char * | trigger, | ||
const char * | response, | ||
int | num | ||
) |
Change the dialog responses for that trigger in the area.
Given the area, trigger and response number; change the reponse to be the new value. There are seperate tables for the triggers and the responses. If something has been said then it is checked against the triggers. If it matches a trigger then the response ID is retrieved for that trigger. That response ID is looked up and for each ID there are a number of responses (5 to be exact) One of these responses is chosen and that response is used from the trigger.
area,: | Is the name of the area associated with the trigger. |
trigger,: | Is the trigger we want to modify a response for. |
response,: | Is the new response for the trigger. |
num,: | Is the response number to change. This can be a value from 1 - 5. |
csRef<ActionManager> psServer::actionmanager [protected] |
Definition at line 831 of file psserver.h.
AdminManager* psServer::adminmanager [protected] |
Definition at line 812 of file psserver.h.
csRef<AdviceManager> psServer::advicemanager [protected] |
Definition at line 830 of file psserver.h.
csRef<AuthenticationServer> psServer::authserver [protected] |
Definition at line 832 of file psserver.h.
BankManager* psServer::bankmanager [protected] |
Definition at line 837 of file psserver.h.
Definition at line 805 of file psserver.h.
Definition at line 791 of file psserver.h.
Definition at line 798 of file psserver.h.
ServerCharManager* psServer::charmanager [protected] |
Definition at line 814 of file psserver.h.
csRef<ChatManager> psServer::chatmanager [protected] |
Definition at line 829 of file psserver.h.
Definition at line 795 of file psserver.h.
csRef<iConfigManager> psServer::configmanager [protected] |
Definition at line 828 of file psserver.h.
psDatabase* psServer::database [protected] |
Definition at line 813 of file psserver.h.
EconomyManager* psServer::economymanager [protected] |
Definition at line 821 of file psserver.h.
Definition at line 804 of file psserver.h.
csRef<EventManager> psServer::eventmanager [protected] |
Definition at line 816 of file psserver.h.
Definition at line 803 of file psserver.h.
GMEventManager* psServer::gmeventManager [protected] |
Definition at line 836 of file psserver.h.
Definition at line 801 of file psserver.h.
Definition at line 799 of file psserver.h.
HireManager* psServer::hiremanager [protected] |
Definition at line 838 of file psserver.h.
IntroductionManager* psServer::intromanager [protected] |
Definition at line 824 of file psserver.h.
LogCSV* psServer::logcsv [protected] |
Definition at line 833 of file psserver.h.
bool psServer::MapLoaded [protected] |
Definition at line 834 of file psserver.h.
Definition at line 794 of file psserver.h.
MathScriptEngine* psServer::mathscriptengine [protected] |
Definition at line 826 of file psserver.h.
MiniGameManager* psServer::minigamemanager [protected] |
Definition at line 823 of file psserver.h.
csString psServer::motd [protected] |
Definition at line 835 of file psserver.h.
NetManager* psServer::netmanager [protected] |
Definition at line 811 of file psserver.h.
Definition at line 793 of file psserver.h.
iObjectRegistry* psServer::objreg [protected] |
Definition at line 827 of file psserver.h.
ProgressionManager* psServer::progression [protected] |
Definition at line 819 of file psserver.h.
Definition at line 800 of file psserver.h.
Definition at line 797 of file psserver.h.
csRandomGen* psServer::rng |
Definition at line 796 of file psserver.h.
psQuitEvent* psServer::server_quit_event [protected] |
Used to keep track of the shut down event.
Definition at line 840 of file psserver.h.
ServerConsole* psServer::serverconsole [protected] |
Definition at line 810 of file psserver.h.
ServerSongManager* psServer::songManager [protected] |
Definition at line 825 of file psserver.h.
SpawnManager* psServer::spawnmanager [protected] |
Definition at line 815 of file psserver.h.
SpellManager* psServer::spellmanager [protected] |
Definition at line 818 of file psserver.h.
TutorialManager* psServer::tutorialmanager [protected] |
Definition at line 822 of file psserver.h.
uint32_t psServer::unused_pid [protected] |
Unused PID.
These are for temporary use. Init with a really big number and decrements.
Definition at line 846 of file psserver.h.
Definition at line 802 of file psserver.h.
csRef<iVFS> psServer::vfs |
Definition at line 806 of file psserver.h.
WeatherManager* psServer::weathermanager [protected] |
Definition at line 817 of file psserver.h.
WorkManager* psServer::workmanager [protected] |
Definition at line 820 of file psserver.h.