Planeshift
|
This class is a list of several CLient objects, it's designed for finding clients very fast based on their clientnum or their IP address. More...
#include <clients.h>
Public Types | |
typedef csHash< Client *, SockAddress > | AddressHash |
Public Member Functions | |
Client * | Add (LPSOCKADDR_IN addr) |
ClientConnectionSet () | |
size_t | Count (void) const |
Count the number of clients connected, including superclients. | |
size_t | CountReadyPlayers () const |
Count the number of ready players connected. | |
Client * | Find (uint32_t id) |
Find by 32bit id value, used in UDP messages. Returns NULL if found but not ready. | |
Client * | Find (const char *name) |
Find by player name, used for Chat and other purposes. Returns NULL if found but not ready. | |
Client * | Find (LPSOCKADDR_IN addr) |
Find by IP addr and Port. | |
Client * | FindAccount (AccountID accountID, uint32_t excludeClient=0) |
Find by account id. | |
Client * | FindAny (uint32_t id) |
Find by 32bit id value, used in UDP messages, returns ready or not. | |
Client * | FindPlayer (PID playerID) |
Find by player id. | |
csRef< NetPacketQueueRefCount > | FindQueueAny (uint32_t id) |
bool | Initialize () |
void | MarkDelete (Client *client) |
void | SweepDelete () |
~ClientConnectionSet () | |
Protected Attributes | |
AddressHash | addrHash |
csHash< Client * > | hash |
CS::Threading::RecursiveMutex | mutex |
csPDelArray< Client > | toDelete |
This class is a list of several CLient objects, it's designed for finding clients very fast based on their clientnum or their IP address.
This class is also threadsafe now
typedef csHash<Client*, SockAddress> ClientConnectionSet::AddressHash |
ClientConnectionSet::ClientConnectionSet | ( | ) |
ClientConnectionSet::~ClientConnectionSet | ( | ) |
Client* ClientConnectionSet::Add | ( | LPSOCKADDR_IN | addr | ) |
size_t ClientConnectionSet::Count | ( | void | ) | const |
Count the number of clients connected, including superclients.
size_t ClientConnectionSet::CountReadyPlayers | ( | ) | const |
Count the number of ready players connected.
Client* ClientConnectionSet::Find | ( | uint32_t | id | ) |
Find by 32bit id value, used in UDP messages. Returns NULL if found but not ready.
Client* ClientConnectionSet::Find | ( | const char * | name | ) |
Find by player name, used for Chat and other purposes. Returns NULL if found but not ready.
Client* ClientConnectionSet::Find | ( | LPSOCKADDR_IN | addr | ) |
Find by IP addr and Port.
Client* ClientConnectionSet::FindAccount | ( | AccountID | accountID, |
uint32_t | excludeClient = 0 |
||
) |
Find by account id.
Client* ClientConnectionSet::FindAny | ( | uint32_t | id | ) |
Find by 32bit id value, used in UDP messages, returns ready or not.
Client* ClientConnectionSet::FindPlayer | ( | PID | playerID | ) |
Find by player id.
csRef<NetPacketQueueRefCount> ClientConnectionSet::FindQueueAny | ( | uint32_t | id | ) |
bool ClientConnectionSet::Initialize | ( | ) |
void ClientConnectionSet::MarkDelete | ( | Client * | client | ) |
void ClientConnectionSet::SweepDelete | ( | ) |
AddressHash ClientConnectionSet::addrHash [protected] |
csHash<Client*> ClientConnectionSet::hash [protected] |
CS::Threading::RecursiveMutex ClientConnectionSet::mutex [protected] |
csPDelArray<Client> ClientConnectionSet::toDelete [protected] |