mirror of
https://port.numenaute.org/aleajactaest/khanat-opennel-code.git
synced 2024-11-26 17:16:20 +00:00
Changed: moved nelns file in ryzom directories
This commit is contained in:
parent
71486048f7
commit
8fcec5faf7
11 changed files with 3980 additions and 158 deletions
|
@ -86,75 +86,6 @@
|
|||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Debug|x64"
|
||||
OutputDirectory="..\..\..\obj64\$(ConfigurationName)\$(ProjectName)"
|
||||
IntermediateDirectory="..\..\..\obj64\$(ConfigurationName)\$(ProjectName)"
|
||||
ConfigurationType="4"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
TargetEnvironment="3"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="4"
|
||||
InlineFunctionExpansion="1"
|
||||
AdditionalIncludeDirectories=".."
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;LIBXML_STATIC"
|
||||
StringPooling="true"
|
||||
MinimalRebuild="true"
|
||||
ExceptionHandling="2"
|
||||
BasicRuntimeChecks="3"
|
||||
SmallerTypeCheck="true"
|
||||
RuntimeLibrary="3"
|
||||
UsePrecompiledHeader="2"
|
||||
PrecompiledHeaderThrough="stdpch.h"
|
||||
WarningLevel="3"
|
||||
DebugInformationFormat="3"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLibrarianTool"
|
||||
OutputFile="..\..\..\lib64\$(ProjectName)_d.lib"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory="..\..\..\obj\$(ConfigurationName)\$(ProjectName)"
|
||||
|
@ -226,6 +157,75 @@
|
|||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Debug|x64"
|
||||
OutputDirectory="..\..\..\obj64\$(ConfigurationName)\$(ProjectName)"
|
||||
IntermediateDirectory="..\..\..\obj64\$(ConfigurationName)\$(ProjectName)"
|
||||
ConfigurationType="4"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
TargetEnvironment="3"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="4"
|
||||
InlineFunctionExpansion="1"
|
||||
AdditionalIncludeDirectories=".."
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;LIBXML_STATIC"
|
||||
StringPooling="true"
|
||||
MinimalRebuild="true"
|
||||
ExceptionHandling="2"
|
||||
BasicRuntimeChecks="3"
|
||||
SmallerTypeCheck="true"
|
||||
RuntimeLibrary="3"
|
||||
UsePrecompiledHeader="2"
|
||||
PrecompiledHeaderThrough="stdpch.h"
|
||||
WarningLevel="3"
|
||||
DebugInformationFormat="3"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLibrarianTool"
|
||||
OutputFile="..\..\..\lib64\$(ProjectName)_d.lib"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|x64"
|
||||
OutputDirectory="..\..\..\obj64\$(ConfigurationName)\$(ProjectName)"
|
||||
|
@ -1482,7 +1482,7 @@
|
|||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|x64"
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
|
@ -1490,7 +1490,7 @@
|
|||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
Name="Debug|x64"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
|
@ -1694,6 +1694,14 @@
|
|||
RelativePath=".\time_weather_season\weather_setup_sheet_base.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\welcome_service_itf.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\welcome_service_itf.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\xml_auto_ptr.cpp"
|
||||
>
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
|
||||
#include "nel/net/login_cookie.h"
|
||||
|
||||
#include "../../nelns/welcome_service/welcome_service_itf.h"
|
||||
#include "game_share/welcome_service_itf.h"
|
||||
|
||||
#include "game_share/character_sync_itf.h"
|
||||
|
||||
|
|
458
code/ryzom/common/src/game_share/welcome_service_itf.cpp
Normal file
458
code/ryzom/common/src/game_share/welcome_service_itf.cpp
Normal file
|
@ -0,0 +1,458 @@
|
|||
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
|
||||
// Copyright (C) 2010 Winch Gate Property Limited
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Affero General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Affero General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
|
||||
#include "stdpch.h"
|
||||
|
||||
/////////////////////////////////////////////////////////////////
|
||||
// WARNING : this is a generated file, don't change it !
|
||||
/////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "welcome_service_itf.h"
|
||||
|
||||
namespace WS
|
||||
{
|
||||
|
||||
/////////////////////////////////////////////////////////////////
|
||||
// WARNING : this is a generated file, don't change it !
|
||||
/////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
const CWelcomeServiceSkel::TMessageHandlerMap &CWelcomeServiceSkel::getMessageHandlers() const
|
||||
{
|
||||
static TMessageHandlerMap handlers;
|
||||
static bool init = false;
|
||||
|
||||
if (!init)
|
||||
{
|
||||
std::pair < TMessageHandlerMap::iterator, bool > res;
|
||||
|
||||
res = handlers.insert(std::make_pair(std::string("WU"), &CWelcomeServiceSkel::welcomeUser_skel));
|
||||
// if this assert, you have a doubly message name in your interface definition !
|
||||
nlassert(res.second);
|
||||
|
||||
res = handlers.insert(std::make_pair(std::string("DU"), &CWelcomeServiceSkel::disconnectUser_skel));
|
||||
// if this assert, you have a doubly message name in your interface definition !
|
||||
nlassert(res.second);
|
||||
|
||||
init = true;
|
||||
}
|
||||
|
||||
return handlers;
|
||||
}
|
||||
bool CWelcomeServiceSkel::fwdOnProcessModuleMessage(NLNET::IModuleProxy *sender, const NLNET::CMessage &message)
|
||||
{
|
||||
const TMessageHandlerMap &mh = getMessageHandlers();
|
||||
|
||||
TMessageHandlerMap::const_iterator it(mh.find(message.getName()));
|
||||
|
||||
if (it == mh.end())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
TMessageHandler cmd = it->second;
|
||||
(this->*cmd)(sender, message);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
void CWelcomeServiceSkel::welcomeUser_skel(NLNET::IModuleProxy *sender, const NLNET::CMessage &__message)
|
||||
{
|
||||
H_AUTO(CWelcomeServiceSkel_welcomeUser_WU);
|
||||
uint32 charId;
|
||||
nlRead(__message, serial, charId);
|
||||
std::string userName;
|
||||
nlRead(__message, serial, userName);
|
||||
NLNET::CLoginCookie cookie;
|
||||
nlRead(__message, serial, cookie);
|
||||
std::string priviledge;
|
||||
nlRead(__message, serial, priviledge);
|
||||
std::string exPriviledge;
|
||||
nlRead(__message, serial, exPriviledge);
|
||||
WS::TUserRole mode;
|
||||
nlRead(__message, serial, mode);
|
||||
uint32 instanceId;
|
||||
nlRead(__message, serial, instanceId);
|
||||
welcomeUser(sender, charId, userName, cookie, priviledge, exPriviledge, mode, instanceId);
|
||||
}
|
||||
|
||||
void CWelcomeServiceSkel::disconnectUser_skel(NLNET::IModuleProxy *sender, const NLNET::CMessage &__message)
|
||||
{
|
||||
H_AUTO(CWelcomeServiceSkel_disconnectUser_DU);
|
||||
uint32 userId;
|
||||
nlRead(__message, serial, userId);
|
||||
disconnectUser(sender, userId);
|
||||
}
|
||||
// ask the welcome service to welcome a character
|
||||
void CWelcomeServiceProxy::welcomeUser(NLNET::IModule *sender, uint32 charId, const std::string &userName, const NLNET::CLoginCookie &cookie, const std::string &priviledge, const std::string &exPriviledge, WS::TUserRole mode, uint32 instanceId)
|
||||
{
|
||||
if (_LocalModuleSkel && _LocalModule->isImmediateDispatchingSupported())
|
||||
{
|
||||
// immediate local synchronous dispatching
|
||||
_LocalModuleSkel->welcomeUser(_ModuleProxy->getModuleGateway()->getPluggedModuleProxy(sender), charId, userName, cookie, priviledge, exPriviledge, mode, instanceId);
|
||||
}
|
||||
else
|
||||
{
|
||||
// send the message for remote dispatching and execution or local queing
|
||||
NLNET::CMessage __message;
|
||||
|
||||
buildMessageFor_welcomeUser(__message, charId, userName, cookie, priviledge, exPriviledge, mode, instanceId);
|
||||
|
||||
_ModuleProxy->sendModuleMessage(sender, __message);
|
||||
}
|
||||
}
|
||||
// ask the welcome service to disconnect a user
|
||||
void CWelcomeServiceProxy::disconnectUser(NLNET::IModule *sender, uint32 userId)
|
||||
{
|
||||
if (_LocalModuleSkel && _LocalModule->isImmediateDispatchingSupported())
|
||||
{
|
||||
// immediate local synchronous dispatching
|
||||
_LocalModuleSkel->disconnectUser(_ModuleProxy->getModuleGateway()->getPluggedModuleProxy(sender), userId);
|
||||
}
|
||||
else
|
||||
{
|
||||
// send the message for remote dispatching and execution or local queing
|
||||
NLNET::CMessage __message;
|
||||
|
||||
buildMessageFor_disconnectUser(__message, userId);
|
||||
|
||||
_ModuleProxy->sendModuleMessage(sender, __message);
|
||||
}
|
||||
}
|
||||
|
||||
// Message serializer. Return the message received in reference for easier integration
|
||||
const NLNET::CMessage &CWelcomeServiceProxy::buildMessageFor_welcomeUser(NLNET::CMessage &__message, uint32 charId, const std::string &userName, const NLNET::CLoginCookie &cookie, const std::string &priviledge, const std::string &exPriviledge, WS::TUserRole mode, uint32 instanceId)
|
||||
{
|
||||
__message.setType("WU");
|
||||
nlWrite(__message, serial, charId);
|
||||
nlWrite(__message, serial, const_cast < std::string& > (userName));
|
||||
nlWrite(__message, serial, const_cast < NLNET::CLoginCookie& > (cookie));
|
||||
nlWrite(__message, serial, const_cast < std::string& > (priviledge));
|
||||
nlWrite(__message, serial, const_cast < std::string& > (exPriviledge));
|
||||
nlWrite(__message, serial, mode);
|
||||
nlWrite(__message, serial, instanceId);
|
||||
|
||||
|
||||
return __message;
|
||||
}
|
||||
|
||||
// Message serializer. Return the message received in reference for easier integration
|
||||
const NLNET::CMessage &CWelcomeServiceProxy::buildMessageFor_disconnectUser(NLNET::CMessage &__message, uint32 userId)
|
||||
{
|
||||
__message.setType("DU");
|
||||
nlWrite(__message, serial, userId);
|
||||
|
||||
|
||||
return __message;
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////
|
||||
// WARNING : this is a generated file, don't change it !
|
||||
/////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
const CLoginServiceSkel::TMessageHandlerMap &CLoginServiceSkel::getMessageHandlers() const
|
||||
{
|
||||
static TMessageHandlerMap handlers;
|
||||
static bool init = false;
|
||||
|
||||
if (!init)
|
||||
{
|
||||
std::pair < TMessageHandlerMap::iterator, bool > res;
|
||||
|
||||
res = handlers.insert(std::make_pair(std::string("PUL"), &CLoginServiceSkel::pendingUserLost_skel));
|
||||
// if this assert, you have a doubly message name in your interface definition !
|
||||
nlassert(res.second);
|
||||
|
||||
init = true;
|
||||
}
|
||||
|
||||
return handlers;
|
||||
}
|
||||
bool CLoginServiceSkel::fwdOnProcessModuleMessage(NLNET::IModuleProxy *sender, const NLNET::CMessage &message)
|
||||
{
|
||||
const TMessageHandlerMap &mh = getMessageHandlers();
|
||||
|
||||
TMessageHandlerMap::const_iterator it(mh.find(message.getName()));
|
||||
|
||||
if (it == mh.end())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
TMessageHandler cmd = it->second;
|
||||
(this->*cmd)(sender, message);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
void CLoginServiceSkel::pendingUserLost_skel(NLNET::IModuleProxy *sender, const NLNET::CMessage &__message)
|
||||
{
|
||||
H_AUTO(CLoginServiceSkel_pendingUserLost_PUL);
|
||||
NLNET::CLoginCookie cookie;
|
||||
nlRead(__message, serial, cookie);
|
||||
pendingUserLost(sender, cookie);
|
||||
}
|
||||
// An awaited user did not connect before the allowed timeout expire
|
||||
void CLoginServiceProxy::pendingUserLost(NLNET::IModule *sender, const NLNET::CLoginCookie &cookie)
|
||||
{
|
||||
if (_LocalModuleSkel && _LocalModule->isImmediateDispatchingSupported())
|
||||
{
|
||||
// immediate local synchronous dispatching
|
||||
_LocalModuleSkel->pendingUserLost(_ModuleProxy->getModuleGateway()->getPluggedModuleProxy(sender), cookie);
|
||||
}
|
||||
else
|
||||
{
|
||||
// send the message for remote dispatching and execution or local queing
|
||||
NLNET::CMessage __message;
|
||||
|
||||
buildMessageFor_pendingUserLost(__message, cookie);
|
||||
|
||||
_ModuleProxy->sendModuleMessage(sender, __message);
|
||||
}
|
||||
}
|
||||
|
||||
// Message serializer. Return the message received in reference for easier integration
|
||||
const NLNET::CMessage &CLoginServiceProxy::buildMessageFor_pendingUserLost(NLNET::CMessage &__message, const NLNET::CLoginCookie &cookie)
|
||||
{
|
||||
__message.setType("PUL");
|
||||
nlWrite(__message, serial, const_cast < NLNET::CLoginCookie& > (cookie));
|
||||
|
||||
|
||||
return __message;
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////
|
||||
// WARNING : this is a generated file, don't change it !
|
||||
/////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
const CWelcomeServiceClientSkel::TMessageHandlerMap &CWelcomeServiceClientSkel::getMessageHandlers() const
|
||||
{
|
||||
static TMessageHandlerMap handlers;
|
||||
static bool init = false;
|
||||
|
||||
if (!init)
|
||||
{
|
||||
std::pair < TMessageHandlerMap::iterator, bool > res;
|
||||
|
||||
res = handlers.insert(std::make_pair(std::string("RWS"), &CWelcomeServiceClientSkel::registerWS_skel));
|
||||
// if this assert, you have a doubly message name in your interface definition !
|
||||
nlassert(res.second);
|
||||
|
||||
res = handlers.insert(std::make_pair(std::string("RWSOS"), &CWelcomeServiceClientSkel::reportWSOpenState_skel));
|
||||
// if this assert, you have a doubly message name in your interface definition !
|
||||
nlassert(res.second);
|
||||
|
||||
res = handlers.insert(std::make_pair(std::string("WUR"), &CWelcomeServiceClientSkel::welcomeUserResult_skel));
|
||||
// if this assert, you have a doubly message name in your interface definition !
|
||||
nlassert(res.second);
|
||||
|
||||
res = handlers.insert(std::make_pair(std::string("UCP"), &CWelcomeServiceClientSkel::updateConnectedPlayerCount_skel));
|
||||
// if this assert, you have a doubly message name in your interface definition !
|
||||
nlassert(res.second);
|
||||
|
||||
init = true;
|
||||
}
|
||||
|
||||
return handlers;
|
||||
}
|
||||
bool CWelcomeServiceClientSkel::fwdOnProcessModuleMessage(NLNET::IModuleProxy *sender, const NLNET::CMessage &message)
|
||||
{
|
||||
const TMessageHandlerMap &mh = getMessageHandlers();
|
||||
|
||||
TMessageHandlerMap::const_iterator it(mh.find(message.getName()));
|
||||
|
||||
if (it == mh.end())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
TMessageHandler cmd = it->second;
|
||||
(this->*cmd)(sender, message);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
void CWelcomeServiceClientSkel::registerWS_skel(NLNET::IModuleProxy *sender, const NLNET::CMessage &__message)
|
||||
{
|
||||
H_AUTO(CWelcomeServiceClientSkel_registerWS_RWS);
|
||||
uint32 shardId;
|
||||
nlRead(__message, serial, shardId);
|
||||
uint32 fixedSessionId;
|
||||
nlRead(__message, serial, fixedSessionId);
|
||||
bool isOnline;
|
||||
nlRead(__message, serial, isOnline);
|
||||
registerWS(sender, shardId, fixedSessionId, isOnline);
|
||||
}
|
||||
|
||||
void CWelcomeServiceClientSkel::reportWSOpenState_skel(NLNET::IModuleProxy *sender, const NLNET::CMessage &__message)
|
||||
{
|
||||
H_AUTO(CWelcomeServiceClientSkel_reportWSOpenState_RWSOS);
|
||||
bool isOnline;
|
||||
nlRead(__message, serial, isOnline);
|
||||
reportWSOpenState(sender, isOnline);
|
||||
}
|
||||
|
||||
void CWelcomeServiceClientSkel::welcomeUserResult_skel(NLNET::IModuleProxy *sender, const NLNET::CMessage &__message)
|
||||
{
|
||||
H_AUTO(CWelcomeServiceClientSkel_welcomeUserResult_WUR);
|
||||
uint32 userId;
|
||||
nlRead(__message, serial, userId);
|
||||
bool ok;
|
||||
nlRead(__message, serial, ok);
|
||||
std::string shardAddr;
|
||||
nlRead(__message, serial, shardAddr);
|
||||
std::string errorMsg;
|
||||
nlRead(__message, serial, errorMsg);
|
||||
welcomeUserResult(sender, userId, ok, shardAddr, errorMsg);
|
||||
}
|
||||
|
||||
void CWelcomeServiceClientSkel::updateConnectedPlayerCount_skel(NLNET::IModuleProxy *sender, const NLNET::CMessage &__message)
|
||||
{
|
||||
H_AUTO(CWelcomeServiceClientSkel_updateConnectedPlayerCount_UCP);
|
||||
uint32 nbOnlinePlayers;
|
||||
nlRead(__message, serial, nbOnlinePlayers);
|
||||
uint32 nbPendingPlayers;
|
||||
nlRead(__message, serial, nbPendingPlayers);
|
||||
updateConnectedPlayerCount(sender, nbOnlinePlayers, nbPendingPlayers);
|
||||
}
|
||||
// Register the welcome service in the ring session manager
|
||||
// The provided sessionId will be non-zero only for a shard with a fixed sessionId
|
||||
void CWelcomeServiceClientProxy::registerWS(NLNET::IModule *sender, uint32 shardId, uint32 fixedSessionId, bool isOnline)
|
||||
{
|
||||
if (_LocalModuleSkel && _LocalModule->isImmediateDispatchingSupported())
|
||||
{
|
||||
// immediate local synchronous dispatching
|
||||
_LocalModuleSkel->registerWS(_ModuleProxy->getModuleGateway()->getPluggedModuleProxy(sender), shardId, fixedSessionId, isOnline);
|
||||
}
|
||||
else
|
||||
{
|
||||
// send the message for remote dispatching and execution or local queing
|
||||
NLNET::CMessage __message;
|
||||
|
||||
buildMessageFor_registerWS(__message, shardId, fixedSessionId, isOnline);
|
||||
|
||||
_ModuleProxy->sendModuleMessage(sender, __message);
|
||||
}
|
||||
}
|
||||
// WS report it's current open state
|
||||
void CWelcomeServiceClientProxy::reportWSOpenState(NLNET::IModule *sender, bool isOnline)
|
||||
{
|
||||
if (_LocalModuleSkel && _LocalModule->isImmediateDispatchingSupported())
|
||||
{
|
||||
// immediate local synchronous dispatching
|
||||
_LocalModuleSkel->reportWSOpenState(_ModuleProxy->getModuleGateway()->getPluggedModuleProxy(sender), isOnline);
|
||||
}
|
||||
else
|
||||
{
|
||||
// send the message for remote dispatching and execution or local queing
|
||||
NLNET::CMessage __message;
|
||||
|
||||
buildMessageFor_reportWSOpenState(__message, isOnline);
|
||||
|
||||
_ModuleProxy->sendModuleMessage(sender, __message);
|
||||
}
|
||||
}
|
||||
// return for welcome user
|
||||
void CWelcomeServiceClientProxy::welcomeUserResult(NLNET::IModule *sender, uint32 userId, bool ok, const std::string &shardAddr, const std::string &errorMsg)
|
||||
{
|
||||
if (_LocalModuleSkel && _LocalModule->isImmediateDispatchingSupported())
|
||||
{
|
||||
// immediate local synchronous dispatching
|
||||
_LocalModuleSkel->welcomeUserResult(_ModuleProxy->getModuleGateway()->getPluggedModuleProxy(sender), userId, ok, shardAddr, errorMsg);
|
||||
}
|
||||
else
|
||||
{
|
||||
// send the message for remote dispatching and execution or local queing
|
||||
NLNET::CMessage __message;
|
||||
|
||||
buildMessageFor_welcomeUserResult(__message, userId, ok, shardAddr, errorMsg);
|
||||
|
||||
_ModuleProxy->sendModuleMessage(sender, __message);
|
||||
}
|
||||
}
|
||||
// transmits the current player counts
|
||||
void CWelcomeServiceClientProxy::updateConnectedPlayerCount(NLNET::IModule *sender, uint32 nbOnlinePlayers, uint32 nbPendingPlayers)
|
||||
{
|
||||
if (_LocalModuleSkel && _LocalModule->isImmediateDispatchingSupported())
|
||||
{
|
||||
// immediate local synchronous dispatching
|
||||
_LocalModuleSkel->updateConnectedPlayerCount(_ModuleProxy->getModuleGateway()->getPluggedModuleProxy(sender), nbOnlinePlayers, nbPendingPlayers);
|
||||
}
|
||||
else
|
||||
{
|
||||
// send the message for remote dispatching and execution or local queing
|
||||
NLNET::CMessage __message;
|
||||
|
||||
buildMessageFor_updateConnectedPlayerCount(__message, nbOnlinePlayers, nbPendingPlayers);
|
||||
|
||||
_ModuleProxy->sendModuleMessage(sender, __message);
|
||||
}
|
||||
}
|
||||
|
||||
// Message serializer. Return the message received in reference for easier integration
|
||||
const NLNET::CMessage &CWelcomeServiceClientProxy::buildMessageFor_registerWS(NLNET::CMessage &__message, uint32 shardId, uint32 fixedSessionId, bool isOnline)
|
||||
{
|
||||
__message.setType("RWS");
|
||||
nlWrite(__message, serial, shardId);
|
||||
nlWrite(__message, serial, fixedSessionId);
|
||||
nlWrite(__message, serial, isOnline);
|
||||
|
||||
|
||||
return __message;
|
||||
}
|
||||
|
||||
// Message serializer. Return the message received in reference for easier integration
|
||||
const NLNET::CMessage &CWelcomeServiceClientProxy::buildMessageFor_reportWSOpenState(NLNET::CMessage &__message, bool isOnline)
|
||||
{
|
||||
__message.setType("RWSOS");
|
||||
nlWrite(__message, serial, isOnline);
|
||||
|
||||
|
||||
return __message;
|
||||
}
|
||||
|
||||
// Message serializer. Return the message received in reference for easier integration
|
||||
const NLNET::CMessage &CWelcomeServiceClientProxy::buildMessageFor_welcomeUserResult(NLNET::CMessage &__message, uint32 userId, bool ok, const std::string &shardAddr, const std::string &errorMsg)
|
||||
{
|
||||
__message.setType("WUR");
|
||||
nlWrite(__message, serial, userId);
|
||||
nlWrite(__message, serial, ok);
|
||||
nlWrite(__message, serial, const_cast < std::string& > (shardAddr));
|
||||
nlWrite(__message, serial, const_cast < std::string& > (errorMsg));
|
||||
|
||||
|
||||
return __message;
|
||||
}
|
||||
|
||||
// Message serializer. Return the message received in reference for easier integration
|
||||
const NLNET::CMessage &CWelcomeServiceClientProxy::buildMessageFor_updateConnectedPlayerCount(NLNET::CMessage &__message, uint32 nbOnlinePlayers, uint32 nbPendingPlayers)
|
||||
{
|
||||
__message.setType("UCP");
|
||||
nlWrite(__message, serial, nbOnlinePlayers);
|
||||
nlWrite(__message, serial, nbPendingPlayers);
|
||||
|
||||
|
||||
return __message;
|
||||
}
|
||||
|
||||
}
|
541
code/ryzom/common/src/game_share/welcome_service_itf.h
Normal file
541
code/ryzom/common/src/game_share/welcome_service_itf.h
Normal file
|
@ -0,0 +1,541 @@
|
|||
|
||||
/////////////////////////////////////////////////////////////////
|
||||
// WARNING : this is a generated file, don't change it !
|
||||
/////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef WELCOME_SERVICE_ITF
|
||||
#define WELCOME_SERVICE_ITF
|
||||
#include "nel/misc/types_nl.h"
|
||||
#ifdef NL_COMP_VC8
|
||||
#include <memory>
|
||||
#endif
|
||||
#include "nel/misc/hierarchical_timer.h"
|
||||
#include "nel/misc/string_conversion.h"
|
||||
#include "nel/net/message.h"
|
||||
#include "nel/net/module.h"
|
||||
#include "nel/net/module_builder_parts.h"
|
||||
#include "nel/net/module_message.h"
|
||||
#include "nel/net/module_gateway.h"
|
||||
|
||||
#include "nel/net/login_cookie.h"
|
||||
|
||||
namespace WS
|
||||
{
|
||||
|
||||
|
||||
|
||||
struct TUserRole
|
||||
{
|
||||
enum TValues
|
||||
{
|
||||
ur_player,
|
||||
ur_editor,
|
||||
ur_animator,
|
||||
/// the highest valid value in the enum
|
||||
last_enum_item = ur_animator,
|
||||
/// a value equal to the last enum item +1
|
||||
end_of_enum,
|
||||
|
||||
invalid_val,
|
||||
|
||||
/// Number of enumerated values
|
||||
nb_enum_items = 3
|
||||
};
|
||||
|
||||
/// Index table to convert enum value to linear index table
|
||||
const std::map<TValues, uint32> &getIndexTable() const
|
||||
{
|
||||
static std::map<TValues, uint32> indexTable;
|
||||
static bool init = false;
|
||||
if (!init)
|
||||
{
|
||||
// fill the index table
|
||||
indexTable.insert(std::make_pair(ur_player, 0));
|
||||
indexTable.insert(std::make_pair(ur_editor, 1));
|
||||
indexTable.insert(std::make_pair(ur_animator, 2));
|
||||
|
||||
init = true;
|
||||
}
|
||||
|
||||
return indexTable;
|
||||
}
|
||||
|
||||
|
||||
static const NLMISC::CStringConversion<TValues> &getConversionTable()
|
||||
{
|
||||
NL_BEGIN_STRING_CONVERSION_TABLE(TValues)
|
||||
NL_STRING_CONVERSION_TABLE_ENTRY(ur_player)
|
||||
NL_STRING_CONVERSION_TABLE_ENTRY(ur_editor)
|
||||
NL_STRING_CONVERSION_TABLE_ENTRY(ur_animator)
|
||||
NL_STRING_CONVERSION_TABLE_ENTRY(invalid_val)
|
||||
};
|
||||
static NLMISC::CStringConversion<TValues>
|
||||
conversionTable(TValues_nl_string_conversion_table, sizeof(TValues_nl_string_conversion_table)
|
||||
/ sizeof(TValues_nl_string_conversion_table[0]), invalid_val);
|
||||
|
||||
return conversionTable;
|
||||
}
|
||||
|
||||
TValues _Value;
|
||||
|
||||
public:
|
||||
TUserRole()
|
||||
: _Value(invalid_val)
|
||||
{
|
||||
}
|
||||
TUserRole(TValues value)
|
||||
: _Value(value)
|
||||
{
|
||||
}
|
||||
|
||||
TUserRole(const std::string &str)
|
||||
{
|
||||
_Value = getConversionTable().fromString(str);
|
||||
}
|
||||
|
||||
void serial(NLMISC::IStream &s)
|
||||
{
|
||||
s.serialEnum(_Value);
|
||||
}
|
||||
|
||||
bool operator == (const TUserRole &other) const
|
||||
{
|
||||
return _Value == other._Value;
|
||||
}
|
||||
bool operator != (const TUserRole &other) const
|
||||
{
|
||||
return ! (_Value == other._Value);
|
||||
}
|
||||
bool operator < (const TUserRole &other) const
|
||||
{
|
||||
return _Value < other._Value;
|
||||
}
|
||||
|
||||
bool operator <= (const TUserRole &other) const
|
||||
{
|
||||
return _Value <= other._Value;
|
||||
}
|
||||
|
||||
bool operator > (const TUserRole &other) const
|
||||
{
|
||||
return !(_Value <= other._Value);
|
||||
}
|
||||
bool operator >= (const TUserRole &other) const
|
||||
{
|
||||
return !(_Value < other._Value);
|
||||
}
|
||||
|
||||
const std::string &toString() const
|
||||
{
|
||||
return getConversionTable().toString(_Value);
|
||||
}
|
||||
static const std::string &toString(TValues value)
|
||||
{
|
||||
return getConversionTable().toString(value);
|
||||
}
|
||||
|
||||
TValues getValue() const
|
||||
{
|
||||
return _Value;
|
||||
}
|
||||
|
||||
// return true if the actual value of the enum is valid, otherwise false
|
||||
bool isValid()
|
||||
{
|
||||
if (_Value == invalid_val)
|
||||
return false;
|
||||
|
||||
// not invalid, check other enum value
|
||||
return getConversionTable().isValid(_Value);
|
||||
}
|
||||
|
||||
|
||||
uint32 asIndex()
|
||||
{
|
||||
std::map<TValues, uint32>::const_iterator it(getIndexTable().find(_Value));
|
||||
nlassert(it != getIndexTable().end());
|
||||
return it->second;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
/////////////////////////////////////////////////////////////////
|
||||
// WARNING : this is a generated file, don't change it !
|
||||
/////////////////////////////////////////////////////////////////
|
||||
class CWelcomeServiceSkel
|
||||
{
|
||||
public:
|
||||
/// the interceptor type
|
||||
typedef NLNET::CInterceptorForwarder < CWelcomeServiceSkel> TInterceptor;
|
||||
protected:
|
||||
CWelcomeServiceSkel()
|
||||
{
|
||||
// do early run time check for message table
|
||||
getMessageHandlers();
|
||||
}
|
||||
virtual ~CWelcomeServiceSkel()
|
||||
{
|
||||
}
|
||||
|
||||
void init(NLNET::IModule *module)
|
||||
{
|
||||
_Interceptor.init(this, module);
|
||||
}
|
||||
|
||||
// unused interceptors
|
||||
std::string fwdBuildModuleManifest() const { return std::string(); }
|
||||
void fwdOnModuleUp(NLNET::IModuleProxy * /* moduleProxy */) {}
|
||||
void fwdOnModuleDown(NLNET::IModuleProxy * /* moduleProxy */) {}
|
||||
void fwdOnModuleSecurityChange(NLNET::IModuleProxy * /* moduleProxy */) {}
|
||||
|
||||
// process module message interceptor
|
||||
bool fwdOnProcessModuleMessage(NLNET::IModuleProxy *sender, const NLNET::CMessage &message);
|
||||
private:
|
||||
|
||||
typedef void (CWelcomeServiceSkel::*TMessageHandler)(NLNET::IModuleProxy *sender, const NLNET::CMessage &message);
|
||||
typedef std::map<std::string, TMessageHandler> TMessageHandlerMap;
|
||||
|
||||
const TMessageHandlerMap &getMessageHandlers() const;
|
||||
|
||||
|
||||
void welcomeUser_skel(NLNET::IModuleProxy *sender, const NLNET::CMessage &__message);
|
||||
|
||||
void disconnectUser_skel(NLNET::IModuleProxy *sender, const NLNET::CMessage &__message);
|
||||
|
||||
// declare one interceptor member of the skeleton
|
||||
TInterceptor _Interceptor;
|
||||
|
||||
// declare the interceptor forwarder as friend of this class
|
||||
friend class NLNET::CInterceptorForwarder < CWelcomeServiceSkel>;
|
||||
public:
|
||||
/////////////////////////////////////////////////////////////////
|
||||
// WARNING : this is a generated file, don't change it !
|
||||
/////////////////////////////////////////////////////////////////
|
||||
|
||||
// ask the welcome service to welcome a character
|
||||
virtual void welcomeUser(NLNET::IModuleProxy *sender, uint32 charId, const std::string &userName, const NLNET::CLoginCookie &cookie, const std::string &priviledge, const std::string &exPriviledge, WS::TUserRole mode, uint32 instanceId) =0;
|
||||
// ask the welcome service to disconnect a user
|
||||
virtual void disconnectUser(NLNET::IModuleProxy *sender, uint32 userId) =0;
|
||||
|
||||
|
||||
};
|
||||
|
||||
/////////////////////////////////////////////////////////////////
|
||||
// WARNING : this is a generated file, don't change it !
|
||||
/////////////////////////////////////////////////////////////////
|
||||
class CWelcomeServiceProxy
|
||||
{
|
||||
/// Smart pointer on the module proxy
|
||||
NLNET::TModuleProxyPtr _ModuleProxy;
|
||||
|
||||
// Pointer on the local module that implement the interface (if the proxy is for a local module)
|
||||
NLNET::TModulePtr _LocalModule;
|
||||
// Direct pointer on the server implementation interface for collocated module
|
||||
CWelcomeServiceSkel *_LocalModuleSkel;
|
||||
|
||||
|
||||
public:
|
||||
CWelcomeServiceProxy(NLNET::IModuleProxy *proxy)
|
||||
{
|
||||
nlassert(proxy->getModuleClassName() == "WelcomeService");
|
||||
_ModuleProxy = proxy;
|
||||
|
||||
// initialize collocated servant interface
|
||||
if (proxy->getModuleDistance() == 0)
|
||||
{
|
||||
_LocalModule = proxy->getLocalModule();
|
||||
nlassert(_LocalModule != NULL);
|
||||
CWelcomeServiceSkel::TInterceptor *interceptor = NULL;
|
||||
interceptor = static_cast < NLNET::CModuleBase* >(_LocalModule.getPtr())->getInterceptor(interceptor);
|
||||
nlassert(interceptor != NULL);
|
||||
|
||||
_LocalModuleSkel = interceptor->getParent();
|
||||
nlassert(_LocalModuleSkel != NULL);
|
||||
}
|
||||
else
|
||||
_LocalModuleSkel = 0;
|
||||
|
||||
}
|
||||
virtual ~CWelcomeServiceProxy()
|
||||
{
|
||||
}
|
||||
|
||||
NLNET::IModuleProxy *getModuleProxy()
|
||||
{
|
||||
return _ModuleProxy;
|
||||
}
|
||||
|
||||
// ask the welcome service to welcome a character
|
||||
void welcomeUser(NLNET::IModule *sender, uint32 charId, const std::string &userName, const NLNET::CLoginCookie &cookie, const std::string &priviledge, const std::string &exPriviledge, WS::TUserRole mode, uint32 instanceId);
|
||||
// ask the welcome service to disconnect a user
|
||||
void disconnectUser(NLNET::IModule *sender, uint32 userId);
|
||||
|
||||
// Message serializer. Return the message received in reference for easier integration
|
||||
static const NLNET::CMessage &buildMessageFor_welcomeUser(NLNET::CMessage &__message, uint32 charId, const std::string &userName, const NLNET::CLoginCookie &cookie, const std::string &priviledge, const std::string &exPriviledge, WS::TUserRole mode, uint32 instanceId);
|
||||
|
||||
// Message serializer. Return the message received in reference for easier integration
|
||||
static const NLNET::CMessage &buildMessageFor_disconnectUser(NLNET::CMessage &__message, uint32 userId);
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
/////////////////////////////////////////////////////////////////
|
||||
// WARNING : this is a generated file, don't change it !
|
||||
/////////////////////////////////////////////////////////////////
|
||||
class CLoginServiceSkel
|
||||
{
|
||||
public:
|
||||
/// the interceptor type
|
||||
typedef NLNET::CInterceptorForwarder < CLoginServiceSkel> TInterceptor;
|
||||
protected:
|
||||
CLoginServiceSkel()
|
||||
{
|
||||
// do early run time check for message table
|
||||
getMessageHandlers();
|
||||
}
|
||||
virtual ~CLoginServiceSkel()
|
||||
{
|
||||
}
|
||||
|
||||
void init(NLNET::IModule *module)
|
||||
{
|
||||
_Interceptor.init(this, module);
|
||||
}
|
||||
|
||||
// unused interceptors
|
||||
std::string fwdBuildModuleManifest() const { return std::string(); }
|
||||
void fwdOnModuleUp(NLNET::IModuleProxy * /* moduleProxy */) {}
|
||||
void fwdOnModuleDown(NLNET::IModuleProxy * /* moduleProxy */) {}
|
||||
void fwdOnModuleSecurityChange(NLNET::IModuleProxy * /* moduleProxy */) {}
|
||||
|
||||
// process module message interceptor
|
||||
bool fwdOnProcessModuleMessage(NLNET::IModuleProxy *sender, const NLNET::CMessage &message);
|
||||
private:
|
||||
|
||||
typedef void (CLoginServiceSkel::*TMessageHandler)(NLNET::IModuleProxy *sender, const NLNET::CMessage &message);
|
||||
typedef std::map<std::string, TMessageHandler> TMessageHandlerMap;
|
||||
|
||||
const TMessageHandlerMap &getMessageHandlers() const;
|
||||
|
||||
|
||||
void pendingUserLost_skel(NLNET::IModuleProxy *sender, const NLNET::CMessage &__message);
|
||||
|
||||
// declare one interceptor member of the skeleton
|
||||
TInterceptor _Interceptor;
|
||||
|
||||
// declare the interceptor forwarder as friend of this class
|
||||
friend class NLNET::CInterceptorForwarder < CLoginServiceSkel>;
|
||||
public:
|
||||
/////////////////////////////////////////////////////////////////
|
||||
// WARNING : this is a generated file, don't change it !
|
||||
/////////////////////////////////////////////////////////////////
|
||||
|
||||
// An awaited user did not connect before the allowed timeout expire
|
||||
virtual void pendingUserLost(NLNET::IModuleProxy *sender, const NLNET::CLoginCookie &cookie) =0;
|
||||
|
||||
|
||||
};
|
||||
|
||||
/////////////////////////////////////////////////////////////////
|
||||
// WARNING : this is a generated file, don't change it !
|
||||
/////////////////////////////////////////////////////////////////
|
||||
class CLoginServiceProxy
|
||||
{
|
||||
/// Smart pointer on the module proxy
|
||||
NLNET::TModuleProxyPtr _ModuleProxy;
|
||||
|
||||
// Pointer on the local module that implement the interface (if the proxy is for a local module)
|
||||
NLNET::TModulePtr _LocalModule;
|
||||
// Direct pointer on the server implementation interface for collocated module
|
||||
CLoginServiceSkel *_LocalModuleSkel;
|
||||
|
||||
|
||||
public:
|
||||
CLoginServiceProxy(NLNET::IModuleProxy *proxy)
|
||||
{
|
||||
|
||||
_ModuleProxy = proxy;
|
||||
|
||||
// initialize collocated servant interface
|
||||
if (proxy->getModuleDistance() == 0)
|
||||
{
|
||||
_LocalModule = proxy->getLocalModule();
|
||||
nlassert(_LocalModule != NULL);
|
||||
CLoginServiceSkel::TInterceptor *interceptor = NULL;
|
||||
interceptor = static_cast < NLNET::CModuleBase* >(_LocalModule.getPtr())->getInterceptor(interceptor);
|
||||
nlassert(interceptor != NULL);
|
||||
|
||||
_LocalModuleSkel = interceptor->getParent();
|
||||
nlassert(_LocalModuleSkel != NULL);
|
||||
}
|
||||
else
|
||||
_LocalModuleSkel = 0;
|
||||
|
||||
}
|
||||
virtual ~CLoginServiceProxy()
|
||||
{
|
||||
}
|
||||
|
||||
NLNET::IModuleProxy *getModuleProxy()
|
||||
{
|
||||
return _ModuleProxy;
|
||||
}
|
||||
|
||||
// An awaited user did not connect before the allowed timeout expire
|
||||
void pendingUserLost(NLNET::IModule *sender, const NLNET::CLoginCookie &cookie);
|
||||
|
||||
// Message serializer. Return the message received in reference for easier integration
|
||||
static const NLNET::CMessage &buildMessageFor_pendingUserLost(NLNET::CMessage &__message, const NLNET::CLoginCookie &cookie);
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
/////////////////////////////////////////////////////////////////
|
||||
// WARNING : this is a generated file, don't change it !
|
||||
/////////////////////////////////////////////////////////////////
|
||||
class CWelcomeServiceClientSkel
|
||||
{
|
||||
public:
|
||||
/// the interceptor type
|
||||
typedef NLNET::CInterceptorForwarder < CWelcomeServiceClientSkel> TInterceptor;
|
||||
protected:
|
||||
CWelcomeServiceClientSkel()
|
||||
{
|
||||
// do early run time check for message table
|
||||
getMessageHandlers();
|
||||
}
|
||||
virtual ~CWelcomeServiceClientSkel()
|
||||
{
|
||||
}
|
||||
|
||||
void init(NLNET::IModule *module)
|
||||
{
|
||||
_Interceptor.init(this, module);
|
||||
}
|
||||
|
||||
// unused interceptors
|
||||
std::string fwdBuildModuleManifest() const { return std::string(); }
|
||||
void fwdOnModuleUp(NLNET::IModuleProxy * /* moduleProxy */) {}
|
||||
void fwdOnModuleDown(NLNET::IModuleProxy * /* moduleProxy */) {}
|
||||
void fwdOnModuleSecurityChange(NLNET::IModuleProxy * /* moduleProxy */) {}
|
||||
|
||||
// process module message interceptor
|
||||
bool fwdOnProcessModuleMessage(NLNET::IModuleProxy *sender, const NLNET::CMessage &message);
|
||||
private:
|
||||
|
||||
typedef void (CWelcomeServiceClientSkel::*TMessageHandler)(NLNET::IModuleProxy *sender, const NLNET::CMessage &message);
|
||||
typedef std::map<std::string, TMessageHandler> TMessageHandlerMap;
|
||||
|
||||
const TMessageHandlerMap &getMessageHandlers() const;
|
||||
|
||||
|
||||
void registerWS_skel(NLNET::IModuleProxy *sender, const NLNET::CMessage &__message);
|
||||
|
||||
void reportWSOpenState_skel(NLNET::IModuleProxy *sender, const NLNET::CMessage &__message);
|
||||
|
||||
void welcomeUserResult_skel(NLNET::IModuleProxy *sender, const NLNET::CMessage &__message);
|
||||
|
||||
void updateConnectedPlayerCount_skel(NLNET::IModuleProxy *sender, const NLNET::CMessage &__message);
|
||||
|
||||
// declare one interceptor member of the skeleton
|
||||
TInterceptor _Interceptor;
|
||||
|
||||
// declare the interceptor forwarder as friend of this class
|
||||
friend class NLNET::CInterceptorForwarder < CWelcomeServiceClientSkel>;
|
||||
public:
|
||||
/////////////////////////////////////////////////////////////////
|
||||
// WARNING : this is a generated file, don't change it !
|
||||
/////////////////////////////////////////////////////////////////
|
||||
|
||||
// Register the welcome service in the ring session manager
|
||||
// The provided sessionId will be non-zero only for a shard with a fixed sessionId
|
||||
virtual void registerWS(NLNET::IModuleProxy *sender, uint32 shardId, uint32 fixedSessionId, bool isOnline) =0;
|
||||
// WS report it's current open state
|
||||
virtual void reportWSOpenState(NLNET::IModuleProxy *sender, bool isOnline) =0;
|
||||
// return for welcome user
|
||||
virtual void welcomeUserResult(NLNET::IModuleProxy *sender, uint32 userId, bool ok, const std::string &shardAddr, const std::string &errorMsg) =0;
|
||||
// transmits the current player counts
|
||||
virtual void updateConnectedPlayerCount(NLNET::IModuleProxy *sender, uint32 nbOnlinePlayers, uint32 nbPendingPlayers) =0;
|
||||
|
||||
|
||||
};
|
||||
|
||||
/////////////////////////////////////////////////////////////////
|
||||
// WARNING : this is a generated file, don't change it !
|
||||
/////////////////////////////////////////////////////////////////
|
||||
class CWelcomeServiceClientProxy
|
||||
{
|
||||
/// Smart pointer on the module proxy
|
||||
NLNET::TModuleProxyPtr _ModuleProxy;
|
||||
|
||||
// Pointer on the local module that implement the interface (if the proxy is for a local module)
|
||||
NLNET::TModulePtr _LocalModule;
|
||||
// Direct pointer on the server implementation interface for collocated module
|
||||
CWelcomeServiceClientSkel *_LocalModuleSkel;
|
||||
|
||||
|
||||
public:
|
||||
CWelcomeServiceClientProxy(NLNET::IModuleProxy *proxy)
|
||||
{
|
||||
|
||||
_ModuleProxy = proxy;
|
||||
|
||||
// initialize collocated servant interface
|
||||
if (proxy->getModuleDistance() == 0)
|
||||
{
|
||||
_LocalModule = proxy->getLocalModule();
|
||||
nlassert(_LocalModule != NULL);
|
||||
CWelcomeServiceClientSkel::TInterceptor *interceptor = NULL;
|
||||
interceptor = static_cast < NLNET::CModuleBase* >(_LocalModule.getPtr())->getInterceptor(interceptor);
|
||||
nlassert(interceptor != NULL);
|
||||
|
||||
_LocalModuleSkel = interceptor->getParent();
|
||||
nlassert(_LocalModuleSkel != NULL);
|
||||
}
|
||||
else
|
||||
_LocalModuleSkel = 0;
|
||||
|
||||
}
|
||||
virtual ~CWelcomeServiceClientProxy()
|
||||
{
|
||||
}
|
||||
|
||||
NLNET::IModuleProxy *getModuleProxy()
|
||||
{
|
||||
return _ModuleProxy;
|
||||
}
|
||||
|
||||
// Register the welcome service in the ring session manager
|
||||
// The provided sessionId will be non-zero only for a shard with a fixed sessionId
|
||||
void registerWS(NLNET::IModule *sender, uint32 shardId, uint32 fixedSessionId, bool isOnline);
|
||||
// WS report it's current open state
|
||||
void reportWSOpenState(NLNET::IModule *sender, bool isOnline);
|
||||
// return for welcome user
|
||||
void welcomeUserResult(NLNET::IModule *sender, uint32 userId, bool ok, const std::string &shardAddr, const std::string &errorMsg);
|
||||
// transmits the current player counts
|
||||
void updateConnectedPlayerCount(NLNET::IModule *sender, uint32 nbOnlinePlayers, uint32 nbPendingPlayers);
|
||||
|
||||
// Message serializer. Return the message received in reference for easier integration
|
||||
static const NLNET::CMessage &buildMessageFor_registerWS(NLNET::CMessage &__message, uint32 shardId, uint32 fixedSessionId, bool isOnline);
|
||||
|
||||
// Message serializer. Return the message received in reference for easier integration
|
||||
static const NLNET::CMessage &buildMessageFor_reportWSOpenState(NLNET::CMessage &__message, bool isOnline);
|
||||
|
||||
// Message serializer. Return the message received in reference for easier integration
|
||||
static const NLNET::CMessage &buildMessageFor_welcomeUserResult(NLNET::CMessage &__message, uint32 userId, bool ok, const std::string &shardAddr, const std::string &errorMsg);
|
||||
|
||||
// Message serializer. Return the message received in reference for easier integration
|
||||
static const NLNET::CMessage &buildMessageFor_updateConnectedPlayerCount(NLNET::CMessage &__message, uint32 nbOnlinePlayers, uint32 nbPendingPlayers);
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
|
@ -33,7 +33,7 @@
|
|||
#include "entity_container.h"
|
||||
#include "game_share/ryzom_entity_id.h"
|
||||
#include "game_share/entity_types.h"
|
||||
#include "../../nelns/welcome_service/welcome_service_itf.h"
|
||||
#include "game_share/welcome_service_itf.h"
|
||||
|
||||
#include <vector>
|
||||
#include <deque>
|
||||
|
|
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
@ -0,0 +1,112 @@
|
|||
// NeLNS - MMORPG Framework <http://dev.ryzom.com/projects/nel/>
|
||||
// Copyright (C) 2010 Winch Gate Property Limited
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Affero General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Affero General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#include "nel/misc/types_nl.h"
|
||||
#include "nel/misc/singleton.h"
|
||||
|
||||
#include "nel/net/module_manager.h"
|
||||
#include "nel/net/module_builder_parts.h"
|
||||
|
||||
#include "game_share/welcome_service_itf.h"
|
||||
|
||||
std::string lsChooseShard (const std::string &userName,
|
||||
const NLNET::CLoginCookie &cookie,
|
||||
const std::string &userPriv,
|
||||
const std::string &userExtended,
|
||||
WS::TUserRole userRole,
|
||||
uint32 instanceId,
|
||||
uint32 charSlot);
|
||||
|
||||
|
||||
bool disconnectClient(uint32 userId);
|
||||
|
||||
|
||||
namespace WS
|
||||
{
|
||||
// welcome service module
|
||||
class CWelcomeServiceMod :
|
||||
public NLNET::CEmptyModuleCommBehav<NLNET::CEmptyModuleServiceBehav<NLNET::CEmptySocketBehav<NLNET::CModuleBase> > >,
|
||||
public WS::CWelcomeServiceSkel,
|
||||
public NLMISC::CManualSingleton<CWelcomeServiceMod>
|
||||
{
|
||||
/// the ring session manager module (if any)
|
||||
NLNET::TModuleProxyPtr _RingSessionManager;
|
||||
/// the login service module (if any)
|
||||
NLNET::TModuleProxyPtr _LoginService;
|
||||
|
||||
void onModuleUp(NLNET::IModuleProxy *proxy);
|
||||
void onModuleDown(NLNET::IModuleProxy *proxy);
|
||||
|
||||
|
||||
////// CWelcomeServiceSkel implementation
|
||||
|
||||
// ask the welcome service to welcome a user
|
||||
virtual void welcomeUser(NLNET::IModuleProxy *sender, uint32 userId, const std::string &userName, const NLNET::CLoginCookie &cookie, const std::string &priviledge, const std::string &exPriviledge, WS::TUserRole mode, uint32 instanceId);
|
||||
|
||||
// ask the welcome service to disconnect a user
|
||||
virtual void disconnectUser(NLNET::IModuleProxy *sender, uint32 userId)
|
||||
{
|
||||
disconnectClient(userId);
|
||||
}
|
||||
|
||||
public:
|
||||
CWelcomeServiceMod()
|
||||
{
|
||||
CWelcomeServiceSkel::init(this);
|
||||
}
|
||||
|
||||
void reportWSOpenState(bool shardOpen)
|
||||
{
|
||||
if (_RingSessionManager == NULL) // skip if the RSM is offline
|
||||
return;
|
||||
|
||||
CWelcomeServiceClientProxy wscp(_RingSessionManager);
|
||||
wscp.reportWSOpenState(this, shardOpen);
|
||||
}
|
||||
|
||||
// forward response from the front end for a player slot to play in
|
||||
// to the client of this welcome service (usually the Ring Session Manager)
|
||||
void frontendResponse(NLNET::IModuleProxy *waiterModule, uint32 userId, const std::string &reason, const NLNET::CLoginCookie &cookie, const std::string &fsAddr)
|
||||
{
|
||||
CWelcomeServiceClientProxy wscp(waiterModule);
|
||||
wscp.welcomeUserResult(this, userId, reason.empty(), fsAddr, reason);
|
||||
}
|
||||
|
||||
// send the current number of players on this shard to the Ring Session Manager
|
||||
void updateConnectedPlayerCount(uint32 nbOnlinePlayers, uint32 nbPendingPlayers)
|
||||
{
|
||||
if (_RingSessionManager == NULL) // skip if the RSM is offline
|
||||
return;
|
||||
|
||||
CWelcomeServiceClientProxy wscp(_RingSessionManager);
|
||||
wscp.updateConnectedPlayerCount(this, nbOnlinePlayers, nbPendingPlayers);
|
||||
}
|
||||
|
||||
// inform the LS that a pending client is lost
|
||||
void pendingUserLost(const NLNET::CLoginCookie &cookie);
|
||||
};
|
||||
|
||||
struct TPendingFEResponseInfo
|
||||
{
|
||||
CWelcomeServiceMod *WSMod;
|
||||
NLNET::TModuleProxyPtr WaiterModule;
|
||||
uint32 UserId;
|
||||
};
|
||||
typedef std::map<NLNET::CLoginCookie, TPendingFEResponseInfo> TPendingFeReponses;
|
||||
// the list of cookie string that are pending an
|
||||
TPendingFeReponses PendingFeResponse;
|
||||
|
||||
} // namespace WS
|
|
@ -94,82 +94,6 @@
|
|||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Debug|x64"
|
||||
OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
|
||||
IntermediateDirectory="$(SolutionDir)obj64\$(ConfigurationName)\$(ProjectName)"
|
||||
ConfigurationType="1"
|
||||
CharacterSet="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
TargetEnvironment="3"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="4"
|
||||
InlineFunctionExpansion="1"
|
||||
AdditionalIncludeDirectories="../../../common/src;.;.."
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS"
|
||||
MinimalRebuild="true"
|
||||
ExceptionHandling="2"
|
||||
BasicRuntimeChecks="3"
|
||||
SmallerTypeCheck="true"
|
||||
RuntimeLibrary="3"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
DebugInformationFormat="3"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
LinkIncremental="2"
|
||||
GenerateDebugInformation="true"
|
||||
SubSystem="2"
|
||||
TargetMachine="17"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
|
||||
|
@ -253,6 +177,82 @@
|
|||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Debug|x64"
|
||||
OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
|
||||
IntermediateDirectory="$(SolutionDir)obj64\$(ConfigurationName)\$(ProjectName)"
|
||||
ConfigurationType="1"
|
||||
CharacterSet="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
TargetEnvironment="3"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="4"
|
||||
InlineFunctionExpansion="1"
|
||||
AdditionalIncludeDirectories="../../../common/src;.;.."
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS"
|
||||
MinimalRebuild="true"
|
||||
ExceptionHandling="2"
|
||||
BasicRuntimeChecks="3"
|
||||
SmallerTypeCheck="true"
|
||||
RuntimeLibrary="3"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
DebugInformationFormat="3"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
LinkIncremental="2"
|
||||
GenerateDebugInformation="true"
|
||||
SubSystem="2"
|
||||
TargetMachine="17"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|x64"
|
||||
OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
|
||||
|
@ -345,6 +345,10 @@
|
|||
RelativePath=".\ryzom_welcome_service.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\ryzom_welcome_service.h"
|
||||
>
|
||||
</File>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
#include "nel/net/module_builder_parts.h"
|
||||
#include "nel/net/login_cookie.h"
|
||||
|
||||
#include "../../nelns/welcome_service/welcome_service_itf.h"
|
||||
#include "game_share/welcome_service_itf.h"
|
||||
|
||||
#include "game_share/utils.h"
|
||||
#include "server_share/mysql_wrapper.h"
|
||||
|
@ -23,8 +23,6 @@ using namespace MSW;
|
|||
using namespace RSMGR;
|
||||
using namespace ENTITYLOC;
|
||||
|
||||
#include "../../../../nelns/welcome_service/welcome_service_itf.cpp"
|
||||
|
||||
namespace LS
|
||||
{
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
#include "nel/net/module_builder_parts.h"
|
||||
#include "nel/net/callback_server.h"
|
||||
|
||||
#include "../../nelns/welcome_service/welcome_service_itf.h"
|
||||
#include "game_share/welcome_service_itf.h"
|
||||
#include "game_share/r2_types.h"
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue