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

#include "LSCService.h"

Inheritance diagram for LSCService:
Collaboration diagram for LSCService:

Public Member Functions

 LSCService (PyServiceMgr *mgr, CommandDispatcher *cd)
 
 ~LSCService ()
 
void Init (CommandDispatcher *cd)
 
PyResult ExecuteCommand (Client *from, const char *msg)
 
void CharacterLogin (Client *pClient)
 
void SendServerMOTD (Client *pClient)
 
void CreateSystemChannel (int32 channelID)
 
void SystemUnload (uint32 systemID, uint32 constID, uint32 regionID)
 
void SendMail (uint32 sender, uint32 recipient, const std::string &subject, const std::string &content)
 
void SendMail (uint32 sender, const std::vector< int32 > &recipients, const std::string &subject, const std::string &content)
 
- Public Member Functions inherited from PyService
 PyService (PyServiceMgr *mgr, const char *serviceName)
 
virtual ~PyService ()
 
virtual PyResult Call (const std::string &method, PyCallArgs &args)
 
const char * GetName () const
 
- Public Member Functions inherited from PyCallable
 PyCallable ()
 
virtual ~PyCallable ()
 

Static Public Attributes

static const int32 BASE_CHANNEL_ID = 2100000000
 
static const uint32 MAX_CHANNEL_ID = 0xFFFFFFFF
 

Protected Member Functions

 PyCallable_DECL_CALL (GetChannels)
 
 PyCallable_DECL_CALL (GetRookieHelpChannel)
 
 PyCallable_DECL_CALL (JoinChannels)
 
 PyCallable_DECL_CALL (LeaveChannels)
 
 PyCallable_DECL_CALL (LeaveChannel)
 
 PyCallable_DECL_CALL (CreateChannel)
 
 PyCallable_DECL_CALL (Configure)
 
 PyCallable_DECL_CALL (DestroyChannel)
 
 PyCallable_DECL_CALL (GetMembers)
 
 PyCallable_DECL_CALL (GetMember)
 
 PyCallable_DECL_CALL (SendMessage)
 
 PyCallable_DECL_CALL (Invite)
 
 PyCallable_DECL_CALL (AccessControl)
 
 PyCallable_DECL_CALL (GetMyMessages)
 
 PyCallable_DECL_CALL (GetMessageDetails)
 
 PyCallable_DECL_CALL (Page)
 
 PyCallable_DECL_CALL (MarkMessagesRead)
 
 PyCallable_DECL_CALL (DeleteMessages)
 
- Protected Member Functions inherited from PyService
PyObject_BuildCachedReturn (PySubStream **result, const char *sessionInfo, CacheCheckTime check)
 
virtual PyBoundObjectCreateBoundObject (Client *pClient, const PyRep *bind_args)
 
virtual PyResult Handle_MachoResolveObject (PyCallArgs &call)
 
virtual PyResult Handle_MachoBindObject (PyCallArgs &call)
 
- Protected Member Functions inherited from PyCallable
void _SetCallDispatcher (CallDispatcher *d)
 

Protected Attributes

Dispatcher *const m_dispatch
 
CommandDispatcher *const m_commandDispatch
 
LSCDBm_db
 
std::map< int32, LSCChannel * > m_channels
 
- Protected Attributes inherited from PyService
PyServiceMgr *const m_manager
 

Private Member Functions

void CreateStaticChannels ()
 
LSCChannelGetChannelByID (int32 channelID)
 
LSCChannelGetChannelByName (std::string channelName)
 
LSCChannelCreateChannel (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)
 

Additional Inherited Members

- Protected Types inherited from PyService
enum  CacheCheckTime {
  check_Always = 0, check_Never, check_in_year, check_in_6_months,
  check_in_3_months, check_in_1_month, check_in_1_week, check_in_1_day,
  check_in_12_hours, check_in_6_hours, check_in_3_hours, check_in_2_hours,
  check_in_1_hour, check_in_30_minutes, check_in_15_minutes, check_in_5_minutes,
  check_in_1_minute, check_in_30_seconds, check_in_15_seconds, check_in_5_seconds,
  check_in_1_second, _checkCount
}
 
- Static Protected Attributes inherited from PyService
static const char *const s_checkTimeStrings [_checkCount]
 

Detailed Description

Definition at line 41 of file LSCService.h.

Constructor & Destructor Documentation

LSCService::LSCService ( PyServiceMgr mgr,
CommandDispatcher cd 
)
LSCService::~LSCService ( )

Definition at line 100 of file LSCService.cpp.

References m_channels, m_db, m_dispatch, and SafeDelete().

100  {
101  delete m_dispatch;
102  std::map<int32, LSCChannel* >::iterator cur = m_channels.begin();
103  for(; cur != m_channels.end(); cur++) {
104  SafeDelete(cur->second);
105  }
106  SafeDelete(m_db);
107 }
Dispatcher *const m_dispatch
Definition: LSCService.h:71
void SafeDelete(T *&p)
Deletes and nullifies a pointer.
Definition: SafeMem.h:83
std::map< int32, LSCChannel * > m_channels
Definition: LSCService.h:77
LSCDB * m_db
Definition: LSCService.h:75

Here is the call graph for this function:

Member Function Documentation

void LSCService::CharacterLogin ( Client pClient)

Definition at line 907 of file LSCService.cpp.

References CreateSystemChannel(), Client::GetAllianceID(), and Client::GetCorporationID().

Referenced by Client::SelectCharacter().

908 {
911 }
int32 GetCorporationID() const
Definition: Client.h:123
int32 GetAllianceID() const
Definition: Client.h:125
void CreateSystemChannel(int32 channelID)
Definition: LSCService.cpp:951

Here is the call graph for this function:

Here is the caller graph for this function:

LSCChannel * LSCService::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 
)
private

Definition at line 924 of file LSCService.cpp.

References m_channels.

Referenced by CreateStaticChannels(), and CreateSystemChannel().

926  {
927  // test for invalid channelID (alliance not implemented yet)
928  if (channelID == 0)
929  return nullptr;
930 
931  LSCChannel* channel = new LSCChannel(this, channelID, type, ownerID, name, compkey, motd, memberless, password, maillist, cspa, temporary, languageRestriction, groupMessageID, channelMessageID);
932  return (m_channels[channelID] = channel);
933 }
std::map< int32, LSCChannel * > m_channels
Definition: LSCService.h:77
const int cspa
Definition: LSCService.cpp:132

Here is the caller graph for this function:

void LSCService::CreateStaticChannels ( )
private

Definition at line 1034 of file LSCService.cpp.

References CreateChannel(), cspa, LSC::custom, and LSC::normal.

1034  {
1035  // hardcode creating server static channels during server startup
1036  // these are all set to memberless to avoid constant updates
1037  std::ostringstream str;
1038 
1039 // basic template
1040  //CreateChannel(channelID, ownerID, "name", "motd", "password" or nullptr, "*title*", LSC::Type::normal, cspa, 0, 0, true);
1041 
1042 //Help
1043 // Incursion Rookie Help MOTD
1044  str.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>";
1055  //str << "<color=0xffffffff>File a petition (F12 - Petitions - New Petition)</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>";
1060  // str << "Sister of EVE storyline starts in <url=showinfo:5//30005001><u>Arnon</url></b></u> <b>with <url=showinfo:1378//3019356><u>Sister Alitura</url></b></u>. <br><br></color>";
1061  CreateChannel(1, 1, "Rookie Help", str.str().c_str(), nullptr, "help", LSC::Type::normal, cspa, 263238, -1, true);
1062 // Incursion Help MOTD
1063  str.str("");
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>";
1074  //str << "<color=0xffffffff>File a petition (F12 - Petitions - New Petition)</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/*263262*/, true);
1078 //Empires/Factions
1079  CreateChannel(10, 1, "Caldari", "Caldari Faction", nullptr, "caldari", LSC::Type::normal, cspa, 263329, -1/*263268*/, true);
1080  CreateChannel(11, 1, "Amarr", "Amarr Faction", nullptr, "amarr", LSC::Type::normal, cspa, 263329, -1/*263246*/, true);
1081  CreateChannel(12, 1, "Minmatar", "Minmatar Faction", nullptr, "minmatar", LSC::Type::normal, cspa, 263329, -1/*263281*/, true);
1082  CreateChannel(13, 1, "Gallente", "Gallente Faction", nullptr, "gallente", LSC::Type::normal, cspa, 263329, -1/*263271*/, true);
1083  CreateChannel(14, 1, "Jove", "Jove Faction", nullptr, "jove", LSC::Type::normal, cspa, 263329, -1/*263258*/, true);
1084 // Incursion recruitment MOTD...
1085  str.str("");
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.";
1089 //Corporate
1090  CreateChannel(20, 9, "Recruitment", str.str().c_str(), nullptr, "recruitment", LSC::Type::normal, cspa, 263235, -1/*263286*/, true);
1091  str.str("");
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/*263287*/, true);
1095 //Alliance
1096  /*
1097  str.str("");
1098  str << "<color=0xffffffff>Welcome to this</color> <color=0xff00ffff>Alliance</color><color=0xffffffff> channel. This channel is intended for corp CEOs to discuss business as they see fit.</color>";
1099  CreateChannel(31, 1, "Smacktalk", str.str().c_str(), nullptr, "smacktalk", LSC::Type::normal, cspa, 263330, -1, true);
1100  CreateChannel(32, 1, "Rumour Mill", str.str().c_str(), nullptr, "rumourmill", LSC::Type::normal, cspa, 263330, -1, true);
1101  CreateChannel(33, 1, "Freelancer", str.str().c_str(), nullptr, "freelancer", LSC::Type::normal, cspa, 263330, -1, true);
1102  */
1103 //Trade
1104  str.str("");
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/*263277*/, true);
1108  CreateChannel(41, 1, "Ships", str.str().c_str(), nullptr, "ships", LSC::Type::normal, cspa, 263240, -1/*263245*/, true);
1109  CreateChannel(42, 1, "Blueprints", str.str().c_str(), nullptr, "blueprints", LSC::Type::normal, cspa, 263240, -1/*263292*/, true);
1110  CreateChannel(43, 1, "Modules and Munitions", str.str().c_str(), nullptr, "modulesandmunitions", LSC::Type::normal, cspa, 263240, -1/*263254*/, true);
1111  CreateChannel(44, 1, "Minerals and Manufacturing", str.str().c_str(), nullptr, "mineralsandmanufacturing", LSC::Type::normal, cspa, 263240, -1/*263275*/, true);
1112 //Science and Industry
1113  str.str("");
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/*263365*/, true);
1117  CreateChannel(51, 1, "Invention", str.str().c_str(), nullptr, "invention", LSC::Type::normal, cspa, 263331, -1/*263366*/, true);
1118  CreateChannel(52, 1, "Manufacturing", str.str().c_str(), nullptr, "manufacturing", LSC::Type::normal, cspa, 263331, -1/*263367*/, true);
1119  CreateChannel(53, 1, "Mining", str.str().c_str(), nullptr, "mining", LSC::Type::normal, cspa, 263331, -1/*263368*/, true);
1120  CreateChannel(54, 1, "Planetary Interaction", str.str().c_str(), nullptr, "planetaryinteraction", LSC::Type::normal, cspa, 263331, -1/*263369*/, true);
1121  CreateChannel(55, 1, "Research", str.str().c_str(), nullptr, "research", LSC::Type::normal, cspa, 263331, -1/*263370*/, true);
1122 //Groups/Content
1123  str.str("");
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/*263289*/, true);
1127  CreateChannel(61, 1, "Ratting", str.str().c_str(), nullptr, "ratting", LSC::Type::normal, cspa, 263328, -1/*263338*/, true);
1128  CreateChannel(62, 1, "Scanning", str.str().c_str(), nullptr, "scanning", LSC::Type::normal, cspa, 263328, -1/*263339*/, true);
1129  CreateChannel(63, 1, "Wormholes", str.str().c_str(), nullptr, "wormholes", LSC::Type::normal, cspa, 263328, -1/*263340*/, true);
1130 //Misc
1131  str.str("");
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>";
1140  /* this suggests t2 shit which isnt available yet
1141  str << "<b><color=0xff00ff00>Omegas</color></b><color=0xffffffff> - You should be able to use a </color><url=showinfo:2998>Noctis</url>";
1142  str << "<color=0xffffffff>, </color><url=showinfo:30836>Salvager II's</url><color=0xffffffff> &amp; </color><url=showinfo:4250>Tractor Beam II's</url><br>";
1143  */
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); //256739 <-- this was messageID from error about "channel already joined"
1153  //CreateChannel(101, 1, "", "motd", nullptr, "*title*", LSC::Type::normal, cspa, 0, 0, true);
1154 
1155 //GM Command channel
1156  str.str("");
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);
1160 }
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)
Definition: LSCService.cpp:924
const int cspa
Definition: LSCService.cpp:132

Here is the call graph for this function:

void LSCService::CreateSystemChannel ( int32  channelID)
Todo:
i know this isnt used much, but wtf was i thinking hitting db for names, when they are in static data??

Definition at line 951 of file LSCService.cpp.

References LSC::alliance, LSC::constellation, LSC::corp, CreateChannel(), cspa, LSC::fleet, LSCDB::GetAllianceName(), LSCDB::GetConstellationName(), LSCDB::GetCorporationName(), LSCDB::GetRegionName(), LSCDB::GetSolarSystemName(), IsAlliance, IsConstellationID, IsFleetID, IsKSpaceID, IsNPCCorp, IsPlayerCorp, IsRegionID, IsSquadID, IsWingID, IsWSpaceID, m_channels, m_db, LSC::normal, LSC::region, sFltSvc, LSC::solarsystem, LSC::solarsystem2, LSC::squad, and LSC::wing.

Referenced by SystemManager::BootSystem(), CharacterLogin(), FleetService::CreateFleet(), FleetService::CreateSquad(), and FleetService::CreateWing().

952 {
953  if (channelID == 0)
954  return;
955  if (m_channels.find(channelID) != m_channels.end())
956  return;
957 
959  std::string name= "", motd = "";
960  int32 messageID = -1, grpMsgID = 0;
961  uint32 ownerID = channelID;
962 
964  if (IsRegionID(channelID)) {
965  type = LSC::Type::region;
966  name = "Region";
967  motd = m_db->GetRegionName(channelID);
968  grpMsgID = 1;
969  } else if (IsConstellationID(channelID)) {
971  name = "Constellation";
972  motd = m_db->GetConstellationName(channelID);
973  grpMsgID = 2;
974  } else if (IsKSpaceID(channelID)) {
976  name = "Local";
977  motd = m_db->GetSolarSystemName(channelID);
978  grpMsgID = 3;
979  } else if (IsWSpaceID(channelID)) {
980  type = LSC::Type::solarsystem;
981  name = "System";
982  motd = m_db->GetSolarSystemName(channelID);
983  grpMsgID = 3;
984  } else if (IsNPCCorp(channelID)) {
985  type = LSC::Type::corp;
986  name = "Corp";
987  motd = m_db->GetCorporationName(channelID);
988  grpMsgID = 263235;
989  } else if (IsPlayerCorp(channelID)) {
990  type = LSC::Type::corp;
991  name = "Corp";
992  motd = m_db->GetCorporationName(channelID);
993  grpMsgID = 263235;
994  messageID = 0;
995  } else if (IsAlliance(channelID)) {
996  type = LSC::Type::alliance;
997  name = "Alliance";
998  motd = m_db->GetAllianceName(channelID);
999  grpMsgID = 5;
1000  messageID = 0;
1001  } else if (IsFleetID(channelID)) {
1002  type = LSC::Type::fleet;
1003  name = sFltSvc.GetFleetName(channelID);
1004  motd = sFltSvc.GetFleetDescription(channelID);
1005  messageID = 0;
1006  ownerID = sFltSvc.GetFleetLeaderID(channelID);
1007  } else if (IsWingID(channelID)) {
1008  type = LSC::Type::wing;
1009  name = sFltSvc.GetWingName(channelID);
1010  motd = name;
1011  motd += "<br>";
1012  motd += sFltSvc.GetFleetDescription(channelID);
1013  messageID = 0;
1014  //ownerID = sFltSvc.GetWingLeaderID(channelID);
1015  ownerID = sFltSvc.GetFleetLeaderID(channelID);
1016  } else if (IsSquadID(channelID)) {
1017  type = LSC::Type::squad;
1018  name = sFltSvc.GetSquadName(channelID);
1019  motd = name;
1020  motd += "<br>";
1021  motd += sFltSvc.GetFleetDescription(channelID);
1022  messageID = 0;
1023  //ownerID = sFltSvc.GetSquadLeaderID(channelID);
1024  ownerID = sFltSvc.GetFleetLeaderID(channelID);
1025  } else {
1026  // not sure what to do here....should never hit
1027  }
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);
1032 }
std::string GetRegionName(uint32 id)
Definition: LSCDB.h:52
#define IsNPCCorp(itemID)
Definition: EVE_Defines.h:238
#define IsConstellationID(itemID)
Definition: EVE_Defines.h:276
std::string GetSolarSystemName(uint32 id)
Definition: LSCDB.h:54
std::string GetConstellationName(uint32 id)
Definition: LSCDB.h:53
std::string GetAllianceName(uint32 id)
Definition: LSCDB.h:56
signed __int32 int32
Definition: eve-compat.h:49
#define sFltSvc
Definition: FleetService.h:147
std::map< int32, LSCChannel * > m_channels
Definition: LSCService.h:77
#define IsKSpaceID(itemID)
Definition: EVE_Defines.h:285
std::string GetCorporationName(uint32 id)
Definition: LSCDB.h:55
#define IsPlayerCorp(itemID)
Definition: EVE_Defines.h:241
#define IsSquadID(itemID)
Definition: EVE_Defines.h:231
unsigned __int32 uint32
Definition: eve-compat.h:50
Type
Definition: EVE_LSC.h:71
#define IsWingID(itemID)
Definition: EVE_Defines.h:228
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)
Definition: LSCService.cpp:924
#define IsFleetID(itemID)
Definition: EVE_Defines.h:225
const int cspa
Definition: LSCService.cpp:132
#define IsAlliance(itemID)
Definition: EVE_Defines.h:244
#define IsRegionID(itemID)
Definition: EVE_Defines.h:273
#define IsWSpaceID(itemID)
Definition: EVE_Defines.h:282
LSCDB * m_db
Definition: LSCService.h:75

Here is the call graph for this function:

Here is the caller graph for this function:

PyResult LSCService::ExecuteCommand ( Client from,
const char *  msg 
)

Definition at line 1304 of file LSCService.cpp.

References CommandDispatcher::Execute(), and m_commandDispatch.

1304  {
1305  return(m_commandDispatch->Execute(from, msg));
1306 }
PyResult Execute(Client *from, const char *msg)
CommandDispatcher *const m_commandDispatch
Definition: LSCService.h:73

Here is the call graph for this function:

LSCChannel * LSCService::GetChannelByID ( int32  channelID)
private

Definition at line 935 of file LSCService.cpp.

References m_channels.

936 {
937  std::map<int32, LSCChannel*>::iterator itr = m_channels.find(channelID);
938  if (itr != m_channels.end())
939  return itr->second;
940  return nullptr;
941 }
std::map< int32, LSCChannel * > m_channels
Definition: LSCService.h:77
LSCChannel * LSCService::GetChannelByName ( std::string  channelName)
private

Definition at line 943 of file LSCService.cpp.

References m_channels.

944 {
945  for (auto cur : m_channels)
946  if (cur.second->GetDisplayName() == channelName)
947  return cur.second;
948  return nullptr;
949 }
std::map< int32, LSCChannel * > m_channels
Definition: LSCService.h:77
void LSCService::Init ( CommandDispatcher cd)

Definition at line 109 of file LSCService.cpp.

110 {
111 
112 }
LSCService::PyCallable_DECL_CALL ( GetChannels  )
protected
LSCService::PyCallable_DECL_CALL ( GetRookieHelpChannel  )
protected
LSCService::PyCallable_DECL_CALL ( JoinChannels  )
protected
LSCService::PyCallable_DECL_CALL ( LeaveChannels  )
protected
LSCService::PyCallable_DECL_CALL ( LeaveChannel  )
protected
LSCService::PyCallable_DECL_CALL ( CreateChannel  )
protected
LSCService::PyCallable_DECL_CALL ( Configure  )
protected
LSCService::PyCallable_DECL_CALL ( DestroyChannel  )
protected
LSCService::PyCallable_DECL_CALL ( GetMembers  )
protected
LSCService::PyCallable_DECL_CALL ( GetMember  )
protected
LSCService::PyCallable_DECL_CALL ( SendMessage  )
protected
LSCService::PyCallable_DECL_CALL ( Invite  )
protected
LSCService::PyCallable_DECL_CALL ( AccessControl  )
protected
LSCService::PyCallable_DECL_CALL ( GetMyMessages  )
protected
LSCService::PyCallable_DECL_CALL ( GetMessageDetails  )
protected
LSCService::PyCallable_DECL_CALL ( Page  )
protected
LSCService::PyCallable_DECL_CALL ( MarkMessagesRead  )
protected
LSCService::PyCallable_DECL_CALL ( DeleteMessages  )
protected
void LSCService::SendMail ( uint32  sender,
uint32  recipient,
const std::string &  subject,
const std::string &  content 
)
inline

Definition at line 64 of file LSCService.h.

Referenced by Client::SelfEveMail().

64  {
65  std::vector<int32> recs(1, recipient);
66  SendMail(sender, recs, subject, content);
67  }
void SendMail(uint32 sender, uint32 recipient, const std::string &subject, const std::string &content)
Definition: LSCService.h:64

Here is the caller graph for this function:

void LSCService::SendMail ( uint32  sender,
const std::vector< int32 > &  recipients,
const std::string &  subject,
const std::string &  content 
)

Definition at line 1209 of file LSCService.cpp.

References _log, m_db, sEntityList, LSCDB::StoreMail(), and Win32TimeNow().

1209  {
1210  NotifyOnMessage notify;
1211  std::set<uint32> successful_recipients;
1212 
1213  notify.subject = subject;
1214  notify.sentTime = Win32TimeNow();
1215  notify.senderID = sender;
1216 
1217  // there's attachmentID and messageID... does this means a single message can contain multiple attachments?
1218  // eg. text/plain and text/html? we should be watching for this at reading mails...
1219  // created should be creation time. But Win32TimeNow returns int64, and is stored as bigint(20),
1220  // so change in the db is needed
1221  std::vector<int32>::const_iterator cur, end;
1222  cur = recipients.begin();
1223  end = recipients.end();
1224 
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);
1229  continue;
1230  }
1231  //TODO: supposed to have a different messageID in each notify I suspect..
1232  notify.messageID = messageID;
1233 
1234  _log(SERVICE__MESSAGE, "Delivered message from %u to recipient %u", sender, *cur);
1235  //record this person in the 'delivered to' list:
1236  notify.recipients.push_back(*cur);
1237  successful_recipients.insert(*cur);
1238  }
1239 
1240  //now, send a notification to each successful recipient
1241  PyTuple *answer = notify.Encode();
1242  sEntityList.Multicast(successful_recipients, "OnMessage", "*multicastID", &answer, false);
1243 }
#define _log(type, fmt,...)
Definition: logsys.h:124
#define sEntityList
Definition: EntityList.h:208
uint32 StoreMail(uint32 senderID, uint32 recipID, const char *subject, const char *message, int64 sentTime)
Definition: LSCDB.cpp:399
Python tuple.
Definition: PyRep.h:567
int64 Win32TimeNow()
Definition: utils_time.cpp:70
unsigned __int32 uint32
Definition: eve-compat.h:50
LSCDB * m_db
Definition: LSCService.h:75

Here is the call graph for this function:

void LSCService::SendServerMOTD ( Client pClient)

Definition at line 1162 of file LSCService.cpp.

References Client::GetSystemID(), and m_channels.

Referenced by Client::SelectCharacter().

1163 {
1164  std::map<int32, LSCChannel*>::iterator itr = m_channels.find(pClient->GetSystemID());
1165  if (itr != m_channels.end())
1166  itr->second->SendServerMOTD(pClient);
1167 }
uint32 GetSystemID() const
Definition: Client.h:152
std::map< int32, LSCChannel * > m_channels
Definition: LSCService.h:77

Here is the call graph for this function:

Here is the caller graph for this function:

void LSCService::SystemUnload ( uint32  systemID,
uint32  constID,
uint32  regionID 
)
Todo:
find a way to track usages of region and const channels to delete when no longer used

Definition at line 913 of file LSCService.cpp.

References m_channels, and SafeDelete().

Referenced by SystemManager::UnloadSystem().

914 {
915  std::map<int32, LSCChannel*>::iterator itr = m_channels.find(systemID);
916  if (itr != m_channels.end()) {
917  SafeDelete(itr->second);
918  m_channels.erase(itr);
919  }
921  // is this needed?
922 }
void SafeDelete(T *&p)
Deletes and nullifies a pointer.
Definition: SafeMem.h:83
std::map< int32, LSCChannel * > m_channels
Definition: LSCService.h:77

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

const int32 LSCService::BASE_CHANNEL_ID = 2100000000
static
Todo:
LSC system todo list... to implement... channel password private chat invite more

to fix... channelID system more

fleet shit... BOSS/FC/WC/SC should be able to moderate text in their respective fleet chat as needed. They should have the power to dictate text color of their type, and silence people who shouldn't be talking..

Definition at line 48 of file LSCService.h.

Referenced by LSCDB::GetNextAvailableChannelID().

std::map<int32, LSCChannel*> LSCService::m_channels
protected
CommandDispatcher* const LSCService::m_commandDispatch
protected

Definition at line 73 of file LSCService.h.

Referenced by ExecuteCommand().

LSCDB* LSCService::m_db
protected

Definition at line 75 of file LSCService.h.

Referenced by CreateSystemChannel(), SendMail(), and ~LSCService().

Dispatcher* const LSCService::m_dispatch
protected

Definition at line 71 of file LSCService.h.

Referenced by ~LSCService().

const uint32 LSCService::MAX_CHANNEL_ID = 0xFFFFFFFF
static

Definition at line 49 of file LSCService.h.

Referenced by LSCDB::GetNextAvailableChannelID().


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