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

#include "Character.h"

Inheritance diagram for Character:
Collaboration diagram for Character:

Public Member Functions

virtual void Delete ()
 
bool AlterBalance (float amount, uint8 type)
 
void SetLocation (uint32 stationID, SystemData &data)
 
void JoinCorporation (const CorpData &data)
 
void SetDescription (const char *newDescription)
 
void SetAccountKey (int32 accountKey)
 
void SetBaseID (uint32 baseID)
 
void SetFleetData (CharFleetData &fleet)
 
uint32 PickAlternateShip (uint32 locationID)
 
void SetClient (Client *pClient)
 
ClientGetClient ()
 
void AddItem (InventoryItemRef item)
 
bool HasSkill (uint16 skillTypeID) const
 
bool HasSkillTrainedToLevel (uint16 skillTypeID, uint8 skillLevel) const
 
SkillRef GetSkill (uint16 skillTypeID) const
 
int8 GetSkillLevel (uint16 skillTypeID, bool zeroForNotInjected=true) const
 
PyRepGetRAMSkills ()
 
SkillGetSkillInTraining () const
 
void GetSkillsList (std::vector< InventoryItemRef > &skills) const
 
void VerifySP ()
 
uint32 GetTotalSPTrained ()
 
uint8 GetSPPerMin (Skill *skill)
 
int64 GetEndOfTraining ()
 
uint8 InjectSkillIntoBrain (SkillRef skill)
 
void AddToSkillQueue (uint16 typeID, uint8 level)
 
void ClearSkillQueue (bool update=false)
 
void PauseSkillQueue ()
 
void CancelSkillInTraining (bool update=false)
 
void LoadPausedSkillQueue (uint16 typeID)
 
void SkillQueueLoop (bool update=true)
 
void UpdateSkillQueue ()
 
void UpdateSkillQueueEndTime ()
 
void RemoveFromQueue (SkillRef sRef)
 
void ClearSkillFlags ()
 
PyRepGetSkillHistory ()
 
uint32 GetTotalSP ()
 
void GrantCertificate (uint32 certificateID)
 
void UpdateCertificate (uint32 certificateID, bool pub)
 
bool HasCertificate (uint32 certificateID) const
 
void GetCertificates (CertMap &crt)
 
PyDictGetCharInfo ()
 
PyObjectGetDescription () const
 
PyTupleSendSkillQueue ()
 
const CharacterTypetype () const
 
uint32 bloodlineID () const
 
uint8 race () const
 
uint32 accountID () const
 
const std::string & title () const
 
const std::string & description () const
 
bool gender () const
 
float bounty () const
 
float balance (uint8 type)
 
float GetSecurityRating () const
 
uint32 loginTime () const
 
uint32 logonMinutes () const
 
uint16 OnlineTime ()
 
void secStatusChange (float amount)
 
void UpdateCorpData (CorpData &data)
 
CorpData GetCorpData ()
 
std::string corpTicker () const
 
uint32 corporationID () const
 
uint32 corporationHQ () const
 
int32 allianceID () const
 
int32 warFactionID () const
 
int32 corpAccountKey () const
 
float corpTaxRate () const
 
float corpSecRating () const
 
void SetCorpHQ (uint32 stationID)
 
int64 corpRole () const
 
int64 rolesAtAll () const
 
int64 rolesAtBase () const
 
int64 rolesAtHQ () const
 
int64 rolesAtOther () const
 
int64 fleetJoinTime ()
 
int32 fleetID () const
 
int32 wingID () const
 
int32 squadID () const
 
int8 fleetRole () const
 
int8 fleetBooster () const
 
int8 fleetJob () const
 
uint32 stationID () const
 
uint32 solarSystemID () const
 
uint32 constellationID () const
 
uint32 regionID () const
 
uint32 ancestryID () const
 
uint32 careerID () const
 
uint32 schoolID () const
 
uint32 careerSpecialityID () const
 
int64 startDateTime () const
 
int64 createDateTime () const
 
uint32 shipID () const
 
uint32 capsuleID () const
 
void SetActiveShip (uint32 shipID)
 
void SetActivePod (uint32 podID)
 
void ResetClone ()
 
void PayBounty (CharacterRef cRef)
 
void LogKill (CharKillData data)
 
void LogOut ()
 
void SaveBookMarks ()
 
void SaveCharacter ()
 
void SaveFullCharacter ()
 
void SaveSkillQueue ()
 
void SaveCertificates ()
 
void SaveSkillHistory (uint16 eventID, double logDate, uint32 characterID, uint16 skillTypeID, uint8 skillLevel, uint32 absolutePoints)
 
void SetLoaded (bool set=false)
 
void SetLoginTime ()
 
void SetLogonMinutes ()
 
float GetStandingModified (uint32 fromID, uint32 toID=0)
 
float GetNPCCorpStanding (uint32 fromID, uint32 toID=0)
 
void SetStanding (uint32 fromID, uint32 toID, float standing)
 
void FleetShareMissionRewards ()
 
void FleetShareMissionStandings (float newStanding)
 
void VisitSystem (uint32 solarSystemID)
 
void ProcessEffects (ShipItem *pShip)
 
void ResetModifiers ()
 
virtual bool _Load ()
 
- Public Member Functions inherited from InventoryItem
 InventoryItem (uint32 _itemID, const ItemType &_type, const ItemData &_data)
 
 InventoryItem (const InventoryItem &oth)
 
 InventoryItem (InventoryItem &&oth) noexcept
 
InventoryItemoperator= (const InventoryItem &oth)=delete
 
InventoryItemoperator= (InventoryItem &&oth)=delete
 
virtual ~InventoryItem () noexcept
 
virtual ShipItemGetShipItem ()
 
virtual ModuleItemGetModuleItem ()
 
virtual bool IsShipItem ()
 
virtual bool IsModuleItem ()
 
virtual void Rename (std::string name)
 
InventoryGetMyInventory ()
 
bool contraband () const
 
bool isSingleton () const
 
int32 quantity () const
 
uint32 itemID () const
 
uint32 ownerID () const
 
uint32 locationID () const
 
EVEItemFlags flag () const
 
const GPointposition () const
 
const ItemTypetype () const
 
const std::string & itemName () const
 
const std::string & customInfo () const
 
const char * name ()
 
uint16 typeID () const
 
uint16 groupID () const
 
double radius () const
 
uint8 categoryID () const
 
bool isGlobal () const
 
bool IsOnline ()
 
void SetPosition (const GPoint &pos)
 
void SetCustomInfo (const char *ci)
 
void ChangeOwner (uint32 new_owner, bool notify=false)
 
void Move (uint32 new_location=locTemp, EVEItemFlags flag=flagNone, bool notify=false)
 
void Donate (uint32 new_owner=ownerSystem, uint32 new_location=locTemp, EVEItemFlags new_flag=flagNone, bool notify=true)
 
void SendItemChange (uint32 toID, std::map< int32, PyRep * > &changes)
 
void MergeTypesInCargo (ShipItem *pShip, EVEItemFlags flag=flagNone)
 
bool ChangeSingleton (bool singleton, bool notify=false)
 
bool AlterQuantity (int32 qty, bool notify=false)
 
bool SetQuantity (int32 qty, bool notify=false, bool deleteOnZero=true)
 
bool SetFlag (EVEItemFlags flag, bool notify=false)
 
void SetOwner (uint32 ownerID)
 
void SaveItem ()
 
void UpdateLocation ()
 
void UpdateLocation (uint32 locID)
 
virtual InventoryItemRef Split (int32 qty=0, bool notify=true, bool silent=false)
 
virtual bool Merge (InventoryItemRef to_merge, int32 qty=0, bool notify=true)
 
virtual void Relocate (uint32 locID=0, EVEItemFlags flag=flagNone)
 
virtual void RemoveItem (InventoryItemRef iRef)
 
double GetPackagedVolume ()
 
virtual void SetPlayer (Client *pClient)
 
virtual bool HasPilot ()
 
virtual ClientGetPilot ()
 
void ToVirtual (uint32 locationID)
 
PyRepGetItem () const
 
void GetItemRow (PyPackedRow *into) const
 
void GetItemStatusRow (PyPackedRow *into) const
 
void GetChargeStatusRow (uint32 shipID, PyPackedRow *into) const
 
bool Populate (Rsp_CommonGetInfo_Entry &into)
 
PyListGetItemInfo () const
 
PyObjectItemGetInfo ()
 
PyPackedRowGetItemRow () const
 
PyPackedRowGetItemStatusRow () const
 
PyPackedRowGetChargeStatusRow (uint32 shipID) const
 
bool SkillCheck (InventoryItemRef refItem)
 
void ClearModifiers ()
 
void AddModifier (fxData &data)
 
void RemoveModifier (fxData &data)
 
void ResetAttributes ()
 
bool HasReqSkill (const uint16 skillID)
 
AttributeMapGetAttributeMap ()
 
int64 GetTimeStamp ()
 
void SetAttribute (uint16 attrID, int num, bool notify=true)
 
void SetAttribute (uint16 attrID, uint32 num, bool notify=true)
 
void SetAttribute (uint16 attrID, int64 num, bool notify=true)
 
void SetAttribute (uint16 attrID, float num, bool notify=true)
 
void SetAttribute (uint16 attrID, double num, bool notify=true)
 
void SetAttribute (uint16 attrID, EvilNumber num, bool notify=true)
 
void MultiplyAttribute (uint16 attrID, EvilNumber num, bool notify=false)
 
bool HasAttribute (const uint16 attrID) const
 
bool HasAttribute (const uint16 attrID, EvilNumber &value) const
 
bool SaveAttributes ()
 
void ResetAttribute (uint16 attrID, bool notify=false)
 
void DeleteAttribute (uint16 attrID)
 
EvilNumber GetAttribute (const uint16 attrID) const
 
EvilNumber GetDefaultAttribute (const uint16 attrID) const
 
- Public Member Functions inherited from RefObject
 RefObject (size_t initRefCount)
 Initializes reference count. More...
 
virtual ~RefObject ()
 Destructor; must be virtual. More...
 
size_t GetCount ()
 

Static Public Member Functions

static CharacterRef Load (uint32 characterID)
 
static CharacterRef Spawn (CharacterData &charData, CorpData &corpData)
 
- Static Public Member Functions inherited from InventoryItem
static uint32 CreateItemID (ItemData &data)
 
static uint32 CreateTempItemID (ItemData &data)
 
static InventoryItemRef Load (uint32 itemID)
 
static InventoryItemRef SpawnItem (uint32 itemID, const ItemData &data)
 
static InventoryItemRef Spawn (ItemData &data)
 
static InventoryItemRef SpawnTemp (ItemData &data)
 

Protected Member Functions

 Character (uint32 _characterID, const CharacterType &_charType, const ItemData &_data, const CharacterData &_charData, const CorpData &_corpData)
 
virtual ~Character ()
 
void LoadBookmarks ()
 
- Protected Member Functions inherited from RefObject
void IncRef () const
 Increments reference count of object by one. More...
 
void DecRef () const
 Decrements reference count of object by one. More...
 

Static Protected Member Functions

template<class _Ty >
static RefPtr< _Ty > _LoadItem (uint32 charID, const ItemType &type, const ItemData &data)
 
- Static Protected Member Functions inherited from InventoryItem
template<class _Ty >
static RefPtr< _Ty > Load (uint32 itemID)
 
template<class _Ty >
static RefPtr< _Ty > _Load (uint32 itemID)
 
template<class _Ty >
static RefPtr< _Ty > _LoadItem (uint32 itemID, const ItemType &type, const ItemData &data)
 

Private Attributes

CertificateMgrDB m_cdb
 
CharacterDB m_db
 
StandingDB s_db
 
Clientm_pClient
 
CorpData m_corpData
 
CharacterData m_charData
 
CharFleetData m_fleetData
 
Skillm_inTraining
 
SkillQueue m_skillQueue
 
uint32 m_freePoints
 
CertMap m_certificates
 
bool m_loaded:1
 
uint32 m_loginTime
 
std::map< uint8, InventoryItemRefm_implantMap
 

Friends

class InventoryItem
 

Additional Inherited Members

- Public Attributes inherited from InventoryItem
std::multimap< int8, fxDatam_modifiers
 
- Protected Attributes inherited from InventoryItem
InventorypInventory
 
uint32 m_itemID
 
AttributeMappAttributeMap
 
- Protected Attributes inherited from RefObject
size_t mRefCount
 Reference count of instance. More...
 
bool mDeleted
 

Detailed Description

Class representing character.

Definition at line 211 of file Character.h.

Constructor & Destructor Documentation

Character::Character ( uint32  _characterID,
const CharacterType _charType,
const ItemData _data,
const CharacterData _charData,
const CorpData _corpData 
)
protected

Definition at line 230 of file Character.cpp.

References IsAgent, InventoryItem::isSingleton(), InventoryItem::m_itemID, m_loginTime, InventoryItem::pInventory, and sEntityList.

Referenced by _LoadItem().

238 : InventoryItem(_characterID, _charType, _data),
239  m_charData(_charData),
240  m_corpData(_corpData),
241  m_pClient(nullptr),
242  m_inTraining(nullptr),
243  m_loaded(false),
245  m_freePoints(0),
246  m_loginTime(0)
247 {
248  // enforce characters to be singletons
249  assert(isSingleton());
250 
251  if (!IsAgent(m_itemID)) {
252  m_loginTime = sEntityList.GetStamp();
254  }
255 }
CorpData m_corpData
Definition: Character.h:439
#define IsAgent(itemID)
Definition: EVE_Defines.h:247
#define sEntityList
Definition: EntityList.h:208
uint32 m_freePoints
Definition: Character.h:446
bool isSingleton() const
Definition: InventoryItem.h:96
CharacterData m_charData
Definition: Character.h:440
bool m_loaded
Definition: Character.h:450
Inventory * pInventory
CharFleetData m_fleetData
Definition: Character.h:441
Client * m_pClient
Definition: Character.h:437
RefPtr< InventoryItem > InventoryItemRef
Definition: ItemRef.h:52
Skill * m_inTraining
Definition: Character.h:444
friend class InventoryItem
Definition: Character.h:214
uint32 m_loginTime
Definition: Character.h:452

Here is the call graph for this function:

Here is the caller graph for this function:

Character::~Character ( )
protectedvirtual

Definition at line 257 of file Character.cpp.

References InventoryItem::pInventory, SafeDelete(), SaveBookMarks(), SaveCertificates(), and SaveFullCharacter().

258 {
259  SaveBookMarks();
263 }
void SafeDelete(T *&p)
Deletes and nullifies a pointer.
Definition: SafeMem.h:83
void SaveFullCharacter()
Definition: Character.cpp:1266
Inventory * pInventory
void SaveCertificates()
Definition: Character.cpp:1341
void SaveBookMarks()
Definition: Character.cpp:1353

Here is the call graph for this function:

Member Function Documentation

bool Character::_Load ( )
virtual

Reimplemented from InventoryItem.

Definition at line 269 of file Character.cpp.

References InventoryItem::_Load(), ClearSkillFlags(), flagSkillInTraining, RefPtr< X >::get(), GetFileTimeNow(), GetSkill(), IsAgent, LoadBookmarks(), CertificateMgrDB::LoadCertificates(), Inventory::LoadContents(), CharacterDB::LoadSkillQueue(), CharacterData::loginTime, m_cdb, m_certificates, m_charData, m_db, m_inTraining, InventoryItem::m_itemID, m_loaded, m_skillQueue, InventoryItem::pInventory, and sLog.

269  {
270  if (m_loaded)
271  return true;
272  if (IsAgent(m_itemID))
273  return true;
274 
275  if (!pInventory->LoadContents()) {
276  sLog.Error("Character::_Load","LoadContents returned false for char %u", m_itemID);
277  return (m_loaded = false);
278  }
280  sLog.Error("Character::_Load","LoadSkillQueue returned false for char %u", m_itemID);
281  return (m_loaded = false);
282  }
283  if (!m_skillQueue.empty()) {
284  SkillRef sRef = GetSkill(m_skillQueue.front().typeID);
285  if (sRef.get() != nullptr) {
286  sRef->SetFlag(flagSkillInTraining, false);
287  m_inTraining = sRef.get();
288  }
289  } else {
290  ClearSkillFlags();
291  }
292 
294 
295  if (m_loaded) {
296  m_certificates.clear();
298  sLog.Warning("Character::_Load","LoadCertificates returned false for char %u", m_itemID);
299  return (m_loaded = false);
300  }
301  }
302 
303  // load char personal bookmarks and folders ... corp shit will be done ???
304  LoadBookmarks();
305 
307 
308  return m_loaded;
309 }
CharacterDB m_db
Definition: Character.h:434
bool LoadSkillQueue(uint32 charID, SkillQueue &into)
SkillRef GetSkill(uint16 skillTypeID) const
Definition: Character.cpp:566
bool LoadCertificates(uint32 characterID, CertMap &into)
void ClearSkillFlags()
Definition: Character.cpp:551
#define IsAgent(itemID)
Definition: EVE_Defines.h:247
SkillQueue m_skillQueue
Definition: Character.h:445
virtual bool _Load()
#define sLog
Evaluates to a NewLog instance.
Definition: LogNew.h:250
CharacterData m_charData
Definition: Character.h:440
bool m_loaded
Definition: Character.h:450
Inventory * pInventory
CertificateMgrDB m_cdb
Definition: Character.h:433
X * get() const
Definition: RefPtr.h:213
CertMap m_certificates
Definition: Character.h:448
double GetFileTimeNow()
Definition: utils_time.cpp:84
Skill * m_inTraining
Definition: Character.h:444
bool LoadContents()
Definition: Inventory.cpp:113
void LoadBookmarks()
Definition: Character.cpp:1348
Reference-counting-based smart pointer.
Definition: RefPtr.h:133

Here is the call graph for this function:

template<class _Ty >
static RefPtr<_Ty> Character::_LoadItem ( uint32  charID,
const ItemType type,
const ItemData data 
)
inlinestaticprotected

Definition at line 409 of file Character.h.

References _log, ItemType::categoryID(), EVEDB::invGroups::Character, Character(), ItemType::groupID(), sConfig, sDataMgr, sItemFactory, EvE::traceStack(), and type().

409  {
410  if( type.groupID() != EVEDB::invGroups::Character ) {
411  _log(ITEM__ERROR, "Trying to load %s as Character.", sDataMgr.GetCategoryName(type.categoryID()));
412  if (sConfig.debug.StackTrace)
413  EvE::traceStack();
414  return RefPtr<_Ty>();
415  }
416  CharacterData charData = CharacterData();
417  if( !sItemFactory.db()->GetCharacterData( charID, charData ) )
418  return RefPtr<_Ty>();
419 
420  CorpData corpData = CorpData();
421  if( !sItemFactory.db()->GetCorpData( charID, corpData ) )
422  return RefPtr<_Ty>();
423 
424  // cast the type
425  const CharacterType& charType = static_cast<const CharacterType& >( type );
426 
427  // construct the character item
428  return CharacterRef( new Character( charID, charType, data, charData, corpData ) );
429  }
#define sConfig
A macro for easier access to the singleton.
#define _log(type, fmt,...)
Definition: logsys.h:124
uint16 groupID() const
Definition: ItemType.h:64
const CharacterType & type() const
Definition: Character.h:276
Character(uint32 _characterID, const CharacterType &_charType, const ItemData &_data, const CharacterData &_charData, const CorpData &_corpData)
Definition: Character.cpp:230
RefPtr< Character > CharacterRef
Definition: ItemRef.h:63
uint8 categoryID() const
Definition: ItemType.h:66
void traceStack(void)
Definition: misc.cpp:169
#define sItemFactory
Definition: ItemFactory.h:165
Reference-counting-based smart pointer.
Definition: RefPtr.h:133
#define sDataMgr

Here is the call graph for this function:

uint32 Character::accountID ( ) const
inline

Definition at line 281 of file Character.h.

References CharacterData::accountID, and m_charData.

281 { return m_charData.accountID; }
CharacterData m_charData
Definition: Character.h:440
void Character::AddItem ( InventoryItemRef  item)
virtual

Reimplemented from InventoryItem.

Definition at line 1230 of file Character.cpp.

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

1231 {
1232  if (iRef.get() == nullptr)
1233  return;
1234 
1235  InventoryItem::AddItem(iRef);
1236 
1237  _log( CHARACTER__INFO, "%s(%u) has been added to %s with flag %i.", iRef->name(), iRef->itemID(), name(), (uint8)iRef->flag() );
1238 }
unsigned __int8 uint8
Definition: eve-compat.h:46
#define _log(type, fmt,...)
Definition: logsys.h:124
virtual void AddItem(InventoryItemRef iRef)
const char * name()

Here is the call graph for this function:

void Character::AddToSkillQueue ( uint16  typeID,
uint8  level 
)

Definition at line 907 of file Character.cpp.

References _log, AttrSkillLevel, EvEMath::Skill::EndTime(), QueuedSkill::endTime, flagSkill, flagSkillInTraining, EvE::FormatTime(), EvilNumber::get_uint32(), InventoryItem::GetAttribute(), Skill::GetCurrentSP(), GetFileTimeNow(), GetSkill(), Skill::GetSPForLevel(), GetSPPerMin(), InventoryItem::itemID(), QueuedSkill::level, m_inTraining, InventoryItem::m_itemID, m_pClient, m_skillQueue, EvESkill::MAXSKILLLEVEL, InventoryItem::name(), Client::QueueDestinyEvent(), InventoryItem::SaveItem(), SaveSkillHistory(), EvE::Time::Second, Client::SendErrorMsg(), InventoryItem::SetFlag(), QueuedSkill::startTime, EvESkill::Event::TaskMaster, EvESkill::Event::TrainingStarted, QueuedSkill::typeID, and InventoryItem::typeID().

907  {
908  Skill* skill(GetSkill(typeID).get());
909  if (skill == nullptr) {
910  // skill not found. cancel and return
911  _log(SKILL__QUEUE, "Cannot find Skill %u.", typeID);
912  m_pClient->SendErrorMsg("Cannot find skill to train.");
913  return;
914  }
915 
916  _log( SKILL__INFO, "Starting checks to add %s to training queue.", skill->name());
917 
918  uint8 nextLvl(skill->GetAttribute(AttrSkillLevel).get_uint32() + 1);
919  if (nextLvl > EvESkill::MAXSKILLLEVEL)
920  nextLvl = EvESkill::MAXSKILLLEVEL;
921 
922  int64 curTime(GetFileTimeNow());
923  uint32 currentSP(skill->GetCurrentSP(this)), nextSP(skill->GetSPForLevel(level));
924  if (level < nextLvl) {
925  // level to train is below current level. update client data and return.
926  SaveSkillHistory(EvESkill::Event::TaskMaster, curTime, m_itemID, typeID, level, currentSP);
927  skill->SetFlag(flagSkill, true);
928  skill->SaveItem();
929 
930  OnSkillTrained ost;
931  ost.itemID = skill->itemID();
932  PyTuple* tmp = ost.Encode();
934 
935  _log(SKILL__WARNING, "Trying to add level %u but current level is %u.", level, nextLvl -1);
936  return;
937  }
938 
939  if (level > nextLvl)
940  currentSP = skill->GetSPForLevel(level -1);
941 
942  // verify sp is below next level
943  if (currentSP >= nextSP) {
944  // it's not. update client data and return.
945  SaveSkillHistory(EvESkill::Event::TaskMaster, curTime, m_itemID, typeID, level, currentSP);
946  skill->SetFlag(flagSkill, true);
947  skill->SaveItem();
948 
949  OnSkillTrained ost;
950  ost.itemID = skill->itemID();
951  PyTuple* tmp = ost.Encode();
953 
954  _log(SKILL__WARNING, "Trying to add level %u at %u sp but current sp is %u.", level, nextSP, currentSP);
955  return;
956  }
957 
958  // current level trainable
959  QueuedSkill qs = QueuedSkill();
960  qs.typeID = typeID;
961  qs.level = level;
962 
963  if (m_skillQueue.empty()) {
964  // nothing in queue. begin training this skill
965  skill->SetFlag(flagSkillInTraining, true);
966  m_inTraining = skill;
967  qs.startTime = curTime;
968  qs.endTime = EvEMath::Skill::EndTime(currentSP, nextSP, GetSPPerMin(skill), curTime);
970 
971  OnSkillStartTraining osst;
972  osst.itemID = skill->itemID();
973  osst.endOfTraining = qs.endTime;
974  PyTuple* tmp = osst.Encode();
976  } else {
977  qs.startTime = m_skillQueue.back().endTime +EvE::Time::Second;
978  qs.endTime = EvEMath::Skill::EndTime(currentSP, nextSP, GetSPPerMin(skill), qs.startTime);
979  }
980 
981  // add to queue and save
982  m_skillQueue.push_back( qs );
983  skill->SaveItem();
984 
985  float timeLeft = (qs.endTime - qs.startTime) / EvE::Time::Second;
986  const char* formatedTime = EvE::FormatTime(timeLeft);
987  _log(SKILL__QUEUE, "Added %s Level %u to queue with %s(%.1f) to train %uSP.", \
988  skill->name(), level, formatedTime, timeLeft, nextSP - currentSP);
989 }
unsigned __int8 uint8
Definition: eve-compat.h:46
SkillRef GetSkill(uint16 skillTypeID) const
Definition: Character.cpp:566
void SendErrorMsg(const char *fmt,...)
Definition: Client.cpp:2719
#define _log(type, fmt,...)
Definition: logsys.h:124
uint8 GetSPPerMin(Skill *skill)
Definition: Character.cpp:559
void SaveSkillHistory(uint16 eventID, double logDate, uint32 characterID, uint16 skillTypeID, uint8 skillLevel, uint32 absolutePoints)
Definition: Character.cpp:689
uint8 level
Definition: CharacterDB.h:73
SkillQueue m_skillQueue
Definition: Character.h:445
void QueueDestinyEvent(PyTuple **multiEvent)
Definition: Client.cpp:2124
InventoryItem for skill.
Definition: Skill.h:48
Python tuple.
Definition: PyRep.h:567
int64 EndTime(uint32 currentSP, uint32 nextSP, uint8 SPMin, int64 timeNow)
Definition: EvEMath.cpp:46
int64 endTime
Definition: CharacterDB.h:75
const uint8 MAXSKILLLEVEL
Definition: EvEMath.h:19
int64 startTime
Definition: CharacterDB.h:76
unsigned __int32 uint32
Definition: eve-compat.h:50
Client * m_pClient
Definition: Character.h:437
double GetFileTimeNow()
Definition: utils_time.cpp:84
Skill * m_inTraining
Definition: Character.h:444
signed __int64 int64
Definition: eve-compat.h:51
uint16 typeID
Definition: CharacterDB.h:74
const char * FormatTime(int64 time=-1)
Definition: misc.cpp:204
uint16 typeID() const

Here is the call graph for this function:

int32 Character::allianceID ( ) const
inline

Definition at line 302 of file Character.h.

References CorpData::allianceID, and m_corpData.

Referenced by ShipSE::LaunchDrone().

302 { return m_corpData.allianceID; }
CorpData m_corpData
Definition: Character.h:439
int32 allianceID

Here is the caller graph for this function:

bool Character::AlterBalance ( float  amount,
uint8  type 
)

Primary public interface:

Definition at line 375 of file Character.cpp.

References UserError::AddISK(), args, CharacterData::aurBalance, Account::CreditType::AURUM, CharacterData::balance, balance(), Account::CreditType::ISK, m_charData, InventoryItem::m_itemID, m_pClient, SaveCharacter(), and Client::SendNotification().

Referenced by Client::AddBalance().

375  {
376  if (amount == 0)
377  return true;
378 
379  // amount can be negative. check for funds to remove, if applicable
380  if ((balance(type) + amount) < 0) {
381  std::map<std::string, PyRep *> args;
382  args["amount"] = new PyFloat(-amount);
383  args["balance"] = new PyFloat(balance(type));
384  throw UserError ("NotEnoughMoney")
385  .AddISK ("amount", -amount)
386  .AddISK ("balance", balance (type));
387  }
388 
389  //adjust balance and send notification of change
390  OnAccountChange ac;
391  ac.ownerid = m_itemID;
393  m_charData.balance += amount;
394  // cap isk balance at one trillion
395  if (m_charData.balance > 1000000000000)
396  m_charData.balance = 1000000000000;
397  ac.balance = m_charData.balance;
398  ac.accountKey = "cash";
399  } else if (type == Account::CreditType::AURUM) {
400  m_charData.aurBalance += amount;
401  ac.balance = m_charData.aurBalance;
402  ac.accountKey = "AURUM";
403  }
404 
405  PyTuple *answer = ac.Encode();
406  m_pClient->SendNotification("OnAccountChange", "cash", &answer, false);
407 
408  SaveCharacter();
409  return true;
410 }
void SendNotification(const PyAddress &dest, EVENotificationStream &noti, bool seq=true)
Definition: Client.cpp:2245
Python floating point number.
Definition: PyRep.h:292
const CharacterType & type() const
Definition: Character.h:276
Python tuple.
Definition: PyRep.h:567
UserError & AddISK(const char *name, double isk)
Shorthand method for adding an ISK amount.
* args
float balance(uint8 type)
Definition: Character.cpp:363
CharacterData m_charData
Definition: Character.h:440
void SaveCharacter()
Definition: Character.cpp:1257
Python object "ccp_exceptions.UserError".
Definition: PyExceptions.h:121
Client * m_pClient
Definition: Character.h:437

Here is the call graph for this function:

Here is the caller graph for this function:

uint32 Character::ancestryID ( ) const
inline

Definition at line 332 of file Character.h.

References CharacterData::ancestryID, and m_charData.

332 { return m_charData.ancestryID; }
CharacterData m_charData
Definition: Character.h:440
float Character::balance ( uint8  type)

Definition at line 363 of file Character.cpp.

References _log, CharacterData::aurBalance, Account::CreditType::AURUM, CharacterData::balance, Account::CreditType::ISK, and m_charData.

Referenced by AlterBalance(), and Client::GetBalance().

364 {
366  return m_charData.balance;
367  } else if (type == Account::CreditType::AURUM) {
368  return m_charData.aurBalance;
369  } else {
370  _log(ACCOUNT__ERROR, "Character::balance() - invalid type %u", type);
371  }
372  return 0.0f;
373 }
#define _log(type, fmt,...)
Definition: logsys.h:124
const CharacterType & type() const
Definition: Character.h:276
CharacterData m_charData
Definition: Character.h:440

Here is the caller graph for this function:

uint32 Character::bloodlineID ( ) const
inline

Definition at line 277 of file Character.h.

References CharacterType::bloodlineID(), and type().

277 { return type().bloodlineID(); }
const CharacterType & type() const
Definition: Character.h:276
uint8 bloodlineID() const
Definition: Character.h:93

Here is the call graph for this function:

float Character::bounty ( ) const
inline

Definition at line 287 of file Character.h.

References CharacterData::bounty, and m_charData.

Referenced by DroneSE::GetBounty(), Client::GetBounty(), and PayBounty().

287 { return m_charData.bounty; }
CharacterData m_charData
Definition: Character.h:440

Here is the caller graph for this function:

void Character::CancelSkillInTraining ( bool  update = false)

Definition at line 816 of file Character.cpp.

References _log, AttrSkillLevel, AttrSkillPoints, QueuedSkill::endTime, flagSkill, EvilNumber::get_uint32(), InventoryItem::GetAttribute(), Skill::GetCurrentSP(), GetFileTimeNow(), Skill::GetSPForLevel(), is_log_enabled, InventoryItem::itemID(), m_inTraining, InventoryItem::m_itemID, m_pClient, m_skillQueue, EvESkill::MAXSKILLLEVEL, InventoryItem::name(), Client::QueueDestinyEvent(), InventoryItem::SaveItem(), SaveSkillHistory(), InventoryItem::SetAttribute(), InventoryItem::SetFlag(), QueuedSkill::startTime, EvESkill::Event::TrainingCanceled, EvESkill::Event::TrainingComplete, QueuedSkill::typeID, and InventoryItem::typeID().

Referenced by ClearSkillQueue(), PauseSkillQueue(), and SkillQueueLoop().

817 {
818  if (m_inTraining == nullptr)
819  return; //nothing to do...
820 
821  if (m_skillQueue.empty())
822  return;
823 
824  QueuedSkill qs = m_skillQueue.front();
826  if (nextLvl > EvESkill::MAXSKILLLEVEL)
827  nextLvl = EvESkill::MAXSKILLLEVEL;
828 
829  int64 curTime(GetFileTimeNow());
830  uint32 currentSP(0);
831 
832  // is skill in training first in queue?
833  if (qs.typeID != m_inTraining->typeID()) {
834  // nope
835  // not sure how to do this correctly...
836  currentSP = m_inTraining->GetCurrentSP(this);
838  // send training stopped packet
839  if (update) {
840  OnSkillTrainingStopped osst;
841  osst.itemID = m_inTraining->itemID();
842  osst.silent = true; // silent means 'disable neocom blink event'
843  PyTuple* tmp = osst.Encode();
845  }
846 
847  if (is_log_enabled(SKILL__INFO))
848  _log(SKILL__INFO, "%s:%s(%u/%u) Training canceled from skill not in queue.", \
850 
851  m_inTraining->SetAttribute(AttrSkillPoints, currentSP, update);
852  m_inTraining->SetFlag(flagSkill, update);
854  m_inTraining = nullptr;
855  // either way, training canceled.
856  return;
857  }
858 
859  // at this point, skill in training is first in queue
860  currentSP = m_inTraining->GetCurrentSP(this, qs.startTime);
861  if ((qs.endTime < curTime) or (currentSP >= m_inTraining->GetSPForLevel(nextLvl))) {
862  // this level has completed
863  // send training complete packet
864  if (update) {
865  OnSkillTrained ost;
866  ost.itemID = m_inTraining->itemID();
867  PyTuple* tmp = ost.Encode();
869  }
870 
871  // update attribs and save
872  m_inTraining->SetAttribute(AttrSkillLevel, nextLvl, false);
873  currentSP = m_inTraining->GetSPForLevel(nextLvl);
875 
876  if (is_log_enabled(SKILL__INFO))
877  _log(SKILL__INFO, "%s:%s(%u/%u) - CancelSkillInTraining - Training to level %u completed.", \
878  name(), m_inTraining->name(), m_inTraining->typeID(), m_inTraining->itemID(), nextLvl);
879  } else {
881  // send training stopped packet
882  if (update) {
883  OnSkillTrainingStopped osst;
884  osst.itemID = m_inTraining->itemID();
885  osst.silent = true; // silent means 'disable neocom blink event'
886  PyTuple* tmp = osst.Encode();
888  }
889 
890  if (is_log_enabled(SKILL__INFO))
891  _log(SKILL__INFO, "%s:%s(%u/%u) - Training to level %u canceled. CurrentSP: %u, nextSP: %u", \
892  name(), m_inTraining->name(), m_inTraining->typeID(), m_inTraining->itemID(), nextLvl, currentSP, m_inTraining->GetSPForLevel(nextLvl));
893  }
894 
895  m_inTraining->SetAttribute(AttrSkillPoints, currentSP, update);
896  m_inTraining->SetFlag(flagSkill, update);
898 
899  // remove from queue, if applicable
900  if (!m_skillQueue.empty())
901  if (m_inTraining->typeID() == m_skillQueue.front().typeID)
902  m_skillQueue.erase( m_skillQueue.begin() );
903 
904  m_inTraining = nullptr;
905 }
unsigned __int8 uint8
Definition: eve-compat.h:46
#define _log(type, fmt,...)
Definition: logsys.h:124
bool SetFlag(EVEItemFlags flag, bool notify=false)
void SaveSkillHistory(uint16 eventID, double logDate, uint32 characterID, uint16 skillTypeID, uint8 skillLevel, uint32 absolutePoints)
Definition: Character.cpp:689
SkillQueue m_skillQueue
Definition: Character.h:445
void QueueDestinyEvent(PyTuple **multiEvent)
Definition: Client.cpp:2124
const char * name()
uint32 GetSPForLevel(uint8 level)
Definition: Skill.cpp:76
Python tuple.
Definition: PyRep.h:567
#define is_log_enabled(type)
Definition: logsys.h:78
int64 endTime
Definition: CharacterDB.h:75
uint32 get_uint32()
Definition: EvilNumber.cpp:173
const uint8 MAXSKILLLEVEL
Definition: EvEMath.h:19
void SetAttribute(uint16 attrID, int num, bool notify=true)
int64 startTime
Definition: CharacterDB.h:76
unsigned __int32 uint32
Definition: eve-compat.h:50
uint32 GetCurrentSP(Character *ch, int64 startTime=0)
Definition: Skill.cpp:80
Client * m_pClient
Definition: Character.h:437
double GetFileTimeNow()
Definition: utils_time.cpp:84
Skill * m_inTraining
Definition: Character.h:444
signed __int64 int64
Definition: eve-compat.h:51
EvilNumber GetAttribute(const uint16 attrID) const
uint16 typeID
Definition: CharacterDB.h:74
uint16 typeID() const
uint32 itemID() const
Definition: InventoryItem.h:98

Here is the call graph for this function:

Here is the caller graph for this function:

uint32 Character::capsuleID ( ) const
inline

Definition at line 342 of file Character.h.

References CharacterData::capsuleID, and m_charData.

Referenced by Client::SetPodItem().

342 { return m_charData.capsuleID; }
CharacterData m_charData
Definition: Character.h:440

Here is the caller graph for this function:

uint32 Character::careerID ( ) const
inline

Definition at line 333 of file Character.h.

References CharacterData::careerID, and m_charData.

333 { return m_charData.careerID; }
CharacterData m_charData
Definition: Character.h:440
uint32 Character::careerSpecialityID ( ) const
inline

Definition at line 335 of file Character.h.

References CharacterData::careerSpecialityID, and m_charData.

335 { return m_charData.careerSpecialityID; }
CharacterData m_charData
Definition: Character.h:440
uint32 careerSpecialityID
void Character::ClearSkillFlags ( )

Definition at line 551 of file Character.cpp.

References flagSkill, Inventory::GetItemsByFlag(), and InventoryItem::pInventory.

Referenced by _Load().

552 {
553  std::vector<InventoryItemRef> skills;
555  for (auto cur : skills)
556  cur->SetFlag(flagSkill, false);
557 }
uint32 GetItemsByFlag(EVEItemFlags flag, std::vector< InventoryItemRef > &items) const
Definition: Inventory.cpp:458
Inventory * pInventory

Here is the call graph for this function:

Here is the caller graph for this function:

void Character::ClearSkillQueue ( bool  update = false)

Definition at line 653 of file Character.cpp.

References _log, CancelSkillInTraining(), InventoryItem::m_itemID, m_skillQueue, and InventoryItem::name().

654 {
655  CancelSkillInTraining(update);
656  m_skillQueue.clear();
657  _log(SKILL__QUEUE, "%s(%u) Skill Queue Cleared", name(), m_itemID);
658 }
#define _log(type, fmt,...)
Definition: logsys.h:124
void CancelSkillInTraining(bool update=false)
Definition: Character.cpp:816
SkillQueue m_skillQueue
Definition: Character.h:445
const char * name()

Here is the call graph for this function:

uint32 Character::constellationID ( ) const
inline

Definition at line 328 of file Character.h.

References CharacterData::constellationID, and m_charData.

Referenced by Client::UpdateSession().

328 { return m_charData.constellationID; }
CharacterData m_charData
Definition: Character.h:440
uint32 constellationID

Here is the caller graph for this function:

int32 Character::corpAccountKey ( ) const
inline

Definition at line 304 of file Character.h.

References CorpData::corpAccountKey, and m_corpData.

304 { return m_corpData.corpAccountKey; }
CorpData m_corpData
Definition: Character.h:439
int16 corpAccountKey
uint32 Character::corporationHQ ( ) const
inline

Definition at line 301 of file Character.h.

References CorpData::corpHQ, and m_corpData.

301 { return m_corpData.corpHQ; }
uint32 corpHQ
CorpData m_corpData
Definition: Character.h:439
uint32 Character::corporationID ( ) const
inline

Definition at line 300 of file Character.h.

References CorpData::corporationID, and m_corpData.

Referenced by FactoryDB::GetAssemblyLineProperties(), and ShipSE::LaunchDrone().

300 { return m_corpData.corporationID; }
CorpData m_corpData
Definition: Character.h:439
uint32 corporationID

Here is the caller graph for this function:

int64 Character::corpRole ( ) const
inline

Definition at line 310 of file Character.h.

References CorpData::corpRole, and m_corpData.

310 { return m_corpData.corpRole; }
CorpData m_corpData
Definition: Character.h:439
int64 corpRole
float Character::corpSecRating ( ) const
inline

Definition at line 306 of file Character.h.

References m_corpData, and CorpData::secRating.

Referenced by RamMethods::LinePermissionCheck().

306 { return m_corpData.secRating; }
CorpData m_corpData
Definition: Character.h:439
float secRating

Here is the caller graph for this function:

float Character::corpTaxRate ( ) const
inline

Definition at line 305 of file Character.h.

References m_corpData, and CorpData::taxRate.

Referenced by Client::GetCorpTaxRate().

305 { return m_corpData.taxRate; }
CorpData m_corpData
Definition: Character.h:439
float taxRate

Here is the caller graph for this function:

std::string Character::corpTicker ( ) const
inline

Definition at line 299 of file Character.h.

References m_corpData, and CorpData::ticker.

299 { return m_corpData.ticker; }
CorpData m_corpData
Definition: Character.h:439
std::string ticker
int64 Character::createDateTime ( ) const
inline

Definition at line 339 of file Character.h.

References CharacterData::createDateTime, and m_charData.

339 { return m_charData.createDateTime; }
int64 createDateTime
CharacterData m_charData
Definition: Character.h:440
void Character::Delete ( )
virtual

Reimplemented from InventoryItem.

Definition at line 354 of file Character.cpp.

References InventoryItem::Delete(), CharacterDB::DeleteCharacter(), Inventory::DeleteContents(), m_db, InventoryItem::m_itemID, and InventoryItem::pInventory.

354  {
355  // delete contents
357  // delete character record
359  // let the parent care about the rest
361 }
CharacterDB m_db
Definition: Character.h:434
void DeleteContents()
Definition: Inventory.cpp:273
void DeleteCharacter(uint32 charID)
Inventory * pInventory
virtual void Delete()

Here is the call graph for this function:

const std::string& Character::description ( ) const
inline

Definition at line 284 of file Character.h.

References CharacterData::description, and m_charData.

Referenced by GetDescription().

284 { return m_charData.description; }
CharacterData m_charData
Definition: Character.h:440
std::string description

Here is the caller graph for this function:

int8 Character::fleetBooster ( ) const
inline

Definition at line 322 of file Character.h.

References CharFleetData::booster, and m_fleetData.

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

322 { return m_fleetData.booster; }
CharFleetData m_fleetData
Definition: Character.h:441

Here is the caller graph for this function:

int32 Character::fleetID ( ) const
inline

Definition at line 318 of file Character.h.

References CharFleetData::fleetID, and m_fleetData.

Referenced by Command_fleetboost(), Command_showsession(), FleetService::FleetBroadcast(), FleetService::LeaveFleet(), and FleetService::RemoveMember().

318 { return m_fleetData.fleetID; }
CharFleetData m_fleetData
Definition: Character.h:441

Here is the caller graph for this function:

int8 Character::fleetJob ( ) const
inline

Definition at line 323 of file Character.h.

References CharFleetData::job, and m_fleetData.

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

323 { return m_fleetData.job; }
CharFleetData m_fleetData
Definition: Character.h:441

Here is the caller graph for this function:

int64 Character::fleetJoinTime ( )
inline

Definition at line 317 of file Character.h.

References CharFleetData::joinTime, and m_fleetData.

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

317 { return m_fleetData.joinTime; }
CharFleetData m_fleetData
Definition: Character.h:441

Here is the caller graph for this function:

int8 Character::fleetRole ( ) const
inline

Definition at line 321 of file Character.h.

References m_fleetData, and CharFleetData::role.

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

321 { return m_fleetData.role; }
CharFleetData m_fleetData
Definition: Character.h:441

Here is the caller graph for this function:

void Character::FleetShareMissionRewards ( )

Definition at line 471 of file Character.cpp.

472 { // not used yet.
473 
474 }
void Character::FleetShareMissionStandings ( float  newStanding)

Definition at line 476 of file Character.cpp.

References CharFleetData::fleetID, and m_fleetData.

477 { // not used yet.
478  if (m_fleetData.fleetID == 0)
479  return;
480  // negative standings are NOT shared with fleet
481  if (newStanding < 0)
482  return;
483 }
CharFleetData m_fleetData
Definition: Character.h:441
bool Character::gender ( ) const
inline

Definition at line 285 of file Character.h.

References CharacterData::gender, and m_charData.

285 { return m_charData.gender; }
CharacterData m_charData
Definition: Character.h:440
void Character::GetCertificates ( CertMap crt)

Definition at line 1323 of file Character.cpp.

References m_certificates.

1323  {
1324  crt = m_certificates;
1325 }
CertMap m_certificates
Definition: Character.h:448
PyDict * Character::GetCharInfo ( )
Todo:
get implants and boosters here once implemented
Todo:
i dont know how boosters and implants work yet, so may have to set item different for them.

Definition at line 1183 of file Character.cpp.

References codelog, Inventory::ContentsLoaded(), flagSkill, flagSkillInTraining, Inventory::GetItemsByFlag(), Inventory::LoadContents(), InventoryItem::m_itemID, InventoryItem::name(), InventoryItem::pInventory, InventoryItem::Populate(), and PyDict::SetItem().

1183  {
1184  // this is char, skills, implants, boosters.
1185  if (!pInventory->ContentsLoaded())
1186  if (!pInventory->LoadContents()) {
1187  codelog(CHARACTER__ERROR, "%s (%u): Failed to load contents for GetCharInfo", name(), m_itemID);
1188  return nullptr;
1189  }
1190 
1191  Rsp_CommonGetInfo_Entry entry1;
1192  if (!Populate(entry1))
1193  return nullptr;
1194 
1195  PyDict *result = new PyDict();
1196  result->SetItem(new PyInt(m_itemID), new PyObject("util.KeyVal", entry1.Encode()));
1197 
1198  //now encode skills...
1199  std::vector<InventoryItemRef> skills;
1200  skills.clear();
1201  //find all the skills contained within ourself.
1202  pInventory->GetItemsByFlag(flagSkill, skills );
1204 
1207  //encode an entry for each one.
1208  for (auto cur : skills) {
1209  Rsp_CommonGetInfo_Entry entry;
1210  if (cur->Populate(entry)) {
1211  result->SetItem(new PyInt(cur->itemID()), new PyObject("util.KeyVal", entry.Encode()));
1212  } else {
1213  codelog(CHARACTER__ERROR, "%s (%u): Failed to load character item %u for GetCharInfo", name(), m_itemID, cur->itemID());
1214  }
1215  }
1216 
1219  return result;
1220 }
bool ContentsLoaded() const
Definition: Inventory.h:62
Python's dictionary.
Definition: PyRep.h:719
const char * name()
uint32 GetItemsByFlag(EVEItemFlags flag, std::vector< InventoryItemRef > &items) const
Definition: Inventory.cpp:458
Python object.
Definition: PyRep.h:826
Inventory * pInventory
#define codelog(type, fmt,...)
Definition: logsys.h:128
Python integer.
Definition: PyRep.h:231
bool Populate(Rsp_CommonGetInfo_Entry &into)
bool LoadContents()
Definition: Inventory.cpp:113
void SetItem(PyRep *key, PyRep *value)
SetItem adds or sets a database entry.
Definition: PyRep.cpp:713

Here is the call graph for this function:

Client* Character::GetClient ( )
inline

Definition at line 232 of file Character.h.

References m_pClient.

232 { return m_pClient; }
Client * m_pClient
Definition: Character.h:437
CorpData Character::GetCorpData ( )
inline

Definition at line 298 of file Character.h.

References m_corpData.

298 { return m_corpData; }
CorpData m_corpData
Definition: Character.h:439
PyObject * Character::GetDescription ( ) const

Definition at line 1222 of file Character.cpp.

References description().

1222  {
1223  util_Row row;
1224  row.header.push_back("description");
1225  row.line = new PyList();
1226  row.line->AddItemString( description().c_str() );
1227  return row.Encode();
1228 }
const std::string & description() const
Definition: Character.h:284
Python list.
Definition: PyRep.h:639

Here is the call graph for this function:

int64 Character::GetEndOfTraining ( )

Definition at line 624 of file Character.cpp.

References flagSkill, InventoryItem::itemID(), m_inTraining, m_pClient, m_skillQueue, InventoryItem::name(), InventoryItem::SetFlag(), Client::SetTrainingEndTime(), and sLog.

Referenced by Skill::GetRemainingSP().

624  {
625  if (m_inTraining == nullptr)
626  return 0;
627 
628  // sanity check for skill training
629  if (m_skillQueue.empty()) {
630  sLog.Error("SkillQueue", "%s(%u) flagged as training but queue empty", \
633  m_inTraining = nullptr;
635  return 0;
636  }
637 
638  m_pClient->SetTrainingEndTime(m_skillQueue.front().endTime);
639  return m_skillQueue.front().endTime;
640 }
void SetTrainingEndTime(int64 endTime)
Definition: Client.h:331
bool SetFlag(EVEItemFlags flag, bool notify=false)
SkillQueue m_skillQueue
Definition: Character.h:445
const char * name()
#define sLog
Evaluates to a NewLog instance.
Definition: LogNew.h:250
Client * m_pClient
Definition: Character.h:437
Skill * m_inTraining
Definition: Character.h:444
uint32 itemID() const
Definition: InventoryItem.h:98

Here is the call graph for this function:

Here is the caller graph for this function:

float Character::GetNPCCorpStanding ( uint32  fromID,
uint32  toID = 0 
)

Definition at line 1376 of file Character.cpp.

References EvESkill::Connections, EvESkill::Diplomacy, GetSkillLevel(), StandingDB::GetStanding(), and InventoryItem::m_itemID.

1376  {
1377  if (toID == 0)
1378  toID = m_itemID;
1379  float res = StandingDB::GetStanding(fromID, toID);
1380  if (res < 0.0f) {
1381  res += ((10.0f + res) * (0.04f * GetSkillLevel(EvESkill::Diplomacy)));
1382  } else {
1383  res += ((10.0f - res) * (0.04f * GetSkillLevel(EvESkill::Connections)));
1384  }
1385  return res;
1386 }
static float GetStanding(uint32 fromID, uint32 toID)
Definition: StandingDB.cpp:142
int8 GetSkillLevel(uint16 skillTypeID, bool zeroForNotInjected=true) const
Definition: Character.cpp:575

Here is the call graph for this function:

PyRep * Character::GetRAMSkills ( )

Definition at line 595 of file Character.cpp.

References EvESkill::AdvancedLaboratoryOperation, EvESkill::AdvancedMassProduction, AttrManufactureSlotLimit, AttrMaxLaborotorySlots, GetSkillLevel(), EvESkill::LaboratoryOperation, EvESkill::MassProduction, EVEDB::invTypes::ScientificNetworking, EvESkill::ScientificNetworking, PyTuple::SetItem(), PyDict::SetItem(), EvESkill::SupplyChainManagement, and EVEDB::invTypes::SupplyChainManagement.

596 {
597  /* this queries RAM skills and is used to display blueprints tab (S&I -> Blueprints)
598  * called by RamProxy::GetRelevantCharSkills()
599  *
600  * skillLevels, attributeValues = sm.GetService('manufacturing').GetRelevantCharSkills()
601  * maxManufacturingJobCount = int(attributeValues[const.attributeManufactureSlotLimit]) -AttrManufactureSlotLimit = 196,
602  * maxResearchJobCount = int(attributeValues[const.attributeMaxLaborotorySlots]) -AttrMaxLaborotorySlots = 467,
603  *
604  * skillLevels << this is a dict of max remote ram jobs
605  * attributeValues << this is a dict of max ram jobs
606  */
607 
608  PyDict* skillLevels = new PyDict();
611 
614  PyDict* attributeValues = new PyDict();
615  attributeValues->SetItem(new PyInt(AttrMaxLaborotorySlots), new PyInt(mLab));
616  attributeValues->SetItem(new PyInt(AttrManufactureSlotLimit), new PyInt(mSlot));
617 
618  PyTuple* tuple = new PyTuple(2);
619  tuple->SetItem(0, skillLevels);
620  tuple->SetItem(1, attributeValues);
621  return tuple;
622 }
unsigned __int8 uint8
Definition: eve-compat.h:46
Python's dictionary.
Definition: PyRep.h:719
Python tuple.
Definition: PyRep.h:567
void SetItem(size_t index, PyRep *object)
Stores Python object.
Definition: PyRep.h:610
Python integer.
Definition: PyRep.h:231
int8 GetSkillLevel(uint16 skillTypeID, bool zeroForNotInjected=true) const
Definition: Character.cpp:575
void SetItem(PyRep *key, PyRep *value)
SetItem adds or sets a database entry.
Definition: PyRep.cpp:713

Here is the call graph for this function:

float Character::GetSecurityRating ( ) const
inline

Definition at line 289 of file Character.h.

References m_charData, and CharacterData::securityRating.

Referenced by SystemEntity::AwardSecurityStatus(), DroneSE::GetSecurityRating(), and Client::GetSecurityRating().

289 { return m_charData.securityRating; }
CharacterData m_charData
Definition: Character.h:440
float securityRating

Here is the caller graph for this function:

SkillRef Character::GetSkill ( uint16  skillTypeID) const

Definition at line 566 of file Character.cpp.

References flagSkill, flagSkillInTraining, RefPtr< X >::get(), Inventory::GetByTypeFlag(), InventoryItem::pInventory, and RefPtr< X >::StaticCast().

Referenced by _Load(), AddToSkillQueue(), Command_giveallskills(), Command_giveskill(), GetSkillLevel(), HasSkill(), HasSkillTrainedToLevel(), InjectSkillIntoBrain(), LoadPausedSkillQueue(), and SkillQueueLoop().

567 {
568  InventoryItemRef skill = pInventory->GetByTypeFlag( skillTypeID, flagSkill );
569  if (skill.get() == nullptr)
570  skill = pInventory->GetByTypeFlag( skillTypeID, flagSkillInTraining );
571 
572  return SkillRef::StaticCast( skill );
573 }
Inventory * pInventory
X * get() const
Definition: RefPtr.h:213
static RefPtr StaticCast(const RefPtr< Y > &oth)
Acts as static_cast from one RefPtr to another.
Definition: RefPtr.h:238
InventoryItemRef GetByTypeFlag(uint32 typeID, EVEItemFlags flag) const
Definition: Inventory.cpp:444

Here is the call graph for this function:

Here is the caller graph for this function:

PyRep * Character::GetSkillHistory ( )

Definition at line 542 of file Character.cpp.

References CharacterDB::GetSkillHistory(), m_db, and InventoryItem::m_itemID.

542  {
543  return m_db.GetSkillHistory(m_itemID);
544 }
CharacterDB m_db
Definition: Character.h:434
PyRep * GetSkillHistory(uint32 charID)

Here is the call graph for this function:

Skill* Character::GetSkillInTraining ( ) const
inline

Definition at line 242 of file Character.h.

References m_inTraining.

242 { return m_inTraining; }
Skill * m_inTraining
Definition: Character.h:444
int8 Character::GetSkillLevel ( uint16  skillTypeID,
bool  zeroForNotInjected = true 
) const

Definition at line 575 of file Character.cpp.

References AttrSkillLevel, RefPtr< X >::get(), and GetSkill().

Referenced by ActiveModule::ActiveModule(), CorporationDB::AddCorporation(), FleetService::AddMember(), SystemEntity::AwardSecurityStatus(), ReprocessingServiceBound::CalcReprocessingEfficiency(), RamMethods::Calculate(), Agent::CanUseAgent(), FleetService::CreateFleet(), CynoModule::CynoModule(), MarketMgr::ExecuteBuyOrder(), MarketMgr::ExecuteSellOrder(), Skill::FitModuleSkillCheck(), FleetService::GetBoosterData(), GetNPCCorpStanding(), GetRAMSkills(), ReprocessingServiceBound::GetStanding(), GetStandingModified(), RamMethods::JobsCheck(), ActiveModule::LaunchProbe(), RamMethods::MaterialSkillsCheck(), Missile::Missile(), ProbeSE::ProbeSE(), Client::ProcessClient(), Prospector::Prospector(), FleetService::SetSquadBoostData(), FleetService::SetWingBoostData(), Skill::SkillPrereqsComplete(), TargetManager::StartTargeting(), Prospector::Update(), ActiveModule::Update(), FleetService::UpdateBoost(), Agent::UpdateStandings(), and DestinyManager::WarpTo().

575  {
576  SkillRef requiredSkill = GetSkill( skillTypeID );
577  // First, check for existence of skill trained or in training:
578  if (requiredSkill.get() == nullptr)
579  return (zeroForNotInjected ? 0 : -1);
580 
581  return (int8)requiredSkill->GetAttribute(AttrSkillLevel).get_uint32() ;
582 }
SkillRef GetSkill(uint16 skillTypeID) const
Definition: Character.cpp:566
signed __int8 int8
Definition: eve-compat.h:45
X * get() const
Definition: RefPtr.h:213
Reference-counting-based smart pointer.
Definition: RefPtr.h:133

Here is the call graph for this function:

Here is the caller graph for this function:

void Character::GetSkillsList ( std::vector< InventoryItemRef > &  skills) const

Definition at line 534 of file Character.cpp.

References flagSkill, Inventory::GetItemsByFlag(), and InventoryItem::pInventory.

Referenced by FxProc::ApplyEffects().

534  {
536 }
uint32 GetItemsByFlag(EVEItemFlags flag, std::vector< InventoryItemRef > &items) const
Definition: Inventory.cpp:458
Inventory * pInventory

Here is the call graph for this function:

Here is the caller graph for this function:

uint8 Character::GetSPPerMin ( Skill skill)

Definition at line 559 of file Character.cpp.

References AttrPrimaryAttribute, AttrSecondaryAttribute, EvilNumber::get_uint32(), InventoryItem::GetAttribute(), and EvEMath::Skill::PointsPerMinute().

Referenced by AddToSkillQueue(), Skill::GetCurrentSP(), Skill::GetRemainingSP(), Skill::GetTrainingTime(), and LoadPausedSkillQueue().

560 {
561  uint8 primary = GetAttribute(skill->GetAttribute(AttrPrimaryAttribute).get_uint32()).get_uint32();
562  uint8 secondary = GetAttribute(skill->GetAttribute(AttrSecondaryAttribute).get_uint32()).get_uint32();
563  return EvEMath::Skill::PointsPerMinute(primary, secondary);
564 }
unsigned __int8 uint8
Definition: eve-compat.h:46
uint8 PointsPerMinute(uint8 pAttr, uint8 sAttr)
Definition: EvEMath.cpp:36
uint32 get_uint32()
Definition: EvilNumber.cpp:173
EvilNumber GetAttribute(const uint16 attrID) const

Here is the call graph for this function:

Here is the caller graph for this function:

float Character::GetStandingModified ( uint32  fromID,
uint32  toID = 0 
)
Todo:
this needs to be moved to common standings code
Todo:
these need to use common standings methods for formulas
Todo:
these need secStatus tests and calcs for negative secStatus

Definition at line 1363 of file Character.cpp.

References EvESkill::Connections, EvESkill::Diplomacy, GetSkillLevel(), StandingDB::GetStanding(), and InventoryItem::m_itemID.

Referenced by RamMethods::LinePermissionCheck().

1364 {
1365  if (toID == 0)
1366  toID = m_itemID;
1367  float res = StandingDB::GetStanding(fromID, toID);
1368  if (res < 0.0f) {
1369  res += ((10.0f + res) * (0.04f * GetSkillLevel(EvESkill::Diplomacy)));
1370  } else {
1371  res += ((10.0f - res) * (0.04f * GetSkillLevel(EvESkill::Connections)));
1372  }
1373  return res;
1374 }
static float GetStanding(uint32 fromID, uint32 toID)
Definition: StandingDB.cpp:142
int8 GetSkillLevel(uint16 skillTypeID, bool zeroForNotInjected=true) const
Definition: Character.cpp:575

Here is the call graph for this function:

Here is the caller graph for this function:

uint32 Character::GetTotalSP ( )

Definition at line 677 of file Character.cpp.

References AttrSkillPoints, flagSkill, Inventory::GetItemsByFlag(), m_charData, InventoryItem::pInventory, and CharacterData::skillPoints.

Referenced by SaveCharacter().

677  {
678  // Loop through all skills trained and calculate total SP this character has trained
679  // this will also update charData for current SP
681  std::vector<InventoryItemRef> skills;
683  for (auto cur : skills)
684  m_charData.skillPoints += cur->GetAttribute( AttrSkillPoints ).get_uint32(); // much cleaner and more accurate -allan
685 
686  return m_charData.skillPoints;
687 }
uint32 skillPoints
uint32 GetItemsByFlag(EVEItemFlags flag, std::vector< InventoryItemRef > &items) const
Definition: Inventory.cpp:458
CharacterData m_charData
Definition: Character.h:440
Inventory * pInventory

Here is the call graph for this function:

Here is the caller graph for this function:

uint32 Character::GetTotalSPTrained ( )
inline

Definition at line 245 of file Character.h.

References m_charData, and CharacterData::skillPoints.

245 { return m_charData.skillPoints; };
uint32 skillPoints
CharacterData m_charData
Definition: Character.h:440
void Character::GrantCertificate ( uint32  certificateID)

Definition at line 1327 of file Character.cpp.

References CertificateMgrDB::AddCertificate(), CharCerts::certificateID, GetFileTimeNow(), CharCerts::grantDate, m_cdb, m_certificates, InventoryItem::m_itemID, and CharCerts::visibilityFlags.

1328 {
1329  CharCerts cert = CharCerts();
1330  cert.certificateID = certID;
1331  cert.grantDate = GetFileTimeNow();
1332  cert.visibilityFlags = 0;
1333  m_certificates.emplace(certID, cert);
1334  m_cdb.AddCertificate(m_itemID, cert);
1335 }
uint32 certificateID
CertificateMgrDB m_cdb
Definition: Character.h:433
CertMap m_certificates
Definition: Character.h:448
uint8 visibilityFlags
double GetFileTimeNow()
Definition: utils_time.cpp:84
void AddCertificate(uint32 charID, CharCerts cert)
int64 grantDate

Here is the call graph for this function:

bool Character::HasCertificate ( uint32  certificateID) const

Definition at line 1318 of file Character.cpp.

References m_certificates.

1318  {
1319  CertMap::const_iterator itr = m_certificates.find(certID);
1320  return (itr != m_certificates.end());
1321 }
CertMap m_certificates
Definition: Character.h:448
bool Character::HasSkill ( uint16  skillTypeID) const

Definition at line 538 of file Character.cpp.

References GetSkill().

Referenced by Command_giveallskills(), and Command_giveskill().

538  {
539  return (GetSkill(skillTypeID).get() != nullptr);
540 }
SkillRef GetSkill(uint16 skillTypeID) const
Definition: Character.cpp:566

Here is the call graph for this function:

Here is the caller graph for this function:

bool Character::HasSkillTrainedToLevel ( uint16  skillTypeID,
uint8  skillLevel 
) const

Definition at line 584 of file Character.cpp.

References AttrSkillLevel, RefPtr< X >::get(), and GetSkill().

Referenced by Command_giveallskills(), Command_giveskill(), FleetService::GetBoosterData(), ProbeSE::HasMaxSkill(), FleetService::SetSquadBoostData(), FleetService::SetWingBoostData(), FleetService::UpdateBoost(), and ShipItem::ValidateBoardShip().

584  {
585  SkillRef requiredSkill = GetSkill( skillTypeID );
586  // First, check for existence of skill
587  if (requiredSkill.get() == nullptr)
588  return false;
589  // Second, check for required minimum level of skill, note it must already be trained to this level:
590  if (requiredSkill->GetAttribute(AttrSkillLevel) < skillLevel)
591  return false;
592  return true;
593 }
SkillRef GetSkill(uint16 skillTypeID) const
Definition: Character.cpp:566
X * get() const
Definition: RefPtr.h:213
Reference-counting-based smart pointer.
Definition: RefPtr.h:133

Here is the call graph for this function:

Here is the caller graph for this function:

uint8 Character::InjectSkillIntoBrain ( SkillRef  skill)
Todo:
: build and send proper UserError for CharacterAlreadyKnowsSkill.
Todo:
config option (later) to check if another character on this account is training a skill. If so, send error, cancel inject and return. (flagID=61).
Todo:
need to send back a response to the client. need packet specs.

Definition at line 700 of file Character.cpp.

References _log, AttrSkillLevel, AttrSkillPoints, EvilZero, flagSkill, RefPtr< X >::get(), EvilNumber::get_uint32(), GetFileTimeNow(), GetSkill(), InventoryItem::m_itemID, m_pClient, InventoryItem::name(), SaveSkillHistory(), Client::SendNotifyMsg(), EvESkill::Event::SkillInjected, and RefPtr< X >::StaticCast().

700  {
701  if (m_pClient == nullptr)
702  return 0;
703 
704  // returns
705  // 1=success, 2=prereqs, 3=already known, 4=split fail, 5=load fail
706 
707  SkillRef oldSkill = GetSkill( skill->typeID() );
708  if (oldSkill.get() != nullptr) {
710  m_pClient->SendNotifyMsg( "You already know this skill." );
711  return 3;
712  }
713 
718  if ( !skill->SkillPrereqsComplete( *this ) ) {
720  _log(SKILL__DEBUG, "%s(%u): Requested to inject %s (%u/%u) but prereq not complete.", \
721  name(), m_itemID, skill->name(), skill->typeID(), skill->itemID() );
722  m_pClient->SendNotifyMsg( "Injection failed. Skill prerequisites incomplete." );
723  return 2;
724  }
725 
726  // are we injecting from a stack of skills?
727  if ( skill->quantity() > 1 ) {
728  // split the stack to obtain single item
729  skill = SkillRef::StaticCast(skill->Split( 1 ));
730  if (skill.get() == nullptr ) {
731  _log( ITEM__ERROR, "%s (%u): Unable to split stack of %s (%u).", name(), m_itemID, skill->name(), skill->itemID() );
732  return 4;
733  }
734  }
735 
736  skill->ChangeSingleton(true);
737  skill->Move(m_itemID, flagSkill, true);
738  skill->SetAttribute(AttrSkillPoints, EvilZero.get_uint32());
739  skill->SetAttribute(AttrSkillLevel, EvilZero.get_uint32(), false);
740 
741  // 'EvESkill::Event::SkillInjected' shows as "Unknown" in PD>Skill>History
743  _log(SKILL__MESSAGE, "%s(%u) has injected %s(%u)", name(), m_itemID, skill->name(), skill->itemID());
744 
745  return 1;
746 }
SkillRef GetSkill(uint16 skillTypeID) const
Definition: Character.cpp:566
#define _log(type, fmt,...)
Definition: logsys.h:124
void SaveSkillHistory(uint16 eventID, double logDate, uint32 characterID, uint16 skillTypeID, uint8 skillLevel, uint32 absolutePoints)
Definition: Character.cpp:689
const char * name()
void SendNotifyMsg(const char *fmt,...)
Definition: Client.cpp:2776
EvilNumber EvilZero
Definition: EvilNumber.cpp:32
uint32 get_uint32()
Definition: EvilNumber.cpp:173
X * get() const
Definition: RefPtr.h:213
static RefPtr StaticCast(const RefPtr< Y > &oth)
Acts as static_cast from one RefPtr to another.
Definition: RefPtr.h:238
Client * m_pClient
Definition: Character.h:437
double GetFileTimeNow()
Definition: utils_time.cpp:84
Reference-counting-based smart pointer.
Definition: RefPtr.h:133

Here is the call graph for this function:

void Character::JoinCorporation ( const CorpData data)
Todo:
remove this in favor of updating data when changed

Definition at line 426 of file Character.cpp.

References CharacterDB::AddEmployment(), CorpData::corporationID, m_corpData, m_db, InventoryItem::m_itemID, m_pClient, CharacterDB::SaveCorpData(), and Client::UpdateCorpSession().

426  {
427  // Add new employment history record -allan 25Mar14 update 20Jan15 update again 23May19
429  m_corpData = data;
433 }
CharacterDB m_db
Definition: Character.h:434
static bool SaveCorpData(uint32 charID, const CorpData &data)
CorpData m_corpData
Definition: Character.h:439
void UpdateCorpSession(CorpData &data)
Definition: Client.cpp:1970
Client * m_pClient
Definition: Character.h:437
uint32 corporationID
static void AddEmployment(uint32 charID, uint32 corpID, uint32 oldCorpID=0)

Here is the call graph for this function:

CharacterRef Character::Load ( uint32  characterID)
static

Definition at line 265 of file Character.cpp.

Referenced by Spawn().

265  {
266  return InventoryItem::Load<Character>( characterID );
267 }

Here is the caller graph for this function:

void Character::LoadBookmarks ( )
protected
Todo:
this will need more thought/work

Definition at line 1348 of file Character.cpp.

Referenced by _Load().

1349 {
1350 
1351 }

Here is the caller graph for this function:

void Character::LoadPausedSkillQueue ( uint16  typeID)

Definition at line 758 of file Character.cpp.

References _log, AttrSkillLevel, EvEMath::Skill::EndTime(), flagSkillInTraining, RefPtr< X >::get(), EvilNumber::get_uint32(), InventoryItem::GetAttribute(), Skill::GetCurrentSP(), GetFileTimeNow(), GetSkill(), Skill::GetSPForLevel(), GetSPPerMin(), InventoryItem::itemID(), CharacterDB::LoadPausedSkillQueue(), m_db, InventoryItem::m_itemID, m_pClient, m_skillQueue, EvESkill::MAXSKILLLEVEL, InventoryItem::name(), Client::QueueDestinyEvent(), InventoryItem::SaveItem(), SaveSkillHistory(), InventoryItem::SetFlag(), EvESkill::Event::TrainingStarted, and UpdateSkillQueueEndTime().

759 {
761 
762  if (m_skillQueue.empty())
763  return;
764 
765  Skill* skill(GetSkill(typeID).get());
766  if (typeID != m_skillQueue.front().typeID) {
767  // skill to start != first skill in queue...do we just start removing skills till we find this typeID?
768  _log(SKILL__WARNING, "LoadPausedSkillQueue() - type sent (%u) does not match first in queue (%u)",
769  typeID, m_skillQueue.front().typeID);
770  }
771 
772  // queue was paused. all endTimes are off, so reset using now as start time for first skill.
773  uint8 nextLvl(0);
774  uint32 currentSP(0), nextSP(0);
775  int64 startTime(GetFileTimeNow());
776  for (SkillQueue::iterator itr = m_skillQueue.begin(); itr != m_skillQueue.end(); ++itr) {
777  skill = GetSkill(itr->typeID).get();
778  if (skill == nullptr)
779  continue;
780  nextLvl = skill->GetAttribute(AttrSkillLevel).get_uint32() + 1;
781  if (nextLvl > EvESkill::MAXSKILLLEVEL)
782  nextLvl = EvESkill::MAXSKILLLEVEL;
783 
784  if (itr->level == nextLvl) {
785  currentSP = skill->GetCurrentSP(this, startTime);
786  } else {
787  currentSP = skill->GetSPForLevel(itr->level - 1);
788  }
789 
790  nextSP = skill->GetSPForLevel(itr->level);
791  itr->startTime = startTime;
792  itr->endTime = EvEMath::Skill::EndTime(currentSP, nextSP, GetSPPerMin(skill), startTime);
793  skill->SaveItem();
794  startTime = itr->endTime;
795  }
796 
797  // get first skill, add start history and send begin training packet
798  skill = GetSkill(m_skillQueue.front().typeID).get();
799  skill->SetFlag(flagSkillInTraining, true);
800  skill->SaveItem();
801 
802  OnSkillStartTraining osst;
803  osst.itemID = skill->itemID();
804  osst.endOfTraining = m_skillQueue.front().endTime;
805  PyTuple* tmp = osst.Encode();
807 
808  // do we save/show cancel/restart training for pause/resume?
809  SaveSkillHistory(EvESkill::Event::TrainingStarted, GetFileTimeNow(), m_itemID, skill->itemID(), m_skillQueue.front().level, skill->GetSPForLevel(m_skillQueue.front().level));
810 
812 
813  _log(SKILL__QUEUE, "%s(%u) Paused Skill Queue Loaded and restarted", name(), m_itemID);
814 }
CharacterDB m_db
Definition: Character.h:434
unsigned __int8 uint8
Definition: eve-compat.h:46
SkillRef GetSkill(uint16 skillTypeID) const
Definition: Character.cpp:566
#define _log(type, fmt,...)
Definition: logsys.h:124
uint8 GetSPPerMin(Skill *skill)
Definition: Character.cpp:559
void SaveSkillHistory(uint16 eventID, double logDate, uint32 characterID, uint16 skillTypeID, uint8 skillLevel, uint32 absolutePoints)
Definition: Character.cpp:689
SkillQueue m_skillQueue
Definition: Character.h:445
void QueueDestinyEvent(PyTuple **multiEvent)
Definition: Client.cpp:2124
InventoryItem for skill.
Definition: Skill.h:48
const char * name()
Python tuple.
Definition: PyRep.h:567
void UpdateSkillQueueEndTime()
Definition: Character.cpp:1166
int64 EndTime(uint32 currentSP, uint32 nextSP, uint8 SPMin, int64 timeNow)
Definition: EvEMath.cpp:46
const uint8 MAXSKILLLEVEL
Definition: EvEMath.h:19
X * get() const
Definition: RefPtr.h:213
unsigned __int32 uint32
Definition: eve-compat.h:50
Client * m_pClient
Definition: Character.h:437
bool LoadPausedSkillQueue(uint32 charID, SkillQueue &into)
double GetFileTimeNow()
Definition: utils_time.cpp:84
signed __int64 int64
Definition: eve-compat.h:51
uint16 typeID() const

Here is the call graph for this function:

uint32 Character::loginTime ( ) const
inline

Definition at line 290 of file Character.h.

References m_loginTime.

290 { return m_loginTime; }
uint32 m_loginTime
Definition: Character.h:452
void Character::LogKill ( CharKillData  data)
inline

Definition at line 349 of file Character.h.

References m_db, and ServiceDB::SaveKillOrLoss().

349 { m_db.SaveKillOrLoss(data); }
CharacterDB m_db
Definition: Character.h:434
static void SaveKillOrLoss(CharKillData &data)
Definition: ServiceDB.cpp:212

Here is the call graph for this function:

uint32 Character::logonMinutes ( ) const
inline

Definition at line 291 of file Character.h.

References CharacterData::logonMinutes, and m_charData.

291 { return m_charData.logonMinutes; }
CharacterData m_charData
Definition: Character.h:440
uint32 logonMinutes
void Character::LogOut ( )

Definition at line 336 of file Character.cpp.

References CharFleetData::fleetID, Client::IsCharCreation(), IsFleetID, CharacterData::locationID, m_charData, m_db, m_fleetData, InventoryItem::m_itemID, m_pClient, InventoryItem::pInventory, SaveFullCharacter(), sConsole, sDataMgr, CharacterDB::SetLogOffTime(), sFltSvc, sItemFactory, and Inventory::Unload().

Referenced by Client::~Client().

337 {
338 
341  if (!sConsole.IsShutdown())
343  sFltSvc.LeaveFleet(m_pClient);
344 
345  pInventory->Unload();
346 
347  if (!m_pClient->IsCharCreation()) {
348  sItemFactory.RemoveItem(m_itemID);
349  if (sDataMgr.IsStation(m_charData.locationID))
350  ; // do we need to do anything here?
351  }
352 }
CharacterDB m_db
Definition: Character.h:434
#define sConsole
bool IsCharCreation()
Definition: Client.h:433
void SetLogOffTime(uint32 charID)
void Unload()
Definition: Inventory.cpp:62
#define sFltSvc
Definition: FleetService.h:147
CharacterData m_charData
Definition: Character.h:440
void SaveFullCharacter()
Definition: Character.cpp:1266
Inventory * pInventory
CharFleetData m_fleetData
Definition: Character.h:441
Client * m_pClient
Definition: Character.h:437
#define IsFleetID(itemID)
Definition: EVE_Defines.h:225
#define sItemFactory
Definition: ItemFactory.h:165
#define sDataMgr

Here is the call graph for this function:

Here is the caller graph for this function:

uint16 Character::OnlineTime ( )

Definition at line 1296 of file Character.cpp.

References GetFileTimeNow(), CharacterData::loginTime, and m_charData.

1297 {
1298  double onlineTime = m_charData.loginTime - GetFileTimeNow();
1299  onlineTime /= 10000000;
1300  onlineTime -= 11644473600;
1301  onlineTime /= 60;
1302  return (uint16)onlineTime;
1303 }
CharacterData m_charData
Definition: Character.h:440
double GetFileTimeNow()
Definition: utils_time.cpp:84
unsigned __int16 uint16
Definition: eve-compat.h:48

Here is the call graph for this function:

void Character::PauseSkillQueue ( )

Definition at line 748 of file Character.cpp.

References _log, CancelSkillInTraining(), m_db, InventoryItem::m_itemID, m_skillQueue, InventoryItem::name(), CharacterDB::SavePausedSkillQueue(), and UpdateSkillQueueEndTime().

748  {
750 
751  CancelSkillInTraining(true);
752 
753  m_skillQueue.clear();
755  _log(SKILL__QUEUE, "%s(%u) Skill Queue Paused", name(), m_itemID);
756 }
CharacterDB m_db
Definition: Character.h:434
#define _log(type, fmt,...)
Definition: logsys.h:124
void CancelSkillInTraining(bool update=false)
Definition: Character.cpp:816
SkillQueue m_skillQueue
Definition: Character.h:445
const char * name()
void UpdateSkillQueueEndTime()
Definition: Character.cpp:1166
bool SavePausedSkillQueue(uint32 charID, SkillQueue &queue)

Here is the call graph for this function:

void Character::PayBounty ( CharacterRef  cRef)

Definition at line 1281 of file Character.cpp.

References Journal::EntryType::Bounty, bounty(), corpCONCORD, InventoryItem::itemID(), InventoryItem::itemName(), InventoryItem::m_itemID, Stat::pcBounties, sStatMgr, and AccountService::TranserFunds().

Referenced by ShipSE::Killed().

1282 {
1283  std::string reason = "Bounty for the killing of ";
1284  reason += cRef->itemName();
1286  // add data to StatisticMgr
1287  sStatMgr.Add(Stat::pcBounties, cRef->bounty());
1288 }
#define sStatMgr
Definition: StatisticMgr.h:68
float bounty() const
Definition: Character.h:287
static void TranserFunds(uint32 fromID, uint32 toID, double amount, std::string reason="", uint8 entryTypeID=Journal::EntryType::Undefined, uint32 referenceID=0, uint16 fromKey=Account::KeyType::Cash, uint16 toKey=Account::KeyType::Cash, Client *pClient=nullptr)
const std::string & itemName() const
uint32 itemID() const
Definition: InventoryItem.h:98

Here is the call graph for this function:

Here is the caller graph for this function:

uint32 Character::PickAlternateShip ( uint32  locationID)

Definition at line 457 of file Character.cpp.

References m_db, InventoryItem::m_itemID, and CharacterDB::PickAlternateShip().

Referenced by Client::PickAlternateShip().

458 {
460 }
CharacterDB m_db
Definition: Character.h:434
uint32 PickAlternateShip(uint32 charID, uint32 locationID)
uint32 locationID() const

Here is the call graph for this function:

Here is the caller graph for this function:

void Character::ProcessEffects ( ShipItem pShip)

Definition at line 498 of file Character.cpp.

References _log, fxData::action, flagSkill, Inventory::GetItemsByFlag(), FX::Action::Invalid, InventoryItem::pInventory, Effect::preExpression, sFxDataMgr, sFxProc, and fxData::srcRef.

Referenced by ShipItem::ProcessEffects().

499 {
500  _log(EFFECTS__TRACE, "Character::ProcessEffects()");
501  //ResetModifiers();
502 
503  // 427 total skills. this should be fairly fast...it is.
504  std::vector<InventoryItemRef> allSkills;
505  pInventory->GetItemsByFlag(flagSkill, allSkills);
506 
507  Effect curEffect = Effect();
508  std::vector<TypeEffects> typeFx;
509  for (auto curSkill : allSkills) {
510  typeFx.clear();
511  sFxDataMgr.GetTypeEffect(curSkill->typeID(), typeFx);
512  for (auto curFx : typeFx) {
513  curEffect = sFxDataMgr.GetEffect(curFx.effectID);
514  fxData data = fxData();
516  data.srcRef = curSkill;
517  sFxProc.ParseExpression(this, sFxDataMgr.GetExpression(curEffect.preExpression), data);
518  }
519  }
520  // apply processed char effects
521  sFxProc.ApplyEffects(this, this, pShip);
522 }
uint16 preExpression
Definition: EffectsData.h:26
#define _log(type, fmt,...)
Definition: logsys.h:124
InventoryItemRef srcRef
Definition: EffectsData.h:78
uint32 GetItemsByFlag(EVEItemFlags flag, std::vector< InventoryItemRef > &items) const
Definition: Inventory.cpp:458
Inventory * pInventory
#define sFxDataMgr
uint8 action
Definition: EffectsData.h:73
#define sFxProc

Here is the call graph for this function:

Here is the caller graph for this function:

uint8 Character::race ( ) const
inline

Definition at line 278 of file Character.h.

References ItemType::race(), and type().

Referenced by CorporationDB::AddCorporation(), and Client::SpawnNewRookieShip().

278 { return type().race(); }
const CharacterType & type() const
Definition: Character.h:276
uint8 race() const
Definition: ItemType.h:72

Here is the call graph for this function:

Here is the caller graph for this function:

uint32 Character::regionID ( ) const
inline

Definition at line 329 of file Character.h.

References m_charData, and CharacterData::regionID.

Referenced by Client::UpdateSession().

329 { return m_charData.regionID; }
CharacterData m_charData
Definition: Character.h:440

Here is the caller graph for this function:

void Character::RemoveFromQueue ( SkillRef  sRef)

Definition at line 642 of file Character.cpp.

References AttrSkillLevel, m_skillQueue, and SkillQueueLoop().

Referenced by Command_giveskill().

643 {
644  SkillQueue::iterator itr = m_skillQueue.begin();
645  for (; itr != m_skillQueue.end(); ++itr) {
646  if (sRef->typeID() == itr->typeID)
647  if (sRef->GetAttribute(AttrSkillLevel).get_uint32() >= itr->level)
648  m_skillQueue.erase(itr);
649  }
650  SkillQueueLoop();
651 }
SkillQueue m_skillQueue
Definition: Character.h:445
void SkillQueueLoop(bool update=true)
Definition: Character.cpp:998

Here is the call graph for this function:

Here is the caller graph for this function:

void Character::ResetClone ( )

Definition at line 1252 of file Character.cpp.

References CharacterDB::ChangeCloneType(), itemCloneAlpha, m_db, and InventoryItem::m_itemID.

Referenced by Client::ResetAfterPodded().

1253 {
1255 }
CharacterDB m_db
Definition: Character.h:434
bool ChangeCloneType(uint32 charID, uint32 typeID)

Here is the call graph for this function:

Here is the caller graph for this function:

void Character::ResetModifiers ( )

Definition at line 485 of file Character.cpp.

References _log, InventoryItem::ClearModifiers(), flagSkill, Inventory::GetItemsByFlag(), InventoryItem::pInventory, and InventoryItem::ResetAttributes().

Referenced by ShipItem::ProcessEffects(), and ShipItem::ResetEffects().

486 {
487  _log(EFFECTS__TRACE, "Character::ResetModifiers()");
488  ClearModifiers();
489  ResetAttributes();
490  std::vector<InventoryItemRef> allSkills;
491  pInventory->GetItemsByFlag(flagSkill, allSkills);
492  for (auto curSkill : allSkills) {
493  curSkill->ClearModifiers();
494  curSkill->ResetAttributes();
495  }
496 }
#define _log(type, fmt,...)
Definition: logsys.h:124
uint32 GetItemsByFlag(EVEItemFlags flag, std::vector< InventoryItemRef > &items) const
Definition: Inventory.cpp:458
Inventory * pInventory

Here is the call graph for this function:

Here is the caller graph for this function:

int64 Character::rolesAtAll ( ) const
inline

Definition at line 311 of file Character.h.

References m_corpData, and CorpData::rolesAtAll.

311 { return m_corpData.rolesAtAll; }
CorpData m_corpData
Definition: Character.h:439
int64 rolesAtAll
int64 Character::rolesAtBase ( ) const
inline

Definition at line 312 of file Character.h.

References m_corpData, and CorpData::rolesAtBase.

312 { return m_corpData.rolesAtBase; }
CorpData m_corpData
Definition: Character.h:439
int64 rolesAtBase
int64 Character::rolesAtHQ ( ) const
inline

Definition at line 313 of file Character.h.

References m_corpData, and CorpData::rolesAtHQ.

313 { return m_corpData.rolesAtHQ; }
CorpData m_corpData
Definition: Character.h:439
int64 rolesAtHQ
int64 Character::rolesAtOther ( ) const
inline

Definition at line 314 of file Character.h.

References m_corpData, and CorpData::rolesAtOther.

314 { return m_corpData.rolesAtOther; }
CorpData m_corpData
Definition: Character.h:439
int64 rolesAtOther
void Character::SaveBookMarks ( )

Definition at line 1353 of file Character.cpp.

Referenced by ~Character().

1354 {
1355 
1356 }

Here is the caller graph for this function:

void Character::SaveCertificates ( )

Definition at line 1341 of file Character.cpp.

References _log, m_cdb, m_certificates, InventoryItem::m_itemID, and CertificateMgrDB::SaveCertificates().

Referenced by ~Character().

1341  {
1342  _log( CHARACTER__INFO, "Saving Certificates of character %u", m_itemID );
1344 }
#define _log(type, fmt,...)
Definition: logsys.h:124
bool SaveCertificates(uint32 characterID, const CertMap &from)
CertificateMgrDB m_cdb
Definition: Character.h:433
CertMap m_certificates
Definition: Character.h:448

Here is the call graph for this function:

Here is the caller graph for this function:

void Character::SaveCharacter ( )

Definition at line 1257 of file Character.cpp.

References _log, GetTotalSP(), m_charData, m_db, InventoryItem::m_itemID, CharacterDB::SaveCharacter(), and SetLogonMinutes().

Referenced by AlterBalance(), Client::ResetAfterPodded(), SaveFullCharacter(), SetDescription(), SetLocation(), and SkillQueueLoop().

1257  {
1258  _log( CHARACTER__INFO, "Saving character info for %u.", m_itemID );
1259 
1260  // update skill points before save
1261  GetTotalSP();
1262  SetLogonMinutes();
1264 }
CharacterDB m_db
Definition: Character.h:434
#define _log(type, fmt,...)
Definition: logsys.h:124
static bool SaveCharacter(uint32 charID, const CharacterData &data)
Definition: CharacterDB.cpp:66
void SetLogonMinutes()
Definition: Character.cpp:1306
uint32 GetTotalSP()
Definition: Character.cpp:677
CharacterData m_charData
Definition: Character.h:440

Here is the call graph for this function:

Here is the caller graph for this function:

void Character::SaveFullCharacter ( )

Definition at line 1266 of file Character.cpp.

References _log, AttrSkillPoints, Skill::GetCurrentSP(), m_corpData, m_db, m_inTraining, InventoryItem::m_itemID, m_skillQueue, InventoryItem::SaveAttributes(), SaveCharacter(), CharacterDB::SaveCorpData(), InventoryItem::SaveItem(), SaveSkillQueue(), and InventoryItem::SetAttribute().

Referenced by LogOut(), and ~Character().

1266  {
1267  _log( CHARACTER__INFO, "Saving full character info for %u.", m_itemID );
1268  //GetTotalSP();
1269  SaveCharacter();
1271  SaveAttributes();
1272 
1273  if (m_inTraining != nullptr) {
1274  m_inTraining->SetAttribute(AttrSkillPoints, m_inTraining->GetCurrentSP(this, m_skillQueue.front().startTime), false);
1276  }
1277 
1278  SaveSkillQueue();
1279 }
CharacterDB m_db
Definition: Character.h:434
#define _log(type, fmt,...)
Definition: logsys.h:124
static bool SaveCorpData(uint32 charID, const CorpData &data)
CorpData m_corpData
Definition: Character.h:439
SkillQueue m_skillQueue
Definition: Character.h:445
bool SaveAttributes()
void SetAttribute(uint16 attrID, int num, bool notify=true)
void SaveCharacter()
Definition: Character.cpp:1257
uint32 GetCurrentSP(Character *ch, int64 startTime=0)
Definition: Skill.cpp:80
Skill * m_inTraining
Definition: Character.h:444
void SaveSkillQueue()
Definition: Character.cpp:546

Here is the call graph for this function:

Here is the caller graph for this function:

void Character::SaveSkillHistory ( uint16  eventID,
double  logDate,
uint32  characterID,
uint16  skillTypeID,
uint8  skillLevel,
uint32  absolutePoints 
)

Definition at line 689 of file Character.cpp.

References m_db, CharacterDB::SaveSkillHistory(), and sDataMgr.

Referenced by AddToSkillQueue(), CancelSkillInTraining(), Command_giveskill(), InjectSkillIntoBrain(), LoadPausedSkillQueue(), and SkillQueueLoop().

690 {
691  if (absolutePoints < 1)
692  return;
693  if (logDate < 1)
694  return;
695  if (!sDataMgr.IsSkillTypeID(skillTypeID))
696  return;
697  m_db.SaveSkillHistory(eventID, logDate, characterID, skillTypeID, skillLevel, absolutePoints);
698 }
CharacterDB m_db
Definition: Character.h:434
#define sDataMgr
void SaveSkillHistory(uint16 eventID, double logDate, uint32 characterID, uint32 skillTypeID, uint8 skillLevel, uint32 absolutePoints)

Here is the call graph for this function:

Here is the caller graph for this function:

void Character::SaveSkillQueue ( )

Definition at line 546 of file Character.cpp.

References _log, m_db, InventoryItem::m_itemID, m_skillQueue, InventoryItem::name(), and CharacterDB::SaveSkillQueue().

Referenced by SaveFullCharacter(), and UpdateSkillQueueEndTime().

546  {
547  _log(SKILL__QUEUE, "%s(%u): Saving skill queue.", name(), m_itemID );
549 }
CharacterDB m_db
Definition: Character.h:434
#define _log(type, fmt,...)
Definition: logsys.h:124
bool SaveSkillQueue(uint32 charID, SkillQueue &queue)
SkillQueue m_skillQueue
Definition: Character.h:445
const char * name()

Here is the call graph for this function:

Here is the caller graph for this function:

uint32 Character::schoolID ( ) const
inline

Definition at line 334 of file Character.h.

References m_charData, and CharacterData::schoolID.

334 { return m_charData.schoolID; }
CharacterData m_charData
Definition: Character.h:440
void Character::secStatusChange ( float  amount)
inline

Definition at line 294 of file Character.h.

References m_charData, and CharacterData::securityRating.

Referenced by SystemEntity::AwardSecurityStatus(), and ShipSE::Killed().

294 { m_charData.securityRating += amount; }
CharacterData m_charData
Definition: Character.h:440
float securityRating

Here is the caller graph for this function:

PyTuple * Character::SendSkillQueue ( )

Definition at line 660 of file Character.cpp.

References PyList::AddItem(), m_freePoints, m_skillQueue, and PyTuple::SetItem().

660  {
661  // get current skill queue
662  PyList *list = new PyList();
663  for (auto cur : m_skillQueue) {
664  SkillQueue_Element el;
665  el.typeID = cur.typeID;
666  el.level = cur.level;
667  list->AddItem( el.Encode() );
668  }
669 
670  // and encapsulate it in a tuple with the free points
671  PyTuple *tuple = new PyTuple(2);
672  tuple->SetItem(0, list);
673  tuple->SetItem(1, new PyInt(m_freePoints));
674  return tuple;
675 }
SkillQueue m_skillQueue
Definition: Character.h:445
Python tuple.
Definition: PyRep.h:567
void AddItem(PyRep *i)
Definition: PyRep.h:701
uint32 m_freePoints
Definition: Character.h:446
void SetItem(size_t index, PyRep *object)
Stores Python object.
Definition: PyRep.h:610
Python integer.
Definition: PyRep.h:231
Python list.
Definition: PyRep.h:639

Here is the call graph for this function:

void Character::SetAccountKey ( int32  accountKey)
Todo:
remove this in favor of updating data when changed

Definition at line 435 of file Character.cpp.

References CorpData::corpAccountKey, m_corpData, m_db, InventoryItem::m_itemID, m_pClient, CharacterDB::SaveCorpData(), and Client::UpdateCorpSession().

436 {
437  m_corpData.corpAccountKey = accountKey;
441 }
CharacterDB m_db
Definition: Character.h:434
static bool SaveCorpData(uint32 charID, const CorpData &data)
CorpData m_corpData
Definition: Character.h:439
void UpdateCorpSession(CorpData &data)
Definition: Client.cpp:1970
Client * m_pClient
Definition: Character.h:437
int16 corpAccountKey

Here is the call graph for this function:

void Character::SetActivePod ( uint32  podID)

Definition at line 1246 of file Character.cpp.

References CharacterData::capsuleID, m_charData, m_db, InventoryItem::m_itemID, and CharacterDB::SetCurrentPod().

Referenced by Client::CreateNewPod().

1247 {
1248  m_charData.capsuleID = podID;
1249  m_db.SetCurrentPod(m_itemID, podID);
1250 }
CharacterDB m_db
Definition: Character.h:434
CharacterData m_charData
Definition: Character.h:440
void SetCurrentPod(uint32 charID, uint32 podID)

Here is the call graph for this function:

Here is the caller graph for this function:

void Character::SetActiveShip ( uint32  shipID)

Definition at line 1240 of file Character.cpp.

References m_charData, m_db, InventoryItem::m_itemID, CharacterDB::SetCurrentShip(), CharacterData::shipID, and shipID().

Referenced by Client::SetShip().

1241 {
1244 }
CharacterDB m_db
Definition: Character.h:434
uint32 shipID() const
Definition: Character.h:341
CharacterData m_charData
Definition: Character.h:440
void SetCurrentShip(uint32 charID, uint32 shipID)

Here is the call graph for this function:

Here is the caller graph for this function:

void Character::SetBaseID ( uint32  baseID)
Todo:
remove this in favor of updating data when changed

Definition at line 443 of file Character.cpp.

References CorpData::baseID, baseID, m_corpData, m_db, InventoryItem::m_itemID, m_pClient, CharacterDB::SaveCorpData(), and Client::UpdateCorpSession().

444 {
449 }
CharacterDB m_db
Definition: Character.h:434
static bool SaveCorpData(uint32 charID, const CorpData &data)
CorpData m_corpData
Definition: Character.h:439
void UpdateCorpSession(CorpData &data)
Definition: Client.cpp:1970
uint32 baseID
Client * m_pClient
Definition: Character.h:437

Here is the call graph for this function:

void Character::SetClient ( Client pClient)
inline

Definition at line 231 of file Character.h.

References m_pClient.

Referenced by Client::SelectCharacter().

231 { m_pClient = pClient; }
Client * m_pClient
Definition: Character.h:437

Here is the caller graph for this function:

void Character::SetCorpHQ ( uint32  stationID)
inline

Definition at line 307 of file Character.h.

References CorpData::corpHQ, m_corpData, stationID(), and UpdateCorpData().

uint32 corpHQ
CorpData m_corpData
Definition: Character.h:439
uint32 stationID() const
Definition: Character.h:326
void UpdateCorpData(CorpData &data)
Definition: Character.cpp:451

Here is the call graph for this function:

void Character::SetDescription ( const char *  newDescription)

Definition at line 421 of file Character.cpp.

References CharacterData::description, m_charData, and SaveCharacter().

421  {
422  m_charData.description = newDescription;
423  SaveCharacter();
424 }
CharacterData m_charData
Definition: Character.h:440
std::string description
void SaveCharacter()
Definition: Character.cpp:1257

Here is the call graph for this function:

void Character::SetFleetData ( CharFleetData fleet)

Definition at line 462 of file Character.cpp.

References LSC::fleet, m_fleetData, m_pClient, and Client::UpdateFleetSession().

Referenced by FleetService::AddMember(), FleetService::CreateFleet(), FleetService::LeaveFleet(), and FleetService::UpdateMember().

463 {
464  m_fleetData = fleet;
465  //if ((fleet.joinTime) and (m_fleetJoinTime != fleet.joinTime))
466  // m_fleetJoinTime = fleet.joinTime;
467 
469 }
void UpdateFleetSession(CharFleetData &fleet)
Definition: Client.cpp:1992
CharFleetData m_fleetData
Definition: Character.h:441
Client * m_pClient
Definition: Character.h:437

Here is the call graph for this function:

Here is the caller graph for this function:

void Character::SetLoaded ( bool  set = false)
inline

Definition at line 360 of file Character.h.

References m_loaded.

360 { m_loaded = set; }
bool m_loaded
Definition: Character.h:450
void Character::SetLocation ( uint32  stationID,
SystemData data 
)

Definition at line 412 of file Character.cpp.

References CharacterData::constellationID, SystemData::constellationID, CharacterData::locationID, m_charData, CharacterData::regionID, SystemData::regionID, SaveCharacter(), CharacterData::solarSystemID, CharacterData::stationID, stationID(), and SystemData::systemID.

Referenced by Client::MoveToLocation().

412  {
418  SaveCharacter();
419 }
CharacterData m_charData
Definition: Character.h:440
uint32 stationID() const
Definition: Character.h:326
uint32 solarSystemID
void SaveCharacter()
Definition: Character.cpp:1257
uint32 constellationID
uint32 systemID
uint32 regionID
uint32 constellationID

Here is the call graph for this function:

Here is the caller graph for this function:

void Character::SetLoginTime ( )

Definition at line 1290 of file Character.cpp.

References m_db, InventoryItem::m_itemID, m_loginTime, sEntityList, and CharacterDB::SetLogInTime().

Referenced by Client::SelectCharacter().

1291 {
1292  m_loginTime = sEntityList.GetStamp();
1294 }
CharacterDB m_db
Definition: Character.h:434
#define sEntityList
Definition: EntityList.h:208
void SetLogInTime(uint32 charID)
uint32 m_loginTime
Definition: Character.h:452

Here is the call graph for this function:

Here is the caller graph for this function:

void Character::SetLogonMinutes ( )

Definition at line 1306 of file Character.cpp.

References CharacterData::logonMinutes, m_charData, m_loginTime, and sEntityList.

Referenced by Client::ProcessClient(), and SaveCharacter().

1306  {
1307  // get login time and set _logonMinutes -allan
1308  uint16 loginMinutes = (sEntityList.GetStamp() - m_loginTime) /60;
1309 
1310  // some checks are done < 1m, so if this check has no minutes, keep original time and exit
1311  if (loginMinutes > 0) {
1312  m_charData.logonMinutes += loginMinutes;
1313  m_loginTime = sEntityList.GetStamp();
1314  }
1315 }
#define sEntityList
Definition: EntityList.h:208
CharacterData m_charData
Definition: Character.h:440
uint32 logonMinutes
unsigned __int16 uint16
Definition: eve-compat.h:48
uint32 m_loginTime
Definition: Character.h:452

Here is the caller graph for this function:

void Character::SetStanding ( uint32  fromID,
uint32  toID,
float  standing 
)

Definition at line 1388 of file Character.cpp.

References m_pClient, Client::SendNotification(), and StandingDB::SetStanding().

1388  {
1389  StandingDB::SetStanding(fromID, toID, standing);
1390  PyTuple* payload = new PyTuple(0);
1391  m_pClient->SendNotification("OnStandingSet", "charid", payload, false);
1392 }
void SendNotification(const PyAddress &dest, EVENotificationStream &noti, bool seq=true)
Definition: Client.cpp:2245
Python tuple.
Definition: PyRep.h:567
Client * m_pClient
Definition: Character.h:437
static void SetStanding(uint32 fromID, uint32 toID, float standing)
Definition: StandingDB.cpp:157

Here is the call graph for this function:

uint32 Character::shipID ( ) const
inline

Definition at line 341 of file Character.h.

References m_charData, and CharacterData::shipID.

Referenced by SetActiveShip().

341 { return m_charData.shipID; }
CharacterData m_charData
Definition: Character.h:440

Here is the caller graph for this function:

void Character::SkillQueueLoop ( bool  update = true)

Definition at line 998 of file Character.cpp.

References _log, PyList::AddItemInt(), AttrSkillLevel, AttrSkillPoints, CancelSkillInTraining(), EVEDB::invGroups::Corporation_Management, PyList::empty(), QueuedSkill::endTime, flagSkill, flagSkillInTraining, EvE::FormatTime(), RefPtr< X >::get(), Skill::GetCurrentSP(), GetFileTimeNow(), GetSkill(), Skill::GetSPForLevel(), GetTimeMSeconds(), InventoryItem::groupID(), is_log_enabled, Client::IsInSpace(), Client::IsLogin(), InventoryItem::itemID(), QueuedSkill::level, m_inTraining, InventoryItem::m_itemID, m_pClient, m_skillQueue, InventoryItem::name(), EVEDB::invGroups::Planet_Management, Client::QueueDestinyEvent(), EvESkill::Event::QueueTrainingCompleted, SaveCharacter(), InventoryItem::SaveItem(), SaveSkillHistory(), EvE::Time::Second, Client::SendInfoModalMsg(), InventoryItem::SetAttribute(), InventoryItem::SetFlag(), PyList::size(), EVEDB::invGroups::Social, QueuedSkill::startTime, EVEDB::invGroups::Trade, EvESkill::Event::TrainingStarted, QueuedSkill::typeID, InventoryItem::typeID(), and UpdateSkillQueueEndTime().

Referenced by Client::ProcessClient(), RemoveFromQueue(), and Client::SelectCharacter().

999 {
1000  double begin(GetTimeMSeconds());
1001  _log(SKILL__QUEUE, "%s(%u) calling SkillQueueLoop() - update %s", name(), m_itemID, update?"true":"false");
1002 
1003  // anything to do here?
1004  if (m_skillQueue.empty())
1005  if (m_inTraining == nullptr)
1006  return;
1007 
1008  if (m_inTraining->typeID() != m_skillQueue.front().typeID)
1009  CancelSkillInTraining(update);
1010 
1011  // at this point, there is a skill in training, and it is front of queue
1012  int64 curTime(GetFileTimeNow());
1013  if (m_skillQueue.front().endTime > curTime) {
1014  float timeLeft = (m_skillQueue.front().endTime - curTime) / EvE::Time::Second;
1015  const char* formatedTime = EvE::FormatTime(timeLeft);
1016  _log(SKILL__INFO, "%s still training. %s remaining.", m_inTraining->name(), formatedTime);
1018  return;
1019  }
1020 
1021  PyList* list = new PyList();
1022  bool sent(false), multiple(false);
1023  Skill* skill(nullptr);
1024  while (!m_skillQueue.empty()) {
1025  QueuedSkill qs = m_skillQueue.front();
1026  skill = GetSkill( qs.typeID ).get();
1027  if ((qs.typeID == 0) or (skill == nullptr)) {
1028  _log( SKILL__WARNING, "SkillID %u to train was not found. Erase and continue.", qs.typeID);
1029  m_skillQueue.erase( m_skillQueue.begin() );
1030  continue;
1031  }
1032 
1033  _log( SKILL__INFO, "Starting checks for %s.", skill->name());
1034 
1035  if (qs.endTime == 0) {
1036  // this should not hit at this point.
1037  _log(SKILL__ERROR, "endTime wasnt set. Erase from queue and continue.");
1038  skill->SetFlag(flagSkill, true);
1039  skill->SaveItem();
1040  m_skillQueue.erase( m_skillQueue.begin() );
1041  skill = nullptr;
1042  m_inTraining = nullptr;
1043  continue;
1044  }
1045 
1046  if (qs.endTime < curTime) {
1047  // skill training has completed.
1048  uint32 currentSP = skill->GetSPForLevel(qs.level);
1049  SaveSkillHistory(EvESkill::Event::QueueTrainingCompleted, qs.endTime, m_itemID, skill->typeID(), qs.level, currentSP);
1050 
1051  if (is_log_enabled(SKILL__INFO))
1052  _log(SKILL__INFO, "Queued Training completed for level: %u", qs.level);
1053 
1054  // update attribs and save
1055  skill->SetAttribute(AttrSkillLevel, qs.level, update);
1056  skill->SetAttribute(AttrSkillPoints, currentSP, update);
1057  skill->SetFlag(flagSkill, update);
1058  skill->SaveItem();
1059 
1060  // remove completed skill level from queue
1061  m_skillQueue.erase( m_skillQueue.begin() );
1062 
1063  // notify client
1064  if (update) {
1065  PyTuple* tmp(nullptr);
1066  if (m_skillQueue.empty()) {
1067  // only one skill to update
1068  OnSkillTrained ost;
1069  ost.itemID = skill->itemID();
1070  tmp = ost.Encode();
1071  } else {
1072  // another skill in the works. send combined update
1073  SkillRef sref = GetSkill(m_skillQueue.front().typeID);
1074  if (sref.get() == nullptr) {
1075  // that shit didnt work...revert to multiple packets
1076  OnSkillTrained ost;
1077  ost.itemID = skill->itemID();
1078  tmp = ost.Encode();
1079  } else {
1080  multiple = true;
1081  // queue skill switching uses the following to reduce data sent
1082  //def OnSkillSwitched(self, oldSkillID, newSkillID, ETA):
1083  OnSkillSwitched oss;
1084  oss.oldSkillID = skill->itemID();
1085  oss.newSkillID = sref->itemID();
1086  oss.ETA = m_skillQueue.front().endTime;
1087  tmp = oss.Encode();
1088  }
1089  }
1091  } else if (m_pClient->IsLogin())
1092  // for login, use OnMultipleSkillsTrained[]
1093  list->AddItemInt(skill->itemID());
1094 
1095  if (m_pClient->IsInSpace() and update) {
1096  switch (skill->groupID()) {
1101  ; // do nothing for these.
1102  } break;
1103  default: {
1104  if (!sent) {
1105  sent = true;
1106  m_pClient->SendInfoModalMsg("Completed Skill Training.<br>Your ship will update to the new level the next time you undock.");
1107  }
1108  } break;
1109  }
1110  }
1111 
1112  // clear variables and continue
1113  skill = nullptr;
1114  m_inTraining = nullptr;
1115  continue;
1116  }
1117 
1118  // at this point, there is at least one skill queued, and nothing currently training.
1119  uint32 nextSP(skill->GetSPForLevel(qs.level));
1121  skill->SetFlag(flagSkillInTraining, true);
1122  skill->SaveItem();
1123  m_inTraining = skill;
1124 
1125  if (is_log_enabled(SKILL__INFO)) {
1126  float timeLeft = (qs.endTime - curTime) / EvE::Time::Second;
1127  const char* formatedTime = EvE::FormatTime(timeLeft);
1128  _log(SKILL__INFO, "Training started. %s to train %u sp for level %u", \
1129  formatedTime, nextSP - skill->GetCurrentSP(this, qs.startTime), qs.level);
1130  }
1131 
1132  if (!multiple) {
1133  OnSkillStartTraining osst;
1134  osst.itemID = skill->itemID();
1135  osst.endOfTraining = qs.endTime;
1136  PyTuple* tmp = osst.Encode();
1138  }
1139 
1140  break;
1141  }
1142 
1144  SaveCharacter();
1145 
1146  if (m_pClient->IsLogin()) {
1147  PyTuple* tmp(nullptr);
1148  if (!list->empty()) {
1149  if (list->size() > 1) {
1150  OnMultipleSkillsTrained omst;
1151  omst.skillList = list;
1152  tmp = omst.Encode();
1153  }
1154  } else if (skill != nullptr) {
1155  OnSkillTrained ost;
1156  ost.itemID = skill->itemID();
1157  tmp = ost.Encode();
1158  }
1159 
1161  }
1162 
1163  _log(SKILL__QUEUE, "SkillQueueLoop() completed in %.4fms", (GetTimeMSeconds() - begin));
1164 }
bool IsLogin()
Definition: Client.h:235
SkillRef GetSkill(uint16 skillTypeID) const
Definition: Character.cpp:566
#define _log(type, fmt,...)
Definition: logsys.h:124
void SaveSkillHistory(uint16 eventID, double logDate, uint32 characterID, uint16 skillTypeID, uint8 skillLevel, uint32 absolutePoints)
Definition: Character.cpp:689
void CancelSkillInTraining(bool update=false)
Definition: Character.cpp:816
uint8 level
Definition: CharacterDB.h:73
SkillQueue m_skillQueue
Definition: Character.h:445
void QueueDestinyEvent(PyTuple **multiEvent)
Definition: Client.cpp:2124
void SendInfoModalMsg(const char *fmt,...)
Definition: Client.cpp:2756
InventoryItem for skill.
Definition: Skill.h:48
const char * name()
bool IsInSpace()
Definition: Client.h:228
Python tuple.
Definition: PyRep.h:567
uint32 GetSPForLevel(uint8 level)
Definition: Skill.cpp:76
void UpdateSkillQueueEndTime()
Definition: Character.cpp:1166
#define is_log_enabled(type)
Definition: logsys.h:78
int64 endTime
Definition: CharacterDB.h:75
double GetTimeMSeconds()
Definition: utils_time.cpp:104
void SaveCharacter()
Definition: Character.cpp:1257
X * get() const
Definition: RefPtr.h:213
void AddItemInt(int32 intval)
Definition: PyRep.h:702
int64 startTime
Definition: CharacterDB.h:76
unsigned __int32 uint32
Definition: eve-compat.h:50
Client * m_pClient
Definition: Character.h:437
double GetFileTimeNow()
Definition: utils_time.cpp:84
Skill * m_inTraining
Definition: Character.h:444
signed __int64 int64
Definition: eve-compat.h:51
uint16 typeID
Definition: CharacterDB.h:74
const char * FormatTime(int64 time=-1)
Definition: misc.cpp:204
size_t size() const
Definition: PyRep.h:663
uint16 typeID() const
bool empty() const
Definition: PyRep.h:664
Python list.
Definition: PyRep.h:639
Reference-counting-based smart pointer.
Definition: RefPtr.h:133

Here is the call graph for this function:

Here is the caller graph for this function:

uint32 Character::solarSystemID ( ) const
inline

Definition at line 327 of file Character.h.

References m_charData, and CharacterData::solarSystemID.

Referenced by Client::CreateNewPod(), and Client::UpdateSession().

327 { return m_charData.solarSystemID; }
CharacterData m_charData
Definition: Character.h:440
uint32 solarSystemID

Here is the caller graph for this function:

CharacterRef Character::Spawn ( CharacterData charData,
CorpData corpData 
)
static

Definition at line 321 of file Character.cpp.

References _log, IsCharacterID, Load(), CharacterDB::NewCharacter(), sItemFactory, and CharacterData::typeID.

Referenced by ItemFactory::SpawnCharacter().

321  {
322  // make sure it's a character
323  const CharacterType *ct = sItemFactory.GetCharacterType(charData.typeID);
324  if (ct == nullptr)
325  return CharacterRef(nullptr);
326 
327  uint32 characterID(CharacterDB::NewCharacter(charData, corpData));
328  if (!IsCharacterID(characterID)) {
329  _log(CHARACTER__ERROR, "Failed to get itemID for new character.");
330  return CharacterRef(nullptr);
331  }
332 
333  return Character::Load(characterID);
334 }
#define _log(type, fmt,...)
Definition: logsys.h:124
RefPtr< Character > CharacterRef
Definition: ItemRef.h:63
#define IsCharacterID(itemID)
Definition: EVE_Defines.h:206
unsigned __int32 uint32
Definition: eve-compat.h:50
static uint32 NewCharacter(const CharacterData &data, const CorpData &corpData)
Definition: CharacterDB.cpp:33
#define sItemFactory
Definition: ItemFactory.h:165
static CharacterRef Load(uint32 characterID)
Definition: Character.cpp:265

Here is the call graph for this function:

Here is the caller graph for this function:

int32 Character::squadID ( ) const
inline

Definition at line 320 of file Character.h.

References m_fleetData, and CharFleetData::squadID.

Referenced by FleetService::AddMember(), Command_showsession(), FleetService::FleetBroadcast(), FleetService::RemoveMember(), and FleetService::UpdateMember().

320 { return m_fleetData.squadID; }
CharFleetData m_fleetData
Definition: Character.h:441

Here is the caller graph for this function:

int64 Character::startDateTime ( ) const
inline

Definition at line 338 of file Character.h.

References m_corpData, and CorpData::startDateTime.

338 { return m_corpData.startDateTime; }
int64 startDateTime
CorpData m_corpData
Definition: Character.h:439
uint32 Character::stationID ( ) const
inline

Definition at line 326 of file Character.h.

References m_charData, and CharacterData::stationID.

Referenced by Client::SendSessionChange(), SetCorpHQ(), SetLocation(), and Client::UpdateSession().

326 { return m_charData.stationID; }
CharacterData m_charData
Definition: Character.h:440

Here is the caller graph for this function:

const std::string& Character::title ( ) const
inline

Definition at line 283 of file Character.h.

References m_charData, and CharacterData::title.

283 { return m_charData.title; }
CharacterData m_charData
Definition: Character.h:440
std::string title
const CharacterType& Character::type ( ) const
inline

Definition at line 276 of file Character.h.

References InventoryItem::type().

Referenced by _LoadItem(), bloodlineID(), and race().

276 { return static_cast<const CharacterType& >(InventoryItem::type()); }
const ItemType & type() const

Here is the call graph for this function:

Here is the caller graph for this function:

void Character::UpdateCertificate ( uint32  certificateID,
bool  pub 
)

Definition at line 1337 of file Character.cpp.

References m_cdb, InventoryItem::m_itemID, and CertificateMgrDB::UpdateCertificate().

1337  {
1338  m_cdb.UpdateCertificate(m_itemID, certID, pub);
1339 }
void UpdateCertificate(uint32 charID, uint32 certificateID, bool pub=false)
CertificateMgrDB m_cdb
Definition: Character.h:433

Here is the call graph for this function:

void Character::UpdateCorpData ( CorpData data)

Definition at line 451 of file Character.cpp.

References m_corpData, m_pClient, and Client::UpdateCorpSession().

Referenced by SetCorpHQ().

452 {
453  m_corpData = data;
455 }
CorpData m_corpData
Definition: Character.h:439
void UpdateCorpSession(CorpData &data)
Definition: Client.cpp:1970
Client * m_pClient
Definition: Character.h:437

Here is the call graph for this function:

Here is the caller graph for this function:

void Character::UpdateSkillQueue ( )

Definition at line 991 of file Character.cpp.

991  {
992  /* cleaned up code and reworked logic -allan 28Apr16 -- revisited 23Mar17 --updated code, logic and timers 16Nov17 -again 9jan18*/
993  // finally fixed. 22Jan18 --it wasnt 24Jan18 still not right 3Dec18 -again 4jan19 -another 6Aug19
994  // rewrote and FINALLY fixed. 10Aug19 --still wrong 23Aug20
995  // complete revamp and rename, this kept for notes -allan 12Oct20
996 }
void Character::UpdateSkillQueueEndTime ( )

Definition at line 1166 of file Character.cpp.

References _log, is_log_enabled, m_db, InventoryItem::m_itemID, m_pClient, m_skillQueue, InventoryItem::name(), SaveSkillQueue(), Client::SetTrainingEndTime(), and CharacterDB::UpdateSkillQueueEndTime().

Referenced by LoadPausedSkillQueue(), PauseSkillQueue(), and SkillQueueLoop().

1167 {
1168  if (m_skillQueue.empty()) {
1171  if (is_log_enabled(SKILL__TRACE))
1172  _log(SKILL__QUEUE, "%s(%u): UpdateSkillQueueEndTime() - Queue is empty.", name(), m_itemID);
1173  return;
1174  }
1175 
1176  // update client timer check for skill in training
1177  m_pClient->SetTrainingEndTime(m_skillQueue.front().endTime);
1179 
1180  SaveSkillQueue();
1181 }
CharacterDB m_db
Definition: Character.h:434
#define _log(type, fmt,...)
Definition: logsys.h:124
void SetTrainingEndTime(int64 endTime)
Definition: Client.h:331
SkillQueue m_skillQueue
Definition: Character.h:445
void UpdateSkillQueueEndTime(int64 endtime, uint32 charID)
const char * name()
#define is_log_enabled(type)
Definition: logsys.h:78
Client * m_pClient
Definition: Character.h:437
void SaveSkillQueue()
Definition: Character.cpp:546

Here is the call graph for this function:

Here is the caller graph for this function:

void Character::VerifySP ( )

Definition at line 311 of file Character.cpp.

References flagSkill, Inventory::GetItemsByFlag(), InventoryItem::pInventory, and RefPtr< X >::StaticCast().

Referenced by Client::SelectCharacter().

312 {
313  std::vector<InventoryItemRef> skills;
315  for (auto cur : skills) {
316  SkillRef::StaticCast(cur)->VerifyAttribs();
317  SkillRef::StaticCast(cur)->VerifySP();
318  }
319 }
uint32 GetItemsByFlag(EVEItemFlags flag, std::vector< InventoryItemRef > &items) const
Definition: Inventory.cpp:458
Inventory * pInventory
static RefPtr StaticCast(const RefPtr< Y > &oth)
Acts as static_cast from one RefPtr to another.
Definition: RefPtr.h:238

Here is the call graph for this function:

Here is the caller graph for this function:

void Character::VisitSystem ( uint32  solarSystemID)

Definition at line 1395 of file Character.cpp.

References m_db, InventoryItem::m_itemID, and CharacterDB::VisitSystem().

Referenced by Client::CynoJump(), and Client::StargateJump().

1395  {
1397 }
CharacterDB m_db
Definition: Character.h:434
uint32 solarSystemID() const
Definition: Character.h:327
void VisitSystem(uint32 solarSystemID, uint32 charID)

Here is the call graph for this function:

Here is the caller graph for this function:

int32 Character::warFactionID ( ) const
inline

Definition at line 303 of file Character.h.

References m_corpData, and CorpData::warFactionID.

Referenced by ShipSE::LaunchDrone().

303 { return m_corpData.warFactionID; }
CorpData m_corpData
Definition: Character.h:439
int32 warFactionID

Here is the caller graph for this function:

int32 Character::wingID ( ) const
inline

Definition at line 319 of file Character.h.

References m_fleetData, and CharFleetData::wingID.

Referenced by FleetService::AddMember(), Command_showsession(), FleetService::FleetBroadcast(), FleetService::RemoveMember(), and FleetService::UpdateMember().

319 { return m_fleetData.wingID; }
CharFleetData m_fleetData
Definition: Character.h:441

Here is the caller graph for this function:

Friends And Related Function Documentation

friend class InventoryItem
friend

Definition at line 214 of file Character.h.

Member Data Documentation

CertificateMgrDB Character::m_cdb
private

Definition at line 433 of file Character.h.

Referenced by _Load(), GrantCertificate(), SaveCertificates(), and UpdateCertificate().

CertMap Character::m_certificates
private
uint32 Character::m_freePoints
private

Definition at line 446 of file Character.h.

Referenced by SendSkillQueue().

std::map<uint8, InventoryItemRef> Character::m_implantMap
private

Definition at line 454 of file Character.h.

Skill* Character::m_inTraining
private
bool Character::m_loaded
private

Definition at line 450 of file Character.h.

Referenced by _Load(), and SetLoaded().

uint32 Character::m_loginTime
private

Definition at line 452 of file Character.h.

Referenced by Character(), loginTime(), SetLoginTime(), and SetLogonMinutes().

StandingDB Character::s_db
private

Definition at line 435 of file Character.h.


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