Creating game entries in database abstraction layer.
This commit is contained in:
@@ -54,26 +54,23 @@ ServerDBGeneric::AsyncPlayerLogin(unsigned requestId, const string &/*playerName
|
|||||||
m_ioService->post(boost::bind(&ServerDBCallback::PlayerLoginFailed, &m_callback, requestId));
|
m_ioService->post(boost::bind(&ServerDBCallback::PlayerLoginFailed, &m_callback, requestId));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
void
|
||||||
ServerDBGeneric::PlayerLogout(db_id /*playerId*/)
|
ServerDBGeneric::PlayerLogout(db_id /*playerId*/)
|
||||||
{
|
{
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
ServerDBGeneric::AsyncCreateGame(unsigned requestId, const db_list &/*players*/)
|
ServerDBGeneric::AsyncCreateGame(unsigned requestId, const string &/*gameName*/)
|
||||||
{
|
{
|
||||||
m_ioService->post(boost::bind(&ServerDBCallback::CreateGameFailed, &m_callback, requestId));
|
m_ioService->post(boost::bind(&ServerDBCallback::CreateGameFailed, &m_callback, requestId));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
void
|
||||||
ServerDBGeneric::SetGamePlayerPlace(db_id /*gameId*/, db_id /*playerId*/, unsigned /*place*/)
|
ServerDBGeneric::SetGamePlayerPlace(db_id /*gameId*/, db_id /*playerId*/, unsigned /*place*/)
|
||||||
{
|
{
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
void
|
||||||
ServerDBGeneric::EndGame(db_id /*gameId*/)
|
ServerDBGeneric::EndGame(db_id /*gameId*/)
|
||||||
{
|
{
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,6 +36,8 @@ public:
|
|||||||
virtual void ConnectSuccess() = 0;
|
virtual void ConnectSuccess() = 0;
|
||||||
virtual void ConnectFailed(const std::string &error) = 0;
|
virtual void ConnectFailed(const std::string &error) = 0;
|
||||||
|
|
||||||
|
virtual void QueryError(const std::string &error) = 0;
|
||||||
|
|
||||||
virtual void PlayerLoginSuccess(unsigned requestId, db_id playerId) = 0;
|
virtual void PlayerLoginSuccess(unsigned requestId, db_id playerId) = 0;
|
||||||
virtual void PlayerLoginFailed(unsigned requestId) = 0;
|
virtual void PlayerLoginFailed(unsigned requestId) = 0;
|
||||||
|
|
||||||
|
|||||||
@@ -39,11 +39,11 @@ public:
|
|||||||
virtual void Stop();
|
virtual void Stop();
|
||||||
|
|
||||||
virtual void AsyncPlayerLogin(unsigned requestId, const std::string &playerName, const std::string &secretString);
|
virtual void AsyncPlayerLogin(unsigned requestId, const std::string &playerName, const std::string &secretString);
|
||||||
virtual bool PlayerLogout(db_id playerId);
|
virtual void PlayerLogout(db_id playerId);
|
||||||
|
|
||||||
virtual void AsyncCreateGame(unsigned requestId, const db_list &players);
|
virtual void AsyncCreateGame(unsigned requestId, const std::string &gameName);
|
||||||
virtual bool SetGamePlayerPlace(db_id gameId, db_id playerId, unsigned place);
|
virtual void SetGamePlayerPlace(db_id gameId, db_id playerId, unsigned place);
|
||||||
virtual bool EndGame(db_id gameId);
|
virtual void EndGame(db_id gameId);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
boost::shared_ptr<boost::asio::io_service> m_ioService;
|
boost::shared_ptr<boost::asio::io_service> m_ioService;
|
||||||
|
|||||||
@@ -39,11 +39,11 @@ public:
|
|||||||
virtual void Stop() = 0;
|
virtual void Stop() = 0;
|
||||||
|
|
||||||
virtual void AsyncPlayerLogin(unsigned requestId, const std::string &playerName, const std::string &secretString) = 0;
|
virtual void AsyncPlayerLogin(unsigned requestId, const std::string &playerName, const std::string &secretString) = 0;
|
||||||
virtual bool PlayerLogout(db_id playerId) = 0;
|
virtual void PlayerLogout(db_id playerId) = 0;
|
||||||
|
|
||||||
virtual void AsyncCreateGame(unsigned requestId, const db_list &players) = 0;
|
virtual void AsyncCreateGame(unsigned requestId, const std::string &gameName) = 0;
|
||||||
virtual bool SetGamePlayerPlace(db_id gameId, db_id playerId, unsigned place) = 0;
|
virtual void SetGamePlayerPlace(db_id gameId, db_id playerId, unsigned place) = 0;
|
||||||
virtual bool EndGame(db_id gameId) = 0;
|
virtual void EndGame(db_id gameId) = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -102,6 +102,12 @@ public:
|
|||||||
|
|
||||||
virtual void ConnectFailed(const string &error)
|
virtual void ConnectFailed(const string &error)
|
||||||
{
|
{
|
||||||
|
// TODO
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual void QueryError(const std::string &error)
|
||||||
|
{
|
||||||
|
// TODO
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void PlayerLoginSuccess(unsigned requestId, db_id dbPlayerId)
|
virtual void PlayerLoginSuccess(unsigned requestId, db_id dbPlayerId)
|
||||||
|
|||||||
Reference in New Issue
Block a user