EvEmu  0.8.4
11 September 2021
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Client Class Reference

#include "Client.h"

Inheritance diagram for Client:
Collaboration diagram for Client:

Public Member Functions

 Client (PyServiceMgr &services, EVETCPConnection **con)
 
 Client (const Client &oth)=delete
 
 Client (Client &&oth)=delete
 
Clientoperator= (const Client &oth)=delete
 
Clientoperator= (Client &&oth)=delete
 
 ~Client ()
 
bool ProcessNet ()
 
void ProcessClient ()
 
bool IsLoaded ()
 
PyServiceMgrservices () const
 
SystemManagerSystemMgr () const
 
const char * GetName () const
 
bool IsAFK ()
 
void SetAFK (bool set=true)
 
bool IsValidSession ()
 
ClientSessionGetSession ()
 
std::string GetAddress () const
 
std::string GetLanguageID () const
 
int32 GetUserID () const
 
int32 GetAccountType () const
 
int32 GetCharacterID () const
 
int32 GetStationID () const
 
int32 GetStationID2 () const
 
int32 GetCloneStationID () const
 
int64 GetAccountRole () const
 
int64 GetClientID () const
 
double GetCorpTaxRate ()
 
int32 GetCorporationID () const
 
int32 GetCorpHQ () const
 
int32 GetAllianceID () const
 
int32 GetWarFactionID () const
 
int32 GetCorpAccountKey () const
 
int64 GetCorpRole () const
 
int64 GetRolesAtAll () const
 
int64 GetRolesAtBase () const
 
int64 GetRolesAtHQ () const
 
int64 GetRolesAtOther () const
 
int8 GetFleetRole ()
 
bool InFleet ()
 
bool IsFleetBoss ()
 
bool IsFleetBooster ()
 
uint32 GetFleetID () const
 
int32 GetWingID () const
 
int32 GetSquadID () const
 
uint32 GetShipID () const
 
uint32 GetLocationID () const
 
uint32 GetSystemID () const
 
uint32 GetConstellationID () const
 
uint32 GetRegionID () const
 
std::string GetSystemName () const
 
void UpdateCorpSession (CorpData &data)
 
void UpdateFleetSession (CharFleetData &fleet)
 
uint32 GetLoyaltyPoints (uint32 corpID)
 
void SetChar (CharacterRef charRef)
 
CharacterRef GetChar () const
 
std::string GetCharName ()
 
uint32 GetCharID ()
 
ShipItemRef GetShip () const
 
ShipSEGetShipSE ()
 
ShipItemRef GetPod () const
 
uint32 GetPodID () const
 
float GetBounty () const
 
float GetSecurityRating () const
 
bool AddBalance (float amount, uint8 type=Account::CreditType::ISK)
 
float GetBalance (uint8 type=Account::CreditType::ISK)
 
void SetPodItem ()
 
void CreateShipSE ()
 
void SetShip (ShipItemRef shipRef)
 
void CreateNewPod ()
 
void UndockFromStation ()
 
void DockToStation ()
 
void PickAlternateShip ()
 
void ResetAfterPodded ()
 
void ResetAfterPopped (GPoint &position)
 
void Eject ()
 
void Board (ShipSE *newShipSE)
 
void BoardShip (ShipItemRef newShipRef)
 
bool SelectCharacter (int32 char_id=0)
 
bool IsHangarLoaded (uint32 stationID)
 
void WarpIn ()
 
void WarpOut ()
 
void EnterSystem (uint32 systemID)
 
void MoveToLocation (uint32 location, const GPoint &pt)
 
void MoveToPosition (const GPoint &pt)
 
void MoveItem (uint32 itemID, uint32 location, EVEItemFlags flag)
 
void SetCloakTimer (uint32 time=Player::Timer::Default)
 
void SetInvulTimer (uint32 time=Player::Timer::Default)
 
void SetUncloakTimer (uint32 time=Player::Timer::Default)
 
void SetBallParkTimer (uint32 time=Player::Timer::Default)
 
void SetStateTimer (int8 state, uint32 time=Player::Timer::Default)
 
void SetDestiny (const GPoint &pt, bool update=false)
 
ShipItemRef SpawnNewRookieShip (uint32 stationID)
 
void LoadStationHangar (uint32 stationID)
 
void AddStationHangar (uint32 stationID)
 
void RemoveStationHangar (uint32 stationID)
 
void SetDockStationID (uint32 stationID)
 
void SetDockPoint (GPoint &pt)
 
uint32 GetDockStationID ()
 
GPoint GetDockPoint ()
 
bool InPod ()
 
bool IsInSpace ()
 
bool IsDocked ()
 
bool IsDock ()
 
bool IsIdle ()
 
bool IsJump ()
 
bool IsBoard ()
 
bool IsInvul ()
 
bool IsLogin ()
 
bool IsUndock ()
 
bool IsUncloak ()
 
bool HasBeyonce ()
 
bool IsBubbleWait ()
 
bool IsSetStateSent ()
 
bool IsSessionChange ()
 
uint32 GetSessionChangeTime ()
 
void SetInvul (bool invul=false)
 
void SetUndock (bool undock=false)
 
void SetBeyonce (bool beyonce=false)
 
void SetUncloak (bool uncloak=false)
 
void SetBubbleWait (bool wait=false)
 
void SetStateSent (bool set=false)
 
void SetSessionTimer ()
 
void SetSessionChange (bool set=false)
 
void SetBallPark ()
 
void StargateJump (uint32 fromGate, uint32 toGate)
 
void CynoJump (InventoryItemRef beacon)
 
bool IsAutoPilot ()
 
void SetAutoPilot (bool set=false)
 
void JumpInEffect ()
 
void JumpOutEffect (uint32 locationID)
 
void CheckBallparkTimer ()
 
bool IsJetcanAvalible ()
 
uint32 JetcanTime ()
 
void StartJetcanTimer ()
 
void SetShowAll (bool set=false)
 
bool IsShowall ()
 
void SetAutoStop (bool set=false)
 
bool AutoStop ()
 
void SendErrorMsg (const char *fmt,...)
 
void SendErrorMsg (const char *fmt, va_list args)
 
void SendNotifyMsg (const char *fmt,...)
 
void SendNotifyMsg (const char *fmt, va_list args)
 
void SendInfoModalMsg (const char *fmt,...)
 
void SelfChatMessage (const char *fmt,...)
 
void SelfEveMail (const char *subject, const char *fmt,...)
 
void ChannelJoined (LSCChannel *chan)
 
void ChannelLeft (LSCChannel *chan)
 
void UpdateSessionInt (const char *sessionType, int value)
 
PyRepGetAggressors () const
 
void QueueDestinyUpdate (PyTuple **update, bool DoPackage=false, bool IsSetState=false)
 
void QueueDestinyEvent (PyTuple **multiEvent)
 
void FlushQueue ()
 
void RemoveMissionItem (uint16 typeID, uint32 qty)
 
bool ContainsTypeQty (uint16 typeID, uint32 qty) const
 
bool IsMissionComplete (MissionOffer &data)
 
Scanscan ()
 
void SetScan (Scan *pScan)
 
void SetScanTimer (uint16 time, bool useProbe=false)
 
void SetTradeSession (TradeSession *ts)
 
void ClearTradeSession ()
 
TradeSessionGetTradeSession ()
 
void CharNowInStation ()
 
void CharNoLongerInStation ()
 
bool RecPic ()
 
void SetPicRec (bool set=false)
 
void DisconnectClient ()
 
void BanClient ()
 
void InitSession (int32 characterID)
 
void SetTrainingEndTime (int64 endTime)
 
void SendSessionChange ()
 
void SendNotification (const PyAddress &dest, EVENotificationStream &noti, bool seq=true)
 
void SendNotification (const char *notifyType, const char *idType, PyTuple *payload, bool seq=true)
 
void SendNotification (const char *notifyType, const char *idType, PyTuple **payload, bool seq=true)
 
bool CanThrow ()
 
bool IsCharCreation ()
 
void CreateChar (bool set)
 
void AddBindID (uint32 bindID)
 

Protected Member Functions

void ExecuteJump ()
 
void ExecuteDriveJump ()
 
void DestroyShipSE ()
 
void _GetVersion (VersionExchangeServer &version)
 Obtains version. More...
 
uint32 GetUserCount ()
 
uint32 _GetQueuePosition ()
 
bool _LoginFail (std::string fail_msg)
 
bool _VerifyVersion (VersionExchangeClient &version)
 Verifies version. More...
 
bool _VerifyCrypto (CryptoRequestPacket &cr)
 Verifies crypto. More...
 
bool _VerifyLogin (CryptoChallengePacket &ccp)
 Verifies login. More...
 
bool _VerifyVIPKey (const std::string &vipKey)
 Verifies VIP key. More...
 
bool _VerifyFuncResult (CryptoHandshakeResult &result)
 Verifies function result. More...
 
void SendInitialSessionStatus ()
 
void UpdateSession ()
 
void _SendPingRequest ()
 
void _SendException (const PyAddress &source, int64 callID, MACHONETMSG_TYPE in_response_to, MACHONETERR_TYPE exception_type, PyRep **payload)
 
void _SendCallReturn (const PyAddress &source, int64 callID, PyResult &rsp)
 
void _SendPingResponse (const PyAddress &source, int64 callID)
 
bool Handle_CallReq (PyPacket *packet, PyCallStream &req)
 
bool Handle_Notify (PyPacket *packet)
 
bool Handle_PingReq (PyPacket *packet)
 
bool Handle_PingRsp (PyPacket *packet)
 
 EVEClientSession (EVETCPConnection **n)
 
virtual ~EVEClientSession ()
 Destroys contained connection. More...
 
state_t GetState () const
 
std::string GetAddress () const
 
void Reset ()
 Resets session. More...
 
void QueuePacket (PyPacket *packet)
 Queues new packet, retaking ownership. More...
 
PyPacketPopPacket ()
 Pops new packet from queue. More...
 
void CloseClientConnection ()
 Disconnects client from the server. More...
 
- Protected Member Functions inherited from EVEPacketDispatcher
virtual bool Handle_AuthenticationReq (PyPacket *packet, AuthenticationReq &req)
 
virtual bool Handle_AuthenticationRsp (PyPacket *packet, AuthenticationRsp &rsp)
 
virtual bool Handle_CallRsp (PyPacket *packet)
 
virtual bool Handle_ErrorResponse (PyPacket *packet, ErrorResponse &error)
 
virtual bool Handle_SessionChange (PyPacket *packet, SessionChangeNotification &sessionChange)
 
virtual bool Handle_Other (PyPacket *packet)
 
bool DispatchPacket (PyPacket *packet)
 

Protected Attributes

Scanm_scan
 
ServiceDB m_sDB
 
SystemData m_SystemData
 
ShipItemRef m_ship
 
ShipItemRef m_pod
 
StationData m_StationData
 
CharacterRef m_char
 
PyServiceMgrm_services
 
SystemGPoint m_SGP
 
ShipSEpShipSE
 
TradeSessionm_TS
 
ClientSessionpSession
 
SystemManagerm_system
 
bool m_afk
 
bool m_invul
 
bool m_login
 
bool m_undock
 
bool m_loaded
 
bool m_beyonce
 
bool m_uncloak
 
bool m_showall
 
bool m_autoStop
 
bool m_packaged
 
bool m_portrait
 
bool m_autoPilot
 
bool m_scanProbe
 
bool m_bubbleWait
 
bool m_setStateSent
 
bool m_sessionChangeActive
 
int32 m_wing
 
int32 m_squad
 
uint32 m_fleet
 
uint32 m_shipId
 
uint32 m_locationID
 
uint32 m_moveSystemID
 
uint32 m_dockStationID
 
Timer m_stateTimer
 
Timer m_pingTimer
 
Timer m_scanTimer
 
Timer m_cloakTimer
 
Timer m_uncloakTimer
 
Timer m_invulTimer
 
Timer m_fleetTimer
 
Timer m_clientTimer
 
Timer m_jetcanTimer
 
Timer m_logoutTimer
 
Timer m_sessionTimer
 
Timer m_ballparkTimer
 
GPoint m_movePoint
 
GPoint m_dockPoint
 
std::set< LSCChannel * > m_channels
 
std::map< uint32, bool > m_hangarLoaded
 
int64 m_skillTimer
 
int8 m_clientState
 
- Protected Attributes inherited from EVEClientSession
EVETCPConnection *const mNet
 

Private Member Functions

void UpdateNewShip ()
 
void CheckShipRef (ShipItemRef newShipRef)
 
void _SendQueuedUpdates ()
 
std::string GetStateName (int8 state)
 

Private Attributes

bool m_canThrow
 
bool m_validSession
 
bool m_charCreation
 
std::set< uint32m_bindSet
 
PyListm_destinyEventQueue
 
PyListm_destinyUpdateQueue
 
uint32 m_nextNotifySequence
 
std::map< uint32, uint32m_lpMap
 

Additional Inherited Members

- Protected Types inherited from EVEClientSession
typedef TCPConnection::state_t state_t
 

Detailed Description

Definition at line 66 of file Client.h.

Constructor & Destructor Documentation

Client::Client ( PyServiceMgr services,
EVETCPConnection **  con 
)

Definition at line 59 of file Client.cpp.

References m_afk, m_autoPilot, m_autoStop, m_beyonce, m_bubbleWait, m_canThrow, m_channels, m_charCreation, m_dockStationID, m_fleet, m_hangarLoaded, m_invul, m_loaded, m_locationID, m_login, m_lpMap, m_moveSystemID, m_packaged, m_pod, m_portrait, m_sessionChangeActive, m_setStateSent, m_ship, m_showall, m_skillTimer, m_squad, m_StationData, m_SystemData, m_uncloak, m_undock, m_validSession, m_wing, and EVEClientSession::Reset().

60 : EVEClientSession(con),
61  m_TS(nullptr),
62  m_char(CharacterRef(nullptr)),
63  m_scan(nullptr),
64  pShipSE(nullptr),
65  pSession(new ClientSession()),
66  m_system(nullptr),
67  m_services(services),
70  m_stateTimer(0),
71  m_ballparkTimer(0),
73  m_scanTimer(0),
74  m_cloakTimer(0),
75  m_fleetTimer(0),
76  m_invulTimer(0),
77  m_clientTimer(0),
78  m_logoutTimer(0),
79  m_jetcanTimer(0),
80  m_sessionTimer(0),
81  m_uncloakTimer(0),
85 {
86  m_pod = ShipItemRef(nullptr);
87  m_ship = ShipItemRef(nullptr);
88 
91 
92  m_afk = false;
93  m_login = true;
94  m_invul = true;
95  m_wing = false;
96  m_fleet = false;
97  m_squad = false;
98  m_loaded = false;
99  m_undock = false;
100  m_showall = false;
101  m_uncloak = false;
102  m_beyonce = false;
103  m_autoStop = false;
104  m_canThrow = false;
105  m_packaged = false;
106  m_portrait = false;
107  m_autoPilot = false;
108  m_bubbleWait = false; // allow client processing of subsquent destiny msgs
109  m_charCreation = false;
110  m_setStateSent = false;
111  m_validSession = false;
112  m_sessionChangeActive = false;
113 
114  //m_toGate = 0;
115  m_locationID = 0;
116  m_moveSystemID = 0;
117  m_skillTimer = 0;
118  m_dockStationID = 0;
119 
120  m_lpMap.clear();
121  m_channels.clear();
122  m_hangarLoaded.clear();
123 
124  // Start handshake
125  Reset();
126 }
bool m_setStateSent
Definition: Client.h:368
void Reset()
Resets session.
Definition: EVESession.cpp:50
SystemData m_SystemData
Definition: Client.h:336
bool m_showall
Definition: Client.h:361
std::map< uint32, bool > m_hangarLoaded
Definition: Client.h:398
uint32 m_nextNotifySequence
Definition: Client.h:464
bool m_uncloak
Definition: Client.h:360
bool m_canThrow
Definition: Client.h:439
CharacterRef m_char
Definition: Client.h:340
int32 m_wing
Definition: Client.h:371
bool m_loaded
Definition: Client.h:358
bool m_portrait
Definition: Client.h:364
PyList * m_destinyEventQueue
Definition: Client.h:460
bool m_autoPilot
Definition: Client.h:365
uint32 m_moveSystemID
Definition: Client.h:378
Timer m_ballparkTimer
Definition: Client.h:392
bool m_undock
Definition: Client.h:357
bool m_sessionChangeActive
Definition: Client.h:369
bool m_charCreation
Definition: Client.h:441
RefPtr< Character > CharacterRef
Definition: ItemRef.h:63
Timer m_logoutTimer
Definition: Client.h:390
Timer m_sessionTimer
Definition: Client.h:391
std::set< LSCChannel * > m_channels
Definition: Client.h:397
uint32 m_locationID
Definition: Client.h:377
Timer m_clientTimer
Definition: Client.h:388
Timer m_uncloakTimer
Definition: Client.h:385
GPoint m_movePoint
Definition: Client.h:394
Value keeper for single EVE session.
Definition: ClientSession.h:37
bool m_autoStop
Definition: Client.h:362
Timer m_cloakTimer
Definition: Client.h:384
bool m_afk
Definition: Client.h:354
bool m_validSession
Definition: Client.h:440
std::map< uint32, uint32 > m_lpMap
Definition: Client.h:466
static const GPoint NULL_ORIGIN(0, 0, 0)
PyList * m_destinyUpdateQueue
Definition: Client.h:461
bool m_bubbleWait
Definition: Client.h:367
PyServiceMgr & m_services
Definition: Client.h:341
ShipItemRef m_pod
Definition: Client.h:338
ShipItemRef m_ship
Definition: Client.h:337
int32 m_squad
Definition: Client.h:372
bool m_packaged
Definition: Client.h:363
Timer m_stateTimer
Definition: Client.h:381
RefPtr< ShipItem > ShipItemRef
Definition: ItemRef.h:54
Timer m_scanTimer
Definition: Client.h:383
Timer m_invulTimer
Definition: Client.h:386
ShipSE * pShipSE
Definition: Client.h:343
SystemManager * m_system
Definition: Client.h:346
Timer m_jetcanTimer
Definition: Client.h:389
uint32 m_dockStationID
Definition: Client.h:379
EVEClientSession(EVETCPConnection **n)
Definition: EVESession.cpp:38
StationData m_StationData
Definition: Client.h:339
Timer m_pingTimer
Definition: Client.h:382
bool m_login
Definition: Client.h:356
TradeSession * m_TS
Definition: Client.h:344
bool m_beyonce
Definition: Client.h:359
ClientSession * pSession
Definition: Client.h:345
Scan * m_scan
Definition: Client.h:334
int64 m_skillTimer
Definition: Client.h:400
Python list.
Definition: PyRep.h:639
Timer m_fleetTimer
Definition: Client.h:387
uint32 m_fleet
Definition: Client.h:374
int8 m_clientState
Definition: Client.h:402
bool m_invul
Definition: Client.h:355
static const uint32 PING_INTERVAL_MS
Definition: Client.cpp:57

Here is the call graph for this function:

Client::Client ( const Client oth)
delete
Client::Client ( Client &&  oth)
delete
Client::~Client ( )
Todo:
need to separate Player from Client before these can be implemented.... not sure if these are used....may have to finish Client::Client(const Client& oth) :m_TS(oth.m_TS), m_scan(oth.m_scan), pShipSE(oth.pShipSE), pSession(oth.pSession), m_system(oth.SystemMgr()), m_services(oth.services()), m_movePoint(NULL_ORIGIN), m_clientState(Player::State::Idle), m_stateTimer(0), m_ballparkTimer(0), m_pingTimer(PING_INTERVAL_MS), m_scanTimer(0), m_cloakTimer(0), m_fleetTimer(0), m_invulTimer(0), m_clientTimer(0), m_logoutTimer(0), m_jetcanTimer(0), m_sessionTimer(0), m_uncloakTimer(0), m_destinyEventQueue(new PyList()), m_destinyUpdateQueue(new PyList()), m_nextNotifySequence(0) { m_pod = ShipItemRef(nullptr); m_ship = ShipItemRef(nullptr);
m_afk = false;
m_login = true;
m_invul = true;
m_wing = false;
m_fleet = false;
m_squad = false;
m_loaded = false;
m_undock = false;
m_showall = false;
m_beyonce = false;
m_canThrow = false;
m_packaged = false;
m_portrait = false;
m_autoPilot = false;
m_bubbleWait = false;     // allow client processing of subsquent destiny msgs
m_setStateSent = false;
m_sessionChangeActive = false;

m_toGate = 0; m_locationID = 0; m_moveSystemID = 0; m_skillTimer = 0; m_dockStationID = 0;

m_lpMap.clear(); m_channels.clear(); m_hangarLoaded.clear();

sLog.Error("Client()", "Client copy c'tor called."); EvE::traceStack(); assert(0); }

Client::Client(Client&& oth) noexcept :m_TS(oth.m_TS), m_scan(oth.m_scan), pShipSE(oth.pShipSE), pSession(oth.pSession), m_system(oth.SystemMgr()), m_services(oth.services()) { sLog.Error("Client()", "Client move c'tor called."); EvE::traceStack(); assert(0); }

Client& Client::operator=(const Client& oth) { m_TS = oth.m_TS; m_scan = oth.m_scan; pShipSE = oth.pShipSE; pSession = oth.pSession; m_system = oth.SystemMgr(); m_services = oth.services();

sLog.Error("Client()", "Client assignment op called."); EvE::traceStack(); assert(0); }

Client& Client::operator=(Client&& oth) noexcept { sLog.Error("Client()", "Client move op called."); EvE::traceStack(); assert(0); }

Todo:
  • for warping to random point when client logs out in space... 1) check client IsInSpace(?) 2) set timer to delay removing bubble/sysmgr/destiny...or check based on destiny->isstopped() or timer on destiny->ismoving() 3) set current position (DB::chrCharacters.logoutPosition?) initial code in place for warp-in on login 4) generate random point to warp to ** use m_SGP.GetRandPointInSystem(systemID, distance) 5) _warp to random point, but DONT make/update new bubble with entering ship 6) remove client from sysmgr/destiny/server

Definition at line 226 of file Client.cpp.

References TradeService::CancelTrade(), CharNoLongerInStation(), PyServiceMgr::ClearBoundObject(), RefPtr< X >::get(), GetTradeSession(), GetUserID(), IsDocked(), InventoryItem::itemID(), ShipItem::LogOut(), Character::LogOut(), PyServiceMgr::LookupService(), m_bindSet, m_channels, m_char, m_destinyEventQueue, m_destinyUpdateQueue, m_loaded, m_locationID, m_scan, m_services, m_ship, m_system, m_TS, InventoryItem::name(), pSession, pShipSE, PyDecRef, SystemManager::RemoveClient(), SafeDelete(), sConsole, sEntityList, ServiceDB::SetAccountOnlineStatus(), ServiceDB::SetCharacterOnlineStatus(), sLog, and WarpOut().

226  {
227  if (!m_loaded)
228  return;
229 
230  m_loaded = false;
231 
232  if (pShipSE != nullptr)
233  WarpOut(); // need to make tests for this...it will segfault if m_char is invalid
234 
235  // LSC logout
236  for (auto cur : m_channels)
237  cur->LeaveChannel(this);
238 
239  if (m_char.get() != nullptr) { // we have valid character
249  sLog.Green(" Client::Logout()","%s (Acct:%u) logging out.", m_char->name(), GetUserID());
250 
251  if (!sConsole.IsDbError()) {
254  }
255 
256  if (!sConsole.IsShutdown()) {
257  if (IsDocked()) {
258  if (GetTradeSession()) {
259  TradeService* mts = (TradeService*)(m_services.LookupService("trademgr"));
260  mts->CancelTrade(this);
261  }
263  // remove char from station
264  sEntityList.GetStationByID(m_locationID)->RemoveItem(m_char);
265  }
266 
267  }
268  // remove fleet data, remove char from ItemFactory cache, save SP and set logout time
269  m_char->LogOut();
270  }
271 
272  // save shipstate and remove from ItemFactory
273  m_ship->LogOut();
274 
275  m_system->RemoveClient(this, true);
276  // remove char from entitylist
277  sEntityList.RemovePlayer(this);
278 
279  for (auto cur : m_bindSet)
281 
282  m_system = nullptr; // DO NOT delete m_system here
283 
284  SafeDelete(m_TS);
290 }
static void SetCharacterOnlineStatus(uint32 char_id, bool online=false)
Definition: ServiceDB.cpp:177
void RemoveClient(Client *pClient, bool count=false, bool jump=false)
#define sConsole
CharacterRef m_char
Definition: Client.h:340
PyService * LookupService(const std::string &name)
bool m_loaded
Definition: Client.h:358
PyList * m_destinyEventQueue
Definition: Client.h:460
#define sEntityList
Definition: EntityList.h:208
void CharNoLongerInStation()
Definition: Client.cpp:1811
const char * name()
std::set< LSCChannel * > m_channels
Definition: Client.h:397
void CancelTrade(Client *pClient)
void SafeDelete(T *&p)
Deletes and nullifies a pointer.
Definition: SafeMem.h:83
uint32 m_locationID
Definition: Client.h:377
void LogOut()
Definition: Ship.cpp:84
#define sLog
Evaluates to a NewLog instance.
Definition: LogNew.h:250
static void SetAccountOnlineStatus(uint32 accountID, bool online=false)
Definition: ServiceDB.cpp:198
bool IsDocked()
Definition: Client.h:229
PyList * m_destinyUpdateQueue
Definition: Client.h:461
TradeSession * GetTradeSession()
Definition: Client.h:311
PyServiceMgr & m_services
Definition: Client.h:341
X * get() const
Definition: RefPtr.h:213
void LogOut()
Definition: Character.cpp:336
#define PyDecRef(op)
Definition: PyRep.h:57
ShipItemRef m_ship
Definition: Client.h:337
void WarpOut()
Definition: Client.cpp:647
std::set< uint32 > m_bindSet
Definition: Client.h:443
ShipSE * pShipSE
Definition: Client.h:343
SystemManager * m_system
Definition: Client.h:346
TradeSession * m_TS
Definition: Client.h:344
ClientSession * pSession
Definition: Client.h:345
void ClearBoundObject(uint32 bindID)
Scan * m_scan
Definition: Client.h:334
uint32 itemID() const
Definition: InventoryItem.h:98
int32 GetUserID() const
Definition: Client.h:109

Here is the call graph for this function:

Member Function Documentation

uint32 Client::_GetQueuePosition ( )
inlineprotectedvirtual
Returns
Current count of connected users.
Current position in connection queue.

Implements EVEClientSession.

Definition at line 409 of file Client.h.

Referenced by _VerifyLogin().

409 { /* hack */ return 1; }

Here is the caller graph for this function:

void Client::_GetVersion ( VersionExchangeServer &  version)
protectedvirtual

Obtains version.

Parameters
[in]versionObject to be filled with version information.

Implements EVEClientSession.

Definition at line 2299 of file Client.cpp.

References EVEBirthday, EVEBuildVersion, EVEProjectVersion, EVEVersionNumber, MachoNetVersion, and sEntityList.

2300 {
2301  version.birthday = EVEBirthday;
2302  version.macho_version = MachoNetVersion;
2303  version.user_count = sEntityList.GetClientCount();
2304  version.version_number = EVEVersionNumber;
2305  version.build_version = EVEBuildVersion;
2306  version.project_version = EVEProjectVersion;
2307 }
#define sEntityList
Definition: EntityList.h:208
static const uint16 MachoNetVersion
Definition: EVEVersion.h:33
static const char *const EVEProjectVersion
Definition: EVEVersion.h:36
static const double EVEVersionNumber
Definition: EVEVersion.h:32
static const int32 EVEBuildVersion
Definition: EVEVersion.h:34
static const int32 EVEBirthday
Definition: EVEVersion.h:39
bool Client::_LoginFail ( std::string  fail_msg)
protected

Definition at line 2440 of file Client.cpp.

References EVEClientSession::mNet, and EVETCPConnection::QueueRep().

Referenced by _VerifyLogin().

2441 {
2442  GPSTransportClosed* except = new GPSTransportClosed(fail_msg);
2443  mNet->QueueRep(except);
2444  return false;
2445 }
void QueueRep(const PyRep *rep, bool compress=true)
Queues given PyRep into send queue.
EVETCPConnection *const mNet
Definition: EVESession.h:155
Python object "exceptions.GPSTransportClosed".
Definition: PyExceptions.h:59

Here is the call graph for this function:

Here is the caller graph for this function:

void Client::_SendCallReturn ( const PyAddress source,
int64  callID,
PyResult rsp 
)
protected

Definition at line 2475 of file Client.cpp.

References _log, CALL_RSP, PyAddress::callID, PyAddress::Client, PyPacket::dest, PyPacket::Dump(), GetUserID(), is_log_enabled, PyPacket::named_payload, PyAddress::objectID, PyPacket::payload, EVEClientSession::QueuePacket(), PyTuple::SetItem(), PyPacket::source, PyResult::ssNamedResult, PyResult::ssResult, PyAddress::type, PyPacket::type, PyPacket::type_string, and PyPacket::userid.

Referenced by Handle_CallReq().

2476 {
2477  //build the packet:
2478  PyPacket* packet = new PyPacket();
2479  packet->type_string = "macho.CallRsp";
2480  packet->type = CALL_RSP;
2481 
2482  packet->source = source; /* address should be 'ship' for warpto response */
2483 
2484  packet->dest.type = PyAddress::Client;
2485  packet->dest.objectID = 0; //GetClientID();
2486  packet->dest.callID = callID;
2487 
2488  packet->userid = GetUserID();
2489 
2490  packet->payload = new PyTuple(1);
2491  packet->payload->SetItem(0, new PySubStream(rsp.ssResult));
2492  packet->named_payload = rsp.ssNamedResult;
2493 
2494  if (is_log_enabled(COLLECT__PACKET_DUMP)) {
2495  _log(COLLECT__PACKET_DUMP, "_SendCallReturn: Dump()");
2496  PyLogDumpVisitor dumper(COLLECT__PACKET_DUMP, COLLECT__PACKET_DUMP, "", true, true);
2497  packet->Dump(COLLECT__PACKET_DUMP, dumper);
2498  }
2499 
2500  QueuePacket(packet);
2501 }
PyDict * ssNamedResult
Definition: PyCallable.h:66
int64 callID
Definition: PyPacket.h:90
#define _log(type, fmt,...)
Definition: logsys.h:124
PyAddress dest
Definition: PyPacket.h:117
int64 objectID
Definition: PyPacket.h:89
Python tuple.
Definition: PyRep.h:567
PyTuple * payload
Definition: PyPacket.h:119
#define is_log_enabled(type)
Definition: logsys.h:78
void Dump(LogType type, PyVisitor &dumper)
Definition: PyPacket.cpp:95
PyRep * ssResult
Definition: PyCallable.h:65
MACHONETMSG_TYPE type
Definition: PyPacket.h:115
AddrType type
Definition: PyPacket.h:88
void SetItem(size_t index, PyRep *object)
Stores Python object.
Definition: PyRep.h:610
void QueuePacket(PyPacket *packet)
Queues new packet, retaking ownership.
Definition: EVESession.cpp:66
uint32 userid
Definition: PyPacket.h:118
PyDict * named_payload
Definition: PyPacket.h:120
PyAddress source
Definition: PyPacket.h:116
std::string type_string
Definition: PyPacket.h:112
int32 GetUserID() const
Definition: Client.h:109

Here is the call graph for this function:

Here is the caller graph for this function:

void Client::_SendException ( const PyAddress source,
int64  callID,
MACHONETMSG_TYPE  in_response_to,
MACHONETERR_TYPE  exception_type,
PyRep **  payload 
)
protected

Definition at line 2503 of file Client.cpp.

References PyAddress::callID, PyAddress::Client, PyPacket::dest, ERRORRESPONSE, GetUserID(), PyAddress::objectID, PyPacket::payload, EVEClientSession::QueuePacket(), PyPacket::source, PyAddress::type, PyPacket::type, PyPacket::type_string, and PyPacket::userid.

Referenced by ProcessNet().

2504 {
2505  //build the packet:
2506  PyPacket* packet = new PyPacket();
2507  packet->type_string = "macho.ErrorResponse";
2508  packet->type = ERRORRESPONSE;
2509 
2510  packet->source = source;
2511 
2512  packet->dest.type = PyAddress::Client;
2513  packet->dest.objectID = 0; //GetClientID();
2514  packet->dest.callID = callID;
2515 
2516  packet->userid = GetUserID();
2517 
2518  ErrorResponse e;
2519  e.MsgType = msgType;
2520  e.ErrorCode = errCode;
2521  e.payload = *payload;
2522  payload = nullptr;
2523 
2524  packet->payload = e.Encode();
2525  QueuePacket(packet);
2526 }
int64 callID
Definition: PyPacket.h:90
PyAddress dest
Definition: PyPacket.h:117
int64 objectID
Definition: PyPacket.h:89
PyTuple * payload
Definition: PyPacket.h:119
MACHONETMSG_TYPE type
Definition: PyPacket.h:115
AddrType type
Definition: PyPacket.h:88
void QueuePacket(PyPacket *packet)
Queues new packet, retaking ownership.
Definition: EVESession.cpp:66
uint32 userid
Definition: PyPacket.h:118
PyAddress source
Definition: PyPacket.h:116
std::string type_string
Definition: PyPacket.h:112
int32 GetUserID() const
Definition: Client.h:109

Here is the call graph for this function:

Here is the caller graph for this function:

void Client::_SendPingRequest ( )
protected

Definition at line 2528 of file Client.cpp.

References PyAddress::callID, PyAddress::Client, PyPacket::dest, PyServiceMgr::GetNodeID(), GetUserID(), m_services, PyPacket::named_payload, new_tuple(), PyAddress::Node, PyAddress::objectID, PyPacket::payload, PING_REQ, EVEClientSession::QueuePacket(), PyAddress::service, PyPacket::source, PyAddress::type, PyPacket::type, PyPacket::type_string, and PyPacket::userid.

Referenced by ProcessClient().

2529 {
2530  PyPacket *packet = new PyPacket();
2531 
2532  packet->type = PING_REQ;
2533  packet->type_string = "macho.PingReq";
2534 
2535  packet->source.type = PyAddress::Node;
2536  packet->source.objectID = m_services.GetNodeID();
2537  packet->source.service = "ping";
2538  packet->source.callID = 0;
2539 
2540  packet->dest.type = PyAddress::Client;
2541  packet->dest.objectID = 0; //GetClientID();
2542  packet->dest.callID = 0;
2543 
2544  packet->userid = GetUserID();
2545 
2546  packet->payload = new_tuple(new PyList()); //times
2547  packet->named_payload = new PyDict();
2548 
2549  QueuePacket(packet);
2550 }
int64 callID
Definition: PyPacket.h:90
Python's dictionary.
Definition: PyRep.h:719
PyAddress dest
Definition: PyPacket.h:117
int64 objectID
Definition: PyPacket.h:89
uint32 GetNodeID() const
Definition: PyServiceMgr.h:67
PyTuple * payload
Definition: PyPacket.h:119
MACHONETMSG_TYPE type
Definition: PyPacket.h:115
PyTuple * new_tuple(int64 arg1)
Definition: PyRep.cpp:1160
AddrType type
Definition: PyPacket.h:88
PyServiceMgr & m_services
Definition: Client.h:341
void QueuePacket(PyPacket *packet)
Queues new packet, retaking ownership.
Definition: EVESession.cpp:66
uint32 userid
Definition: PyPacket.h:118
PyDict * named_payload
Definition: PyPacket.h:120
std::string service
Definition: PyPacket.h:92
PyAddress source
Definition: PyPacket.h:116
std::string type_string
Definition: PyPacket.h:112
Python list.
Definition: PyRep.h:639
int32 GetUserID() const
Definition: Client.h:109

Here is the call graph for this function:

Here is the caller graph for this function:

void Client::_SendPingResponse ( const PyAddress source,
int64  callID 
)
protected

Definition at line 2552 of file Client.cpp.

References PyList::AddItem(), PyAddress::callID, PyAddress::Client, PyPacket::dest, GetUserID(), PyAddress::objectID, PyPacket::payload, PING_RSP, EVEClientSession::QueuePacket(), PyTuple::SetItem(), PyPacket::source, PyAddress::type, PyPacket::type, PyPacket::type_string, PyPacket::userid, and Win32TimeNow().

Referenced by Handle_PingReq().

2553 {
2554  PyPacket* packet = new PyPacket();
2555  packet->type = PING_RSP;
2556  packet->type_string = "macho.PingRsp";
2557 
2558  packet->source = source;
2559 
2560  packet->dest.type = PyAddress::Client;
2561  packet->dest.objectID = 0; //GetClientID();
2562  packet->dest.callID = callID;
2563 
2564  packet->userid = GetUserID();
2565 
2566  /* Here the hacking begins, the ping packet handles the timestamps of various packet handling steps.
2567  * To really simulate/emulate that we need the various packet handlers which in fact we don't have (:P).
2568  * So the next piece of code "fake's" it, with a slight delay on the received packet time.
2569  */
2570  PyList* pingList = new PyList();
2571  PyTuple* pingTuple(nullptr);
2572 
2573  pingTuple = new PyTuple(3);
2574  pingTuple->SetItem(0, new PyLong(Win32TimeNow() - 20)); // this should be the time the packet was received (we cheat here a bit)
2575  pingTuple->SetItem(1, new PyLong(Win32TimeNow())); // this is the time the packet is (handled/written) by the (proxy/server) so we're cheating a bit again.
2576  pingTuple->SetItem(2, new PyString("proxy::handle_message"));
2577  pingList->AddItem(pingTuple);
2578 
2579  pingTuple = new PyTuple(3);
2580  pingTuple->SetItem(0, new PyLong(Win32TimeNow() - 20));
2581  pingTuple->SetItem(1, new PyLong(Win32TimeNow()));
2582  pingTuple->SetItem(2, new PyString("proxy::writing"));
2583  pingList->AddItem(pingTuple);
2584 
2585  pingTuple = new PyTuple(3);
2586  pingTuple->SetItem(0, new PyLong(Win32TimeNow() - 20));
2587  pingTuple->SetItem(1, new PyLong(Win32TimeNow()));
2588  pingTuple->SetItem(2, new PyString("server::handle_message"));
2589  pingList->AddItem(pingTuple);
2590 
2591  pingTuple = new PyTuple(3);
2592  pingTuple->SetItem(0, new PyLong(Win32TimeNow() - 20));
2593  pingTuple->SetItem(1, new PyLong(Win32TimeNow()));
2594  pingTuple->SetItem(2, new PyString("server::turnaround"));
2595  pingList->AddItem(pingTuple);
2596 
2597  pingTuple = new PyTuple(3);
2598  pingTuple->SetItem(0, new PyLong(Win32TimeNow() - 20));
2599  pingTuple->SetItem(1, new PyLong(Win32TimeNow()));
2600  pingTuple->SetItem(2, new PyString("proxy::handle_message"));
2601  pingList->AddItem(pingTuple);
2602 
2603  pingTuple = new PyTuple(3);
2604  pingTuple->SetItem(0, new PyLong(Win32TimeNow() - 20));
2605  pingTuple->SetItem(1, new PyLong(Win32TimeNow()));
2606  pingTuple->SetItem(2, new PyString("proxy::writing"));
2607  pingList->AddItem(pingTuple);
2608 
2609  // Set payload
2610  packet->payload = new PyTuple(1);
2611  packet->payload->SetItem(0, pingList);
2612 
2613  // Don't clone so it eats the ret object upon sending.
2614  QueuePacket(packet);
2615 }
int64 callID
Definition: PyPacket.h:90
Python string.
Definition: PyRep.h:430
PyAddress dest
Definition: PyPacket.h:117
int64 objectID
Definition: PyPacket.h:89
Python tuple.
Definition: PyRep.h:567
void AddItem(PyRep *i)
Definition: PyRep.h:701
PyTuple * payload
Definition: PyPacket.h:119
MACHONETMSG_TYPE type
Definition: PyPacket.h:115
AddrType type
Definition: PyPacket.h:88
void SetItem(size_t index, PyRep *object)
Stores Python object.
Definition: PyRep.h:610
int64 Win32TimeNow()
Definition: utils_time.cpp:70
void QueuePacket(PyPacket *packet)
Queues new packet, retaking ownership.
Definition: EVESession.cpp:66
uint32 userid
Definition: PyPacket.h:118
PyAddress source
Definition: PyPacket.h:116
std::string type_string
Definition: PyPacket.h:112
Python list.
Definition: PyRep.h:639
Python long integer.
Definition: PyRep.h:261
int32 GetUserID() const
Definition: Client.h:109

Here is the call graph for this function:

Here is the caller graph for this function:

void Client::_SendQueuedUpdates ( )
private

Definition at line 2170 of file Client.cpp.

References PyList::clear(), PyRep::Dump(), PyList::empty(), is_log_enabled, m_bubbleWait, m_destinyEventQueue, m_destinyUpdateQueue, m_packaged, and SendNotification().

Referenced by FlushQueue(), and ProcessNet().

2170  {
2171  if (!m_destinyUpdateQueue->empty()) {
2172  if (m_destinyEventQueue->empty()) {
2173  DoDestinyUpdateMain_2 dum;
2174  dum.updates = m_destinyUpdateQueue;
2175  dum.waitForBubble = m_bubbleWait;
2176  PyTuple* t = dum.Encode();
2177  if (is_log_enabled(CLIENT__QUEUE_DUMP))
2178  t->Dump(CLIENT__QUEUE_DUMP, "");
2179  SendNotification("DoDestinyUpdate", "clientID", &t);
2180  } else {
2181  DoDestinyUpdateMain dum;
2182  dum.updates = m_destinyUpdateQueue;
2183  dum.events = m_destinyEventQueue;
2184  dum.waitForBubble = m_bubbleWait;
2185  PyTuple* t = dum.Encode();
2186  if (is_log_enabled(CLIENT__QUEUE_DUMP))
2187  t->Dump(CLIENT__QUEUE_DUMP, "");
2188  SendNotification("DoDestinyUpdate", "clientID", &t);
2189  }
2190  } else if (!m_destinyEventQueue->empty()) {
2191  Notify_OnMultiEvent nom;
2192  nom.events = m_destinyEventQueue;
2193  PyTuple* t = nom.Encode();
2194  if (is_log_enabled(CLIENT__QUEUE_DUMP))
2195  t->Dump(CLIENT__QUEUE_DUMP, "");
2196  SendNotification("OnMultiEvent", "charid", &t);
2197  } //else nothing to be sent ...
2198 
2199  // clear the queues now, after the packets have been sent
2202  m_packaged = false;
2203 }
void SendNotification(const PyAddress &dest, EVENotificationStream &noti, bool seq=true)
Definition: Client.cpp:2245
PyList * m_destinyEventQueue
Definition: Client.h:460
Python tuple.
Definition: PyRep.h:567
void Dump(FILE *into, const char *pfx) const
Dumps object to file.
Definition: PyRep.cpp:84
#define is_log_enabled(type)
Definition: logsys.h:78
PyList * m_destinyUpdateQueue
Definition: Client.h:461
bool m_bubbleWait
Definition: Client.h:367
void clear()
Definition: PyRep.cpp:627
bool m_packaged
Definition: Client.h:363
bool empty() const
Definition: PyRep.h:664

Here is the call graph for this function:

Here is the caller graph for this function:

bool Client::_VerifyCrypto ( CryptoRequestPacket &  cr)
protectedvirtual

Verifies crypto.

Parameters
[in]crCrypto sent by client.
Return values
trueVerification succeeded; proceeds to next state.
falseVerification failed; stays in current state.

Implements EVEClientSession.

Definition at line 2330 of file Client.cpp.

References GetAddress(), EVEClientSession::mNet, EVETCPConnection::QueueRep(), SendErrorMsg(), and sLog.

2331 {
2332  if (cr.keyVersion != "placebo") {
2333  //I'm sure cr.keyVersion can specify either CryptoAPI or PyCrypto, but its all binary so im not sure how.
2334  CryptoAPIRequestParams car;
2335  if (!car.Decode(cr.keyParams)) {
2336  sLog.Error("Client","%s: Received invalid CryptoAPI request!", GetAddress().c_str());
2337  } else {
2338  sLog.Error("Client","%s: Unhandled CryptoAPI request: hashmethod=%s sessionkeylength=%d provider=%s sessionkeymethod=%s", GetAddress().c_str(), car.hashmethod.c_str(), car.sessionkeylength, car.provider.c_str(), car.sessionkeymethod.c_str());
2339  SendErrorMsg("Invalid CryptoAPI request - You must change your client to use Placebo crypto in common.ini to talk to this server.");
2340  }
2341 
2342  return false;
2343  } else {
2344  sLog.Debug("Client","%s: Received Placebo crypto request, accepting.", GetAddress().c_str());
2345 
2346  //send out accept response
2347  PyRep* rsp = new PyString("OK CC");
2348  mNet->QueueRep(rsp);
2349  }
2350 
2351  return true;
2352 }
Base Python wire object.
Definition: PyRep.h:66
void SendErrorMsg(const char *fmt,...)
Definition: Client.cpp:2719
Python string.
Definition: PyRep.h:430
void QueueRep(const PyRep *rep, bool compress=true)
Queues given PyRep into send queue.
#define sLog
Evaluates to a NewLog instance.
Definition: LogNew.h:250
EVETCPConnection *const mNet
Definition: EVESession.h:155
std::string GetAddress() const
Definition: Client.h:106

Here is the call graph for this function:

bool Client::_VerifyFuncResult ( CryptoHandshakeResult &  result)
protectedvirtual

Verifies function result.

Parameters
[in]resultFunction result sent by client.
Return values
trueVerification succeeded; proceeds to next state.
falseVerification failed; stays in current state.

Implements EVEClientSession.

Definition at line 2447 of file Client.cpp.

References _log, PyRep::Dump(), GetAddress(), GetLanguageID(), GetUserID(), is_log_enabled, Acct::Role::LOGIN, Acct::Type::Mammon, EVEClientSession::mNet, Acct::Role::NEWBIE, Acct::Role::PLAYER, PyStatic, EVETCPConnection::QueueRep(), SendInitialSessionStatus(), and sLiveUpdateDB.

2448 {
2449  _log(NET__PRES_DEBUG, "%s: Handshake result received.", GetAddress().c_str());
2450 
2451  //send this before session change
2452  CryptoHandshakeAck ack;
2453  ack.jit = GetLanguageID();
2454  ack.userid = GetUserID(); //5654387 accountID?
2455  ack.maxSessionTime = PyStatic.NewNone(); // set this for an auto-logout time?
2456  ack.userType = Acct::Type::Mammon; //GetAccountType() - not written yet
2457  ack.role = Acct::Role::PLAYER | Acct::Role::NEWBIE | Acct::Role::LOGIN; /* live returns these */
2458  ack.address = GetAddress();
2459  ack.inDetention = PyStatic.NewNone(); // dont know what this is or what it's for
2460  ack.client_hash = PyStatic.NewNone();
2461  ack.user_clientid = 0; //GetClientID(); //241241000001103
2462  ack.live_updates = sLiveUpdateDB.GetUpdates();
2463  ack.sessionID = 0; //pSession->GetSessionID(); //398773966249980114
2464  PyRep* res(ack.Encode());
2465  if (is_log_enabled(CLIENT__CALL_DUMP))
2466  res->Dump(CLIENT__CALL_DUMP, " ");
2467  mNet->QueueRep(res, false);
2468 
2469  // send out the initial session status
2471 
2472  return true;
2473 }
Base Python wire object.
Definition: PyRep.h:66
void SendInitialSessionStatus()
Definition: Client.cpp:2007
#define _log(type, fmt,...)
Definition: logsys.h:124
void QueueRep(const PyRep *rep, bool compress=true)
Queues given PyRep into send queue.
void Dump(FILE *into, const char *pfx) const
Dumps object to file.
Definition: PyRep.cpp:84
std::string GetLanguageID() const
Definition: Client.h:107
#define is_log_enabled(type)
Definition: logsys.h:78
#define sLiveUpdateDB
Definition: LiveUpdateDB.h:47
#define PyStatic
Definition: PyRep.h:1209
EVETCPConnection *const mNet
Definition: EVESession.h:155
std::string GetAddress() const
Definition: Client.h:106
int32 GetUserID() const
Definition: Client.h:109

Here is the call graph for this function:

bool Client::_VerifyLogin ( CryptoChallengePacket &  ccp)
protectedvirtual

Verifies login.

Parameters
[in]ccpLogin data sent by client.
Return values
trueVerification succeeded; proceeds to next state.
falseVerification failed; stays in current state.
Todo:
check this character/account for newbie status and revoke as needed before account update.

Implements EVEClientSession.

Definition at line 2354 of file Client.cpp.

References _GetQueuePosition(), _LoginFail(), AccountData::banned, AccountData::clientID, EVEBuildVersion, EVEProjectCodename, EVEProjectRegion, EVEVersionNumber, ServiceDB::GetAccountInformation(), EVEClientSession::GetAddress(), AccountData::hash, AccountData::id, MachoNetVersion, Acct::Type::Mammon, marshaledNone, EVEClientSession::mNet, AccountData::name, AccountData::online, AccountData::password, pSession, EVETCPConnection::QueueRep(), AccountData::role, sEntityList, ClientSession::SetInt(), ClientSession::SetLong(), ClientSession::SetString(), sImageServer, sLog, ServiceDB::UpdatePassword(), and ServiceDB::ValidateAccountName().

2355 {
2356  /* send passwordVersion required: 1=plain, 2=hashed */
2357  // this doesnt work as i want it to.
2358  // sending '2' will have client use hashed pass.
2359  // sending '1' will have client send hashed pass first, then a second authentication packet using plain pass
2360  PyRep* res = new PyInt(2);
2361  mNet->QueueRep(res);
2362 
2363  std::string failMsg = "Login Authorization Invalid.";
2364 
2365  // test account name for invalid chars (which may allow sql injection)
2366  if (!ServiceDB::ValidateAccountName(ccp, failMsg))
2367  return _LoginFail(failMsg);
2368 
2369  AccountData aData = AccountData();
2370  if (!ServiceDB::GetAccountInformation(ccp, aData, failMsg))
2371  return _LoginFail(failMsg);
2372 
2373  if (aData.banned) {
2374  failMsg = "Your account is banned. Contact Allan for further support";
2375  return _LoginFail(failMsg);
2376  }
2377 
2378  if (aData.online) {
2379  failMsg = "This account is currently online.";
2380  return _LoginFail(failMsg);
2381  }
2382 
2383  if (!ccp.user_password.empty()) {
2384  sLog.Warning(" Client::Login()", "%s(%li) - Using Plain Password", aData.name.c_str(), aData.clientID);
2385  if (strcmp(aData.password.c_str(), ccp.user_password.c_str()) != 0) {
2386  failMsg = "The plain Password you entered is incorrect for this account.";
2387  return _LoginFail(failMsg);
2388  }
2389  } else {
2390  //sLog.Warning(" Client::Login()", "%s(%li) - Using Hashed Password", aData.name.c_str(), aData.clientID);
2391  if (strcmp(aData.hash.c_str(), ccp.user_password_hash.c_str()) != 0) {
2392  failMsg = "The Password you entered is incorrect for this account.";
2393  return _LoginFail(failMsg);
2394  }
2395 
2396  if (!ccp.user_password.empty())
2397  ServiceDB::UpdatePassword(aData.id, ccp.user_password.c_str());
2398  }
2399 
2402  /* send our handshake */
2403  CryptoServerHandshake server_shake;
2404  //server_shake.context = ??
2405  server_shake.serverChallenge = "";
2406  server_shake.func_marshaled_code = new PyBuffer(marshaledNone, marshaledNone + sizeof(marshaledNone));
2407  server_shake.verification = new PyBool(false);
2408  server_shake.cluster_usercount = sEntityList.GetClientCount(); //GetUserCount();
2409  server_shake.proxy_nodeid = 0xFFAA; //888444
2410  server_shake.user_logonqueueposition = _GetQueuePosition();
2411  // binascii.crc_hqx of marshaled single-element tuple containing 64 zero-bytes string
2412  server_shake.challenge_responsehash = "55087";
2413 
2414  // the image server to be used by the client to download images
2415  server_shake.imageserverurl = sImageServer.url();
2416 
2417  server_shake.macho_version = MachoNetVersion;
2418  server_shake.boot_version = EVEVersionNumber;
2419  server_shake.boot_build = EVEBuildVersion;
2420  server_shake.boot_codename = EVEProjectCodename;
2421  server_shake.boot_region = EVEProjectRegion;
2422  res = server_shake.Encode();
2423  mNet->QueueRep(res);
2424 
2425  // Setup session, but don't send the change yet.
2426  pSession->SetString("address", EVEClientSession::GetAddress().c_str());
2427  pSession->SetString("languageID", ccp.user_languageid.c_str());
2428 
2429  pSession->SetInt("userType", Acct::Type::Mammon); //aData.type - incomplete (db fields done)
2430  pSession->SetInt("userid", aData.id);
2431  pSession->SetLong("role", aData.role);
2432  pSession->SetLong("clientID", 0 /*1000000L * aData.clientID + 888444*/); // kinda arbitrary
2433  pSession->SetLong("sessionID", 0 /*pSession->GetSessionID()*/);
2434 
2435  sLog.Green(" Client::Login()","Account %u (%s) logging in from %s", aData.id, aData.name.c_str(), EVEClientSession::GetAddress().c_str());
2436 
2437  return true;
2438 }
std::string name
Base Python wire object.
Definition: PyRep.h:66
#define sImageServer
Definition: ImageServer.h:93
static const char *const EVEProjectCodename
Definition: EVEVersion.h:37
static const uint8 marshaledNone[]
Definition: EVE_Consts.h:23
void SetLong(const char *name, int64 value)
std::string hash
bool _LoginFail(std::string fail_msg)
Definition: Client.cpp:2440
#define sEntityList
Definition: EntityList.h:208
std::string GetAddress() const
Definition: EVESession.h:67
void QueueRep(const PyRep *rep, bool compress=true)
Queues given PyRep into send queue.
static const uint16 MachoNetVersion
Definition: EVEVersion.h:33
Python boolean.
Definition: PyRep.h:323
#define sLog
Evaluates to a NewLog instance.
Definition: LogNew.h:250
uint32 clientID
static const double EVEVersionNumber
Definition: EVEVersion.h:32
static const int32 EVEBuildVersion
Definition: EVEVersion.h:34
static void UpdatePassword(uint32 accountID, const char *pass)
Definition: ServiceDB.cpp:170
Python integer.
Definition: PyRep.h:231
std::string password
EVETCPConnection *const mNet
Definition: EVESession.h:155
static bool GetAccountInformation(CryptoChallengePacket &ccp, AccountData &aData, std::string &failMsg)
Definition: ServiceDB.cpp:70
void SetString(const char *name, const char *value)
Python buffer.
Definition: PyRep.h:382
static bool ValidateAccountName(CryptoChallengePacket &ccp, std::string &failMsg)
Definition: ServiceDB.cpp:43
uint32 _GetQueuePosition()
Definition: Client.h:409
void SetInt(const char *name, int32 value)
ClientSession * pSession
Definition: Client.h:345
static const char *const EVEProjectRegion
Definition: EVEVersion.h:35

Here is the call graph for this function:

bool Client::_VerifyVersion ( VersionExchangeClient &  version)
protectedvirtual

Verifies version.

Parameters
[in]versionVersion sent by client.
Return values
trueVerification succeeded; proceeds to next state.
falseVerification failed; stays in current state.

Implements EVEClientSession.

Definition at line 2314 of file Client.cpp.

References EVEBirthday, EVEBuildVersion, EVEProjectVersion, EVEVersionNumber, GetAddress(), MachoNetVersion, and sLog.

2315 {
2316  version.Dump(NET__PRES_REP, " ");
2317  if (version.birthday != EVEBirthday)
2318  sLog.Error("Client","%s: Client's birthday does not match ours!", GetAddress().c_str());
2319  if (version.macho_version != MachoNetVersion)
2320  sLog.Error("Client","%s: Client's macho_version not match ours!", GetAddress().c_str());
2321  if (version.version_number != EVEVersionNumber)
2322  sLog.Error("Client","%s: Client's version_number not match ours!", GetAddress().c_str());
2323  if (version.build_version != EVEBuildVersion)
2324  sLog.Error("Client","%s: Client's build_version not match ours!", GetAddress().c_str());
2325  if (version.project_version != EVEProjectVersion)
2326  sLog.Error("Client","%s: Client's project_version not match ours!", GetAddress().c_str());
2327  return true;
2328 }
static const uint16 MachoNetVersion
Definition: EVEVersion.h:33
#define sLog
Evaluates to a NewLog instance.
Definition: LogNew.h:250
static const char *const EVEProjectVersion
Definition: EVEVersion.h:36
static const double EVEVersionNumber
Definition: EVEVersion.h:32
static const int32 EVEBuildVersion
Definition: EVEVersion.h:34
static const int32 EVEBirthday
Definition: EVEVersion.h:39
std::string GetAddress() const
Definition: Client.h:106

Here is the call graph for this function:

bool Client::_VerifyVIPKey ( const std::string &  vipKey)
inlineprotectedvirtual

Verifies VIP key.

Parameters
[in]vipKeyVIP key sent by client.
Return values
trueVerification succeeded; proceeds to next state.
falseVerification failed; stays in current state.

Implements EVEClientSession.

Definition at line 418 of file Client.h.

418 { /* do nothing */ return true; }
bool Client::AddBalance ( float  amount,
uint8  type = Account::CreditType::ISK 
)
inline

Definition at line 174 of file Client.h.

References Character::AlterBalance(), and m_char.

Referenced by AccountService::TranserFunds().

175  { return m_char->AlterBalance(amount, type); }
CharacterRef m_char
Definition: Client.h:340
bool AlterBalance(float amount, uint8 type)
Definition: Character.cpp:375

Here is the call graph for this function:

Here is the caller graph for this function:

void Client::AddBindID ( uint32  bindID)
inline

Definition at line 436 of file Client.h.

References m_bindSet.

Referenced by PyServiceMgr::BindObject().

436 { m_bindSet.emplace(bindID); }
std::set< uint32 > m_bindSet
Definition: Client.h:443

Here is the caller graph for this function:

void Client::AddStationHangar ( uint32  stationID)

Definition at line 1652 of file Client.cpp.

References m_hangarLoaded.

Referenced by Inventory::LoadContents().

1652  {
1653  m_hangarLoaded.insert(std::make_pair(stationID, true));
1654 }
std::map< uint32, bool > m_hangarLoaded
Definition: Client.h:398

Here is the caller graph for this function:

bool Client::AutoStop ( )
inline

Definition at line 274 of file Client.h.

References m_autoStop.

Referenced by Command_autostop(), LSCChannel::SendServerMOTD(), ActiveModule::UpdateCharge(), and ActiveModule::UpdateDamage().

274 { return m_autoStop; }
bool m_autoStop
Definition: Client.h:362

Here is the caller graph for this function:

void Client::BanClient ( )

Definition at line 2287 of file Client.cpp.

References GetUserID(), SendNotifyMsg(), and ServiceDB::SetAccountBanStatus().

Referenced by Command_ban().

2288 {
2289  //send message to client
2290  SendNotifyMsg("You have been banned from this server and will be disconnected shortly. You will no longer be able to log in");
2291 
2292  //ban the client
2294 }
static void SetAccountBanStatus(uint32 accountID, bool banned=false)
Definition: ServiceDB.cpp:205
void SendNotifyMsg(const char *fmt,...)
Definition: Client.cpp:2776
int32 GetUserID() const
Definition: Client.h:109

Here is the call graph for this function:

Here is the caller graph for this function:

void Client::Board ( ShipSE newShipSE)

Definition at line 1086 of file Client.cpp.

References SystemEntity::Abandon(), CheckShipRef(), SystemEntity::DestinyMgr(), Ga::GaVec3::distance(), ShipItem::Eject(), DestinyManager::Eject(), flagCapsule, flagShipOffline, SystemManager::GetID(), GetName(), SystemEntity::GetPosition(), ShipSE::GetShipItemRef(), TowerSE::GetSOI(), SystemBubble::GetTowerSE(), TowerSE::HasForceField(), SystemBubble::HasTower(), InventoryItem::itemID(), itemTypeCapsule, m_char, m_ship, m_system, InventoryItem::Move(), NULL_ORIGIN(), pShipSE, SystemManager::RemoveEntity(), SafeDelete(), SendSessionChange(), InventoryItem::SetCustomInfo(), InventoryItem::SetFlag(), InventoryItem::SetPosition(), SetShip(), snprintf, SystemEntity::SysBubble(), InventoryItem::typeID(), and UpdateNewShip().

1087 {
1088  CheckShipRef(newShipSE->GetShipItemRef());
1089 
1090  if (m_ship->typeID() == itemTypeCapsule) {
1092  m_ship->Move(m_system->GetID(), flagCapsule, true);
1093  // cannot use DestroyShipSE() for this. it removes current shipSE, with pilot, like pilot is leaving bubble.
1094  ShipSE* oldShipSE = pShipSE;
1095  // set vars to new ship
1096  SetShip(newShipSE->GetShipItemRef());
1097  pShipSE = newShipSE;
1098  // remove pod entity
1099  m_system->RemoveEntity(oldShipSE);
1100  SafeDelete(oldShipSE);
1101  } else { // you can xfer direct from one ship from another.
1102  // check for POS/FF in bubble. check for ship in FF. if so, then not abandoned.
1103  bool abandoned = true;
1104  if (pShipSE->SysBubble()->HasTower()) {
1105  TowerSE* ptSE = pShipSE->SysBubble()->GetTowerSE();
1106  if (ptSE->HasForceField())
1107  if (pShipSE->GetPosition().distance(ptSE->GetPosition()) < ptSE->GetSOI())
1108  abandoned = false;
1109  }
1110 
1111  char ci[45];
1112  if (abandoned) {
1113  pShipSE->Abandon();
1114  snprintf(ci, sizeof(ci), "Abandoned: %s(%u)", GetName(), m_char->itemID());
1115  } else
1116  snprintf(ci, sizeof(ci), "Ejected: %s(%u)", GetName(), m_char->itemID());
1117 
1118  m_ship->SetCustomInfo(ci);
1120  m_ship->Eject();
1121 
1122  pShipSE->DestinyMgr()->Eject();
1123 
1124  SetShip(newShipSE->GetShipItemRef());
1125  pShipSE = newShipSE;
1126  }
1127 
1128  UpdateNewShip();
1129  //SetStateTimer(Player::State::Board, Player::Timer::Board);
1131 }
CharacterRef m_char
Definition: Client.h:340
bool SetFlag(EVEItemFlags flag, bool notify=false)
SystemBubble * SysBubble()
Definition: SystemEntity.h:195
ShipItemRef GetShipItemRef()
Definition: Ship.h:362
uint32 GetID() const
Definition: SystemManager.h:80
void SetPosition(const GPoint &pos)
void SendSessionChange()
Definition: Client.cpp:2048
uint16 GetSOI()
Definition: Tower.h:90
Definition: Ship.h:301
const GPoint & GetPosition() const
Definition: SystemEntity.h:211
void Move(uint32 new_location=locTemp, EVEItemFlags flag=flagNone, bool notify=false)
TowerSE * GetTowerSE()
Definition: SystemBubble.h:142
void SafeDelete(T *&p)
Deletes and nullifies a pointer.
Definition: SafeMem.h:83
void SetShip(ShipItemRef shipRef)
Definition: Client.cpp:1278
static const GPoint NULL_ORIGIN(0, 0, 0)
#define snprintf
Definition: eve-compat.h:184
void RemoveEntity(SystemEntity *pSE)
const char * GetName() const
Definition: Client.h:94
ShipItemRef m_ship
Definition: Client.h:337
void SetCustomInfo(const char *ci)
void Eject()
Definition: Ship.cpp:350
ShipSE * pShipSE
Definition: Client.h:343
SystemManager * m_system
Definition: Client.h:346
Definition: Tower.h:19
bool HasForceField()
Definition: Tower.h:76
virtual void Abandon()
uint16 typeID() const
void UpdateNewShip()
Definition: Client.cpp:1025
void CheckShipRef(ShipItemRef newShipRef)
Definition: Client.cpp:1049
uint32 itemID() const
Definition: InventoryItem.h:98

Here is the call graph for this function:

void Client::BoardShip ( ShipItemRef  newShipRef)

Definition at line 1064 of file Client.cpp.

References _log, ModuleManager::CharacterLeavingShip(), CheckShipRef(), flagCapsule, SystemManager::GetID(), ShipItem::GetModuleManager(), GetName(), InventoryItem::itemID(), itemTypeCapsule, m_char, m_login, m_ship, m_system, InventoryItem::Move(), InventoryItem::name(), NULL_ORIGIN(), ShipItem::SaveShip(), InventoryItem::SetCustomInfo(), InventoryItem::SetPosition(), SetSessionTimer(), SetShip(), snprintf, and InventoryItem::typeID().

1065 {
1066  CheckShipRef(newShipRef);
1067 
1068  if (m_login) {
1069  _log(PLAYER__MESSAGE, "%s boarding active ship %u on login.", m_char->name(), newShipRef->itemID());
1070  } else if (m_ship->typeID() == itemTypeCapsule) {
1072  m_ship->Move(m_system->GetID(), flagCapsule, true);
1073  m_ship->SetCustomInfo(nullptr);
1074  } else {
1075  char ci[45];
1076  snprintf(ci, sizeof(ci), "Inactive: %s(%u)", GetName(), m_char->itemID());
1077  m_ship->SetCustomInfo(ci);
1079  m_ship->SaveShip();
1080  }
1081 
1082  SetShip(newShipRef);
1083  SetSessionTimer();
1084 }
#define _log(type, fmt,...)
Definition: logsys.h:124
CharacterRef m_char
Definition: Client.h:340
ModuleManager * GetModuleManager()
Definition: Ship.h:80
uint32 GetID() const
Definition: SystemManager.h:80
void SetPosition(const GPoint &pos)
const char * name()
void Move(uint32 new_location=locTemp, EVEItemFlags flag=flagNone, bool notify=false)
void SetShip(ShipItemRef shipRef)
Definition: Client.cpp:1278
static const GPoint NULL_ORIGIN(0, 0, 0)
#define snprintf
Definition: eve-compat.h:184
const char * GetName() const
Definition: Client.h:94
ShipItemRef m_ship
Definition: Client.h:337
void SetCustomInfo(const char *ci)
void CharacterLeavingShip()
SystemManager * m_system
Definition: Client.h:346
bool m_login
Definition: Client.h:356
void SaveShip()
Definition: Ship.cpp:1060
void SetSessionTimer()
Definition: Client.h:250
uint16 typeID() const
void CheckShipRef(ShipItemRef newShipRef)
Definition: Client.cpp:1049
uint32 itemID() const
Definition: InventoryItem.h:98

Here is the call graph for this function:

bool Client::CanThrow ( )
inline

Definition at line 431 of file Client.h.

References m_canThrow.

Referenced by ModuleManager::AddModule(), DestinyManager::AttemptDockOperation(), Colony::LaunchCommodities(), ModuleManager::Online(), Colony::PlanetXfer(), and Colony::TransferCommodities().

431 { return m_canThrow; }
bool m_canThrow
Definition: Client.h:439

Here is the caller graph for this function:

void Client::ChannelJoined ( LSCChannel chan)

Definition at line 1799 of file Client.cpp.

References m_channels.

Referenced by LSCChannel::JoinChannel().

1799  {
1800  m_channels.insert(chan);
1801 }
std::set< LSCChannel * > m_channels
Definition: Client.h:397

Here is the caller graph for this function:

void Client::ChannelLeft ( LSCChannel chan)

Definition at line 1803 of file Client.cpp.

References m_channels, and m_loaded.

Referenced by LSCChannel::LeaveChannel().

1803  {
1804  if (m_loaded)
1805  m_channels.erase(chan);
1806 }
bool m_loaded
Definition: Client.h:358
std::set< LSCChannel * > m_channels
Definition: Client.h:397

Here is the caller graph for this function:

void Client::CharNoLongerInStation ( )

Definition at line 1811 of file Client.cpp.

References GetAllianceID(), GetCorporationID(), GetWarFactionID(), InventoryItem::itemID(), m_char, m_StationData, m_system, PyDecRef, PyIncRef, sEntityList, SystemManager::SetDockCount(), and StationData::stationID.

Referenced by MoveToLocation(), and ~Client().

1811  {
1812  // clear station data
1813  // remove client from station guest list
1814  sEntityList.GetStationByID(m_StationData.stationID)->RemoveGuest(this);
1815  m_system->SetDockCount(this, false);
1816  OnCharNoLongerInStation ocnis;
1817  ocnis.charID = m_char->itemID();
1818  ocnis.corpID = GetCorporationID();
1819  ocnis.allianceID = GetAllianceID();
1820  ocnis.factionID = GetWarFactionID();
1821  PyTuple* tmp = ocnis.Encode();
1822  if (tmp == nullptr)
1823  return;
1824  std::vector<Client*> clients;
1825  clients.clear();
1826  sEntityList.GetStationGuestList(m_StationData.stationID, clients);
1827  for (auto cur : clients) {
1828  PyIncRef(tmp);
1829  cur->SendNotification("OnCharNoLongerInStation", "stationid", &tmp); //consumed
1830  }
1831  PyDecRef(tmp);
1832 
1833  // delete current station data
1835 }
CharacterRef m_char
Definition: Client.h:340
int32 GetWarFactionID() const
Definition: Client.h:126
int32 GetCorporationID() const
Definition: Client.h:123
#define sEntityList
Definition: EntityList.h:208
Python tuple.
Definition: PyRep.h:567
int32 GetAllianceID() const
Definition: Client.h:125
uint32 stationID
void SetDockCount(Client *pClient, bool docked=false)
#define PyDecRef(op)
Definition: PyRep.h:57
#define PyIncRef(op)
Definition: PyRep.h:56
SystemManager * m_system
Definition: Client.h:346
StationData m_StationData
Definition: Client.h:339
uint32 itemID() const
Definition: InventoryItem.h:98

Here is the call graph for this function:

Here is the caller graph for this function:

void Client::CharNowInStation ( )

Definition at line 1837 of file Client.cpp.

References GetAllianceID(), GetCorporationID(), GetWarFactionID(), InventoryItem::itemID(), m_char, m_locationID, m_system, PySafeDecRef, PySafeIncRef, sEntityList, and SystemManager::SetDockCount().

Referenced by MoveToLocation().

1837  {
1838  m_system->SetDockCount(this, true);
1839  OnCharNowInStation ocnis;
1840  ocnis.charID = m_char->itemID();
1841  ocnis.corpID = GetCorporationID();
1842  ocnis.allianceID = GetAllianceID();
1843  ocnis.warFactionID = GetWarFactionID();
1844  PyTuple* tmp = ocnis.Encode();
1845  std::vector<Client*> clients;
1846  clients.clear();
1847  sEntityList.GetStationGuestList(m_locationID, clients);
1848  for (auto cur : clients) {
1849  PySafeIncRef(tmp);
1850  cur->SendNotification("OnCharNowInStation", "stationid", &tmp);
1851  }
1852  PySafeDecRef(tmp);
1853 }
#define PySafeIncRef(op)
Definition: PyRep.h:60
CharacterRef m_char
Definition: Client.h:340
int32 GetWarFactionID() const
Definition: Client.h:126
int32 GetCorporationID() const
Definition: Client.h:123
#define sEntityList
Definition: EntityList.h:208
Python tuple.
Definition: PyRep.h:567
int32 GetAllianceID() const
Definition: Client.h:125
uint32 m_locationID
Definition: Client.h:377
void SetDockCount(Client *pClient, bool docked=false)
SystemManager * m_system
Definition: Client.h:346
#define PySafeDecRef(op)
Definition: PyRep.h:61
uint32 itemID() const
Definition: InventoryItem.h:98

Here is the call graph for this function:

Here is the caller graph for this function:

void Client::CheckBallparkTimer ( )

Definition at line 913 of file Client.cpp.

References _log, SystemEntity::DestinyMgr(), Timer::Enabled(), Timer::GetRemainingTime(), GetStateName(), DestinyManager::IsCloaked(), m_ballparkTimer, m_beyonce, m_bubbleWait, m_clientState, m_invul, m_login, m_setStateSent, pShipSE, and sLog.

Referenced by SetBallPark().

913  {
914  if (!m_ballparkTimer.Enabled()) {
915  sLog.Error("CheckBallparkTimer()", "BallPark Timer is disabled.");
916  } else {
917  sLog.Warning("CheckBallparkTimer()", "BallPark Time remaining %ums", m_ballparkTimer.GetRemainingTime());
918  }
919 
920  _log(CLIENT__TIMER, "CheckBallparkTimer(): State: %s, SetState: %s, Beyonce: %s, Login: %s", \
921  GetStateName(m_clientState).c_str(), m_setStateSent?"true":"false", \
922  m_beyonce?"true":"false", m_login?"true":"false");
923  _log(CLIENT__TIMER, "CheckBallparkTimer(): invul: %s, cloak: %s, bubblewait: %s", m_invul?"true":"false", \
924  pShipSE == nullptr? "ship null": pShipSE->DestinyMgr() == nullptr? "destiny null": pShipSE->DestinyMgr()->IsCloaked()?"true":"false", \
925  m_bubbleWait?"true":"false");
926 }
bool m_setStateSent
Definition: Client.h:368
#define _log(type, fmt,...)
Definition: logsys.h:124
std::string GetStateName(int8 state)
Definition: Client.cpp:1636
Timer m_ballparkTimer
Definition: Client.h:392
uint32 GetRemainingTime() const
Definition: timer.cpp:114
#define sLog
Evaluates to a NewLog instance.
Definition: LogNew.h:250
DestinyManager * DestinyMgr()
Definition: SystemEntity.h:198
bool Enabled() const
Definition: timer.h:41
bool m_bubbleWait
Definition: Client.h:367
ShipSE * pShipSE
Definition: Client.h:343
bool m_login
Definition: Client.h:356
bool m_beyonce
Definition: Client.h:359
int8 m_clientState
Definition: Client.h:402
bool m_invul
Definition: Client.h:355

Here is the call graph for this function:

Here is the caller graph for this function:

void Client::CheckShipRef ( ShipItemRef  newShipRef)
private

Definition at line 1049 of file Client.cpp.

References _log, RefPtr< X >::get(), InventoryItem::isSingleton(), InventoryItem::itemID(), m_char, m_login, m_ship, and InventoryItem::name().

Referenced by Board(), and BoardShip().

1050 {
1051  if (newShipRef.get() == nullptr) {
1052  _log(PLAYER__ERROR, "CheckShipRef() - %s: newShipRef == NULL.", m_char->name());
1053  throw CustomError ("Could not find ship's ItemRef. Cannot Board. Ref: ServerError 12321.");
1054  } else if (!newShipRef->isSingleton()) {
1055  _log(PLAYER__MESSAGE, "%s tried to board ship %u, which is not assembled.", m_char->name(), newShipRef->itemID());
1056  throw CustomError ("You cannot board a ship which is not assembled!");
1057  } else if ((m_ship == newShipRef) and !m_login) {
1058  // if char is loging in, this will hit. unknown about any other time.
1059  _log(PLAYER__MESSAGE, "%s tried to board active ship %u.", m_char->name(), newShipRef->itemID());
1060  throw CustomError ("You are already aboard this ship.");
1061  }
1062 }
#define _log(type, fmt,...)
Definition: logsys.h:124
CharacterRef m_char
Definition: Client.h:340
const char * name()
Advanced version of UserError that allows to send a full custom message.
Definition: PyExceptions.h:453
bool isSingleton() const
Definition: InventoryItem.h:96
X * get() const
Definition: RefPtr.h:213
ShipItemRef m_ship
Definition: Client.h:337
bool m_login
Definition: Client.h:356
uint32 itemID() const
Definition: InventoryItem.h:98

Here is the call graph for this function:

Here is the caller graph for this function:

void Client::ClearTradeSession ( )
inline

Definition at line 310 of file Client.h.

References m_TS.

Referenced by TradeService::CancelTrade().

310 { m_TS = nullptr; }
TradeSession * m_TS
Definition: Client.h:344

Here is the caller graph for this function:

bool Client::ContainsTypeQty ( uint16  typeID,
uint32  qty 
) const

Definition at line 1744 of file Client.cpp.

References flagCargoHold, flagHangar, RefPtr< X >::get(), Inventory::GetByTypeFlag(), InventoryItem::GetMyInventory(), GetShip(), m_locationID, InventoryItem::quantity(), sDataMgr, and sItemFactory.

Referenced by AgentBound::GetMissionObjectives(), and IsMissionComplete().

1745 {
1746  uint16 count = 0;
1747  InventoryItemRef iRef(nullptr);
1748  // this is for missions....we will have to determine if we have the TOTAL qty desired, in both cargo and hangar
1749  if (sDataMgr.IsStation(m_locationID)) {
1750  iRef = sItemFactory.GetStationItem(m_locationID)->GetMyInventory()->GetByTypeFlag(typeID, flagHangar);
1751  if (iRef.get() != nullptr)
1752  count = iRef->quantity();
1753  }
1754 
1755  iRef = GetShip()->GetMyInventory()->GetByTypeFlag(typeID, flagCargoHold);
1756  if (iRef.get() != nullptr)
1757  count += iRef->quantity();
1758 
1759  if (count >= qty)
1760  return true;
1761  return false;
1762 }
uint32 m_locationID
Definition: Client.h:377
ShipItemRef GetShip() const
Definition: Client.h:167
#define sItemFactory
Definition: ItemFactory.h:165
Inventory * GetMyInventory()
Definition: InventoryItem.h:91
unsigned __int16 uint16
Definition: eve-compat.h:48
InventoryItemRef GetByTypeFlag(uint32 typeID, EVEItemFlags flag) const
Definition: Inventory.cpp:444
int32 quantity() const
Definition: InventoryItem.h:97
#define sDataMgr

Here is the call graph for this function:

Here is the caller graph for this function:

void Client::CreateChar ( bool  set)
inline

Definition at line 434 of file Client.h.

References m_charCreation.

434 { m_charCreation = set; }
bool m_charCreation
Definition: Client.h:441
void Client::CreateNewPod ( )

Definition at line 1303 of file Client.cpp.

References flagCapsule, flagNone, InventoryItem::itemID(), InventoryItem::itemName(), itemTypeCapsule, locTemp, m_char, m_pod, Character::SetActivePod(), sItemFactory, and Character::solarSystemID().

Referenced by Eject(), ResetAfterPodded(), ResetAfterPopped(), and SetPodItem().

1303  {
1304  std::string pod_name = m_char->itemName() + "'s Capsule";
1305  ItemData podItem( itemTypeCapsule, m_char->itemID(), locTemp, flagNone, pod_name.c_str() );
1306  m_pod = sItemFactory.SpawnShip( podItem );
1307  // make sure this is singleton
1308  m_pod->ChangeSingleton(true);
1309  m_pod->Move(m_char->solarSystemID(), flagCapsule);
1310  m_pod->SaveShip();
1311  m_char->SetActivePod(m_pod->itemID()); // is this used?
1312 }
void SetActivePod(uint32 podID)
Definition: Character.cpp:1246
CharacterRef m_char
Definition: Client.h:340
uint32 solarSystemID() const
Definition: Character.h:327
ShipItemRef m_pod
Definition: Client.h:338
const std::string & itemName() const
#define sItemFactory
Definition: ItemFactory.h:165
uint32 itemID() const
Definition: InventoryItem.h:98

Here is the call graph for this function:

Here is the caller graph for this function:

void Client::CreateShipSE ( )

Definition at line 1004 of file Client.cpp.

References _log, FactionData::allianceID, FactionData::corporationID, FactionData::factionID, GetAllianceID(), GetCharacterID(), GetCorporationID(), SystemManager::GetServiceMgr(), GetWarFactionID(), InventoryItem::itemID(), m_char, m_ship, m_system, InventoryItem::name(), FactionData::ownerID, and pShipSE.

Referenced by MoveToPosition(), and SetDestiny().

1004  {
1005  FactionData data = FactionData();
1006  data.allianceID = GetAllianceID();
1008  data.factionID = GetWarFactionID();
1009  data.ownerID = GetCharacterID();
1010  pShipSE = new ShipSE(m_ship, *(m_system->GetServiceMgr()), m_system, data);
1011  _log(PLAYER__MESSAGE, "CreateShipSE() - pShipSE %p created for %s(%u)", pShipSE, m_char->name(), m_char->itemID());
1012 }
#define _log(type, fmt,...)
Definition: logsys.h:124
CharacterRef m_char
Definition: Client.h:340
int32 GetCharacterID() const
Definition: Client.h:113
int32 GetWarFactionID() const
Definition: Client.h:126
int32 GetCorporationID() const
Definition: Client.h:123
const char * name()
Definition: Ship.h:301
int32 GetAllianceID() const
Definition: Client.h:125
ShipItemRef m_ship
Definition: Client.h:337
PyServiceMgr * GetServiceMgr()
Definition: SystemManager.h:88
uint32 corporationID
ShipSE * pShipSE
Definition: Client.h:343
SystemManager * m_system
Definition: Client.h:346
uint32 itemID() const
Definition: InventoryItem.h:98

Here is the call graph for this function:

Here is the caller graph for this function:

void Client::CynoJump ( InventoryItemRef  beacon)

Definition at line 1454 of file Client.cpp.

References MapDB::AddJump(), Player::State::DriveJump, Timer::Enabled(), Player::State::Idle, Player::Timer::Jumping, JumpOutEffect(), InventoryItem::locationID(), m_char, m_clientState, m_locationID, m_movePoint, m_moveSystemID, m_stateTimer, GPoint::MakeRandomPointOnSphereLayer(), InventoryItem::name(), InventoryItem::position(), SetStateTimer(), sLog, and Character::VisitSystem().

1454  {
1456  sLog.Error("Client","%s: CynoJump called when a move is already pending. Ignoring.", m_char->name());
1457  // send client msg about state change in progress
1458  return;
1459  }
1460 
1462 
1463  m_moveSystemID = beacon->locationID();
1466 
1468 
1469  m_movePoint = beacon->position();
1471 
1473 }
void JumpOutEffect(uint32 locationID)
Definition: Client.cpp:1628
CharacterRef m_char
Definition: Client.h:340
const GPoint & position() const
uint32 m_moveSystemID
Definition: Client.h:378
const char * name()
uint32 m_locationID
Definition: Client.h:377
GPoint m_movePoint
Definition: Client.h:394
#define sLog
Evaluates to a NewLog instance.
Definition: LogNew.h:250
void VisitSystem(uint32 solarSystemID)
Definition: Character.cpp:1395
bool Enabled() const
Definition: timer.h:41
void MakeRandomPointOnSphereLayer(double radiusInner, double radiusOuter)
Definition: gpoint.h:59
uint32 locationID() const
Timer m_stateTimer
Definition: Client.h:381
void SetStateTimer(int8 state, uint32 time=Player::Timer::Default)
Definition: Client.cpp:1599
static void AddJump(uint32 sysID)
Definition: MapDB.cpp:218
int8 m_clientState
Definition: Client.h:402

Here is the call graph for this function:

void Client::DestroyShipSE ( )
protected

Definition at line 1014 of file Client.cpp.

References _log, InventoryItem::itemID(), m_char, m_ship, m_system, InventoryItem::name(), pShipSE, SystemManager::RemoveEntity(), and SafeDelete().

Referenced by MoveToLocation(), and WarpOut().

1014  {
1015  if (pShipSE != nullptr) {
1016  _log(PLAYER__MESSAGE, "DestroyShipSE() - pShipSE %p (%s) destroyed for %s(%u)", pShipSE, m_ship->name(), m_char->name(), m_char->itemID());
1019  } else {
1020  _log(PLAYER__WARNING, "DestroyShipSE() - pShipSE = null for %s(%u)", m_char->name(), m_char->itemID());
1021  }
1022  pShipSE = nullptr;
1023 }
#define _log(type, fmt,...)
Definition: logsys.h:124
CharacterRef m_char
Definition: Client.h:340
const char * name()
void SafeDelete(T *&p)
Deletes and nullifies a pointer.
Definition: SafeMem.h:83
void RemoveEntity(SystemEntity *pSE)
ShipItemRef m_ship
Definition: Client.h:337
ShipSE * pShipSE
Definition: Client.h:343
SystemManager * m_system
Definition: Client.h:346
uint32 itemID() const
Definition: InventoryItem.h:98

Here is the call graph for this function:

Here is the caller graph for this function:

void Client::DisconnectClient ( )

Definition at line 2279 of file Client.cpp.

References EVEClientSession::CloseClientConnection(), and SendNotifyMsg().

Referenced by Command_ban(), and Command_kick().

2280 {
2281  SendNotifyMsg("You have been kicked from this server and will be disconnected shortly.");
2282 
2283  //initiate closing the client TCP Connection
2285 }
void SendNotifyMsg(const char *fmt,...)
Definition: Client.cpp:2776
void CloseClientConnection()
Disconnects client from the server.
Definition: EVESession.h:93

Here is the call graph for this function:

Here is the caller graph for this function:

void Client::DockToStation ( )

Definition at line 942 of file Client.cpp.

References _log, SystemEntity::DestinyMgr(), ShipSE::Dock(), DestinyManager::DockingAccepted(), RefPtr< X >::get(), SystemManager::GetID(), SystemManager::GetName(), GetName(), SystemManager::GetStationFromInventory(), StationItem::HasShip(), Player::State::Idle, InventoryItem::itemID(), itemTypeCapsule, m_autoPilot, m_bubbleWait, m_char, m_clientState, m_dockStationID, m_setStateSent, m_ship, m_system, MoveToLocation(), NULL_ORIGIN(), pShipSE, sConfig, ShipItem::SetDocked(), SetSessionTimer(), SpawnNewRookieShip(), and InventoryItem::typeID().

Referenced by ProcessClient().

942  {
943  pShipSE->Dock();
944  // ap cleared on client side when docking.
945  m_autoPilot = false;
946  m_setStateSent = false;
948  _log(AUTOPILOT__TRACE, "DockToStation()() - m_clientState set to Idle");
950  m_bubbleWait = true; // deny client processing of subsquent destiny msgs
951 
952  //Check if player is in pod and have no ships in hangar, in which case they get a rookie ship for free
953  // on live, SCC sends mail about the loss of the players ship, and offers a shiny, new, fully-fitted ship as replacement. we dont....yet
954  // this needs to be done before player is docked
955  if (m_ship->typeID() == itemTypeCapsule) {
956  if (sConfig.server.NoobShipCheck) {
958  if (sRef.get() == nullptr) {
959  _log(CLIENT__ERROR, "%s(%u): DockToStation() - Station %u not found in inventory of %s(%u).", \
961  } else if (!sRef->HasShip(this)) { // need to get hangar items (flagHangar) by owner
963  }
964  } else {
966  }
967  }
968 
970 
971  SetSessionTimer();
972  m_ship->SetDocked();
973 }
bool m_setStateSent
Definition: Client.h:368
#define sConfig
A macro for easier access to the singleton.
#define _log(type, fmt,...)
Definition: logsys.h:124
CharacterRef m_char
Definition: Client.h:340
void MoveToLocation(uint32 location, const GPoint &pt)
Definition: Client.cpp:684
bool m_autoPilot
Definition: Client.h:365
uint32 GetID() const
Definition: SystemManager.h:80
bool HasShip(Client *pClient)
Definition: Station.cpp:242
DestinyManager * DestinyMgr()
Definition: SystemEntity.h:198
static const GPoint NULL_ORIGIN(0, 0, 0)
bool m_bubbleWait
Definition: Client.h:367
X * get() const
Definition: RefPtr.h:213
const char * GetName() const
Definition: Client.h:94
ShipItemRef m_ship
Definition: Client.h:337
StationItemRef GetStationFromInventory(uint32 stationID)
const char * GetName() const
Definition: SystemManager.h:84
ShipItemRef SpawnNewRookieShip(uint32 stationID)
Definition: Client.cpp:1314
ShipSE * pShipSE
Definition: Client.h:343
SystemManager * m_system
Definition: Client.h:346
uint32 m_dockStationID
Definition: Client.h:379
void Dock()
Definition: Ship.cpp:2543
void SetDocked()
Definition: Ship.h:150
void SetSessionTimer()
Definition: Client.h:250
uint16 typeID() const
uint32 itemID() const
Definition: InventoryItem.h:98
int8 m_clientState
Definition: Client.h:402

Here is the call graph for this function:

Here is the caller graph for this function:

void Client::Eject ( )

Definition at line 1133 of file Client.cpp.

References _log, SystemEntity::Abandon(), SystemManager::AddEntity(), FactionData::allianceID, FactionData::corporationID, CreateNewPod(), SystemEntity::DestinyMgr(), Ga::GaVec3::distance(), ShipItem::Eject(), DestinyManager::Eject(), FactionData::factionID, flagCapsule, flagShipOffline, RefPtr< X >::get(), GetAllianceID(), GetCharacterID(), GetCloneStationID(), GetCorporationID(), SystemEntity::GetID(), GetName(), SystemEntity::GetPosition(), SystemManager::GetServiceMgr(), TowerSE::GetSOI(), SystemBubble::GetTowerSE(), GetWarFactionID(), TowerSE::HasForceField(), SystemBubble::HasTower(), InventoryItem::itemID(), m_canThrow, m_char, m_locationID, m_pod, m_ship, m_system, MakeRandomInt(), GPoint::MakeRandomPointOnSphere(), InventoryItem::Move(), MoveToLocation(), InventoryItem::name(), NULL_ORIGIN(), FactionData::ownerID, pShipSE, InventoryItem::radius(), SendSessionChange(), InventoryItem::SetCustomInfo(), InventoryItem::SetFlag(), ShipSE::SetLauncherID(), ShipItem::SetPlayer(), InventoryItem::SetPosition(), SetShip(), snprintf, SystemEntity::SysBubble(), and UpdateNewShip().

1134 {
1135  if (m_pod.get() == nullptr)
1136  CreateNewPod();
1137 
1138  if (m_pod.get() == nullptr) {
1139  _log(SHIP__ERROR, "Handle_Eject() - Failed to get podItem for %s.", GetName());
1140  if (m_canThrow) {
1141  throw CustomError ("Something bad happened as you prepared to eject. Ref: ServerError 25107.");
1142  } else {
1143  return;
1144  }
1145  }
1146  // this should NEVER happen...
1147  if (pShipSE->SysBubble() == nullptr) {
1148  _log(SHIP__ERROR, "Handle_Eject() - Bubble is null for %s.", GetName());
1149  if (m_canThrow) {
1150  throw CustomError ("Something bad happened as you prepared to eject. Ref: ServerError 25107+1.");
1151  } else {
1152  return;
1153  }
1154  }
1155 
1156  // check for POS/FF in bubble. check for ship in FF. if so, then not abandoned.
1157  bool abandoned = true;
1158  if (pShipSE->SysBubble()->HasTower()) {
1159  TowerSE* ptSE = pShipSE->SysBubble()->GetTowerSE();
1160  if (ptSE->HasForceField())
1161  if (pShipSE->GetPosition().distance(ptSE->GetPosition()) < ptSE->GetSOI())
1162  abandoned = false;
1163  }
1164 
1165  char ci[45];
1166  if (abandoned) {
1167  pShipSE->Abandon();
1168  snprintf(ci, sizeof(ci), "Abandoned: %s(%u)", GetName(), m_char->itemID());
1169  } else {
1170  snprintf(ci, sizeof(ci), "Ejected: %s(%u)", GetName(), m_char->itemID());
1171  }
1172 
1173  m_ship->SetCustomInfo(ci);
1174  m_ship->SetPlayer(nullptr);
1176  m_ship->Eject();
1177 
1178  pShipSE->DestinyMgr()->Eject();
1179 
1180  GPoint capsulePosition(pShipSE->GetPosition());
1181  capsulePosition.MakeRandomPointOnSphere(m_ship->radius() + m_pod->radius() + MakeRandomInt(30, 120));
1182  m_pod->SetPosition(capsulePosition);
1184 
1185  FactionData data = FactionData();
1186  data.ownerID = GetCharacterID();
1187  data.factionID = GetWarFactionID();
1188  data.allianceID = GetAllianceID();
1190  ShipSE* newShipSE = new ShipSE(m_pod, *(m_system->GetServiceMgr()), m_system, data);
1191  if (newShipSE == nullptr) {
1192  _log(PLAYER__ERROR, "%s Eject() - pShipSE = NULL for shipID %u.", m_char->name(), m_pod->itemID());
1193  // we should probably send char to their clone station if this happens....
1195  throw CustomError ("There was a problem creating your pod in space.<br>You have been transfered to your home station.<br>Ref: ServerError 15107.");
1196  }
1197 
1198  newShipSE->SetLauncherID(pShipSE->GetID());
1199  // set shipSE to null. this allows sending AddBalls when pod added to system
1200  SetShip(m_pod);
1201  m_system->AddEntity(newShipSE);
1202  pShipSE = newShipSE;
1203 
1204  UpdateNewShip();
1205  //SetStateTimer(Player::State::Board, Player::Timer::Board);
1207 }
double radius() const
void AddEntity(SystemEntity *pSE, bool addSignal=true)
#define _log(type, fmt,...)
Definition: logsys.h:124
bool m_canThrow
Definition: Client.h:439
CharacterRef m_char
Definition: Client.h:340
bool SetFlag(EVEItemFlags flag, bool notify=false)
void MoveToLocation(uint32 location, const GPoint &pt)
Definition: Client.cpp:684
SystemBubble * SysBubble()
Definition: SystemEntity.h:195
int32 GetCharacterID() const
Definition: Client.h:113
int32 GetWarFactionID() const
Definition: Client.h:126
int32 GetCorporationID() const
Definition: Client.h:123
void SetPosition(const GPoint &pos)
void SendSessionChange()
Definition: Client.cpp:2048
const char * name()
uint16 GetSOI()
Definition: Tower.h:90
Definition: Ship.h:301
Advanced version of UserError that allows to send a full custom message.
Definition: PyExceptions.h:453
int32 GetAllianceID() const
Definition: Client.h:125
const GPoint & GetPosition() const
Definition: SystemEntity.h:211
void Move(uint32 new_location=locTemp, EVEItemFlags flag=flagNone, bool notify=false)
TowerSE * GetTowerSE()
Definition: SystemBubble.h:142
uint32 m_locationID
Definition: Client.h:377
Definition: gpoint.h:33
DestinyManager * DestinyMgr()
Definition: SystemEntity.h:198
void SetShip(ShipItemRef shipRef)
Definition: Client.cpp:1278
static const GPoint NULL_ORIGIN(0, 0, 0)
#define snprintf
Definition: eve-compat.h:184
void SetLauncherID(uint32 shipID)
Definition: Ship.h:359
uint32 GetID()
Definition: SystemEntity.h:207
X * get() const
Definition: RefPtr.h:213
const char * GetName() const
Definition: Client.h:94
ShipItemRef m_pod
Definition: Client.h:338
ShipItemRef m_ship
Definition: Client.h:337
void SetCustomInfo(const char *ci)
PyServiceMgr * GetServiceMgr()
Definition: SystemManager.h:88
int32 GetCloneStationID() const
Definition: Client.h:116
uint32 corporationID
void Eject()
Definition: Ship.cpp:350
int64 MakeRandomInt(int64 low, int64 high)
Generates random integer from interval [low; high].
Definition: misc.cpp:109
bool HasTower()
Definition: SystemBubble.h:141
virtual void SetPlayer(Client *pClient)
Definition: Ship.cpp:106
ShipSE * pShipSE
Definition: Client.h:343
SystemManager * m_system
Definition: Client.h:346
Definition: Tower.h:19
GaExpInl GaFloat distance(const GaVec3 &oth) const
Definition: GaTypes.h:158
void MakeRandomPointOnSphere(double radius)
Definition: gpoint.h:46
void CreateNewPod()
Definition: Client.cpp:1303
bool HasForceField()
Definition: Tower.h:76
virtual void Abandon()
void UpdateNewShip()
Definition: Client.cpp:1025
uint32 itemID() const
Definition: InventoryItem.h:98

Here is the call graph for this function:

void Client::EnterSystem ( uint32  systemID)

Definition at line 679 of file Client.cpp.

References m_ship, MoveToLocation(), and InventoryItem::position().

Referenced by Command_addball(), Command_addball2(), Command_destinyvars(), Command_entityspawn(), Command_halt(), Command_list(), Command_location(), Command_sendstate(), Command_shipvars(), Command_status(), Command_syncloc(), Command_syncpos(), Command_update(), and Command_warpto().

680 {
681  MoveToLocation(systemID, m_ship->position());
682 }
void MoveToLocation(uint32 location, const GPoint &pt)
Definition: Client.cpp:684
const GPoint & position() const
ShipItemRef m_ship
Definition: Client.h:337

Here is the call graph for this function:

Here is the caller graph for this function:

void Client::ExecuteDriveJump ( )
protected

Definition at line 1494 of file Client.cpp.

References _log, Player::State::Idle, Player::Timer::Jump, ShipSE::Jump(), JumpInEffect(), m_clientState, m_movePoint, m_moveSystemID, MoveToLocation(), NULL_ORIGIN(), pShipSE, SendNotification(), and SetBallParkTimer().

Referenced by ProcessClient().

1494  {
1495  if (m_movePoint == NULL_ORIGIN) { // this is part of infant AP hack
1497  _log(AUTOPILOT__TRACE, "ExecuteJump() - movePoint = null; state set to Idle");
1498  return;
1499  }
1500 
1501  //OnScannerInfoRemoved - no args. flushes scan data in client
1502  SendNotification("OnScannerInfoRemoved", "charid", new PyTuple(0), true); // this is sequenced
1503  pShipSE->Jump(false);
1504 
1506 
1507  JumpInEffect();
1508 
1510 
1512  m_moveSystemID = 0;
1513 }
void SendNotification(const PyAddress &dest, EVENotificationStream &noti, bool seq=true)
Definition: Client.cpp:2245
#define _log(type, fmt,...)
Definition: logsys.h:124
void JumpInEffect()
Definition: Client.cpp:1620
void MoveToLocation(uint32 location, const GPoint &pt)
Definition: Client.cpp:684
void SetBallParkTimer(uint32 time=Player::Timer::Default)
Definition: Client.cpp:1515
uint32 m_moveSystemID
Definition: Client.h:378
Python tuple.
Definition: PyRep.h:567
GPoint m_movePoint
Definition: Client.h:394
static const GPoint NULL_ORIGIN(0, 0, 0)
ShipSE * pShipSE
Definition: Client.h:343
void Jump(bool showCloak=true)
Definition: Ship.cpp:2553
int8 m_clientState
Definition: Client.h:402

Here is the call graph for this function:

Here is the caller graph for this function:

void Client::ExecuteJump ( )
protected

Definition at line 1475 of file Client.cpp.

References _log, Player::State::Idle, Player::Timer::Jump, ShipSE::Jump(), m_clientState, m_movePoint, m_moveSystemID, MoveToLocation(), NULL_ORIGIN(), pShipSE, SendNotification(), and SetBallParkTimer().

Referenced by ProcessClient().

1475  {
1476  if (m_movePoint == NULL_ORIGIN) { // this is part of infant AP hack
1478  _log(AUTOPILOT__TRACE, "ExecuteJump() - movePoint = null; state set to Idle");
1479  return;
1480  }
1481 
1482  //OnScannerInfoRemoved - no args. flushes scan data in client
1483  SendNotification("OnScannerInfoRemoved", "charid", new PyTuple(0), true); // this is sequenced
1484  pShipSE->Jump();
1485 
1487 
1489 
1491  m_moveSystemID = 0;
1492 }
void SendNotification(const PyAddress &dest, EVENotificationStream &noti, bool seq=true)
Definition: Client.cpp:2245
#define _log(type, fmt,...)
Definition: logsys.h:124
void MoveToLocation(uint32 location, const GPoint &pt)
Definition: Client.cpp:684
void SetBallParkTimer(uint32 time=Player::Timer::Default)
Definition: Client.cpp:1515
uint32 m_moveSystemID
Definition: Client.h:378
Python tuple.
Definition: PyRep.h:567
GPoint m_movePoint
Definition: Client.h:394
static const GPoint NULL_ORIGIN(0, 0, 0)
ShipSE * pShipSE
Definition: Client.h:343
void Jump(bool showCloak=true)
Definition: Ship.cpp:2553
int8 m_clientState
Definition: Client.h:402

Here is the call graph for this function:

Here is the caller graph for this function:

void Client::FlushQueue ( )

Definition at line 2118 of file Client.cpp.

References _SendQueuedUpdates(), PyList::empty(), m_destinyEventQueue, and m_destinyUpdateQueue.

2118  {
2119  if ((!m_destinyUpdateQueue->empty())
2120  or (!m_destinyEventQueue->empty()))
2122 }
PyList * m_destinyEventQueue
Definition: Client.h:460
PyList * m_destinyUpdateQueue
Definition: Client.h:461
void _SendQueuedUpdates()
Definition: Client.cpp:2170
bool empty() const
Definition: PyRep.h:664

Here is the call graph for this function:

int64 Client::GetAccountRole ( ) const
inline

Definition at line 118 of file Client.h.

References ClientSession::GetCurrentLong(), and pSession.

Referenced by LSCChannel::_MakeSenderInfo(), CommandDispatcher::Execute(), LSCChannel::JoinChannel(), SlashService::SlashCommand(), and LSCDB::UpdateSubscription().

118 { return pSession->GetCurrentLong( "role" ); }
int64 GetCurrentLong(const char *name) const
ClientSession * pSession
Definition: Client.h:345

Here is the call graph for this function:

Here is the caller graph for this function:

int32 Client::GetAccountType ( ) const
inline

Definition at line 110 of file Client.h.

References ClientSession::GetCurrentInt(), and pSession.

110 { return pSession->GetCurrentInt( "userType" ); }
int32 GetCurrentInt(const char *name) const
ClientSession * pSession
Definition: Client.h:345

Here is the call graph for this function:

std::string Client::GetAddress ( ) const
inline

Definition at line 106 of file Client.h.

References ClientSession::GetCurrentString(), and pSession.

Referenced by _VerifyCrypto(), _VerifyFuncResult(), and _VerifyVersion().

106 { return pSession->GetCurrentString( "address" ); }
std::string GetCurrentString(const char *name) const
ClientSession * pSession
Definition: Client.h:345

Here is the call graph for this function:

Here is the caller graph for this function:

PyRep * Client::GetAggressors ( ) const

Definition at line 1389 of file Client.cpp.

1389  {
1390  PyDict* dict(nullptr);
1391  /*
1392  * for aggressorID, aggressor in aggressors.iteritems():
1393  * for aggresseeID, lastAggression in aggressor.iteritems():
1394  * lastAggression = int(lastAggression / SEC) * SEC
1395  * when = lastAggression + const.aggressionTime * MIN
1396  * self.clearAggressions[aggressorID, aggresseeID, solarsystemID] = when
1397  *
1398  * aggressionTime = 15
1399  */
1400  /* items are set here as
1401  * [PyInt 90971469] <- entity (aggressorID)
1402  * [PyDict 1 kvp] <- dictionary
1403  * [PyInt 1000127] <- entity (aggresseeID)
1404  * [PyIntegerVar 129550906897224125] <- beginning timestamp (lastAggression)
1405  */
1406 
1407  return dict;
1408 }
Python's dictionary.
Definition: PyRep.h:719
float Client::GetBalance ( uint8  type = Account::CreditType::ISK)
inline

Definition at line 176 of file Client.h.

References Character::balance(), and m_char.

Referenced by AccountService::TranserFunds().

177  { return m_char->balance(type); }
CharacterRef m_char
Definition: Client.h:340
float balance(uint8 type)
Definition: Character.cpp:363

Here is the call graph for this function:

Here is the caller graph for this function:

float Client::GetBounty ( ) const
inline

Definition at line 171 of file Client.h.

References Character::bounty(), and m_char.

Referenced by ShipSE::MakeSlimItem(), and DestinyManager::UpdateNewShip().

171 { return m_char->bounty(); }
CharacterRef m_char
Definition: Client.h:340
float bounty() const
Definition: Character.h:287

Here is the call graph for this function:

Here is the caller graph for this function:

CharacterRef Client::GetChar ( ) const
inline

Definition at line 164 of file Client.h.

References m_char.

Referenced by LSCChannel::_MakeSenderInfo(), ActiveModule::ActiveModule(), CorporationDB::AddCorporation(), FleetService::AddMember(), ActiveModule::ApplyEffect(), ReprocessingServiceBound::CalcReprocessingEfficiency(), Agent::CanUseAgent(), Command_fleetboost(), Command_giveallskills(), Command_giveskill(), Command_showsession(), Command_skilllist(), AllianceDB::CreateAlliance(), FleetService::CreateFleet(), CynoModule::CynoModule(), GenericModule::DeOverload(), RamMethods::EncodeMissingMaterials(), MarketMgr::ExecuteBuyOrder(), MarketMgr::ExecuteSellOrder(), FleetService::FleetBroadcast(), FleetService::GetBoosterData(), DroneSE::GetBounty(), DroneSE::GetSecurityRating(), ReprocessingServiceBound::GetStanding(), ProbeSE::HasMaxSkill(), RamMethods::ItemLocationCheck(), Sentry::Killed(), CustomsSE::Killed(), NPC::Killed(), DroneSE::Killed(), StructureSE::Killed(), ShipSE::Killed(), ShipSE::LaunchDrone(), ActiveModule::LaunchProbe(), FleetService::LeaveFleet(), RamMethods::LinePermissionCheck(), ActiveModule::LoadCharge(), RamMethods::MaterialSkillsCheck(), Missile::Missile(), GenericModule::Offline(), GenericModule::Online(), GenericModule::Overload(), ProbeSE::ProbeSE(), ActiveModule::Process(), ProcessClient(), ShipItem::ProcessEffects(), ShipItem::ProcessShipEffects(), Prospector::Prospector(), FleetService::RemoveMember(), ActiveModule::ReprocessCharge(), ShipItem::ResetEffects(), ShipItem::SetPlayer(), TargetManager::StartTargeting(), ActiveModule::UnloadCharge(), Prospector::Update(), ActiveModule::Update(), FleetService::UpdateMember(), Agent::UpdateStandings(), RamMethods::VerifyCompleteJob(), ShipItem::VerifyHoldType(), and DestinyManager::WarpTo().

164 { return m_char; }
CharacterRef m_char
Definition: Client.h:340
int32 Client::GetCharacterID ( ) const
inline

Definition at line 113 of file Client.h.

References ClientSession::GetCurrentInt(), and pSession.

Referenced by LSCChannel::_MakeSenderInfo(), Colony::AbandonColony(), RamMethods::ActivityCheck(), SystemManager::AddClient(), CorporationDB::AddCorporation(), StationItem::AddGuest(), FleetService::AddMember(), EntityList::AddPlayer(), DynamicSystemEntity::AwardBounty(), Colony::Colony(), Command_giveallskills(), Command_giveisk(), Command_giveskill(), Command_showsession(), Command_skilllist(), Command_spawn(), AllianceDB::CreateAlliance(), Colony::CreateCommandPin(), CynoModule::CreateCyno(), Colony::CreateLink(), PlanetMgr::CreatePin(), Colony::CreatePin(), CreateShipSE(), Eject(), RamMethods::EncodeMissingMaterials(), TradeBound::ExchangeItems(), MarketMgr::ExecuteBuyOrder(), MarketMgr::ExecuteSellOrder(), FleetService::FleetBroadcast(), generic_createitem(), FleetService::GetAvailableFleets(), StandingDB::GetCharStandings(), PlanetSE::GetColony(), Colony::GetColony(), FleetService::GetFleetAdvert(), Colony::GetOwner(), ReprocessingServiceBound::GetQuote(), ReprocessingServiceBound::GetStanding(), StationItem::HasShip(), Colony::Init(), TradeService::InitiateTrade(), RamMethods::ItemOwnerCheck(), LSCChannel::JoinChannel(), Sentry::Killed(), CustomsSE::Killed(), NPC::Killed(), DroneSE::Killed(), StructureSE::Killed(), ShipSE::Killed(), Colony::LaunchCommodities(), ActiveModule::LaunchMissile(), ActiveModule::LaunchProbe(), LSCChannel::LeaveChannel(), ShipSE::MakeSlimItem(), Colony::PlanetXfer(), ProbeSE::ProbeSE(), DestinyManager::ProcessState(), SystemBubble::Remove(), SystemManager::RemoveClient(), StationItem::RemoveGuest(), EntityList::RemovePlayer(), Scan::RequestScans(), ResetAfterPopped(), SelfEveMail(), DestinyManager::SendDestinyUpdate(), LSCChannel::SendMessage(), CynoModule::SendOnJumpBeaconChange(), DestinyManager::SendSetState(), SystemManager::SetDockCount(), DestinyManager::SetMaxVelocity(), DroneSE::SetOwner(), AccountService::TranserFunds(), DestinyManager::UpdateNewShip(), LSCDB::UpdateSubscription(), and PlanetMgr::UpgradeCommandCenter().

113 { return pSession->GetCurrentInt( "charid" ); }
int32 GetCurrentInt(const char *name) const
ClientSession * pSession
Definition: Client.h:345

Here is the call graph for this function:

uint32 Client::GetCharID ( )
inline

Definition at line 166 of file Client.h.

References RefPtr< X >::get(), InventoryItem::itemID(), and m_char.

Referenced by EntityList::AddPlayer(), EntityList::RemovePlayer(), and DestinyManager::SendDestinyUpdate().

166 { return (m_char.get() != nullptr ? m_char->itemID() : 0); } // only used during char creation
CharacterRef m_char
Definition: Client.h:340
X * get() const
Definition: RefPtr.h:213
uint32 itemID() const
Definition: InventoryItem.h:98

Here is the call graph for this function:

Here is the caller graph for this function:

std::string Client::GetCharName ( )
inline

Definition at line 165 of file Client.h.

References InventoryItem::itemName(), and m_char.

Referenced by Command_giveskill(), TradeBound::ExchangeItems(), and LSCChannel::JoinChannel().

165 { return m_char->itemName(); }
CharacterRef m_char
Definition: Client.h:340
const std::string & itemName() const

Here is the call graph for this function:

Here is the caller graph for this function:

int64 Client::GetClientID ( ) const
inline

Definition at line 119 of file Client.h.

References ClientSession::GetCurrentLong(), and pSession.

Referenced by FleetService::AddMember(), and Command_showsession().

119 { return pSession->GetCurrentLong( "clientID" ); }
int64 GetCurrentLong(const char *name) const
ClientSession * pSession
Definition: Client.h:345

Here is the call graph for this function:

Here is the caller graph for this function:

int32 Client::GetCloneStationID ( ) const
inline

Definition at line 116 of file Client.h.

References ClientSession::GetCurrentInt(), and pSession.

Referenced by Command_showsession(), Command_tr(), Eject(), ResetAfterPodded(), and ResetAfterPopped().

116 { return pSession->GetCurrentInt( "cloneStationID" ); }
int32 GetCurrentInt(const char *name) const
ClientSession * pSession
Definition: Client.h:345

Here is the call graph for this function:

Here is the caller graph for this function:

uint32 Client::GetConstellationID ( ) const
inline

Definition at line 153 of file Client.h.

References SystemData::constellationID, and m_SystemData.

Referenced by Command_showsession().

153 { return m_SystemData.constellationID; }
SystemData m_SystemData
Definition: Client.h:336
uint32 constellationID

Here is the caller graph for this function:

int32 Client::GetCorpAccountKey ( ) const
inline

Definition at line 127 of file Client.h.

References ClientSession::GetCurrentInt(), and pSession.

Referenced by Command_showsession().

127 { return pSession->GetCurrentInt( "corpAccountKey" ); }
int32 GetCurrentInt(const char *name) const
ClientSession * pSession
Definition: Client.h:345

Here is the call graph for this function:

Here is the caller graph for this function:

int32 Client::GetCorpHQ ( ) const
inline

Definition at line 124 of file Client.h.

References ClientSession::GetCurrentInt(), and pSession.

Referenced by Command_showsession(), and RamMethods::LocationRolesCheck().

124 { return pSession->GetCurrentInt( "hqID" ); }
int32 GetCurrentInt(const char *name) const
ClientSession * pSession
Definition: Client.h:345

Here is the call graph for this function:

Here is the caller graph for this function:

int64 Client::GetCorpRole ( ) const
inline

Definition at line 129 of file Client.h.

References ClientSession::GetCurrentLong(), and pSession.

Referenced by LSCChannel::_MakeSenderInfo(), EntityList::AddPlayer(), Command_showsession(), MarketMgr::ExecuteBuyOrder(), ReprocessingServiceBound::GetQuote(), RamMethods::HangarRolesCheck(), RamMethods::LinePermissionCheck(), and RamMethods::VerifyCompleteJob().

129 { return pSession->GetCurrentLong( "corprole" ); }
int64 GetCurrentLong(const char *name) const
ClientSession * pSession
Definition: Client.h:345

Here is the call graph for this function:

Here is the caller graph for this function:

double Client::GetCorpTaxRate ( )
inline

Definition at line 122 of file Client.h.

References Character::corpTaxRate(), RefPtr< X >::get(), and m_char.

Referenced by AccountService::TranserFunds().

122 { return (m_char.get() != nullptr ? m_char->corpTaxRate() : 0.0); }
CharacterRef m_char
Definition: Client.h:340
X * get() const
Definition: RefPtr.h:213
float corpTaxRate() const
Definition: Character.h:305

Here is the call graph for this function:

Here is the caller graph for this function:

GPoint Client::GetDockPoint ( )
inline

Definition at line 226 of file Client.h.

References m_dockPoint.

226 { return m_dockPoint; }
GPoint m_dockPoint
Definition: Client.h:395
uint32 Client::GetDockStationID ( )
inline

Definition at line 225 of file Client.h.

References m_dockStationID.

Referenced by DestinyManager::AttemptDockOperation(), Command_tr(), and DestinyManager::DockingAccepted().

225 { return m_dockStationID; };
uint32 m_dockStationID
Definition: Client.h:379

Here is the caller graph for this function:

uint32 Client::GetFleetID ( ) const
inline
int8 Client::GetFleetRole ( )
inline

Definition at line 140 of file Client.h.

References ClientSession::GetCurrentInt(), and pSession.

Referenced by IsFleetBooster(), and IsFleetBoss().

140 { return pSession->GetCurrentInt("fleetrole"); }
int32 GetCurrentInt(const char *name) const
ClientSession * pSession
Definition: Client.h:345

Here is the call graph for this function:

Here is the caller graph for this function:

std::string Client::GetLanguageID ( ) const
inline

Definition at line 107 of file Client.h.

References ClientSession::GetCurrentString(), and pSession.

Referenced by _VerifyFuncResult().

107 { return pSession->GetCurrentString( "languageID" ); }
std::string GetCurrentString(const char *name) const
ClientSession * pSession
Definition: Client.h:345

Here is the call graph for this function:

Here is the caller graph for this function:

uint32 Client::GetLoyaltyPoints ( uint32  corpID)

Definition at line 1704 of file Client.cpp.

References m_lpMap.

1704  {
1705  std::map<uint32, uint32>::iterator itr = m_lpMap.find(corpID);
1706  if (itr != m_lpMap.end())
1707  return itr->second;
1708  return 0;
1709 }
std::map< uint32, uint32 > m_lpMap
Definition: Client.h:466
const char* Client::GetName ( ) const
inline

Definition at line 94 of file Client.h.

References RefPtr< X >::get(), m_char, and InventoryItem::name().

Referenced by LSCChannel::_MakeSenderInfo(), CynoModule::Activate(), ModuleManager::Activate(), RamMethods::ActivityCheck(), SystemManager::AddClient(), SystemEntity::ApplyDamage(), DestinyManager::AttemptDockOperation(), DynamicSystemEntity::AwardBounty(), SystemEntity::AwardSecurityStatus(), PyServiceMgr::BindObject(), Board(), BoardShip(), DestinyManager::Bump(), Colony::Colony(), Command_showsession(), Command_spawn(), Command_spawnn(), Command_targlist(), EntityService::CreateBoundObject(), PosMgr::CreateBoundObject(), ReprocessingService::CreateBoundObject(), AllianceRegistry::CreateBoundObject(), AgentMgrService::CreateBoundObject(), CorpRegistryService::CreateBoundObject(), PyCallableDispatcher< Svc >::Dispatch(), DockToStation(), Eject(), CommandDispatcher::Execute(), FleetService::FleetBroadcast(), ReprocessingServiceBound::GetQuote(), ModuleManager::InstallRig(), ModuleManager::InstallSubSystem(), LSCChannel::JoinChannel(), Colony::LaunchCommodities(), LSCChannel::LeaveChannel(), MoveToLocation(), Scan::ProbeScanResult(), ShipSE::Process(), DestinyManager::ProcessState(), SystemBubble::RemoveBalls(), SystemManager::RemoveClient(), Scan::RequestScans(), SystemBubble::SendAddBalls(), SystemBubble::SendAddBalls2(), DestinyManager::SendDestinyUpdate(), SendNotification(), DestinyManager::SendSetState(), SetAutoPilot(), SetDestiny(), SystemManager::SetDockCount(), DestinyManager::SetMaxVelocity(), SlashService::SlashCommand(), TargetManager::StartTargeting(), Scan::SystemScanStarted(), ModuleManager::UnloadCharge(), UpdateNewShip(), WarpIn(), and WarpOut().

94 { return (m_char.get() != nullptr ? m_char->name() : "(null)"); }
CharacterRef m_char
Definition: Client.h:340
const char * name()
X * get() const
Definition: RefPtr.h:213

Here is the call graph for this function:

ShipItemRef Client::GetPod ( ) const
inline

Definition at line 169 of file Client.h.

References m_pod.

169 { return m_pod; }
ShipItemRef m_pod
Definition: Client.h:338
uint32 Client::GetPodID ( ) const
inline

Definition at line 170 of file Client.h.

References InventoryItem::itemID(), and m_pod.

170 { return m_pod->itemID(); }
ShipItemRef m_pod
Definition: Client.h:338
uint32 itemID() const
Definition: InventoryItem.h:98

Here is the call graph for this function:

uint32 Client::GetRegionID ( ) const
inline

Definition at line 154 of file Client.h.

References m_SystemData, and SystemData::regionID.

Referenced by Command_showsession(), Command_spawn(), CorporationDB::CreateAdvert(), and RamMethods::InstallationCheck().

154 { return m_SystemData.regionID; }
SystemData m_SystemData
Definition: Client.h:336
uint32 regionID

Here is the caller graph for this function:

int64 Client::GetRolesAtAll ( ) const
inline

Definition at line 131 of file Client.h.

References ClientSession::GetCurrentLong(), and pSession.

Referenced by Command_showsession(), and ReprocessingServiceBound::GetQuote().

131 { return pSession->GetCurrentLong( "rolesAtAll" ); }
int64 GetCurrentLong(const char *name) const
ClientSession * pSession
Definition: Client.h:345

Here is the call graph for this function:

Here is the caller graph for this function:

int64 Client::GetRolesAtBase ( ) const
inline

Definition at line 133 of file Client.h.

References ClientSession::GetCurrentLong(), and pSession.

Referenced by Command_showsession().

133 { return pSession->GetCurrentLong( "rolesAtBase" ); }
int64 GetCurrentLong(const char *name) const
ClientSession * pSession
Definition: Client.h:345

Here is the call graph for this function:

Here is the caller graph for this function:

int64 Client::GetRolesAtHQ ( ) const
inline

Definition at line 135 of file Client.h.

References ClientSession::GetCurrentLong(), and pSession.

Referenced by Command_showsession(), and RamMethods::LocationRolesCheck().

135 { return pSession->GetCurrentLong( "rolesAtHQ" ); }
int64 GetCurrentLong(const char *name) const
ClientSession * pSession
Definition: Client.h:345

Here is the call graph for this function:

Here is the caller graph for this function:

int64 Client::GetRolesAtOther ( ) const
inline

Definition at line 137 of file Client.h.

References ClientSession::GetCurrentLong(), and pSession.

Referenced by Command_showsession().

137 { return pSession->GetCurrentLong( "rolesAtOther" ); }
int64 GetCurrentLong(const char *name) const
ClientSession * pSession
Definition: Client.h:345

Here is the call graph for this function:

Here is the caller graph for this function:

float Client::GetSecurityRating ( ) const
inline

Definition at line 172 of file Client.h.

References Character::GetSecurityRating(), and m_char.

Referenced by Command_secstatus(), FleetService::GetAvailableFleets(), FleetService::GetFleetAdvert(), ShipSE::Killed(), RamMethods::LinePermissionCheck(), ShipSE::MakeSlimItem(), ProbeSE::ProbeSE(), and DestinyManager::UpdateNewShip().

172 { return m_char->GetSecurityRating(); }
float GetSecurityRating() const
Definition: Character.h:289
CharacterRef m_char
Definition: Client.h:340

Here is the call graph for this function:

Here is the caller graph for this function:

ClientSession* Client::GetSession ( )
inline

Definition at line 104 of file Client.h.

References pSession.

Referenced by Command_showsession().

104 { return pSession; }
ClientSession * pSession
Definition: Client.h:345

Here is the caller graph for this function:

uint32 Client::GetSessionChangeTime ( )
inline

Definition at line 242 of file Client.h.

References Timer::GetRemainingTime(), and m_sessionTimer.

Referenced by Command_sendstate(), Command_syncloc(), Command_syncpos(), and Command_update().

242 { return m_sessionTimer.GetRemainingTime() / 1000; }
uint32 GetRemainingTime() const
Definition: timer.cpp:114
Timer m_sessionTimer
Definition: Client.h:391

Here is the call graph for this function:

Here is the caller graph for this function:

int32 Client::GetSquadID ( ) const
inline

Definition at line 148 of file Client.h.

References m_squad.

148 { return m_squad; }
int32 m_squad
Definition: Client.h:372
std::string Client::GetStateName ( int8  state)
private

Definition at line 1636 of file Client.cpp.

References Player::State::Board, Player::State::Dock, Player::State::DriveJump, Player::State::Idle, Player::State::Jump, Player::State::Killed, Player::State::Login, Player::State::Logout, and Player::State::Undock.

Referenced by CheckBallparkTimer(), ProcessClient(), SetBallPark(), and SetStateTimer().

1637 {
1638  switch (state) {
1639  case Player::State::Idle: return "Idle";
1640  case Player::State::Jump: return "Jump";
1641  case Player::State::DriveJump: return "DriveJump";
1642  case Player::State::Dock: return "Dock";
1643  case Player::State::Undock: return "Undock";
1644  case Player::State::Killed: return "Killed";
1645  case Player::State::Logout: return "Logout";
1646  case Player::State::Board: return "Board";
1647  case Player::State::Login: return "Login";
1648  }
1649  return "Undefined";
1650 }
entityID heal the character with the entityID note giving you detailed ship status information gives a list of all dynamic entities and players and their destinyState in this bubble shows some current destiny variables save all kick all and halt server immediate command list all items in current location s gives list of cargo contents and volumes in all holds list current session values show current ship DNA show current objects in their destiny state

Here is the caller graph for this function:

int32 Client::GetStationID ( ) const
inline

Definition at line 114 of file Client.h.

References ClientSession::GetCurrentInt(), and pSession.

Referenced by CorporationDB::AddCorporation(), Command_inventory(), Command_showsession(), CorporationDB::CreateAdvert(), TradeBound::ExchangeItems(), and generic_createitem().

114 { return pSession->GetCurrentInt( "stationid" ); }
int32 GetCurrentInt(const char *name) const
ClientSession * pSession
Definition: Client.h:345

Here is the call graph for this function:

Here is the caller graph for this function:

int32 Client::GetStationID2 ( ) const
inline

Definition at line 115 of file Client.h.

References ClientSession::GetCurrentInt(), and pSession.

Referenced by Command_showsession().

115 { return pSession->GetCurrentInt( "stationid2" ); }
int32 GetCurrentInt(const char *name) const
ClientSession * pSession
Definition: Client.h:345

Here is the call graph for this function:

Here is the caller graph for this function:

std::string Client::GetSystemName ( ) const
inline

Definition at line 155 of file Client.h.

References m_SystemData, and SystemData::name.

Referenced by DynamicSystemEntity::AwardBounty(), Command_bubblewarp(), Command_dropLoot(), TradeBound::ExchangeItems(), and Scan::RequestScans().

155 { return m_SystemData.name; }
SystemData m_SystemData
Definition: Client.h:336
std::string name

Here is the caller graph for this function:

TradeSession* Client::GetTradeSession ( )
inline

Definition at line 311 of file Client.h.

References m_TS.

Referenced by TradeService::CancelTrade(), and ~Client().

311 { return m_TS; }
TradeSession * m_TS
Definition: Client.h:344

Here is the caller graph for this function:

uint32 Client::GetUserCount ( )
protected

Definition at line 2309 of file Client.cpp.

References sEntityList.

2310 {
2311  return sEntityList.GetClientCount();
2312 }
#define sEntityList
Definition: EntityList.h:208
int32 Client::GetUserID ( ) const
inline

Definition at line 109 of file Client.h.

References ClientSession::GetCurrentInt(), and pSession.

Referenced by _SendCallReturn(), _SendException(), _SendPingRequest(), _SendPingResponse(), _VerifyFuncResult(), BanClient(), Command_showsession(), SelectCharacter(), SendInitialSessionStatus(), SendNotification(), SendSessionChange(), and ~Client().

109 { return pSession->GetCurrentInt( "userid" ); }
int32 GetCurrentInt(const char *name) const
ClientSession * pSession
Definition: Client.h:345

Here is the call graph for this function:

Here is the caller graph for this function:

int32 Client::GetWarFactionID ( ) const
inline

Definition at line 126 of file Client.h.

References ClientSession::GetCurrentInt(), and pSession.

Referenced by ActiveModule::CanActivate(), CharNoLongerInStation(), CharNowInStation(), Command_spawn(), CreateShipSE(), Eject(), FleetService::GetAvailableFleets(), FleetService::GetFleetAdvert(), LSCChannel::JoinChannel(), Colony::LaunchCommodities(), ProbeSE::ProbeSE(), ResetAfterPopped(), and DroneSE::SetOwner().

126 { return pSession->GetCurrentInt( "warfactionid" ); }
int32 GetCurrentInt(const char *name) const
ClientSession * pSession
Definition: Client.h:345

Here is the call graph for this function:

Here is the caller graph for this function:

int32 Client::GetWingID ( ) const
inline

Definition at line 147 of file Client.h.

References m_wing.

147 { return m_wing; }
int32 m_wing
Definition: Client.h:371
bool Client::Handle_CallReq ( PyPacket packet,
PyCallStream req 
)
protectedvirtual

Reimplemented from EVEPacketDispatcher.

Definition at line 2620 of file Client.cpp.

References _SendCallReturn(), PyCallStream::arg_dict, PyCallStream::arg_tuple, args, PyCallable::Call(), PyAddress::callID, PyPacket::dest, PyAddress::Dump(), PyServiceMgr::FindBoundObject(), PyServiceMgr::GetNodeID(), is_log_enabled, PyServiceMgr::LookupService(), m_canThrow, m_services, PyCallStream::method, PyCallStream::remoteObjectStr, SendSessionChange(), PyAddress::service, sLog, and PyPacket::source.

2621 {
2622  PyCallable* dest(nullptr);
2623  if (packet->dest.service == "") {
2624  //bound object
2625  uint32 nodeID = 0, bindID = 0;
2626  if (sscanf(req.remoteObjectStr.c_str(), "N=%u:%u", &nodeID, &bindID) != 2) {
2627  sLog.Error("Client::CallReq","Failed to parse bind string '%s'.", req.remoteObjectStr.c_str());
2628  return false;
2629  }
2630 
2631  if (nodeID != m_services.GetNodeID()) {
2632  sLog.Error("Client::CallReq","Unknown nodeID - received %u but expected %u.", nodeID, m_services.GetNodeID());
2633  return false;
2634  }
2635 
2636  dest = m_services.FindBoundObject(bindID);
2637  if (dest == nullptr) {
2638  sLog.Error("Client::CallReq", "Failed to find bound object %u.", bindID);
2639  return false;
2640  }
2641  } else {
2642  //service
2643  dest = m_services.LookupService(packet->dest.service);
2644  if (dest == nullptr) {
2645  sLog.Error("Client::CallReq","Unable to find service to handle call to: %s", packet->dest.service.c_str());
2646  packet->dest.Dump(CLIENT__CALL_DUMP, " ");
2647  throw UserError ("ServiceNotFound"); // this message is invalid (message not found)
2648  }
2649  }
2650 
2651  //build arguments
2652  PyCallArgs args(this, req.arg_tuple, req.arg_dict);
2653 
2654  //parts of call may be consumed here
2655  m_canThrow = true; // test for throwable. -allan 29Jul16 should we use try/catch here? yes
2656  PyResult result(dest->Call(req.method, args));
2657  m_canThrow = false;
2658 
2659  SendSessionChange(); //send out the session change before the return.
2660  if (is_log_enabled(CLIENT__OUT_ALL)) {
2661  if (result.ssResult != nullptr)
2662  result.ssResult->Dump(CLIENT__OUT_ALL, " ");
2663  if (result.ssNamedResult != nullptr)
2664  result.ssNamedResult->Dump(CLIENT__OUT_ALL, " ");
2665  }
2666 
2667  _SendCallReturn(packet->dest, packet->source.callID, result);
2668 
2669  return true;
2670 }
PyDict * arg_dict
Definition: PyPacket.h:159
int64 callID
Definition: PyPacket.h:90
PyBoundObject * FindBoundObject(uint32 bindID)
bool m_canThrow
Definition: Client.h:439
PyService * LookupService(const std::string &name)
PyAddress dest
Definition: PyPacket.h:117
std::string method
Definition: PyPacket.h:157
void SendSessionChange()
Definition: Client.cpp:2048
uint32 GetNodeID() const
Definition: PyServiceMgr.h:67
void Dump(FILE *into, const char *pfx) const
Definition: PyPacket.cpp:284
* args
#define is_log_enabled(type)
Definition: logsys.h:78
#define sLog
Evaluates to a NewLog instance.
Definition: LogNew.h:250
PyTuple * arg_tuple
Definition: PyPacket.h:158
PyServiceMgr & m_services
Definition: Client.h:341
Python object "ccp_exceptions.UserError".
Definition: PyExceptions.h:121
unsigned __int32 uint32
Definition: eve-compat.h:50
std::string service
Definition: PyPacket.h:92
std::string remoteObjectStr
Definition: PyPacket.h:155
PyAddress source
Definition: PyPacket.h:116
void _SendCallReturn(const PyAddress &source, int64 callID, PyResult &rsp)
Definition: Client.cpp:2475

Here is the call graph for this function:

bool Client::Handle_Notify ( PyPacket packet)
protectedvirtual

Reimplemented from EVEPacketDispatcher.

Definition at line 2672 of file Client.cpp.

References _log, PyServiceMgr::ClearBoundObject(), PyServiceMgr::GetNodeID(), m_bindSet, m_char, m_services, InventoryItem::name(), PyPacket::payload, and sLog.

2673 {
2674  //turn this thing into a notify stream:
2675  ServerNotification notify;
2676  if (!notify.Decode(packet->payload)) {
2677  sLog.Error("Client::Notify","Failed to convert rep into a notify stream");
2678  return false;
2679  }
2680 
2681  if (notify.method == "ClientHasReleasedTheseObjects") {
2682  _log(SERVICE__MESSAGE, "Client Has Released These Objects:");
2683  ServerNotification_ReleaseObj element;
2684 
2685  uint32 nodeID(0), bindID(0);
2686  PyList::const_iterator cur = notify.elements->begin();
2687  for (; cur != notify.elements->end(); ++cur) {
2688  if (!element.Decode(*cur)) {
2689  sLog.Error("Client::Notify","Notification '%s' from %s: Failed to decode element. Skipping.", notify.method.c_str(), m_char->name());
2690  continue;
2691  }
2692 
2693  if (sscanf(element.boundID.c_str(), "N=%u:%u", &nodeID, &bindID) != 2) {
2694  sLog.Error("Client::Notify","Notification '%s' from %s: Failed to parse bind string '%s'. Skipping.", \
2695  notify.method.c_str(), m_char->name(), element.boundID.c_str());
2696  continue;
2697  }
2698 
2699  if (nodeID != m_services.GetNodeID()) {
2700  sLog.Error("Client::Notify","Notification '%s' from %s: Unknown nodeID %u received (expected %u). Skipping.", \
2701  notify.method.c_str(), m_char->name(), nodeID, m_services.GetNodeID());
2702  continue;
2703  }
2704 
2705  // clear bindID from internal map
2706  m_bindSet.erase(bindID);
2707  m_services.ClearBoundObject(bindID);
2708  }
2709  } else {
2710  sLog.Error("Client::Notify","Unhandled notification from %s: unknown method '%s'", m_char->name(), notify.method.c_str());
2711  return false;
2712  }
2713 
2714  return true;
2715 }
#define _log(type, fmt,...)
Definition: logsys.h:124
CharacterRef m_char
Definition: Client.h:340
storage_type::const_iterator const_iterator
Definition: PyRep.h:644
const char * name()
uint32 GetNodeID() const
Definition: PyServiceMgr.h:67
PyTuple * payload
Definition: PyPacket.h:119
#define sLog
Evaluates to a NewLog instance.
Definition: LogNew.h:250
PyServiceMgr & m_services
Definition: Client.h:341
unsigned __int32 uint32
Definition: eve-compat.h:50
std::set< uint32 > m_bindSet
Definition: Client.h:443
void ClearBoundObject(uint32 bindID)

Here is the call graph for this function:

bool Client::Handle_PingReq ( PyPacket packet)
inlineprotectedvirtual

Reimplemented from EVEPacketDispatcher.

Definition at line 455 of file Client.h.

References _SendPingResponse(), PyAddress::callID, PyPacket::dest, and PyPacket::source.

455 { _SendPingResponse( packet->dest, packet->source.callID ); return true; }
int64 callID
Definition: PyPacket.h:90
void _SendPingResponse(const PyAddress &source, int64 callID)
Definition: Client.cpp:2552
PyAddress dest
Definition: PyPacket.h:117
PyAddress source
Definition: PyPacket.h:116

Here is the call graph for this function:

bool Client::Handle_PingRsp ( PyPacket packet)
inlineprotectedvirtual

Reimplemented from EVEPacketDispatcher.

Definition at line 456 of file Client.h.

456 { /* do nothing */ return true; }
bool Client::HasBeyonce ( )
inline

Definition at line 238 of file Client.h.

References m_beyonce.

Referenced by Command_destinyvars().

238 { return m_beyonce; }
bool m_beyonce
Definition: Client.h:359

Here is the caller graph for this function:

bool Client::InFleet ( )
inline

Definition at line 142 of file Client.h.

References IsFleetID, and m_fleet.

Referenced by DynamicSystemEntity::AwardBounty(), SystemManager::BuildDynamicEntity(), CynoModule::CanActivate(), ActiveModule::CanActivate(), Command_fleetinvite(), Command_tr(), and Agent::UpdateStandings().

142 { return IsFleetID(m_fleet); }
#define IsFleetID(itemID)
Definition: EVE_Defines.h:225
uint32 m_fleet
Definition: Client.h:374

Here is the caller graph for this function:

void Client::InitSession ( int32  characterID)

Definition at line 1858 of file Client.cpp.

References ClientSession::Clear(), SystemData::constellationID, CharacterDB::GetCharacterData(), IsCharacterID, IsConstellationID, IsRegionID, m_locationID, m_shipId, m_SystemData, m_validSession, pSession, SystemData::regionID, sDataMgr, ClientSession::SetInt(), ClientSession::SetLong(), sLog, and SystemData::systemID.

Referenced by SelectCharacter().

1859 {
1860  if (!IsCharacterID(characterID)) {
1861  sLog.Error("Client::InitSession()", "characterID is not valid");
1862  return;
1863  }
1864 
1865  std::map<std::string, int64> characterDataMap;
1866  CharacterDB::GetCharacterData(characterID, characterDataMap);
1867  if (characterDataMap.size() < 1) {
1868  sLog.Error("Client::InitSession()", "characterDataMap.size() returned zero.");
1869  return;
1870  }
1871 
1872  int32 stationID = (int32)(characterDataMap["stationID"]);
1873  int32 solarSystemID = (int32)(characterDataMap["solarSystemID"]);
1874  m_shipId = (int32)(characterDataMap["shipID"]);
1875 
1876  pSession->SetInt("genderID", (int32)(characterDataMap["gender"]));
1877  pSession->SetInt("bloodlineID", (int32)(characterDataMap["bloodlineID"]));
1878  pSession->SetInt("raceID", (int32)(characterDataMap["raceID"]));
1879  pSession->SetInt("charid", characterID);
1880  pSession->SetInt("corpid", (int32)(characterDataMap["corporationID"]));
1881 
1882  pSession->SetInt("cloneStationID", (int32)(characterDataMap["cloneStationID"]));
1883  pSession->SetInt("solarsystemid2", solarSystemID);
1884  pSession->SetInt("constellationid", (int32)(characterDataMap["constellationID"]));
1885  pSession->SetInt("regionid", (int32)(characterDataMap["regionID"]));
1886 
1887  pSession->SetInt("hqID", (int32)(characterDataMap["corporationHQ"]));
1888  pSession->SetInt("baseID", characterDataMap["baseID"]);
1889  pSession->SetInt("corpAccountKey", characterDataMap["corpAccountKey"]);
1890 
1891  //Only set allianceID if it is not 0
1892  if (characterDataMap["allianceID"] != 0){
1893  pSession->SetInt("allianceid", characterDataMap["allianceID"]);
1894  }
1895 
1896  pSession->SetInt("warfactionid", characterDataMap["warFactionID"]);
1897 
1898  pSession->SetLong("corprole", characterDataMap["corpRole"]);
1899  pSession->SetLong("rolesAtAll", characterDataMap["rolesAtAll"]);
1900  pSession->SetLong("rolesAtBase", characterDataMap["rolesAtBase"]);
1901  pSession->SetLong("rolesAtHQ", characterDataMap["rolesAtHQ"]);
1902  pSession->SetLong("rolesAtOther", characterDataMap["rolesAtOther"]);
1903 
1904  /* solarSystemID != 0 -character in space
1905  * also used as current system in following menus:
1906  * JumpPortalBridgeMenu, GetHybridBeaconJumpMenu, GetHybridBridgeMenu
1907  */
1908  if (sDataMgr.IsStation(stationID)) {
1909  m_locationID = stationID;
1910  pSession->Clear("solarsystemid"); //must be 0 in station
1911  pSession->Clear("shipid"); //must be 0 in station
1912  pSession->SetInt("stationid", stationID);
1913  pSession->SetInt("stationid2", stationID);
1914  pSession->SetInt("locationid", stationID);
1915  pSession->SetInt("worldspaceid", stationID);
1916  } else {
1917  m_locationID = solarSystemID;
1918  pSession->Clear("stationid"); //must be 0 in space
1919  pSession->Clear("stationid2"); //must be 0 in space
1920  pSession->Clear("worldspaceid"); //must be 0 in space
1921  pSession->SetInt("shipid", m_shipId);
1922  pSession->SetInt("solarsystemid", solarSystemID);
1923  pSession->SetInt("locationid", solarSystemID);
1924  }
1925 
1926  sDataMgr.GetSystemData(m_locationID, m_SystemData);
1927  if ((sDataMgr.IsSolarSystem(m_SystemData.systemID))
1930  {
1931  m_validSession = true;
1932  }
1933 }
#define IsConstellationID(itemID)
Definition: EVE_Defines.h:276
SystemData m_SystemData
Definition: Client.h:336
void SetLong(const char *name, int64 value)
uint32 m_shipId
Definition: Client.h:375
void Clear(const char *name)
signed __int32 int32
Definition: eve-compat.h:49
uint32 m_locationID
Definition: Client.h:377
#define sLog
Evaluates to a NewLog instance.
Definition: LogNew.h:250
bool m_validSession
Definition: Client.h:440
#define IsCharacterID(itemID)
Definition: EVE_Defines.h:206
uint32 systemID
uint32 regionID
static void GetCharacterData(uint32 charID, std::map< std::string, int64 > &characterDataMap)
uint32 constellationID
void SetInt(const char *name, int32 value)
ClientSession * pSession
Definition: Client.h:345
#define IsRegionID(itemID)
Definition: EVE_Defines.h:273
#define sDataMgr

Here is the call graph for this function:

Here is the caller graph for this function:

bool Client::InPod ( )
inline

Definition at line 227 of file Client.h.

References EVEDB::invGroups::Capsule, InventoryItem::groupID(), and m_ship.

Referenced by Command_destinyvars(), MoveToLocation(), WarpIn(), and WarpOut().

227 { return (m_ship->groupID() == EVEDB::invGroups::Capsule); }
uint16 groupID() const
ShipItemRef m_ship
Definition: Client.h:337

Here is the call graph for this function:

Here is the caller graph for this function:

bool Client::IsAFK ( )
inline

Definition at line 96 of file Client.h.

References m_afk.

96 { return m_afk; }
bool m_afk
Definition: Client.h:354
bool Client::IsAutoPilot ( )
inline

Definition at line 256 of file Client.h.

References m_autoPilot.

Referenced by DestinyManager::Follow().

256 { return m_autoPilot; }
bool m_autoPilot
Definition: Client.h:365

Here is the caller graph for this function:

bool Client::IsBoard ( )
inline

Definition at line 233 of file Client.h.

References Player::State::Board, and m_clientState.

233 { return (m_clientState == Player::State::Board); }
int8 m_clientState
Definition: Client.h:402
bool Client::IsBubbleWait ( )
inline

Definition at line 239 of file Client.h.

References m_bubbleWait.

Referenced by Command_destinyvars().

239 { return m_bubbleWait; }
bool m_bubbleWait
Definition: Client.h:367

Here is the caller graph for this function:

bool Client::IsCharCreation ( )
inline

Definition at line 433 of file Client.h.

References m_charCreation.

Referenced by ModuleItem::_Load(), ShipItem::_Load(), Character::LogOut(), InventoryItem::SendItemChange(), ShipItem::SetPlayer(), and AccountService::TranserFunds().

433 { return m_charCreation; }
bool m_charCreation
Definition: Client.h:441

Here is the caller graph for this function:

bool Client::IsDock ( )
inline

Definition at line 230 of file Client.h.

References Player::State::Dock, and m_clientState.

Referenced by SystemBubble::RemoveBalls().

230 { return (m_clientState == Player::State::Dock); }
int8 m_clientState
Definition: Client.h:402

Here is the caller graph for this function:

bool Client::IsDocked ( )
inline
bool Client::IsFleetBooster ( )
inline

Definition at line 144 of file Client.h.

References GetFleetRole(), IsFleetID, m_fleet, and Fleet::Booster::No.

Referenced by MoveToLocation().

144 { return (IsFleetID(m_fleet) ? ((GetFleetRole() == Fleet::Booster::No) ? false : true) : false); }
int8 GetFleetRole()
Definition: Client.h:140
#define IsFleetID(itemID)
Definition: EVE_Defines.h:225
uint32 m_fleet
Definition: Client.h:374

Here is the call graph for this function:

Here is the caller graph for this function:

bool Client::IsFleetBoss ( )
inline

Definition at line 143 of file Client.h.

References Fleet::Role::FleetLeader, GetFleetRole(), IsFleetID, and m_fleet.

Referenced by Command_fleetinvite(), and MoveToLocation().

143 { return (IsFleetID(m_fleet) ? ((GetFleetRole() == Fleet::Role::FleetLeader) ? true : false) : false); }
int8 GetFleetRole()
Definition: Client.h:140
#define IsFleetID(itemID)
Definition: EVE_Defines.h:225
uint32 m_fleet
Definition: Client.h:374

Here is the call graph for this function:

Here is the caller graph for this function:

bool Client::IsHangarLoaded ( uint32  stationID)

Definition at line 1660 of file Client.cpp.

References m_hangarLoaded.

Referenced by MoveToLocation().

1660  {
1661  std::map<uint32, bool>::const_iterator itr = m_hangarLoaded.find(hangarID);
1662  if (itr != m_hangarLoaded.end())
1663  return itr->second;
1664  return false;
1665 }
std::map< uint32, bool > m_hangarLoaded
Definition: Client.h:398

Here is the caller graph for this function:

bool Client::IsIdle ( )
inline

Definition at line 231 of file Client.h.

References Player::State::Idle, and m_clientState.

231 { return (m_clientState == Player::State::Idle); }
int8 m_clientState
Definition: Client.h:402
bool Client::IsInvul ( )
inline

Definition at line 234 of file Client.h.

References m_invul.

Referenced by Command_destinyvars(), and ShipSE::IsInvul().

234 { return m_invul; }
bool m_invul
Definition: Client.h:355

Here is the caller graph for this function:

bool Client::IsJetcanAvalible ( )

Definition at line 1381 of file Client.cpp.

References Timer::Check(), Timer::Enabled(), and m_jetcanTimer.

1381  {
1382  if (m_jetcanTimer.Enabled()) {
1383  return (m_jetcanTimer.Check(false));
1384  } else {
1385  return true;
1386  }
1387 }
bool Enabled() const
Definition: timer.h:41
bool Check(bool reset=true)
Definition: timer.cpp:62
Timer m_jetcanTimer
Definition: Client.h:389

Here is the call graph for this function:

bool Client::IsJump ( )
inline

Definition at line 232 of file Client.h.

References Player::State::Jump, and m_clientState.

Referenced by ModuleManager::Activate(), Command_destinyvars(), MoveToLocation(), SetBallPark(), and SetDestiny().

232 { return (m_clientState == Player::State::Jump); }
int8 m_clientState
Definition: Client.h:402

Here is the caller graph for this function:

bool Client::IsLoaded ( )
inline

Definition at line 88 of file Client.h.

References m_loaded.

88 { return m_loaded; }
bool m_loaded
Definition: Client.h:358
bool Client::IsLogin ( )
inline
bool Client::IsMissionComplete ( MissionOffer data)

Definition at line 1764 of file Client.cpp.

References Mission::Type::Anomic, Mission::Type::Arc, ContainsTypeQty(), Mission::Type::Cosmos, Mission::Type::Courier, MissionOffer::courierAmount, MissionOffer::courierTypeID, Mission::Type::Data, MissionOffer::destinationID, Mission::Type::Encounter, m_locationID, Mission::Type::Mining, Mission::Type::Research, Mission::Type::Storyline, Mission::Type::Trade, Mission::Type::Tutorial, and MissionOffer::typeID.

Referenced by AgentBound::GetMissionObjectiveInfo().

1765 {
1766  // dont know all the stipulations of "completion" yet, but skeleton code for starters...
1767  switch (data.typeID) {
1768  case Mission::Type::Tutorial: {
1769  } break;
1770  case Mission::Type::Encounter: {
1771  } break;
1772  case Mission::Type::Courier: {
1773  if (m_locationID == data.destinationID)
1775  return true;
1776  } break;
1777  case Mission::Type::Trade: {
1778  } break;
1779  case Mission::Type::Mining: {
1780  } break;
1781  case Mission::Type::Research: {
1782  } break;
1783  case Mission::Type::Data: {
1784  } break;
1785  case Mission::Type::Storyline: {
1786  } break;
1787  case Mission::Type::Cosmos: {
1788  } break;
1789  case Mission::Type::Arc: {
1790  } break;
1791  case Mission::Type::Anomic: {
1792  } break;
1793  }
1794 
1795  return false;
1796 }
bool ContainsTypeQty(uint16 typeID, uint32 qty) const
Definition: Client.cpp:1744
uint32 m_locationID
Definition: Client.h:377
uint16 courierTypeID
Definition: EVE_Missions.h:38
uint16 courierAmount
Definition: EVE_Missions.h:39
uint32 destinationID
Definition: EVE_Missions.h:51

Here is the call graph for this function:

Here is the caller graph for this function:

bool Client::IsSessionChange ( )
inline

Definition at line 241 of file Client.h.

References m_sessionChangeActive.

Referenced by Command_sendstate(), Command_syncloc(), Command_syncpos(), Command_update(), and ShipItem::Undock().

241 { return m_sessionChangeActive; }
bool m_sessionChangeActive
Definition: Client.h:369

Here is the caller graph for this function:

bool Client::IsSetStateSent ( )
inline

Definition at line 240 of file Client.h.

References m_setStateSent.

Referenced by Command_destinyvars(), and BeyonceBound::m_dispatch().

240 { return m_setStateSent; }
bool m_setStateSent
Definition: Client.h:368

Here is the caller graph for this function:

bool Client::IsShowall ( )
inline

Definition at line 271 of file Client.h.

References m_showall.

Referenced by Command_showall(), and Scan::ShipScanResult().

271 { return m_showall; }
bool m_showall
Definition: Client.h:361

Here is the caller graph for this function:

bool Client::IsUncloak ( )
inline

Definition at line 237 of file Client.h.

References m_uncloak.

237 { return m_uncloak; }
bool m_uncloak
Definition: Client.h:360
bool Client::IsUndock ( )
inline

Definition at line 236 of file Client.h.

References m_undock.

Referenced by Command_destinyvars(), ModuleItem::SetOnline(), DestinyManager::SetSpeedFraction(), and DestinyManager::Turn().

236 { return m_undock; }
bool m_undock
Definition: Client.h:357

Here is the caller graph for this function:

bool Client::IsValidSession ( )
inline

Definition at line 103 of file Client.h.

References m_validSession.

Referenced by EntityList::AddPlayer(), and EntityList::RemovePlayer().

103 { return m_validSession; }
bool m_validSession
Definition: Client.h:440

Here is the caller graph for this function:

uint32 Client::JetcanTime ( )
inline

Definition at line 267 of file Client.h.

References Timer::GetRemainingTime(), and m_jetcanTimer.

267 { return (m_jetcanTimer.GetRemainingTime() / 1000); }
uint32 GetRemainingTime() const
Definition: timer.cpp:114
Timer m_jetcanTimer
Definition: Client.h:389

Here is the call graph for this function:

void Client::JumpInEffect ( )

Definition at line 1620 of file Client.cpp.

References SystemEntity::DestinyMgr(), DestinyManager::IsCloaked(), pShipSE, and DestinyManager::SendJumpInEffect().

Referenced by Command_tr(), and ExecuteDriveJump().

1621 {
1622  if (pShipSE != nullptr)
1623  if (pShipSE->DestinyMgr() != nullptr)
1624  if (!pShipSE->DestinyMgr()->IsCloaked())
1625  pShipSE->DestinyMgr()->SendJumpInEffect("effects.JumpIn");
1626 }
void SendJumpInEffect(std::string JumpEffect) const
DestinyManager * DestinyMgr()
Definition: SystemEntity.h:198
ShipSE * pShipSE
Definition: Client.h:343

Here is the call graph for this function:

Here is the caller graph for this function:

void Client::JumpOutEffect ( uint32  locationID)

Definition at line 1628 of file Client.cpp.

References SystemEntity::DestinyMgr(), DestinyManager::IsCloaked(), pShipSE, and DestinyManager::SendJumpOutEffect().

Referenced by Command_tr(), and CynoJump().

1629 {
1630  if (pShipSE != nullptr)
1631  if (pShipSE->DestinyMgr() != nullptr)
1632  if (!pShipSE->DestinyMgr()->IsCloaked())
1633  pShipSE->DestinyMgr()->SendJumpOutEffect("effects.JumpOut", locationID);
1634 }
void SendJumpOutEffect(std::string JumpEffect, uint32 locationID) const
DestinyManager * DestinyMgr()
Definition: SystemEntity.h:198
ShipSE * pShipSE
Definition: Client.h:343

Here is the call graph for this function:

Here is the caller graph for this function:

void Client::LoadStationHangar ( uint32  stationID)

Definition at line 1667 of file Client.cpp.

References _log, InventoryItem::GetMyInventory(), SystemManager::GetStationFromInventory(), InventoryItem::itemID(), Inventory::LoadContents(), m_char, m_system, InventoryItem::name(), and sItemFactory.

Referenced by MoveToLocation().

1667  {
1668  _log(PLAYER__INFO, "Client::LoadStationHangar() is loading personal hangar for %s(%u) in stationID %u", m_char->name(), m_char->itemID(), stationID);
1669  sItemFactory.SetUsingClient(this);
1671  sItemFactory.UnsetUsingClient();
1672 }
#define _log(type, fmt,...)
Definition: logsys.h:124
CharacterRef m_char
Definition: Client.h:340
const char * name()
StationItemRef GetStationFromInventory(uint32 stationID)
bool LoadContents()
Definition: Inventory.cpp:113
SystemManager * m_system
Definition: Client.h:346
#define sItemFactory
Definition: ItemFactory.h:165
Inventory * GetMyInventory()
Definition: InventoryItem.h:91
uint32 itemID() const
Definition: InventoryItem.h:98

Here is the call graph for this function:

Here is the caller graph for this function:

void Client::MoveItem ( uint32  itemID,
uint32  location,
EVEItemFlags  flag 
)

Definition at line 1674 of file Client.cpp.

References _log, InventoryItem::flag(), flagDroneBay, flagIllegal, RefPtr< X >::get(), IsCargoHoldFlag, IsModuleSlot, IsPlayerItem, itemID(), m_char, m_ship, InventoryItem::Move(), InventoryItem::name(), sDataMgr, sItemFactory, and ShipItem::UpdateModules().

1675 {
1676  sItemFactory.SetUsingClient(this);
1677  InventoryItemRef iRef = sItemFactory.GetItem(itemID);
1678  if (iRef.get() == nullptr) {
1679  _log(INV__ERROR, "Client::MoveItem() - %s Unable to load item %u", m_char->name(), itemID);
1680  return;
1681  }
1682 
1683  EVEItemFlags oldflag = flagIllegal;
1684  oldflag = iRef->flag();
1685 
1686  iRef->Move(location, flag, true);
1687 
1688  if (IsPlayerItem(location)) {
1689  if (IsModuleSlot(iRef->flag())) {
1690  m_ship->UpdateModules(iRef->flag());
1691  } else if (IsCargoHoldFlag(iRef->flag()) or (iRef->flag() == flagDroneBay)) {
1692  // do nothing here. this is to avoid throwing error msg below
1693  } else {
1694  _log(INV__WARNING, "Client::MoveItem() - %s Unhandled PlayerItem %s (%u) from flag %s to flag %s.", \
1695  m_char->name(), iRef->name(), itemID, sDataMgr.GetFlagName(oldflag), sDataMgr.GetFlagName(flag));
1696  }
1697  } else {
1698  _log(INV__WARNING, "Client::MoveItem() - %s Unhandled NonPlayerItem %s (%u) from flag %s to flag %s.", \
1699  m_char->name(), iRef->name(), itemID, sDataMgr.GetFlagName(oldflag), sDataMgr.GetFlagName(flag));
1700  }
1701  sItemFactory.UnsetUsingClient();
1702 }
#define _log(type, fmt,...)
Definition: logsys.h:124
CharacterRef m_char
Definition: Client.h:340
EVEItemFlags
Definition: EVE_Flags.h:13
const char * name()
void Move(uint32 new_location=locTemp, EVEItemFlags flag=flagNone, bool notify=false)
#define IsPlayerItem(itemID)
Definition: EVE_Defines.h:256
X * get() const
Definition: RefPtr.h:213
ShipItemRef m_ship
Definition: Client.h:337
void UpdateModules()
Definition: Ship.cpp:862
EVEItemFlags flag() const
#define IsModuleSlot(flag)
Definition: EVE_Defines.h:350
#define IsCargoHoldFlag(flag)
Definition: EVE_Defines.h:336
typeID Spawn an NPC with the specified type text Search for items matching the specified query() type()() itemID() copy() materialLevel()() itemID(attributeID)-Retrieves attribute value." ) COMMAND( setattr
#define sItemFactory
Definition: ItemFactory.h:165
#define sDataMgr

Here is the call graph for this function:

void Client::MoveToLocation ( uint32  location,
const GPoint pt 
)

Definition at line 684 of file Client.cpp.

References _log, SystemManager::AddClient(), StationItem::AddGuest(), CharNoLongerInStation(), CharNowInStation(), SystemEntity::DestinyMgr(), DestroyShipSE(), Timer::Disable(), InventoryItem::flag(), flagCapsule, flagHangar, flagNone, flagPilot, Player::Timer::Fleet, RefPtr< X >::get(), GetCorporationID(), SystemManager::GetID(), SystemManager::GetName(), GetName(), DestinyManager::Halt(), InPod(), IsFleetBooster(), IsFleetBoss(), IsFleetID, IsHangarLoaded(), IsJump(), IsSquadID, IsWingID, InventoryItem::itemID(), LoadStationHangar(), StationItem::LoadStationOffice(), m_autoPilot, m_beyonce, m_bubbleWait, m_char, m_fleet, m_fleetTimer, m_locationID, m_login, m_pod, m_setStateSent, m_ship, m_shipId, m_squad, m_StationData, m_system, m_SystemData, m_undock, m_wing, InventoryItem::Move(), InventoryItem::name(), SystemData::name, pShipSE, SystemManager::RemoveClient(), SystemManager::RemoveEntity(), ShipSE::ResetShipSystemMgr(), ShipItem::SaveShip(), sDataMgr, SendErrorMsg(), SendSessionChange(), sEntityList, InventoryItem::SetCustomInfo(), SetDestiny(), Character::SetLocation(), InventoryItem::SetPosition(), sFltSvc, sItemFactory, sLog, snprintf, LSC::squad, Timer::Start(), stDataMgr, DestinyManager::Stop(), SystemData::systemID, UpdateSession(), and LSC::wing.

Referenced by Command_tr(), DockToStation(), Eject(), EnterSystem(), ExecuteDriveJump(), ExecuteJump(), ResetAfterPodded(), ResetAfterPopped(), SelectCharacter(), and UndockFromStation().

684  {
685  // process ALL location changes here.
686  if (!sDataMgr.IsStation(locationID) and !sDataMgr.IsSolarSystem(locationID)) {
687  SendErrorMsg("Move requested to unsupported location %u", locationID);
688  return;
689  }
690 
691  _log(AUTOPILOT__TRACE, "MoveToLocation() - m_autoPilot = %s", (m_autoPilot ? "true" : "false"));
692 
693  if (!m_login and (m_locationID == locationID) and !sDataMgr.IsStation(locationID)) {
694  _log(PLAYER__WARNING, "MoveToLocation() - m_locationID == location");
695  // This is a simple movement
696  SetDestiny(pt, true);
697  return;
698  }
699 
700  bool count(m_login);
701  bool wasDocked(sDataMgr.IsStation(m_locationID));
702  m_locationID = locationID;
703  // get data for new system. this checks for stationID sent as locationID, so is safe here.
704  sDataMgr.GetSystemData(m_locationID, m_SystemData);
705 
706  m_bubbleWait = false; // allow client processing of subsequent destiny msgs
707 
708  // location changed...verify current system and set session data for current system.
709  if (IsJump() or ((m_system != nullptr) and (m_system->GetID() != m_SystemData.systemID))) {
710  //we have different m_system
711  _log(PLAYER__WARNING, "MoveToLocation() - current m_system is %s, systemData is for %s, m_system->GetID(%u) != locationID(%u)", \
713  // if docked, update guestlist
714  if (wasDocked) {
716  wasDocked = false; // dont update station again on this call (redundant check later in this method)
717  }
718  if (pShipSE != nullptr)
719  if (IsJump() and !m_autoPilot)
720  pShipSE->DestinyMgr()->Halt();
721 
722  // remove from current system before resetting system vars
724  m_system->RemoveClient(this, (count = true), IsJump());
725  m_system = nullptr;
726  }
727 
728  if (m_system == nullptr) {
729  _log(PLAYER__WARNING, "MoveToLocation() - m_system == NULL, m_locationID = %u", m_locationID);
730  // find our new system's manager
731  sItemFactory.SetUsingClient(this);
732  m_system = sEntityList.FindOrBootSystem(m_SystemData.systemID);
733  sItemFactory.UnsetUsingClient();
734  if (m_system == nullptr) {
735  sLog.Error("Client", "Failed to boot system %u for char %s (%u)", m_SystemData.systemID, m_char->name(), m_char->itemID());
736  SendErrorMsg("Unable to boot system. Relog and try again.");
737  return;
738  }
739 
740  m_beyonce = false;
741  m_setStateSent = false;
742 
743  // register ourselves with new system manager (this wont hit on login)
744  m_system->AddClient(this, count, IsJump());
745  }
746 
747  if (InPod()) {
748  m_ship->Move(m_locationID, flagCapsule, true);
749  } else {
751  m_ship->Move(m_locationID, flagNone, true);
752  }
753 
754  // once systemData.radius implemented, remove this in favor of below check
755  m_ship->SetPosition(pt);
756  /* comment this block for later use...
757  * m_SystemData.radius is not populated yet, and this does weird things with ships
758  // verify 'pt' is within system boundaries
759  if (pt.length() < m_SystemData.radius) {
760  m_ship->SetPosition(pt);
761  } else {
762  ; // oob
763  }
764  */
765 
766  char ci[45];
767  if (sDataMgr.IsStation(m_locationID)) {
768  _log(PLAYER__WARNING, "MoveToLocation() - Character %s (%u) Docked in %u.", m_char->name(), m_char->itemID(), m_locationID);
769  stDataMgr.GetStationData(m_locationID, m_StationData);
770  snprintf(ci, sizeof(ci), "Docked: %s(%u)", GetName(), m_char->itemID());
771  m_char->Move(m_locationID, flagNone, true);
772  m_ship->Move(m_locationID, flagHangar, true);
773 
774  if (IsFleetID(m_fleet)) {
776  if (IsFleetBooster()) {
777  std::list<int32> wing, squad;
778  wing.clear();
779  squad.clear();
780  if (IsSquadID(m_squad)) {
781  squad.emplace(squad.end(), m_squad);
782  } else if (IsWingID(m_wing)) {
783  wing.emplace(wing.end(), m_wing);
784  }
785  sFltSvc.UpdateBoost(m_fleet, IsFleetBoss(), wing, squad);
786  }
787  }
788 
789  if (!IsHangarLoaded(m_locationID))
790  LoadStationHangar(m_locationID);
792  DestroyShipSE();
793  StationItemRef sRef = sEntityList.GetStationByID(m_locationID);
794  if (sRef.get() != nullptr) {
796  sRef->AddGuest(this);
797  }
798  m_bubbleWait = true; // deny client processing of subsquent destiny msgs
799  } else {
800  _log(PLAYER__WARNING, "MoveToLocation() - Character %s(%u) InSpace in %u. (setState %s, beyonce %s)", \
801  m_char->name(), m_char->itemID(), m_locationID, m_setStateSent ? "true" : "false", m_beyonce ? "true" : "false");
802  snprintf(ci, sizeof(ci), "InSpace: %s(%u)", GetName(), m_char->itemID());
803 
804  // if docked, update guestlist
805  if (wasDocked and m_undock)
807 
808  if (IsFleetID(m_fleet)) {
810  if (IsFleetBooster()) {
811  std::list<int32> wing, squad;
812  wing.clear();
813  squad.clear();
814  if (IsSquadID(m_squad)) {
815  squad.emplace(squad.end(), m_squad);
816  } else if (IsWingID(m_wing)) {
817  wing.emplace(wing.end(), m_wing);
818  }
819  sFltSvc.UpdateBoost(m_fleet, IsFleetBoss(), wing, squad);
820  }
821  }
822 
823  if (m_char->flag() != flagPilot)
824  m_char->Move(m_shipId, flagPilot, true);
825 
826  if (pShipSE != nullptr)
828 
829  SetDestiny(pt);
830 
831  if (IsJump() and !m_autoPilot)
832  pShipSE->DestinyMgr()->Stop();
833  }
834 
835  m_ship->SetCustomInfo(ci);
836 
837  if (!m_login)
838  m_ship->SaveShip(); // this saves everything on ship
839 
840  uint32 stationID(sDataMgr.IsStation(m_locationID) ? m_locationID : 0);
841  m_char->SetLocation(stationID, m_SystemData);
842 
843  UpdateSession();
845 }
bool m_setStateSent
Definition: Client.h:368
void AddGuest(Client *pClient)
Definition: Station.cpp:219
void SendErrorMsg(const char *fmt,...)
Definition: Client.cpp:2719
SystemData m_SystemData
Definition: Client.h:336
void RemoveClient(Client *pClient, bool count=false, bool jump=false)
#define _log(type, fmt,...)
Definition: logsys.h:124
#define stDataMgr
void Disable()
Definition: timer.h:39
void LoadStationOffice(uint32 corpID)
Definition: Station.cpp:144
void SetLocation(uint32 stationID, SystemData &data)
Definition: Character.cpp:412
CharacterRef m_char
Definition: Client.h:340
std::string name
int32 m_wing
Definition: Client.h:371
uint32 m_shipId
Definition: Client.h:375
int32 GetCorporationID() const
Definition: Client.h:123
#define sEntityList
Definition: EntityList.h:208
bool m_autoPilot
Definition: Client.h:365
void CharNowInStation()
Definition: Client.cpp:1837
uint32 GetID() const
Definition: SystemManager.h:80
bool m_undock
Definition: Client.h:357
void SetPosition(const GPoint &pos)
void CharNoLongerInStation()
Definition: Client.cpp:1811
void SendSessionChange()
Definition: Client.cpp:2048
const char * name()
void Move(uint32 new_location=locTemp, EVEItemFlags flag=flagNone, bool notify=false)
uint32 m_locationID
Definition: Client.h:377
#define sFltSvc
Definition: FleetService.h:147
#define sLog
Evaluates to a NewLog instance.
Definition: LogNew.h:250
bool InPod()
Definition: Client.h:227
DestinyManager * DestinyMgr()
Definition: SystemEntity.h:198
#define snprintf
Definition: eve-compat.h:184
void RemoveEntity(SystemEntity *pSE)
bool m_bubbleWait
Definition: Client.h:367
void AddClient(Client *pClient, bool count=false, bool jump=false)
X * get() const
Definition: RefPtr.h:213
const char * GetName() const
Definition: Client.h:94
ShipItemRef m_pod
Definition: Client.h:338
bool IsFleetBoss()
Definition: Client.h:143
#define IsSquadID(itemID)
Definition: EVE_Defines.h:231
ShipItemRef m_ship
Definition: Client.h:337
unsigned __int32 uint32
Definition: eve-compat.h:50
uint32 systemID
void SetCustomInfo(const char *ci)
EVEItemFlags flag() const
void LoadStationHangar(uint32 stationID)
Definition: Client.cpp:1667
int32 m_squad
Definition: Client.h:372
const char * GetName() const
Definition: SystemManager.h:84
#define IsWingID(itemID)
Definition: EVE_Defines.h:228
void SetDestiny(const GPoint &pt, bool update=false)
Definition: Client.cpp:847
bool IsJump()
Definition: Client.h:232
void ResetShipSystemMgr(SystemManager *pSystem)
Definition: Ship.cpp:2512
#define IsFleetID(itemID)
Definition: EVE_Defines.h:225
ShipSE * pShipSE
Definition: Client.h:343
SystemManager * m_system
Definition: Client.h:346
#define sItemFactory
Definition: ItemFactory.h:165
StationData m_StationData
Definition: Client.h:339
bool m_login
Definition: Client.h:356
void SaveShip()
Definition: Ship.cpp:1060
bool IsFleetBooster()
Definition: Client.h:144
void DestroyShipSE()
Definition: Client.cpp:1014
bool m_beyonce
Definition: Client.h:359
void UpdateSession()
Definition: Client.cpp:1935
bool IsHangarLoaded(uint32 stationID)
Definition: Client.cpp:1660
Timer m_fleetTimer
Definition: Client.h:387
uint32 m_fleet
Definition: Client.h:374
uint32 itemID() const
Definition: InventoryItem.h:98
#define sDataMgr
void Start(uint32 setTimerTime=0, bool changeResetTimer=true)
Definition: timer.cpp:81

Here is the call graph for this function:

Here is the caller graph for this function:

void Client::MoveToPosition ( const GPoint pt)

Definition at line 928 of file Client.cpp.

References SystemManager::AddEntity(), CreateShipSE(), SystemEntity::DestinyMgr(), DestinyManager::Halt(), DestinyManager::IsMoving(), m_system, m_undock, pShipSE, ShipSE::SetPilot(), DestinyManager::SetPosition(), and UpdateNewShip().

Referenced by Command_goto().

928  {
929  if ((pShipSE == nullptr) or (pShipSE->DestinyMgr() == nullptr)) {
930  CreateShipSE();
931  pShipSE->SetPilot(this);
933  UpdateNewShip();
934  }
935  pShipSE->DestinyMgr()->SetPosition(pt, true);
936  if (m_undock)
937  return;
938  if (pShipSE->DestinyMgr()->IsMoving())
939  pShipSE->DestinyMgr()->Halt();
940 }
void AddEntity(SystemEntity *pSE, bool addSignal=true)
bool m_undock
Definition: Client.h:357
DestinyManager * DestinyMgr()
Definition: SystemEntity.h:198
void SetPosition(const GPoint &pt, bool update=false)
virtual void SetPilot(Client *pClient)
Definition: Ship.cpp:2517
ShipSE * pShipSE
Definition: Client.h:343
SystemManager * m_system
Definition: Client.h:346
void CreateShipSE()
Definition: Client.cpp:1004
void UpdateNewShip()
Definition: Client.cpp:1025

Here is the call graph for this function:

Here is the caller graph for this function:

Client& Client::operator= ( const Client oth)
delete
Client& Client::operator= ( Client &&  oth)
delete
void Client::PickAlternateShip ( )

Definition at line 1298 of file Client.cpp.

References RefPtr< X >::get(), m_char, m_locationID, m_shipId, and Character::PickAlternateShip().

Referenced by SelectCharacter().

1298  {
1299  if (m_char.get() != nullptr)
1301 }
CharacterRef m_char
Definition: Client.h:340
uint32 m_shipId
Definition: Client.h:375
uint32 m_locationID
Definition: Client.h:377
X * get() const
Definition: RefPtr.h:213
uint32 PickAlternateShip(uint32 locationID)
Definition: Character.cpp:457

Here is the call graph for this function:

Here is the caller graph for this function:

void Client::ProcessClient ( )

Definition at line 433 of file Client.cpp.

References _log, _SendPingRequest(), ShipSE::ApplyBoost(), BoostData::armored, EvESkill::ArmoredWarfare, Player::State::Board, WingData::boost, SquadData::boost, FleetData::booster, WingData::booster, SquadData::booster, Timer::Check(), Profile::client, SystemEntity::DestinyMgr(), Timer::Disable(), Player::State::Dock, DockToStation(), Player::State::DriveJump, Timer::Enabled(), ExecuteDriveJump(), ExecuteJump(), GetChar(), Timer::GetCurrentTime(), GetFileTimeNow(), ShipItem::GetModuleManager(), Character::GetSkillLevel(), GetStateName(), GetTimeUSeconds(), Player::State::Idle, BoostData::info, EvESkill::InformationWarfare, DestinyManager::IsCloaked(), IsFleetID, IsInSpace(), IsSquadID, IsWingID, InventoryItem::itemID(), Player::State::Jump, Player::State::Killed, BoostData::leader, FleetData::leader, WingData::leader, SquadData::leader, EvESkill::Leadership, Player::State::Login, Player::State::Logout, m_ballparkTimer, m_char, m_charCreation, m_clientState, m_cloakTimer, m_fleet, m_fleetTimer, m_invul, m_invulTimer, m_locationID, m_login, m_movePoint, m_pingTimer, m_scan, m_scanProbe, m_scanTimer, m_sessionChangeActive, m_sessionTimer, m_ship, m_skillTimer, m_squad, m_stateTimer, m_uncloak, m_uncloakTimer, m_undock, m_wing, BoostData::mining, EvESkill::MiningForeman, InventoryItem::name(), Scan::ProcessScan(), pShipSE, sConfig, sDataMgr, SendSessionChange(), SetBallPark(), Character::SetLogonMinutes(), sFltSvc, BoostData::siege, EvESkill::SiegeWarfare, Character::SkillQueueLoop(), BoostData::skirmish, EvESkill::SkirmishWarfare, sLog, sProfiler, DestinyManager::UnCloak(), Player::State::Undock, DestinyManager::Undock(), and ModuleManager::UpdateChargeQty().

433  {
434  if (m_charCreation)
435  return;
436 
437  double profileStartTime = GetTimeUSeconds();
438 
439  // wtf is this for?
440  if (m_pingTimer.Check()) {
441  _SendPingRequest(); //10m
443  }
444 
445  if (m_skillTimer > 0)
448 
449  if (m_sessionTimer.Check(false)) {
450  _log(CLIENT__TIMER, "Client::ProcessClient(): SetSessionChange to false for %s(%u)", m_char->name(), m_char->itemID());
452  m_sessionChangeActive = false;
453  }
454 
455  /* Check Character Save Timer Expiry: (not currently used -allan 17May16)
456  if (m_char->CheckSaveTimer()) {
457  _log(CLIENT__TIMER, "Client::ProcessClient(): SaveTimer for %s(%u)", m_char->name(), m_char->itemID());
458  m_char->SaveCharacter();
459  m_ship->SaveShip();
460  }
461  */
462  if (sDataMgr.IsStation(m_locationID)) {
463  if (m_stateTimer.Enabled())
464  if (m_stateTimer.Check(false)) {
466  switch (m_clientState) {
467  case Player::State::Login: {
468  _log(CLIENT__TIMER, "ProcessClient()::IsDocked()::CheckState(): case: Login");
469  m_login = false;
470  } break;
471  case Player::State::Idle: {
472  _log(CLIENT__TIMER, "ProcessClient()::IsDocked()::CheckState(): case: Idle");
473  } break;
474  case Player::State::Logout: {
475  _log(CLIENT__TIMER, "ProcessClient()::IsDocked()::CheckState(): case: Logout");
476  } break;
477  case Player::State::Killed: {
478  _log(CLIENT__TIMER, "ProcessClient()::IsDocked()::CheckState(): case: Killed");
479  } break;
480  }
482  _log(AUTOPILOT__TRACE, "ProcessClient()::IsDocked() - m_clientState set to Idle");
483  }
484  if (sConfig.debug.UseProfiling)
485  sProfiler.AddTime(Profile::client, GetTimeUSeconds() - profileStartTime);
486  return;
487  }
488 
489  if (pShipSE == nullptr) {
490  sLog.Error("ProcessClient()","%s: InSpace with no shipSE. LocationID %u", m_char->name(), m_locationID);
491  return;
492  }
493 
494  if (m_invulTimer.Enabled()/*m_invul*/)
495  if (m_invulTimer.Check(false)) {
496  _log(CLIENT__TIMER, "ProcessClient(): SetInvul to false for %s(%u)", m_char->name(), m_char->itemID());
498  m_invul = false;
499  m_undock = false;
500  }
501 
502  if (m_scanTimer.Enabled())
503  if (m_scanTimer.Check(false)) {
504  _log(CLIENT__TIMER, "ProcessClient(): Scan Timer hit for %s(%u).", m_char->name(), m_char->itemID());
507  }
508 
509  if (m_ballparkTimer.Enabled())
510  if (m_ballparkTimer.Check(false)) {
511  _log(CLIENT__TIMER, "ProcessClient(): Ballpark Timer hit for %s(%u).", m_char->name(), m_char->itemID());
513  SetBallPark();
514  }
515 
516  if (pShipSE->DestinyMgr()->IsCloaked())
517  if (m_cloakTimer.Check(false)) {
518  _log(CLIENT__TIMER, "ProcessClient(): SetCloak to false for %s(%u)", m_char->name(), m_char->itemID());
520  pShipSE->DestinyMgr()->UnCloak();
521  //m_clientState = Player::State::Idle;
522  //_log(AUTOPILOT__TRACE, "ProcessClient() - Cloaked - m_clientState set to Idle");
523  }
524 
525  if (m_uncloak)
526  if (m_uncloakTimer.Check(false)) {
527  _log(CLIENT__TIMER, "ProcessClient(): SetUncloak to false for %s(%u)", m_char->name(), m_char->itemID());
529  m_uncloak = false;
530  }
531 
532  if (m_stateTimer.Enabled())
533  if (m_stateTimer.Check(false)) {
534  _log(CLIENT__TIMER, "ProcessClient(): state timer hit. current state time is %ums", m_stateTimer.GetCurrentTime());
536  switch (m_clientState) {
537  case Player::State::Idle: {
538  _log(CLIENT__TIMER, "ProcessClient()::CheckState(): case: Idle");
539  // this shouldnt hit...error
540  } break;
541  case Player::State::Dock: {
542  _log(CLIENT__TIMER, "ProcessClient()::CheckState(): case: Dock");
543  DockToStation();
544  } break;
545  case Player::State::Undock: {
546  _log(CLIENT__TIMER, "ProcessClient()::CheckState(): case: Undock");
548  SetBallPark();
550  } break;
551  case Player::State::Killed: {
552  _log(CLIENT__TIMER, "ProcessClient()::CheckState(): case: Killed");
553  // live does NOT resend destiny state when killed. see csBoard notes.
556  } break;
557  case Player::State::Board: {
558  _log(CLIENT__TIMER, "ProcessClient()::CheckState(): case: Board");
559  // calling OnSessionChanged() in client with shipid in change will update ego with new ship.
560  // NOTE: all items must be in same bubble.
563  } break;
564  case Player::State::Login: {
565  _log(CLIENT__TIMER, "ProcessClient()::CheckState(): case: Login");
566  m_login = false;
567  SetBallPark();
569  m_ship->GetModuleManager()->UpdateChargeQty(); // <<<< huge hack here....cant find another way to do it yet.
570  } break;
571  case Player::State::Jump: {
572  _log(CLIENT__TIMER, "ProcessClient()::CheckState(): case: Jump");
573  ExecuteJump();
574  } break;
576  _log(CLIENT__TIMER, "ProcessClient()::CheckState(): case: DriveJump");
578  } break;
579  case Player::State::Logout: {
580  _log(CLIENT__TIMER, "ProcessClient()::CheckState(): case: Logout");
581  // can we use this to allow WarpOut?
582  } break;
583  default: {
584  sLog.Error("ProcessClient()","%s: State timer expired with invalid state: %s.", m_char->name(), GetStateName(m_clientState).c_str());
585  //SendErrorMsg("Server Error - Move not initalized properly. You may need to relog. Ref: ServerError 10928");
586  } break;
587  }
588  }
589 
590  // only set for location change
591  if (m_fleetTimer.Enabled())
592  if (m_fleetTimer.Check(false)) {
594  BoostData bData = BoostData();
595  if (IsSquadID(m_squad)) {
596  SquadData sData = SquadData();
597  sFltSvc.GetSquadData(m_squad, sData);
598  if ((sData.leader != nullptr) and (sData.booster != nullptr))
599  if ((sData.leader->IsInSpace()) and (sData.booster->IsInSpace()))
600  bData = sData.boost;
601  } else if (IsWingID(m_wing)) {
602  WingData wData = WingData();
603  sFltSvc.GetWingData(m_wing, wData);
604  if ((wData.leader != nullptr) and (wData.booster != nullptr))
605  if ((wData.leader->IsInSpace()) and (wData.booster->IsInSpace()))
606  bData = wData.boost;
607  } else if (IsFleetID(m_fleet)) {
608  FleetData fData = FleetData();
609  sFltSvc.GetFleetData(m_fleet, fData);
610  if ((fData.leader != nullptr) and (fData.booster != nullptr))
611  if ((fData.leader->IsInSpace()) and (fData.booster->IsInSpace())) {
612  CharacterRef bRef = fData.booster->GetChar();
619  }
620  }
621  pShipSE->ApplyBoost(bData);
622  }
623 
624  if (sConfig.debug.UseProfiling)
625  sProfiler.AddTime(Profile::client, GetTimeUSeconds() - profileStartTime);
626 }
#define sConfig
A macro for easier access to the singleton.
void ExecuteDriveJump()
Definition: Client.cpp:1494
#define _log(type, fmt,...)
Definition: logsys.h:124
void Disable()
Definition: timer.h:39
bool m_uncloak
Definition: Client.h:360
CharacterRef m_char
Definition: Client.h:340
BoostData boost
Definition: FleetData.h:118
void SetLogonMinutes()
Definition: Character.cpp:1306
ModuleManager * GetModuleManager()
Definition: Ship.h:80
void ExecuteJump()
Definition: Client.cpp:1475
int32 m_wing
Definition: Client.h:371
Client * leader
Definition: FleetData.h:129
#define sProfiler
Definition: dbcore.cpp:39
int8 leader
Definition: FleetData.h:71
std::string GetStateName(int8 state)
Definition: Client.cpp:1636
Timer m_ballparkTimer
Definition: Client.h:392
bool m_undock
Definition: Client.h:357
int8 siege
Definition: FleetData.h:74
bool m_sessionChangeActive
Definition: Client.h:369
void SendSessionChange()
Definition: Client.cpp:2048
const char * name()
bool IsInSpace()
Definition: Client.h:228
bool m_charCreation
Definition: Client.h:441
CharacterRef GetChar() const
Definition: Client.h:164
Timer m_sessionTimer
Definition: Client.h:391
uint32 m_locationID
Definition: Client.h:377
Timer m_uncloakTimer
Definition: Client.h:385
GPoint m_movePoint
Definition: Client.h:394
#define sFltSvc
Definition: FleetService.h:147
#define sLog
Evaluates to a NewLog instance.
Definition: LogNew.h:250
DestinyManager * DestinyMgr()
Definition: SystemEntity.h:198
double GetTimeUSeconds()
Definition: utils_time.cpp:116
Timer m_cloakTimer
Definition: Client.h:384
bool Enabled() const
Definition: timer.h:41
void _SendPingRequest()
Definition: Client.cpp:2528
int8 info
Definition: FleetData.h:72
uint32 GetCurrentTime()
Definition: timer.cpp:134
bool Check(bool reset=true)
Definition: timer.cpp:62
void SkillQueueLoop(bool update=true)
Definition: Character.cpp:998
void SetBallPark()
Definition: Client.cpp:887
#define IsSquadID(itemID)
Definition: EVE_Defines.h:231
ShipItemRef m_ship
Definition: Client.h:337
Client * booster
Definition: FleetData.h:130
int8 armored
Definition: FleetData.h:70
void ApplyBoost(BoostData &bData)
Definition: Ship.cpp:2757
int8 skirmish
Definition: FleetData.h:75
int32 m_squad
Definition: Client.h:372
Timer m_stateTimer
Definition: Client.h:381
double GetFileTimeNow()
Definition: utils_time.cpp:84
Timer m_scanTimer
Definition: Client.h:383
Timer m_invulTimer
Definition: Client.h:386
#define IsWingID(itemID)
Definition: EVE_Defines.h:228
#define IsFleetID(itemID)
Definition: EVE_Defines.h:225
Client * leader
Definition: FleetData.h:107
int8 mining
Definition: FleetData.h:73
void Undock(GPoint dir)
void ProcessScan(bool useProbe=false)
Definition: Scan.cpp:56
ShipSE * pShipSE
Definition: Client.h:343
int8 GetSkillLevel(uint16 skillTypeID, bool zeroForNotInjected=true) const
Definition: Character.cpp:575
Client * booster
Definition: FleetData.h:120
void DockToStation()
Definition: Client.cpp:942
Timer m_pingTimer
Definition: Client.h:382
bool m_login
Definition: Client.h:356
BoostData boost
Definition: FleetData.h:128
Scan * m_scan
Definition: Client.h:334
Client * booster
Definition: FleetData.h:108
Client * leader
Definition: FleetData.h:119
bool m_scanProbe
Definition: Client.h:366
int64 m_skillTimer
Definition: Client.h:400
Timer m_fleetTimer
Definition: Client.h:387
uint32 m_fleet
Definition: Client.h:374
uint32 itemID() const
Definition: InventoryItem.h:98
int8 m_clientState
Definition: Client.h:402
bool m_invul
Definition: Client.h:355
#define sDataMgr

Here is the call graph for this function:

bool Client::ProcessNet ( )

Definition at line 292 of file Client.cpp.

References _SendException(), _SendQueuedUpdates(), PyAddress::callID, PyPacket::dest, EVEPacketDispatcher::DispatchPacket(), EVEClientSession::GetState(), m_char, MACHONETMSG_TYPE_NAMES, InventoryItem::name(), EVEClientSession::PopPacket(), SafeDelete(), sLog, PyPacket::source, PyException::ssException, TCPConnection::STATE_CONNECTED, PyPacket::type, and WRAPPEDEXCEPTION.

293 {
295  return false;
296 
297  PyPacket *p(nullptr);
298  while ((p = PopPacket())) {
299  try {
300  if (!DispatchPacket(p))
301  sLog.Error("Client", "%s: Failed to dispatch packet of type %s (%d).", m_char->name(), MACHONETMSG_TYPE_NAMES[ p->type ], (int)p->type);
302  }
303  catch(PyException& e) {
304  _SendException(p->dest, p->source.callID, p->type, WRAPPEDEXCEPTION, &e.ssException);
305  }
306 
307  SafeDelete(p);
308  }
309 
310  // send queue
312 
313  return true;
314 }
void _SendException(const PyAddress &source, int64 callID, MACHONETMSG_TYPE in_response_to, MACHONETERR_TYPE exception_type, PyRep **payload)
Definition: Client.cpp:2503
CharacterRef m_char
Definition: Client.h:340
const char * name()
void SafeDelete(T *&p)
Deletes and nullifies a pointer.
Definition: SafeMem.h:83
#define sLog
Evaluates to a NewLog instance.
Definition: LogNew.h:250
Base class for exceptions that can be converted to python objects.
Definition: PyExceptions.h:39
const char * MACHONETMSG_TYPE_NAMES[MACHONETMSG_TYPE_COUNT]
Definition: PyPacket.cpp:36
void _SendQueuedUpdates()
Definition: Client.cpp:2170
PyPacket * PopPacket()
Pops new packet from queue.
Definition: EVESession.cpp:80
state_t GetState() const
Definition: EVESession.h:65
PyRep * ssException
Definition: PyExceptions.h:48
bool DispatchPacket(PyPacket *packet)

Here is the call graph for this function:

void Client::QueueDestinyEvent ( PyTuple **  multiEvent)

Definition at line 2124 of file Client.cpp.

References PyList::AddItem(), and m_destinyEventQueue.

Referenced by Character::AddToSkillQueue(), SystemEntity::ApplyDamage(), Character::CancelSkillInTraining(), Command_giveskill(), ActiveModule::DeactivateCycle(), Character::LoadPausedSkillQueue(), AttributeMap::SendChanges(), DestinyManager::SendDestinyUpdate(), Prospector::SendFailure(), ActiveModule::ShowEffect(), Character::SkillQueueLoop(), TargetManager::TargetAdded(), ShipItem::UnlinkGroup(), and ShipItem::UnlinkWeapon().

2124  {
2125  if ((event == nullptr) or ((*event) == nullptr))
2126  return;
2127  m_destinyEventQueue->AddItem(*event);
2128  //PyDecRef(*event);
2129 }
PyList * m_destinyEventQueue
Definition: Client.h:460
void AddItem(PyRep *i)
Definition: PyRep.h:701

Here is the call graph for this function:

Here is the caller graph for this function:

void Client::QueueDestinyUpdate ( PyTuple **  update,
bool  DoPackage = false,
bool  IsSetState = false 
)

Definition at line 2131 of file Client.cpp.

References PyList::AddItem(), PyRep::Dump(), PyList::empty(), is_log_enabled, m_bubbleWait, m_destinyUpdateQueue, m_locationID, m_packaged, PyDecRef, sDataMgr, SendNotification(), and sEntityList.

Referenced by SystemBubble::RemoveBalls(), SystemBubble::SendAddBalls(), SystemBubble::SendAddBalls2(), DestinyManager::SendDestinyUpdate(), DestinyManager::SendSetState(), and TargetManager::TargetAdded().

2131  {
2132  if ((update == nullptr) or ((*update) == nullptr))
2133  return;
2134  if (sDataMgr.IsStation(m_locationID))
2135  return;
2136  DoDestinyAction act;
2137  act.stamp = sEntityList.GetStamp();
2138  if (DoPackage/* or m_packaged*/) {
2139  if (IsSetState) {
2140  // send the setstate buffer alone
2141  act.update = *update;
2142  } else {
2143  // this will package all current updates (and those coming in before next flush) into
2144  // a single PackagedAction packet, which is then inserted into the DoDestinyAction packet.
2145  PyList* paList = new PyList();
2146  paList->AddItem(*update);
2147  if (!m_destinyUpdateQueue->empty())
2148  paList->AddItem(m_destinyUpdateQueue);
2149  PackagedAction pa;
2150  pa.substream = new PySubStream(paList);
2151  act.update = pa.Encode();
2152  m_packaged = false;
2153  }
2154  DoDestinyUpdateMain_2 dum;
2155  dum.updates = new PyList();
2156  dum.updates->AddItem(act.Encode());
2157  dum.waitForBubble = m_bubbleWait;
2158  PyTuple* t = dum.Encode();
2159  if (is_log_enabled(CLIENT__QUEUE_DUMP))
2160  t->Dump(CLIENT__QUEUE_DUMP, "");
2161  SendNotification("DoDestinyUpdate", "clientID", &t, false);
2162  PyDecRef(t);
2163  } else {
2164  act.update = *update;
2165  m_packaged = true;
2166  m_destinyUpdateQueue->AddItem(act.Encode());
2167  }
2168 }
void SendNotification(const PyAddress &dest, EVENotificationStream &noti, bool seq=true)
Definition: Client.cpp:2245
#define sEntityList
Definition: EntityList.h:208
Python tuple.
Definition: PyRep.h:567
void Dump(FILE *into, const char *pfx) const
Dumps object to file.
Definition: PyRep.cpp:84
void AddItem(PyRep *i)
Definition: PyRep.h:701
uint32 m_locationID
Definition: Client.h:377
#define is_log_enabled(type)
Definition: logsys.h:78
PyList * m_destinyUpdateQueue
Definition: Client.h:461
bool m_bubbleWait
Definition: Client.h:367
#define PyDecRef(op)
Definition: PyRep.h:57
bool m_packaged
Definition: Client.h:363
bool empty() const
Definition: PyRep.h:664
Python list.
Definition: PyRep.h:639
#define sDataMgr

Here is the call graph for this function:

Here is the caller graph for this function:

bool Client::RecPic ( )
inline

Definition at line 318 of file Client.h.

References m_portrait.

318 { return m_portrait; }
bool m_portrait
Definition: Client.h:364
void Client::RemoveMissionItem ( uint16  typeID,
uint32  qty 
)

Definition at line 1711 of file Client.cpp.

References InventoryItem::AlterQuantity(), InventoryItem::Delete(), flagCargoHold, flagHangar, RefPtr< X >::get(), Inventory::GetByTypeFlag(), InventoryItem::GetMyInventory(), GetShip(), m_locationID, InventoryItem::quantity(), sDataMgr, and sItemFactory.

Referenced by MissionDataMgr::Process().

1712 {
1713  uint16 count = qty;
1714  InventoryItemRef iRef(nullptr);
1715  if (sDataMgr.IsStation(m_locationID)) {
1716  iRef = sItemFactory.GetStationItem(m_locationID)->GetMyInventory()->GetByTypeFlag(typeID, flagHangar);
1717  if (iRef.get() != nullptr) {
1718  if (count < iRef->quantity()) {
1719  iRef->AlterQuantity(count, true);
1720  count = 0;
1721  } else {
1722  count -= iRef->quantity();
1723  iRef->Delete();
1724  }
1725  }
1726  }
1727 
1728  if (count) {
1729  iRef = GetShip()->GetMyInventory()->GetByTypeFlag(typeID, flagCargoHold);
1730  if (iRef.get() != nullptr){
1731  if (count < iRef->quantity()) {
1732  iRef->AlterQuantity(count, true);
1733  count = 0;
1734  } else {
1735  count -= iRef->quantity();
1736  iRef->Delete();
1737  }
1738  }
1739  }
1740  if (count)
1741  ; // make error here for not enough?
1742 }
uint32 m_locationID
Definition: Client.h:377
bool AlterQuantity(int32 qty, bool notify=false)
ShipItemRef GetShip() const
Definition: Client.h:167
#define sItemFactory
Definition: ItemFactory.h:165
Inventory * GetMyInventory()
Definition: InventoryItem.h:91
unsigned __int16 uint16
Definition: eve-compat.h:48
InventoryItemRef GetByTypeFlag(uint32 typeID, EVEItemFlags flag) const
Definition: Inventory.cpp:444
#define sDataMgr

Here is the call graph for this function:

Here is the caller graph for this function:

void Client::RemoveStationHangar ( uint32  stationID)

Definition at line 1656 of file Client.cpp.

References m_hangarLoaded.

1656  {
1657  m_hangarLoaded.erase(hangarID);
1658 }
std::map< uint32, bool > m_hangarLoaded
Definition: Client.h:398
void Client::ResetAfterPodded ( )
Todo:
destroy all implants check skillpoints vs. clone grade and adjust accordingly. reset skill effects if clone != current SP and skills lost

Definition at line 1252 of file Client.cpp.

References CreateNewPod(), flagHangar, GetCloneStationID(), m_autoPilot, m_char, m_locationID, m_pod, m_ship, InventoryItem::Move(), MoveToLocation(), NULL_ORIGIN(), Character::ResetClone(), Character::SaveCharacter(), ShipItem::SaveShip(), SendSessionChange(), SetShip(), SpawnNewRookieShip(), and UpdateSession().

1252  {
1259  m_autoPilot = false;
1260 
1261  CreateNewPod();
1262  SetShip(m_pod);
1263 
1265 
1267  m_ship->SaveShip();
1268  m_char->ResetClone();
1269  m_char->SaveCharacter();
1270 
1272 
1273  //update session with new values
1274  UpdateSession();
1276 }
CharacterRef m_char
Definition: Client.h:340
void MoveToLocation(uint32 location, const GPoint &pt)
Definition: Client.cpp:684
bool m_autoPilot
Definition: Client.h:365
void SendSessionChange()
Definition: Client.cpp:2048
void Move(uint32 new_location=locTemp, EVEItemFlags flag=flagNone, bool notify=false)
uint32 m_locationID
Definition: Client.h:377
void SetShip(ShipItemRef shipRef)
Definition: Client.cpp:1278
static const GPoint NULL_ORIGIN(0, 0, 0)
void SaveCharacter()
Definition: Character.cpp:1257
ShipItemRef m_pod
Definition: Client.h:338
ShipItemRef m_ship
Definition: Client.h:337
int32 GetCloneStationID() const
Definition: Client.h:116
void ResetClone()
Definition: Character.cpp:1252
ShipItemRef SpawnNewRookieShip(uint32 stationID)
Definition: Client.cpp:1314
void SaveShip()
Definition: Ship.cpp:1060
void UpdateSession()
Definition: Client.cpp:1935
void CreateNewPod()
Definition: Client.cpp:1303

Here is the call graph for this function:

void Client::ResetAfterPopped ( GPoint position)

Definition at line 1209 of file Client.cpp.

References _log, SystemManager::AddEntity(), FactionData::allianceID, FactionData::corporationID, CreateNewPod(), SystemEntity::DestinyMgr(), DestinyManager::Eject(), FactionData::factionID, RefPtr< X >::get(), GetAllianceID(), GetCharacterID(), GetCloneStationID(), GetCorporationID(), SystemEntity::GetID(), SystemManager::GetServiceMgr(), GetWarFactionID(), ShipItem::Heal(), InventoryItem::itemID(), m_autoPilot, m_bubbleWait, m_char, m_locationID, m_pod, m_system, MoveToLocation(), InventoryItem::name(), NULL_ORIGIN(), FactionData::ownerID, pShipSE, sBubbleMgr, SendSessionChange(), ShipSE::SetLauncherID(), ShipSE::SetPilot(), InventoryItem::SetPosition(), SetShip(), SpawnNewRookieShip(), and UpdateNewShip().

1210 {
1211  m_autoPilot = false;
1212  m_bubbleWait = false; // allow client processing of subsquent destiny msgs
1213 
1214  if (m_pod.get() == nullptr)
1215  CreateNewPod();
1216 
1217  m_pod->SetPosition(position);
1218 
1219  FactionData data = FactionData();
1220  data.allianceID = GetAllianceID();
1222  data.factionID = GetWarFactionID();
1223  data.ownerID = GetCharacterID();
1224  ShipSE* newShipSE = new ShipSE(m_pod, *(m_system->GetServiceMgr()), m_system, data);
1225  if (newShipSE == nullptr) {
1226  _log(PLAYER__ERROR, "%s ResetAfterPopped() - pShipSE = NULL for shipID %u.", m_char->name(), m_pod->itemID());
1227  // we should probably send char to their clone station if this happens....
1230  throw CustomError ("There was a problem creating your pod in space.<br>You have been transfered to your home station.<br>Ref: ServerError 15107.");
1231  }
1232 
1233  newShipSE->SetLauncherID(pShipSE->GetID());
1234  pShipSE->DestinyMgr()->Eject();
1235  // nullify pilot before removing from bubble, which removes player from bubble map
1236  pShipSE->SetPilot(nullptr);
1237  // remove dead ship from bubble before calling SetShip() (it deletes pShipSE)
1238  sBubbleMgr.Remove(pShipSE);
1239  // set shipSE to null. this allows sending AddBalls when pod added to system
1240  SetShip(m_pod);
1241  // just in case something's a bit off, reset pod to full
1242  m_pod->Heal();
1243  // add pod to system
1244  m_system->AddEntity(newShipSE);
1245  pShipSE = newShipSE;
1246 
1247  UpdateNewShip();
1248  //SetStateTimer(Player::State::Killed, Player::Timer::Killed);
1250 }
void AddEntity(SystemEntity *pSE, bool addSignal=true)
#define _log(type, fmt,...)
Definition: logsys.h:124
CharacterRef m_char
Definition: Client.h:340
void MoveToLocation(uint32 location, const GPoint &pt)
Definition: Client.cpp:684
int32 GetCharacterID() const
Definition: Client.h:113
int32 GetWarFactionID() const
Definition: Client.h:126
int32 GetCorporationID() const
Definition: Client.h:123
bool m_autoPilot
Definition: Client.h:365
void SetPosition(const GPoint &pos)
void SendSessionChange()
Definition: Client.cpp:2048
const char * name()
Definition: Ship.h:301
Advanced version of UserError that allows to send a full custom message.
Definition: PyExceptions.h:453
int32 GetAllianceID() const
Definition: Client.h:125
uint32 m_locationID
Definition: Client.h:377
void Heal()
Definition: Ship.cpp:458
DestinyManager * DestinyMgr()
Definition: SystemEntity.h:198
void SetShip(ShipItemRef shipRef)
Definition: Client.cpp:1278
static const GPoint NULL_ORIGIN(0, 0, 0)
void SetLauncherID(uint32 shipID)
Definition: Ship.h:359
bool m_bubbleWait
Definition: Client.h:367
uint32 GetID()
Definition: SystemEntity.h:207
X * get() const
Definition: RefPtr.h:213
ShipItemRef m_pod
Definition: Client.h:338
PyServiceMgr * GetServiceMgr()
Definition: SystemManager.h:88
int32 GetCloneStationID() const
Definition: Client.h:116
uint32 corporationID
ShipItemRef SpawnNewRookieShip(uint32 stationID)
Definition: Client.cpp:1314
virtual void SetPilot(Client *pClient)
Definition: Ship.cpp:2517
ShipSE * pShipSE
Definition: Client.h:343
SystemManager * m_system
Definition: Client.h:346
#define sBubbleMgr
void CreateNewPod()
Definition: Client.cpp:1303
void UpdateNewShip()
Definition: Client.cpp:1025
uint32 itemID() const
Definition: InventoryItem.h:98

Here is the call graph for this function:

Scan* Client::scan ( )
inline

Definition at line 302 of file Client.h.

References m_scan.

Referenced by ActiveModule::LaunchProbe().

302 { return m_scan; }
Scan * m_scan
Definition: Client.h:334

Here is the caller graph for this function:

bool Client::SelectCharacter ( int32  char_id = 0)

Definition at line 316 of file Client.cpp.

References SystemManager::AddClient(), LSCService::CharacterLogin(), EVEClientSession::CloseClientConnection(), RefPtr< X >::get(), SystemManager::GetStationFromInventory(), GetUserID(), StationItem::HasShip(), ServiceDB::IncrementLoginCount(), InitSession(), itemTypeCapsule, Player::Timer::Login, Player::State::Login, PyServiceMgr::lsc_service, m_char, m_loaded, m_locationID, m_pod, m_services, m_ship, m_shipId, m_system, m_SystemData, m_validSession, MoveToLocation(), SystemData::name, NULL_ORIGIN(), PickAlternateShip(), InventoryItem::position(), sConfig, sDataMgr, SendErrorMsg(), LSCService::SendServerMOTD(), sEntityList, ServiceDB::SetAccountOnlineStatus(), ServiceDB::SetCharacterOnlineStatus(), Character::SetClient(), SetInvulTimer(), Character::SetLoginTime(), ShipItem::SetPlayer(), SetPodItem(), SetShip(), ShipItem::SetShipCapacitorLevel(), ShipItem::SetShipShield(), SetStateTimer(), sItemFactory, Character::SkillQueueLoop(), sLog, SpawnNewRookieShip(), SystemData::systemID, InventoryItem::typeID(), Character::VerifySP(), WarpIn(), and Player::Timer::WarpInInvul.

317 {
318  if (sEntityList.IsOnline(charID)) {
319  sLog.Error("Client::SelectCharacter()", "Char %u already online.", charID);
320  SendErrorMsg("That Character is already online. Selection Failed.");
322  return false;
323  }
324 
325  InitSession(charID);
326  if (!m_validSession){
327  sLog.Error("Client::SelectCharacter()", "Failed to init session for char %u.", charID);
328  SendErrorMsg("Unable to Initalize Character session. Selection Failed.");
330  return false;
331  }
332 
333  sEntityList.AddPlayer(this);
334  sItemFactory.SetUsingClient(this);
335 
336  m_system = sEntityList.FindOrBootSystem(m_SystemData.systemID);
337  if (m_system == nullptr) {
338  sLog.Error("Client::SelectCharacter()", "Failed to boot system %u for char %u.", m_SystemData.systemID, charID);
339  SendErrorMsg("SolarSystem %s(%u) - Boot Failure.", m_SystemData.name.c_str(), m_SystemData.systemID);
341  return false;
342  }
343 
344  m_char = sItemFactory.GetCharacter(charID);
345  if (m_char.get() == nullptr) {
346  sLog.Error("Client::SelectCharacter()", "GetChar for %u = nullptr", charID);
347  SendErrorMsg("Unable to locate Character. Selection Failed.");
348  sItemFactory.UnsetUsingClient();
350  return false;
351  }
352 
353  m_char->SetClient(this);
354 
355  // register with our system manager AFTER character is constructed and initialized
356  m_system->AddClient(this, true);
357 
358  // this will eventually check for d/c timer and rejoin existing fleet if applicable
359  // fleet data is zeroed when char item is created
360 
361  SetPodItem();
362 
363  m_ship = sItemFactory.GetShip(m_shipId);
364  if (m_ship.get() == nullptr) {
365  sLog.Error("Client::SelectCharacter()", "shipID %u invalid for %u. Selecting new ship...", m_shipId, charID);
366  PickAlternateShip(); // incase shipID wasnt set correctly in db (seen on 'bad' Damage::Killed())
367  m_ship = sItemFactory.GetShip(m_shipId);
368  if (m_ship.get() == nullptr) {
369  sLog.Error("Client::SelectCharacter()", "shipID %u for %u also invalid. Loading Pod.", m_shipId, charID);
370  m_ship = m_pod;
371  }
372  SetShip(m_ship);
373  }
374 
375  m_ship->SetPlayer(this);
376 
377  GPoint pos(NULL_ORIGIN);
378  if (sDataMgr.IsSolarSystem(m_locationID))
379  pos = m_ship->position();
380 
382 
383  if (sDataMgr.IsSolarSystem(m_locationID)) {
384  WarpIn();
385  } else {
386  if (m_ship->typeID() == itemTypeCapsule) {
387  if (sConfig.server.NoobShipCheck) {
389  if (sRef.get() == nullptr) {
390  // error here...
391  } else if (!sRef->HasShip(this)) {
393  }
394  } else {
396  }
397  }
398  }
399 
400  //create corp and ally chat channels (if not already created)
402 
403  // load char LPs
404  //m_lpMap
405 
406  // update account online status, increase login count, set last login timestamp
409 
410  //johnsus - characterOnline mod
412  sItemFactory.UnsetUsingClient();
413 
414 
417  //SetCloakTimer(Player::Timer::LoginCloak);
418 
419  m_char->VerifySP();
420  m_char->SkillQueueLoop(false);
421  m_char->SetLoginTime();
422 
423  // set ship cap and shields to full
424  m_ship->SetShipShield(1.0);
426 
427  // send MOTD and server data to 'local' chat channel
429 
430  return (m_loaded = true);
431 }
static bool IncrementLoginCount(uint32 accountID)
Definition: ServiceDB.cpp:140
#define sConfig
A macro for easier access to the singleton.
static void SetCharacterOnlineStatus(uint32 char_id, bool online=false)
Definition: ServiceDB.cpp:177
void SendErrorMsg(const char *fmt,...)
Definition: Client.cpp:2719
SystemData m_SystemData
Definition: Client.h:336
CharacterRef m_char
Definition: Client.h:340
void MoveToLocation(uint32 location, const GPoint &pt)
Definition: Client.cpp:684
std::string name
void SetPodItem()
Definition: Client.cpp:1038
const GPoint & position() const
bool m_loaded
Definition: Client.h:358
uint32 m_shipId
Definition: Client.h:375
#define sEntityList
Definition: EntityList.h:208
void InitSession(int32 characterID)
Definition: Client.cpp:1858
uint32 m_locationID
Definition: Client.h:377
bool HasShip(Client *pClient)
Definition: Station.cpp:242
#define sLog
Evaluates to a NewLog instance.
Definition: LogNew.h:250
Definition: gpoint.h:33
static void SetAccountOnlineStatus(uint32 accountID, bool online=false)
Definition: ServiceDB.cpp:198
bool m_validSession
Definition: Client.h:440
void SetShip(ShipItemRef shipRef)
Definition: Client.cpp:1278
static const GPoint NULL_ORIGIN(0, 0, 0)
void SetShipCapacitorLevel(float fraction)
Definition: Ship.cpp:881
void CharacterLogin(Client *pClient)
Definition: LSCService.cpp:907
PyServiceMgr & m_services
Definition: Client.h:341
void PickAlternateShip()
Definition: Client.cpp:1298
void WarpIn()
Definition: Client.cpp:628
void AddClient(Client *pClient, bool count=false, bool jump=false)
X * get() const
Definition: RefPtr.h:213
void SkillQueueLoop(bool update=true)
Definition: Character.cpp:998
ShipItemRef m_pod
Definition: Client.h:338
ShipItemRef m_ship
Definition: Client.h:337
LSCService * lsc_service
Definition: PyServiceMgr.h:77
StationItemRef GetStationFromInventory(uint32 stationID)
uint32 systemID
void CloseClientConnection()
Disconnects client from the server.
Definition: EVESession.h:93
void SetInvulTimer(uint32 time=Player::Timer::Default)
Definition: Client.cpp:1579
void VerifySP()
Definition: Character.cpp:311
virtual void SetPlayer(Client *pClient)
Definition: Ship.cpp:106
ShipItemRef SpawnNewRookieShip(uint32 stationID)
Definition: Client.cpp:1314
void SetStateTimer(int8 state, uint32 time=Player::Timer::Default)
Definition: Client.cpp:1599
SystemManager * m_system
Definition: Client.h:346
void SendServerMOTD(Client *pClient)
#define sItemFactory
Definition: ItemFactory.h:165
void SetShipShield(float fraction)
Definition: Ship.cpp:897
void SetLoginTime()
Definition: Character.cpp:1290
void SetClient(Client *pClient)
Definition: Character.h:231
uint16 typeID() const
#define sDataMgr
int32 GetUserID() const
Definition: Client.h:109

Here is the call graph for this function:

void Client::SelfChatMessage ( const char *  fmt,
  ... 
)

Definition at line 2812 of file Client.cpp.

References args, RefPtr< X >::get(), m_channels, m_char, InventoryItem::name(), SafeFree(), sLog, and vasprintf().

2813 {
2814  va_list args;
2815  va_start(args, fmt);
2816  char* str(nullptr);
2817  vasprintf(&str, fmt, args);
2818  assert(str);
2819  va_end(args);
2820 
2821  if (m_channels.empty()) {
2822  if (m_char.get() != nullptr)
2823  sLog.Error("Client", "%s: Tried to send self chat, but we are not joined to any channels: %s", m_char->name(), str);
2824  free(str);
2825  return;
2826  }
2827 
2828  if (m_char.get() != nullptr)
2829  sLog.White("Client","%s: Self message on all channels: %s", m_char->name(), str);
2830 
2831  //this is such a pile of crap, but im not sure whats better.
2832  //maybe a private message...
2833  std::set<LSCChannel*>::iterator cur = m_channels.begin();
2834  for (; cur != m_channels.end(); ++cur)
2835  (*cur)->SendMessage(this, str, true);
2836 
2837  //m_channels[
2838 
2839  //just send it to the first channel we are in..
2840  /*LSCChannel *chan = *(m_channels.begin());
2841  * char self_id[24]; //such crap..
2842  * snprintf(self_id, sizeof(self_id), "%u", m_char->itemID());
2843  * if (chan->GetName() == self_id) {
2844  * if (m_channels.size() > 1) {
2845  * chan = *(++m_channels.begin());
2846 }
2847 }*/
2848 
2849  SafeFree(str);
2850 }
CharacterRef m_char
Definition: Client.h:340
const char * name()
std::set< LSCChannel * > m_channels
Definition: Client.h:397
* args
int vasprintf(char **strp, const char *fmt, va_list ap)
Definition: eve-compat.cpp:70
#define sLog
Evaluates to a NewLog instance.
Definition: LogNew.h:250
void SafeFree(T *&p)
Frees and nullifies an array pointer.
Definition: SafeMem.h:111
X * get() const
Definition: RefPtr.h:213

Here is the call graph for this function:

void Client::SelfEveMail ( const char *  subject,
const char *  fmt,
  ... 
)

Definition at line 1249 of file LSCService.cpp.

References args, GetCharacterID(), PyServiceMgr::lsc_service, m_services, SafeFree(), LSCService::SendMail(), and vasprintf().

Referenced by Command_search().

1250 {
1251  va_list args;
1252  va_start(args, fmt);
1253 
1254  char* str = nullptr;
1255  vasprintf(&str, fmt, args);
1256  assert(str);
1257 
1258  va_end(args);
1259 
1261  SafeFree(str);
1262 }
void SendMail(uint32 sender, uint32 recipient, const std::string &subject, const std::string &content)
Definition: LSCService.h:64
int32 GetCharacterID() const
Definition: Client.h:113
* args
int vasprintf(char **strp, const char *fmt, va_list ap)
Definition: eve-compat.cpp:70
void SafeFree(T *&p)
Frees and nullifies an array pointer.
Definition: SafeMem.h:111
PyServiceMgr & m_services
Definition: Client.h:341
LSCService * lsc_service
Definition: PyServiceMgr.h:77

Here is the call graph for this function:

Here is the caller graph for this function:

void Client::SendErrorMsg ( const char *  fmt,
  ... 
)

Definition at line 2719 of file Client.cpp.

References args, SafeFree(), SendNotification(), and vasprintf().

Referenced by _VerifyCrypto(), ModuleManager::Activate(), PlanetMgr::AddExtractorHead(), ModuleManager::AddModule(), Character::AddToSkillQueue(), TurretModule::ApplyDamage(), DestinyManager::AttemptDockOperation(), Command_giveallskills(), PlanetMgrService::CreateBoundObject(), AllianceRegistry::CreateBoundObject(), CorpRegistryService::CreateBoundObject(), PlanetMgr::CreateLink(), PlanetMgr::CreatePin(), PlanetMgr::CreateRoute(), FleetService::FleetBroadcast(), ReprocessingServiceBound::GetQuote(), PlanetMgr::InstallProgram(), Colony::LaunchCommodities(), ActiveModule::LaunchMissile(), ActiveModule::LaunchProbe(), ShipItem::LinkWeaponLoop(), ShipItem::LoadWeaponGroups(), InventoryItem::Merge(), PlanetMgr::MoveExtractorHead(), MoveToLocation(), DestinyManager::Orbit(), PlanetMgr::PrioritizeRoute(), DestinyManager::ProcessState(), PlanetMgr::RemovePin(), PlanetMgr::RemoveRoute(), SelectCharacter(), CustomsSE::SetAnchor(), StructureSE::SetAnchor(), PlanetMgr::UpdateNetwork(), and DestinyManager::WarpTo().

2720 {
2721  va_list args;
2722  va_start(args, fmt);
2723  char* str(nullptr);
2724  vasprintf(&str, fmt, args);
2725  assert(str);
2726  va_end(args);
2727 
2728  Notify_OnRemoteMessage n;
2729  n.msgType = "CustomError";
2730  n.args[ "error" ] = new PyString(str);
2731 
2732  PyTuple* tmp = n.Encode();
2733  SendNotification("OnRemoteMessage", "charid", &tmp);
2734 
2735  SafeFree(str);
2736 }
void SendNotification(const PyAddress &dest, EVENotificationStream &noti, bool seq=true)
Definition: Client.cpp:2245
Python string.
Definition: PyRep.h:430
Python tuple.
Definition: PyRep.h:567
* args
int vasprintf(char **strp, const char *fmt, va_list ap)
Definition: eve-compat.cpp:70
void SafeFree(T *&p)
Frees and nullifies an array pointer.
Definition: SafeMem.h:111

Here is the call graph for this function:

Here is the caller graph for this function:

void Client::SendErrorMsg ( const char *  fmt,
va_list  args 
)

Definition at line 2738 of file Client.cpp.

References SafeFree(), SendNotification(), and vasprintf().

2739 {
2740  char* str(nullptr);
2741  vasprintf(&str, fmt, args);
2742  assert(str);
2743 
2744  Notify_OnRemoteMessage n;
2745  n.msgType = "CustomError";
2746  n.args[ "error" ] = new PyString(str);
2747 
2748  PyTuple* tmp = n.Encode();
2749  SendNotification("OnRemoteMessage", "charid", &tmp);
2750 
2751  SafeFree(str);
2752 
2753 }
void SendNotification(const PyAddress &dest, EVENotificationStream &noti, bool seq=true)
Definition: Client.cpp:2245
Python string.
Definition: PyRep.h:430
Python tuple.
Definition: PyRep.h:567
* args
int vasprintf(char **strp, const char *fmt, va_list ap)
Definition: eve-compat.cpp:70
void SafeFree(T *&p)
Frees and nullifies an array pointer.
Definition: SafeMem.h:111

Here is the call graph for this function:

void Client::SendInfoModalMsg ( const char *  fmt,
  ... 
)

Definition at line 2756 of file Client.cpp.

References args, SafeFree(), SendNotification(), and vasprintf().

Referenced by Command_attrlist(), Command_beltlist(), Command_bindList(), Command_bubblelist(), Command_bubbletrack(), Command_bubblewarp(), Command_cargo(), Command_commandlist(), Command_destinyvars(), Command_entityspawn(), Command_fleetboost(), Command_fleetinvite(), Command_getposition(), Command_halt(), Command_inventory(), Command_list(), Command_location(), Command_players(), Command_savedungeon(), Command_secstatus(), Command_sendstate(), Command_shipdna(), Command_shipinventory(), Command_shipvars(), Command_showsession(), Command_siglist(), Command_skilllist(), Command_status(), Command_syncloc(), Command_syncpos(), Command_targlist(), Command_tr(), Command_update(), Command_warpto(), InventoryItem::SetQuantity(), and Character::SkillQueueLoop().

2757 {
2758  va_list args;
2759  va_start(args, fmt);
2760  char* str(nullptr);
2761  vasprintf(&str, fmt, args);
2762  assert(str);
2763  va_end(args);
2764 
2765  Notify_OnRemoteMessage n;
2766  n.msgType = "ServerMessage";
2767  n.args[ "msg" ] = new PyString(str);
2768 
2769  PyTuple* tmp = n.Encode();
2770  SendNotification("OnRemoteMessage", "charid", &tmp);
2771 
2772  SafeFree(str);
2773 }
void SendNotification(const PyAddress &dest, EVENotificationStream &noti, bool seq=true)
Definition: Client.cpp:2245
Python string.
Definition: PyRep.h:430
Python tuple.
Definition: PyRep.h:567
* args
int vasprintf(char **strp, const char *fmt, va_list ap)
Definition: eve-compat.cpp:70
void SafeFree(T *&p)
Frees and nullifies an array pointer.
Definition: SafeMem.h:111

Here is the call graph for this function:

Here is the caller graph for this function:

void Client::SendInitialSessionStatus ( )
protected

Definition at line 2007 of file Client.cpp.

References _log, PyAddress::callID, PyAddress::Client, PyPacket::dest, PyPacket::Dump(), ClientSession::EncodeInitialState(), PyServiceMgr::GetNodeID(), ClientSession::GetSessionID(), GetUserID(), is_log_enabled, m_services, PyPacket::named_payload, PyAddress::Node, PyAddress::objectID, PyPacket::payload, pSession, EVEClientSession::QueuePacket(), SESSIONINITIALSTATENOTIFICATION, PyPacket::source, PyAddress::type, PyPacket::type, PyPacket::type_string, and PyPacket::userid.

Referenced by _VerifyFuncResult().

2008 {
2009  SessionInitialState scn;
2010  scn.initialstate = new PyDict();
2011 
2012  pSession->EncodeInitialState (scn.initialstate);
2013 
2014  if (is_log_enabled(CLIENT__SESSION)) {
2015  _log(CLIENT__SESSION, "Session initialized. Sending initial session state");
2016  scn.initialstate->Dump(CLIENT__SESSION, " Changes: ");
2017  }
2018 
2019  scn.sessionID = pSession->GetSessionID();
2020 
2021  //build the packet:
2022  PyPacket* packet = new PyPacket();
2023  packet->type_string = "macho.SessionInitialStateNotification";
2025 
2026  packet->source.type = PyAddress::Node;
2027  packet->source.objectID = m_services.GetNodeID();
2028  packet->source.callID = 0;
2029 
2030  packet->dest.type = PyAddress::Client;
2031  packet->dest.objectID = 0; //GetClientID();
2032  packet->dest.callID = 0;
2033 
2034  packet->userid = GetUserID();
2035 
2036  packet->payload = scn.Encode();
2037  packet->named_payload = nullptr;
2038 
2039  if (is_log_enabled(CLIENT__SESSION_DUMP)) {
2040  _log(CLIENT__SESSION_DUMP, "Sending Session packet:");
2041  PyLogDumpVisitor dumper(CLIENT__SESSION_DUMP, CLIENT__SESSION_DUMP);
2042  packet->Dump(CLIENT__SESSION_DUMP, dumper);
2043  }
2044 
2045  QueuePacket(packet);
2046 }
int64 callID
Definition: PyPacket.h:90
#define _log(type, fmt,...)
Definition: logsys.h:124
Python's dictionary.
Definition: PyRep.h:719
PyAddress dest
Definition: PyPacket.h:117
int64 objectID
Definition: PyPacket.h:89
uint32 GetNodeID() const
Definition: PyServiceMgr.h:67
PyTuple * payload
Definition: PyPacket.h:119
#define is_log_enabled(type)
Definition: logsys.h:78
void Dump(LogType type, PyVisitor &dumper)
Definition: PyPacket.cpp:95
int64 GetSessionID()
Definition: ClientSession.h:76
MACHONETMSG_TYPE type
Definition: PyPacket.h:115
AddrType type
Definition: PyPacket.h:88
PyServiceMgr & m_services
Definition: Client.h:341
void QueuePacket(PyPacket *packet)
Queues new packet, retaking ownership.
Definition: EVESession.cpp:66
uint32 userid
Definition: PyPacket.h:118
PyDict * named_payload
Definition: PyPacket.h:120
PyAddress source
Definition: PyPacket.h:116
ClientSession * pSession
Definition: Client.h:345
std::string type_string
Definition: PyPacket.h:112
void EncodeInitialState(PyDict *into)
int32 GetUserID() const
Definition: Client.h:109

Here is the call graph for this function:

Here is the caller graph for this function:

void Client::SendNotification ( const PyAddress dest,
EVENotificationStream noti,
bool  seq = true 
)

Definition at line 2245 of file Client.cpp.

References _log, PyAddress::bcast_idtype, PyPacket::dest, PyPacket::Dump(), EVENotificationStream::Encode(), GetName(), PyServiceMgr::GetNodeID(), GetUserID(), is_log_enabled, m_nextNotifySequence, m_services, PyPacket::named_payload, PyAddress::Node, NOTIFICATION, PyAddress::objectID, PyPacket::payload, EVEClientSession::QueuePacket(), PyAddress::service, PyDict::SetItemString(), PyPacket::source, PyAddress::type, PyPacket::type, PyPacket::type_string, and PyPacket::userid.

Referenced by _SendQueuedUpdates(), FleetService::AddMember(), Character::AlterBalance(), TradeService::CancelTrade(), Command_pop(), DestinyManager::DockingAccepted(), TradeBound::ExchangeItems(), ExecuteDriveJump(), ExecuteJump(), TradeService::InitiateTrade(), ActiveModule::LoadCharge(), ModuleManager::LoadCharge(), CorporationDB::MoveShares(), Scan::ProbeScanResult(), QueueDestinyUpdate(), ProbeSE::RemoveProbe(), InventoryItem::Rename(), Scan::RequestScans(), SendErrorMsg(), SendInfoModalMsg(), InventoryItem::SendItemChange(), Agent::SendMissionUpdate(), ProbeSE::SendNewProbe(), SendNotification(), SendNotifyMsg(), MarketMgr::SendOnOwnOrderChanged(), LSCChannel::SendServerMOTD(), ProbeSE::SendStateChange(), ProbeSE::SendWarpEnd(), ProbeSE::SendWarpStart(), ModuleItem::SetOnline(), Character::SetStanding(), Scan::ShipScanResult(), Scan::SystemScanStarted(), TargetManager::TargetedAdd(), TargetManager::TargetedLost(), TargetManager::TargetLost(), TargetManager::TargetsCleared(), EntityList::Unicast(), and Agent::UpdateStandings().

2245  {
2246  //build the packet:
2247  PyPacket *packet = new PyPacket();
2248  packet->type_string = "macho.Notification";
2249  packet->type = NOTIFICATION;
2250 
2251  // is source type right here?
2252  packet->source.type = PyAddress::Node;
2253  packet->source.objectID = m_services.GetNodeID();
2254 
2255  packet->dest = dest;
2256 
2257  packet->userid = GetUserID();
2258 
2259  packet->payload = noti.Encode();
2260 
2261  if (seq) {
2262  packet->named_payload = new PyDict();
2263  packet->named_payload->SetItemString("sn", new PyInt(++m_nextNotifySequence));
2264  }
2265 
2266  if (is_log_enabled(CLIENT__NOTIFY_DUMP)) {
2267  _log(CLIENT__NOTIFY_REP, "Sending notify of type %s with ID type %s to %s", dest.service.c_str(), dest.bcast_idtype.c_str(), GetName());
2268  PyLogDumpVisitor dumper(CLIENT__NOTIFY_DUMP, CLIENT__NOTIFY_REP, "", true, true);
2269  packet->Dump(CLIENT__NOTIFY_DUMP, dumper);
2270  }
2271 
2272  QueuePacket(packet);
2273 }
#define _log(type, fmt,...)
Definition: logsys.h:124
uint32 m_nextNotifySequence
Definition: Client.h:464
Python's dictionary.
Definition: PyRep.h:719
PyAddress dest
Definition: PyPacket.h:117
int64 objectID
Definition: PyPacket.h:89
uint32 GetNodeID() const
Definition: PyServiceMgr.h:67
PyTuple * payload
Definition: PyPacket.h:119
#define is_log_enabled(type)
Definition: logsys.h:78
void Dump(LogType type, PyVisitor &dumper)
Definition: PyPacket.cpp:95
MACHONETMSG_TYPE type
Definition: PyPacket.h:115
AddrType type
Definition: PyPacket.h:88
Python integer.
Definition: PyRep.h:231
PyServiceMgr & m_services
Definition: Client.h:341
const char * GetName() const
Definition: Client.h:94
std::string bcast_idtype
Definition: PyPacket.h:93
void QueuePacket(PyPacket *packet)
Queues new packet, retaking ownership.
Definition: EVESession.cpp:66
uint32 userid
Definition: PyPacket.h:118
PyDict * named_payload
Definition: PyPacket.h:120
std::string service
Definition: PyPacket.h:92
PyAddress source
Definition: PyPacket.h:116
std::string type_string
Definition: PyPacket.h:112
void SetItemString(const char *key, PyRep *value)
SetItemString adds or sets a database entry.
Definition: PyRep.h:812
int32 GetUserID() const
Definition: Client.h:109

Here is the call graph for this function:

Here is the caller graph for this function:

void Client::SendNotification ( const char *  notifyType,
const char *  idType,
PyTuple payload,
bool  seq = true 
)

Definition at line 2205 of file Client.cpp.

References EVENotificationStream::args, PyAddress::bcast_idtype, PyAddress::Broadcast, EVENotificationStream::notifyType, EVENotificationStream::remoteObject, SendNotification(), PyAddress::service, and PyAddress::type.

2205  {
2206  //build a little notification out of it.
2207  EVENotificationStream notify;
2208  notify.notifyType = notifyType;
2209  notify.remoteObject = 1;
2210  notify.args = payload;
2211 
2212  PyAddress dest;
2213  // are all of these 'Broadcast'?
2214  dest.type = PyAddress::Broadcast;
2215  dest.service = notifyType;
2216  dest.bcast_idtype = idType;
2217  /*
2218  if (dest.bcast_idtype.compare("clientID") == 0)
2219  dest.objectID = GetClientID();*/
2220 
2221  //now send it to the client
2222  SendNotification(dest, notify, seq);
2223 }
void SendNotification(const PyAddress &dest, EVENotificationStream &noti, bool seq=true)
Definition: Client.cpp:2245
std::string notifyType
Definition: PyPacket.h:172
AddrType type
Definition: PyPacket.h:88
std::string bcast_idtype
Definition: PyPacket.h:93
std::string service
Definition: PyPacket.h:92

Here is the call graph for this function:

void Client::SendNotification ( const char *  notifyType,
const char *  idType,
PyTuple **  payload,
bool  seq = true 
)

Definition at line 2225 of file Client.cpp.

References EVENotificationStream::args, PyAddress::bcast_idtype, PyAddress::Broadcast, EVENotificationStream::notifyType, PyAddress::objectID, EVENotificationStream::remoteObject, SendNotification(), PyAddress::service, and PyAddress::type.

2225  {
2226  if ((*payload) == nullptr)
2227  return;
2228  //build a little notification out of it.
2229  EVENotificationStream notify;
2230  notify.notifyType = notifyType;
2231  notify.remoteObject = 1;
2232  notify.args = (*payload);
2233 
2234  PyAddress dest;
2235  // are all of these 'Broadcast'?
2236  dest.type = PyAddress::Broadcast;
2237  dest.service = notifyType;
2238  dest.bcast_idtype = idType;
2239  dest.objectID = 0; //GetClientID();
2240 
2241  //now send it to the client
2242  SendNotification(dest, notify, seq);
2243 }
void SendNotification(const PyAddress &dest, EVENotificationStream &noti, bool seq=true)
Definition: Client.cpp:2245
int64 objectID
Definition: PyPacket.h:89
std::string notifyType
Definition: PyPacket.h:172
AddrType type
Definition: PyPacket.h:88
std::string bcast_idtype
Definition: PyPacket.h:93
std::string service
Definition: PyPacket.h:92

Here is the call graph for this function:

void Client::SendNotifyMsg ( const char *  fmt,
  ... 
)

Definition at line 2776 of file Client.cpp.

References args, SafeFree(), SendNotification(), and vasprintf().

Referenced by ModuleManager::Activate(), MiningLaser::AddOreAndDeactivate(), TurretModule::ApplyDamage(), BanClient(), DestinyManager::Bump(), CynoModule::CanActivate(), MiningLaser::CanActivate(), ActiveModule::CanActivate(), Command_autostop(), Command_bubbletrack(), Command_showall(), Command_track(), ModuleManager::DamageModule(), DisconnectClient(), ActiveModule::DoCycle(), Prospector::DropSalvage(), MarketMgr::ExecuteBuyOrder(), Character::InjectSkillIntoBrain(), ModuleManager::LoadCharge(), InventoryBound::MoveItems(), GenericModule::Online(), MiningLaser::ProcessCycle(), TargetManager::StartTargeting(), ShipItem::UnlinkWeapon(), and ModuleManager::UnloadCharge().

2777 {
2778  va_list args;
2779  va_start(args, fmt);
2780  char* str(nullptr);
2781  vasprintf(&str, fmt, args);
2782  assert(str);
2783  va_end(args);
2784 
2785  Notify_OnRemoteMessage n;
2786  n.msgType = "CustomNotify";
2787  n.args[ "notify" ] = new PyString(str);
2788 
2789  PyTuple* tmp = n.Encode();
2790  SendNotification("OnRemoteMessage", "charid", &tmp);
2791 
2792  SafeFree(str);
2793 }
void SendNotification(const PyAddress &dest, EVENotificationStream &noti, bool seq=true)
Definition: Client.cpp:2245
Python string.
Definition: PyRep.h:430
Python tuple.
Definition: PyRep.h:567
* args
int vasprintf(char **strp, const char *fmt, va_list ap)
Definition: eve-compat.cpp:70
void SafeFree(T *&p)
Frees and nullifies an array pointer.
Definition: SafeMem.h:111

Here is the call graph for this function:

Here is the caller graph for this function:

void Client::SendNotifyMsg ( const char *  fmt,
va_list  args 
)

Definition at line 2795 of file Client.cpp.

References SafeFree(), SendNotification(), and vasprintf().

2796 {
2797  char* str(nullptr);
2798  vasprintf(&str, fmt, args);
2799  assert(str);
2800 
2801  Notify_OnRemoteMessage n;
2802  n.msgType = "CustomNotify";
2803  n.args[ "notify" ] = new PyString(str);
2804 
2805  PyTuple* tmp = n.Encode();
2806  SendNotification("OnRemoteMessage", "charid", &tmp);
2807 
2808  SafeFree(str);
2809 }
void SendNotification(const PyAddress &dest, EVENotificationStream &noti, bool seq=true)
Definition: Client.cpp:2245
Python string.
Definition: PyRep.h:430
Python tuple.
Definition: PyRep.h:567
* args
int vasprintf(char **strp, const char *fmt, va_list ap)
Definition: eve-compat.cpp:70
void SafeFree(T *&p)
Frees and nullifies an array pointer.
Definition: SafeMem.h:111

Here is the call graph for this function:

void Client::SendSessionChange ( )

Definition at line 2048 of file Client.cpp.

References _log, PyAddress::callID, PyAddress::Client, codelog, PyPacket::dest, PyPacket::Dump(), ClientSession::EncodeChanges(), RefPtr< X >::get(), PyServiceMgr::GetNodeID(), GetUserID(), is_log_enabled, ClientSession::isDirty(), InventoryItem::itemID(), m_char, m_locationID, m_services, m_SystemData, InventoryItem::name(), PyPacket::named_payload, PyAddress::Node, PyAddress::objectID, PyPacket::payload, pSession, EVEClientSession::QueuePacket(), sDataMgr, SESSIONCHANGENOTIFICATION, ClientSession::SetInt(), PyPacket::source, Character::stationID(), SystemData::systemID, EvE::traceStack(), PyAddress::type, PyPacket::type, PyPacket::type_string, and PyPacket::userid.

Referenced by Board(), Eject(), Handle_CallReq(), MoveToLocation(), ProcessClient(), ResetAfterPodded(), ResetAfterPopped(), UpdateCorpSession(), and UpdateFleetSession().

2049 {
2050  if (!pSession->isDirty())
2051  return;
2052 
2053  // this should never happen now. -allan 3Aug16
2054  if (m_locationID == 0) {
2055  if (m_char.get() != nullptr) {
2056  codelog(CLIENT__ERROR, "Session::LocationID == 0 for %s(%u)", m_char->name(), m_char->itemID());
2057  EvE::traceStack();
2058  if (sDataMgr.IsStation(m_char->stationID())) {
2060  } else {
2062  }
2063  /* a `session.locationid` change will trigger a ballpark update (add/delete bp) */
2064  pSession->SetInt("locationid", m_locationID);
2065  }
2066  }
2067 
2068  SessionChangeNotification scn;
2069  scn.changes = new PyDict();
2070 
2071  pSession->EncodeChanges(scn.changes);
2072  if (scn.changes->empty())
2073  return;
2074 
2075  if (is_log_enabled(CLIENT__SESSION)) {
2076  _log(CLIENT__SESSION, "Session updated. Sending session change");
2077  scn.changes->Dump(CLIENT__SESSION, " Changes: ");
2078  }
2079 
2080  scn.sessionID = 0; //pSession->GetSessionID();
2081  scn.clueless = 0;
2082  scn.nodesOfInterest.push_back(-1); /* this means 'all nodes' */
2083  scn.nodesOfInterest.push_back(m_services.GetNodeID()); /* add current node to list */
2084  /* if other nodes are created, add those that are 'live' for this client here */
2085  // will need *some way* to track active nodes for each client
2086  //scn.nodesOfInterest.push_back(m_services.GetNodeID());
2087 
2088  //build the packet:
2089  PyPacket* packet = new PyPacket();
2090  packet->type_string = "macho.SessionChangeNotification";
2091  packet->type = SESSIONCHANGENOTIFICATION;
2092 
2093  packet->source.type = PyAddress::Node;
2094  packet->source.objectID = m_services.GetNodeID();
2095  packet->source.callID = 0;
2096 
2097  packet->dest.type = PyAddress::Client;
2098  packet->dest.objectID = 0; //GetClientID();
2099  packet->dest.callID = 0;
2100 
2101  packet->userid = GetUserID();
2102 
2103  packet->payload = scn.Encode();
2104  packet->named_payload = nullptr;
2105 
2106  if (is_log_enabled(CLIENT__SESSION_DUMP)) {
2107  _log(CLIENT__SESSION_DUMP, "Sending Session packet:");
2108  PyLogDumpVisitor dumper(CLIENT__SESSION_DUMP, CLIENT__SESSION_DUMP);
2109  packet->Dump(CLIENT__SESSION_DUMP, dumper);
2110  }
2111 
2112  QueuePacket(packet);
2113 
2114  // clean up packet after being created by 'new'
2115  //SafeDelete(packet);
2116 }
int64 callID
Definition: PyPacket.h:90
SystemData m_SystemData
Definition: Client.h:336
#define _log(type, fmt,...)
Definition: logsys.h:124
Python's dictionary.
Definition: PyRep.h:719
CharacterRef m_char
Definition: Client.h:340
PyAddress dest
Definition: PyPacket.h:117
int64 objectID
Definition: PyPacket.h:89
const char * name()
uint32 GetNodeID() const
Definition: PyServiceMgr.h:67
PyTuple * payload
Definition: PyPacket.h:119
uint32 m_locationID
Definition: Client.h:377
#define is_log_enabled(type)
Definition: logsys.h:78
void Dump(LogType type, PyVisitor &dumper)
Definition: PyPacket.cpp:95
MACHONETMSG_TYPE type
Definition: PyPacket.h:115
uint32 stationID() const
Definition: Character.h:326
AddrType type
Definition: PyPacket.h:88
bool isDirty() const
Definition: ClientSession.h:43
#define codelog(type, fmt,...)
Definition: logsys.h:128
PyServiceMgr & m_services
Definition: Client.h:341
X * get() const
Definition: RefPtr.h:213
uint32 systemID
void QueuePacket(PyPacket *packet)
Queues new packet, retaking ownership.
Definition: EVESession.cpp:66
uint32 userid
Definition: PyPacket.h:118
PyDict * named_payload
Definition: PyPacket.h:120
void traceStack(void)
Definition: misc.cpp:169
PyAddress source
Definition: PyPacket.h:116
void SetInt(const char *name, int32 value)
ClientSession * pSession
Definition: Client.h:345
std::string type_string
Definition: PyPacket.h:112
void EncodeChanges(PyDict *into)
uint32 itemID() const
Definition: InventoryItem.h:98
#define sDataMgr
int32 GetUserID() const
Definition: Client.h:109

Here is the call graph for this function:

Here is the caller graph for this function:

PyServiceMgr& Client::services ( ) const
inline

Definition at line 90 of file Client.h.

References m_services.

Referenced by Command_bindList(), and CynoModule::CreateCyno().

90 { return m_services; }
PyServiceMgr & m_services
Definition: Client.h:341

Here is the caller graph for this function:

void Client::SetAFK ( bool  set = true)
inline

Definition at line 97 of file Client.h.

References m_afk.

97 { m_afk = set; }
bool m_afk
Definition: Client.h:354
void Client::SetAutoPilot ( bool  set = false)

Definition at line 669 of file Client.cpp.

References _log, GetName(), and m_autoPilot.

Referenced by DestinyManager::AttemptDockOperation(), and DestinyManager::Stop().

670 {
671  // itemID=10644 flag=*module* not published - not in client data
672  if (m_autoPilot == set)
673  return;
674 
675  m_autoPilot = set;
676  _log(AUTOPILOT__MESSAGE, "%s called SetAutoPilot to %s", GetName(), (set ? "true" : "false"));
677 }
#define _log(type, fmt,...)
Definition: logsys.h:124
bool m_autoPilot
Definition: Client.h:365
const char * GetName() const
Definition: Client.h:94

Here is the call graph for this function:

Here is the caller graph for this function:

void Client::SetAutoStop ( bool  set = false)
inline

Definition at line 273 of file Client.h.

References m_autoStop.

Referenced by Command_autostop().

273 { m_autoStop = set; }
bool m_autoStop
Definition: Client.h:362

Here is the caller graph for this function:

void Client::SetBallPark ( )

Definition at line 887 of file Client.cpp.

References _log, SystemManager::AddEntity(), CheckBallparkTimer(), Player::Timer::Default, SystemEntity::DestinyMgr(), Timer::Disable(), GetStateName(), Player::State::Idle, IsJump(), Player::Timer::JumpCloak, Player::Timer::JumpInvul, m_ballparkTimer, m_beyonce, m_bubbleWait, m_clientState, m_cloakTimer, m_login, m_setStateSent, m_system, m_undock, pShipSE, DestinyManager::SendSetState(), SetBallParkTimer(), SetInvulTimer(), DestinyManager::SetSpeedFraction(), Timer::Start(), and SystemEntity::SysBubble().

Referenced by BeyonceBound::m_dispatch(), and ProcessClient().

887  {
888  _log(PLAYER__AP_TRACE, "Client::SetBallPark(): State: %s, SetState: %s, Beyonce: %s", \
889  GetStateName(m_clientState).c_str(), m_setStateSent?"true":"false", m_beyonce?"true":"false");
890  m_bubbleWait = false; // allow client processing of subsequent destiny msgs
891  if (pShipSE->SysBubble() == nullptr)
893  if (!m_beyonce and !m_login and !m_undock) {
894  m_bubbleWait = true; // wait on proc destiny msgs
896  SetBallParkTimer(Player::Timer::Default); // set timer 1s to wait for beyonce
897  return;
898  }
899  if (!m_setStateSent and m_beyonce) { // MUST have beyonce before sending state data.
902  if (IsJump()) {
904  // dont use timer method here...(jumping ship will flash at destination)
907  }
908  }
909  if (m_undock)
911 }
bool m_setStateSent
Definition: Client.h:368
void AddEntity(SystemEntity *pSE, bool addSignal=true)
#define _log(type, fmt,...)
Definition: logsys.h:124
void Disable()
Definition: timer.h:39
SystemBubble * SysBubble()
Definition: SystemEntity.h:195
void SetBallParkTimer(uint32 time=Player::Timer::Default)
Definition: Client.cpp:1515
std::string GetStateName(int8 state)
Definition: Client.cpp:1636
Timer m_ballparkTimer
Definition: Client.h:392
bool m_undock
Definition: Client.h:357
void SendSetState() const
void CheckBallparkTimer()
Definition: Client.cpp:913
DestinyManager * DestinyMgr()
Definition: SystemEntity.h:198
Timer m_cloakTimer
Definition: Client.h:384
bool m_bubbleWait
Definition: Client.h:367
void SetSpeedFraction(float fraction=1.0f, bool startMovement=false)
void SetInvulTimer(uint32 time=Player::Timer::Default)
Definition: Client.cpp:1579
bool IsJump()
Definition: Client.h:232
ShipSE * pShipSE
Definition: Client.h:343
SystemManager * m_system
Definition: Client.h:346
bool m_login
Definition: Client.h:356
bool m_beyonce
Definition: Client.h:359
int8 m_clientState
Definition: Client.h:402
void Start(uint32 setTimerTime=0, bool changeResetTimer=true)
Definition: timer.cpp:81

Here is the call graph for this function:

Here is the caller graph for this function:

void Client::SetBallParkTimer ( uint32  time = Player::Timer::Default)

Definition at line 1515 of file Client.cpp.

References _log, Timer::Disable(), Timer::Enabled(), Timer::GetCurrentTime(), Timer::GetRemainingTime(), m_ballparkTimer, m_char, InventoryItem::name(), Timer::Start(), and EvE::traceStack().

Referenced by ExecuteDriveJump(), ExecuteJump(), and SetBallPark().

1516 {
1517  if (time == 0) {
1519  _log(CLIENT__TIMER, "%s: Ballpark Timer Disabled", m_char->name());
1520  return;
1521  }
1522 
1523  if (m_ballparkTimer.Enabled()) {
1524  _log(CLIENT__ERROR, "%s: Ballpark Timer called but timer already enabled with %ums remaining.", m_char->name(), m_ballparkTimer.GetRemainingTime());
1525  EvE::traceStack();
1526  return;
1527  }
1528 
1529  _log(CLIENT__TIMER, "%s: Ballpark Timer set at %ums. current state time is %ums", m_char->name(), time, m_ballparkTimer.GetCurrentTime());
1530  m_ballparkTimer.Start(time);
1531 }
#define _log(type, fmt,...)
Definition: logsys.h:124
void Disable()
Definition: timer.h:39
CharacterRef m_char
Definition: Client.h:340
Timer m_ballparkTimer
Definition: Client.h:392
const char * name()
uint32 GetRemainingTime() const
Definition: timer.cpp:114
bool Enabled() const
Definition: timer.h:41
uint32 GetCurrentTime()
Definition: timer.cpp:134
void traceStack(void)
Definition: misc.cpp:169
void Start(uint32 setTimerTime=0, bool changeResetTimer=true)
Definition: timer.cpp:81

Here is the call graph for this function:

Here is the caller graph for this function:

void Client::SetBeyonce ( bool  beyonce = false)
inline

Definition at line 246 of file Client.h.

References m_beyonce.

Referenced by BeyonceBound::m_dispatch().

246 { m_beyonce = beyonce; }
bool m_beyonce
Definition: Client.h:359

Here is the caller graph for this function:

void Client::SetBubbleWait ( bool  wait = false)
inline

Definition at line 248 of file Client.h.

References m_bubbleWait.

248 { m_bubbleWait = wait; }
bool m_bubbleWait
Definition: Client.h:367
void Client::SetChar ( CharacterRef  charRef)
inline

Definition at line 163 of file Client.h.

References m_char.

163 { m_char = charRef; } // only used during char creation
CharacterRef m_char
Definition: Client.h:340
void Client::SetCloakTimer ( uint32  time = Player::Timer::Default)

Definition at line 1533 of file Client.cpp.

References _log, DestinyManager::Cloak(), SystemEntity::DestinyMgr(), Timer::Disable(), Timer::Enabled(), Timer::GetCurrentTime(), Timer::GetRemainingTime(), m_char, m_cloakTimer, m_login, InventoryItem::name(), pShipSE, Timer::Start(), EvE::traceStack(), and DestinyManager::UnCloak().

1534 {
1535  if (time == 0) {
1537  if (pShipSE != nullptr)
1538  if (pShipSE->DestinyMgr() != nullptr)
1539  pShipSE->DestinyMgr()->UnCloak();
1540  _log(CLIENT__TIMER, "%s: Cloak Timer Disabled");
1541  return;
1542  }
1543 
1544  if (m_cloakTimer.Enabled()) {
1545  _log(CLIENT__ERROR, "%s: Cloak Timer called but timer already enabled with %ums remaining.", m_char->name(), m_cloakTimer.GetRemainingTime());
1546  EvE::traceStack();
1547  return;
1548  }
1549 
1550  _log(CLIENT__TIMER, "%s: Cloak Timer set at %ums. current state time is %ums", m_char->name(), time, m_cloakTimer.GetCurrentTime());
1551  m_cloakTimer.Start(time);
1552  if (m_login)
1553  return;
1554  if (pShipSE != nullptr)
1555  if (pShipSE->DestinyMgr() != nullptr)
1556  pShipSE->DestinyMgr()->Cloak();
1557 }
#define _log(type, fmt,...)
Definition: logsys.h:124
void Disable()
Definition: timer.h:39
CharacterRef m_char
Definition: Client.h:340
const char * name()
uint32 GetRemainingTime() const
Definition: timer.cpp:114
DestinyManager * DestinyMgr()
Definition: SystemEntity.h:198
Timer m_cloakTimer
Definition: Client.h:384
bool Enabled() const
Definition: timer.h:41
uint32 GetCurrentTime()
Definition: timer.cpp:134
ShipSE * pShipSE
Definition: Client.h:343
void traceStack(void)
Definition: misc.cpp:169
bool m_login
Definition: Client.h:356
void Start(uint32 setTimerTime=0, bool changeResetTimer=true)
Definition: timer.cpp:81

Here is the call graph for this function:

void Client::SetDestiny ( const GPoint pt,
bool  update = false 
)

Definition at line 847 of file Client.cpp.

References _log, SystemManager::AddEntity(), CreateShipSE(), SystemEntity::DestinyMgr(), SystemManager::GetID(), GetName(), SystemEntity::GetPosition(), SystemGPoint::GetRandPointOnPlanet(), DestinyManager::IsCloaked(), IsJump(), Ga::GaVec3::isZero(), InventoryItem::itemID(), m_bubbleWait, m_char, m_locationID, m_setStateSent, m_SGP, m_system, pShipSE, sDataMgr, DestinyManager::SetPosition(), SystemEntity::SystemMgr(), and UpdateNewShip().

Referenced by Command_addball(), Command_addball2(), Command_destinyvars(), Command_entityspawn(), Command_halt(), Command_location(), Command_sendstate(), Command_shipvars(), Command_status(), Command_syncloc(), Command_syncpos(), Command_update(), Command_warpto(), and MoveToLocation().

847  {
848  if (!sDataMgr.IsSolarSystem(m_locationID)) {
849  _log(CLIENT__ERROR, "%s(%u) - Calling SetDestiny() when not in space.", GetName(), m_char->itemID());
850  return;
851  }
852  m_bubbleWait = false; // allow client processing of subsquent destiny msgs
853  m_setStateSent = false;
854 
855  bool updateShip = false;
856  if (pShipSE == nullptr) {
857  updateShip = true;
858  CreateShipSE();
859  }
860 
861  if (pShipSE->SystemMgr()->GetID() != m_system->GetID())
862  _log(CLIENT__ERROR, "%s(%u) - Ship SysID of %u != Client SysID of %u.", GetName(), m_char->itemID(), pShipSE->SystemMgr()->GetID(), m_system->GetID());
863 
864  _log(PLAYER__AP_TRACE, "Client::SetDestiny(): shipSystemID: %u, SystemID: %u, update: %s, updateShip: %s, jump: %s, cloak: %s", \
865  pShipSE->SystemMgr()->GetID(), m_system->GetID(), update?"true":"false", \
866  updateShip?"true":"false", IsJump()?"true":"false", pShipSE->DestinyMgr()->IsCloaked()?"true":"false");
867 
868  if (pt.isZero()) {
869  if (pShipSE->GetPosition().isZero()) {
871  } else {
873  }
874  } else {
875  pShipSE->DestinyMgr()->SetPosition(pt, update);
876  }
877 
878  //if (m_login)
879  // pShipSE->DestinyMgr()->SetCloak(true);
880 
882 
883  if (updateShip)
884  UpdateNewShip();
885 }
bool m_setStateSent
Definition: Client.h:368
void AddEntity(SystemEntity *pSE, bool addSignal=true)
#define _log(type, fmt,...)
Definition: logsys.h:124
CharacterRef m_char
Definition: Client.h:340
uint32 GetID() const
Definition: SystemManager.h:80
const GPoint & GetPosition() const
Definition: SystemEntity.h:211
uint32 m_locationID
Definition: Client.h:377
const GPoint GetRandPointOnPlanet(uint32 systemID)
DestinyManager * DestinyMgr()
Definition: SystemEntity.h:198
SystemManager * SystemMgr()
Definition: SystemEntity.h:196
SystemGPoint m_SGP
Definition: Client.h:342
bool m_bubbleWait
Definition: Client.h:367
const char * GetName() const
Definition: Client.h:94
void SetPosition(const GPoint &pt, bool update=false)
bool IsJump()
Definition: Client.h:232
GaExpInl bool isZero() const
Definition: GaTypes.h:188
ShipSE * pShipSE
Definition: Client.h:343
SystemManager * m_system
Definition: Client.h:346
void CreateShipSE()
Definition: Client.cpp:1004
void UpdateNewShip()
Definition: Client.cpp:1025
uint32 itemID() const
Definition: InventoryItem.h:98
#define sDataMgr

Here is the call graph for this function:

Here is the caller graph for this function:

void Client::SetDockPoint ( GPoint pt)
inline

Definition at line 224 of file Client.h.

References m_dockPoint.

224 { m_dockPoint = pt; }
GPoint m_dockPoint
Definition: Client.h:395
void Client::SetDockStationID ( uint32  stationID)
inline

Definition at line 223 of file Client.h.

References m_dockStationID.

223 { m_dockStationID = stationID; };
uint32 m_dockStationID
Definition: Client.h:379
void Client::SetInvul ( bool  invul = false)
inline

Definition at line 244 of file Client.h.

References m_invul.

Referenced by SetInvulTimer().

244 { m_invul = invul; }
bool m_invul
Definition: Client.h:355

Here is the caller graph for this function:

void Client::SetInvulTimer ( uint32  time = Player::Timer::Default)

Definition at line 1579 of file Client.cpp.

References _log, Timer::Disable(), Timer::Enabled(), Timer::GetCurrentTime(), Timer::GetRemainingTime(), m_char, m_invulTimer, InventoryItem::name(), SetInvul(), Timer::Start(), and EvE::traceStack().

Referenced by SelectCharacter(), SetBallPark(), and UndockFromStation().

1580 {
1581  if (time == 0) {
1582  SetInvul(false);
1584  _log(CLIENT__TIMER, "%s: Invul Timer Disabled");
1585  return;
1586  }
1587 
1588  if (m_invulTimer.Enabled()) {
1589  _log(CLIENT__ERROR, "%s: Invul Timer called but timer already enabled with %ums remaining.", m_char->name(), m_invulTimer.GetRemainingTime());
1590  EvE::traceStack();
1591  return;
1592  }
1593 
1594  _log(CLIENT__TIMER, "%s: Invul Timer set at %ums. current state time is %ums", m_char->name(), time, m_invulTimer.GetCurrentTime());
1595  m_invulTimer.Start(time);
1596  SetInvul(true);
1597 }
#define _log(type, fmt,...)
Definition: logsys.h:124
void Disable()
Definition: timer.h:39
CharacterRef m_char
Definition: Client.h:340
const char * name()
uint32 GetRemainingTime() const
Definition: timer.cpp:114
void SetInvul(bool invul=false)
Definition: Client.h:244
bool Enabled() const
Definition: timer.h:41
uint32 GetCurrentTime()
Definition: timer.cpp:134
Timer m_invulTimer
Definition: Client.h:386
void traceStack(void)
Definition: misc.cpp:169
void Start(uint32 setTimerTime=0, bool changeResetTimer=true)
Definition: timer.cpp:81

Here is the call graph for this function:

Here is the caller graph for this function:

void Client::SetPicRec ( bool  set = false)
inline

Definition at line 319 of file Client.h.

References m_portrait.

319 { m_portrait = set; }
bool m_portrait
Definition: Client.h:364
void Client::SetPodItem ( )

Definition at line 1038 of file Client.cpp.

References Character::capsuleID(), CreateNewPod(), RefPtr< X >::get(), IsPlayerItem, m_char, m_pod, and sItemFactory.

Referenced by SelectCharacter().

1038  {
1039  if (!IsPlayerItem(m_char->capsuleID())) {
1040  CreateNewPod();
1041  } else {
1042  m_pod = sItemFactory.GetShip(m_char->capsuleID());
1043  }
1044  if (m_pod.get() == nullptr)
1045  CreateNewPod();
1046 }
CharacterRef m_char
Definition: Client.h:340
#define IsPlayerItem(itemID)
Definition: EVE_Defines.h:256
X * get() const
Definition: RefPtr.h:213
ShipItemRef m_pod
Definition: Client.h:338
#define sItemFactory
Definition: ItemFactory.h:165
uint32 capsuleID() const
Definition: Character.h:342
void CreateNewPod()
Definition: Client.cpp:1303

Here is the call graph for this function:

Here is the caller graph for this function:

void Client::SetScan ( Scan pScan)
inline

Definition at line 303 of file Client.h.

References m_scan.

Referenced by ActiveModule::LaunchProbe().

303 { m_scan = pScan; }
Scan * m_scan
Definition: Client.h:334

Here is the caller graph for this function:

void Client::SetScanTimer ( uint16  time,
bool  useProbe = false 
)
inline

Definition at line 306 of file Client.h.

References m_scanProbe, m_scanTimer, and Timer::Start().

Referenced by Scan::ProcessScan(), and Scan::RequestScans().

306 { m_scanTimer.Start(time); m_scanProbe = useProbe; }
Timer m_scanTimer
Definition: Client.h:383
bool m_scanProbe
Definition: Client.h:366
void Start(uint32 setTimerTime=0, bool changeResetTimer=true)
Definition: timer.cpp:81

Here is the call graph for this function:

Here is the caller graph for this function:

void Client::SetSessionChange ( bool  set = false)
inline

Definition at line 251 of file Client.h.

References m_sessionChangeActive.

251 { m_sessionChangeActive = set; }
bool m_sessionChangeActive
Definition: Client.h:369
void Client::SetSessionTimer ( )
inline

Definition at line 250 of file Client.h.

References m_sessionChangeActive, m_sessionTimer, Player::Timer::Session, and Timer::Start().

Referenced by BoardShip(), Command_sendstate(), Command_syncloc(), Command_syncpos(), Command_update(), DockToStation(), UndockFromStation(), and UpdateNewShip().

bool m_sessionChangeActive
Definition: Client.h:369
Timer m_sessionTimer
Definition: Client.h:391
void Start(uint32 setTimerTime=0, bool changeResetTimer=true)
Definition: timer.cpp:81

Here is the call graph for this function:

Here is the caller graph for this function:

void Client::SetShip ( ShipItemRef  shipRef)

Definition at line 1278 of file Client.cpp.

References InventoryItem::ChangeOwner(), flagPilot, InventoryItem::itemID(), m_char, m_charCreation, m_locationID, m_ship, m_shipId, m_validSession, InventoryItem::Move(), pSession, pShipSE, sDataMgr, Character::SetActiveShip(), ClientSession::SetInt(), ShipSE::SetPilot(), and ShipItem::SetPlayer().

Referenced by Board(), BoardShip(), Eject(), ResetAfterPodded(), ResetAfterPopped(), and SelectCharacter().

1278  {
1279  shipRef->ChangeOwner(m_char->itemID());
1280  if (pShipSE != nullptr)
1281  pShipSE->SetPilot(nullptr);
1282 
1283  // nullify ship pointer, but do NOT delete...most callers need existing ship for system and destiny pointers
1284  pShipSE = nullptr;
1285 
1286  m_ship = shipRef;
1287  m_shipId = shipRef->itemID();
1289  if (sDataMgr.IsSolarSystem(m_locationID)) {
1290  m_char->Move(m_shipId, flagPilot, true);
1291  pSession->SetInt("shipid", m_shipId); // update shipID in session
1292  }
1293 
1295  m_ship->SetPlayer(this);
1296 }
void SetActiveShip(uint32 shipID)
Definition: Character.cpp:1240
CharacterRef m_char
Definition: Client.h:340
uint32 m_shipId
Definition: Client.h:375
bool m_charCreation
Definition: Client.h:441
void Move(uint32 new_location=locTemp, EVEItemFlags flag=flagNone, bool notify=false)
uint32 m_locationID
Definition: Client.h:377
bool m_validSession
Definition: Client.h:440
void ChangeOwner(uint32 new_owner, bool notify=false)
ShipItemRef m_ship
Definition: Client.h:337
virtual void SetPlayer(Client *pClient)
Definition: Ship.cpp:106
virtual void SetPilot(Client *pClient)
Definition: Ship.cpp:2517
ShipSE * pShipSE
Definition: Client.h:343
void SetInt(const char *name, int32 value)
ClientSession * pSession
Definition: Client.h:345
uint32 itemID() const
Definition: InventoryItem.h:98
#define sDataMgr

Here is the call graph for this function:

Here is the caller graph for this function:

void Client::SetShowAll ( bool  set = false)
inline

Definition at line 270 of file Client.h.

References m_showall.

Referenced by Command_showall().

270 { m_showall = set; }
bool m_showall
Definition: Client.h:361

Here is the caller graph for this function:

void Client::SetStateSent ( bool  set = false)
inline

Definition at line 249 of file Client.h.

References m_setStateSent.

Referenced by Command_sendstate(), Command_update(), and DestinyManager::SendSetState().

249 { m_setStateSent = set; }
bool m_setStateSent
Definition: Client.h:368

Here is the caller graph for this function:

void Client::SetStateTimer ( int8  state,
uint32  time = Player::Timer::Default 
)

Definition at line 1599 of file Client.cpp.

References _log, Timer::Disable(), Timer::Enabled(), Timer::GetCurrentTime(), Timer::GetRemainingTime(), GetStateName(), m_char, m_clientState, m_stateTimer, InventoryItem::name(), Timer::Start(), state, and EvE::traceStack().

Referenced by DestinyManager::AttemptDockOperation(), CynoJump(), SelectCharacter(), StargateJump(), and UndockFromStation().

1600 {
1601  if (time == 0) {
1603  _log(CLIENT__TIMER, "%s: State Timer Disabled");
1604  return;
1605  }
1606 
1607  if (m_stateTimer.Enabled()) {
1608  _log(CLIENT__ERROR, "%s: State Timer called but timer already enabled with %ums remaining.", m_char->name(), m_stateTimer.GetRemainingTime());
1609  EvE::traceStack();
1610  return;
1611  }
1612 
1613  _log(CLIENT__TIMER, "%s: Client Timer set from %s to %s at %ums. current state time: %u", m_char->name(), \
1615  m_clientState = state;
1616  m_stateTimer.Start(time);
1617 }
#define _log(type, fmt,...)
Definition: logsys.h:124
void Disable()
Definition: timer.h:39
CharacterRef m_char
Definition: Client.h:340
std::string GetStateName(int8 state)
Definition: Client.cpp:1636
const char * name()
uint32 GetRemainingTime() const
Definition: timer.cpp:114
bool Enabled() const
Definition: timer.h:41
uint32 GetCurrentTime()
Definition: timer.cpp:134
Timer m_stateTimer
Definition: Client.h:381
void traceStack(void)
Definition: misc.cpp:169
entityID heal the character with the entityID note giving you detailed ship status information gives a list of all dynamic entities and players and their destinyState in this bubble shows some current destiny variables save all kick all and halt server immediate command list all items in current location s gives list of cargo contents and volumes in all holds list current session values show current ship DNA show current objects in their destiny state
int8 m_clientState
Definition: Client.h:402
void Start(uint32 setTimerTime=0, bool changeResetTimer=true)
Definition: timer.cpp:81

Here is the call graph for this function:

Here is the caller graph for this function:

void Client::SetTradeSession ( TradeSession ts)
inline

Definition at line 309 of file Client.h.

References m_TS.

Referenced by TradeService::CreateBoundObject().

309 { m_TS = ts; }
TradeSession * m_TS
Definition: Client.h:344

Here is the caller graph for this function:

void Client::SetTrainingEndTime ( int64  endTime)
inline

Definition at line 331 of file Client.h.

References m_skillTimer.

Referenced by Character::GetEndOfTraining(), and Character::UpdateSkillQueueEndTime().

331 { m_skillTimer = endTime; }
int64 m_skillTimer
Definition: Client.h:400

Here is the caller graph for this function:

void Client::SetUncloak ( bool  uncloak = false)
inline

Definition at line 247 of file Client.h.

References m_uncloak.

Referenced by SetUncloakTimer().

247 { m_uncloak = uncloak; }
bool m_uncloak
Definition: Client.h:360

Here is the caller graph for this function:

void Client::SetUncloakTimer ( uint32  time = Player::Timer::Default)

Definition at line 1559 of file Client.cpp.

References _log, Timer::Disable(), Timer::Enabled(), Timer::GetCurrentTime(), Timer::GetRemainingTime(), m_char, m_cloakTimer, m_uncloakTimer, InventoryItem::name(), SetUncloak(), Timer::Start(), and EvE::traceStack().

1560 {
1561  if (time == 0) {
1563  SetUncloak(false);
1564  _log(CLIENT__TIMER, "%s: Uncloak Timer Disabled");
1565  return;
1566  }
1567 
1568  if (m_uncloakTimer.Enabled()) {
1569  _log(CLIENT__ERROR, "%s: Uncloak Timer called but timer already enabled with %ums remaining.", m_char->name(), m_cloakTimer.GetRemainingTime());
1570  EvE::traceStack();
1571  return;
1572  }
1573 
1574  _log(CLIENT__TIMER, "%s: Uncloak Timer set at %ums. current state time is %ums", m_char->name(), time, m_uncloakTimer.GetCurrentTime());
1575  m_uncloakTimer.Start(time);
1576  SetUncloak(true);
1577 }
#define _log(type, fmt,...)
Definition: logsys.h:124
void Disable()
Definition: timer.h:39
CharacterRef m_char
Definition: Client.h:340
const char * name()
uint32 GetRemainingTime() const
Definition: timer.cpp:114
Timer m_uncloakTimer
Definition: Client.h:385
Timer m_cloakTimer
Definition: Client.h:384
bool Enabled() const
Definition: timer.h:41
uint32 GetCurrentTime()
Definition: timer.cpp:134
void SetUncloak(bool uncloak=false)
Definition: Client.h:247
void traceStack(void)
Definition: misc.cpp:169
void Start(uint32 setTimerTime=0, bool changeResetTimer=true)
Definition: timer.cpp:81

Here is the call graph for this function:

void Client::SetUndock ( bool  undock = false)
inline

Definition at line 245 of file Client.h.

References m_undock.

245 { m_undock = undock; }
bool m_undock
Definition: Client.h:357
ShipItemRef Client::SpawnNewRookieShip ( uint32  stationID)
Todo:
create/send mail from scc about lost ship as needed....create char uses this method also

Definition at line 1314 of file Client.cpp.

References _log, Char::Race::Amarr, AttrOnline, Char::Race::Caldari, EvilOne, flagCargoHold, flagHangar, flagHiSlot0, flagHiSlot1, flagNone, Char::Race::Gallente, itemCivilianMiner, InventoryItem::itemID(), InventoryItem::itemName(), itemTypeTrit, locTemp, m_char, Char::Race::Minmatar, InventoryItem::name(), Character::race(), sDataMgr, and sItemFactory.

Referenced by DockToStation(), ResetAfterPodded(), ResetAfterPopped(), and SelectCharacter().

1314  {
1316  //create rookie ship of appropriate type
1317  using namespace Char;
1318  uint16 shipID(0), gunID(0);
1319  switch (m_char->race()) {
1320  case Race::Caldari: {
1321  gunID = Rookie::Weapon::Caldari;
1322  shipID = Rookie::Ship::Caldari;
1323  } break;
1324  case Race::Gallente: {
1325  gunID = Rookie::Weapon::Gallente;
1326  shipID = Rookie::Ship::Gallente;
1327  } break;
1328  case Race::Minmatar: {
1329  gunID = Rookie::Weapon::Minmatar;
1330  shipID = Rookie::Ship::Minmatar;
1331  } break;
1332  case Race::Amarr: {
1333  gunID = Rookie::Weapon::Amarr;
1334  shipID = Rookie::Ship::Amarr;
1335  } break;
1336  default: {
1337  // invalid race
1338  _log(CLIENT__ERROR, "SpawnNewRookieShip() - Invalid Race of %s(%u) for %s(%u)",
1339  sDataMgr.GetRaceName(m_char->race()), m_char->race(), m_char->name(),
1340  m_char->itemID());
1341  return ShipItemRef(nullptr);
1342  }
1343  }
1344 
1345  //create data for new rookie ship
1346  std::string name = m_char->itemName() + "'s Noob Ship";
1347  ItemData sData(shipID, m_char->itemID(), locTemp, flagNone, name.c_str());
1348  //spawn rookie ship
1349  ShipItemRef sRef = sItemFactory.SpawnShip(sData);
1350  if (sRef.get() != nullptr) {
1351  // noob ships come pre-assembled (and "fully fit")
1352  sRef->ChangeSingleton(true);
1353  sRef->Move(stationID, flagHangar);
1354  }
1355  // create and fit noob items in ship
1357  InventoryItemRef mRef = sItemFactory.SpawnItem(mData);
1358  if (mRef.get() != nullptr) {
1359  mRef->ChangeSingleton(true);
1360  mRef->Move(sRef->itemID(), flagHiSlot0);
1361  mRef->SetAttribute(AttrOnline, EvilOne, false);
1362  }
1363  ItemData wData(gunID, m_char->itemID(), locTemp, flagNone);
1364  InventoryItemRef wRef = sItemFactory.SpawnItem(wData);
1365  if (wRef.get() != nullptr) {
1366  wRef->ChangeSingleton(true);
1367  wRef->Move(sRef->itemID(), flagHiSlot1);
1368  wRef->SetAttribute(AttrOnline, EvilOne, false);
1369  }
1370  ItemData cData(itemTypeTrit, m_char->itemID(), locTemp, flagNone, 100);
1371  InventoryItemRef cRef = sItemFactory.SpawnItem(cData);
1372  if (cRef.get() != nullptr)
1373  cRef->Move(sRef->itemID(), flagCargoHold);
1374  // save new ship and items
1375  sRef->SaveShip();
1376 
1377  // in case caller needs ref to new ship
1378  return sRef;
1379 }
#define _log(type, fmt,...)
Definition: logsys.h:124
CharacterRef m_char
Definition: Client.h:340
const char * name()
uint8 race() const
Definition: Character.h:278
RefPtr< ShipItem > ShipItemRef
Definition: ItemRef.h:54
const std::string & itemName() const
#define sItemFactory
Definition: ItemFactory.h:165
EvilNumber EvilOne
Definition: EvilNumber.cpp:34
unsigned __int16 uint16
Definition: eve-compat.h:48
uint32 itemID() const
Definition: InventoryItem.h:98
#define sDataMgr

Here is the call graph for this function:

Here is the caller graph for this function:

void Client::StargateJump ( uint32  fromGate,
uint32  toGate 
)

Definition at line 1410 of file Client.cpp.

References _log, MapDB::AddJump(), SystemEntity::DestinyMgr(), Timer::Enabled(), Player::State::Idle, Player::State::Jump, Player::Timer::Jumping, m_char, m_clientState, m_movePoint, m_moveSystemID, m_stateTimer, m_SystemData, GPoint::MakeRandomPointOnSphereLayer(), InventoryItem::name(), StaticData::position, pShipSE, StaticData::radius, sDataMgr, DestinyManager::SendGateActivity(), DestinyManager::SendJumpOut(), SetStateTimer(), sLog, SystemData::systemID, StaticData::systemID, and Character::VisitSystem().

1410  {
1412  sLog.Error("Client","%s: StargateJump called when a move is already pending. Ignoring.", m_char->name());
1413  // send client msg about state change in progress
1414  return;
1415  }
1416 
1417  // add jump to mapDynamicData for showing in StarMap (F10) -allan 06Mar14
1419 
1420  // call Stop() per packet sniff - shuts off AP. Halt() does also. try not calling any movement updates
1421  //pShipSE->DestinyMgr()->Halt(); // Stop() disables ap. try Halt() to reset ship movement to null
1422  pShipSE->DestinyMgr()->SendJumpOut(fromGate);
1423  // show gate animation in from gate. -working -allan 15Nov15
1424  pShipSE->DestinyMgr()->SendGateActivity(fromGate);
1425 
1426  //m_toGate = toGate;
1427  StaticData toData = StaticData();
1428  if (!sDataMgr.GetStaticInfo(toGate, toData)) {
1429  _log(DATA__ERROR, "Failed to retrieve data for stargate %u", toGate);
1430  // send client msg about new system info failure
1431  return;
1432  }
1433 
1434  // this is where we can put the msgs about system closed or w/e
1435 
1436  // add jump to mapDynamicData for showing in StarMap (F10) -allan 06Mar14
1437  MapDB::AddJump(toData.systemID);
1438  // used for showing Visited Systems in StarMap(F10) -allan 30Jan14
1439  m_char->VisitSystem(toData.systemID);
1440 
1441  m_movePoint = toData.position;
1442  // Make Jump-In point a random spot on ~10km radius sphere about the stargate radius
1443  m_movePoint.MakeRandomPointOnSphereLayer(toData.radius + 6500, toData.radius + 9500);
1444  m_moveSystemID = toData.systemID;
1445 /*
1446  char ci[25];
1447  snprintf(ci, sizeof(ci), "Jumping:%u", toGate);
1448  m_ship->SetCustomInfo(ci);
1449 */
1450  //delay the move 4sec so they can see the JumpOut animation
1452 }
SystemData m_SystemData
Definition: Client.h:336
#define _log(type, fmt,...)
Definition: logsys.h:124
void SendGateActivity(uint32 gateID) const
CharacterRef m_char
Definition: Client.h:340
uint32 m_moveSystemID
Definition: Client.h:378
const char * name()
GPoint m_movePoint
Definition: Client.h:394
#define sLog
Evaluates to a NewLog instance.
Definition: LogNew.h:250
DestinyManager * DestinyMgr()
Definition: SystemEntity.h:198
void VisitSystem(uint32 solarSystemID)
Definition: Character.cpp:1395
bool Enabled() const
Definition: timer.h:41
void SendJumpOut(uint32 gateID) const
void MakeRandomPointOnSphereLayer(double radiusInner, double radiusOuter)
Definition: gpoint.h:59
uint32 systemID
GPoint position
Timer m_stateTimer
Definition: Client.h:381
uint32 systemID
void SetStateTimer(int8 state, uint32 time=Player::Timer::Default)
Definition: Client.cpp:1599
ShipSE * pShipSE
Definition: Client.h:343
static void AddJump(uint32 sysID)
Definition: MapDB.cpp:218
int8 m_clientState
Definition: Client.h:402
#define sDataMgr

Here is the call graph for this function:

void Client::StartJetcanTimer ( )
inline

Definition at line 268 of file Client.h.

References Player::Timer::Jetcan, m_jetcanTimer, and Timer::Start().

Timer m_jetcanTimer
Definition: Client.h:389
void Start(uint32 setTimerTime=0, bool changeResetTimer=true)
Definition: timer.cpp:81

Here is the call graph for this function:

void Client::UndockFromStation ( )
Todo:
this needs a bit of work to match live.... we are really close now. 02Jan19 Undock Request -> GetCriminalTimeStamps -> Undock -> OnItemsChanged (Undocking:xxxxxxxx) -> OnCharNoLongerInStation -> GetAllInfo -> GetNPCStandings -> GetFormations -> AddBalls2 (slim, not ball, wait=true) -> GotoDirection(etc, etc) -> SetState (dmg, ego, ball, slim) ***** 9sec from hitting undock to space view on live. *****

Definition at line 975 of file Client.cpp.

References TradeService::CancelTrade(), StationData::dockOrientation, StationData::dockPosition, PyServiceMgr::LookupService(), m_dockPoint, m_invul, m_movePoint, m_services, m_ship, m_StationData, m_SystemData, m_TS, m_undock, MoveToLocation(), SetInvulTimer(), SetSessionTimer(), SetStateTimer(), ShipItem::SetUndocking(), SystemData::systemID, Player::Timer::Undock, Player::State::Undock, ShipItem::Undock(), and Player::Timer::UndockInvul.

975  {
976  if (m_TS != nullptr) {
977  TradeService* mts = (TradeService*)(m_services.LookupService("trademgr"));
978  mts->CancelTrade(this);
979  }
980 
981  m_invul = true;
982  m_undock = true;
983  //set position and direction of docking ramp for later use
986 
987  m_ship->Undock();
988 
999  SetSessionTimer();
1000 
1001  m_ship->SetUndocking(false);
1002 }
SystemData m_SystemData
Definition: Client.h:336
void MoveToLocation(uint32 location, const GPoint &pt)
Definition: Client.cpp:684
PyService * LookupService(const std::string &name)
bool m_undock
Definition: Client.h:357
void CancelTrade(Client *pClient)
GPoint m_dockPoint
Definition: Client.h:395
GPoint m_movePoint
Definition: Client.h:394
PyServiceMgr & m_services
Definition: Client.h:341
void SetUndocking(bool set=false)
Definition: Ship.h:151
ShipItemRef m_ship
Definition: Client.h:337
uint32 systemID
void SetInvulTimer(uint32 time=Player::Timer::Default)
Definition: Client.cpp:1579
GPoint dockPosition
void Undock()
Definition: Ship.cpp:370
void SetStateTimer(int8 state, uint32 time=Player::Timer::Default)
Definition: Client.cpp:1599
StationData m_StationData
Definition: Client.h:339
GVector dockOrientation
TradeSession * m_TS
Definition: Client.h:344
void SetSessionTimer()
Definition: Client.h:250
bool m_invul
Definition: Client.h:355

Here is the call graph for this function:

void Client::UpdateCorpSession ( CorpData data)

Definition at line 1970 of file Client.cpp.

References CorpData::allianceID, CorpData::baseID, CorpData::corpAccountKey, CorpData::corpHQ, CorpData::corporationID, CorpData::corpRole, pSession, CorpData::rolesAtAll, CorpData::rolesAtBase, CorpData::rolesAtHQ, CorpData::rolesAtOther, SendSessionChange(), ClientSession::SetInt(), ClientSession::SetLong(), and CorpData::warFactionID.

Referenced by Character::JoinCorporation(), Character::SetAccountKey(), Character::SetBaseID(), and Character::UpdateCorpData().

1971 {
1972  // session.Set* methods only update on change
1973  pSession->SetInt("corpid", data.corporationID);
1974  pSession->SetInt("baseID", data.baseID);
1975  pSession->SetInt("hqID", data.corpHQ);
1976 
1977  //Only set allianceID if it is not 0
1978  if (data.allianceID != 0){
1979  pSession->SetInt("allianceid", data.allianceID);
1980  }
1981 
1982  pSession->SetInt("warfactionid", data.warFactionID);
1983  pSession->SetInt("corpAccountKey", data.corpAccountKey);
1984  pSession->SetLong("corprole", data.corpRole);
1985  pSession->SetLong("rolesAtAll", data.rolesAtAll);
1986  pSession->SetLong("rolesAtBase", data.rolesAtBase);
1987  pSession->SetLong("rolesAtHQ", data.rolesAtHQ);
1988  pSession->SetLong("rolesAtOther", data.rolesAtOther);
1990 }
uint32 corpHQ
void SetLong(const char *name, int64 value)
int64 rolesAtHQ
int64 rolesAtBase
void SendSessionChange()
Definition: Client.cpp:2048
int64 rolesAtOther
int64 rolesAtAll
int32 allianceID
int64 corpRole
uint32 baseID
uint32 corporationID
int16 corpAccountKey
int32 warFactionID
void SetInt(const char *name, int32 value)
ClientSession * pSession
Definition: Client.h:345

Here is the call graph for this function:

Here is the caller graph for this function:

void Client::UpdateFleetSession ( CharFleetData fleet)

Definition at line 1992 of file Client.cpp.

References CharFleetData::booster, CharFleetData::fleetID, CharFleetData::job, m_fleet, m_squad, m_wing, pSession, CharFleetData::role, SendSessionChange(), ClientSession::SetInt(), CharFleetData::squadID, and CharFleetData::wingID.

Referenced by Character::SetFleetData().

1993 {
1994  m_fleet = fleet.fleetID;
1995  m_wing = fleet.wingID;
1996  m_squad = fleet.squadID;
1997 
1998  pSession->SetInt("fleetjob", fleet.job);
1999  pSession->SetInt("fleetrole", fleet.role);
2000  pSession->SetInt("fleetbooster", fleet.booster);
2001  pSession->SetInt("fleetid", m_fleet);
2002  pSession->SetInt("wingid", m_wing);
2003  pSession->SetInt("squadid", m_squad);
2005 }
int32 m_wing
Definition: Client.h:371
void SendSessionChange()
Definition: Client.cpp:2048
int32 m_squad
Definition: Client.h:372
void SetInt(const char *name, int32 value)
ClientSession * pSession
Definition: Client.h:345
uint32 m_fleet
Definition: Client.h:374

Here is the call graph for this function:

Here is the caller graph for this function:

void Client::UpdateNewShip ( )
private

Definition at line 1025 of file Client.cpp.

References SystemEntity::DestinyMgr(), GetName(), InventoryItem::itemID(), m_char, m_ship, pShipSE, InventoryItem::SetCustomInfo(), ShipSE::SetPilot(), SetSessionTimer(), sItemFactory, snprintf, and DestinyManager::UpdateNewShip().

Referenced by Board(), Eject(), MoveToPosition(), ResetAfterPopped(), and SetDestiny().

1026 {
1027  sItemFactory.SetUsingClient(this);
1028  pShipSE->SetPilot(this);
1030  sItemFactory.UnsetUsingClient();
1031 
1032  char ci[45];
1033  snprintf(ci, sizeof(ci), "InSpace: %s(%u)", GetName(), m_char->itemID());
1034  m_ship->SetCustomInfo(ci);
1035  SetSessionTimer();
1036 }
CharacterRef m_char
Definition: Client.h:340
DestinyManager * DestinyMgr()
Definition: SystemEntity.h:198
#define snprintf
Definition: eve-compat.h:184
const char * GetName() const
Definition: Client.h:94
void UpdateNewShip(const ShipItemRef newShipRef)
ShipItemRef m_ship
Definition: Client.h:337
void SetCustomInfo(const char *ci)
virtual void SetPilot(Client *pClient)
Definition: Ship.cpp:2517
ShipSE * pShipSE
Definition: Client.h:343
#define sItemFactory
Definition: ItemFactory.h:165
void SetSessionTimer()
Definition: Client.h:250
uint32 itemID() const
Definition: InventoryItem.h:98

Here is the call graph for this function:

Here is the caller graph for this function:

void Client::UpdateSession ( )
protected

Definition at line 1935 of file Client.cpp.

References ClientSession::Clear(), Character::constellationID(), RefPtr< X >::get(), m_char, m_shipId, pSession, Character::regionID(), sDataMgr, ClientSession::SetInt(), Character::solarSystemID(), and Character::stationID().

Referenced by MoveToLocation(), and ResetAfterPodded().

1936 {
1937  if (m_char.get() == nullptr)
1938  return;
1939  uint32 stationID = m_char->stationID();
1940  uint32 solarsystemID = m_char->solarSystemID();
1941  if (sDataMgr.IsStation(stationID)) {
1942  pSession->Clear("solarsystemid"); //must be 0 in station
1943  pSession->Clear("shipid"); //must be 0 in station
1944  //pSession->Clear("worldspaceid"); //not used here (yet)
1945 
1946  pSession->SetInt("stationid", stationID);
1947  pSession->SetInt("stationid2", stationID); // client uses this for continer location checks
1948  pSession->SetInt("worldspaceid", stationID);
1949  pSession->SetInt("locationid", stationID);
1950  } else {
1951  pSession->Clear("stationid");
1952  pSession->Clear("stationid2");
1953  pSession->Clear("worldspaceid");
1954  pSession->SetInt("solarsystemid", solarsystemID); // used to tell client they are in space
1955  pSession->SetInt("locationid", solarsystemID);
1956  pSession->SetInt("shipid", m_shipId);
1957  }
1958 
1959  // solarsystemid2 is used by client to determine current system. NOTE: *MUST* be set to current system.
1960  pSession->SetInt("solarsystemid2", solarsystemID);
1961  pSession->SetInt("constellationid", m_char->constellationID());
1962  pSession->SetInt("regionid", m_char->regionID());
1963 }
CharacterRef m_char
Definition: Client.h:340
uint32 m_shipId
Definition: Client.h:375
uint32 solarSystemID() const
Definition: Character.h:327
void Clear(const char *name)
uint32 constellationID() const
Definition: Character.h:328
uint32 regionID() const
Definition: Character.h:329
uint32 stationID() const
Definition: Character.h:326
X * get() const
Definition: RefPtr.h:213
unsigned __int32 uint32
Definition: eve-compat.h:50
void SetInt(const char *name, int32 value)
ClientSession * pSession
Definition: Client.h:345
#define sDataMgr

Here is the call graph for this function:

Here is the caller graph for this function:

void Client::UpdateSessionInt ( const char *  sessionType,
int  value 
)

Definition at line 1965 of file Client.cpp.

References pSession, and ClientSession::SetInt().

1966 {
1967  pSession->SetInt(id, value);
1968 }
void SetInt(const char *name, int32 value)
ClientSession * pSession
Definition: Client.h:345

Here is the call graph for this function:

void Client::WarpIn ( )

Definition at line 628 of file Client.cpp.

References flagNone, GetName(), InPod(), InventoryItem::itemID(), m_char, m_ship, InventoryItem::SetCustomInfo(), InventoryItem::SetFlag(), sLog, and snprintf.

Referenced by SelectCharacter().

628  {
629  sLog.Blue("Client::WarpIn()", "%s(%u) called WarpIn(). Finish code here.", GetName(), m_char->itemID());
630  char ci[45];
631  snprintf(ci, sizeof(ci), "InSpace: %s(%u)", GetName(), m_char->itemID());
632  m_ship->SetCustomInfo(ci);
633  if (!InPod())
635  return;
636  /*
637  // We are just logging in, so we need to warp to our last position from our WarpOut spot.
638  // when implemented, make sure we move the ship item, if needed....check this
639  GPoint warpToPoint(m_ship->position());
640  GPoint warpFromPoint(m_ship->position());
641  warpFromPoint.MakeRandomPointOnSphere(0.5*ONE_AU_IN_METERS);
642  pShipSE->DestinyMgr()->SetPosition(warpFromPoint);
643  pShipSE->DestinyMgr()->WarpTo(warpToPoint); // Warp ship from the random login point to the position saved on last disconnect
644  */
645 }
CharacterRef m_char
Definition: Client.h:340
bool SetFlag(EVEItemFlags flag, bool notify=false)
#define sLog
Evaluates to a NewLog instance.
Definition: LogNew.h:250
bool InPod()
Definition: Client.h:227
#define snprintf
Definition: eve-compat.h:184
const char * GetName() const
Definition: Client.h:94
ShipItemRef m_ship
Definition: Client.h:337
void SetCustomInfo(const char *ci)
uint32 itemID() const
Definition: InventoryItem.h:98

Here is the call graph for this function:

Here is the caller graph for this function:

void Client::WarpOut ( )

Definition at line 647 of file Client.cpp.

References DestroyShipSE(), flagShipOffline, GetName(), InPod(), InventoryItem::itemID(), m_char, m_ship, InventoryItem::position(), pShipSE, InventoryItem::SetCustomInfo(), InventoryItem::SetFlag(), SystemEntity::SetPosition(), sLog, and snprintf.

Referenced by ~Client().

647  {
648  sLog.Blue("Client::WarpOut()", "Client Destructor for %s(%u) called WarpOut(). Finish code here.", GetName(), m_char->itemID());
649  char ci[45];
650  snprintf(ci, sizeof(ci), "Logout: %s(%u)", GetName(), m_char->itemID());
651  m_ship->SetCustomInfo(ci);
652  if (!InPod())
655  DestroyShipSE();
656  return;
657  /*
658  SetInvulTimer(Player::Timer::WarpOutInvul);
659  // We are logging out, so we need to warp to a random spot 1Mm away:
660  GPoint warpToPoint(m_ship->position());
661  warpToPoint.MakeRandomPointOnSphere(0.5*ONE_AU_IN_METERS);
662  if (sConsole.IsShutdown()) // if server is being shutdown, set ship to WarpOut point, as if they warped there.
663  pShipSE->SetPosition(warpToPoint);
664  else
665  pShipSE->DestinyMgr()->WarpTo(warpToPoint);
666  */
667 }
void SetPosition(const GPoint &pos)
Definition: SystemEntity.h:212
CharacterRef m_char
Definition: Client.h:340
bool SetFlag(EVEItemFlags flag, bool notify=false)
const GPoint & position() const
#define sLog
Evaluates to a NewLog instance.
Definition: LogNew.h:250
bool InPod()
Definition: Client.h:227
#define snprintf
Definition: eve-compat.h:184
const char * GetName() const
Definition: Client.h:94
ShipItemRef m_ship
Definition: Client.h:337
void SetCustomInfo(const char *ci)
ShipSE * pShipSE
Definition: Client.h:343
void DestroyShipSE()
Definition: Client.cpp:1014
uint32 itemID() const
Definition: InventoryItem.h:98

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

bool Client::m_afk
protected

Definition at line 354 of file Client.h.

Referenced by Client(), IsAFK(), and SetAFK().

bool Client::m_autoPilot
protected
bool Client::m_autoStop
protected

Definition at line 362 of file Client.h.

Referenced by AutoStop(), Client(), and SetAutoStop().

Timer Client::m_ballparkTimer
protected

Definition at line 392 of file Client.h.

Referenced by CheckBallparkTimer(), ProcessClient(), SetBallPark(), and SetBallParkTimer().

bool Client::m_beyonce
protected
std::set<uint32> Client::m_bindSet
private

Definition at line 443 of file Client.h.

Referenced by AddBindID(), Handle_Notify(), and ~Client().

bool Client::m_canThrow
private

Definition at line 439 of file Client.h.

Referenced by CanThrow(), Client(), Eject(), and Handle_CallReq().

std::set<LSCChannel*> Client::m_channels
protected

Definition at line 397 of file Client.h.

Referenced by ChannelJoined(), ChannelLeft(), Client(), SelfChatMessage(), and ~Client().

bool Client::m_charCreation
private

Definition at line 441 of file Client.h.

Referenced by Client(), CreateChar(), IsCharCreation(), ProcessClient(), and SetShip().

Timer Client::m_clientTimer
protected

Definition at line 388 of file Client.h.

Timer Client::m_cloakTimer
protected

Definition at line 384 of file Client.h.

Referenced by ProcessClient(), SetBallPark(), SetCloakTimer(), and SetUncloakTimer().

PyList* Client::m_destinyEventQueue
private

Definition at line 460 of file Client.h.

Referenced by _SendQueuedUpdates(), FlushQueue(), QueueDestinyEvent(), and ~Client().

PyList* Client::m_destinyUpdateQueue
private

Definition at line 461 of file Client.h.

Referenced by _SendQueuedUpdates(), FlushQueue(), QueueDestinyUpdate(), and ~Client().

GPoint Client::m_dockPoint
protected

Definition at line 395 of file Client.h.

Referenced by GetDockPoint(), SetDockPoint(), and UndockFromStation().

uint32 Client::m_dockStationID
protected

Definition at line 379 of file Client.h.

Referenced by Client(), DockToStation(), GetDockStationID(), and SetDockStationID().

uint32 Client::m_fleet
protected
Timer Client::m_fleetTimer
protected

Definition at line 387 of file Client.h.

Referenced by MoveToLocation(), and ProcessClient().

std::map<uint32, bool> Client::m_hangarLoaded
protected

Definition at line 398 of file Client.h.

Referenced by AddStationHangar(), Client(), IsHangarLoaded(), and RemoveStationHangar().

bool Client::m_invul
protected
Timer Client::m_invulTimer
protected

Definition at line 386 of file Client.h.

Referenced by ProcessClient(), and SetInvulTimer().

Timer Client::m_jetcanTimer
protected

Definition at line 389 of file Client.h.

Referenced by IsJetcanAvalible(), JetcanTime(), and StartJetcanTimer().

bool Client::m_loaded
protected

Definition at line 358 of file Client.h.

Referenced by ChannelLeft(), Client(), IsLoaded(), SelectCharacter(), and ~Client().

bool Client::m_login
protected
Timer Client::m_logoutTimer
protected

Definition at line 390 of file Client.h.

std::map<uint32, uint32> Client::m_lpMap
private

Definition at line 466 of file Client.h.

Referenced by Client(), and GetLoyaltyPoints().

GPoint Client::m_movePoint
protected
uint32 Client::m_moveSystemID
protected

Definition at line 378 of file Client.h.

Referenced by Client(), CynoJump(), ExecuteDriveJump(), ExecuteJump(), and StargateJump().

uint32 Client::m_nextNotifySequence
private

Definition at line 464 of file Client.h.

Referenced by SendNotification().

bool Client::m_packaged
protected

Definition at line 363 of file Client.h.

Referenced by _SendQueuedUpdates(), Client(), and QueueDestinyUpdate().

Timer Client::m_pingTimer
protected

Definition at line 382 of file Client.h.

Referenced by ProcessClient().

bool Client::m_portrait
protected

Definition at line 364 of file Client.h.

Referenced by Client(), RecPic(), and SetPicRec().

Scan* Client::m_scan
protected

Definition at line 334 of file Client.h.

Referenced by ProcessClient(), scan(), SetScan(), and ~Client().

bool Client::m_scanProbe
protected

Definition at line 366 of file Client.h.

Referenced by ProcessClient(), and SetScanTimer().

Timer Client::m_scanTimer
protected

Definition at line 383 of file Client.h.

Referenced by ProcessClient(), and SetScanTimer().

ServiceDB Client::m_sDB
protected

Definition at line 335 of file Client.h.

bool Client::m_sessionChangeActive
protected

Definition at line 369 of file Client.h.

Referenced by Client(), IsSessionChange(), ProcessClient(), SetSessionChange(), and SetSessionTimer().

Timer Client::m_sessionTimer
protected

Definition at line 391 of file Client.h.

Referenced by GetSessionChangeTime(), ProcessClient(), and SetSessionTimer().

bool Client::m_setStateSent
protected
SystemGPoint Client::m_SGP
protected

Definition at line 342 of file Client.h.

Referenced by SetDestiny().

uint32 Client::m_shipId
protected
bool Client::m_showall
protected

Definition at line 361 of file Client.h.

Referenced by Client(), IsShowall(), and SetShowAll().

int64 Client::m_skillTimer
protected

Definition at line 400 of file Client.h.

Referenced by Client(), ProcessClient(), and SetTrainingEndTime().

int32 Client::m_squad
protected

Definition at line 372 of file Client.h.

Referenced by Client(), GetSquadID(), MoveToLocation(), ProcessClient(), and UpdateFleetSession().

Timer Client::m_stateTimer
protected

Definition at line 381 of file Client.h.

Referenced by CynoJump(), ProcessClient(), SetStateTimer(), and StargateJump().

StationData Client::m_StationData
protected

Definition at line 339 of file Client.h.

Referenced by CharNoLongerInStation(), Client(), MoveToLocation(), and UndockFromStation().

TradeSession* Client::m_TS
protected
bool Client::m_uncloak
protected

Definition at line 360 of file Client.h.

Referenced by Client(), IsUncloak(), ProcessClient(), and SetUncloak().

Timer Client::m_uncloakTimer
protected

Definition at line 385 of file Client.h.

Referenced by ProcessClient(), and SetUncloakTimer().

bool Client::m_undock
protected
bool Client::m_validSession
private

Definition at line 440 of file Client.h.

Referenced by Client(), InitSession(), IsValidSession(), SelectCharacter(), and SetShip().

int32 Client::m_wing
protected

Definition at line 371 of file Client.h.

Referenced by Client(), GetWingID(), MoveToLocation(), ProcessClient(), and UpdateFleetSession().


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