2011-07-02 14:49:09 +00:00
|
|
|
/*****************************************************************************
|
|
|
|
|
* PokerTH - The open source texas holdem engine *
|
|
|
|
|
* Copyright (C) 2006-2011 Felix Hammer, Florian Thauer, Lothar May *
|
|
|
|
|
* *
|
|
|
|
|
* 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/>. *
|
|
|
|
|
*****************************************************************************/
|
2009-09-04 22:53:24 +00:00
|
|
|
|
2009-09-24 20:10:40 +00:00
|
|
|
#include <boost/bind.hpp>
|
2009-09-04 22:53:24 +00:00
|
|
|
#include <db/serverdbgeneric.h>
|
|
|
|
|
|
|
|
|
|
using namespace std;
|
|
|
|
|
|
|
|
|
|
|
2009-09-24 20:10:40 +00:00
|
|
|
ServerDBGeneric::ServerDBGeneric(ServerDBCallback &cb, boost::shared_ptr<boost::asio::io_service> ioService)
|
2011-02-11 20:02:08 +00:00
|
|
|
: m_ioService(ioService), m_callback(cb)
|
2009-09-04 22:53:24 +00:00
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ServerDBGeneric::~ServerDBGeneric()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
ServerDBGeneric::Init(const string &/*host*/, const string &/*user*/, const string &/*pwd*/,
|
|
|
|
|
const string &/*database*/, const string &/*encryptionKey*/)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2009-09-26 22:10:43 +00:00
|
|
|
void
|
|
|
|
|
ServerDBGeneric::Start()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
ServerDBGeneric::Stop()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2009-09-24 20:10:40 +00:00
|
|
|
void
|
2010-08-23 17:37:22 +00:00
|
|
|
ServerDBGeneric::AsyncPlayerLogin(unsigned requestId, const string &/*playerName*/)
|
2009-09-04 22:53:24 +00:00
|
|
|
{
|
2009-09-24 20:10:40 +00:00
|
|
|
m_ioService->post(boost::bind(&ServerDBCallback::PlayerLoginFailed, &m_callback, requestId));
|
2009-09-04 22:53:24 +00:00
|
|
|
}
|
|
|
|
|
|
2011-01-09 00:22:00 +00:00
|
|
|
void
|
|
|
|
|
ServerDBGeneric::AsyncCheckAvatarBlacklist(unsigned requestId, const std::string &/*avatarHash*/)
|
|
|
|
|
{
|
|
|
|
|
m_ioService->post(boost::bind(&ServerDBCallback::AvatarIsBlacklisted, &m_callback, requestId));
|
|
|
|
|
}
|
|
|
|
|
|
2010-08-23 17:37:22 +00:00
|
|
|
void
|
|
|
|
|
ServerDBGeneric::PlayerPostLogin(DB_id /*playerId*/, const std::string &/*avatarHash*/, const std::string &/*avatarType*/)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2009-10-03 17:03:51 +00:00
|
|
|
void
|
2009-10-11 09:20:17 +00:00
|
|
|
ServerDBGeneric::PlayerLogout(DB_id /*playerId*/)
|
2009-09-04 22:53:24 +00:00
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2009-09-24 20:10:40 +00:00
|
|
|
void
|
2009-10-03 17:03:51 +00:00
|
|
|
ServerDBGeneric::AsyncCreateGame(unsigned requestId, const string &/*gameName*/)
|
2009-09-04 22:53:24 +00:00
|
|
|
{
|
2009-09-24 20:10:40 +00:00
|
|
|
m_ioService->post(boost::bind(&ServerDBCallback::CreateGameFailed, &m_callback, requestId));
|
2009-09-04 22:53:24 +00:00
|
|
|
}
|
|
|
|
|
|
2009-10-03 17:03:51 +00:00
|
|
|
void
|
2011-03-20 22:38:03 +00:00
|
|
|
ServerDBGeneric::SetGamePlayerPlace(unsigned /*requestId*/, DB_id /*playerId*/, unsigned /*place*/)
|
2009-09-04 22:53:24 +00:00
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2009-10-03 17:03:51 +00:00
|
|
|
void
|
2011-03-20 22:38:03 +00:00
|
|
|
ServerDBGeneric::EndGame(unsigned /*requestId*/)
|
2009-09-04 22:53:24 +00:00
|
|
|
{
|
|
|
|
|
}
|
2010-12-24 16:46:49 +00:00
|
|
|
|
|
|
|
|
void
|
2011-04-10 10:04:42 +00:00
|
|
|
ServerDBGeneric::AsyncReportAvatar(unsigned requestId, unsigned replyId, DB_id /*reportedPlayerId*/, const std::string &/*avatarHash*/, const std::string &/*avatarType*/, DB_id * /*byPlayerId*/)
|
2010-12-24 16:46:49 +00:00
|
|
|
{
|
|
|
|
|
m_ioService->post(boost::bind(&ServerDBCallback::ReportAvatarFailed, &m_callback, requestId, replyId));
|
|
|
|
|
}
|