27 #include <boost/algorithm/string.hpp>
94 CreateStaticChannels();
102 std::map<int32, LSCChannel* >::iterator cur =
m_channels.begin();
138 info.lines =
new PyList();
143 std::map<int32, LSCChannel*>::iterator cur =
m_channels.begin();
145 switch (cur->second->GetType()) {
147 if (cur->first != corpID)
168 info.Dump(LSC__RSP_DUMP);
169 return info.Encode();
175 sLog.Warning(
"LSCService::Handle_GetRookieHelpChannel()",
"size=%u", call.
tuple->
size());
176 call.
Dump(LSC__CALL_DUMP);
185 sLog.Warning(
"LSCService::Handle_CreateChannel()",
"size=%u", call.
tuple->
size());
186 call.
Dump(LSC__CALL_DUMP);
189 Call_SingleStringArg name;
190 if (!name.Decode(&call.
tuple)) {
191 codelog(SERVICE__ERROR,
"%s: Failed to decode arguments.",
GetName());
195 bool create =
false, temporary =
false, joinExisting =
false, noCallThrottling =
false, memberless =
false;
197 create = call.
byname.find(
"create")->second->AsBool()->value();
199 temporary = call.
byname.find(
"temporary")->second->AsBool()->value();
200 if (call.
byname.find(
"joinExisting") != call.
byname.end())
201 joinExisting = call.
byname.find(
"joinExisting")->second->AsBool()->value();
202 if (call.
byname.find(
"noCallThrottling") != call.
byname.end())
203 noCallThrottling = call.
byname.find(
"noCallThrottling")->second->AsBool()->value();
204 if (call.
byname.find(
"memberless") != call.
byname.end())
205 memberless = (call.
byname.find(
"memberless")->second->AsInt()->value() ?
true :
false);
208 ChannelCreateReply reply;
218 std::string comStr = name.arg;
219 boost::algorithm::to_lower(comStr);
220 comStr.erase(std::remove(comStr.begin(), comStr.end(),
' '), comStr.end());
222 nextID, nextID, memberless,
false, temporary,
false);
225 if ((channel) and (!temporary))
234 _log(LSC__ERROR,
"%s: Channel not found - %s", pClient->
GetName(), name.arg.c_str());
237 _log(LSC__ERROR,
"%s: Channel not created - %s", pClient->
GetName(), name.arg.c_str());
242 return reply.Encode();
247 if (channel->JoinChannel(pClient)) {
249 reply.ChannelInfo = channel->EncodeDynamicChannel(pClient->
GetCharacterID());
253 reply.ChannelChars = channel->EncodeChannelChars();
254 reply.ChannelMods = channel->EncodeChannelMods();
261 return reply.Encode();
263 _log(LSC__ERROR,
"%s: Already joined Channel %i \"%s\".", pClient->
GetName(), channel->GetChannelID(), channel->GetDisplayName().c_str());
265 return reply.Encode();
269 reply.Dump(LSC__RSP_DUMP);
284 sLog.Warning(
"LSCService::Handle_JoinChannels()",
"size=%u", call.
tuple->
size());
285 call.
Dump(LSC__CALL_DUMP);
288 CallJoinChannels
args;
289 if (!args.Decode(&call.
tuple)) {
290 codelog(SERVICE__ERROR,
"%s: Failed to decode arguments.",
GetName());
294 std::set<int32> toJoin;
297 for (; cur != args.channels->end(); cur++) {
298 if ((*cur)->IsInt()) {
299 toJoin.insert((*cur)->AsInt()->value());
300 }
else if ((*cur)->IsTuple()) {
302 if (prt->
items.size() != 1 or !prt->
items[0]->IsTuple()) {
303 _log(SERVICE__ERROR,
"%s: Failed to decode arguments.",
GetName());
306 prt = prt->
items[0]->AsTuple();
308 if (prt->
items.size() != 2 or !prt->
items[1]->IsInt()) {
309 _log(SERVICE__ERROR,
"%s: Failed to decode arguments.",
GetName());
312 toJoin.insert(prt->
items[1]->AsInt()->value());
323 std::set<int32>::iterator curs = toJoin.begin();
324 for (; curs != toJoin.end(); curs++) {
325 int32 channelID = *curs;
328 if (
sConfig.chat.EnforceRookieInHelp)
329 if ((channelID == 1) or (channelID == 2))
334 if (channel ==
nullptr)
336 ChannelJoinReply chjr;
337 chjr.ChannelID = channel->EncodeID();
340 if (!channel->IsJoined(charID)) {
341 if (channel->JoinChannel(call.
client)) {
344 cjok.ChannelInfo = channel->EncodeDynamicChannel(charID);
348 cjok.ChannelMods = channel->EncodeChannelMods();
349 cjok.ChannelChars = channel->EncodeChannelChars();
350 chjr.JoinRsp = cjok.Encode();
353 ChannelJoinNotOK cjnok;
354 cjnok.Error =
"LSCCannotJoin";
355 cjnok.rspDict =
new PyDict();
356 chjr.JoinRsp = cjnok.Encode();
360 ChannelJoinNotOK cjnok;
362 cjnok.Error =
"LSCChannelIsJoined";
363 cjnok.rspDict =
new PyDict();
364 chjr.JoinRsp = cjnok.Encode();
371 ml->
Dump(LSC__RSP_DUMP,
" ");
378 sLog.Warning(
"LSCService::Handle_SendMessage()",
"size=%u", call.
tuple->
size());
379 call.
Dump(LSC__CALL_DUMP);
382 int32 channel_id = 0;
383 std::string message =
"";
388 _log(LSC__ERROR,
"LSCService::Handle_SendMessage failed: tuple0 is the wrong type: %s", call.
tuple->
TypeString());
393 if (tuple0->
size() != 2) {
394 _log(LSC__ERROR,
"LSCService::Handle_SendMessage failed: tuple0 is the wrong size: expected 2, but got %u", tuple0->
size());
400 _log(LSC__INFO,
"Handle_SendMessage: call is player channel chat.");
402 Call_SendMessage
args;
403 if (!args.Decode(&call.
tuple)) {
404 codelog(SERVICE__ERROR,
"%s: Failed to decode arguments.",
GetName());
407 channel_id = args.channel.id;
408 message = args.message;
409 _log(LSC__INFO,
"Handle_SendMessage: call is system channel chat.");
412 std::map<int32, LSCChannel*>::iterator itr =
m_channels.find(channel_id);
414 _log(LSC__ERROR,
"%s: Couldn't find channel %u", call.
client->
GetName(), channel_id);
418 if (message.at(0) ==
'.') {
419 _log(LSC__INFO,
"SlashService->SlashCmd() called via LSC Service");
421 itr->second->SendMessage(call.
client, message.c_str(),
true);
423 itr->second->SendMessage(call.
client, message.c_str());
432 sLog.Warning(
"LSCService::Handle_AccessControl()",
"size=%u", call.
tuple->
size());
433 call.
Dump(LSC__CALL_DUMP);
451 int32 channel_id = 0;
484 sLog.Warning(
"LSCService::Handle_Invite()",
"size=%u", call.
tuple->
size());
485 call.
Dump(LSC__CALL_DUMP);
521 if (!channel->IsJoined(invited_char_ID)) {
559 _log(LSC__ERROR,
"%s: Character %u is already joined to channel %u.", call.
client->
GetName(), invited_char_ID, channel_ID);
563 _log(LSC__ERROR,
"%s: Cannot find channel %u.", call.
client->
GetName(), channel_ID);
573 sLog.Warning(
"LSCService::Handle_Configure()",
"size=%u", call.
tuple->
size());
574 call.
Dump(LSC__CALL_DUMP);
604 int32 channel_id = 0;
621 if (call.
byname.size() == 0) {
622 _log(LSC__ERROR,
"%s: byname std::map contained zero elements, expected at least one.", call.
client->
GetName());
627 std::map<int32, LSCChannel*>::iterator res =
m_channels.find(channel_id);
629 _log(LSC__ERROR,
"%s: Handle_Configure Couldn't find channel %u", call.
client->
GetName(), channel_id);
633 channel =
m_channels.find(channel_id)->second;
634 if (call.
byname.find(
"displayName") != call.
byname.end()) {
635 if (call.
byname.find(
"displayName")->second->IsWString()) {
636 channel->SetDisplayName(call.
byname.find(
"displayName")->second->AsWString()->content());
638 _log(LSC__ERROR,
"%s: displayName contained wrong type: '%s'", call.
client->
GetName(), call.
byname.find(
"displayName")->second->TypeString());
643 if (call.
byname.find(
"memberless") != call.
byname.end()) {
644 if (call.
byname.find(
"memberless")->second->IsInt()) {
645 channel->SetMemberless(call.
byname.find(
"memberless")->second->AsInt()->value() ?
true :
false);
647 _log(LSC__ERROR,
"%s: memberless contained wrong type: '%s'", call.
client->
GetName(), call.
byname.find(
"memberless")->second->TypeString());
653 if (call.
byname.find(
"motd")->second->IsWString()) {
654 channel->SetMOTD(call.
byname.find(
"motd")->second->AsWString()->content());
656 _log(LSC__ERROR,
"%s: motd contained wrong type: '%s'", call.
client->
GetName(), call.
byname.find(
"motd")->second->TypeString());
661 if (call.
byname.find(
"oldPassword") != call.
byname.end()) {
662 if (call.
byname.find(
"oldPassword")->second->IsWString()) {
663 if (channel->GetPassword() == call.
byname.find(
"oldPassword")->second->AsWString()->content()) {
664 if (call.
byname.find(
"newPassword") != call.
byname.end()) {
665 if (call.
byname.find(
"newPassword")->second->IsWString()) {
666 channel->SetPassword(call.
byname.find(
"newPassword")->second->AsWString()->content());
668 _log(LSC__ERROR,
"%s: newPassword contained wrong type: '%s'", call.
client->
GetName(), call.
byname.find(
"newPassword")->second->TypeString());
673 _log(LSC__ERROR,
"%s: incorrect oldPassword supplied. Password NOT changed.", call.
client->
GetName());
676 }
else if (call.
byname.find(
"oldPassword")->second->IsNone()) {
677 if (call.
byname.find(
"newPassword") != call.
byname.end()) {
678 if (call.
byname.find(
"newPassword")->second->IsWString()) {
679 channel->SetPassword(call.
byname.find(
"newPassword")->second->AsWString()->content());
681 _log(LSC__ERROR,
"%s: newPassword contained wrong type: '%s'", call.
client->
GetName(), call.
byname.find(
"newPassword")->second->TypeString());
686 _log(LSC__ERROR,
"%s: oldPassword is of an unexpected type: '%s'", call.
client->
GetName(), call.
byname.find(
"newPassword")->second->TypeString());
693 channel->UpdateConfig();
701 sLog.Warning(
"LSCService::Handle_LeaveChannel()",
"size=%u", call.
tuple->
size());
702 call.
Dump(LSC__CALL_DUMP);
705 CallLeaveChannel arg;
706 if (!arg.Decode(&call.
tuple)) {
707 codelog(SERVICE__ERROR,
"%s: Failed to decode arguments.",
GetName());
713 if (arg.channel->IsInt()) {
714 toLeave = arg.channel->AsInt()->value();
715 }
else if (arg.channel->IsTuple()) {
724 _log(SERVICE__ERROR,
"%s: Failed to decode arguments.",
GetName());
730 _log(SERVICE__ERROR,
"%s: Failed to decode arguments.",
GetName());
734 _log(SERVICE__ERROR,
"%s: Failed to decode arguments.",
GetName());
741 std::map<int32, LSCChannel*>::iterator itr =
m_channels.find(toLeave);
743 itr->second->LeaveChannel(call.
client);
744 if ((itr->second->GetMemberCount() < 1) and (itr->second->GetTemporary())) {
757 sLog.Warning(
"LSCService::Handle_LeaveChannels()",
"size=%u", call.
tuple->
size());
758 call.
Dump(LSC__CALL_DUMP);
761 CallLeaveChannels
args;
763 if (!args.Decode(&call.
tuple)) {
764 codelog(SERVICE__ERROR,
"%s: Failed to decode arguments.",
GetName());
768 std::set<uint32> toLeave;
772 for (; cur != args.channels->end(); cur++) {
773 if ((*cur)->IsInt()) {
774 toLeave.insert((*cur)->AsInt()->value());
775 }
else if ((*cur)->IsTuple()) {
784 _log(SERVICE__ERROR,
"%s: Failed to decode arguments.",
GetName());
793 _log(SERVICE__ERROR,
"%s: Failed to decode arguments.",
GetName());
799 _log(SERVICE__ERROR,
"%s: Failed to decode arguments.",
GetName());
804 std::set<uint32>::iterator itr = toLeave.begin();
805 std::map<int32, LSCChannel*>::iterator itr2;
806 for (; itr!=toLeave.end(); itr++) {
809 itr2->second->LeaveChannel(call.
client);
810 if (args.unsubscribe)
813 if ((itr2->second->GetMemberCount() < 1) and (itr2->second->GetTemporary())) {
827 sLog.Warning(
"LSCService::Handle_DestroyChannel()",
"size=%u", call.
tuple->
size());
828 call.
Dump(LSC__CALL_DUMP);
831 Call_SingleIntegerArg arg;
832 if (!arg.Decode(&call.
tuple)) {
833 codelog(SERVICE__ERROR,
"%s: Failed to decode arguments.",
GetName());
837 std::map<int32, LSCChannel*>::iterator itr =
m_channels.find(arg.arg);
839 _log(LSC__ERROR,
"%s: Couldn't find channel %u", call.
client->
GetName(), arg.arg);
853 itr->second->Evacuate(call.
client);
863 if (!arg.Decode(&call.
tuple)) {
864 codelog(SERVICE__ERROR,
"%s: Failed to decode arguments.",
GetName());
869 if (arg.channel->IsInt()) {
870 channelID = arg.channel->AsInt()->value();
871 }
else if (arg.channel->IsTuple()) {
881 _log(SERVICE__ERROR,
"%s: Failed to decode arguments.",
GetName());
887 _log(SERVICE__ERROR,
"%s: Failed to decode arguments.",
GetName());
891 _log(SERVICE__ERROR,
"%s: Failed to decode arguments.",
GetName());
896 return m_channels[channelID]->EncodeChannelChars();
915 std::map<int32, LSCChannel*>::iterator itr =
m_channels.find(systemID);
926 bool maillist,
bool temporary,
bool languageRestriction) {
931 LSCChannel* channel =
new LSCChannel(
this, channelID, type, ownerID, name, compkey, motd, memberless, password, maillist, cspa, temporary, languageRestriction, groupMessageID, channelMessageID);
937 std::map<int32, LSCChannel*>::iterator itr =
m_channels.find(channelID);
946 if (cur.second->GetDisplayName() == channelName)
959 std::string name=
"", motd =
"";
960 int32 messageID = -1, grpMsgID = 0;
961 uint32 ownerID = channelID;
971 name =
"Constellation";
1003 name =
sFltSvc.GetFleetName(channelID);
1004 motd =
sFltSvc.GetFleetDescription(channelID);
1006 ownerID =
sFltSvc.GetFleetLeaderID(channelID);
1009 name =
sFltSvc.GetWingName(channelID);
1012 motd +=
sFltSvc.GetFleetDescription(channelID);
1015 ownerID =
sFltSvc.GetFleetLeaderID(channelID);
1018 name =
sFltSvc.GetSquadName(channelID);
1021 motd +=
sFltSvc.GetFleetDescription(channelID);
1024 ownerID =
sFltSvc.GetFleetLeaderID(channelID);
1028 std::string comStr = motd;
1029 boost::algorithm::to_lower(comStr);
1030 comStr.erase(std::remove(comStr.begin(), comStr.end(),
' '), comStr.end());
1031 CreateChannel(channelID, ownerID, name.c_str(), motd,
nullptr, comStr.c_str(), type,
cspa, grpMsgID, messageID);
1037 std::ostringstream str;
1045 str <<
"<br><color=0xff007fff><b>Welcome to the EVEmu <u>EVE Online: Crucible</u> Emulator</b></color><br><br>";
1046 str <<
"<color=0xff00ff00><b>Topic:</b></color> ";
1047 str <<
"<color=0xffffffff>EVE-Online related rookie help.</color><br><br>";
1048 str <<
"<color=0xff00ff00><b>Rules:</b></color> ";
1049 str <<
"<color=0xffffffff>No WTB, WTS, WTT, PC, advertising, recruiting, scamming, offering private help in any form or begging in this channel.<br>";
1050 str <<
"No CAPS or text-decoration.</color><br><br>";
1051 str <<
"<color=0xff00ff00><b>Language:</b></color> ";
1052 str <<
"<color=0xffffffff>This channel is ENGLISH ONLY.</color><br><br>";
1053 str <<
"<color=0xff00ff00><b>How to contact a GM:</b> </color> ";
1054 str <<
"<color=0xffffffff>Right now, our petition service isnt operational, so to contact a GM, post on the forums.</color><br><br>";
1056 str <<
"<color=0xff00ff00><b>ISK Advertising:</b></color> ";
1057 str <<
"<color=0xffff0000>Contrary to what they spam, EVEmu does not authorize any person or site to sell ISK for RL cash.</color><br><br>";
1058 str <<
"<color=0xff00ff00><b>Please Note:</b></color><br>";
1059 str <<
"<color=0xffffffff>There are no third party applications (.exe) that will magically give you any type of ship you wish or hack your wallet. Please report characters advertising these types of links IMMEDIATELY via petition and DO NOT download and try them. <br><br>";
1061 CreateChannel(1, 1,
"Rookie Help", str.str().c_str(),
nullptr,
"help",
LSC::Type::normal,
cspa, 263238, -1,
true);
1064 str <<
"<br><color=0xff007fff><b>Welcome to the EVEmu <u>EVE Online: Crucible</u> Emulator</color><br><br>";
1065 str <<
"<color=0xff00ff00><b>Topic:</b></color> ";
1066 str <<
"<color=0xffffffff>EVE-Online related help.</color><br><br>";
1067 str <<
"<color=0xff00ff00><b>Rules:</b></color> ";
1068 str <<
"<color=0xffffffff>No WTB, WTS, WTT, PC, advertising, recruiting, scamming, offering private help in any form or begging in this channel.<br>";
1069 str <<
"No CAPS or text-decoration.</color><br><br>";
1070 str <<
"<color=0xff00ff00><b>Language:</b></color> ";
1071 str <<
"<color=0xffffffff>This channel is ENGLISH ONLY.</color><br><br>";
1072 str <<
"<color=0xff00ff00><b>How to contact a GM:</b> </color> ";
1073 str <<
"<color=0xffffffff>Right now, our petition service isnt operational, so to contact a GM, post on the forums.</color><br><br>";
1075 str <<
"<color=0xff00ff00><b>ISK Advertising:</b></color> ";
1076 str <<
"<color=0xffff0000>Contrary to what they spam, EVEmu does not authorize any person or site to sell ISK for RL cash.</color><br><br>";
1077 CreateChannel(2, 1,
"Help", str.str().c_str(),
nullptr,
"help",
LSC::Type::normal,
cspa, 263238, -1,
true);
1079 CreateChannel(10, 1,
"Caldari",
"Caldari Faction",
nullptr,
"caldari",
LSC::Type::normal, cspa, 263329, -1,
true);
1080 CreateChannel(11, 1,
"Amarr",
"Amarr Faction",
nullptr,
"amarr",
LSC::Type::normal, cspa, 263329, -1,
true);
1081 CreateChannel(12, 1,
"Minmatar",
"Minmatar Faction",
nullptr,
"minmatar",
LSC::Type::normal, cspa, 263329, -1,
true);
1082 CreateChannel(13, 1,
"Gallente",
"Gallente Faction",
nullptr,
"gallente",
LSC::Type::normal, cspa, 263329, -1,
true);
1083 CreateChannel(14, 1,
"Jove",
"Jove Faction",
nullptr,
"jove",
LSC::Type::normal, cspa, 263329, -1,
true);
1086 str <<
"<br><color=0xffffffff>Welcome to the recruitment channel.<br><br>";
1087 str <<
"This channel is intended for those players looking to find a new corporation, as well as those looking to enlist new players.<br>";
1088 str <<
"Other activities, such as non-recruitment discussion and scamming, are not permitted in this channel.";
1090 CreateChannel(20, 9,
"Recruitment", str.str().c_str(),
nullptr,
"recruitment",
LSC::Type::normal,
cspa, 263235, -1,
true);
1092 str <<
"<br><color=0xffffffff>Welcome to this</color> <color=0xff00ffff>Corporate CEO</color><color=0xffffffff> channel.<br><br>";
1093 str <<
"This channel is intended for corp CEOs to discuss business as they see fit.</color>";
1094 CreateChannel(21, 9,
"CEO", str.str().c_str(),
nullptr,
"ceo",
LSC::Type::normal,
cspa, 263235, -1,
true);
1105 str <<
"<br><color=0xffffffff>Welcome to this</color> <color=0xff00ffff>Trade</color><color=0xffffffff> channel.<br><br>";
1106 str <<
"This channel is intended for those players looking to trade the various items as referenced in the channel title.</color>";
1107 CreateChannel(40, 1,
"Other", str.str().c_str(),
nullptr,
"other",
LSC::Type::normal,
cspa, 263240, -1,
true);
1108 CreateChannel(41, 1,
"Ships", str.str().c_str(),
nullptr,
"ships",
LSC::Type::normal,
cspa, 263240, -1,
true);
1109 CreateChannel(42, 1,
"Blueprints", str.str().c_str(),
nullptr,
"blueprints",
LSC::Type::normal,
cspa, 263240, -1,
true);
1110 CreateChannel(43, 1,
"Modules and Munitions", str.str().c_str(),
nullptr,
"modulesandmunitions",
LSC::Type::normal,
cspa, 263240, -1,
true);
1111 CreateChannel(44, 1,
"Minerals and Manufacturing", str.str().c_str(),
nullptr,
"mineralsandmanufacturing",
LSC::Type::normal,
cspa, 263240, -1,
true);
1114 str <<
"<br><color=0xffffffff>Welcome to this</color> <color=0xff00ffff>Science and Industry</color><color=0xffffffff> channel.<br><br>";
1115 str <<
"This channel is intended for those players looking to discuss the various items as referenced in the channel title.</color>";
1116 CreateChannel(50, 1,
"Boosters", str.str().c_str(),
nullptr,
"boosters",
LSC::Type::normal,
cspa, 263331, -1,
true);
1117 CreateChannel(51, 1,
"Invention", str.str().c_str(),
nullptr,
"invention",
LSC::Type::normal,
cspa, 263331, -1,
true);
1118 CreateChannel(52, 1,
"Manufacturing", str.str().c_str(),
nullptr,
"manufacturing",
LSC::Type::normal,
cspa, 263331, -1,
true);
1119 CreateChannel(53, 1,
"Mining", str.str().c_str(),
nullptr,
"mining",
LSC::Type::normal,
cspa, 263331, -1,
true);
1120 CreateChannel(54, 1,
"Planetary Interaction", str.str().c_str(),
nullptr,
"planetaryinteraction",
LSC::Type::normal,
cspa, 263331, -1,
true);
1121 CreateChannel(55, 1,
"Research", str.str().c_str(),
nullptr,
"research",
LSC::Type::normal,
cspa, 263331, -1,
true);
1124 str <<
"<br><color=0xffffffff>Welcome to this</color> <color=0xff00ffff>Content</color><color=0xffffffff> channel.<br><br>";
1125 str <<
"This channel is intended for those players looking to discuss the various items as referenced in the channel title.</color>";
1126 CreateChannel(60, 1,
"Incursions", str.str().c_str(),
nullptr,
"incursions",
LSC::Type::normal,
cspa, 263328, -1,
true);
1127 CreateChannel(61, 1,
"Ratting", str.str().c_str(),
nullptr,
"ratting",
LSC::Type::normal,
cspa, 263328, -1,
true);
1128 CreateChannel(62, 1,
"Scanning", str.str().c_str(),
nullptr,
"scanning",
LSC::Type::normal,
cspa, 263328, -1,
true);
1129 CreateChannel(63, 1,
"Wormholes", str.str().c_str(),
nullptr,
"wormholes",
LSC::Type::normal,
cspa, 263328, -1,
true);
1132 str <<
"<br><color=0xffffffff>Welcome to the <url=https://evemu.dev>Free Wrecks</url> channel.<br>";
1133 str <<
"Here you can offer your abandoned mission wrecks to any willing freelance salvager in New Eden.</color><br><br>";
1134 str <<
"<b><u><color=0xff00ffff>Salvagers</color></u><br><color=0xff00ff00>Alphas</color></b>";
1135 str <<
"<color=0xffffffff> - Basic salvage fits by race: </color><br>";
1136 str <<
"<url=fitting:16236:31083;2:25861;4:8135;1:31370;1:1319;2:4435;1:5973;1:24348;4::>Amarr</url><color=0xffffffff> - </color>";
1137 str <<
"<url=fitting:16238:25861;4:1319;2:31370;1:31083;2:4435;2:5973;1:24348;4::>Caldari</url><color=0xffffffff> - </color>";
1138 str <<
"<url=fitting:16240:31083;2:25861;4:8135;1:31370;1:1319;2:4435;1:5973;1:24348;4::>Gallente</url><color=0xffffffff> - </color>";
1139 str <<
"<url=fitting:16242:25861;4:1319;2:31370;1:31083;2:6001;1:4435;2:24348;4::>Minmatar</url><color=0xffffffff> </color><br><br>";
1144 str <<
"<b><u><color=0xff00ffff>Mission Runners</color></b></u><br><color=0xffffffff>";
1145 str <<
"Please state where your bookmark will be traded, contracted or if you're hoping to fleet with the salvager looking for work. <br>";
1146 str <<
"If you are contracting or trading bookmarks dont forget to</color> <color=0xff007fff>Abandon all wrecks and containers</color><color=0xffffffff>.</color><br><br>";
1147 str <<
"<b><u><color=0xff00ff00>Useful Links.</color></u><br>";
1148 str <<
"<loc><url=http://evemaps.dotlan.net/>DOTLAN</url></loc></b><color=0xffffffff> - A database of everything you need to know about New Eden; maps, corporations, navigations and much more.</color><color=0xff0000ff>NOTE:</color><color=0xffffffff> While this site is specific for Tranquility, the maps and navigation are the same here on EVEmu.</color><br>";
1149 str <<
"<loc><url=http://o.smium.org>Osmium</url></loc><color=0xffffffff> - A site where pilots post their ship fittings to help players get the most out of their ship class.</color><br>";
1150 str <<
"<loc><url=http://eve-survival.org/wikka.php?wakka=MissionReports>EVE Survival</url></loc><color=0xffffffff> - A database of missions within New Eden. Here you can find information about gaining the upper hand on those sneaky NPCs and how to perfectly run the mission in question.</color><br>";
1151 str <<
"<loc><url=http://www.fuzzwork.co.uk/>Fuzz Work</url></loc><color=0xffffffff> - A brilliant site that has many awesome calculators for LP stores, Blueprints, Invention, Ore and much more!</color><br>";
1152 CreateChannel(100, 2,
"Free Wrecks", str.str().c_str(),
nullptr,
"freewrecks",
LSC::Type::normal,
cspa, 0, 0,
true);
1157 str <<
"<br><color=0xffffffff>Welcome to the</color> <color=0xff00ffff>GM Command</color><color=0xffffffff> channel.<br><br>";
1158 str <<
"This channel is intended for using dot commands.</color>";
1159 CreateChannel(2900000000, 1,
"Command", str.str().c_str(),
nullptr,
"command",
LSC::Type::custom,
cspa, 0, 0,
true);
1166 itr->second->SendServerMOTD(pClient);
1181 Call_TwoIntegerArgs
args;
1182 if (!args.Decode(&call.
tuple)) {
1183 codelog(SERVICE__ERROR,
"%s: Failed to decode arguments.",
GetName());
1195 if (!args.Decode(&call.
tuple)) {
1196 codelog(SERVICE__ERROR,
"%s: Failed to decode arguments.",
GetName());
1200 _log(SERVICE__MESSAGE,
"%s: Received evemail msg with subject '%s': %s", call.
client->
GetName(), args.subject.c_str(), args.body.c_str());
1210 NotifyOnMessage notify;
1211 std::set<uint32> successful_recipients;
1213 notify.subject = subject;
1215 notify.senderID = sender;
1221 std::vector<int32>::const_iterator cur, end;
1222 cur = recipients.begin();
1223 end = recipients.end();
1225 for(; cur != end; cur++) {
1226 uint32 messageID =
m_db->
StoreMail(sender, *cur, subject.c_str(), content.c_str(), notify.sentTime);
1227 if(messageID == 0) {
1228 _log(SERVICE__ERROR,
"Failed to store message from %u for recipient %u", sender, *cur);
1232 notify.messageID = messageID;
1234 _log(SERVICE__MESSAGE,
"Delivered message from %u to recipient %u", sender, *cur);
1236 notify.recipients.push_back(*cur);
1237 successful_recipients.insert(*cur);
1241 PyTuple *answer = notify.Encode();
1242 sEntityList.Multicast(successful_recipients,
"OnMessage",
"*multicastID", &answer,
false);
1252 va_start(args, fmt);
1254 char* str =
nullptr;
1266 Call_SingleIntList
args;
1267 if (!args.Decode(&call.
tuple)) {
1268 codelog(SERVICE__ERROR,
"%s: Failed to decode arguments.",
GetName());
1272 std::vector<int32>::iterator cur, end;
1273 cur = args.ints.begin();
1274 end = args.ints.end();
1275 for(; cur != end; cur++) {
1283 Call_DeleteMessages
args;
1284 if (!args.Decode(&call.
tuple)) {
1285 codelog(SERVICE__ERROR,
"%s: Failed to decode arguments.",
GetName());
1294 std::vector<int32>::iterator cur, end;
1295 cur = args.messages.begin();
1296 end = args.messages.end();
1297 for(; cur != end; cur++) {
LSCChannel * GetChannelByID(int32 channelID)
int32 GetNextAvailableChannelID()
#define sConfig
A macro for easier access to the singleton.
Dispatcher *const m_dispatch
std::string GetRegionName(uint32 id)
#define IsNPCCorp(itemID)
bool MarkMessageRead(uint32 messageID)
#define IsConstellationID(itemID)
uint32 GetSystemID() const
#define _log(type, fmt,...)
PyRep * GetItem(size_t index) const
Returns Python object.
void CreateStaticChannels()
std::map< std::string, PyRep * > byname
PyService * LookupService(const std::string &name)
void DeleteChannel(int32 channelID)
void UpdateSubscription(int32 channelID, Client *pClient)
uint32 GetRegionID() const
std::string GetSolarSystemName(uint32 id)
void SendMail(uint32 sender, uint32 recipient, const std::string &subject, const std::string &content)
PyCallable_Make_InnerDispatcher(LSCService) LSCService
void UpdateChannelInfo(LSCChannel *channel)
std::string GetConstellationName(uint32 id)
void DeleteSubscription(int32 channelID, uint32 charID)
int32 GetCharacterID() const
int32 GetCorporationID() const
PyResult Execute(Client *from, const char *msg)
storage_type::const_iterator const_iterator
uint32 StoreMail(uint32 senderID, uint32 recipID, const char *subject, const char *message, int64 sentTime)
Dispatcher *const m_dispatch
PyRep * GetMailDetails(uint32 messageID, uint32 readerID)
std::string GetAllianceName(uint32 id)
const char * GetName() const
void Dump(FILE *into, const char *pfx) const
Dumps object to file.
void SelfEveMail(const char *subject, const char *fmt,...)
int32 GetAllianceID() const
void SafeDelete(T *&p)
Deletes and nullifies a pointer.
int vasprintf(char **strp, const char *fmt, va_list ap)
#define is_log_enabled(type)
#define sLog
Evaluates to a NewLog instance.
void SafeFree(T *&p)
Frees and nullifies an array pointer.
void CreateSystemChannel(int32 channelID)
std::map< int32, LSCChannel * > m_channels
#define codelog(type, fmt,...)
#define IsKSpaceID(itemID)
void CharacterLogin(Client *pClient)
PyServiceMgr & m_services
std::string GetCorporationName(uint32 id)
PyServiceMgr *const m_manager
uint32 GetConstellationID() const
const char * GetName() const
#define IsPlayerCorp(itemID)
#define IsSquadID(itemID)
PyResult ExecuteCommand(Client *from, const char *msg)
#define PyCallable_REG_CALL(c, m)
void Init(CommandDispatcher *cd)
LSCChannel * CreateChannel(int32 channelID, uint32 ownerID, const char *name, std::string motd, const char *password, const char *compkey, LSC::Type type=LSC::Type::normal, uint32 cspa=0, int32 groupMessageID=0, int32 channelMessageID=0, bool memberless=false, bool maillist=false, bool temporary=false, bool languageRestriction=false)
#define IsFleetID(itemID)
void Dump(LogType type) const
static const int32 BASE_CHANNEL_ID
void SendServerMOTD(Client *pClient)
#define IsAlliance(itemID)
LSCChannel * GetChannelByName(std::string channelName)
bool DeleteMessage(uint32 messageID, uint32 readerID)
void SystemUnload(uint32 systemID, uint32 constID, uint32 regionID)
#define IsRegionID(itemID)
#define IsWSpaceID(itemID)
static const uint32 MAX_CHANNEL_ID
const char * TypeString() const
PyObject * GetMailHeaders(uint32 recID)
CommandDispatcher *const m_commandDispatch