EvEmu  0.8.4
11 September 2021
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
NotificationMgrService.cpp
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: caytchen
24 */
25 
26 #include "eve-server.h"
27 
28 #include "PyServiceCD.h"
30 
32 
33 // this service is part of mail and used with the 'notifications' tab of mail window
34 
36 : PyService(mgr, "notificationMgr"),
37  m_dispatch(new Dispatcher(this))
38 {
39  _SetCallDispatcher(m_dispatch);
40 
43  PyCallable_REG_CALL(NotificationMgrService, MarkGroupAsProcessed);
44  PyCallable_REG_CALL(NotificationMgrService, MarkAllAsProcessed);
46  PyCallable_REG_CALL(NotificationMgrService, DeleteGroupNotifications);
47  PyCallable_REG_CALL(NotificationMgrService, DeleteAllNotifications);
48  PyCallable_REG_CALL(NotificationMgrService, DeleteNotifications);
49 }
50 
52  delete m_dispatch;
53 }
54 
55 PyResult NotificationMgrService::Handle_GetByGroupID(PyCallArgs &call)
56 {
57 
58  sLog.White("NotificationMgrService", "Handle_GetByGroupID() size=%u", call.tuple->size() );
59  call.Dump(MAIL__DUMP);
60  /*
61  [PyString "GetByGroupID"]
62  [PyTuple 1 items]
63  [PyInt 9]
64  {returns}
65  [PyObjectEx Type2]
66  [PyTuple 2 items]
67  [PyTuple 1 items]
68  [PyToken dbutil.CRowset]
69  [PyDict 1 kvp]
70  [PyString "header"]
71  [PyObjectEx Normal]
72  [PyTuple 2 items]
73  [PyToken blue.DBRowDescriptor]
74  [PyTuple 1 items]
75  [PyTuple 8 items]
76  [PyTuple 2 items]
77  [PyString "notificationID"]
78  [PyInt 3]
79  [PyTuple 2 items]
80  [PyString "typeID"]
81  [PyInt 3]
82  [PyTuple 2 items]
83  [PyString "senderID"]
84  [PyInt 3]
85  [PyTuple 2 items]
86  [PyString "receiverID"]
87  [PyInt 3]
88  [PyTuple 2 items]
89  [PyString "processed"]
90  [PyInt 11]
91  [PyTuple 2 items]
92  [PyString "created"]
93  [PyInt 64]
94  [PyTuple 2 items]
95  [PyString "data"]
96  [PyInt 130]
97  [PyTuple 2 items]
98  [PyString "deleted"]
99  [PyInt 11]
100  */
101  // yes, i have the packet, but wtf is this?
102  Call_SingleIntegerArg args;
103  if (!args.Decode(&call.tuple)) {
104  codelog(SERVICE__ERROR, "%s: Failed to decode arguments.", GetName());
105  return nullptr;
106  }
107 
108  int groupID = args.arg;
109  return new PyTuple(0);
110 }
111 
112 PyResult NotificationMgrService::Handle_GetUnprocessed(PyCallArgs &call)
113 {
114  // called when mail window's notifications tab opened
115  // see /journal/GetUnprocessed for info..
116 
117  return new PyTuple(0);
118 }
119 
120 PyResult NotificationMgrService::Handle_MarkGroupAsProcessed(PyCallArgs &call)
121 {
122  Call_SingleIntegerArg args;
123  if (!args.Decode(&call.tuple)) {
124  codelog(SERVICE__ERROR, "%s: Failed to decode arguments.", GetName());
125  return nullptr;
126  }
127 
128  int groupID = args.arg;
129  return nullptr;
130 }
131 
132 PyResult NotificationMgrService::Handle_MarkAllAsProcessed(PyCallArgs &call)
133 {
134  return nullptr;
135 }
136 
137 PyResult NotificationMgrService::Handle_MarkAsProcessed(PyCallArgs &call)
138 {
139  Call_SingleArg args;
140  if (!args.Decode(&call.tuple)) {
141  codelog(SERVICE__ERROR, "%s: Failed to decode arguments.", GetName());
142  return nullptr;
143  }
144 
145  PyRep* notificationsList = args.arg;
146  return nullptr;
147 }
148 
149 PyResult NotificationMgrService::Handle_DeleteGroupNotifications(PyCallArgs &call)
150 {
151  Call_SingleIntegerArg args;
152  if (!args.Decode(&call.tuple)) {
153  codelog(SERVICE__ERROR, "%s: Failed to decode arguments.", GetName());
154  return nullptr;
155  }
156 
157  int groupID = args.arg;
158  return nullptr;
159 }
160 
161 PyResult NotificationMgrService::Handle_DeleteAllNotifications(PyCallArgs &call)
162 {
163  return nullptr;
164 }
165 
166 PyResult NotificationMgrService::Handle_DeleteNotifications(PyCallArgs &call)
167 {
168  Call_SingleArg args;
169  if (!args.Decode(&call.tuple)) {
170  codelog(SERVICE__ERROR, "%s: Failed to decode arguments.", GetName());
171  return nullptr;
172  }
173 
174  PyRep* notificationsIDs = args.arg;
175  return nullptr;
176 }
Base Python wire object.
Definition: PyRep.h:66
Dispatcher *const m_dispatch
size_t size() const
Definition: PyRep.h:591
Python tuple.
Definition: PyRep.h:567
const char * GetName() const
Definition: PyService.h:54
* args
#define sLog
Evaluates to a NewLog instance.
Definition: LogNew.h:250
#define codelog(type, fmt,...)
Definition: logsys.h:128
#define PyCallable_REG_CALL(c, m)
Definition: PyServiceCD.h:78
void Dump(LogType type) const
Definition: PyCallable.cpp:81
PyCallable_Make_InnerDispatcher(NotificationMgrService) NotificationMgrService
PyTuple * tuple
Definition: PyCallable.h:50