25 #include "../eve-server.h" 
   26 #include "../StaticDataMgr.h" 
   27 #include "../station/StationDataMgr.h" 
   28 #include "../map/MapData.h" 
   32 #include "../Client.h" 
   33 #include "../fleet/FleetService.h" 
   34 #include "../system/SystemManager.h" 
   35 #include "../standing/StandingMgr.h" 
   47     _log(AGENT__TRACE, 
"Agent created for AgentID %u", 
id);
 
   58     _log(AGENT__TRACE, 
"Data Loaded for Agent %u - bl: %u, level: %u, locationID: %u, systemID: %u", \
 
  105     sMapData.GetMissionDestination(
this, misionType, offer);
 
  108         sEntityList.FindClientByCharID(charID)->SendErrorMsg(
"Internal Server Error. Ref: ServerError 07208.");
 
  151     std::map<uint32, MissionOffer>::iterator itr = 
m_offers.find(charID);
 
  159     std::map<uint32, MissionOffer>::iterator itr = 
m_offers.find(charID);
 
  169     std::map<uint32, MissionOffer>::iterator itr = 
m_offers.find(charID);
 
  173         _log(AGENT__WARNING, 
"Agent::GetOffer() - offer not found for characterID %u", charID);
 
  197     std::map<uint32, MissionOffer>::iterator itr = 
m_offers.find(charID);
 
  203         _log(AGENT__WARNING, 
"Agent::UpdateOffer() - offer not found for character %u", charID);
 
  209     std::map<uint32, MissionOffer>::iterator itr = 
m_offers.find(charID);
 
  213         _log(AGENT__WARNING, 
"Agent::RemoveOffer() - offer not found for character %u", charID);
 
  219     std::map<uint32, MissionOffer>::iterator itr = 
m_offers.find(charID);
 
  226         _log(AGENT__WARNING, 
"Agent::DeleteOffer() - offer not found for character %u", charID);
 
  330             patent1->
SetItem(1, patentlist1);
 
  335             patent2->
SetItem(1, patentlist2);
 
  394             delays->
SetItem(0, sameSystem);
 
  396             delays->
SetItem(2, sameRegion);
 
  397             delays->
SetItem(3, otherRegion);
 
  422     std::string msg = 
"Your personal standings must be ";
 
  424     msg += 
" or higher toward this agent, its faction, or its corporation in order to use this agent's services.";
 
  440         _log(AGENT__RSP_DUMP, 
"Agent::GetInfoServiceDetails() Dump:" );
 
  441         res->
Dump(AGENT__RSP_DUMP, 
"    ");
 
  444     return new PyObject(
"util.KeyVal", res);
 
  451         case 1:     
return "-2.0";
 
  452         case 2:     
return "1.0";
 
  453         case 3:     
return "3.0";
 
  454         case 4:     
return "5.0";
 
  455         case 5:     
return "7.0";
 
  457         case 11:     
return "-1.0";
 
  458         case 12:     
return "1.5";
 
  459         case 13:     
return "3.5";
 
  460         case 14:     
return "5.5";
 
  461         case 15:     
return "7.5";
 
  473         case 1:   
return 236738; 
 
  474         case 2:   
return 236739; 
 
  475         case 3:   
return 236740; 
 
  476         case 4:   
return 236741; 
 
  477         case 5:   
return 236742; 
 
  478         case 6:   
return 236743; 
 
  479         case 7:   
return 236744; 
 
  480         case 8:   
return 236745; 
 
  481         case 9:   
return 236721; 
 
  482         case 10:  
return 236746; 
 
  483         case 11:  
return 236747; 
 
  484         case 12:  
return 236749; 
 
  485         case 13:  
return 135877; 
 
  493         case 1:   
return 236693; 
 
  494         case 2:   
return 236695; 
 
  495         case 3:   
return 236793; 
 
  496         case 4:   
return 236794; 
 
  497         case 5:   
return 236796; 
 
  498         case 6:   
return 236797; 
 
  499         case 7:   
return 236801; 
 
  500         case 8:   
return 236802; 
 
  501         case 9:   
return 236843; 
 
  502         case 10:  
return 130895; 
 
  503         case 11:  
return 133432; 
 
  504         case 12:  
return 135858; 
 
  505         case 13:  
return 135895; 
 
  506         case 14:  
return 136322; 
 
  515         case 1:   
return 236750; 
 
  516         case 2:   
return 236751; 
 
  517         case 3:   
return 236752; 
 
  518         case 4:   
return 236753; 
 
  519         case 5:   
return 236754; 
 
  520         case 6:   
return 236755; 
 
  521         case 7:   
return 236756; 
 
  522         case 8:   
return 236757; 
 
  523         case 9:   
return 236758; 
 
  524         case 10:  
return 236759; 
 
  525         case 11:  
return 236760; 
 
  526         case 12:  
return 236761; 
 
  527         case 13:  
return 236762; 
 
  528         case 14:  
return 236763; 
 
  529         case 15:  
return 236764; 
 
  530         case 16:  
return 236765; 
 
  531         case 17:  
return 236766; 
 
  532         case 18:  
return 236767; 
 
  533         case 19:  
return 236768; 
 
  534         case 20:  
return 139398; 
 
  550         case 1:   
return 236682; 
 
  551         case 2:   
return 236691; 
 
  553         case 3:   
return 236785; 
 
  554         case 4:   
return 236787; 
 
  555         case 5:   
return 236775; 
 
  556         case 6:   
return 236853; 
 
  586     if (pSysMgr != 
nullptr)
 
  593     newStanding *= 
sConfig.standings.BaseMissionMultiplier;
 
  596         newStanding *= 
sConfig.standings.ImportantMissionBonus;
 
  598     std::string msg = 
"Status Change for Mission ";
 
  602             newStanding *= 
sConfig.standings.MissionFailedRollback;
 
  606             newStanding *= 
sConfig.standings.MissionOfferExpired;
 
  609             msg += 
"completion bonus ";
 
  610             newStanding *= 
sConfig.standings.MissionBonus;
 
  613             msg += 
"completion ";
 
  614             newStanding *= 
sConfig.standings.MissionCompleted;
 
  623             newStanding *= 
sConfig.standings.MissionFailure;
 
  630     if (pClient->
InFleet() and (newStanding > 0)) {
 
  631         float fleetStanding = newStanding * 
sConfig.standings.FleetMissionMultiplier;
 
  632         newStanding -= (fleetStanding /2);  
 
  634         std::vector<Client*> clientVec;
 
  635         sFltSvc.GetFleetClientsInSystem(pClient, clientVec);
 
  636         for (
auto cur : clientVec) {
 
  648             cur->SendNotification(
"OnStandingsModified", 
"charid", payload, 
false);
 
  689         _log(STANDING__RSPDUMP, 
"Agent::UpdateStandings RSP:" );
 
  690         payload->
Dump(STANDING__RSPDUMP, 
"    ");
 
  698     if (pClient == 
nullptr)
 
  724     pClient->
SendNotification(
"OnAgentMissionChange", 
"charid", payload, 
false);    
 
  768         facChr = (1.0 - (1.0 - facChr / 10.0) * (1.0 - facBonus / 10.0)) * 10.0;
 
  769     if (corpBonus > 0.0f)
 
  770         corpChr = (1.0 - (1.0 - corpChr / 10.0) * (1.0 - corpBonus / 10.0)) * 10.0;
 
  771     if (charBonus > 0.0f)
 
  772         charChr = (1.0 - (1.0 - charChr / 10.0) * (1.0 - charBonus / 10.0)) * 10.0;
 
  776     _log(AGENT__DEBUG, 
"%s(%u) CanUseAgent() - charSkills(con:%u,dip:%u,cri:%u), stand(%f, %f, %f)",\
 
  778     _log(AGENT__DEBUG, 
"%s(%u) CanUseAgent() - standings(fac:%u,crp:%u,chr:%u), bonus(%f, %f, %f) - m=%f", \
 
  781     if ((
EvE::max(facChr, corpChr, charChr) >= m ) and (
EvE::min(facChr, corpChr, charChr) > -2.0f)) {
 
static float GetStanding(uint32 fromID, uint32 toID)
 
#define sConfig
A macro for easier access to the singleton. 
 
void SendNotification(const PyAddress &dest, EVENotificationStream ¬i, bool seq=true)
 
void RemoveOffer(uint32 charID)
 
std::string GetMinReqStanding(uint8 level)
 
#define _log(type, fmt,...)
 
uint32 GetStandingsRsp(uint32 charID)
 
double min(double x, double y)
 
PyObject * GetInfoServiceDetails()
 
float EffectiveQuality(int8 AgentQuality, uint8 NegotiationSkillLevel, float AgentPersonalStanding)
 
uint32 GetDeclineRsp(uint32 charID)
 
std::map< uint32, MissionOffer > m_offers
 
std::map< uint16, AgentActions > m_actions
 
Python floating point number. 
 
int32 GetCorporationID() const 
 
static void LoadAgentSkills(uint32 agentID, std::map< uint16, uint8 > &data)
 
CharacterRef GetChar() const 
 
void MakeOffer(uint32 charID, MissionOffer &offer)
 
void Dump(FILE *into, const char *pfx) const 
Dumps object to file. 
 
bool HasMission(uint32 charID)
 
#define is_log_enabled(type)
 
uint32 destinationSystemID
 
float MissionStandingIncrease(float BaseMissionIncrease, uint8 YourSocialSkillLevel)
 
void SetItem(size_t index, PyRep *object)
Stores Python object. 
 
float Efficiency(uint8 AgentLevel, int8 AgentQuality)
 
void UpdateStandings(Client *pClient, uint8 eventID, bool important=false)
 
#define IsPlayerCorp(itemID)
 
bool CanUseAgent(Client *pClient)
 
uint32 GetCompleteRsp(uint32 charID)
 
uint32 destinationOwnerID
 
static void LoadAgentData(uint32 agentID, AgentData &data)
 
void GetOffer(uint32 charID, MissionOffer &offer)
 
PyDict * GetLocationWrap()
 
int64 MakeRandomInt(int64 low, int64 high)
Generates random integer from interval [low; high]. 
 
int64 max(int64 x, int64 y=0)
 
float GetStandingBonus(float fromStanding, uint32 fromFactionID, uint8 ConnectionsSkillLevel, uint8 DiplomacySkillLevel, uint8 CriminalConnectionsSkillLevel)
 
void DeleteOffer(uint32 charID)
 
uint32 GetQuitRsp(uint32 charID)
 
int8 GetSkillLevel(uint16 skillTypeID, bool zeroForNotInjected=true) const 
 
float EffectiveStanding(float YourStanding, double standingBonus)
 
static void CreateOfferID(MissionOffer &data)
 
uint32 GetAcceptRsp(uint32 charID)
 
void SendMissionUpdate(Client *pClient, std::string action)
 
void UpdateOffer(uint32 charID, MissionOffer &offer)
 
std::map< uint16, uint8 > m_skills
 
static void UpdateMissionOffer(MissionOffer &data)
 
void SetItemString(const char *key, PyRep *value)
SetItemString adds or sets a database entry.