#include <login_server.h>
Nevrax France
Definition at line 65 of file login_server.h.
Static Public Member Functions | |
void | clientDisconnected (uint32 userId) |
std::string | CLoginServer::isValidCookie (const CLoginCookie &lc, std::string &userName, std::string &userPriv) |
Used only in UDP, check if the cookie is valid. return empty string if valid, reason otherwise. | |
void | init (CUdpSock &server, TDisconnectClientCallback dc) |
void | init (CCallbackServer &server, TNewClientCallback ncl) |
Static Private Member Functions | |
void | connectToWS () |
This function is used by init() to create the connection to the Welcome Service. | |
void | init (const std::string &listenAddress) |
|
Call this method when a user is disconnected or the server disconnect the user. This method will warn the login system that the user is not here anymore Definition at line 413 of file login_server.cpp. References NLNET::ModeTcp, NLMISC::CMemStream::serial(), uint32, uint8, and NLNET::UserIdSockAssociations.
|
|
Used only in UDP, check if the cookie is valid. return empty string if valid, reason otherwise.
|
|
This function is used by init() to create the connection to the Welcome Service.
Definition at line 408 of file login_server.cpp. References NLNET::WSCallbackArray. Referenced by init().
00409 { 00410 CUnifiedNetwork::getInstance()->addCallbackArray(WSCallbackArray, sizeof(WSCallbackArray)/sizeof(WSCallbackArray[0])); 00411 } |
|
Definition at line 295 of file login_server.cpp. References NLNET::cfcbAcceptInvalidCookie(), NLNET::cfcbDefaultUserPriv(), NLNET::cfcbListenAddress(), NLNET::cfcbTimeBeforeEraseCookie(), connectToWS(), and NLNET::setListenAddress().
00296 { 00297 // connect to the welcome service 00298 connectToWS (); 00299 00300 try { 00301 cfcbDefaultUserPriv(IService::getInstance()->ConfigFile.getVar("DefaultUserPriv")); 00302 IService::getInstance()->ConfigFile.setCallback("DefaultUserPriv", cfcbDefaultUserPriv); 00303 } catch(Exception &) { } 00304 00305 try { 00306 cfcbAcceptInvalidCookie (IService::getInstance()->ConfigFile.getVar("AcceptInvalidCookie")); 00307 IService::getInstance()->ConfigFile.setCallback("AcceptInvalidCookie", cfcbAcceptInvalidCookie); 00308 } catch(Exception &) { } 00309 00310 try { 00311 cfcbTimeBeforeEraseCookie (IService::getInstance()->ConfigFile.getVar("TimeBeforeEraseCookie")); 00312 IService::getInstance()->ConfigFile.setCallback("TimeBeforeEraseCookie", cfcbTimeBeforeEraseCookie); 00313 } catch(Exception &) { } 00314 00315 // setup the listen address 00316 00317 string la; 00318 00319 if (IService::getInstance()->haveArg('D')) 00320 { 00321 // use the command line param if set 00322 la = IService::getInstance()->getArg('D'); 00323 } 00324 else if (IService::getInstance()->ConfigFile.exists ("ListenAddress")) 00325 { 00326 // use the config file param if set 00327 la = IService::getInstance()->ConfigFile.getVar ("ListenAddress").asString(); 00328 } 00329 else 00330 { 00331 la = listenAddress; 00332 } 00333 setListenAddress (la); 00334 IService::getInstance()->ConfigFile.setCallback("ListenAddress", cfcbListenAddress); 00335 } |
|
Create the connection to the Welcome Service for an UDP connection the dc will be call when the Welcome Service decides to disconnect a player (double login...) Definition at line 353 of file login_server.cpp. References NLNET::CInetAddress::asIPString(), NLNET::DisconnectClientCallback, init(), NLNET::CSock::localAddr(), NLNET::ModeTcp, and NLNET::TDisconnectClientCallback.
00354 { 00355 init (server.localAddr ().asIPString()); 00356 00357 DisconnectClientCallback = dc; 00358 00359 ModeTcp = false; 00360 } |
|
Create the connection to the Welcome Service and install callbacks to the callback server (for a TCP connection) init() will try to find the ListenAddress in the config file and it will be used to say to the client the address to connect to this frontend (using the login system). You can modify this in real time in the config file or with the ls_listen_address command The ListenAddress must be in the form of "itsalive.nevrax.org:38000" (ip+port) Definition at line 338 of file login_server.cpp. References NLNET::CCallbackNetBase::addCallbackArray(), NLNET::CInetAddress::asIPString(), NLNET::ClientCallbackArray, NLNET::ClientConnection(), NLNET::CBufServer::listenAddress(), NLNET::ModeTcp, NLNET::NewClientCallback, NLNET::Server, NLNET::CCallbackServer::setConnectionCallback(), and NLNET::TNewClientCallback. Referenced by init().
00339 { 00340 init (server.listenAddress ().asIPString()); 00341 00342 // add callback to the server 00343 server.addCallbackArray (ClientCallbackArray, sizeof (ClientCallbackArray) / sizeof (ClientCallbackArray[0])); 00344 server.setConnectionCallback (ClientConnection, NULL); 00345 00346 NewClientCallback = ncl; 00347 Server = &server; 00348 00349 ModeTcp = true; 00350 } |