/ghost-legacy/ghostdbmysql.h

http://ghostcb.googlecode.com/ · C Header · 497 lines · 270 code · 61 blank · 166 comment · 0 complexity · 92b0c38ef7ea513f68b59c985b5f15ec MD5 · raw file

  1. /*
  2. Copyright [2008] [Trevor Hogan]
  3. Licensed under the Apache License, Version 2.0 (the "License");
  4. you may not use this file except in compliance with the License.
  5. You may obtain a copy of the License at
  6. http://www.apache.org/licenses/LICENSE-2.0
  7. Unless required by applicable law or agreed to in writing, software
  8. distributed under the License is distributed on an "AS IS" BASIS,
  9. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10. See the License for the specific language governing permissions and
  11. limitations under the License.
  12. CODE PORTED FROM THE ORIGINAL GHOST PROJECT: http://ghost.pwner.org/
  13. */
  14. #ifdef GHOST_MYSQL
  15. #ifndef GHOSTDBMYSQL_H
  16. #define GHOSTDBMYSQL_H
  17. /**************
  18. *** SCHEMA ***
  19. **************
  20. CREATE TABLE admins (
  21. id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
  22. botid INT NOT NULL,
  23. name VARCHAR(15) NOT NULL,
  24. server VARCHAR(100) NOT NULL
  25. )
  26. CREATE TABLE bans (
  27. id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
  28. botid INT NOT NULL,
  29. server VARCHAR(100) NOT NULL,
  30. name VARCHAR(15) NOT NULL,
  31. ip VARCHAR(15) NOT NULL,
  32. date DATETIME NOT NULL,
  33. gamename VARCHAR(31) NOT NULL,
  34. admin VARCHAR(15) NOT NULL,
  35. reason VARCHAR(255) NOT NULL
  36. )
  37. CREATE TABLE games (
  38. id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
  39. botid INT NOT NULL,
  40. server VARCHAR(100) NOT NULL,
  41. map VARCHAR(100) NOT NULL,
  42. datetime DATETIME NOT NULL,
  43. gamename VARCHAR(31) NOT NULL,
  44. ownername VARCHAR(15) NOT NULL,
  45. duration INT NOT NULL,
  46. gamestate INT NOT NULL,
  47. creatorname VARCHAR(15) NOT NULL,
  48. creatorserver VARCHAR(100) NOT NULL
  49. )
  50. CREATE TABLE gameplayers (
  51. id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
  52. botid INT NOT NULL,
  53. gameid INT NOT NULL,
  54. name VARCHAR(15) NOT NULL,
  55. ip VARCHAR(15) NOT NULL,
  56. spoofed INT NOT NULL,
  57. reserved INT NOT NULL,
  58. loadingtime INT NOT NULL,
  59. `left` INT NOT NULL,
  60. leftreason VARCHAR(100) NOT NULL,
  61. team INT NOT NULL,
  62. colour INT NOT NULL,
  63. spoofedrealm VARCHAR(100) NOT NULL,
  64. INDEX( gameid )
  65. )
  66. CREATE TABLE dotagames (
  67. id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
  68. botid INT NOT NULL,
  69. gameid INT NOT NULL,
  70. winner INT NOT NULL,
  71. min INT NOT NULL,
  72. sec INT NOT NULL
  73. )
  74. CREATE TABLE dotaplayers (
  75. id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
  76. botid INT NOT NULL,
  77. gameid INT NOT NULL,
  78. colour INT NOT NULL,
  79. kills INT NOT NULL,
  80. deaths INT NOT NULL,
  81. creepkills INT NOT NULL,
  82. creepdenies INT NOT NULL,
  83. assists INT NOT NULL,
  84. gold INT NOT NULL,
  85. neutralkills INT NOT NULL,
  86. item1 CHAR(4) NOT NULL,
  87. item2 CHAR(4) NOT NULL,
  88. item3 CHAR(4) NOT NULL,
  89. item4 CHAR(4) NOT NULL,
  90. item5 CHAR(4) NOT NULL,
  91. item6 CHAR(4) NOT NULL,
  92. hero CHAR(4) NOT NULL,
  93. newcolour INT NOT NULL,
  94. towerkills INT NOT NULL,
  95. raxkills INT NOT NULL,
  96. courierkills INT NOT NULL,
  97. INDEX( gameid, colour )
  98. )
  99. CREATE TABLE downloads (
  100. id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
  101. botid INT NOT NULL,
  102. map VARCHAR(100) NOT NULL,
  103. mapsize INT NOT NULL,
  104. datetime DATETIME NOT NULL,
  105. name VARCHAR(15) NOT NULL,
  106. ip VARCHAR(15) NOT NULL,
  107. spoofed INT NOT NULL,
  108. spoofedrealm VARCHAR(100) NOT NULL,
  109. downloadtime INT NOT NULL
  110. )
  111. CREATE TABLE scores (
  112. id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
  113. category VARCHAR(25) NOT NULL,
  114. name VARCHAR(15) NOT NULL,
  115. server VARCHAR(100) NOT NULL,
  116. score REAL NOT NULL
  117. )
  118. CREATE TABLE w3mmdplayers (
  119. id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
  120. botid INT NOT NULL,
  121. category VARCHAR(25) NOT NULL,
  122. gameid INT NOT NULL,
  123. pid INT NOT NULL,
  124. name VARCHAR(15) NOT NULL,
  125. flag VARCHAR(32) NOT NULL,
  126. leaver INT NOT NULL,
  127. practicing INT NOT NULL
  128. )
  129. CREATE TABLE w3mmdvars (
  130. id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
  131. botid INT NOT NULL,
  132. gameid INT NOT NULL,
  133. pid INT NOT NULL,
  134. varname VARCHAR(25) NOT NULL,
  135. value_int INT DEFAULT NULL,
  136. value_real REAL DEFAULT NULL,
  137. value_string VARCHAR(100) DEFAULT NULL
  138. )
  139. **************
  140. *** SCHEMA ***
  141. **************/
  142. //
  143. // CGHostDBMySQL
  144. //
  145. class CGHostDBMySQL : public CGHostDB
  146. {
  147. private:
  148. string m_Server;
  149. string m_Database;
  150. string m_User;
  151. string m_Password;
  152. uint16_t m_Port;
  153. uint32_t m_BotID;
  154. queue<void *> m_IdleConnections;
  155. uint32_t m_NumConnections;
  156. uint32_t m_OutstandingCallables;
  157. public:
  158. CGHostDBMySQL( CConfig *CFG );
  159. virtual ~CGHostDBMySQL( );
  160. virtual string GetStatus( );
  161. virtual void RecoverCallable( CBaseCallable *callable );
  162. // threaded database functions
  163. virtual void CreateThread( CBaseCallable *callable );
  164. virtual CCallableAdminCount *ThreadedAdminCount( string server );
  165. virtual CCallableAdminCheck *ThreadedAdminCheck( string server, string user );
  166. virtual CCallableAdminAdd *ThreadedAdminAdd( string server, string user );
  167. virtual CCallableAdminRemove *ThreadedAdminRemove( string server, string user );
  168. virtual CCallableAdminList *ThreadedAdminList( string server );
  169. virtual CCallableBanCount *ThreadedBanCount( string server );
  170. virtual CCallableBanCheck *ThreadedBanCheck( string server, string user, string ip );
  171. virtual CCallableBanAdd *ThreadedBanAdd( string server, string user, string ip, string gamename, string admin, string reason );
  172. virtual CCallableBanRemove *ThreadedBanRemove( string server, string user );
  173. virtual CCallableBanRemove *ThreadedBanRemove( string user );
  174. virtual CCallableBanList *ThreadedBanList( string server );
  175. virtual CCallableGameAdd *ThreadedGameAdd( string server, string map, string gamename, string ownername, uint32_t duration, uint32_t gamestate, string creatorname, string creatorserver );
  176. virtual CCallableGamePlayerAdd *ThreadedGamePlayerAdd( uint32_t gameid, string name, string ip, uint32_t spoofed, string spoofedrealm, uint32_t reserved, uint32_t loadingtime, uint32_t left, string leftreason, uint32_t team, uint32_t colour );
  177. virtual CCallableGamePlayerSummaryCheck *ThreadedGamePlayerSummaryCheck( string name );
  178. virtual CCallableDotAGameAdd *ThreadedDotAGameAdd( uint32_t gameid, uint32_t winner, uint32_t min, uint32_t sec );
  179. virtual CCallableDotAPlayerAdd *ThreadedDotAPlayerAdd( uint32_t gameid, uint32_t colour, uint32_t kills, uint32_t deaths, uint32_t creepkills, uint32_t creepdenies, uint32_t assists, uint32_t gold, uint32_t neutralkills, string item1, string item2, string item3, string item4, string item5, string item6, string hero, uint32_t newcolour, uint32_t towerkills, uint32_t raxkills, uint32_t courierkills );
  180. virtual CCallableDotAPlayerSummaryCheck *ThreadedDotAPlayerSummaryCheck( string name );
  181. virtual CCallableDownloadAdd *ThreadedDownloadAdd( string map, uint32_t mapsize, string name, string ip, uint32_t spoofed, string spoofedrealm, uint32_t downloadtime );
  182. virtual CCallableScoreCheck *ThreadedScoreCheck( string category, string name, string server );
  183. virtual CCallableW3MMDPlayerAdd *ThreadedW3MMDPlayerAdd( string category, uint32_t gameid, uint32_t pid, string name, string flag, uint32_t leaver, uint32_t practicing );
  184. virtual CCallableW3MMDVarAdd *ThreadedW3MMDVarAdd( uint32_t gameid, map<VarP,int32_t> var_ints );
  185. virtual CCallableW3MMDVarAdd *ThreadedW3MMDVarAdd( uint32_t gameid, map<VarP,double> var_reals );
  186. virtual CCallableW3MMDVarAdd *ThreadedW3MMDVarAdd( uint32_t gameid, map<VarP,string> var_strings );
  187. // other database functions
  188. virtual void *GetIdleConnection( );
  189. };
  190. //
  191. // global helper functions
  192. //
  193. uint32_t MySQLAdminCount( void *conn, string *error, uint32_t botid, string server );
  194. bool MySQLAdminCheck( void *conn, string *error, uint32_t botid, string server, string user );
  195. bool MySQLAdminAdd( void *conn, string *error, uint32_t botid, string server, string user );
  196. bool MySQLAdminRemove( void *conn, string *error, uint32_t botid, string server, string user );
  197. vector<string> MySQLAdminList( void *conn, string *error, uint32_t botid, string server );
  198. uint32_t MySQLBanCount( void *conn, string *error, uint32_t botid, string server );
  199. CDBBan *MySQLBanCheck( void *conn, string *error, uint32_t botid, string server, string user, string ip );
  200. bool MySQLBanAdd( void *conn, string *error, uint32_t botid, string server, string user, string ip, string gamename, string admin, string reason );
  201. bool MySQLBanRemove( void *conn, string *error, uint32_t botid, string server, string user );
  202. bool MySQLBanRemove( void *conn, string *error, uint32_t botid, string user );
  203. vector<CDBBan *> MySQLBanList( void *conn, string *error, uint32_t botid, string server );
  204. uint32_t MySQLGameAdd( void *conn, string *error, uint32_t botid, string server, string map, string gamename, string ownername, uint32_t duration, uint32_t gamestate, string creatorname, string creatorserver );
  205. uint32_t MySQLGamePlayerAdd( void *conn, string *error, uint32_t botid, uint32_t gameid, string name, string ip, uint32_t spoofed, string spoofedrealm, uint32_t reserved, uint32_t loadingtime, uint32_t left, string leftreason, uint32_t team, uint32_t colour );
  206. CDBGamePlayerSummary *MySQLGamePlayerSummaryCheck( void *conn, string *error, uint32_t botid, string name );
  207. uint32_t MySQLDotAGameAdd( void *conn, string *error, uint32_t botid, uint32_t gameid, uint32_t winner, uint32_t min, uint32_t sec );
  208. uint32_t MySQLDotAPlayerAdd( void *conn, string *error, uint32_t botid, uint32_t gameid, uint32_t colour, uint32_t kills, uint32_t deaths, uint32_t creepkills, uint32_t creepdenies, uint32_t assists, uint32_t gold, uint32_t neutralkills, string item1, string item2, string item3, string item4, string item5, string item6, string hero, uint32_t newcolour, uint32_t towerkills, uint32_t raxkills, uint32_t courierkills );
  209. CDBDotAPlayerSummary *MySQLDotAPlayerSummaryCheck( void *conn, string *error, uint32_t botid, string name );
  210. bool MySQLDownloadAdd( void *conn, string *error, uint32_t botid, string map, uint32_t mapsize, string name, string ip, uint32_t spoofed, string spoofedrealm, uint32_t downloadtime );
  211. double MySQLScoreCheck( void *conn, string *error, uint32_t botid, string category, string name, string server );
  212. uint32_t MySQLW3MMDPlayerAdd( void *conn, string *error, uint32_t botid, string category, uint32_t gameid, uint32_t pid, string name, string flag, uint32_t leaver, uint32_t practicing );
  213. bool MySQLW3MMDVarAdd( void *conn, string *error, uint32_t botid, uint32_t gameid, map<VarP,int32_t> var_ints );
  214. bool MySQLW3MMDVarAdd( void *conn, string *error, uint32_t botid, uint32_t gameid, map<VarP,double> var_reals );
  215. bool MySQLW3MMDVarAdd( void *conn, string *error, uint32_t botid, uint32_t gameid, map<VarP,string> var_strings );
  216. //
  217. // MySQL Callables
  218. //
  219. class CMySQLCallable : virtual public CBaseCallable
  220. {
  221. protected:
  222. void *m_Connection;
  223. string m_SQLServer;
  224. string m_SQLDatabase;
  225. string m_SQLUser;
  226. string m_SQLPassword;
  227. uint16_t m_SQLPort;
  228. uint32_t m_SQLBotID;
  229. public:
  230. CMySQLCallable( void *nConnection, uint32_t nSQLBotID, string nSQLServer, string nSQLDatabase, string nSQLUser, string nSQLPassword, uint16_t nSQLPort ) : CBaseCallable( ), m_Connection( nConnection ), m_SQLBotID( nSQLBotID ), m_SQLServer( nSQLServer ), m_SQLDatabase( nSQLDatabase ), m_SQLUser( nSQLUser ), m_SQLPassword( nSQLPassword ), m_SQLPort( nSQLPort ) { }
  231. virtual ~CMySQLCallable( ) { }
  232. virtual void *GetConnection( ) { return m_Connection; }
  233. virtual void Init( );
  234. virtual void Close( );
  235. };
  236. class CMySQLCallableAdminCount : public CCallableAdminCount, public CMySQLCallable
  237. {
  238. public:
  239. CMySQLCallableAdminCount( string nServer, void *nConnection, uint32_t nSQLBotID, string nSQLServer, string nSQLDatabase, string nSQLUser, string nSQLPassword, uint16_t nSQLPort ) : CBaseCallable( ), CCallableAdminCount( nServer ), CMySQLCallable( nConnection, nSQLBotID, nSQLServer, nSQLDatabase, nSQLUser, nSQLPassword, nSQLPort ) { }
  240. virtual ~CMySQLCallableAdminCount( ) { }
  241. virtual void operator( )( );
  242. virtual void Init( ) { CMySQLCallable :: Init( ); }
  243. virtual void Close( ) { CMySQLCallable :: Close( ); }
  244. };
  245. class CMySQLCallableAdminCheck : public CCallableAdminCheck, public CMySQLCallable
  246. {
  247. public:
  248. CMySQLCallableAdminCheck( string nServer, string nUser, void *nConnection, uint32_t nSQLBotID, string nSQLServer, string nSQLDatabase, string nSQLUser, string nSQLPassword, uint16_t nSQLPort ) : CBaseCallable( ), CCallableAdminCheck( nServer, nUser ), CMySQLCallable( nConnection, nSQLBotID, nSQLServer, nSQLDatabase, nSQLUser, nSQLPassword, nSQLPort ) { }
  249. virtual ~CMySQLCallableAdminCheck( ) { }
  250. virtual void operator( )( );
  251. virtual void Init( ) { CMySQLCallable :: Init( ); }
  252. virtual void Close( ) { CMySQLCallable :: Close( ); }
  253. };
  254. class CMySQLCallableAdminAdd : public CCallableAdminAdd, public CMySQLCallable
  255. {
  256. public:
  257. CMySQLCallableAdminAdd( string nServer, string nUser, void *nConnection, uint32_t nSQLBotID, string nSQLServer, string nSQLDatabase, string nSQLUser, string nSQLPassword, uint16_t nSQLPort ) : CBaseCallable( ), CCallableAdminAdd( nServer, nUser ), CMySQLCallable( nConnection, nSQLBotID, nSQLServer, nSQLDatabase, nSQLUser, nSQLPassword, nSQLPort ) { }
  258. virtual ~CMySQLCallableAdminAdd( ) { }
  259. virtual void operator( )( );
  260. virtual void Init( ) { CMySQLCallable :: Init( ); }
  261. virtual void Close( ) { CMySQLCallable :: Close( ); }
  262. };
  263. class CMySQLCallableAdminRemove : public CCallableAdminRemove, public CMySQLCallable
  264. {
  265. public:
  266. CMySQLCallableAdminRemove( string nServer, string nUser, void *nConnection, uint32_t nSQLBotID, string nSQLServer, string nSQLDatabase, string nSQLUser, string nSQLPassword, uint16_t nSQLPort ) : CBaseCallable( ), CCallableAdminRemove( nServer, nUser ), CMySQLCallable( nConnection, nSQLBotID, nSQLServer, nSQLDatabase, nSQLUser, nSQLPassword, nSQLPort ) { }
  267. virtual ~CMySQLCallableAdminRemove( ) { }
  268. virtual void operator( )( );
  269. virtual void Init( ) { CMySQLCallable :: Init( ); }
  270. virtual void Close( ) { CMySQLCallable :: Close( ); }
  271. };
  272. class CMySQLCallableAdminList : public CCallableAdminList, public CMySQLCallable
  273. {
  274. public:
  275. CMySQLCallableAdminList( string nServer, void *nConnection, uint32_t nSQLBotID, string nSQLServer, string nSQLDatabase, string nSQLUser, string nSQLPassword, uint16_t nSQLPort ) : CBaseCallable( ), CCallableAdminList( nServer ), CMySQLCallable( nConnection, nSQLBotID, nSQLServer, nSQLDatabase, nSQLUser, nSQLPassword, nSQLPort ) { }
  276. virtual ~CMySQLCallableAdminList( ) { }
  277. virtual void operator( )( );
  278. virtual void Init( ) { CMySQLCallable :: Init( ); }
  279. virtual void Close( ) { CMySQLCallable :: Close( ); }
  280. };
  281. class CMySQLCallableBanCount : public CCallableBanCount, public CMySQLCallable
  282. {
  283. public:
  284. CMySQLCallableBanCount( string nServer, void *nConnection, uint32_t nSQLBotID, string nSQLServer, string nSQLDatabase, string nSQLUser, string nSQLPassword, uint16_t nSQLPort ) : CBaseCallable( ), CCallableBanCount( nServer ), CMySQLCallable( nConnection, nSQLBotID, nSQLServer, nSQLDatabase, nSQLUser, nSQLPassword, nSQLPort ) { }
  285. virtual ~CMySQLCallableBanCount( ) { }
  286. virtual void operator( )( );
  287. virtual void Init( ) { CMySQLCallable :: Init( ); }
  288. virtual void Close( ) { CMySQLCallable :: Close( ); }
  289. };
  290. class CMySQLCallableBanCheck : public CCallableBanCheck, public CMySQLCallable
  291. {
  292. public:
  293. CMySQLCallableBanCheck( string nServer, string nUser, string nIP, void *nConnection, uint32_t nSQLBotID, string nSQLServer, string nSQLDatabase, string nSQLUser, string nSQLPassword, uint16_t nSQLPort ) : CBaseCallable( ), CCallableBanCheck( nServer, nUser, nIP ), CMySQLCallable( nConnection, nSQLBotID, nSQLServer, nSQLDatabase, nSQLUser, nSQLPassword, nSQLPort ) { }
  294. virtual ~CMySQLCallableBanCheck( ) { }
  295. virtual void operator( )( );
  296. virtual void Init( ) { CMySQLCallable :: Init( ); }
  297. virtual void Close( ) { CMySQLCallable :: Close( ); }
  298. };
  299. class CMySQLCallableBanAdd : public CCallableBanAdd, public CMySQLCallable
  300. {
  301. public:
  302. CMySQLCallableBanAdd( string nServer, string nUser, string nIP, string nGameName, string nAdmin, string nReason, void *nConnection, uint32_t nSQLBotID, string nSQLServer, string nSQLDatabase, string nSQLUser, string nSQLPassword, uint16_t nSQLPort ) : CBaseCallable( ), CCallableBanAdd( nServer, nUser, nIP, nGameName, nAdmin, nReason ), CMySQLCallable( nConnection, nSQLBotID, nSQLServer, nSQLDatabase, nSQLUser, nSQLPassword, nSQLPort ) { }
  303. virtual ~CMySQLCallableBanAdd( ) { }
  304. virtual void operator( )( );
  305. virtual void Init( ) { CMySQLCallable :: Init( ); }
  306. virtual void Close( ) { CMySQLCallable :: Close( ); }
  307. };
  308. class CMySQLCallableBanRemove : public CCallableBanRemove, public CMySQLCallable
  309. {
  310. public:
  311. CMySQLCallableBanRemove( string nServer, string nUser, void *nConnection, uint32_t nSQLBotID, string nSQLServer, string nSQLDatabase, string nSQLUser, string nSQLPassword, uint16_t nSQLPort ) : CBaseCallable( ), CCallableBanRemove( nServer, nUser ), CMySQLCallable( nConnection, nSQLBotID, nSQLServer, nSQLDatabase, nSQLUser, nSQLPassword, nSQLPort ) { }
  312. virtual ~CMySQLCallableBanRemove( ) { }
  313. virtual void operator( )( );
  314. virtual void Init( ) { CMySQLCallable :: Init( ); }
  315. virtual void Close( ) { CMySQLCallable :: Close( ); }
  316. };
  317. class CMySQLCallableBanList : public CCallableBanList, public CMySQLCallable
  318. {
  319. public:
  320. CMySQLCallableBanList( string nServer, void *nConnection, uint32_t nSQLBotID, string nSQLServer, string nSQLDatabase, string nSQLUser, string nSQLPassword, uint16_t nSQLPort ) : CBaseCallable( ), CCallableBanList( nServer ), CMySQLCallable( nConnection, nSQLBotID, nSQLServer, nSQLDatabase, nSQLUser, nSQLPassword, nSQLPort ) { }
  321. virtual ~CMySQLCallableBanList( ) { }
  322. virtual void operator( )( );
  323. virtual void Init( ) { CMySQLCallable :: Init( ); }
  324. virtual void Close( ) { CMySQLCallable :: Close( ); }
  325. };
  326. class CMySQLCallableGameAdd : public CCallableGameAdd, public CMySQLCallable
  327. {
  328. public:
  329. CMySQLCallableGameAdd( string nServer, string nMap, string nGameName, string nOwnerName, uint32_t nDuration, uint32_t nGameState, string nCreatorName, string nCreatorServer, void *nConnection, uint32_t nSQLBotID, string nSQLServer, string nSQLDatabase, string nSQLUser, string nSQLPassword, uint16_t nSQLPort ) : CBaseCallable( ), CCallableGameAdd( nServer, nMap, nGameName, nOwnerName, nDuration, nGameState, nCreatorName, nCreatorServer ), CMySQLCallable( nConnection, nSQLBotID, nSQLServer, nSQLDatabase, nSQLUser, nSQLPassword, nSQLPort ) { }
  330. virtual ~CMySQLCallableGameAdd( ) { }
  331. virtual void operator( )( );
  332. virtual void Init( ) { CMySQLCallable :: Init( ); }
  333. virtual void Close( ) { CMySQLCallable :: Close( ); }
  334. };
  335. class CMySQLCallableGamePlayerAdd : public CCallableGamePlayerAdd, public CMySQLCallable
  336. {
  337. public:
  338. CMySQLCallableGamePlayerAdd( uint32_t nGameID, string nName, string nIP, uint32_t nSpoofed, string nSpoofedRealm, uint32_t nReserved, uint32_t nLoadingTime, uint32_t nLeft, string nLeftReason, uint32_t nTeam, uint32_t nColour, void *nConnection, uint32_t nSQLBotID, string nSQLServer, string nSQLDatabase, string nSQLUser, string nSQLPassword, uint16_t nSQLPort ) : CBaseCallable( ), CCallableGamePlayerAdd( nGameID, nName, nIP, nSpoofed, nSpoofedRealm, nReserved, nLoadingTime, nLeft, nLeftReason, nTeam, nColour ), CMySQLCallable( nConnection, nSQLBotID, nSQLServer, nSQLDatabase, nSQLUser, nSQLPassword, nSQLPort ) { }
  339. virtual ~CMySQLCallableGamePlayerAdd( ) { }
  340. virtual void operator( )( );
  341. virtual void Init( ) { CMySQLCallable :: Init( ); }
  342. virtual void Close( ) { CMySQLCallable :: Close( ); }
  343. };
  344. class CMySQLCallableGamePlayerSummaryCheck : public CCallableGamePlayerSummaryCheck, public CMySQLCallable
  345. {
  346. public:
  347. CMySQLCallableGamePlayerSummaryCheck( string nName, void *nConnection, uint32_t nSQLBotID, string nSQLServer, string nSQLDatabase, string nSQLUser, string nSQLPassword, uint16_t nSQLPort ) : CBaseCallable( ), CCallableGamePlayerSummaryCheck( nName ), CMySQLCallable( nConnection, nSQLBotID, nSQLServer, nSQLDatabase, nSQLUser, nSQLPassword, nSQLPort ) { }
  348. virtual ~CMySQLCallableGamePlayerSummaryCheck( ) { }
  349. virtual void operator( )( );
  350. virtual void Init( ) { CMySQLCallable :: Init( ); }
  351. virtual void Close( ) { CMySQLCallable :: Close( ); }
  352. };
  353. class CMySQLCallableDotAGameAdd : public CCallableDotAGameAdd, public CMySQLCallable
  354. {
  355. public:
  356. CMySQLCallableDotAGameAdd( uint32_t nGameID, uint32_t nWinner, uint32_t nMin, uint32_t nSec, void *nConnection, uint32_t nSQLBotID, string nSQLServer, string nSQLDatabase, string nSQLUser, string nSQLPassword, uint16_t nSQLPort ) : CBaseCallable( ), CCallableDotAGameAdd( nGameID, nWinner, nMin, nSec ), CMySQLCallable( nConnection, nSQLBotID, nSQLServer, nSQLDatabase, nSQLUser, nSQLPassword, nSQLPort ) { }
  357. virtual ~CMySQLCallableDotAGameAdd( ) { }
  358. virtual void operator( )( );
  359. virtual void Init( ) { CMySQLCallable :: Init( ); }
  360. virtual void Close( ) { CMySQLCallable :: Close( ); }
  361. };
  362. class CMySQLCallableDotAPlayerAdd : public CCallableDotAPlayerAdd, public CMySQLCallable
  363. {
  364. public:
  365. CMySQLCallableDotAPlayerAdd( uint32_t nGameID, uint32_t nColour, uint32_t nKills, uint32_t nDeaths, uint32_t nCreepKills, uint32_t nCreepDenies, uint32_t nAssists, uint32_t nGold, uint32_t nNeutralKills, string nItem1, string nItem2, string nItem3, string nItem4, string nItem5, string nItem6, string nHero, uint32_t nNewColour, uint32_t nTowerKills, uint32_t nRaxKills, uint32_t nCourierKills, void *nConnection, uint32_t nSQLBotID, string nSQLServer, string nSQLDatabase, string nSQLUser, string nSQLPassword, uint16_t nSQLPort ) : CBaseCallable( ), CCallableDotAPlayerAdd( nGameID, nColour, nKills, nDeaths, nCreepKills, nCreepDenies, nAssists, nGold, nNeutralKills, nItem1, nItem2, nItem3, nItem4, nItem5, nItem6, nHero, nNewColour, nTowerKills, nRaxKills, nCourierKills ), CMySQLCallable( nConnection, nSQLBotID, nSQLServer, nSQLDatabase, nSQLUser, nSQLPassword, nSQLPort ) { }
  366. virtual ~CMySQLCallableDotAPlayerAdd( ) { }
  367. virtual void operator( )( );
  368. virtual void Init( ) { CMySQLCallable :: Init( ); }
  369. virtual void Close( ) { CMySQLCallable :: Close( ); }
  370. };
  371. class CMySQLCallableDotAPlayerSummaryCheck : public CCallableDotAPlayerSummaryCheck, public CMySQLCallable
  372. {
  373. public:
  374. CMySQLCallableDotAPlayerSummaryCheck( string nName, void *nConnection, uint32_t nSQLBotID, string nSQLServer, string nSQLDatabase, string nSQLUser, string nSQLPassword, uint16_t nSQLPort ) : CBaseCallable( ), CCallableDotAPlayerSummaryCheck( nName ), CMySQLCallable( nConnection, nSQLBotID, nSQLServer, nSQLDatabase, nSQLUser, nSQLPassword, nSQLPort ) { }
  375. virtual ~CMySQLCallableDotAPlayerSummaryCheck( ) { }
  376. virtual void operator( )( );
  377. virtual void Init( ) { CMySQLCallable :: Init( ); }
  378. virtual void Close( ) { CMySQLCallable :: Close( ); }
  379. };
  380. class CMySQLCallableDownloadAdd : public CCallableDownloadAdd, public CMySQLCallable
  381. {
  382. public:
  383. CMySQLCallableDownloadAdd( string nMap, uint32_t nMapSize, string nName, string nIP, uint32_t nSpoofed, string nSpoofedRealm, uint32_t nDownloadTime, void *nConnection, uint32_t nSQLBotID, string nSQLServer, string nSQLDatabase, string nSQLUser, string nSQLPassword, uint16_t nSQLPort ) : CBaseCallable( ), CCallableDownloadAdd( nMap, nMapSize, nName, nIP, nSpoofed, nSpoofedRealm, nDownloadTime ), CMySQLCallable( nConnection, nSQLBotID, nSQLServer, nSQLDatabase, nSQLUser, nSQLPassword, nSQLPort ) { }
  384. virtual ~CMySQLCallableDownloadAdd( ) { }
  385. virtual void operator( )( );
  386. virtual void Init( ) { CMySQLCallable :: Init( ); }
  387. virtual void Close( ) { CMySQLCallable :: Close( ); }
  388. };
  389. class CMySQLCallableScoreCheck : public CCallableScoreCheck, public CMySQLCallable
  390. {
  391. public:
  392. CMySQLCallableScoreCheck( string nCategory, string nName, string nServer, void *nConnection, uint32_t nSQLBotID, string nSQLServer, string nSQLDatabase, string nSQLUser, string nSQLPassword, uint16_t nSQLPort ) : CBaseCallable( ), CCallableScoreCheck( nCategory, nName, nServer ), CMySQLCallable( nConnection, nSQLBotID, nSQLServer, nSQLDatabase, nSQLUser, nSQLPassword, nSQLPort ) { }
  393. virtual ~CMySQLCallableScoreCheck( ) { }
  394. virtual void operator( )( );
  395. virtual void Init( ) { CMySQLCallable :: Init( ); }
  396. virtual void Close( ) { CMySQLCallable :: Close( ); }
  397. };
  398. class CMySQLCallableW3MMDPlayerAdd : public CCallableW3MMDPlayerAdd, public CMySQLCallable
  399. {
  400. public:
  401. CMySQLCallableW3MMDPlayerAdd( string nCategory, uint32_t nGameID, uint32_t nPID, string nName, string nFlag, uint32_t nLeaver, uint32_t nPracticing, void *nConnection, uint32_t nSQLBotID, string nSQLServer, string nSQLDatabase, string nSQLUser, string nSQLPassword, uint16_t nSQLPort ) : CBaseCallable( ), CCallableW3MMDPlayerAdd( nCategory, nGameID, nPID, nName, nFlag, nLeaver, nPracticing ), CMySQLCallable( nConnection, nSQLBotID, nSQLServer, nSQLDatabase, nSQLUser, nSQLPassword, nSQLPort ) { }
  402. virtual ~CMySQLCallableW3MMDPlayerAdd( ) { }
  403. virtual void operator( )( );
  404. virtual void Init( ) { CMySQLCallable :: Init( ); }
  405. virtual void Close( ) { CMySQLCallable :: Close( ); }
  406. };
  407. class CMySQLCallableW3MMDVarAdd : public CCallableW3MMDVarAdd, public CMySQLCallable
  408. {
  409. public:
  410. CMySQLCallableW3MMDVarAdd( uint32_t nGameID, map<VarP,int32_t> nVarInts, void *nConnection, uint32_t nSQLBotID, string nSQLServer, string nSQLDatabase, string nSQLUser, string nSQLPassword, uint16_t nSQLPort ) : CBaseCallable( ), CCallableW3MMDVarAdd( nGameID, nVarInts ), CMySQLCallable( nConnection, nSQLBotID, nSQLServer, nSQLDatabase, nSQLUser, nSQLPassword, nSQLPort ) { }
  411. CMySQLCallableW3MMDVarAdd( uint32_t nGameID, map<VarP,double> nVarReals, void *nConnection, uint32_t nSQLBotID, string nSQLServer, string nSQLDatabase, string nSQLUser, string nSQLPassword, uint16_t nSQLPort ) : CBaseCallable( ), CCallableW3MMDVarAdd( nGameID, nVarReals ), CMySQLCallable( nConnection, nSQLBotID, nSQLServer, nSQLDatabase, nSQLUser, nSQLPassword, nSQLPort ) { }
  412. CMySQLCallableW3MMDVarAdd( uint32_t nGameID, map<VarP,string> nVarStrings, void *nConnection, uint32_t nSQLBotID, string nSQLServer, string nSQLDatabase, string nSQLUser, string nSQLPassword, uint16_t nSQLPort ) : CBaseCallable( ), CCallableW3MMDVarAdd( nGameID, nVarStrings ), CMySQLCallable( nConnection, nSQLBotID, nSQLServer, nSQLDatabase, nSQLUser, nSQLPassword, nSQLPort ) { }
  413. virtual ~CMySQLCallableW3MMDVarAdd( ) { }
  414. virtual void operator( )( );
  415. virtual void Init( ) { CMySQLCallable :: Init( ); }
  416. virtual void Close( ) { CMySQLCallable :: Close( ); }
  417. };
  418. #endif
  419. #endif