Starting login dialog integration on client side.

This commit is contained in:
lotodore
2009-09-24 20:10:40 +00:00
parent 64613ac9b4
commit 39285263b7
11 changed files with 65 additions and 42 deletions
+1 -1
View File
@@ -60,8 +60,8 @@ public:
bool ipv6,
bool sctp,
const std::string &avatarServerAddress,
const std::string &pwd,
const std::string &playerName,
const std::string &playerPwd,
const std::string &avatarFile,
const std::string &cacheDir);
virtual void SignalTermination();
+3 -3
View File
@@ -84,8 +84,8 @@ void
ClientThread::Init(
const string &serverAddress, const string &serverListUrl,
bool useServerList, unsigned serverPort, bool ipv6, bool sctp,
const string &avatarServerAddress, const string &pwd,
const string &playerName, const string &avatarFile,
const string &avatarServerAddress, const string &playerName,
const string &playerPwd, const string &avatarFile,
const string &cacheDir)
{
if (IsRunning())
@@ -103,8 +103,8 @@ ClientThread::Init(
context.SetUseServerList(useServerList);
context.SetServerPort(serverPort);
context.SetAvatarServerAddr(avatarServerAddress);
context.SetPassword(pwd);
context.SetPlayerName(playerName);
context.SetPassword(playerPwd);
context.SetAvatarFile(avatarFile);
context.SetCacheDir(cacheDir);
}
+24 -12
View File
@@ -28,7 +28,6 @@
#include <net/socket_msg.h>
#include <net/chatcleanermanager.h>
#include <db/serverdbinterface.h>
#include <db/serverdbcallback.h>
#ifdef POKERTH_OFFICIAL_SERVER
#include <dbclosed/serverdbfactoryinternal.h>
#else
@@ -105,19 +104,21 @@ public:
{
}
virtual void PlayerLoginSuccess(async_handle login, db_id playerId)
virtual void PlayerLoginSuccess(unsigned requestId, db_id dbPlayerId)
{
m_server.AuthenticationSuccess(requestId, dbPlayerId);
}
virtual void PlayerLoginFailed(unsigned requestId)
{
m_server.AuthenticationFailure(requestId);
}
virtual void CreateGameSuccess(unsigned requestId, db_id gameId)
{
}
virtual void PlayerLoginFailed(async_handle login)
{
}
virtual void CreateGameSuccess(async_handle create, db_id gameId)
{
}
virtual void CreateGameFailed(async_handle create)
virtual void CreateGameFailed(unsigned requestId)
{
}
@@ -1255,7 +1256,18 @@ ServerLobbyThread::EstablishSession(SessionWrapper session)
void
ServerLobbyThread::AuthenticatePlayer(SessionWrapper session, const std::string &password)
{
// TODO
assert(session.playerData);
m_database->AsyncPlayerLogin(session.playerData->GetUniqueId(), session.playerData->GetName(), password);
}
void
ServerLobbyThread::AuthenticationSuccess(unsigned playerId, db_id dbPlayerId)
{
}
void
ServerLobbyThread::AuthenticationFailure(unsigned playerId)
{
}
void
+5
View File
@@ -27,6 +27,7 @@
#include <net/sessionmanager.h>
#include <net/netpacket.h>
#include <db/serverdbcallback.h>
#include <gui/guiinterface.h>
#include <gamedata.h>
@@ -133,6 +134,8 @@ protected:
void InitAfterLogin(SessionWrapper session);
void EstablishSession(SessionWrapper session);
void AuthenticatePlayer(SessionWrapper session, const std::string &password);
void AuthenticationSuccess(unsigned playerId, db_id dbPlayerId);
void AuthenticationFailure(unsigned playerId);
void RequestPlayerAvatar(SessionWrapper session);
void TimerRemoveGame(const boost::system::error_code &ec);
void TimerRemovePlayer(const boost::system::error_code &ec);
@@ -232,6 +235,8 @@ private:
boost::asio::deadline_timer m_avatarLockTimer;
const boost::posix_time::ptime m_startTime;
friend class InternalServerCallback;
};
#endif