Pol  Rev 533
Client Class Reference

#include <client.h>

+ Inheritance diagram for Client:
+ Collaboration diagram for Client:

List of all members.

Public Types

enum  e_recv_states {
  RECV_STATE_CRYPTSEED_WAIT, RECV_STATE_MSGTYPE_WAIT, RECV_STATE_MSGLEN_WAIT, RECV_STATE_MSGDATA_WAIT,
  RECV_STATE_CLIENTVERSION_WAIT
}

Public Member Functions

 Client (ClientInterface &aInterface, TCryptInfo &encryption)
virtual ~Client ()
void closeConnection ()
bool compareVersion (const std::string &ver)
bool compareVersion (const VersionDetailStruct &ver2)
void Disconnect ()
void forceDisconnect ()
BStructgetclientinfo () const
const std::string & getversion () const
VersionDetailStruct getversiondetail () const
bool have_queued_data () const
std::string ipaddrAsString () const
bool isActive () const
bool isConnected () const
bool isReallyConnected () const
bool IsUOKRClient ()
void itemizeclientversion (const std::string &ver, VersionDetailStruct &detail)
BObjectImpmake_ref ()
void pause ()
void recv_remaining (int total_expected)
void recv_remaining_nocrypt (int total_expected)
void restart ()
void restart2 ()
void send_pause (bool bForce=false)
void send_queued_data ()
void send_restart (bool bForce=false)
void setclientinfo (const PKTIN_D9 *msg)
void setClientType (ClientTypeFlag type)
void setversion (const std::string &ver)
void setversiondetail (VersionDetailStruct &detail)
bool SpeedHackPrevention (bool add=true)
std::string status () const
void transmit (const void *data, int len, bool needslock=false)
void transmitmore (const void *data, int len)

Static Public Member Functions

static void Delete (Client *client)

Public Attributes

Accountacct
bool aosresist
unsigned char bufcheck1_AA
unsigned char bufcheck2_55
unsigned char buffer [MAXBUFFER]
unsigned int bytes_received
int checkpoint
Characterchr
u16 ClientType
CCryptBasecryptengine
SOCKET csocket
bool encrypt_server_stream
FILE * fpLog
ClientGameDatagd
unsigned int instance_
ClientInterfaceInterface
struct sockaddr ipaddr
unsigned char last_msgtype
unsigned short listen_port
unsigned int message_length
queue< PacketThrottlermovementqueue
u8 movementsequence
const MessageTypeFiltermsgtype_filter
wallclock_t next_movement
int pause_count
bool ready
enum Client::e_recv_states recv_state
int thread_pid
u16 UOExpansionFlag
u32 UOExpansionFlagClient
unsigned int bytes_transmitted

Static Public Attributes

static Mutex _SocketMutex
static unsigned int instance_counter_

Protected Member Functions

void queue_data (const void *data, unsigned short datalen)
void transmit_encrypted (const void *data, int len)
void xmit (const void *data, unsigned short datalen)

Protected Attributes

XmitBufferfirst_xmit_buffer
XmitBufferlast_xmit_buffer
int n_queued
int queued_bytes_counter

Private Member Functions

 Client (const Client &x)
Clientoperator= (const Client &x)
void PreDelete ()

Private Attributes

PKTIN_D9 clientinfo_
struct {
   unsigned int   bytes_received
   unsigned int   bytes_transmitted
counters
bool disconnect
bool paused_
bool preDisconnect
std::string version_
VersionDetailStruct versiondetail_

Friends

class GCCHelper

Detailed Description

Definition at line 106 of file client.h.


Member Enumeration Documentation

Enumerator:
RECV_STATE_CRYPTSEED_WAIT 
RECV_STATE_MSGTYPE_WAIT 
RECV_STATE_MSGLEN_WAIT 
RECV_STATE_MSGDATA_WAIT 
RECV_STATE_CLIENTVERSION_WAIT 

Definition at line 163 of file client.h.


Constructor & Destructor Documentation

Client::Client ( ClientInterface aInterface,
TCryptInfo &  encryption 
)
Client::~Client ( ) [virtual]

Definition at line 118 of file client.cpp.

Client::Client ( const Client x) [private]

Member Function Documentation

Definition at line 122 of file client.cpp.

References csocket, ClientInterface::deregister_client(), Interface, and INVALID_SOCKET.

Referenced by client_io_thread(), and PreDelete().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool Client::compareVersion ( const std::string &  ver)

Definition at line 307 of file client.cpp.

References itemizeclientversion().

Referenced by EClientRefObjImp::call_method_id(), handle_client_version(), handle_ef_seed(), UOExecutorModule::mf_SendGumpMenu(), and Character::script_method_id().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Definition at line 314 of file client.cpp.

References getversiondetail(), VersionDetailStruct::major, VersionDetailStruct::minor, VersionDetailStruct::patch, and VersionDetailStruct::rev.

+ Here is the call graph for this function:

void Client::Delete ( Client client) [static]

Definition at line 109 of file client.cpp.

References _SocketMutex, cryptengine, and PreDelete().

Referenced by KillClient().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

const std::string& Client::getversion ( ) const [inline]

Definition at line 134 of file client.h.

References version_.

Referenced by EClientRefObjImp::get_member_id(), and Character::get_script_member_id().

+ Here is the caller graph for this function:

bool Client::have_queued_data ( ) const [inline]

Definition at line 243 of file client.h.

References first_xmit_buffer.

Referenced by check_incoming_data(), client_io_thread(), and status().

+ Here is the caller graph for this function:

string Client::ipaddrAsString ( ) const

Definition at line 35 of file clientio.cpp.

References AddressToString(), and ipaddr.

Referenced by ClientCreateChar(), ClientCreateChar70160(), ClientCreateCharKR(), EClientRefObjImp::get_member_id(), Character::get_script_member_id(), handle_unknown_packet(), process_data(), and status().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool Client::isActive ( ) const [inline]

Definition at line 267 of file client.h.

References isConnected(), and ready.

Referenced by Character::has_active_client().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool Client::isReallyConnected ( ) const [inline]

Definition at line 256 of file client.h.

References disconnect.

Referenced by check_incoming_data(), client_io_thread(), ClientTransmitThread(), and kill_disconnected_clients().

+ Here is the caller graph for this function:

Definition at line 371 of file client.cpp.

References ClientType, CLIENTTYPE_7000, and CLIENTTYPE_UOKR.

Referenced by UOExecutorModule::mf_SendGumpMenu().

+ Here is the caller graph for this function:

void Client::itemizeclientversion ( const std::string &  ver,
VersionDetailStruct detail 
)

Definition at line 266 of file client.cpp.

References Log2(), VersionDetailStruct::major, VersionDetailStruct::minor, VersionDetailStruct::patch, and VersionDetailStruct::rev.

Referenced by compareVersion(), and handle_client_version().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Definition at line 673 of file client.cpp.

Referenced by CallOutgoingPacketExportedFunction(), ExportedPacketHookHandler(), and Character::get_script_member_id().

+ Here is the caller graph for this function:

Client& Client::operator= ( const Client x) [private]
void Client::queue_data ( const void *  data,
unsigned short  datalen 
) [protected]

Definition at line 398 of file client.cpp.

References XmitBuffer::data, disconnect, first_xmit_buffer, instance_, last_xmit_buffer, XmitBuffer::lenleft, Log(), n_queued, XmitBuffer::next, XmitBuffer::nsent, queued_bytes_counter, and THREAD_CHECKPOINT.

Referenced by xmit().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void Client::recv_remaining ( int  total_expected)

Definition at line 40 of file clientio.cpp.

References _SocketMutex, buffer, PolStats::bytes_received, bytes_received, ref_counted::count(), counters, cryptengine, csocket, disconnect, passert, polstats, CCryptBase::Receive(), SOCKET_ERRNO, and socket_errno.

Referenced by process_data().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void Client::recv_remaining_nocrypt ( int  total_expected)

Definition at line 70 of file clientio.cpp.

References _SocketMutex, buffer, PolStats::bytes_received, bytes_received, ref_counted::count(), counters, csocket, disconnect, polstats, SOCKET_ERRNO, and socket_errno.

Referenced by process_data().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void Client::restart2 ( )

Definition at line 620 of file client.cpp.

References pause_count, and send_restart().

Referenced by client_io_thread(), and restart_all_clients().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void Client::send_pause ( bool  bForce = false)

Definition at line 571 of file client.cpp.

References UoClientProtocol::EnableFlowControlPackets, PKTOUT_33::flow, MSGOPT_33_FLOW_PAUSE, PKTOUT_33::msgtype, pause_pre_encrypted, paused_, PKTOUT_33_ID, transmit(), uoclient_protocol, and xmit().

Referenced by handle_resync_request(), and pause().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Definition at line 505 of file client.cpp.

References _SocketMutex, PolStats::bytes_sent, counters, csocket, XmitBuffer::data, disconnect, first_xmit_buffer, instance_, last_xmit_buffer, XmitBuffer::lenleft, Log(), n_queued, XmitBuffer::next, XmitBuffer::nsent, polstats, queued_bytes_counter, and SOCKET_ERRNO.

Referenced by check_incoming_data(), and client_io_thread().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void Client::send_restart ( bool  bForce = false)

Definition at line 598 of file client.cpp.

References PKTOUT_33::flow, MSGOPT_33_FLOW_RESTART, PKTOUT_33::msgtype, paused_, PKTOUT_33_ID, restart_pre_encrypted, transmit(), and xmit().

Referenced by handle_resync_request(), and restart2().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void Client::setclientinfo ( const PKTIN_D9 msg) [inline]

Definition at line 143 of file client.h.

References clientinfo_.

Referenced by handle_D9().

+ Here is the caller graph for this function:

void Client::setversion ( const std::string &  ver) [inline]

Definition at line 133 of file client.h.

References version_.

Referenced by handle_client_version(), and handle_ef_seed().

+ Here is the caller graph for this function:

void Client::setversiondetail ( VersionDetailStruct detail) [inline]

Definition at line 136 of file client.h.

References versiondetail_.

Referenced by handle_client_version(), and handle_ef_seed().

+ Here is the caller graph for this function:

bool Client::SpeedHackPrevention ( bool  add = true)

Definition at line 628 of file client.cpp.

References buffer, Character::can_speedhack(), chr, disconnect, instance_, Log2(), movementqueue, next_movement, PacketThrottler::pktbuffer, PKTIN_02_ASYNCHRONOUS, PKTIN_02_SIZE, wallclock(), and wallclock_diff_ms().

Referenced by client_io_thread(), and process_data().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

std::string Client::status ( ) const

Definition at line 376 of file client.cpp.

References acct, checkpoint, chr, decint(), disconnect, have_queued_data(), hexint(), ipaddrAsString(), last_msgtype, Account::name(), UObject::name(), paused_, ready, and thread_pid.

+ Here is the call graph for this function:

void Client::transmit ( const void *  data,
int  len,
bool  needslock = false 
)
void Client::transmit_encrypted ( const void *  data,
int  len 
) [protected]
void Client::transmitmore ( const void *  data,
int  len 
)

Definition at line 262 of file clientio.cpp.

References encrypt_server_stream, fdump(), fpLog, pause(), transmit_encrypted(), and xmit().

+ Here is the call graph for this function:

void Client::xmit ( const void *  data,
unsigned short  datalen 
) [protected]

Definition at line 437 of file client.cpp.

References PolStats::bytes_sent, counters, cryptengine, csocket, disconnect, CCryptBase::Encrypt(), encrypt_server_stream, instance_, INVALID_SOCKET, last_xmit_buffer, Log(), polstats, queue_data(), SOCKET_ERRNO, socket_errno, and THREAD_CHECKPOINT.

Referenced by send_pause(), send_restart(), transmit(), transmit_encrypted(), and transmitmore().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:


Friends And Related Function Documentation

friend class GCCHelper [friend]

Definition at line 111 of file client.h.


Member Data Documentation

Definition at line 160 of file client.h.

Referenced by UoClientThread::run(), and send_full_statmsg().

unsigned char Client::bufcheck1_AA

Definition at line 171 of file client.h.

Referenced by process_data().

unsigned char Client::bufcheck2_55

Definition at line 173 of file client.h.

Referenced by process_data().

Definition at line 231 of file client.h.

Definition at line 147 of file client.h.

Referenced by add_item_to_stack(), UOClientInterface::bcast_vital_changed(), UDoor::builtin_on_use(), buyhandler(), BPacket::call_method_id(), CallOutgoingPacketExportedFunction(), cancel_all_trades(), CanUseSkill(), char_select(), character_race_changer_handler(), Character::check_justice_region_change(), check_weather_change(), client_io_thread(), ClientCreateChar(), ClientCreateChar70160(), ClientCreateCharKR(), clientHasCharacter(), do_cast(), do_open_trade_window(), do_place_item_in_secure_trade_container(), Spellbook::double_click(), Item::double_click(), doubleclick(), drop_item(), drop_item_on_ground(), drop_item_on_mobile(), drop_item_on_object(), drop_item_v2(), equip_item(), ExportedPacketHookHandler(), ext_stats_in(), get_item(), gumpbutton_handler(), handle_accept_invite(), handle_action(), handle_add(), handle_allnames(), handle_attack(), handle_char_profile_request(), handle_client_version(), handle_decline_invite(), handle_help(), handle_loot_perm(), handle_map_pin(), handle_member_msg(), handle_menu_selection(), handle_mode_set(), handle_msg_BF(), handle_open_spellbook(), handle_party_msg(), handle_processed_speech(), handle_remove(), handle_rename_char(), handle_request_tooltip(), handle_resurrect_menu(), handle_resync_request(), handle_secure_trade_msg(), handle_selcolor(), handle_skill_lock(), handle_target_cursor(), handle_textentry(), handle_walk(), EClientRefObjImp::isEqual(), menu_selection_made(), UOExecutorModule::mf_SendOverallSeason(), move_boat_item(), move_item(), oldBuyHandler(), oldSellHandler(), Character::on_aos_ext_stat_changed(), Character::on_color_changed(), Character::on_death(), Character::on_facing_changed(), Character::on_poison_changed(), OnChatButton(), OnGuildButton(), OnQuestButton(), open_book_handler(), open_trade_window(), place_item(), place_item_in_container(), place_item_in_secure_trade_container(), play_moving_effect(), play_moving_effect2(), play_moving_effect2_ex(), play_moving_effect_ex(), play_sound_effect_xyz(), play_stationary_effect(), play_stationary_effect_ex(), PreDelete(), process_command(), PropagateMove(), read_book_page_handler(), remove_objects_inrange(), Character::resurrect(), NPCExecutorModule::say(), NPCExecutorModule::SayUC(), sellhandler(), send_boat_to_inrange(), send_char_data(), send_char_if_newly_inrange(), send_client_char_data(), send_container_contents(), LosCheckedCoordCursor::send_coord_cursor(), send_create_ghost(), send_create_mobile_if_nearby_cansee(), send_death_message(), send_fight_occuring(), send_inrange_items(), send_inrange_multis(), send_item(), send_item_if_newly_inrange(), send_item_to_inrange(), send_mana_level(), send_move(), send_move_if_inrange(), send_move_if_inrange2(), send_move_mobile_if_nearby_cansee(), send_multi_if_newly_inrange(), send_multi_to_inrange(), send_nametext(), send_new_subserver(), send_object_cache_to_inrange(), TargetCursor::send_object_cursor(), send_objects_newly_inrange(), send_owncreate(), send_paperdoll(), MultiPlacementCursor::send_placemulti(), send_put_in_container_to_inrange(), send_remove_character(), send_remove_character_if_nearby(), send_remove_character_if_nearby_cansee(), send_remove_character_if_nearby_cantsee(), send_remove_character_to_nearby(), send_remove_character_to_nearby_cansee(), send_remove_character_to_nearby_cantsee(), send_remove_if_hidden_ghost(), send_remove_object_if_inrange(), send_remove_object_to_inrange(), send_season_info(), send_short_statmsg(), send_stamina_level(), send_startup(), SendUnicodeSpeech(), Character::setgraphic(), SetRegionLightLevel(), singleclick(), skillrequest(), SpeedHackPrevention(), srequest(), start_client_char(), start_textcmd_script(), StartSkillScript(), statrequest(), status(), textcmd_flag1(), textcmd_flag2(), textcmd_listarmor(), textcmd_resendchars(), textcmd_singlezone_integ_item(), textcmd_startlog(), textcmd_stoplog(), transmit_to_inrange(), transmit_to_others_inrange(), UnicodeSpeechHandler(), update_lightregion(), update_weatherregion(), and Character::~Character().

Definition at line 235 of file client.h.

Referenced by Client(), getclientinfo(), and setclientinfo().

Definition at line 181 of file client.h.

Referenced by login2(), transmit(), transmitmore(), and xmit().

Definition at line 204 of file client.h.

Referenced by have_queued_data(), PreDelete(), queue_data(), and send_queued_data().

Definition at line 216 of file client.h.

Referenced by buyhandler(), char_select(), Character::check_justice_region_change(), Character::check_light_region_change(), Character::check_music_region_change(), Character::check_weather_region_change(), clear_gumphandler(), client_io_thread(), CustomHouseStopEditing(), Character::CustomHousingMove(), UHouse::FindWorkingHouse(), gumpbutton_handler(), handle_attack(), handle_coord_cursor(), handle_prompt(), handle_resurrect_menu(), handle_script_cursor(), handle_selcolor(), TargetCursor::handle_target_cursor(), handle_textentry(), handle_unicode_prompt(), Character::has_active_gump(), Character::has_active_prompt(), UOExecutorModule::internal_SendCompressedGumpMenu(), UOExecutorModule::internal_SendUnCompressedGumpMenu(), Character::is_house_editing(), menu_selection_made(), UOExecutorModule::mf_CloseGump(), UOExecutorModule::mf_GetRegionName(), UOExecutorModule::mf_PromptInput(), UnicodeExecutorModule::mf_RequestInputUC(), UOExecutorModule::mf_SelectColor(), UOExecutorModule::mf_SelectMenuItem(), UOExecutorModule::mf_SendBuyWindow(), UOExecutorModule::mf_SendHousingTool(), UOExecutorModule::mf_SendInstaResDialog(), UOExecutorModule::mf_SendSellWindow(), UOExecutorModule::mf_SendTextEntryGump(), UOExecutorModule::mf_Target(), UOExecutorModule::mf_TargetCoordinates(), UOExecutorModule::mf_TargetMultiPlacement(), move_character_to(), oldBuyHandler(), oldSellHandler(), PreDelete(), JusticeRegion::RunNoCombatCheck(), UHouse::script_method_id(), sellhandler(), send_season_info(), SetRegionLightLevel(), start_client_char(), Character::target_cursor_busy(), update_weatherregion(), Realm::walkheight(), UnicodeExecutorModule::~UnicodeExecutorModule(), and UOExecutorModule::~UOExecutorModule().

unsigned int Client::instance_counter_ [static]

Definition at line 218 of file client.h.

unsigned char Client::last_msgtype

Definition at line 220 of file client.h.

Referenced by process_data(), and status().

Definition at line 205 of file client.h.

Referenced by PreDelete(), queue_data(), send_queued_data(), transmit(), and xmit().

unsigned short Client::listen_port

Definition at line 159 of file client.h.

Referenced by UoClientThread::run(), and select_server().

unsigned int Client::message_length

Definition at line 175 of file client.h.

Referenced by process_data().

Definition at line 225 of file client.h.

Referenced by client_io_thread(), and SpeedHackPrevention().

Definition at line 227 of file client.h.

Referenced by handle_walk().

int Client::n_queued [protected]

Definition at line 206 of file client.h.

Referenced by PreDelete(), queue_data(), and send_queued_data().

Definition at line 226 of file client.h.

Referenced by handle_walk(), and SpeedHackPrevention().

Definition at line 195 of file client.h.

Referenced by client_io_thread(), pause(), restart2(), and restart_all_clients().

bool Client::paused_ [private]

Definition at line 236 of file client.h.

Referenced by send_pause(), send_restart(), and status().

bool Client::preDisconnect [private]

Definition at line 116 of file client.h.

Referenced by Disconnect(), and isConnected().

Definition at line 207 of file client.h.

Referenced by queue_data(), and send_queued_data().

Definition at line 150 of file client.h.

Referenced by UOClientInterface::bcast_vital_changed(), broadcast(), BPacket::call_method_id(), cancel_all_trades(), char_select(), check_weather_change(), PrivUpdater::disable_invul(), PrivUpdater::enable_invul(), handle_processed_speech(), isActive(), move_boat_item(), move_item(), PrivUpdater::on_change_invul(), PrivUpdater::on_change_see_ghosts(), PrivUpdater::on_change_see_hidden(), PrivUpdater::on_change_see_invis_items(), play_moving_effect(), play_moving_effect2(), play_moving_effect2_ex(), play_moving_effect_ex(), play_sound_effect_xyz(), play_stationary_effect(), play_stationary_effect_ex(), PropagateMove(), NPCExecutorModule::say(), NPCExecutorModule::SayUC(), send_boat_to_inrange(), send_char_data(), send_create_mobile_if_nearby_cansee(), send_death_message(), send_item_to_inrange(), send_move_if_inrange(), send_move_if_inrange2(), send_move_mobile_if_nearby_cansee(), send_multi_to_inrange(), send_object_cache_to_inrange(), send_put_in_container_to_inrange(), send_remove_character(), send_remove_character_if_nearby(), send_remove_character_if_nearby_cansee(), send_remove_character_if_nearby_cantsee(), send_remove_character_to_nearby(), send_remove_character_to_nearby_cansee(), send_remove_character_to_nearby_cantsee(), send_remove_object_if_inrange(), send_remove_object_to_inrange(), send_update_hits_to_inrange(), SendUnicodeSpeech(), SetRegionLightLevel(), start_client_char(), status(), ClientInterface::tell_attribute_changed(), ClientInterface::tell_vital_changed(), transmit_to_inrange(), transmit_to_others_inrange(), update_lightregion(), and update_weatherregion().

Definition at line 221 of file client.h.

Referenced by listen_thread(), and status().

std::string Client::version_ [private]

Definition at line 234 of file client.h.

Referenced by getversion(), and setversion().

Definition at line 237 of file client.h.

Referenced by Client(), getversiondetail(), and setversiondetail().


The documentation for this class was generated from the following files: