19 #ifndef __NETWORKMGR_H__ 20 #define __NETWORKMGR_H__ 24 #include <csutil/csstring.h> 226 void Authenticate(csString &host,
int port,csString &user,csString &pass);
252 void QueueDRDataCommand(
NPC* npc);
456 const csString &magicalAssessmentPerception,
const csString &overallAssessmentPerception);
524 virtual void Trigger();
void QueueVisibilityCommand(gemNPCActor *entity, bool status)
Queue a change in visibility.
void HandleHiredNPCScript(MsgEntry *me)
Handle Hired npc script from server.
void QueueAssessCommand(gemNPCActor *entity, gemNPCObject *target, const csString &physicalAssessmentPerception, const csString &magicalAssessmentPerception, const csString &overallAssessmentPerception)
Send a command to do an assessment.
void HandlePositionUpdates(MsgEntry *msg)
Handle update update of positions from server.
void CheckCommandsOverrun(size_t neededSize)
Checks if the npc command message could overrun if the neededSize is tried to be added.
void SendAllCommands(bool final=false)
Send the queued commands.
NetworkManager * networkMgr
void QueueLootCommand(gemNPCActor *entity, EID targetEID, const csString &type)
Send a command to loot selected target.
void QueueDRData(NPC *npc)
Queue the NPC for an DR Update to the server.
void QueueSystemInfoCommand(uint32_t clientNum, const char *reply,...)
Send an system info command to the client.
void ReAuthenticate()
Reauthenicate with the server.
The structure of 1 queue entry (pointer to a message)
void HandleNpcDeleted(MsgEntry *msg)
Handle information from server about deleted NPC.
Handle all network messages inn and out of the NPC Client.
int cmd_count
Entities queued for sending of DR.
void RequestAllObjects()
Number of command messages queued.
void QueueSitCommand(gemNPCActor *npc, gemNPCObject *target, bool sit)
Send a sit command to server.
void QueueBusyCommand(gemNPCActor *entity, bool busy)
Send a command to change the busy state.
void QueueSpawnCommand(gemNPCActor *mother, gemNPCActor *father, const csString &tribeMemberType)
Send a spawn command to server.
void QueueScriptCommand(gemNPCActor *npc, gemNPCObject *target, const csString &scriptName)
Send a script command to server.
void Authenticate(csString &host, int port, csString &user, csString &pass)
void QueueWorkCommand(gemNPCActor *entity, const csString &type, const csString &resource)
Send a command to start working.
psNetConnection * connection
void HandleLocation(MsgEntry *me)
Handle location changes from server.
bool HandleNPCList(MsgEntry *msg)
Handle a list of npcs received from server.
void HandleTimeUpdate(MsgEntry *msg)
Handle time updates from server.
NetworkManager(MsgHandler *mh, psNetConnection *conn, iEngine *engine)
Construct the network manager.
void HandleNPCWorkDone(MsgEntry *msg)
Handle information from server that work is done.
void QueueCastCommand(gemNPCActor *entity, gemNPCObject *target, const csString &spell, float kFactor)
Send a command to start cast a spell.
void QueueEmoteCommand(gemNPCActor *npc, gemNPCObject *target, const csString &cmd)
Send an emote command to server.
bool HandleMapList(MsgEntry *msg)
Handle the map list received from server.
void HandleItem(MsgEntry *me)
Handle a new item from server.
void HandleNewNpc(MsgEntry *msg)
Handle information from server about NPCs to use.
void QueueAttackCommand(gemNPCActor *attacker, gemNPCActor *target, const char *stance, const char *attack_type)
Queue an Attack Command for an NPC to the server.
psNPCCommandsMessage * outbound
void ReConnect()
Reconnect to the server server.
This object represents each NPC managed by this superclient.
void HandleActor(MsgEntry *msg)
Handle an actor from server.
void HandleDisconnect(MsgEntry *msg)
Handle command to disconnect from server.
void QueueTalkCommand(gemNPCActor *speaker, gemNPCActor *target, psNPCCommandsMessage::PerceptionTalkType talkType, bool publicTalk, const char *text)
Queue a talk command to the server.
void QueueUnbuildCommand(gemNPCActor *unbuilder, gemNPCItem *building)
Send a unbuild command to server.
uint32_t GetCommonStringID(const char *string)
Convert a string into a common string id.
This class is the client's and server's main interface for either sending network messages out or get...
void QueueResurrectCommand(csVector3 where, float rot, iSector *sector, PID character_id)
Send a command to resurrect.
void QueueAnimationCommand(gemNPCActor *npc, const csString &cmd)
Send an animation command to server.
void DequeueDRData(NPC *npc)
Call to remove queued dr updates when entities are removed/deleted.
void QueueDeleteNPCCommand(NPC *npcx)
Send a command to delete a npc.
void HandlePathNetwork(MsgEntry *me)
Handle changes to path network from server.
void HandleConsoleCommand(MsgEntry *me)
void SendConsoleCommand(const char *cmd)
Send a console command.
void QueuePickupCommand(gemNPCActor *entity, gemNPCObject *item, int count)
Queue a command to pickup a item.
const char * GetCommonString(uint32_t cstr_id)
Convert a common string id into the corresponding string.
csHash< NPC *, PID > cmd_dr_outbound
void QueueEquipCommand(gemNPCActor *entity, csString item, csString slot, int count)
Send a command to equip an equipment.
csStringHashReversible * GetMsgStrings()
Get the message string table.
void HandleRaceList(MsgEntry *me)
Handle list of races from server.
void QueueTransferCommand(gemNPCActor *entity, csString item, int count, csString target)
Send a command to transfere an item between two entities.
void QueueDequipCommand(gemNPCActor *entity, csString slot)
Send a command to dequip an equipment.
void HandlePersistMessage(MsgEntry *msg)
Handle new entities from server.
void QueueControlCommand(gemNPCActor *controllingEntity, gemNPCActor *controlledEntity)
Send a command start controll an entity.
virtual ~NetworkManager()
Destructor.
void HandleAllEntities(MsgEntry *message)
Handle list of all entities from server.
void HandlePerceptions(MsgEntry *msg)
Handle perceptions from the server.
void QueueSpawnBuildingCommand(gemNPCActor *spawner, csVector3 where, iSector *sector, const char *buildingName, int tribeID, bool pickupable)
Send a spawn building command to server.
void HandleObjectRemoval(MsgEntry *me)
Handle removal of an object from server.
void QueueDropCommand(gemNPCActor *entity, csString slot)
Send a command to drop the content of a slot.
All scheduled events must inherit from this class.
void QueueSequenceCommand(csString name, int cmd, int count)
Send a command to start a sequence.
virtual void HandleMessage(MsgEntry *pMsg)
Handle all messages from server and send them to specefic Handle functions for each message type...
void QueueDRData2(NPC *npc)
Queue the NPC for an DR Update to the server.
This class handles all queueing and invoking of timed events, such as combat, spells, NPC dialog responses, range weapons, or NPC respawning.
void PrepareCommandMessage()
Prepare a new command message allow for queuing of new commands.
bool reconnect
Set to true if reconnect should be done.
void QueueTemporarilyImperviousCommand(gemNPCActor *entity, bool impervious)
Send a command to change the temporarily impervious status.
The message sent from server to superclient after successful login.