EvEmu  0.8.4
11 September 2021
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
LSCService.h
Go to the documentation of this file.
1 /*
2  ------------------------------------------------------------------------------------
3  LICENSE:
4  ------------------------------------------------------------------------------------
5  This file is part of EVEmu: EVE Online Server Emulator
6  Copyright 2006 - 2021 The EVEmu Team
7  For the latest information visit https://evemu.dev
8  ------------------------------------------------------------------------------------
9  This program is free software; you can redistribute it and/or modify it under
10  the terms of the GNU Lesser General Public License as published by the Free Software
11  Foundation; either version 2 of the License, or (at your option) any later
12  version.
13 
14  This program is distributed in the hope that it will be useful, but WITHOUT
15  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
16  FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
17 
18  You should have received a copy of the GNU Lesser General Public License along with
19  this program; if not, write to the Free Software Foundation, Inc., 59 Temple
20  Place - Suite 330, Boston, MA 02111-1307, USA, or go to
21  http://www.gnu.org/copyleft/lesser.txt.
22  ------------------------------------------------------------------------------------
23  Author: Zhur, Aknor Jaden
24 */
25 
26 
27 #ifndef __LSC_SERVICE_H_INCL__
28 #define __LSC_SERVICE_H_INCL__
29 
30 #include <vector>
31 
32 //#include "utils/Singleton.h"
33 
34 #include "chat/LSCDB.h"
35 #include "chat/LSCChannel.h"
36 #include "PyService.h"
37 
38 
39 class CommandDispatcher;
40 
42 : //public Singleton<ItemFactory>,
43  public PyService
44 {
45 public:
46  // All user-created chat channels are created with IDs that are in this set:
47  // [baseChannelID,maxChannelID] (note the inclusivity in that set)
48  static const int32 BASE_CHANNEL_ID;
49  static const uint32 MAX_CHANNEL_ID;
50 
52  ~LSCService();
53 
54  void Init(CommandDispatcher *cd);
55 
56  PyResult ExecuteCommand(Client *from, const char *msg);
57 
58  void CharacterLogin(Client *pClient);
59  void SendServerMOTD(Client* pClient);
60 
61  void CreateSystemChannel(int32 channelID);
62  void SystemUnload(uint32 systemID, uint32 constID, uint32 regionID);
63 
64  void SendMail(uint32 sender, uint32 recipient, const std::string &subject, const std::string &content) {
65  std::vector<int32> recs(1, recipient);
66  SendMail(sender, recs, subject, content);
67  }
68  void SendMail(uint32 sender, const std::vector<int32> &recipients, const std::string &subject, const std::string &content);
69 
70 protected:
71  class Dispatcher;
72  Dispatcher *const m_dispatch;
74 
76 
77  std::map<int32, LSCChannel*> m_channels; //we own these pointers
78 
79  PyCallable_DECL_CALL(GetChannels);
80  PyCallable_DECL_CALL(GetRookieHelpChannel);
81  PyCallable_DECL_CALL(JoinChannels);
82  PyCallable_DECL_CALL(LeaveChannels);
83  PyCallable_DECL_CALL(LeaveChannel);
86  PyCallable_DECL_CALL(DestroyChannel);
87  PyCallable_DECL_CALL(GetMembers);
88  PyCallable_DECL_CALL(GetMember);
89  PyCallable_DECL_CALL(SendMessage);
90  PyCallable_DECL_CALL(Invite);
91  PyCallable_DECL_CALL(AccessControl);
92 
93  PyCallable_DECL_CALL(GetMyMessages);
94  PyCallable_DECL_CALL(GetMessageDetails);
96  PyCallable_DECL_CALL(MarkMessagesRead);
97  PyCallable_DECL_CALL(DeleteMessages);
98 
99 private:
100  void CreateStaticChannels();
101  LSCChannel *GetChannelByID(int32 channelID);
102  LSCChannel *GetChannelByName(std::string channelName);
103  LSCChannel *CreateChannel(int32 channelID, uint32 ownerID, const char* name, std::string motd, const char* password, const char* compkey,
104  LSC::Type type = LSC::Type::normal, uint32 cspa = 0, int32 groupMessageID = 0, int32 channelMessageID = 0,
105  bool memberless = false, bool maillist = false, bool temporary = false, bool languageRestriction = false);
106 
107 };
108 
109 /* to finish later...
110 //Singleton
111 #define sLscSvc \
112 ( LSCService::get() )
113 */
114 
115 #endif
116 
117 /*{'FullPath': u'UI/Messages', 'messageID': 259365, 'label': u'LSCCannotAccessControlBody'}(u'{msg}', None, {u'{msg}': {'conditionalValues': [], 'variableType': 10, 'propertyName': None, 'args': 0, 'kwargs': {}, 'variableName': 'msg'}})
118  * {'FullPath': u'UI/Messages', 'messageID': 259367, 'label': u'LSCCannotCreateBody'}(u'{msg}', None, {u'{msg}': {'conditionalValues': [], 'variableType': 10, 'propertyName': None, 'args': 0, 'kwargs': {}, 'variableName': 'msg'}})
119  * {'FullPath': u'UI/Messages', 'messageID': 259369, 'label': u'LSCCannotDestroyTitle'}(u'Cannot Destroy Channel', None, None)
120  * {'FullPath': u'UI/Messages', 'messageID': 259370, 'label': u'LSCCannotDestroyBody'}(u'{msg}', None, {u'{msg}': {'conditionalValues': [], 'variableType': 10, 'propertyName': None, 'args': 0, 'kwargs': {}, 'variableName': 'msg'}})
121  * {'FullPath': u'UI/Messages', 'messageID': 259371, 'label': u'LSCCannotJoinTitle'}(u'Cannot Join Channel', None, None)
122  * {'FullPath': u'UI/Messages', 'messageID': 259372, 'label': u'LSCCannotJoinBody'}(u'{msg}', None, {u'{msg}': {'conditionalValues': [], 'variableType': 10, 'propertyName': None, 'args': 0, 'kwargs': {}, 'variableName': 'msg'}})
123  * {'FullPath': u'UI/Messages', 'messageID': 259374, 'label': u'LSCCannotRenameBody'}(u'{msg}', None, {u'{msg}': {'conditionalValues': [], 'variableType': 10, 'propertyName': None, 'args': 0, 'kwargs': {}, 'variableName': 'msg'}})
124  * {'FullPath': u'UI/Messages', 'messageID': 259376, 'label': u'LSCCannotSendMessageBody'}(u'{msg}', None, {u'{msg}': {'conditionalValues': [], 'variableType': 10, 'propertyName': None, 'args': 0, 'kwargs': {}, 'variableName': 'msg'}})
125  * {'FullPath': u'UI/Messages', 'messageID': 259377, 'label': u'LSCCannotSetCSPATitle'}(u'Cannot Configure CSPA', None, None)
126  * {'FullPath': u'UI/Messages', 'messageID': 259378, 'label': u'LSCCannotSetCSPABody'}(u'{msg}', None, {u'{msg}': {'conditionalValues': [], 'variableType': 10, 'propertyName': None, 'args': 0, 'kwargs': {}, 'variableName': 'msg'}})
127  * {'FullPath': u'UI/Messages', 'messageID': 259381, 'label': u'LSCCannotSetCreatorTitle'}(u'Cannot Set Creator', None, None)
128  * {'FullPath': u'UI/Messages', 'messageID': 259382, 'label': u'LSCCannotSetCreatorBody'}(u'{msg}', None, {u'{msg}': {'conditionalValues': [], 'variableType': 10, 'propertyName': None, 'args': 0, 'kwargs': {}, 'variableName': 'msg'}})
129  * {'FullPath': u'UI/Messages', 'messageID': 259387, 'label': u'LSCCannotSetMOTDTitle'}(u'Cannot Set Channel MOTD', None, None)
130  * {'FullPath': u'UI/Messages', 'messageID': 259388, 'label': u'LSCCannotSetMOTDBody'}(u'{msg}', None, {u'{msg}': {'conditionalValues': [], 'variableType': 10, 'propertyName': None, 'args': 0, 'kwargs': {}, 'variableName': 'msg'}})
131  * {'FullPath': u'UI/Messages', 'messageID': 259389, 'label': u'LSCCannotSetMemberlessTitle'}(u'Cannot Configure Channel', None, None)
132  * {'FullPath': u'UI/Messages', 'messageID': 259390, 'label': u'LSCCannotSetMemberlessBody'}(u'{msg}', None, {u'{msg}': {'conditionalValues': [], 'variableType': 10, 'propertyName': None, 'args': 0, 'kwargs': {}, 'variableName': 'msg'}})
133  * {'FullPath': u'UI/Messages', 'messageID': 259391, 'label': u'LSCCannotSetPasswordTitle'}(u'Cannot Set Channel Password', None, None)
134  * {'FullPath': u'UI/Messages', 'messageID': 259392, 'label': u'LSCCannotSetPasswordBody'}(u'{msg}', None, {u'{msg}': {'conditionalValues': [], 'variableType': 10, 'propertyName': None, 'args': 0, 'kwargs': {}, 'variableName': 'msg'}})
135  */
LSCChannel * GetChannelByID(int32 channelID)
Definition: LSCService.cpp:935
void CreateStaticChannels()
void SendMail(uint32 sender, uint32 recipient, const std::string &subject, const std::string &content)
Definition: LSCService.h:64
Dispatcher *const m_dispatch
Definition: LSCService.h:71
signed __int32 int32
Definition: eve-compat.h:49
void CreateSystemChannel(int32 channelID)
Definition: LSCService.cpp:951
std::map< int32, LSCChannel * > m_channels
Definition: LSCService.h:77
void CharacterLogin(Client *pClient)
Definition: LSCService.cpp:907
Definition: LSCDB.h:36
PyResult ExecuteCommand(Client *from, const char *msg)
Definition: Client.h:66
unsigned __int32 uint32
Definition: eve-compat.h:50
Type
Definition: EVE_LSC.h:71
PyCallable_DECL_CALL(GetChannels)
void Init(CommandDispatcher *cd)
Definition: LSCService.cpp:109
LSCService(PyServiceMgr *mgr, 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)
Definition: LSCService.cpp:924
const int cspa
Definition: LSCService.cpp:132
static const int32 BASE_CHANNEL_ID
Definition: LSCService.h:48
void SendServerMOTD(Client *pClient)
LSCChannel * GetChannelByName(std::string channelName)
Definition: LSCService.cpp:943
void SystemUnload(uint32 systemID, uint32 constID, uint32 regionID)
Definition: LSCService.cpp:913
static const uint32 MAX_CHANNEL_ID
Definition: LSCService.h:49
CommandDispatcher *const m_commandDispatch
Definition: LSCService.h:73
LSCDB * m_db
Definition: LSCService.h:75