Planeshift
|
This class collects data of a netclient. More...
#include <client.h>
Public Member Functions | |
void | AddDuelClient (uint32_t clientnum) |
void | AddPet (gemActor *pet) |
bool | AllowDisconnect () |
Permit the player to disconnect? Players cannot quit while in combat (includes spell casting). | |
void | AnnounceToDuelClients (gemActor *attacker, const char *event) |
void | ClearAllDuelClients () |
Client () | |
Please call constructor with the connection object produced by handleUnknownClient. | |
void | CountDetectedCheat () |
Give a warning to the client silently. Capped at 10000. | |
void | DecrementSpamPoints () |
bool | Disconnect () |
void | FloodControl (uint8_t chatType, const csString &newMessage, const csString &recipient) |
Warn or mute for chat spamming. | |
AccountID | GetAccountID () |
The account number for this client. | |
unsigned int | GetAccountTotalOnlineTime () |
gemActor * | GetActor () const |
const SOCKADDR_IN & | GetAddress () const |
bool | GetAdvisor () |
int | GetAdvisorPoints () |
int | GetAllianceID () |
the alliance id value if the player is member of a guild in an alliance | |
bool | GetBuddyListHide () |
MuteBuffable & | GetBuffableMute () |
psCharacter * | GetCharacterData () |
bool | GetCheatMask (CheatFlags mask) |
uint32_t | GetClientNum () const |
NetBase::Connection * | GetConnection () const |
unsigned int | GetDetectedCheatCount () |
int | GetDuelClient (int id) |
int | GetDuelClientCount () |
int | GetExchangeID () |
gemActor * | GetFamiliar () |
int | GetGuildID () |
The guild id value if player is member of guild. | |
csString | GetIPAddress () |
void | GetIPAddress (char *addrStr, socklen_t size) |
Return a string representing the ip address of this client. | |
csString | GetIPRange (int octets=3) |
bool | GetLastInviteResult () |
csTicks | GetLastInviteTime () |
csList< iSector * >::Iterator | GetLocationDisplaying () |
csString | GetMesh () const |
const char * | GetName () |
Get Client Name. | |
size_t | GetNumPets () |
OrderedMessageChannel * | GetOrderedMessageChannel (msgtype mtype) |
Get the channel to use for an ordered message. | |
csList< iSector * >::Iterator | GetPathDisplaying () |
gemActor * | GetPet (size_t index) |
PID | GetPID () |
The player number for this client. | |
int | GetSecurityLevel () const |
The security level of this player. | |
int | GetSelectedLocationID () |
int | GetSpamPoints () |
int | GetTargetClientID () |
Get the current selected target player. | |
gemObject * | GetTargetObject () const |
csList< iSector * >::Iterator | GetWaypointDisplaying () |
bool | HasBeenPenalized () |
bool | HasBeenWarned () |
void | IncrementAdvisorPoints (int n=1) |
void | IncrementSpamPoints () |
bool | Initialize (LPSOCKADDR_IN addr, uint32_t clientnum) |
bool | IsAdvisorBanned () |
bool | IsAlive () const |
Returns whether the client's character is alive. | |
bool | IsDuelClient (uint32_t clientnum) |
bool | IsGM () const |
bool | IsMute () |
bool | IsMyPet (gemActor *other) const |
Return if other is one of my pets. | |
bool | IsPlayerClient () |
bool | IsReady () |
bool | IsSuperClient () |
bool | IsZombie () |
A zombie client is a client that is prevented from disconnecting because of combat, spellcasting, or defeted. | |
void | LocationClearDisplaying () |
bool | LocationIsDisplaying () |
void | LocationSetIsDisplaying (iSector *sector) |
Online edit of location. | |
void | PathClearDisplaying () |
psPath * | PathGetPath () |
bool | PathIsDisplaying () |
void | PathSetIsDisplaying (iSector *sector) |
void | PathSetPath (psPath *path) |
void | RemoveDuelClient (Client *client) |
void | RemovePet (size_t index) |
void | SetAccountID (AccountID id) |
void | SetActor (gemActor *myactor) |
void | SetAdvisor (bool advisor) |
Set this client's advisor status. | |
void | SetAdvisorBan (bool ban) |
void | SetAdvisorPoints (int p) |
void | SetAllowedToDisconnect (bool allowed) |
Called from server side to set the allowedToDisconnect flag. | |
void | SetBuddyListHide (bool hide) |
Change whether hiding from buddylists. | |
void | SetCheatMask (CheatFlags mask, bool flag) |
Set the next move as not a cheat, or clear it. | |
void | SetExchangeID (int ID) |
void | SetFamiliar (gemActor *familiar) |
void | SetLastInviteResult (bool result) |
void | SetLastInviteTime (csTicks time) |
void | SetMesh (csString nextMesh) |
void | SetMute (bool flag) |
SetMute is the function that toggles the muted flag. | |
void | SetName (const char *n) |
Set the clients name. | |
void | SetPenalized (bool value) |
void | SetPID (PID id) |
void | SetReady (bool rdy) |
void | SetSecurityLevel (int level) |
void | SetSelectedLocationID (int id) |
void | SetSpamPoints (int points) |
void | SetSuperClient (bool flag) |
Allow distinguishing superclients from regular player clients. | |
void | SetTargetObject (gemObject *object, bool updateClientGUI=false) |
void | SetWarned () |
bool | ValidateDistanceToTarget (float range) |
Check if distance between client and target is within range. | |
void | WaypointClearDisplaying () |
int | WaypointGetNewPathIndex () |
int | WaypointGetPathIndex () |
csString & | WaypointGetPathName () |
bool | WaypointIsDisplaying () |
void | WaypointSetIsDisplaying (iSector *sector) |
void | WaypointSetPath (csString &path, int index) |
Online edit of paths. | |
bool | ZombieAllowDisconnect () |
Check if a zombie is allowed to disconnect. Called from the network thread so no access to server internal data should be made. | |
~Client () | |
Static Public Member Functions | |
static csString | GetIPRange (const char *ipaddr, int octets=3) |
static void | GetTargetTypeName (int32_t targetType, csString &targetDesc) |
Builds a list of target type names associated with a target type bitmap (formed by OR-ing TARGET_TYPES). | |
Public Attributes | |
csTicks | accumulatedLag |
For cheat detection. | |
csTicks | lastGlyphSend |
csTicks | lastInventorySend |
csRef< NetPacketQueueRefCount > | outqueue |
Protected Member Functions | |
void | SaveAccountData () |
Protected Attributes | |
AccountID | accountID |
gemActor * | actor |
Pointer to the gemActor object played by this client once a character is logged in and in-game. | |
int | advisorPoints |
bool | allowedToDisconnect |
Server set this flag when the player isn't casting spells, fighting or doing anythinge else that should prevent the player from disconnecting. | |
csArray< uint32_t > | duel_clients |
int | exchangeID |
Currently active id of Exchange object managed by Exchange Manager, or 0 if no exchange is active. | |
FloodBuffRow | floodHistory [floodMax] |
bool | hasBeenPenalized |
bool | hasBeenWarned |
bool | isAdvisor |
Store if this client is acting as an advisor. | |
bool | lastInviteResult |
csTicks | lastInviteTime |
csArray< gemNPC * > | listeningNpc |
csList< iSector * > | locationDisplaySectors |
csString | mesh |
MuteBuffable | mute |
mute flag | |
csString | name |
int | nextFloodHistoryIndex |
csHash< OrderedMessageChannel * > | orderedMessages |
This collection stores queues of ordered messages while we're waiting for an out of order one to arrive. | |
csList< iSector * > | pathDisplaySectors |
psPath * | pathPath |
csArray< PID > | pets |
PID | playerID |
bool | ready |
int | securityLevel |
int | selectedLocationID |
int | spamPoints |
bool | superclient |
csList< iSector * > | waypointDisplaySectors |
Sectors where client is doing online editing. | |
int | waypointPathIndex |
csString | waypointPathName |
bool | zombie |
A zombie client is a client where the player has disconnected, but still active due to not finished combat, spellcasting, or defeted. | |
csTicks | zombietimeout |
Static Protected Attributes | |
static const unsigned int | floodForgiveTime = 10000 |
How long to wait before forgiving a repeated message. | |
static const int | floodMax = 5 |
Mute client after 5 repeated messages. | |
static const int | floodWarn = 3 |
Warn client after 3 repeated messages. |
This class collects data of a netclient.
While the socket data like ip adress and port is managed inside NetManager and not stored here this is the object that will be saved in the ObjectManager and will get an Object ID
Client::Client | ( | ) |
Please call constructor with the connection object produced by handleUnknownClient.
Client::~Client | ( | ) |
void Client::AddDuelClient | ( | uint32_t | clientnum | ) |
void Client::AddPet | ( | gemActor * | pet | ) |
bool Client::AllowDisconnect | ( | ) |
Permit the player to disconnect? Players cannot quit while in combat (includes spell casting).
Also causes the client to be set as a zombie indicating that the server knows the connection has been broken.
void Client::AnnounceToDuelClients | ( | gemActor * | attacker, |
const char * | event | ||
) |
void Client::ClearAllDuelClients | ( | ) |
void Client::CountDetectedCheat | ( | ) | [inline] |
bool Client::Disconnect | ( | ) |
void Client::FloodControl | ( | uint8_t | chatType, |
const csString & | newMessage, | ||
const csString & | recipient | ||
) |
Warn or mute for chat spamming.
AccountID Client::GetAccountID | ( | ) | [inline] |
int Client::GetAllianceID | ( | ) |
the alliance id value if the player is member of a guild in an alliance
MuteBuffable& Client::GetBuffableMute | ( | ) | [inline] |
psCharacter* Client::GetCharacterData | ( | ) |
bool Client::GetCheatMask | ( | CheatFlags | mask | ) | [inline] |
NetBase::Connection* Client::GetConnection | ( | ) | const [inline] |
int Client::GetDuelClientCount | ( | ) |
gemActor* Client::GetFamiliar | ( | ) |
int Client::GetGuildID | ( | ) |
The guild id value if player is member of guild.
void Client::GetIPAddress | ( | char * | addrStr, |
socklen_t | size | ||
) |
Return a string representing the ip address of this client.
csString Client::GetIPAddress | ( | ) |
csString Client::GetIPRange | ( | int | octets = 3 | ) |
static csString Client::GetIPRange | ( | const char * | ipaddr, |
int | octets = 3 |
||
) | [static] |
csList<iSector*>::Iterator Client::GetLocationDisplaying | ( | ) |
const char* Client::GetName | ( | ) |
Get Client Name.
Returning the account name until a Character is connected to the client. When a Character is connected it will returnt the Character first name.
size_t Client::GetNumPets | ( | ) |
OrderedMessageChannel* Client::GetOrderedMessageChannel | ( | msgtype | mtype | ) |
Get the channel to use for an ordered message.
csList<iSector*>::Iterator Client::GetPathDisplaying | ( | ) |
gemActor* Client::GetPet | ( | size_t | index | ) |
PID Client::GetPID | ( | ) | [inline] |
int Client::GetSecurityLevel | ( | ) | const [inline] |
int Client::GetTargetClientID | ( | ) |
Get the current selected target player.
gemObject* Client::GetTargetObject | ( | ) | const |
static void Client::GetTargetTypeName | ( | int32_t | targetType, |
csString & | targetDesc | ||
) | [static] |
Builds a list of target type names associated with a target type bitmap (formed by OR-ing TARGET_TYPES).
targetType | A target type bitmap. |
targetDesc | [CHANGES] Gets filled in with a comma-separated list of target names. |
csList<iSector*>::Iterator Client::GetWaypointDisplaying | ( | ) |
bool Client::Initialize | ( | LPSOCKADDR_IN | addr, |
uint32_t | clientnum | ||
) |
bool Client::IsAdvisorBanned | ( | ) |
bool Client::IsAlive | ( | ) | const |
Returns whether the client's character is alive.
bool Client::IsDuelClient | ( | uint32_t | clientnum | ) |
bool Client::IsGM | ( | ) | const |
bool Client::IsMyPet | ( | gemActor * | other | ) | const |
Return if other is one of my pets.
bool Client::IsZombie | ( | ) | [inline] |
void Client::LocationClearDisplaying | ( | ) |
bool Client::LocationIsDisplaying | ( | ) |
void Client::LocationSetIsDisplaying | ( | iSector * | sector | ) |
Online edit of location.
void Client::PathClearDisplaying | ( | ) |
bool Client::PathIsDisplaying | ( | ) |
void Client::PathSetIsDisplaying | ( | iSector * | sector | ) |
void Client::RemoveDuelClient | ( | Client * | client | ) |
void Client::RemovePet | ( | size_t | index | ) |
void Client::SaveAccountData | ( | ) | [protected] |
void Client::SetActor | ( | gemActor * | myactor | ) |
void Client::SetAdvisor | ( | bool | advisor | ) | [inline] |
void Client::SetAdvisorBan | ( | bool | ban | ) |
void Client::SetAllowedToDisconnect | ( | bool | allowed | ) |
Called from server side to set the allowedToDisconnect flag.
This flagg will be read by the network thread to see if the client could be disconnected.
void Client::SetBuddyListHide | ( | bool | hide | ) | [inline] |
void Client::SetCheatMask | ( | CheatFlags | mask, |
bool | flag | ||
) |
Set the next move as not a cheat, or clear it.
void Client::SetFamiliar | ( | gemActor * | familiar | ) |
void Client::SetMute | ( | bool | flag | ) | [inline] |
void Client::SetName | ( | const char * | n | ) |
Set the clients name.
Use this to set the account name during loading. When a Character is loaded this call will have no effect anymore, since GetName than will use the character to get the name.
void Client::SetSuperClient | ( | bool | flag | ) | [inline] |
void Client::SetTargetObject | ( | gemObject * | object, |
bool | updateClientGUI = false |
||
) |
bool Client::ValidateDistanceToTarget | ( | float | range | ) |
Check if distance between client and target is within range.
void Client::WaypointClearDisplaying | ( | ) |
bool Client::WaypointIsDisplaying | ( | ) |
void Client::WaypointSetIsDisplaying | ( | iSector * | sector | ) |
void Client::WaypointSetPath | ( | csString & | path, |
int | index | ||
) | [inline] |
bool Client::ZombieAllowDisconnect | ( | ) |
Check if a zombie is allowed to disconnect. Called from the network thread so no access to server internal data should be made.
AccountID Client::accountID [protected] |
csTicks Client::accumulatedLag |
gemActor* Client::actor [protected] |
int Client::advisorPoints [protected] |
bool Client::allowedToDisconnect [protected] |
csArray<uint32_t> Client::duel_clients [protected] |
int Client::exchangeID [protected] |
const unsigned int Client::floodForgiveTime = 10000 [static, protected] |
FloodBuffRow Client::floodHistory[floodMax] [protected] |
const int Client::floodMax = 5 [static, protected] |
const int Client::floodWarn = 3 [static, protected] |
bool Client::hasBeenPenalized [protected] |
bool Client::hasBeenWarned [protected] |
bool Client::isAdvisor [protected] |
csTicks Client::lastGlyphSend |
csTicks Client::lastInventorySend |
bool Client::lastInviteResult [protected] |
csTicks Client::lastInviteTime [protected] |
csArray<gemNPC*> Client::listeningNpc [protected] |
csList<iSector*> Client::locationDisplaySectors [protected] |
csString Client::mesh [protected] |
MuteBuffable Client::mute [protected] |
csString Client::name [protected] |
int Client::nextFloodHistoryIndex [protected] |
csHash<OrderedMessageChannel*> Client::orderedMessages [protected] |
csList<iSector*> Client::pathDisplaySectors [protected] |
psPath* Client::pathPath [protected] |
csArray<PID> Client::pets [protected] |
PID Client::playerID [protected] |
bool Client::ready [protected] |
int Client::securityLevel [protected] |
int Client::selectedLocationID [protected] |
int Client::spamPoints [protected] |
bool Client::superclient [protected] |
csList<iSector*> Client::waypointDisplaySectors [protected] |
int Client::waypointPathIndex [protected] |
csString Client::waypointPathName [protected] |
bool Client::zombie [protected] |
csTicks Client::zombietimeout [protected] |