20 #ifndef __NETMANAGER_H__ 21 #define __NETMANAGER_H__ 26 #include <csutil/threading/thread.h> 71 bool Initialize(
CacheManager* cachemanager,
int client_firstmsg,
int npcclient_firstmsg,
int timeout=15000);
116 virtual void Multicast(
MsgEntry* me,
const csArray<PublishDestination> &multi, uint32_t except,
float range);
222 void CheckResendPkts(
void);
234 uint32_t client_firstmsg;
236 uint32_t npcclient_firstmsg;
This class holds data for a connection.
virtual Connection * GetConnByIP(LPSOCKADDR_IN addr)
Returns a NetManager::Connection from the given IP address.
virtual void Broadcast(MsgEntry *me, int scope, int guild=-1)
This broadcasts the same msg out to a bunch of Clients.
The structure of 1 queue entry (pointer to a message)
Client * GetClient(int cnum)
Gets a client with the specified id.
virtual bool HandleUnknownClient(LPSOCKADDR_IN addr, MsgEntry *msg)
Handles/connects a new client from an unknown IP address.
void CheckLinkDead(void)
Checks for and deletes link dead clients.
bool SendMessageDelayed(MsgEntry *me, csTicks delay)
Queues the message for sending later, so the calling classes don't have to all manage this themselves...
void Run()
This is the main thread function.
virtual Connection * GetConnByNum(uint32_t clientnum)
Returns a NetManager::Connection from the given client number.
virtual void Multicast(MsgEntry *me, const csArray< PublishDestination > &multi, uint32_t except, float range)
Sends the given message me to all the clients in the list.
This class acts as a base for client/server net classes.
This class collects data of a netclient.
virtual bool SendMessage(MsgEntry *me)
Sends the given message to the client listed in the message.
Client * GetAnyClient(int cnum)
Gets a client with the specified id.
bool Initialize(CacheManager *cachemanager, int client_firstmsg, int npcclient_firstmsg, int timeout=15000)
Initialize the network thread.
ClientConnectionSet * GetConnections()
Gets a list of all connected clients.
This is the network thread handling packets sending/receiving to/from network other threads can regis...
This class manages the caching of data that is unchanging during server operation.
This class is a list of several CLient objects, it's designed for finding clients very fast based on ...
static NetManager * Create(CacheManager *cacheManager, int client_firstmsg, int npcclient_firstmsg, int timeout=15000)