161 DogmaLM_BindArgs
args;
164 if (!args.Decode(&tmp)) {
165 codelog(SERVICE__ERROR,
"%s: Failed to decode bind args.",
GetName());
205 Call_SingleIntegerArg
args;
206 if (!args.Decode(&call.
tuple)) {
207 codelog(SERVICE__ERROR,
"%s: Failed to decode arguments.",
GetName());
212 if (itemRef.
get() == nullptr ) {
213 _log(INV__ERROR,
"Unable to load item %u", args.arg);
219 obj->
Dump(ITEM__DEBUG,
" ");
226 if (pClient->IsInSpace()) {
228 if (pDestiny ==
nullptr) {
229 _log(PLAYER__ERROR,
"%s: Client has no destiny manager!", pClient->GetName());
233 pClient->SendNotifyMsg(
"You can't do this while warping");
238 Call_TwoIntegerArgs
args;
240 if (!args.Decode(&call.
tuple)) {
241 codelog(SERVICE__ERROR,
"%s: Failed to decode arguments.",
GetName());
245 pClient->GetShip()->Online(args.arg2);
257 if (pClient->IsInSpace()) {
259 if (pDestiny ==
nullptr) {
260 _log(PLAYER__ERROR,
"%s: Client has no destiny manager!", pClient->GetName());
264 pClient->SendNotifyMsg(
"You can't do this while warping");
269 Call_TwoIntegerArgs
args;
270 if (!args.Decode(&call.
tuple)) {
271 codelog(SERVICE__ERROR,
"%s: Failed to decode arguments.",
GetName());
275 pClient->GetShip()->Offline(args.arg2);
298 _log(MODULE__TRACE,
"DogmaIMBound::Handle_LoadAmmoToModules()");
299 call.
Dump(MODULE__TRACE);
300 Call_Dogma_LoadAmmoToModules
args;
301 if (!args.Decode(&call.
tuple)) {
302 codelog(SERVICE__ERROR,
"%s: Failed to decode arguments.",
GetName());
306 if (args.moduleIDs.empty())
308 if (args.moduleIDs.size() > 1) {
309 sLog.Error(
"DogmaIMBound::Handle_LoadAmmoToModules()",
"args.moduleIDs.size = %u.", args.moduleIDs.size() );
310 call.
Dump(MODULE__WARNING);
317 throw UserError (
"ModuleNoLongerPresentForCharges");
335 _log(MODULE__TRACE,
"DogmaIMBound::Handle_LoadAmmoToBank()");
336 call.
Dump(MODULE__TRACE);
337 Call_Dogma_LoadAmmoToBank
args;
338 if (!args.Decode(&call.
tuple)) {
339 codelog(SERVICE__ERROR,
"%s: Failed to decode arguments.",
GetName());
350 if (args.itemIDs.empty())
355 if (sRef->
itemID() != args.shipID)
356 sLog.Error(
"DogmaIMBound::Handle_LoadAmmoToBank()",
"passed shipID %u != current shipID %u.", args.shipID, sRef->
itemID() );
361 throw UserError (
"ModuleNoLongerPresentForCharges");
386 Call_SingleIntegerArg
args;
387 if (!args.Decode(&call.
tuple)) {
388 codelog(SERVICE__ERROR,
"%s: Failed to decode arguments.",
GetName());
393 if (pClient->IsJump())
394 throw UserError (
"CantTargetWhileJumping");
396 if (pClient->GetShipID() == args.arg)
400 if (pClient->IsUncloak())
401 throw UserError (
"DeinedTargetAfterCloak");
403 if (pClient->IsDocked()) {
404 pClient->SendNotifyMsg(
"You can't do this while docked");
405 Rsp_Dogma_AddTarget rsp;
407 rsp.targetList.push_back(args.arg);
413 throw UserError (
"DeniedTargetingAttemptFailed")
417 throw UserError (
"DeniedTargetSelfFrozen")
424 _log(DESTINY__ERROR,
"Client %s does not have a bubble.", pClient->GetName());
425 throw UserError (
"DeniedTargettingAttemptFailed")
431 throw UserError (
"DeniedTargetingInsideField")
437 if (pMyDestiny ==
nullptr) {
438 _log(PLAYER__ERROR,
"%s: Client has no destiny manager!", pClient->GetName());
439 throw UserError (
"DeniedTargetingAttemptFailed")
443 throw UserError (
"CantTargetWhileCloaked");
448 if (pSysMgr ==
nullptr) {
449 _log(PLAYER__WARNING,
"Unable to find system manager for '%s'", pClient->GetName());
450 throw UserError (
"DeniedTargetingAttemptFailed")
456 if (tSE ==
nullptr) {
457 _log(INV__WARNING,
"Unable to find entity %u in system %u from '%s'", args.arg, pSysMgr->
GetID(), pClient->GetName());
458 throw UserError (
"DeniedTargetingAttemptFailed")
464 throw UserError (
"DeniedTargetEvadesSensors")
472 throw UserError (
"DeniedTargetOtherFrozen")
481 throw UserError (
"DeniedTargetEvadesSensors")
487 _log(TARGET__WARNING,
"Handle_AddTarget - TargMgr.StartTargeting() failed - warping.");
488 throw UserError (
"DeniedTargetSelfWarping")
493 throw UserError (
"DeniedTargetingTargetCloaked");
495 _log(TARGET__WARNING,
"Handle_AddTarget - TargMgr.StartTargeting() failed - target warping.");
496 throw UserError (
"DeniedTargetOtherWarping")
503 _log(DESTINY__ERROR,
"Target %s does not have a bubble.", tSE->
GetName());
504 throw UserError (
"DeniedTargetingAttemptFailed")
509 throw UserError (
"DeniedTargetReinforcedStructure")
514 throw UserError (
"DeniedTargetForceField")
520 if (
sConfig.debug.IsTestServer)
523 _log(TARGET__MESSAGE,
"DogmaIM::AddTarget() - %s(%u) targeting %s(%u) at distance of %.2f meters.", \
528 _log(TARGET__WARNING,
"AddTarget() - TargMgr.StartTargeting() failed.");
529 throw UserError (
"DeniedTargetingAttemptFailed")
533 Rsp_Dogma_AddTarget rsp;
535 rsp.targetList.push_back(args.arg);
542 Call_SingleIntegerArg
args;
543 if (!args.Decode(&call.
tuple)) {
544 codelog(SERVICE__ERROR,
"%s: Failed to decode arguments.",
GetName());
549 if (pSysMgr ==
nullptr) {
550 _log(SERVICE__ERROR,
"Unable to find system manager for '%s'", pClient->GetName());
554 if (pTSE ==
nullptr) {
555 _log(SERVICE__ERROR,
"Unable to find entity %u in system %u for '%s'", args.arg, pSysMgr->
GetID(), pClient->GetName());
559 if (
sConfig.debug.IsTestServer)
562 _log(TARGET__MESSAGE,
"Handle_RemoveTarget() - Removed %s(%u) - Range to Target: %.2f meters.", \
563 pTSE->
GetName(),pTSE->
GetID(), vectorToTarget.length() );
567 pClient->GetShipSE()->RemoveTarget(pTSE);
579 Call_TwoBoolArgs
args;
580 if (!args.Decode(&call.
tuple)) {
581 codelog(SERVICE__ERROR,
"%s: Failed to decode arguments.",
GetName());
609 PyDict* charResult = pClient->GetChar()->GetCharInfo();
610 if (charResult ==
nullptr) {
611 _log(SERVICE__ERROR,
"Unable to build char info for char %u", pClient->GetCharacterID());
622 PyDict* shipResult = pClient->GetShip()->GetShipInfo();
623 if (shipResult ==
nullptr) {
624 _log(SERVICE__ERROR,
"Unable to build ship info for ship %u", pClient->GetShipID());
634 if (pClient->GetShip().get() ==
nullptr) {
635 _log(SERVICE__ERROR,
"Unable to build shipState for %u", pClient->GetShipID());
639 rspShipState->
items[0] = pClient->GetShip()->GetShipState();
640 rspShipState->
items[1] = pClient->GetShip()->GetChargeState();
641 rspShipState->
items[2] = pClient->GetShip()->GetLinkedWeapons();
645 rsp->
Dump(SHIP__STATE,
" ");
648 return new PyObject(
"util.KeyVal", rsp );
663 Call_Dogma_LinkWeapons
args;
664 if (!args.Decode(&call.
tuple)) {
665 codelog(SERVICE__ERROR,
"%s: Failed to decode arguments.",
GetName());
682 if (sRef.
get() ==
nullptr) {
683 _log(INV__ERROR,
"ShipRef not found in containers inventory for %s", call.
client->
GetName());
687 sRef->
LinkWeapon(args.masterID, args.slaveID);
692 Call_SingleIntegerArg arg;
693 if (!arg.Decode(&call.
tuple)) {
694 codelog(SERVICE__ERROR,
"%s: Failed to decode arguments.",
GetName());
708 if (sRef.
get() ==
nullptr) {
709 _log(INV__ERROR,
"ShipRef not found in containers inventory for %s", call.
client->
GetName());
720 Call_TwoIntegerArgs
args;
721 if (!args.Decode(&call.
tuple)) {
722 codelog(SERVICE__ERROR,
"%s: Failed to decode arguments.",
GetName());
736 if (sRef.
get() ==
nullptr) {
737 _log(INV__ERROR,
"ShipRef not found in containers inventory for %s", call.
client->
GetName());
747 Call_SingleIntegerArg arg;
748 if (!arg.Decode(&call.
tuple)) {
749 codelog(SERVICE__ERROR,
"%s: Failed to decode arguments.",
GetName());
763 if (sRef.
get() ==
nullptr) {
764 _log(INV__ERROR,
"ShipRef not found in containers inventory for %s", call.
client->
GetName());
774 sLog.Warning(
"DogmaIMBound::Handle_UnlinkModule()",
"size=%u", call.
tuple->
size());
775 call.
Dump(SHIP__MESSAGE);
777 Call_TwoIntegerArgs
args;
778 if (!args.Decode(&call.
tuple)) {
779 codelog(SERVICE__ERROR,
"%s: Failed to decode arguments.",
GetName());
793 if (sRef.
get() ==
nullptr) {
794 _log(INV__ERROR,
"ShipRef not found in containers inventory for %s", call.
client->
GetName());
804 sLog.Warning(
"DogmaIMBound::Handle_MergeModuleGroups()",
"size=%u", call.
tuple->
size());
805 call.
Dump(SHIP__MESSAGE);
807 Call_Dogma_LinkWeapons
args;
808 if (!args.Decode(&call.
tuple)) {
809 codelog(SERVICE__ERROR,
"%s: Failed to decode arguments.",
GetName());
825 if (sRef.
get() ==
nullptr) {
826 _log(INV__ERROR,
"ShipRef not found in containers inventory for %s", call.
client->
GetName());
839 sLog.Warning(
"DogmaIMBound::Handle_PeelAndLink()",
"size=%u", call.
tuple->
size());
840 call.
Dump(SHIP__MESSAGE);
842 Call_Dogma_LinkWeapons
args;
843 if (!args.Decode(&call.
tuple)) {
844 codelog(SERVICE__ERROR,
"%s: Failed to decode arguments.",
GetName());
860 if (sRef.
get() ==
nullptr) {
861 _log(INV__ERROR,
"ShipRef not found in containers inventory for %s", call.
client->
GetName());
880 if (!pClient->IsInSpace()) {
881 pClient->SendNotifyMsg(
"You can't do this while docked.");
891 call.
Dump(POS__DUMP);
894 Call_TwoIntegerArgs
args;
895 if (!args.Decode(&call.
tuple)) {
896 codelog(SERVICE__ERROR,
"%s: Failed to decode arguments.",
GetName());
916 if (pSE ==
nullptr) {
917 sLog.Error(
"DogmaIMBound::Handle_Activate()",
"%u is not a valid EntityID in this system.", args.arg1);
940 Call_Dogma_Activate
args;
941 if (!args.Decode(&call.
tuple)) {
942 codelog(SERVICE__ERROR,
"%s: Failed to decode arguments.",
GetName());
946 pClient->GetShip()->Activate(args.itemID, args.effectName, args.target, args.repeat);
959 sLog.Warning(
"DogmaIMBound::Handle_Deactivate()",
"size=%u", call.
tuple->
size());
960 call.
Dump(SHIP__MESSAGE);
964 if (!pClient->IsInSpace()) {
965 pClient->SendNotifyMsg(
"You can't do this while docked");
971 call.
Dump(POS__DUMP);
972 Call_TwoIntegerArgs
args;
973 if (!args.Decode(&call.
tuple)) {
974 codelog(SERVICE__ERROR,
"%s: Failed to decode arguments.",
GetName());
978 if (pSE ==
nullptr) {
979 sLog.Error(
"DogmaIMBound::Handle_Deactivate()",
"%u is not a valid EntityID in this system.", args.arg1);
998 }
else if (call.
tuple->
items.at(1)->IsWString()) {
1000 Call_Dogma_Deactivate
args;
1001 if (!args.Decode(&call.
tuple)) {
1002 codelog(SERVICE__ERROR,
"%s: Failed to decode arguments.",
GetName());
1006 pClient->GetShip()->Deactivate(args.itemID, args.effectName);
1025 Call_TwoIntegerArgs
args;
1026 if (!args.Decode(&call.
tuple)) {
1027 codelog(SERVICE__ERROR,
"%s: Failed to decode arguments.",
GetName());
1033 pClient->GetShip()->Overload(args.arg1);
1041 Call_TwoIntegerArgs
args;
1042 if (!args.Decode(&call.
tuple)) {
1043 codelog(SERVICE__ERROR,
"%s: Failed to decode arguments.",
GetName());
1048 pClient->GetShip()->CancelOverloading(args.arg1);
1049 pClient->GetShip()->Deactivate(args.arg1,
sFxDataMgr.GetEffectName(args.arg2));
1058 Call_SingleIntegerArg
args;
1059 if (!args.Decode(&call.
tuple)) {
1060 codelog(SERVICE__ERROR,
"%s: Failed to decode arguments.",
GetName());
1064 pClient->GetShip()->CancelOverloading(args.arg);
1073 Call_SingleIntegerArg
args;
1074 if (!args.Decode(&call.
tuple)) {
1075 codelog(SERVICE__ERROR,
"%s: Failed to decode arguments.",
GetName());
1089 Call_SingleIntegerArg
args;
1090 if (!args.Decode(&call.
tuple)) {
1091 codelog(SERVICE__ERROR,
"%s: Failed to decode arguments.",
GetName());
1105 Call_SingleIntegerArg
args;
1106 if (!args.Decode(&call.
tuple)) {
1107 codelog(SERVICE__ERROR,
"%s: Failed to decode arguments.",
GetName());
1117 Call_SingleIntegerArg
args;
1118 if (!args.Decode(&call.
tuple)) {
1119 codelog(SERVICE__ERROR,
"%s: Failed to decode arguments.",
GetName());
1150 std::map<int16, int8> attribs;
#define sConfig
A macro for easier access to the singleton.
Dispatcher *const m_dispatch
PyList * GetTargets() const
PyRep * ModuleRepair(uint32 modID)
void StopModuleRepair(uint32 modID)
SystemEntity * GetSE(uint32 entityID) const
virtual ShipSE * GetShipSE()
void SendErrorMsg(const char *fmt,...)
#define _log(type, fmt,...)
Dispatcher *const m_dispatch
PyRep * GetItem(size_t index) const
Returns Python object.
bool HasAttribute(const uint16 attrID) const
PyRep * GetPyObject()
converts the EvilNumber into a python object.
virtual PyRep * Clone() const =0
Clones object.
SystemBubble * SysBubble()
PyCallable_Make_InnerDispatcher(DogmaIMService) DogmaIMService
uint32 UnlinkWeapon(uint32 moduleID)
virtual Client * GetPilot()
PyRep * GetCacheHint(const PyRep *objectID)
void Deactivate(int32 effectID)
static uint32 IntegerValueU32(PyRep *pRep)
std::string m_strBoundObjectName
UserError & AddFormatValue(const char *name, PyRep *value)
Fluent version of the protected AddKeyword, allows for adding a keyword to the exception.
void LoadLinkedWeapons(GenericModule *pMod, std::vector< int32 > &chargeIDs)
virtual ~DogmaIMService()
void ClearTargets(bool notify=true)
TargetManager * TargetMgr()
CharacterRef GetChar() const
const char * GetName() const
void UpdateDrones(std::map< int16, int8 > &attribs)
Advanced version of UserError that allows to send a full custom message.
void Dump(FILE *into, const char *pfx) const
Dumps object to file.
const GPoint & GetPosition() const
void _SetCallDispatcher(CallDispatcher *d)
PyList * GetTargeters() const
#define is_log_enabled(type)
#define sLog
Evaluates to a NewLog instance.
ShipItemRef GetShipFromInventory(uint32 shipID)
virtual PyBoundObject * CreateBoundObject(Client *pClient, const PyRep *bind_args)
DestinyManager * DestinyMgr()
SystemManager * SystemMgr()
void Deactivate(int32 effectID)
PyRep * GetLinkedWeapons()
InventoryItemRef GetSelf()
#define IsPlayerItem(itemID)
#define codelog(type, fmt,...)
void SetItem(size_t index, PyRep *object)
Stores Python object.
SystemManager * SystemMgr() const
virtual bool IsContainerSE()
void PeelAndLink(uint32 masterID, uint32 slaveID)
std::string GetBindStr() const
void Activate(int32 effectID)
PyServiceMgr *const m_manager
ShipItemRef GetShip() const
const char * GetName() const
const char * GetName() const
PyCallable_Make_Dispatcher(DogmaIMBound) DogmaIMBound(PyServiceMgr *mgr
Python object "ccp_exceptions.UserError".
#define PyCallable_REG_CALL(c, m)
StationItemRef GetStationFromInventory(uint32 stationID)
PyCallable_DECL_CALL(ChangeDroneSettings)
virtual StructureSE * GetPOSSE()
const_iterator begin() const
Dispatcher *const m_dispatch
void Activate(int32 effectID)
GenericModule * GetModule(EVEItemFlags flag)
storage_type::const_iterator const_iterator
EvilNumber GetAttribute(const uint16 attrID) const
ObjCacheService * cache_service
void Dump(LogType type) const
const_iterator end() const
virtual ContainerSE * GetContSE()
int32 GetStationID() const
static int64 IntegerValue(PyRep *pRep)
GaExpInl GaFloat distance(const GaVec3 &oth) const
virtual bool IsStaticEntity()
void MergeModuleGroups(uint32 masterID, uint32 slaveID)
void SetItem(PyRep *key, PyRep *value)
SetItem adds or sets a database entry.
void LoadCharge(InventoryItemRef cRef, EVEItemFlags flag)
const char * TypeString() const
bool StartTargeting(SystemEntity *tSE, ShipItemRef sRef)
void SetItemString(const char *key, PyRep *value)
SetItemString adds or sets a database entry.
void UnlinkGroup(uint32 memberID, bool update=false)
const char * GetName() const
void LinkWeapon(uint32 masterID, uint32 slaveID)