Merge branch '138-toggle-free-look-with-hotkey' into main/gingo-test
[ryzomcore.git] / nelns / login_service / login_service.h
blobc98804ff577b83f281a7635e277f82817649609e
1 // NeLNS - MMORPG Framework <http://dev.ryzom.com/projects/nel/>
2 // Copyright (C) 2010 Winch Gate Property Limited
3 //
4 // This source file has been modified by the following contributors:
5 // Copyright (C) 2014 Jan BOON (Kaetemi) <jan.boon@kaetemi.be>
6 //
7 // This program is free software: you can redistribute it and/or modify
8 // it under the terms of the GNU Affero General Public License as
9 // published by the Free Software Foundation, either version 3 of the
10 // License, or (at your option) any later version.
12 // This program is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 // GNU Affero General Public License for more details.
17 // You should have received a copy of the GNU Affero General Public License
18 // along with this program. If not, see <http://www.gnu.org/licenses/>.
20 #ifndef NL_LOGIN_SERVICE_H
21 #define NL_LOGIN_SERVICE_H
23 // we have to include windows.h because mysql.h uses it but not include it
24 #ifdef NL_OS_WINDOWS
25 # ifndef NL_COMP_MINGW
26 # define NOMINMAX
27 # endif
28 # include <winsock2.h>
29 # include <windows.h>
30 typedef unsigned long ulong;
31 #endif
33 #include <mysql.h>
35 #include "nel/misc/types_nl.h"
37 #include "nel/misc/debug.h"
38 #include "nel/misc/config_file.h"
39 #include "nel/misc/displayer.h"
40 #include "nel/misc/log.h"
42 #include "nel/net/service.h"
44 using namespace std;
45 using namespace NLMISC;
46 using namespace NLNET;
48 // Structures
50 struct CFrontEnd
52 CFrontEnd(TServiceId sid, bool patching, const std::string& patchingURI) : SId(sid), Patching(patching), PatchURI(patchingURI) {}
54 TServiceId SId; // Service Id of the frontend on the remote shard
55 bool Patching; // Is FS in patching mode
56 std::string PatchURI; // Patch URI
59 struct CShard
61 CShard (uint32 shardId, TServiceId sid) : ShardId(shardId), NbPlayers(0), SId(sid) {}
63 sint32 ShardId; // unique shard id generated by the database, used to identify a WS
64 uint32 NbPlayers; // number of player for *this* LS, the total number of player for a shard is in the database
65 TServiceId SId; // unique service id used to identify the connection when a callback happen
67 std::vector<CFrontEnd> FrontEnds; // frontends on the shard
71 // Variables
73 extern CLog* Output;
75 extern std::vector<CShard> Shards;
77 // Functions
79 sint findShardWithSId (NLNET::TServiceId sid);
80 sint findShard (sint32 shardId);
82 void displayShards ();
83 void displayUsers ();
84 sint findUser (uint32 Id);
85 void beep (uint freq = 400, uint nb = 2, uint beepDuration = 100, uint pauseDuration = 100);
88 * disconnectClient is true if we need to disconnect the client on connected on the login system (during the login process)
89 * disconnectShard is true if we need to send a message to the shard to disconnect the client from the shard
91 //void disconnectClient (CUser &user, bool disconnectClient, bool disconnectShard);
95 #endif // NL_LOGIN_SERVICE_H
97 /* End of login_service.h */