EvEmu  0.8.4
11 September 2021
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
BrowserLockdownSvc.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: Captnoord
24  Updates: Allan
25 */
26 
27 #include "eve-server.h"
28 #include "EVE_Consts.h"
29 
30 #include "PyServiceCD.h"
32 
33 
35 
37 : PyService(mgr, "browserLockdownSvc"),
38  m_dispatch(new Dispatcher(this))
39 {
40  _SetCallDispatcher(m_dispatch);
41 
42  PyCallable_REG_CALL(BrowserLockdownService, GetFlaggedSitesHash);
43  PyCallable_REG_CALL(BrowserLockdownService, GetFlaggedSitesList);
44  PyCallable_REG_CALL(BrowserLockdownService, GetDefaultHomePage);
45  PyCallable_REG_CALL(BrowserLockdownService, IsBrowserInLockdown);
46 }
47 
49  delete m_dispatch;
50 }
51 
52 PyResult BrowserLockdownService::Handle_GetFlaggedSitesHash(PyCallArgs &call)
53 {
54  /* Future updates should be the md5 sum of the cache/browser/flaggedsites.dat file from user/appdata/Local/CCP/EVE
55  * as we dont have this list (which is sent from GetFlaggedSitesList), we send the md5 sum for an empty set.
56  */
57  return new PyString("df98509e1e3f0dd839083e7be1d2b360"); // mine
58  //return new PyString("d751713988987e9331980363e24189ce"); // avianrr
59 }
60 
61 PyResult BrowserLockdownService::Handle_GetFlaggedSitesList(PyCallArgs &call)
62 {
63  // all packets show none here, however, this throws error for me in crucible.
64  // needs to be empty list to play nice with above hash
65  return PyStatic.mtList();
66 }
67 
68 PyResult BrowserLockdownService::Handle_GetDefaultHomePage(PyCallArgs &call)
69 {
70  return new PyWString(HomePageURL);
71 }
72 
73 PyResult BrowserLockdownService::Handle_IsBrowserInLockdown(PyCallArgs &call)
74 {
75  return new PyBool(sConfig.server.DisableIGB);
76 }
#define sConfig
A macro for easier access to the singleton.
Dispatcher *const m_dispatch
Python string.
Definition: PyRep.h:430
Dispatcher *const m_dispatch
Python wide string.
Definition: PyRep.h:475
Python boolean.
Definition: PyRep.h:323
PyCallable_Make_InnerDispatcher(BrowserLockdownService) BrowserLockdownService
#define PyStatic
Definition: PyRep.h:1209
#define PyCallable_REG_CALL(c, m)
Definition: PyServiceCD.h:78
const std::string HomePageURL
Definition: EVE_Consts.h:11