2009-09-04 22:53:24 +00:00
|
|
|
/***************************************************************************
|
|
|
|
|
* Copyright (C) 2009 by Lothar May *
|
|
|
|
|
* *
|
|
|
|
|
* This program is free software; you can redistribute it and/or modify *
|
|
|
|
|
* it under the terms of the GNU General Public License as published by *
|
|
|
|
|
* the Free Software Foundation; either version 2 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 General Public License for more details. *
|
|
|
|
|
* *
|
|
|
|
|
* You should have received a copy of the GNU General Public License *
|
|
|
|
|
* along with this program; if not, write to the *
|
|
|
|
|
* Free Software Foundation, Inc., *
|
|
|
|
|
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
|
|
|
|
***************************************************************************/
|
|
|
|
|
|
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)
|
|
|
|
|
: 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
|
2009-10-11 12:07:56 +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
|
|
|
}
|
|
|
|
|
|
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
|
2009-10-11 09:20:17 +00:00
|
|
|
ServerDBGeneric::SetGamePlayerPlace(DB_id /*gameId*/, DB_id /*playerId*/, unsigned /*place*/)
|
2009-09-04 22:53:24 +00:00
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2009-10-03 17:03:51 +00:00
|
|
|
void
|
2009-10-11 09:20:17 +00:00
|
|
|
ServerDBGeneric::EndGame(DB_id /*gameId*/)
|
2009-09-04 22:53:24 +00:00
|
|
|
{
|
|
|
|
|
}
|