41 m_strBoundObjectName =
"FleetBound";
91 sLog.Warning(
"FleetBound",
"Handle_Init() size=%u", call.
tuple->
size() );
92 call.
Dump(FLEET__DUMP);
106 if (pClient ==
nullptr)
110 if (pChar ==
nullptr)
123 join.squadID = pChar->
squadID();
126 join.wingID = pChar->
wingID();
129 res->
SetItem(0, join.Encode());
131 _log(FLEET__UPDATE_DUMP,
"OnFleetJoin");
132 res->
Dump(FLEET__UPDATE_DUMP,
" ");
140 _log(FLEET__UPDATE_DUMP,
"OnFleetStateChange");
141 obj->
Dump(FLEET__UPDATE_DUMP,
" ");
146 _log(FLEET__UPDATE_DUMP,
"OnFleetActive");
147 count->
Dump(FLEET__UPDATE_DUMP,
" ");
171 rsp.motd = fData.
motd;
172 rsp.name = fData.
name;
178 rsp.isExcludedFromMuting = muteDict;
184 rsp.isMutedByLeader = lMuteDict;
186 std::vector< uint32 > wingIDs, squadIDs;
190 for (
auto wingID : wingIDs) {
192 sFltSvc.GetWingData(wingID, wData);
194 wing.name = wData.
name;
195 wing.wingID = wingID;
198 sFltSvc.GetSquadIDs(wingID, squadIDs);
201 for (
auto squadID : squadIDs) {
203 sFltSvc.GetSquadData(squadID, sData);
205 squad.name = sData.
name;
206 squad.squadID = squadID;
216 std::vector<Client*> members;
219 for (
auto cur : members) {
221 member.charID = cur->GetCharacterID();
222 member.clientID = cur->GetClientID();
223 member.job = cur->GetChar()->fleetJob();
224 member.role = cur->GetChar()->fleetRole();
225 member.shipTypeID = cur->GetShip()->typeID();
229 member.squadID = cur->GetChar()->squadID();
230 member.roleBooster = cur->GetChar()->fleetBooster();
231 member.solarSystemID = cur->GetSystemID();
232 member.wingID = cur->GetChar()->wingID();
233 member.timestamp = cur->GetChar()->fleetJoinTime();
234 dict2->
SetItem(
new PyInt(member.charID), member.Encode());
239 rsp.
Dump(FLEET__DEBUG);
246 sLog.Warning(
"FleetBound",
"Handle_Invite() size=%u", call.
tuple->
size() );
247 call.
Dump(FLEET__DUMP);
249 FleetInviteCall
args;
250 if (!args.Decode(&call.
tuple)) {
256 if (pClient ==
nullptr)
266 data.
wingID = args.wingID;
268 data.
role = args.role;
273 _log(FLEET__MESSAGE,
"Fleet Invite: Role: %s, WingID: %i, SquadID: %i",
sFltSvc.GetRoleName(data.
role).c_str(), data.
wingID, data.
squadID);
277 _log(FLEET__MESSAGE,
"Fleet Invite: Role: %s, WingID: %i, SquadID: %i",
sFltSvc.GetRoleName(data.
role).c_str(), data.
wingID, data.
squadID);
280 _log(FLEET__MESSAGE,
"Fleet Invite: Role: %s, WingID: %i, SquadID: %i",
sFltSvc.GetRoleName(data.
role).c_str(), data.
wingID, data.
squadID);
283 _log(FLEET__MESSAGE,
"Fleet Invite: Role: %s, WingID: %i, SquadID: %i",
sFltSvc.GetRoleName(data.
role).c_str(), data.
wingID, data.
squadID);
285 _log(FLEET__ERROR,
"Fleet Invite Role/UnitID error. Role: %s, WingID: %i, SquadID: %i",
sFltSvc.GetRoleName(data.
role).c_str(), data.
wingID, data.
squadID);
288 if (!
sFltSvc.SaveInviteData(args.charID, data)) {
289 call.
client->
SendNotifyMsg(
"%s is invited to another fleet. That invite must be rejected before another can be issued.", pClient->
GetCharName().c_str());
307 _log(FLEET__UPDATE_DUMP,
"OnFleetInvite");
308 tuple->
Dump(FLEET__UPDATE_DUMP,
" ");
317 sLog.Warning(
"FleetBound",
"Handle_AcceptInvite() size=%u", call.
tuple->
size() );
318 call.
Dump(FLEET__DUMP);
321 if (pChar ==
nullptr)
363 sLog.Warning(
"FleetBound",
"Handle_RejectInvite() size=%u", call.
tuple->
size() );
364 call.
Dump(FLEET__DUMP);
367 if (pChar ==
nullptr)
370 bool rejected =
false;
397 sLog.Warning(
"FleetBound",
"Handle_ChangeWingName() size=%u", call.
tuple->
size() );
398 call.
Dump(FLEET__DUMP);
401 if (!args.Decode(&call.
tuple)) {
406 if (args.name->IsWString()) {
407 sFltSvc.RenameWing(args.unitID, args.name->AsWString()->content());
408 }
else if (args.name->IsString()) {
409 sFltSvc.RenameWing(args.unitID, args.name->AsString()->content());
411 _log(FLEET__ERROR,
"ChangeWingName - args.name is of the wrong type: '%s'. Expected PyString or PyWString.", args.name->TypeString());
420 sLog.Warning(
"FleetBound",
"Handle_ChangeSquadName() size=%u", call.
tuple->
size() );
421 call.
Dump(FLEET__DUMP);
424 if (!args.Decode(&call.
tuple)) {
429 if (args.name->IsWString()) {
430 sFltSvc.RenameSquad(args.unitID, args.name->AsWString()->content());
431 }
else if (args.name->IsString()) {
432 sFltSvc.RenameSquad(args.unitID, args.name->AsString()->content());
434 _log(FLEET__ERROR,
"ChangeSquadName - args.name is of the wrong type: '%s'. Expected PyString or PyWString.", args.name->TypeString());
443 sLog.Warning(
"FleetBound",
"Handle_SetOptions() size=%u", call.
tuple->
size() );
444 call.
Dump(FLEET__DUMP);
463 sLog.Warning(
"FleetBound",
"Handle_GetJoinRequests() size=%u", call.
tuple->
size() );
464 call.
Dump(FLEET__DUMP);
466 std::vector<Client*> cVec;
470 for (
auto cur : cVec) {
477 rsp->
Dump(FLEET__DEBUG,
" ");
483 sLog.Warning(
"FleetBound",
"Handle_RejectJoinRequest() size=%u", call.
tuple->
size() );
484 call.
Dump(FLEET__DUMP);
486 Call_SingleIntegerArg arg;
487 if (!arg.Decode(&call.
tuple)) {
502 sLog.Warning(
"FleetBound",
"Handle_GetFleetComposition() size=%u", call.
tuple->
size() );
503 call.
Dump(FLEET__DUMP);
507 std::vector<Client*> members;
509 for (
auto cur : members) {
510 pChar = cur->GetChar().get();
511 if (pChar ==
nullptr)
534 list->
Dump(FLEET__DEBUG,
" ");
540 sLog.Warning(
"FleetBound",
"Handle_GetWings() size=%u", call.
tuple->
size() );
541 call.
Dump(FLEET__DUMP);
549 sLog.Warning(
"FleetBound",
"Handle_SendBroadcast() size=%u", call.
tuple->
size() );
550 call.
Dump(FLEET__DUMP);
552 SendBroadCastCall
args;
553 if (!args.Decode(&call.
tuple)) {
572 sLog.Warning(
"FleetBound",
"Handle_UpdateMemberInfo() size=%u", call.
tuple->
size() );
581 sLog.Warning(
"FleetBound",
"Handle_SetMotdEx() size=%u", call.
tuple->
size() );
582 call.
Dump(FLEET__DUMP);
592 sLog.Warning(
"FleetBound",
"Handle_GetMotd() size=%u", call.
tuple->
size() );
593 call.
Dump(FLEET__DUMP);
600 sLog.Warning(
"FleetBound",
"Handle_LeaveFleet() size=%u", call.
tuple->
size() );
601 call.
Dump(FLEET__DUMP);
611 sLog.Warning(
"FleetBound",
"Handle_MakeLeader() size=%u", call.
tuple->
size() );
612 call.
Dump(FLEET__DUMP);
614 Call_SingleIntegerArg arg;
615 if (!arg.Decode(&call.
tuple)) {
624 if (pClient !=
nullptr) {
626 if (pCharOld ==
nullptr)
628 int32 wingID = 0, squadID = 0;
635 if (pCharNew ==
nullptr)
645 sLog.Warning(
"FleetBound",
"Handle_SetBooster() size=%u", call.
tuple->
size() );
646 call.
Dump(FLEET__DUMP);
649 if (!args.Decode(&call.
tuple)) {
656 if (pChar ==
nullptr)
660 switch (args.booster) {
696 sLog.Warning(
"FleetBound",
"Handle_MoveMember() size=%u", call.
tuple->
size() );
697 call.
Dump(FLEET__DUMP);
700 if (!args.Decode(&call.
tuple)) {
706 if (pChar ==
nullptr)
711 if (
sFltSvc.UpdateMember(args.charID,
m_fleetID, args.wingID, args.squadID, pChar->
fleetJob(), args.role, args.booster))
725 sLog.Warning(
"FleetBound",
"Handle_KickMember() size=%u", call.
tuple->
size() );
726 call.
Dump(FLEET__DUMP);
728 Call_SingleIntegerArg arg;
729 if (!arg.Decode(&call.
tuple)) {
742 sLog.Warning(
"FleetBound",
"Handle_CreateWing() size=%u", call.
tuple->
size() );
743 call.
Dump(FLEET__DUMP);
750 sLog.Warning(
"FleetBound",
"Handle_CreateSquad() size=%u", call.
tuple->
size() );
751 call.
Dump(FLEET__DUMP);
753 Call_SingleIntegerArg arg;
754 if (!arg.Decode(&call.
tuple)) {
767 sLog.Warning(
"FleetBound",
"Handle_DeleteWing() size=%u", call.
tuple->
size() );
768 call.
Dump(FLEET__DUMP);
770 Call_SingleIntegerArg arg;
771 if (!arg.Decode(&call.
tuple)) {
784 sLog.Warning(
"FleetBound",
"Handle_DeleteSquad() size=%u", call.
tuple->
size() );
785 call.
Dump(FLEET__DUMP);
787 Call_SingleIntegerArg arg;
788 if (!arg.Decode(&call.
tuple)) {
801 sLog.Warning(
"FleetBound",
"Handle_AddToVoiceChat() size=%u", call.
tuple->
size() );
802 call.
Dump(FLEET__DUMP);
812 sLog.Warning(
"FleetBound",
"Handle_SetVoiceMuteStatus() size=%u", call.
tuple->
size() );
813 call.
Dump(FLEET__DUMP);
821 sLog.Warning(
"FleetBound",
"Handle_ExcludeFromVoiceMute()) size=%u", call.
tuple->
size() );
822 call.
Dump(FLEET__DUMP);
830 sLog.Warning(
"FleetBound",
"Handle_Reconnect()) size=%u", call.
tuple->
size() );
#define sConfig
A macro for easier access to the singleton.
Dispatcher *const m_dispatch
void SendNotification(const PyAddress &dest, EVENotificationStream ¬i, bool seq=true)
static std::string StringContent(PyRep *pRep)
uint32 GetSystemID() const
#define _log(type, fmt,...)
PyRep * GetItem(size_t index) const
Returns Python object.
PyRep * GetItemString(const char *key) const
Obtains database entry based on given key string.
PyCallable_Make_InnerDispatcher(FleetBound) FleetBound
std::multimap< uint32, uint32 > isExcludedFromMuting
Dispatcher *const m_dispatch
void SendInfoModalMsg(const char *fmt,...)
int32 GetCharacterID() const
int64 GetClientID() const
void SendNotifyMsg(const char *fmt,...)
CharacterRef GetChar() const
void Dump(FILE *into, const char *pfx) const
Dumps object to file.
PyRep * arguments() const
#define is_log_enabled(type)
#define sLog
Evaluates to a NewLog instance.
#define codelog(type, fmt,...)
void SetItem(size_t index, PyRep *object)
Stores Python object.
std::string GetBindStr() const
int8 fleetBooster() const
ShipItemRef GetShip() const
const char * GetName() const
#define PyCallable_REG_CALL(c, m)
std::string GetCharName()
void Dump(LogType type) const
std::multimap< uint32, uint32 > isMutedByLeader
int8 GetSkillLevel(uint16 skillTypeID, bool zeroForNotInjected=true) const
void SetItem(PyRep *key, PyRep *value)
SetItem adds or sets a database entry.
void SetItemString(const char *key, PyRep *value)
SetItemString adds or sets a database entry.
bool HasSkill(uint16 skillTypeID) const