1 /***************************************************************************** 2 * PokerTH - The open source texas holdem engine * 3 * Copyright (C) 2006-2016 Felix Hammer, Florian Thauer, Lothar May * 4 * * 5 * This program is free software: you can redistribute it and/or modify * 6 * it under the terms of the GNU Affero General Public License as * 7 * published by the Free Software Foundation, either version 3 of the * 8 * License, or (at your option) any later version. * 9 * * 10 * This program is distributed in the hope that it will be useful, * 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 * GNU Affero General Public License for more details. * 14 * * 15 * You should have received a copy of the GNU Affero General Public License * 16 * along with this program. If not, see <http://www.gnu.org/licenses/>. * 17 * * 18 * * 19 * Additional permission under GNU AGPL version 3 section 7 * 20 * * 21 * If you modify this program, or any covered work, by linking or * 22 * combining it with the OpenSSL project's OpenSSL library (or a * 23 * modified version of that library), containing parts covered by the * 24 * terms of the OpenSSL or SSLeay licenses, the authors of PokerTH * 25 * (Felix Hammer, Florian Thauer, Lothar May) grant you additional * 26 * permission to convey the resulting work. * 27 * Corresponding Source for a non-source form of such a combination * 28 * shall include the source code for the parts of OpenSSL used as well * 29 * as that of the covered work. * 30 *****************************************************************************/ 31 /* Async database update to block a player. */ 32 33 #ifndef _ASYNCDBBLOCKPLAYER_H_ 34 #define _ASYNCDBBLOCKPLAYER_H_ 35 36 #include <dbofficial/singleasyncdbquery.h> 37 38 39 class AsyncDBBlockPlayer : public SingleAsyncDBQuery 40 { 41 public: 42 AsyncDBBlockPlayer(unsigned queryId, unsigned replyId, const std::string &preparedName, const std::list<std::string> ¶ms); 43 virtual ~AsyncDBBlockPlayer(); 44 45 virtual void Init(DBIdManager& idManager); 46 47 virtual void HandleResult(mysqlpp::Query &query, DBIdManager& idManager, mysqlpp::StoreQueryResult& result, boost::asio::io_service &service, ServerDBCallback &cb); 48 virtual void HandleNoResult(mysqlpp::Query &query, DBIdManager& idManager, boost::asio::io_service &service, ServerDBCallback &cb); 49 virtual void HandleError(boost::asio::io_service &service, ServerDBCallback &cb); 50 RequiresResultSet()51 virtual bool RequiresResultSet() const 52 { 53 return false; 54 } 55 56 private: 57 unsigned m_replyId; 58 }; 59 60 #endif 61