From 80197ac21d486683f416679810094065a4ad62e4 Mon Sep 17 00:00:00 2001 From: Pelish Date: Sat, 31 Dec 2011 15:50:44 +0100 Subject: [PATCH 1/8] fix for LIST command when client could not show games of other clients when it wants, added small hack for showing Red Alert ladders --- pvpgn/src/bnetd/handle_wol.cpp | 36 ++++++++++++++++++++++------------ pvpgn/src/common/tag.cpp | 7 +++++++ pvpgn/src/common/tag.h | 2 ++ 3 files changed, 33 insertions(+), 12 deletions(-) diff --git a/pvpgn/src/bnetd/handle_wol.cpp b/pvpgn/src/bnetd/handle_wol.cpp index d138c7576..658fb7740 100644 --- a/pvpgn/src/bnetd/handle_wol.cpp +++ b/pvpgn/src/bnetd/handle_wol.cpp @@ -455,6 +455,7 @@ static int _handle_privmsg_command(t_connection * conn, int numparams, char ** p struct gamelist_data { unsigned tcount, counter; t_connection *conn; + t_clienttag clienttag; }; static int append_game_info(t_game* game, void* vdata) @@ -475,7 +476,7 @@ static int append_game_info(t_game* game, void* vdata) eventlog(eventlog_level_debug, __FUNCTION__, "[%d] not listing because game is not open", conn_get_socket(data->conn)); return 0; } - if (game_get_clienttag(game) != conn_get_clienttag(data->conn)) { + if (game_get_clienttag(game) != data->clienttag) { eventlog(eventlog_level_debug, __FUNCTION__, "[%d] not listing because game is for a different client", conn_get_socket(data->conn)); return 0; } @@ -514,6 +515,13 @@ static int append_game_info(t_game* game, void* vdata) /** * The layout of the game list entry is something like this: * #game_channel_name currentusers maxplayers gameType gameIsTournment gameExtension longIP LOCK::topic + * + * Known channel game types: + * 0 = Westwood Chat channels, 1 = Command & Conquer Win95 channels, 2 = Red Alert Win95 channels, + * 3 = Red Alert Counterstrike channels, 4 = Red Alert Aftermath channels, 5 = CnC Sole Survivor channels, + * 12 = C&C Renegade channels, 14 = Dune 2000 channels, 16 = Nox channels, 18 = Tiberian Sun channels, + * 21 = Red Alert 1 v 3.03 channels, 31 = Emperor: Battle for Dune, 33 = Red Alert 2, + * 37 = Nox Quest channels, 38,39,40 = Quickgame channels, 41 = Yuri's Revenge */ std::strcat(temp,gamename); @@ -562,12 +570,12 @@ static int _handle_list_command(t_connection * conn, int numparams, char ** para irc_send(conn,RPL_LISTSTART,"Channel :Users Names"); /* backward compatibility */ - if ((numparams == 0) || ((numparams == 2) && (params[0]) && (params[1]) && (std::strcmp(params[0], params[1]) != 0))) { + if ((numparams == 0) || ((numparams == 2) && (params[0]) && ((std::strcmp(params[0], "0") == 0) + || (std::strcmp(params[0], "-1") == 0)))) { /** * LIST all chat channels * Emperor sends as params[0] == -1 if want QuickMatch channels too, 0 if not. * This sends also NOX but we dunno why. - * DUNE 2000 use params[0] to determine channels by channeltype */ LIST_TRAVERSE_CONST(channellist(),curr) { @@ -601,21 +609,18 @@ static int _handle_list_command(t_connection * conn, int numparams, char ** para irc_send(conn,RPL_CHANNEL,temp); } } - /** - * Known channel game types: - * 0 = Westwood Chat channels, 1 = Command & Conquer Win95 channels, 2 = Red Alert Win95 channels, - * 3 = Red Alert Counterstrike channels, 4 = Red Alert Aftermath channels, 5 = CnC Sole Survivor channels, - * 12 = C&C Renegade channels, 14 = Dune 2000 channels, 16 = Nox channels, 18 = Tiberian Sun channels, - * 21 = Red Alert 1 v 3.03 channels, 31 = Emperor: Battle for Dune, 33 = Red Alert 2, - * 37 = Nox Quest channels, 38,39,40 = Quickgame channels, 41 = Yuri's Revenge - */ - if ((numparams == 0) || ((numparams == 2) && (params[0]) && (params[1]) && (std::strcmp(params[0], params[1]) == 0))) { + if ((numparams == 0) || ((numparams == 2) && (params[0]) && ((std::strcmp(params[0], "0") != 0) + && (std::strcmp(params[0], "-1") != 0)))) { eventlog(eventlog_level_debug,__FUNCTION__,"[** WOL **] LIST [Game]"); /* list games */ struct gamelist_data data; data.tcount = 0; data.counter = 0; data.conn = conn; + if ((numparams == 2) && (params[0])) + data.clienttag = tag_channeltype_to_uint(std::atoi(params[0])); + else + data.clienttag = conn_get_clienttag(conn); gamelist_traverse(&append_game_info, &data); DEBUG3("[%d] LIST sent %u of %u games", conn_get_socket(conn), data.counter, data.tcount); } @@ -1685,6 +1690,13 @@ static int _handle_listsearch_command(t_connection * conn, int numparams, char * if ((numparams>=1) && (params[0]) && (text)) { cl_tag = tag_sku_to_uint(std::atoi(params[0])); + + if (std::strcmp(params[0], "1005") == 0) + cl_tag = CLIENTTAG_REDALERT_UINT; + if (std::strcmp(params[0], "500") == 0) + cl_tag = CLIENTTAG_REDALAFM_UINT; + + DEBUG1("Client wants LISTSEARCH for %s client", clienttag_get_title(cl_tag)); e = irc_get_ladderelems(text); diff --git a/pvpgn/src/common/tag.cpp b/pvpgn/src/common/tag.cpp index e2b192613..ed7971426 100644 --- a/pvpgn/src/common/tag.cpp +++ b/pvpgn/src/common/tag.cpp @@ -85,6 +85,8 @@ extern char const * clienttag_uint_to_str(t_clienttag clienttag) return CLIENTTAG_TIBSUNXP; case CLIENTTAG_REDALERT_UINT: return CLIENTTAG_REDALERT; + case CLIENTTAG_REDALAFM_UINT: + return CLIENTTAG_REDALAFM; case CLIENTTAG_REDALERT2_UINT: return CLIENTTAG_REDALERT2; case CLIENTTAG_DUNE2000_UINT: @@ -218,6 +220,7 @@ extern int tag_check_client(t_tag tag_uint) case CLIENTTAG_TIBERNSUN_UINT: case CLIENTTAG_TIBSUNXP_UINT: case CLIENTTAG_REDALERT_UINT: + case CLIENTTAG_REDALAFM_UINT: case CLIENTTAG_REDALERT2_UINT: case CLIENTTAG_DUNE2000_UINT: case CLIENTTAG_NOX_UINT: @@ -272,6 +275,7 @@ extern int tag_check_wolv2(t_tag tag_uint) case CLIENTTAG_TIBERNSUN_UINT: case CLIENTTAG_TIBSUNXP_UINT: case CLIENTTAG_REDALERT_UINT: + case CLIENTTAG_REDALAFM_UINT: case CLIENTTAG_REDALERT2_UINT: case CLIENTTAG_DUNE2000_UINT: case CLIENTTAG_NOX_UINT: @@ -326,6 +330,8 @@ extern char const * clienttag_get_title(t_clienttag clienttag) return "Tiberian Sun: Firestorm"; case CLIENTTAG_REDALERT_UINT: return "Red Alert"; + case CLIENTTAG_REDALAFM_UINT: + return "Red Alert: Aftermath"; case CLIENTTAG_REDALERT2_UINT: return "Red Alert 2"; case CLIENTTAG_DUNE2000_UINT: @@ -405,6 +411,7 @@ extern t_clienttag tag_sku_to_uint(int sku) } switch (sku) { +/* case 500: Red Alert: Aftermath ladders */ case 1000: /* Westwood Chat */ return CLIENTTAG_WCHAT_UINT; /* case 1002: Internet Registration */ diff --git a/pvpgn/src/common/tag.h b/pvpgn/src/common/tag.h index 00fb0b673..c1149ed25 100644 --- a/pvpgn/src/common/tag.h +++ b/pvpgn/src/common/tag.h @@ -131,6 +131,8 @@ typedef enum { #define CLIENTTAG_TIBSUNXP_UINT 0x54535850 #define CLIENTTAG_REDALERT "RALT" /* Red Alert 1 */ #define CLIENTTAG_REDALERT_UINT 0x52414C54 +#define CLIENTTAG_REDALAFM "RAAM" /* Red Alert 1: Aftermath */ +#define CLIENTTAG_REDALAFM_UINT 0x5241414D #define CLIENTTAG_REDALERT2 "RAL2" /* Red Alert 2 */ #define CLIENTTAG_REDALERT2_UINT 0x52414C32 #define CLIENTTAG_DUNE2000 "DN2K" /* Dune 2000 */ From db97afd65313c4cdb5e6ccfe1d00cf297b1a9f78 Mon Sep 17 00:00:00 2001 From: Pelish Date: Sun, 1 Jan 2012 18:57:53 +0100 Subject: [PATCH 2/8] fixed JOINGAME acknowledgement when was used bad hardcoded parameter --- pvpgn/src/bnetd/handle_wol.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/pvpgn/src/bnetd/handle_wol.cpp b/pvpgn/src/bnetd/handle_wol.cpp index 658fb7740..c7665d93c 100644 --- a/pvpgn/src/bnetd/handle_wol.cpp +++ b/pvpgn/src/bnetd/handle_wol.cpp @@ -946,14 +946,14 @@ static int _handle_joingame_command(t_connection * conn, int numparams, char ** * hack in here, for Red Alert 1, it use's JOINGAME for some reason to join a lobby channel. * * Here is WOLv1 input expected: - * JOINGAME [#Game_channel_name] [MinPlayers] [MaxPlayers] [channelType] 1 1 [gameIsTournament] + * JOINGAME [#Game_channel_name] [MinPlayers] [MaxPlayers] [channelType] [currentPlayers] 1 [gameIsTournament] * Knowed channelTypes (0-chat, 1-cnc, 2-ra1, 3-racs, 4-raam, 5-solsurv... listed in tag.cpp) * * Here is WOLv2 input expected: - * JOINGAME [#Game_channel_name] [MinPlayers] [MaxPlayers] [channelType] unknown unknown [gameIsTournament] [gameExtension] [password_optional] + * JOINGAME [#Game_channel_name] [MinPlayers] [MaxPlayers] [channelType] [currentPlayers] unknown [gameIsTournament] [gameExtension] [password_optional] * * Heres the output expected: - * user!WWOL@hostname JOINGAME [MinPlayers] [MaxPlayers] [channelType] unknown clanID [longIP] [gameIsTournament] :[#Game_channel_name] + * user!WWOL@hostname JOINGAME [MinPlayers] [MaxPlayers] [channelType] [currentPlayers] [clanID] [longIP] [gameIsTournament] :[#Game_channel_name] */ if((numparams==2) || (numparams==3)) { char ** e; @@ -1036,8 +1036,8 @@ static int _handle_joingame_command(t_connection * conn, int numparams, char ** if (channel!=old_channel) { if (tag_check_wolv1(conn_get_clienttag(conn))) { /* WOLv1 JOINGAME message */ - std::sprintf(_temp,"%u %u %u 1 1 %u :%s", channel_get_min(channel), game_get_maxplayers(game), channel_wol_get_game_type(channel), - ((game_get_type(game) == game_type_ladder) ? 1 : 0), irc_convert_channel(channel,conn)); + std::sprintf(_temp,"%u %u %u %u 1 %u :%s", channel_get_min(channel), game_get_maxplayers(game), channel_wol_get_game_type(channel), + game_get_ref(game), ((game_get_type(game) == game_type_ladder) ? 1 : 0), irc_convert_channel(channel,conn)); } else { /* WOLv2 JOINGAME message with BATTLECLAN support */ @@ -1047,8 +1047,8 @@ static int _handle_joingame_command(t_connection * conn, int numparams, char ** if (clan) clanid = clan_get_clanid(clan); - std::sprintf(_temp,"%u %u %u 1 %u %u %u :%s", channel_get_min(channel), game_get_maxplayers(game), channel_wol_get_game_type(channel), - clanid, conn_get_addr(conn), ((game_get_type(game) == game_type_ladder) ? 1 : 0), irc_convert_channel(channel,conn)); + std::sprintf(_temp,"%u %u %u %u %u %u %u :%s", channel_get_min(channel), game_get_maxplayers(game), channel_wol_get_game_type(channel), + game_get_ref(game), clanid, conn_get_addr(conn), ((game_get_type(game) == game_type_ladder) ? 1 : 0), irc_convert_channel(channel,conn)); } channel_set_userflags(conn); From aba85456ac0f2445106c29af27341040fbbe8a09 Mon Sep 17 00:00:00 2001 From: Pelish Date: Mon, 2 Jan 2012 21:26:57 +0100 Subject: [PATCH 3/8] added Red Alert v3.03 ladders support, fixed uninitialized variable bug, added handling of some missing wol gameres tags --- pvpgn/src/bnetd/channel.cpp | 1 + pvpgn/src/bnetd/game.cpp | 2 +- pvpgn/src/bnetd/handle_wol_gameres.cpp | 231 +++++++++++++++++++++++- pvpgn/src/bnetd/ladder.cpp | 4 + pvpgn/src/common/wol_gameres_protocol.h | 19 ++ pvpgn/version-history.txt | 4 +- 6 files changed, 255 insertions(+), 6 deletions(-) diff --git a/pvpgn/src/bnetd/channel.cpp b/pvpgn/src/bnetd/channel.cpp index 4d0053fd1..27d2ff85d 100644 --- a/pvpgn/src/bnetd/channel.cpp +++ b/pvpgn/src/bnetd/channel.cpp @@ -224,6 +224,7 @@ extern t_channel * channel_create(char const * fullname, char const * shortname, channel->log = NULL; } + channel->minmembers = 0; channel->gameType = 0; channel->gameExtension = NULL; diff --git a/pvpgn/src/bnetd/game.cpp b/pvpgn/src/bnetd/game.cpp index 75b4ea597..eebdf3274 100644 --- a/pvpgn/src/bnetd/game.cpp +++ b/pvpgn/src/bnetd/game.cpp @@ -737,7 +737,7 @@ static int game_report(t_game * game) // war3 game reporting is done elsewhere, so we can skip this function return 0; - if ((game->clienttag == CLIENTTAG_WCHAT_UINT) || (game->clienttag == CLIENTTAG_REDALERT_UINT) + if ((game->clienttag == CLIENTTAG_WCHAT_UINT) || (game->clienttag == CLIENTTAG_DUNE2000_UINT) || (game->clienttag == CLIENTTAG_NOX_UINT) || (game->clienttag == CLIENTTAG_NOXQUEST_UINT) || (game->clienttag == CLIENTTAG_RENEGADE_UINT) || (game->clienttag == CLIENTTAG_RENGDFDS_UINT) || (game->clienttag == CLIENTTAG_EMPERORBD_UINT) diff --git a/pvpgn/src/bnetd/handle_wol_gameres.cpp b/pvpgn/src/bnetd/handle_wol_gameres.cpp index 203f1abb5..930d36035 100644 --- a/pvpgn/src/bnetd/handle_wol_gameres.cpp +++ b/pvpgn/src/bnetd/handle_wol_gameres.cpp @@ -45,6 +45,7 @@ namespace bnetd /* handlers prototypes */ static int _client_sern(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); +static int _client_sidn(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); static int _client_sdfx(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); static int _client_idno(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); static int _client_gsku(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); @@ -313,6 +314,25 @@ static int _client_blc5(t_wol_gameres_result * game_result, wol_gameres_type typ static int _client_blc6(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); static int _client_blc7(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); +static int _client_cra0(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); +static int _client_cra1(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); +static int _client_cra2(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); +static int _client_cra3(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); +static int _client_cra4(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); +static int _client_cra5(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); +static int _client_cra6(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); +static int _client_cra7(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); + +static int _client_hrv0(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); +static int _client_hrv1(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); +static int _client_hrv2(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); +static int _client_hrv3(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); +static int _client_hrv4(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); +static int _client_hrv5(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); +static int _client_hrv6(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); +static int _client_hrv7(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); + + typedef int (* t_wol_gamerestag)(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); typedef struct { @@ -323,6 +343,7 @@ typedef struct { /* handler table */ static const t_wol_gamerestag_table_row wol_gamreres_htable[] = { {CLIENT_SERN_UINT, _client_sern}, + {CLIENT_SIDN_UINT, _client_sidn}, {CLIENT_SDFX_UINT, _client_sdfx}, {CLIENT_IDNO_UINT, _client_idno}, {CLIENT_GSKU_UINT, _client_gsku}, @@ -591,6 +612,24 @@ static const t_wol_gamerestag_table_row wol_gamreres_htable[] = { {CLIENT_BLC6_UINT, _client_blc6}, {CLIENT_BLC7_UINT, _client_blc7}, + {CLIENT_CRA0_UINT, _client_cra0}, + {CLIENT_CRA1_UINT, _client_cra1}, + {CLIENT_CRA2_UINT, _client_cra2}, + {CLIENT_CRA3_UINT, _client_cra3}, + {CLIENT_CRA4_UINT, _client_cra4}, + {CLIENT_CRA5_UINT, _client_cra5}, + {CLIENT_CRA6_UINT, _client_cra6}, + {CLIENT_CRA7_UINT, _client_cra7}, + + {CLIENT_HRV0_UINT, _client_hrv0}, + {CLIENT_HRV1_UINT, _client_hrv1}, + {CLIENT_HRV2_UINT, _client_hrv2}, + {CLIENT_HRV3_UINT, _client_hrv3}, + {CLIENT_HRV4_UINT, _client_hrv4}, + {CLIENT_HRV5_UINT, _client_hrv5}, + {CLIENT_HRV6_UINT, _client_hrv6}, + {CLIENT_HRV7_UINT, _client_hrv7}, + {1, NULL} }; @@ -802,6 +841,27 @@ static int _client_sern(t_wol_gameres_result * game_result, wol_gameres_type typ return 0; } +static int _client_sidn(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) +{ + /* SID# */ + + switch (type) { + case wol_gameres_type_string: + DEBUG1("Sender id NO is: %s", (char *) data); + break; + default: + WARN1("got unknown gameres type %u for SIDN", type); + break; + } + +//In WOLv1 clients we just got this TAG from Game host - so sender ID1 + + DEBUG1("Setting sender ID to %u", 1); + game_result->senderid = 1; + + return 0; +} + static int _client_sdfx(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) { int sdfx; @@ -1177,17 +1237,70 @@ static int _client_scen(t_wol_gameres_result * game_result, wol_gameres_type typ static int _client_cmpl(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) { - int cmpl; + t_game * game = game_result->game; + t_game_result result; + t_game_result * results = game_result->results; + int resultnum; switch (type) { case wol_gameres_type_byte: - cmpl = (unsigned int) bn_byte_get(*((bn_byte *)data)); - DEBUG1("CMPL is: %u", cmpl); + resultnum = (unsigned int) bn_byte_get(*((bn_byte *)data)); break; default: WARN1("got unknown gameres type %u for CMPL", type); break; } + + switch (resultnum) { + case 0: + DEBUG0("Game NOT started"); + result = game_result_disconnect; + break; + case 1: + DEBUG0("Player 1 - WIN"); + result = game_result_win; + break; + case 4: + DEBUG0("Player 1 - LOSS"); + result = game_result_loss; + break; + default: + DEBUG1("Got wrong resultnum %u", resultnum); + result = game_result_disconnect; + break; + } + + if (!game) { + ERROR0 ("got corrupt gameres packet - game == NULL"); + return 0; + } + + if (results) { + results[0] = result; + + switch (result) { + case game_result_disconnect: + DEBUG0("Game NOT started"); + results[1] = game_result_disconnect; + break; + case game_result_loss: + DEBUG0("Player 2 - WIN"); + results[1] = game_result_win; + break; + case game_result_win: + DEBUG0("Player 2 - LOSS"); + results[1] = game_result_loss; + break; + } + + game_result->results = results; + DEBUG0("game result was set"); + } + + if (game_result->senderid == -1) { + game_result->senderid = 2; + DEBUG0("Have not got SIDN tag - setting senderid to 2"); + } return 0; } @@ -1288,6 +1401,7 @@ static int _client_afps(t_wol_gameres_result * game_result, wol_gameres_type typ switch (type) { case wol_gameres_type_int: + case wol_gameres_type_time: afps = (unsigned int) bn_int_nget(*((bn_int *)data)); DEBUG1("Average Frames per Second %u ", afps); break; @@ -1369,6 +1483,9 @@ static int _client_date(t_wol_gameres_result * game_result, wol_gameres_type typ case wol_gameres_type_string: DEBUG1("Date %s", (char *) data); break; + case wol_gameres_type_bigint: + DEBUG1("Date %u", wol_gameres_get_long_from_data(size, data)); + break; default: WARN1("got unknown gameres type %u for DATE", type); break; @@ -2286,6 +2403,9 @@ static int _cl_sid_general(t_wol_gameres_result * game_result, int num, wol_game sideid = (unsigned int) bn_int_nget(*((bn_int *)data)); DEBUG2("Side ID of player%u: %u", num, sideid); break; + case wol_gameres_type_string: + DEBUG2("Side name of player%u: %s", num, data); + break; default: WARN2("got unknown gameres type %u for SID%u", type, num); break; @@ -3334,6 +3454,111 @@ static int _client_blc7(t_wol_gameres_result * game_result, wol_gameres_type typ return _cl_blc_general(7, type, size, data); } +static int _cl_cra_general(int num, wol_gameres_type type, int size, void const * data) +{ + switch (type) { + case wol_gameres_type_bigint: + DEBUG2("Player %u obtain %u creates", num, wol_gameres_get_long_from_data(size, data)); + break; + default: + WARN2("got unknown gameres type %u for CRA%u", type, num); + break; + } + return 0; +} + +static int _client_cra0(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) +{ + return _cl_cra_general(0, type, size, data); +} + +static int _client_cra1(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) +{ + return _cl_cra_general(1, type, size, data); +} + +static int _client_cra2(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) +{ + return _cl_cra_general(2, type, size, data); +} + +static int _client_cra3(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) +{ + return _cl_cra_general(3, type, size, data); +} + +static int _client_cra4(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) +{ + return _cl_cra_general(4, type, size, data); +} + +static int _client_cra5(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) +{ + return _cl_cra_general(5, type, size, data); +} + +static int _client_cra6(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) +{ + return _cl_cra_general(6, type, size, data); +} + +static int _client_cra7(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) +{ + return _cl_cra_general(7, type, size, data); +} + +static int _cl_hrv_general(int num, wol_gameres_type type, int size, void const * data) +{ + switch (type) { + case wol_gameres_type_int: + DEBUG2("Player %u harvested %u credits", num, (unsigned int) bn_int_nget(*((bn_int *)data))); + break; + default: + WARN2("got unknown gameres type %u for HRV%u", type, num); + break; + } + return 0; +} + +static int _client_hrv0(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) +{ + return _cl_hrv_general(0, type, size, data); +} + +static int _client_hrv1(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) +{ + return _cl_hrv_general(1, type, size, data); +} + +static int _client_hrv2(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) +{ + return _cl_hrv_general(2, type, size, data); +} + +static int _client_hrv3(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) +{ + return _cl_hrv_general(3, type, size, data); +} + +static int _client_hrv4(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) +{ + return _cl_hrv_general(4, type, size, data); +} + +static int _client_hrv5(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) +{ + return _cl_hrv_general(5, type, size, data); +} + +static int _client_hrv6(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) +{ + return _cl_hrv_general(6, type, size, data); +} + +static int _client_hrv7(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) +{ + return _cl_hrv_general(7, type, size, data); +} } diff --git a/pvpgn/src/bnetd/ladder.cpp b/pvpgn/src/bnetd/ladder.cpp index 03dbb6cfb..dfb8652e4 100644 --- a/pvpgn/src/bnetd/ladder.cpp +++ b/pvpgn/src/bnetd/ladder.cpp @@ -1429,6 +1429,10 @@ Ladders::Ladders() //YURI ladders LadderKey YURI_solo(ladder_id_solo, CLIENTTAG_YURISREV_UINT, ladder_sort_default, ladder_time_default); ladderMap.insert(std::make_pair(YURI_solo,LadderList(YURI_solo, referenceTypeAccount))); + + //RALT ladders + LadderKey RALT_solo(ladder_id_solo, CLIENTTAG_REDALERT_UINT, ladder_sort_default, ladder_time_default); + ladderMap.insert(std::make_pair(RALT_solo,LadderList(RALT_solo, referenceTypeAccount))); } diff --git a/pvpgn/src/common/wol_gameres_protocol.h b/pvpgn/src/common/wol_gameres_protocol.h index d7af78612..c2d77a1c6 100644 --- a/pvpgn/src/common/wol_gameres_protocol.h +++ b/pvpgn/src/common/wol_gameres_protocol.h @@ -71,6 +71,7 @@ const int DATA_TYPE_BIGINT = 20; /* Game resolution tags */ const t_tag CLIENT_SERN_UINT = 0x53455223; +const t_tag CLIENT_SIDN_UINT = 0x53494423; const t_tag CLIENT_SDFX_UINT = 0x53444658; const t_tag CLIENT_IDNO_UINT = 0x49444E4F; const t_tag CLIENT_GSKU_UINT = 0x47534B55; @@ -339,6 +340,24 @@ const t_tag CLIENT_BLC5_UINT = 0x424c4335; const t_tag CLIENT_BLC6_UINT = 0x424c4336; const t_tag CLIENT_BLC7_UINT = 0x424c4337; +const t_tag CLIENT_CRA0_UINT = 0x43524130; +const t_tag CLIENT_CRA1_UINT = 0x43524131; +const t_tag CLIENT_CRA2_UINT = 0x43524132; +const t_tag CLIENT_CRA3_UINT = 0x43524133; +const t_tag CLIENT_CRA4_UINT = 0x43524134; +const t_tag CLIENT_CRA5_UINT = 0x43524135; +const t_tag CLIENT_CRA6_UINT = 0x43524136; +const t_tag CLIENT_CRA7_UINT = 0x43524137; + +const t_tag CLIENT_HRV0_UINT = 0x48525630; +const t_tag CLIENT_HRV1_UINT = 0x48525631; +const t_tag CLIENT_HRV2_UINT = 0x48525632; +const t_tag CLIENT_HRV3_UINT = 0x48525633; +const t_tag CLIENT_HRV4_UINT = 0x48525634; +const t_tag CLIENT_HRV5_UINT = 0x48525635; +const t_tag CLIENT_HRV6_UINT = 0x48525636; +const t_tag CLIENT_HRV7_UINT = 0x48525637; + } #endif /* INCLUDED_WOL_GAMERES_PROTOCOL_TYPES */ diff --git a/pvpgn/version-history.txt b/pvpgn/version-history.txt index c70b1b47c..664668eaa 100644 --- a/pvpgn/version-history.txt +++ b/pvpgn/version-history.txt @@ -20,8 +20,8 @@ PvPGN Version History: -- fixed voice flag not shown for clients in channel -- fixed bug in RedAlert2/Yuri when game owner changes maximum players -- added QuickMatch support for RA2/YURI - -- added Ladders support for Tiberian Sun, Firestorm, Red Alert 2 - and Yuri's Revenge clients + -- added Ladders support for Red Alert v3.03, Tiberian Sun, Firestorm, + Red Alert 2 and Yuri's Revenge clients [WAR3] -- added support for SRP3 based account creation/login From 3ec390e887ce501442c7629ea18847b86f24a879 Mon Sep 17 00:00:00 2001 From: Pelish Date: Tue, 3 Jan 2012 21:56:24 +0100 Subject: [PATCH 4/8] add possibility to draw game for WOL ladders --- pvpgn/src/bnetd/handle_wol_gameres.cpp | 8 ++++++++ pvpgn/src/bnetd/ladder.cpp | 5 +++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/pvpgn/src/bnetd/handle_wol_gameres.cpp b/pvpgn/src/bnetd/handle_wol_gameres.cpp index 930d36035..6e5eae442 100644 --- a/pvpgn/src/bnetd/handle_wol_gameres.cpp +++ b/pvpgn/src/bnetd/handle_wol_gameres.cpp @@ -1264,6 +1264,10 @@ static int _client_cmpl(t_wol_gameres_result * game_result, wol_gameres_type typ DEBUG0("Player 1 - LOSS"); result = game_result_loss; break; + case 64: + DEBUG0("Player 1 - DRAW"); + result = game_result_draw; + break; default: DEBUG1("Got wrong resultnum %u", resultnum); result = game_result_disconnect; @@ -1291,6 +1295,10 @@ static int _client_cmpl(t_wol_gameres_result * game_result, wol_gameres_type typ DEBUG0("Player 2 - LOSS"); results[1] = game_result_loss; break; + case game_result_draw: + DEBUG0("Player 2 - DRAW"); + results[1] = game_result_draw; + break; } game_result->results = results; diff --git a/pvpgn/src/bnetd/ladder.cpp b/pvpgn/src/bnetd/ladder.cpp index dfb8652e4..ef0cf5e2d 100644 --- a/pvpgn/src/bnetd/ladder.cpp +++ b/pvpgn/src/bnetd/ladder.cpp @@ -258,8 +258,9 @@ extern int ladder_update_wol(t_clienttag clienttag, t_ladder_id id, t_account * return -1; } - if (((results[0]) && (results[1])) && ((results[0] == results[1]) && (results[0] = game_result_disconnect))) { - DEBUG0("Both players got game_result_disconnect - points counting terminated"); + if (((results[0]) && (results[1])) && ((results[0] == results[1]) && + ((results[0] = game_result_disconnect) || (results[0] = game_result_draw)))) { + DEBUG0("Both players got game_result_disconnect or draw - points counting terminated"); return 0; } From 808070bcb1256d1f9819e4d179fcb279cfedb5a5 Mon Sep 17 00:00:00 2001 From: Pelish Date: Sat, 7 Jan 2012 20:07:14 +0100 Subject: [PATCH 5/8] fix for WOL bug when points was counted when game not started or was draw --- pvpgn/src/bnetd/ladder.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pvpgn/src/bnetd/ladder.cpp b/pvpgn/src/bnetd/ladder.cpp index ef0cf5e2d..1b34c88a7 100644 --- a/pvpgn/src/bnetd/ladder.cpp +++ b/pvpgn/src/bnetd/ladder.cpp @@ -259,7 +259,7 @@ extern int ladder_update_wol(t_clienttag clienttag, t_ladder_id id, t_account * } if (((results[0]) && (results[1])) && ((results[0] == results[1]) && - ((results[0] = game_result_disconnect) || (results[0] = game_result_draw)))) { + ((results[0] == game_result_disconnect) || (results[0] == game_result_draw)))) { DEBUG0("Both players got game_result_disconnect or draw - points counting terminated"); return 0; } From 2b2616a26ef64ac8c3941c747945bd986433cbf9 Mon Sep 17 00:00:00 2001 From: Pelish Date: Sat, 7 Jan 2012 20:09:02 +0100 Subject: [PATCH 6/8] using templates instead of mane same functions (thanks goes to d1zzy for giving me that solution) --- pvpgn/src/bnetd/handle_wol.cpp | 4 +- pvpgn/src/bnetd/handle_wol_gameres.cpp | 1756 +++++------------------- 2 files changed, 381 insertions(+), 1379 deletions(-) diff --git a/pvpgn/src/bnetd/handle_wol.cpp b/pvpgn/src/bnetd/handle_wol.cpp index c7665d93c..7ab1b6a01 100644 --- a/pvpgn/src/bnetd/handle_wol.cpp +++ b/pvpgn/src/bnetd/handle_wol.cpp @@ -1149,8 +1149,8 @@ static int _handle_gameopt_command(t_connection * conn, int numparams, char ** p char temp[MAX_IRC_MESSAGE_LEN]; /** - * Basically this has 2 modes as like in PRIVMSG - whisper and talk. What is in - * text is pretty much unknown, we just dump this to the client to deal with... + * Basically this has 2 modes as like in PRIVMSG - whisper and talk. What is in + * text is pretty much unknown, we just dump this to the client to deal with... * * Heres the output expected (when gameopt is channel talk): * user!WWOL@hostname GAMEOPT #game_channel_name :gameOptions diff --git a/pvpgn/src/bnetd/handle_wol_gameres.cpp b/pvpgn/src/bnetd/handle_wol_gameres.cpp index 6e5eae442..bca360ffb 100644 --- a/pvpgn/src/bnetd/handle_wol_gameres.cpp +++ b/pvpgn/src/bnetd/handle_wol_gameres.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008,2009 Pelish (pelish@gmail.com) + * Copyright (C) 2008,2009,2012 Pelish (pelish@gmail.com) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -125,213 +125,143 @@ static int _client_crtr(t_wol_gameres_result * game_result, wol_gameres_type typ static int _client_flgc(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); /* Player related functions */ -static int _client_nam0(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_nam1(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_nam2(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_nam3(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_nam4(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_nam5(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_nam6(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_nam7(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); - -static int _client_ipa0(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_ipa1(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_ipa2(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_ipa3(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_ipa4(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_ipa5(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_ipa6(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_ipa7(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); - -static int _client_cid0(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_cid1(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_cid2(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_cid3(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_cid4(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_cid5(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_cid6(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_cid7(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); - -static int _client_sid0(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_sid1(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_sid2(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_sid3(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_sid4(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_sid5(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_sid6(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_sid7(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); - -static int _client_tid0(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_tid1(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_tid2(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_tid3(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_tid4(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_tid5(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_tid6(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_tid7(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); - -static int _client_cmp0(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_cmp1(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_cmp2(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_cmp3(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_cmp4(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_cmp5(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_cmp6(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_cmp7(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); - -static int _client_col0(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_col1(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_col2(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_col3(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_col4(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_col5(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_col6(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_col7(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); - -static int _client_crd0(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_crd1(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_crd2(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_crd3(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_crd4(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_crd5(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_crd6(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_crd7(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); - -static int _client_inb0(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_inb1(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_inb2(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_inb3(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_inb4(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_inb5(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_inb6(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_inb7(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); - -static int _client_unb0(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_unb1(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_unb2(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_unb3(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_unb4(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_unb5(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_unb6(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_unb7(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); - -static int _client_plb0(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_plb1(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_plb2(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_plb3(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_plb4(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_plb5(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_plb6(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_plb7(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); - -static int _client_blb0(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_blb1(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_blb2(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_blb3(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_blb4(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_blb5(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_blb6(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_blb7(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); - -static int _client_inl0(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_inl1(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_inl2(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_inl3(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_inl4(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_inl5(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_inl6(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_inl7(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); - -static int _client_unl0(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_unl1(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_unl2(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_unl3(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_unl4(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_unl5(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_unl6(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_unl7(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); - -static int _client_pll0(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_pll1(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_pll2(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_pll3(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_pll4(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_pll5(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_pll6(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_pll7(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); - -static int _client_bll0(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_bll1(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_bll2(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_bll3(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_bll4(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_bll5(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_bll6(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_bll7(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); - -static int _client_ink0(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_ink1(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_ink2(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_ink3(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_ink4(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_ink5(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_ink6(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_ink7(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); - -static int _client_unk0(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_unk1(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_unk2(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_unk3(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_unk4(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_unk5(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_unk6(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_unk7(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); - -static int _client_plk0(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_plk1(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_plk2(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_plk3(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_plk4(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_plk5(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_plk6(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_plk7(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); - -static int _client_blk0(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_blk1(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_blk2(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_blk3(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_blk4(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_blk5(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_blk6(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_blk7(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); - -static int _client_blc0(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_blc1(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_blc2(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_blc3(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_blc4(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_blc5(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_blc6(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_blc7(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); - -static int _client_cra0(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_cra1(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_cra2(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_cra3(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_cra4(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_cra5(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_cra6(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_cra7(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); - -static int _client_hrv0(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_hrv1(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_hrv2(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_hrv3(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_hrv4(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_hrv5(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_hrv6(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); -static int _client_hrv7(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); +static int _cl_nam_general(int num, t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); +template +static int _client_nam_generic(t_wol_gameres_result* game_result, wol_gameres_type type, int size, void const* data) { +return _cl_nam_general(N, game_result, type, size, data); +} + +static int _cl_ipa_general(int num, t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); +template +static int _client_ipa_generic(t_wol_gameres_result* game_result, wol_gameres_type type, int size, void const* data) { +return _cl_ipa_general(N, game_result, type, size, data); +} + +static int _cl_cid_general(int num, t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); +template +static int _client_cid_generic(t_wol_gameres_result* game_result, wol_gameres_type type, int size, void const* data) { +return _cl_cid_general(N, game_result, type, size, data); +} + +static int _cl_sid_general(int num, t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); +template +static int _client_sid_generic(t_wol_gameres_result* game_result, wol_gameres_type type, int size, void const* data) { +return _cl_sid_general(N, game_result, type, size, data); +} + +static int _cl_tid_general(int num, t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); +template +static int _client_tid_generic(t_wol_gameres_result* game_result, wol_gameres_type type, int size, void const* data) { +return _cl_tid_general(N, game_result, type, size, data); +} + +static int _cl_cmp_general(int num, t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); +template +static int _client_cmp_generic(t_wol_gameres_result* game_result, wol_gameres_type type, int size, void const* data) { +return _cl_cmp_general(N, game_result, type, size, data); +} + +static int _cl_col_general(int num, t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); +template +static int _client_col_generic(t_wol_gameres_result* game_result, wol_gameres_type type, int size, void const* data) { +return _cl_col_general(N, game_result, type, size, data); +} + +static int _cl_crd_general(int num, t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); +template +static int _client_crd_generic(t_wol_gameres_result* game_result, wol_gameres_type type, int size, void const* data) { +return _cl_crd_general(N, game_result, type, size, data); +} + +static int _cl_inb_general(int num, t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); +template +static int _client_inb_generic(t_wol_gameres_result* game_result, wol_gameres_type type, int size, void const* data) { +return _cl_inb_general(N, game_result, type, size, data); +} + +static int _cl_unb_general(int num, t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); +template +static int _client_unb_generic(t_wol_gameres_result* game_result, wol_gameres_type type, int size, void const* data) { +return _cl_unb_general(N, game_result, type, size, data); +} + +static int _cl_plb_general(int num, t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); +template +static int _client_plb_generic(t_wol_gameres_result* game_result, wol_gameres_type type, int size, void const* data) { +return _cl_plb_general(N, game_result, type, size, data); +} + +static int _cl_blb_general(int num, t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); +template +static int _client_blb_generic(t_wol_gameres_result* game_result, wol_gameres_type type, int size, void const* data) { +return _cl_blb_general(N, game_result, type, size, data); +} + +static int _cl_inl_general(int num, t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); +template +static int _client_inl_generic(t_wol_gameres_result* game_result, wol_gameres_type type, int size, void const* data) { +return _cl_inl_general(N, game_result, type, size, data); +} + +static int _cl_unl_general(int num, t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); +template +static int _client_unl_generic(t_wol_gameres_result* game_result, wol_gameres_type type, int size, void const* data) { +return _cl_unl_general(N, game_result, type, size, data); +} + +static int _cl_pll_general(int num, t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); +template +static int _client_pll_generic(t_wol_gameres_result* game_result, wol_gameres_type type, int size, void const* data) { +return _cl_pll_general(N, game_result, type, size, data); +} + +static int _cl_bll_general(int num, t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); +template +static int _client_bll_generic(t_wol_gameres_result* game_result, wol_gameres_type type, int size, void const* data) { +return _cl_bll_general(N, game_result, type, size, data); +} + +static int _cl_ink_general(int num, t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); +template +static int _client_ink_generic(t_wol_gameres_result* game_result, wol_gameres_type type, int size, void const* data) { +return _cl_ink_general(N, game_result, type, size, data); +} + +static int _cl_unk_general(int num, t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); +template +static int _client_unk_generic(t_wol_gameres_result* game_result, wol_gameres_type type, int size, void const* data) { +return _cl_unk_general(N, game_result, type, size, data); +} + +static int _cl_plk_general(int num, t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); +template +static int _client_plk_generic(t_wol_gameres_result* game_result, wol_gameres_type type, int size, void const* data) { +return _cl_plk_general(N, game_result, type, size, data); +} + +static int _cl_blk_general(int num, t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); +template +static int _client_blk_generic(t_wol_gameres_result* game_result, wol_gameres_type type, int size, void const* data) { +return _cl_blk_general(N, game_result, type, size, data); +} + +static int _cl_blc_general(int num, t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); +template +static int _client_blc_generic(t_wol_gameres_result* game_result, wol_gameres_type type, int size, void const* data) { +return _cl_blc_general(N, game_result, type, size, data); +} + +static int _cl_cra_general(int num, t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); +template +static int _client_cra_generic(t_wol_gameres_result* game_result, wol_gameres_type type, int size, void const* data) { +return _cl_cra_general(N, game_result, type, size, data); +} +static int _cl_hrv_general(int num, t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); +template +static int _client_hrv_generic(t_wol_gameres_result* game_result, wol_gameres_type type, int size, void const* data) { +return _cl_hrv_general(N, game_result, type, size, data); +} typedef int (* t_wol_gamerestag)(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); @@ -423,212 +353,212 @@ static const t_wol_gamerestag_table_row wol_gamreres_htable[] = { {CLIENT_FLGC_UINT, _client_flgc}, /* Player related tags */ - {CLIENT_NAM0_UINT, _client_nam0}, - {CLIENT_NAM1_UINT, _client_nam1}, - {CLIENT_NAM2_UINT, _client_nam2}, - {CLIENT_NAM3_UINT, _client_nam3}, - {CLIENT_NAM4_UINT, _client_nam4}, - {CLIENT_NAM5_UINT, _client_nam5}, - {CLIENT_NAM6_UINT, _client_nam6}, - {CLIENT_NAM7_UINT, _client_nam7}, - - {CLIENT_IPA0_UINT, _client_ipa0}, - {CLIENT_IPA1_UINT, _client_ipa1}, - {CLIENT_IPA2_UINT, _client_ipa2}, - {CLIENT_IPA3_UINT, _client_ipa3}, - {CLIENT_IPA4_UINT, _client_ipa4}, - {CLIENT_IPA5_UINT, _client_ipa5}, - {CLIENT_IPA6_UINT, _client_ipa6}, - {CLIENT_IPA7_UINT, _client_ipa7}, - - {CLIENT_CID0_UINT, _client_cid0}, - {CLIENT_CID1_UINT, _client_cid1}, - {CLIENT_CID2_UINT, _client_cid2}, - {CLIENT_CID3_UINT, _client_cid3}, - {CLIENT_CID4_UINT, _client_cid4}, - {CLIENT_CID5_UINT, _client_cid5}, - {CLIENT_CID6_UINT, _client_cid6}, - {CLIENT_CID7_UINT, _client_cid7}, - - {CLIENT_SID0_UINT, _client_sid0}, - {CLIENT_SID1_UINT, _client_sid1}, - {CLIENT_SID2_UINT, _client_sid2}, - {CLIENT_SID3_UINT, _client_sid3}, - {CLIENT_SID4_UINT, _client_sid4}, - {CLIENT_SID5_UINT, _client_sid5}, - {CLIENT_SID6_UINT, _client_sid6}, - {CLIENT_SID7_UINT, _client_sid7}, - - {CLIENT_TID0_UINT, _client_tid0}, - {CLIENT_TID1_UINT, _client_tid1}, - {CLIENT_TID2_UINT, _client_tid2}, - {CLIENT_TID3_UINT, _client_tid3}, - {CLIENT_TID4_UINT, _client_tid4}, - {CLIENT_TID5_UINT, _client_tid5}, - {CLIENT_TID6_UINT, _client_tid6}, - {CLIENT_TID7_UINT, _client_tid7}, - - {CLIENT_CMP0_UINT, _client_cmp0}, - {CLIENT_CMP1_UINT, _client_cmp1}, - {CLIENT_CMP2_UINT, _client_cmp2}, - {CLIENT_CMP3_UINT, _client_cmp3}, - {CLIENT_CMP4_UINT, _client_cmp4}, - {CLIENT_CMP5_UINT, _client_cmp5}, - {CLIENT_CMP6_UINT, _client_cmp6}, - {CLIENT_CMP7_UINT, _client_cmp7}, + {CLIENT_NAM0_UINT, &_client_nam_generic<0>}, + {CLIENT_NAM1_UINT, &_client_nam_generic<1>}, + {CLIENT_NAM2_UINT, &_client_nam_generic<2>}, + {CLIENT_NAM3_UINT, &_client_nam_generic<3>}, + {CLIENT_NAM4_UINT, &_client_nam_generic<4>}, + {CLIENT_NAM5_UINT, &_client_nam_generic<5>}, + {CLIENT_NAM6_UINT, &_client_nam_generic<6>}, + {CLIENT_NAM7_UINT, &_client_nam_generic<7>}, + + {CLIENT_IPA0_UINT, &_client_ipa_generic<0>}, + {CLIENT_IPA1_UINT, &_client_ipa_generic<1>}, + {CLIENT_IPA2_UINT, &_client_ipa_generic<2>}, + {CLIENT_IPA3_UINT, &_client_ipa_generic<3>}, + {CLIENT_IPA4_UINT, &_client_ipa_generic<4>}, + {CLIENT_IPA5_UINT, &_client_ipa_generic<5>}, + {CLIENT_IPA6_UINT, &_client_ipa_generic<6>}, + {CLIENT_IPA7_UINT, &_client_ipa_generic<7>}, + + {CLIENT_CID0_UINT, &_client_cid_generic<0>}, + {CLIENT_CID1_UINT, &_client_cid_generic<1>}, + {CLIENT_CID2_UINT, &_client_cid_generic<2>}, + {CLIENT_CID3_UINT, &_client_cid_generic<3>}, + {CLIENT_CID4_UINT, &_client_cid_generic<4>}, + {CLIENT_CID5_UINT, &_client_cid_generic<5>}, + {CLIENT_CID6_UINT, &_client_cid_generic<6>}, + {CLIENT_CID7_UINT, &_client_cid_generic<7>}, + + {CLIENT_SID0_UINT, &_client_sid_generic<0>}, + {CLIENT_SID1_UINT, &_client_sid_generic<1>}, + {CLIENT_SID2_UINT, &_client_sid_generic<2>}, + {CLIENT_SID3_UINT, &_client_sid_generic<3>}, + {CLIENT_SID4_UINT, &_client_sid_generic<4>}, + {CLIENT_SID5_UINT, &_client_sid_generic<5>}, + {CLIENT_SID6_UINT, &_client_sid_generic<6>}, + {CLIENT_SID7_UINT, &_client_sid_generic<7>}, + + {CLIENT_TID0_UINT, &_client_tid_generic<0>}, + {CLIENT_TID1_UINT, &_client_tid_generic<1>}, + {CLIENT_TID2_UINT, &_client_tid_generic<2>}, + {CLIENT_TID3_UINT, &_client_tid_generic<3>}, + {CLIENT_TID4_UINT, &_client_tid_generic<4>}, + {CLIENT_TID5_UINT, &_client_tid_generic<5>}, + {CLIENT_TID6_UINT, &_client_tid_generic<6>}, + {CLIENT_TID7_UINT, &_client_tid_generic<7>}, + + {CLIENT_CMP0_UINT, &_client_cmp_generic<0>}, + {CLIENT_CMP1_UINT, &_client_cmp_generic<1>}, + {CLIENT_CMP2_UINT, &_client_cmp_generic<2>}, + {CLIENT_CMP3_UINT, &_client_cmp_generic<3>}, + {CLIENT_CMP4_UINT, &_client_cmp_generic<4>}, + {CLIENT_CMP5_UINT, &_client_cmp_generic<5>}, + {CLIENT_CMP6_UINT, &_client_cmp_generic<6>}, + {CLIENT_CMP7_UINT, &_client_cmp_generic<7>}, - {CLIENT_COL0_UINT, _client_col0}, - {CLIENT_COL1_UINT, _client_col1}, - {CLIENT_COL2_UINT, _client_col2}, - {CLIENT_COL3_UINT, _client_col3}, - {CLIENT_COL4_UINT, _client_col4}, - {CLIENT_COL5_UINT, _client_col5}, - {CLIENT_COL6_UINT, _client_col6}, - {CLIENT_COL7_UINT, _client_col7}, - - {CLIENT_CRD0_UINT, _client_crd0}, - {CLIENT_CRD1_UINT, _client_crd1}, - {CLIENT_CRD2_UINT, _client_crd2}, - {CLIENT_CRD3_UINT, _client_crd3}, - {CLIENT_CRD4_UINT, _client_crd4}, - {CLIENT_CRD5_UINT, _client_crd5}, - {CLIENT_CRD6_UINT, _client_crd6}, - {CLIENT_CRD7_UINT, _client_crd7}, - - {CLIENT_INB0_UINT, _client_inb0}, - {CLIENT_INB1_UINT, _client_inb1}, - {CLIENT_INB2_UINT, _client_inb2}, - {CLIENT_INB3_UINT, _client_inb3}, - {CLIENT_INB4_UINT, _client_inb4}, - {CLIENT_INB5_UINT, _client_inb5}, - {CLIENT_INB6_UINT, _client_inb6}, - {CLIENT_INB7_UINT, _client_inb7}, - - {CLIENT_UNB0_UINT, _client_unb0}, - {CLIENT_UNB1_UINT, _client_unb1}, - {CLIENT_UNB2_UINT, _client_unb2}, - {CLIENT_UNB3_UINT, _client_unb3}, - {CLIENT_UNB4_UINT, _client_unb4}, - {CLIENT_UNB5_UINT, _client_unb5}, - {CLIENT_UNB6_UINT, _client_unb6}, - {CLIENT_UNB7_UINT, _client_unb7}, - - {CLIENT_PLB0_UINT, _client_plb0}, - {CLIENT_PLB1_UINT, _client_plb1}, - {CLIENT_PLB2_UINT, _client_plb2}, - {CLIENT_PLB3_UINT, _client_plb3}, - {CLIENT_PLB4_UINT, _client_plb4}, - {CLIENT_PLB5_UINT, _client_plb5}, - {CLIENT_PLB6_UINT, _client_plb6}, - {CLIENT_PLB7_UINT, _client_plb7}, - - {CLIENT_BLB0_UINT, _client_blb0}, - {CLIENT_BLB1_UINT, _client_blb1}, - {CLIENT_BLB2_UINT, _client_blb2}, - {CLIENT_BLB3_UINT, _client_blb3}, - {CLIENT_BLB4_UINT, _client_blb4}, - {CLIENT_BLB5_UINT, _client_blb5}, - {CLIENT_BLB6_UINT, _client_blb6}, - {CLIENT_BLB7_UINT, _client_blb7}, - - {CLIENT_INL0_UINT, _client_inl0}, - {CLIENT_INL1_UINT, _client_inl1}, - {CLIENT_INL2_UINT, _client_inl2}, - {CLIENT_INL3_UINT, _client_inl3}, - {CLIENT_INL4_UINT, _client_inl4}, - {CLIENT_INL5_UINT, _client_inl5}, - {CLIENT_INL6_UINT, _client_inl6}, - {CLIENT_INL7_UINT, _client_inl7}, - - {CLIENT_UNL0_UINT, _client_unl0}, - {CLIENT_UNL1_UINT, _client_unl1}, - {CLIENT_UNL2_UINT, _client_unl2}, - {CLIENT_UNL3_UINT, _client_unl3}, - {CLIENT_UNL4_UINT, _client_unl4}, - {CLIENT_UNL5_UINT, _client_unl5}, - {CLIENT_UNL6_UINT, _client_unl6}, - {CLIENT_UNL7_UINT, _client_unl7}, - - {CLIENT_PLL0_UINT, _client_pll0}, - {CLIENT_PLL1_UINT, _client_pll1}, - {CLIENT_PLL2_UINT, _client_pll2}, - {CLIENT_PLL3_UINT, _client_pll3}, - {CLIENT_PLL4_UINT, _client_pll4}, - {CLIENT_PLL5_UINT, _client_pll5}, - {CLIENT_PLL6_UINT, _client_pll6}, - {CLIENT_PLL7_UINT, _client_pll7}, - - {CLIENT_BLL0_UINT, _client_bll0}, - {CLIENT_BLL1_UINT, _client_bll1}, - {CLIENT_BLL2_UINT, _client_bll2}, - {CLIENT_BLL3_UINT, _client_bll3}, - {CLIENT_BLL4_UINT, _client_bll4}, - {CLIENT_BLL5_UINT, _client_bll5}, - {CLIENT_BLL6_UINT, _client_bll6}, - {CLIENT_BLL7_UINT, _client_bll7}, - - {CLIENT_INK0_UINT, _client_ink0}, - {CLIENT_INK1_UINT, _client_ink1}, - {CLIENT_INK2_UINT, _client_ink2}, - {CLIENT_INK3_UINT, _client_ink3}, - {CLIENT_INK4_UINT, _client_ink4}, - {CLIENT_INK5_UINT, _client_ink5}, - {CLIENT_INK6_UINT, _client_ink6}, - {CLIENT_INK7_UINT, _client_ink7}, - - {CLIENT_UNK0_UINT, _client_unk0}, - {CLIENT_UNK1_UINT, _client_unk1}, - {CLIENT_UNK2_UINT, _client_unk2}, - {CLIENT_UNK3_UINT, _client_unk3}, - {CLIENT_UNK4_UINT, _client_unk4}, - {CLIENT_UNK5_UINT, _client_unk5}, - {CLIENT_UNK6_UINT, _client_unk6}, - {CLIENT_UNK7_UINT, _client_unk7}, - - {CLIENT_PLK0_UINT, _client_plk0}, - {CLIENT_PLK1_UINT, _client_plk1}, - {CLIENT_PLK2_UINT, _client_plk2}, - {CLIENT_PLK3_UINT, _client_plk3}, - {CLIENT_PLK4_UINT, _client_plk4}, - {CLIENT_PLK5_UINT, _client_plk5}, - {CLIENT_PLK6_UINT, _client_plk6}, - {CLIENT_PLK7_UINT, _client_plk7}, - - {CLIENT_BLK0_UINT, _client_blk0}, - {CLIENT_BLK1_UINT, _client_blk1}, - {CLIENT_BLK2_UINT, _client_blk2}, - {CLIENT_BLK3_UINT, _client_blk3}, - {CLIENT_BLK4_UINT, _client_blk4}, - {CLIENT_BLK5_UINT, _client_blk5}, - {CLIENT_BLK6_UINT, _client_blk6}, - {CLIENT_BLK7_UINT, _client_blk7}, - - {CLIENT_BLC0_UINT, _client_blc0}, - {CLIENT_BLC1_UINT, _client_blc1}, - {CLIENT_BLC2_UINT, _client_blc2}, - {CLIENT_BLC3_UINT, _client_blc3}, - {CLIENT_BLC4_UINT, _client_blc4}, - {CLIENT_BLC5_UINT, _client_blc5}, - {CLIENT_BLC6_UINT, _client_blc6}, - {CLIENT_BLC7_UINT, _client_blc7}, - - {CLIENT_CRA0_UINT, _client_cra0}, - {CLIENT_CRA1_UINT, _client_cra1}, - {CLIENT_CRA2_UINT, _client_cra2}, - {CLIENT_CRA3_UINT, _client_cra3}, - {CLIENT_CRA4_UINT, _client_cra4}, - {CLIENT_CRA5_UINT, _client_cra5}, - {CLIENT_CRA6_UINT, _client_cra6}, - {CLIENT_CRA7_UINT, _client_cra7}, - - {CLIENT_HRV0_UINT, _client_hrv0}, - {CLIENT_HRV1_UINT, _client_hrv1}, - {CLIENT_HRV2_UINT, _client_hrv2}, - {CLIENT_HRV3_UINT, _client_hrv3}, - {CLIENT_HRV4_UINT, _client_hrv4}, - {CLIENT_HRV5_UINT, _client_hrv5}, - {CLIENT_HRV6_UINT, _client_hrv6}, - {CLIENT_HRV7_UINT, _client_hrv7}, + {CLIENT_COL0_UINT, &_client_col_generic<0>}, + {CLIENT_COL1_UINT, &_client_col_generic<1>}, + {CLIENT_COL2_UINT, &_client_col_generic<2>}, + {CLIENT_COL3_UINT, &_client_col_generic<3>}, + {CLIENT_COL4_UINT, &_client_col_generic<4>}, + {CLIENT_COL5_UINT, &_client_col_generic<5>}, + {CLIENT_COL6_UINT, &_client_col_generic<6>}, + {CLIENT_COL7_UINT, &_client_col_generic<7>}, + + {CLIENT_CRD0_UINT, &_client_crd_generic<0>}, + {CLIENT_CRD1_UINT, &_client_crd_generic<1>}, + {CLIENT_CRD2_UINT, &_client_crd_generic<2>}, + {CLIENT_CRD3_UINT, &_client_crd_generic<3>}, + {CLIENT_CRD4_UINT, &_client_crd_generic<4>}, + {CLIENT_CRD5_UINT, &_client_crd_generic<5>}, + {CLIENT_CRD6_UINT, &_client_crd_generic<6>}, + {CLIENT_CRD7_UINT, &_client_crd_generic<7>}, + + {CLIENT_INB0_UINT, &_client_inb_generic<0>}, + {CLIENT_INB1_UINT, &_client_inb_generic<1>}, + {CLIENT_INB2_UINT, &_client_inb_generic<2>}, + {CLIENT_INB3_UINT, &_client_inb_generic<3>}, + {CLIENT_INB4_UINT, &_client_inb_generic<4>}, + {CLIENT_INB5_UINT, &_client_inb_generic<5>}, + {CLIENT_INB6_UINT, &_client_inb_generic<6>}, + {CLIENT_INB7_UINT, &_client_inb_generic<7>}, + + {CLIENT_UNB0_UINT, &_client_unb_generic<0>}, + {CLIENT_UNB1_UINT, &_client_unb_generic<1>}, + {CLIENT_UNB2_UINT, &_client_unb_generic<2>}, + {CLIENT_UNB3_UINT, &_client_unb_generic<3>}, + {CLIENT_UNB4_UINT, &_client_unb_generic<4>}, + {CLIENT_UNB5_UINT, &_client_unb_generic<5>}, + {CLIENT_UNB6_UINT, &_client_unb_generic<6>}, + {CLIENT_UNB7_UINT, &_client_unb_generic<7>}, + + {CLIENT_PLB0_UINT, &_client_plb_generic<0>}, + {CLIENT_PLB1_UINT, &_client_plb_generic<1>}, + {CLIENT_PLB2_UINT, &_client_plb_generic<2>}, + {CLIENT_PLB3_UINT, &_client_plb_generic<3>}, + {CLIENT_PLB4_UINT, &_client_plb_generic<4>}, + {CLIENT_PLB5_UINT, &_client_plb_generic<5>}, + {CLIENT_PLB6_UINT, &_client_plb_generic<6>}, + {CLIENT_PLB7_UINT, &_client_plb_generic<7>}, + + {CLIENT_BLB0_UINT, &_client_blb_generic<0>}, + {CLIENT_BLB1_UINT, &_client_blb_generic<1>}, + {CLIENT_BLB2_UINT, &_client_blb_generic<2>}, + {CLIENT_BLB3_UINT, &_client_blb_generic<3>}, + {CLIENT_BLB4_UINT, &_client_blb_generic<4>}, + {CLIENT_BLB5_UINT, &_client_blb_generic<5>}, + {CLIENT_BLB6_UINT, &_client_blb_generic<6>}, + {CLIENT_BLB7_UINT, &_client_blb_generic<7>}, + + {CLIENT_INL0_UINT, &_client_inl_generic<0>}, + {CLIENT_INL1_UINT, &_client_inl_generic<1>}, + {CLIENT_INL2_UINT, &_client_inl_generic<2>}, + {CLIENT_INL3_UINT, &_client_inl_generic<3>}, + {CLIENT_INL4_UINT, &_client_inl_generic<4>}, + {CLIENT_INL5_UINT, &_client_inl_generic<5>}, + {CLIENT_INL6_UINT, &_client_inl_generic<6>}, + {CLIENT_INL7_UINT, &_client_inl_generic<7>}, + + {CLIENT_UNL0_UINT, &_client_unl_generic<0>}, + {CLIENT_UNL1_UINT, &_client_unl_generic<1>}, + {CLIENT_UNL2_UINT, &_client_unl_generic<2>}, + {CLIENT_UNL3_UINT, &_client_unl_generic<3>}, + {CLIENT_UNL4_UINT, &_client_unl_generic<4>}, + {CLIENT_UNL5_UINT, &_client_unl_generic<5>}, + {CLIENT_UNL6_UINT, &_client_unl_generic<6>}, + {CLIENT_UNL7_UINT, &_client_unl_generic<7>}, + + {CLIENT_PLL0_UINT, &_client_pll_generic<0>}, + {CLIENT_PLL1_UINT, &_client_pll_generic<1>}, + {CLIENT_PLL2_UINT, &_client_pll_generic<2>}, + {CLIENT_PLL3_UINT, &_client_pll_generic<3>}, + {CLIENT_PLL4_UINT, &_client_pll_generic<4>}, + {CLIENT_PLL5_UINT, &_client_pll_generic<5>}, + {CLIENT_PLL6_UINT, &_client_pll_generic<6>}, + {CLIENT_PLL7_UINT, &_client_pll_generic<7>}, + + {CLIENT_BLL0_UINT, &_client_bll_generic<0>}, + {CLIENT_BLL1_UINT, &_client_bll_generic<1>}, + {CLIENT_BLL2_UINT, &_client_bll_generic<2>}, + {CLIENT_BLL3_UINT, &_client_bll_generic<3>}, + {CLIENT_BLL4_UINT, &_client_bll_generic<4>}, + {CLIENT_BLL5_UINT, &_client_bll_generic<5>}, + {CLIENT_BLL6_UINT, &_client_bll_generic<6>}, + {CLIENT_BLL7_UINT, &_client_bll_generic<7>}, + + {CLIENT_INK0_UINT, &_client_ink_generic<0>}, + {CLIENT_INK1_UINT, &_client_ink_generic<1>}, + {CLIENT_INK2_UINT, &_client_ink_generic<2>}, + {CLIENT_INK3_UINT, &_client_ink_generic<3>}, + {CLIENT_INK4_UINT, &_client_ink_generic<4>}, + {CLIENT_INK5_UINT, &_client_ink_generic<5>}, + {CLIENT_INK6_UINT, &_client_ink_generic<6>}, + {CLIENT_INK7_UINT, &_client_ink_generic<7>}, + + {CLIENT_UNK0_UINT, &_client_unk_generic<0>}, + {CLIENT_UNK1_UINT, &_client_unk_generic<1>}, + {CLIENT_UNK2_UINT, &_client_unk_generic<2>}, + {CLIENT_UNK3_UINT, &_client_unk_generic<3>}, + {CLIENT_UNK4_UINT, &_client_unk_generic<4>}, + {CLIENT_UNK5_UINT, &_client_unk_generic<5>}, + {CLIENT_UNK6_UINT, &_client_unk_generic<6>}, + {CLIENT_UNK7_UINT, &_client_unk_generic<7>}, + + {CLIENT_PLK0_UINT, &_client_plk_generic<0>}, + {CLIENT_PLK1_UINT, &_client_plk_generic<1>}, + {CLIENT_PLK2_UINT, &_client_plk_generic<2>}, + {CLIENT_PLK3_UINT, &_client_plk_generic<3>}, + {CLIENT_PLK4_UINT, &_client_plk_generic<4>}, + {CLIENT_PLK5_UINT, &_client_plk_generic<5>}, + {CLIENT_PLK6_UINT, &_client_plk_generic<6>}, + {CLIENT_PLK7_UINT, &_client_plk_generic<7>}, + + {CLIENT_BLK0_UINT, &_client_blk_generic<0>}, + {CLIENT_BLK1_UINT, &_client_blk_generic<1>}, + {CLIENT_BLK2_UINT, &_client_blk_generic<2>}, + {CLIENT_BLK3_UINT, &_client_blk_generic<3>}, + {CLIENT_BLK4_UINT, &_client_blk_generic<4>}, + {CLIENT_BLK5_UINT, &_client_blk_generic<5>}, + {CLIENT_BLK6_UINT, &_client_blk_generic<6>}, + {CLIENT_BLK7_UINT, &_client_blk_generic<7>}, + + {CLIENT_BLC0_UINT, &_client_blc_generic<0>}, + {CLIENT_BLC1_UINT, &_client_blc_generic<1>}, + {CLIENT_BLC2_UINT, &_client_blc_generic<2>}, + {CLIENT_BLC3_UINT, &_client_blc_generic<3>}, + {CLIENT_BLC4_UINT, &_client_blc_generic<4>}, + {CLIENT_BLC5_UINT, &_client_blc_generic<5>}, + {CLIENT_BLC6_UINT, &_client_blc_generic<6>}, + {CLIENT_BLC7_UINT, &_client_blc_generic<7>}, + + {CLIENT_CRA0_UINT, &_client_cra_generic<0>}, + {CLIENT_CRA1_UINT, &_client_cra_generic<1>}, + {CLIENT_CRA2_UINT, &_client_cra_generic<2>}, + {CLIENT_CRA3_UINT, &_client_cra_generic<3>}, + {CLIENT_CRA4_UINT, &_client_cra_generic<4>}, + {CLIENT_CRA5_UINT, &_client_cra_generic<5>}, + {CLIENT_CRA6_UINT, &_client_cra_generic<6>}, + {CLIENT_CRA7_UINT, &_client_cra_generic<7>}, + + {CLIENT_HRV0_UINT, &_client_hrv_generic<0>}, + {CLIENT_HRV1_UINT, &_client_hrv_generic<1>}, + {CLIENT_HRV2_UINT, &_client_hrv_generic<2>}, + {CLIENT_HRV3_UINT, &_client_hrv_generic<3>}, + {CLIENT_HRV4_UINT, &_client_hrv_generic<4>}, + {CLIENT_HRV5_UINT, &_client_hrv_generic<5>}, + {CLIENT_HRV6_UINT, &_client_hrv_generic<6>}, + {CLIENT_HRV7_UINT, &_client_hrv_generic<7>}, {1, NULL} }; @@ -1239,7 +1169,7 @@ static int _client_cmpl(t_wol_gameres_result * game_result, wol_gameres_type typ { t_game * game = game_result->game; t_game_result result; - t_game_result * results = game_result->results; + t_game_result * results = game_result->results; int resultnum; switch (type) { @@ -2233,7 +2163,7 @@ static int _client_flgc(t_wol_gameres_result * game_result, wol_gameres_type typ /* player related tag handlers */ -static int _cl_nam_general(t_wol_gameres_result * game_result, int num, wol_gameres_type type, int size, void const * data) +static int _cl_nam_general(int num, t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) { int senderid = game_result->senderid; t_account * account = accountlist_find_account((char const *) data); @@ -2250,47 +2180,7 @@ static int _cl_nam_general(t_wol_gameres_result * game_result, int num, wol_game return 0; } -static int _client_nam0(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_nam_general(game_result, 0, type, size, data); -} - -static int _client_nam1(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_nam_general(game_result, 1, type, size, data); -} - -static int _client_nam2(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_nam_general(game_result, 2, type, size, data); -} - -static int _client_nam3(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_nam_general(game_result, 3, type, size, data); -} - -static int _client_nam4(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_nam_general(game_result, 4, type, size, data); -} - -static int _client_nam5(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_nam_general(game_result, 5, type, size, data); -} - -static int _client_nam6(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_nam_general(game_result, 6, type, size, data); -} - -static int _client_nam7(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_nam_general(game_result, 7, type, size, data); -} - -static int _cl_ipa_general(t_wol_gameres_result * game_result, int num, wol_gameres_type type, int size, void const * data) +static int _cl_ipa_general(int num, t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) { unsigned int ipaddress; @@ -2306,47 +2196,7 @@ static int _cl_ipa_general(t_wol_gameres_result * game_result, int num, wol_game return 0; } -static int _client_ipa0(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_ipa_general(game_result, 0, type, size, data); -} - -static int _client_ipa1(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_ipa_general(game_result, 1, type, size, data); -} - -static int _client_ipa2(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_ipa_general(game_result, 2, type, size, data); -} - -static int _client_ipa3(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_ipa_general(game_result, 3, type, size, data); -} - -static int _client_ipa4(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_ipa_general(game_result, 4, type, size, data); -} - -static int _client_ipa5(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_ipa_general(game_result, 5, type, size, data); -} - -static int _client_ipa6(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_ipa_general(game_result, 6, type, size, data); -} - -static int _client_ipa7(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_ipa_general(game_result, 7, type, size, data); -} - -static int _cl_cid_general(t_wol_gameres_result * game_result, int num, wol_gameres_type type, int size, void const * data) +static int _cl_cid_general(int num, t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) { unsigned int clanid; @@ -2362,47 +2212,7 @@ static int _cl_cid_general(t_wol_gameres_result * game_result, int num, wol_game return 0; } -static int _client_cid0(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_cid_general(game_result, 0, type, size, data); -} - -static int _client_cid1(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_cid_general(game_result, 1, type, size, data); -} - -static int _client_cid2(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_cid_general(game_result, 2, type, size, data); -} - -static int _client_cid3(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_cid_general(game_result, 3, type, size, data); -} - -static int _client_cid4(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_cid_general(game_result, 4, type, size, data); -} - -static int _client_cid5(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_cid_general(game_result, 5, type, size, data); -} - -static int _client_cid6(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_cid_general(game_result, 6, type, size, data); -} - -static int _client_cid7(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_cid_general(game_result, 7, type, size, data); -} - -static int _cl_sid_general(t_wol_gameres_result * game_result, int num, wol_gameres_type type, int size, void const * data) +static int _cl_sid_general(int num, t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) { unsigned int sideid; @@ -2421,47 +2231,7 @@ static int _cl_sid_general(t_wol_gameres_result * game_result, int num, wol_game return 0; } -static int _client_sid0(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_sid_general(game_result, 0, type, size, data); -} - -static int _client_sid1(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_sid_general(game_result, 1, type, size, data); -} - -static int _client_sid2(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_sid_general(game_result, 2, type, size, data); -} - -static int _client_sid3(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_sid_general(game_result, 3, type, size, data); -} - -static int _client_sid4(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_sid_general(game_result, 4, type, size, data); -} - -static int _client_sid5(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_sid_general(game_result, 5, type, size, data); -} - -static int _client_sid6(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_sid_general(game_result, 6, type, size, data); -} - -static int _client_sid7(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_sid_general(game_result, 7, type, size, data); -} - -static int _cl_tid_general(t_wol_gameres_result * game_result, int num, wol_gameres_type type, int size, void const * data) +static int _cl_tid_general(int num, t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) { unsigned int teamid; @@ -2477,48 +2247,7 @@ static int _cl_tid_general(t_wol_gameres_result * game_result, int num, wol_game return 0; } -static int _client_tid0(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_tid_general(game_result, 0, type, size, data); -} - -static int _client_tid1(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_tid_general(game_result, 1, type, size, data); -} - -static int _client_tid2(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_tid_general(game_result, 2, type, size, data); -} - -static int _client_tid3(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_tid_general(game_result, 3, type, size, data); -} - -static int _client_tid4(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_tid_general(game_result, 4, type, size, data); -} - -static int _client_tid5(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_tid_general(game_result, 5, type, size, data); -} - -static int _client_tid6(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_tid_general(game_result, 6, type, size, data); -} - -static int _client_tid7(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_tid_general(game_result, 7, type, size, data); -} - - -static int _cl_cmp_general(t_wol_gameres_result * game_result, int num, wol_gameres_type type, int size, void const * data) +static int _cl_cmp_general(int num, t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) { //CMPx 00 06 00 04 00 00 02 00 //0x0100=WIN 0x0200(0x0210)=LOSE 0x0300=DISCONECT @@ -2526,7 +2255,7 @@ static int _cl_cmp_general(t_wol_gameres_result * game_result, int num, wol_game t_account * other_account = game_result->otheraccount; t_game * game = game_result->game; t_game_result result; - t_game_result * results = game_result->results; + t_game_result * results = game_result->results; int resultnum; int i; @@ -2581,47 +2310,7 @@ static int _cl_cmp_general(t_wol_gameres_result * game_result, int num, wol_game return 0; } -static int _client_cmp0(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_cmp_general(game_result, 0, type, size, data); -} - -static int _client_cmp1(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_cmp_general(game_result, 1, type, size, data); -} - -static int _client_cmp2(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_cmp_general(game_result, 2, type, size, data); -} - -static int _client_cmp3(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_cmp_general(game_result, 3, type, size, data); -} - -static int _client_cmp4(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_cmp_general(game_result, 4, type, size, data); -} - -static int _client_cmp5(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_cmp_general(game_result, 5, type, size, data); -} - -static int _client_cmp6(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_cmp_general(game_result, 6, type, size, data); -} - -static int _client_cmp7(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_cmp_general(game_result, 7, type, size, data); -} - -static int _cl_col_general(int num, wol_gameres_type type, int size, void const * data) +static int _cl_col_general(int num, t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) { switch (type) { case wol_gameres_type_int: @@ -2634,47 +2323,7 @@ static int _cl_col_general(int num, wol_gameres_type type, int size, void const return 0; } -static int _client_col0(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_col_general(0, type, size, data); -} - -static int _client_col1(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_col_general(1, type, size, data); -} - -static int _client_col2(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_col_general(2, type, size, data); -} - -static int _client_col3(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_col_general(3, type, size, data); -} - -static int _client_col4(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_col_general(4, type, size, data); -} - -static int _client_col5(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_col_general(5, type, size, data); -} - -static int _client_col6(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_col_general(6, type, size, data); -} - -static int _client_col7(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_col_general(7, type, size, data); -} - -static int _cl_crd_general(int num, wol_gameres_type type, int size, void const * data) +static int _cl_crd_general(int num, t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) { switch (type) { case wol_gameres_type_time: @@ -2687,47 +2336,7 @@ static int _cl_crd_general(int num, wol_gameres_type type, int size, void const return 0; } -static int _client_crd0(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_crd_general(0, type, size, data); -} - -static int _client_crd1(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_crd_general(1, type, size, data); -} - -static int _client_crd2(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_crd_general(2, type, size, data); -} - -static int _client_crd3(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_crd_general(3, type, size, data); -} - -static int _client_crd4(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_crd_general(4, type, size, data); -} - -static int _client_crd5(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_crd_general(5, type, size, data); -} - -static int _client_crd6(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_crd_general(6, type, size, data); -} - -static int _client_crd7(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_crd_general(7, type, size, data); -} - -static int _cl_inb_general(int num, wol_gameres_type type, int size, void const * data) +static int _cl_inb_general(int num, t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) { switch (type) { case wol_gameres_type_time: @@ -2743,110 +2352,23 @@ static int _cl_inb_general(int num, wol_gameres_type type, int size, void const return 0; } -static int _client_inb0(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_inb_general(0, type, size, data); -} - -static int _client_inb1(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) +static int _cl_unb_general(int num, t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) { - return _cl_inb_general(1, type, size, data); + switch (type) { + case wol_gameres_type_time: + DEBUG2("Player %u build %u units", num, (unsigned int) bn_int_nget(*((bn_int *)data))); + break; + case wol_gameres_type_bigint: + DEBUG2("Player %u build %u units", num, wol_gameres_get_long_from_data(size, data)); + break; + default: + WARN2("got unknown gameres type %u for UNB%u", type, num); + break; + } + return 0; } - -static int _client_inb2(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_inb_general(2, type, size, data); -} - - -static int _client_inb3(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_inb_general(3, type, size, data); -} - - -static int _client_inb4(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_inb_general(4, type, size, data); -} - - -static int _client_inb5(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_inb_general(5, type, size, data); -} - - -static int _client_inb6(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_inb_general(6, type, size, data); -} - - -static int _client_inb7(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_inb_general(7, type, size, data); -} - -static int _cl_unb_general(int num, wol_gameres_type type, int size, void const * data) -{ - switch (type) { - case wol_gameres_type_time: - DEBUG2("Player %u build %u units", num, (unsigned int) bn_int_nget(*((bn_int *)data))); - break; - case wol_gameres_type_bigint: - DEBUG2("Player %u build %u units", num, wol_gameres_get_long_from_data(size, data)); - break; - default: - WARN2("got unknown gameres type %u for UNB%u", type, num); - break; - } - return 0; -} - -static int _client_unb0(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_unb_general(0, type, size, data); -} - - -static int _client_unb1(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_unb_general(1, type, size, data); -} - -static int _client_unb2(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_unb_general(2, type, size, data); -} - -static int _client_unb3(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_unb_general(3, type, size, data); -} - -static int _client_unb4(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_unb_general(4, type, size, data); -} - -static int _client_unb5(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_unb_general(5, type, size, data); -} - -static int _client_unb6(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_unb_general(6, type, size, data); -} - -static int _client_unb7(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_unb_general(7, type, size, data); -} - -static int _cl_plb_general(int num, wol_gameres_type type, int size, void const * data) +static int _cl_plb_general(int num, t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) { switch (type) { case wol_gameres_type_time: @@ -2862,47 +2384,7 @@ static int _cl_plb_general(int num, wol_gameres_type type, int size, void const return 0; } -static int _client_plb0(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_plb_general(0, type, size, data); -} - -static int _client_plb1(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_plb_general(1, type, size, data); -} - -static int _client_plb2(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_plb_general(2, type, size, data); -} - -static int _client_plb3(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_plb_general(3, type, size, data); -} - -static int _client_plb4(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_plb_general(4, type, size, data); -} - -static int _client_plb5(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_plb_general(5, type, size, data); -} - -static int _client_plb6(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_plb_general(6, type, size, data); -} - -static int _client_plb7(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_plb_general(7, type, size, data); -} - -static int _cl_blb_general(int num, wol_gameres_type type, int size, void const * data) +static int _cl_blb_general(int num, t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) { switch (type) { case wol_gameres_type_time: @@ -2918,47 +2400,7 @@ static int _cl_blb_general(int num, wol_gameres_type type, int size, void const return 0; } -static int _client_blb0(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_blb_general(0, type, size, data); -} - -static int _client_blb1(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_blb_general(1, type, size, data); -} - -static int _client_blb2(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_blb_general(2, type, size, data); -} - -static int _client_blb3(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_blb_general(3, type, size, data); -} - -static int _client_blb4(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_blb_general(4, type, size, data); -} - -static int _client_blb5(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_blb_general(5, type, size, data); -} - -static int _client_blb6(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_blb_general(6, type, size, data); -} - -static int _client_blb7(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_blb_general(7, type, size, data); -} - -static int _cl_inl_general(int num, wol_gameres_type type, int size, void const * data) +static int _cl_inl_general(int num, t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) { switch (type) { case wol_gameres_type_time: @@ -2974,47 +2416,7 @@ static int _cl_inl_general(int num, wol_gameres_type type, int size, void const return 0; } -static int _client_inl0(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_inl_general(0, type, size, data); -} - -static int _client_inl1(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_inl_general(1, type, size, data); -} - -static int _client_inl2(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_inl_general(2, type, size, data); -} - -static int _client_inl3(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_inl_general(3, type, size, data); -} - -static int _client_inl4(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_inl_general(4, type, size, data); -} - -static int _client_inl5(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_inl_general(5, type, size, data); -} - -static int _client_inl6(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_inl_general(6, type, size, data); -} - -static int _client_inl7(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_inl_general(7, type, size, data); -} - -static int _cl_unl_general(int num, wol_gameres_type type, int size, void const * data) +static int _cl_unl_general(int num, t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) { switch (type) { case wol_gameres_type_time: @@ -3030,47 +2432,7 @@ static int _cl_unl_general(int num, wol_gameres_type type, int size, void const return 0; } -static int _client_unl0(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_unl_general(0, type, size, data); -} - -static int _client_unl1(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_unl_general(1, type, size, data); -} - -static int _client_unl2(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_unl_general(2, type, size, data); -} - -static int _client_unl3(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_unl_general(3, type, size, data); -} - -static int _client_unl4(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_unl_general(4, type, size, data); -} - -static int _client_unl5(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_unl_general(5, type, size, data); -} - -static int _client_unl6(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_unl_general(6, type, size, data); -} - -static int _client_unl7(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_unl_general(7, type, size, data); -} - -static int _cl_pll_general(int num, wol_gameres_type type, int size, void const * data) +static int _cl_pll_general(int num, t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) { switch (type) { case wol_gameres_type_time: @@ -3086,47 +2448,7 @@ static int _cl_pll_general(int num, wol_gameres_type type, int size, void const return 0; } -static int _client_pll0(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_pll_general(0, type, size, data); -} - -static int _client_pll1(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_pll_general(1, type, size, data); -} - -static int _client_pll2(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_pll_general(2, type, size, data); -} - -static int _client_pll3(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_pll_general(3, type, size, data); -} - -static int _client_pll4(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_pll_general(4, type, size, data); -} - -static int _client_pll5(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_pll_general(5, type, size, data); -} - -static int _client_pll6(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_pll_general(6, type, size, data); -} - -static int _client_pll7(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_pll_general(7, type, size, data); -} - -static int _cl_bll_general(int num, wol_gameres_type type, int size, void const * data) +static int _cl_bll_general(int num, t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) { switch (type) { case wol_gameres_type_time: @@ -3142,47 +2464,7 @@ static int _cl_bll_general(int num, wol_gameres_type type, int size, void const return 0; } -static int _client_bll0(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_bll_general(0, type, size, data); -} - -static int _client_bll1(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_bll_general(1, type, size, data); -} - -static int _client_bll2(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_bll_general(2, type, size, data); -} - -static int _client_bll3(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_bll_general(3, type, size, data); -} - -static int _client_bll4(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_bll_general(4, type, size, data); -} - -static int _client_bll5(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_bll_general(5, type, size, data); -} - -static int _client_bll6(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_bll_general(6, type, size, data); -} - -static int _client_bll7(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_bll_general(7, type, size, data); -} - -static int _cl_ink_general(int num, wol_gameres_type type, int size, void const * data) +static int _cl_ink_general(int num, t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) { switch (type) { case wol_gameres_type_time: @@ -3198,47 +2480,7 @@ static int _cl_ink_general(int num, wol_gameres_type type, int size, void const return 0; } -static int _client_ink0(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_ink_general(0, type, size, data); -} - -static int _client_ink1(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_ink_general(1, type, size, data); -} - -static int _client_ink2(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_ink_general(2, type, size, data); -} - -static int _client_ink3(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_ink_general(3, type, size, data); -} - -static int _client_ink4(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_ink_general(4, type, size, data); -} - -static int _client_ink5(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_ink_general(5, type, size, data); -} - -static int _client_ink6(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_ink_general(6, type, size, data); -} - -static int _client_ink7(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_ink_general(7, type, size, data); -} - -static int _cl_unk_general(int num, wol_gameres_type type, int size, void const * data) +static int _cl_unk_general(int num, t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) { switch (type) { case wol_gameres_type_time: @@ -3254,47 +2496,7 @@ static int _cl_unk_general(int num, wol_gameres_type type, int size, void const return 0; } -static int _client_unk0(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_unk_general(0, type, size, data); -} - -static int _client_unk1(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_unk_general(1, type, size, data); -} - -static int _client_unk2(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_unk_general(2, type, size, data); -} - -static int _client_unk3(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_unk_general(3, type, size, data); -} - -static int _client_unk4(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_unk_general(4, type, size, data); -} - -static int _client_unk5(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_unk_general(5, type, size, data); -} - -static int _client_unk6(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_unk_general(6, type, size, data); -} - -static int _client_unk7(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_unk_general(7, type, size, data); -} - -static int _cl_plk_general(int num, wol_gameres_type type, int size, void const * data) +static int _cl_plk_general(int num, t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) { switch (type) { case wol_gameres_type_time: @@ -3310,47 +2512,7 @@ static int _cl_plk_general(int num, wol_gameres_type type, int size, void const return 0; } -static int _client_plk0(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_plk_general(0, type, size, data); -} - -static int _client_plk1(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_plk_general(1, type, size, data); -} - -static int _client_plk2(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_plk_general(2, type, size, data); -} - -static int _client_plk3(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_plk_general(3, type, size, data); -} - -static int _client_plk4(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_plk_general(4, type, size, data); -} - -static int _client_plk5(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_plk_general(5, type, size, data); -} - -static int _client_plk6(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_plk_general(6, type, size, data); -} - -static int _client_plk7(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_plk_general(7, type, size, data); -} - -static int _cl_blk_general(int num, wol_gameres_type type, int size, void const * data) +static int _cl_blk_general(int num, t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) { switch (type) { case wol_gameres_type_time: @@ -3366,47 +2528,7 @@ static int _cl_blk_general(int num, wol_gameres_type type, int size, void const return 0; } -static int _client_blk0(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_blk_general(0, type, size, data); -} - -static int _client_blk1(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_blk_general(1, type, size, data); -} - -static int _client_blk2(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_blk_general(2, type, size, data); -} - -static int _client_blk3(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_blk_general(3, type, size, data); -} - -static int _client_blk4(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_blk_general(4, type, size, data); -} - -static int _client_blk5(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_blk_general(5, type, size, data); -} - -static int _client_blk6(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_blk_general(6, type, size, data); -} - -static int _client_blk7(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_blk_general(7, type, size, data); -} - -static int _cl_blc_general(int num, wol_gameres_type type, int size, void const * data) +static int _cl_blc_general(int num, t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) { switch (type) { case wol_gameres_type_int: @@ -3422,47 +2544,7 @@ static int _cl_blc_general(int num, wol_gameres_type type, int size, void const return 0; } -static int _client_blc0(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_blc_general(0, type, size, data); -} - -static int _client_blc1(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_blc_general(1, type, size, data); -} - -static int _client_blc2(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_blc_general(2, type, size, data); -} - -static int _client_blc3(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_blc_general(3, type, size, data); -} - -static int _client_blc4(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_blc_general(4, type, size, data); -} - -static int _client_blc5(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_blc_general(5, type, size, data); -} - -static int _client_blc6(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_blc_general(6, type, size, data); -} - -static int _client_blc7(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_blc_general(7, type, size, data); -} - -static int _cl_cra_general(int num, wol_gameres_type type, int size, void const * data) +static int _cl_cra_general(int num, t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) { switch (type) { case wol_gameres_type_bigint: @@ -3475,47 +2557,7 @@ static int _cl_cra_general(int num, wol_gameres_type type, int size, void const return 0; } -static int _client_cra0(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_cra_general(0, type, size, data); -} - -static int _client_cra1(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_cra_general(1, type, size, data); -} - -static int _client_cra2(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_cra_general(2, type, size, data); -} - -static int _client_cra3(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_cra_general(3, type, size, data); -} - -static int _client_cra4(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_cra_general(4, type, size, data); -} - -static int _client_cra5(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_cra_general(5, type, size, data); -} - -static int _client_cra6(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_cra_general(6, type, size, data); -} - -static int _client_cra7(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_cra_general(7, type, size, data); -} - -static int _cl_hrv_general(int num, wol_gameres_type type, int size, void const * data) +static int _cl_hrv_general(int num, t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) { switch (type) { case wol_gameres_type_int: @@ -3528,46 +2570,6 @@ static int _cl_hrv_general(int num, wol_gameres_type type, int size, void const return 0; } -static int _client_hrv0(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_hrv_general(0, type, size, data); -} - -static int _client_hrv1(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_hrv_general(1, type, size, data); -} - -static int _client_hrv2(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_hrv_general(2, type, size, data); -} - -static int _client_hrv3(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_hrv_general(3, type, size, data); -} - -static int _client_hrv4(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_hrv_general(4, type, size, data); -} - -static int _client_hrv5(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_hrv_general(5, type, size, data); -} - -static int _client_hrv6(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_hrv_general(6, type, size, data); -} - -static int _client_hrv7(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) -{ - return _cl_hrv_general(7, type, size, data); -} - } } From 68e4eb4ca54a0e1066ea7c677572bcf18bb56572 Mon Sep 17 00:00:00 2001 From: Pelish Date: Sun, 8 Jan 2012 22:35:15 +0100 Subject: [PATCH 7/8] added some missing gameres tags, fix for bug in Red Alert Ladders when game_results was not sorted according to game_players --- pvpgn/src/bnetd/handle_wol_gameres.cpp | 151 +++++++++++++++++------- pvpgn/src/bnetd/handle_wol_gameres.h | 2 +- pvpgn/src/common/wol_gameres_protocol.h | 4 + 3 files changed, 111 insertions(+), 46 deletions(-) diff --git a/pvpgn/src/bnetd/handle_wol_gameres.cpp b/pvpgn/src/bnetd/handle_wol_gameres.cpp index bca360ffb..39ff67f17 100644 --- a/pvpgn/src/bnetd/handle_wol_gameres.cpp +++ b/pvpgn/src/bnetd/handle_wol_gameres.cpp @@ -131,6 +131,8 @@ static int _client_nam_generic(t_wol_gameres_result* game_result, wol_gameres_ty return _cl_nam_general(N, game_result, type, size, data); } +static int _client_quit(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); + static int _cl_ipa_general(int num, t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); template static int _client_ipa_generic(t_wol_gameres_result* game_result, wol_gameres_type type, int size, void const* data) { @@ -293,6 +295,8 @@ static const t_wol_gamerestag_table_row wol_gamreres_htable[] = { {CLIENT_AIPL_UINT, _client_aipl}, {CLIENT_UNIT_UINT, _client_unit}, {CLIENT_SCEN_UINT, _client_scen}, + {CLIENT_ADR1_UINT, &_client_ipa_generic<1>}, //For WOLv1 we use the same function as in WOLv2 for IPAx + {CLIENT_ADR2_UINT, &_client_ipa_generic<2>}, //For WOLv1 we use the same function as in WOLv2 for IPAx {CLIENT_CMPL_UINT, _client_cmpl}, {CLIENT_PNGS_UINT, _client_pngs}, {CLIENT_PNGR_UINT, _client_pngr}, @@ -361,6 +365,8 @@ static const t_wol_gamerestag_table_row wol_gamreres_htable[] = { {CLIENT_NAM5_UINT, &_client_nam_generic<5>}, {CLIENT_NAM6_UINT, &_client_nam_generic<6>}, {CLIENT_NAM7_UINT, &_client_nam_generic<7>}, + + {CLIENT_QUIT_UINT, _client_quit}, //WOLv1 sends QUIT as second TAG by name, but it does not include number of player {CLIENT_IPA0_UINT, &_client_ipa_generic<0>}, {CLIENT_IPA1_UINT, &_client_ipa_generic<1>}, @@ -637,6 +643,7 @@ static t_wol_gameres_result * gameres_result_create() gameres_result->results = NULL; gameres_result->senderid = -1; gameres_result->myaccount = NULL; + gameres_result->accounts = NULL; return gameres_result; } @@ -650,6 +657,9 @@ static int gameres_result_destroy(t_wol_gameres_result * gameres_result) eventlog(eventlog_level_info,__FUNCTION__,"destroying gameres_result"); + if (gameres_result->accounts) + xfree((void *)gameres_result->accounts); /* avoid warning */ + xfree(gameres_result); return 0; @@ -664,8 +674,10 @@ extern int handle_wol_gameres_packet(t_connection * c, t_packet const * const pa unsigned datalen; void const * data; wol_gameres_type type; + t_game_result * unsorted_results = NULL; t_wol_gameres_result * gameres_result; - unsigned int i; + + unsigned int i, j, max; DEBUG2("[%d] got WOL Gameres packet length %u", conn_get_socket(c), packet_get_size(packet)); offset = sizeof(t_wolgameres_header); @@ -736,23 +748,55 @@ extern int handle_wol_gameres_packet(t_connection * c, t_packet const * const pa offset += datalen; } - if (!(gameres_result->game)) { + if (!(gameres_result->game)) + { ERROR0("game not found (game == NULL)"); return -1; } - if (!(gameres_result->myaccount)) { + if (!(gameres_result->myaccount)) + { ERROR0("have not account of sender"); return -1; } - if (!(gameres_result->results)) { + if (!(gameres_result->results)) + { ERROR0("have not results of game"); return -1; } + if (!(gameres_result->accounts)) + { + ERROR0("have not accounts"); + return -1; + } + + unsorted_results = (t_game_result*)xmalloc(sizeof(t_game_result) * game_get_count(gameres_result->game)); + + for (i=0; igame); i++) + unsorted_results[i] = gameres_result->results[i]; + + for (i=0; igame); i++) + { + for (j=0; jgame); j++) + { + if (!gameres_result->accounts[j]) + { + ERROR0("got NULL account"); + break; + } + if (game_get_player(gameres_result->game,i) == gameres_result->accounts[j]) + { + gameres_result->results[i] = unsorted_results[j]; + break; + } + } + } game_set_report(gameres_result->game, gameres_result->myaccount, "head", "body"); if (game_set_reported_results(gameres_result->game, gameres_result->myaccount, gameres_result->results) < 0) xfree((void *) gameres_result->results); + + xfree((void *) unsorted_results); conn_set_game(account_get_conn(gameres_result->myaccount), NULL, NULL, NULL, game_type_none, 0); @@ -784,10 +828,10 @@ static int _client_sidn(t_wol_gameres_result * game_result, wol_gameres_type typ break; } -//In WOLv1 clients we just got this TAG from Game host - so sender ID1 + //In WOLv1 clients we just got this TAG from Game host - so sender ID0 - DEBUG1("Setting sender ID to %u", 1); - game_result->senderid = 1; + DEBUG1("Setting sender ID to %u", 0); + game_result->senderid = 0; return 0; } @@ -832,6 +876,7 @@ static int _client_idno(t_wol_gameres_result * game_result, wol_gameres_type typ DEBUG2("found started game \"%s\" for gameid %u", game_get_name(game), gameidnumber); game_result->game = game; game_result->results = (t_game_result*)xmalloc(sizeof(t_game_result) * game_get_count(game)); + game_result->accounts = (t_account**)xmalloc(sizeof(t_account*) * game_get_count(game)); } return 0; @@ -1167,7 +1212,6 @@ static int _client_scen(t_wol_gameres_result * game_result, wol_gameres_type typ static int _client_cmpl(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) { - t_game * game = game_result->game; t_game_result result; t_game_result * results = game_result->results; int resultnum; @@ -1204,11 +1248,6 @@ static int _client_cmpl(t_wol_gameres_result * game_result, wol_gameres_type typ break; } - if (!game) { - ERROR0 ("got corrupt gameres packet - game == NULL"); - return 0; - } - if (results) { results[0] = result; @@ -1231,12 +1270,11 @@ static int _client_cmpl(t_wol_gameres_result * game_result, wol_gameres_type typ break; } - game_result->results = results; DEBUG0("game result was set"); } if (game_result->senderid == -1) { - game_result->senderid = 2; + game_result->senderid = 1; DEBUG0("Have not got SIDN tag - setting senderid to 2"); } @@ -2166,13 +2204,23 @@ static int _client_flgc(t_wol_gameres_result * game_result, wol_gameres_type typ static int _cl_nam_general(int num, t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) { int senderid = game_result->senderid; - t_account * account = accountlist_find_account((char const *) data); + t_account * account; + int plnum; DEBUG2("Name of palyer %u: %s", (char *) num, data); + + if ((game_result->game) && (game_get_clienttag(game_result->game) == CLIENTTAG_REDALERT_UINT)) + plnum = num - 1; + else + plnum = num; + + if (account = accountlist_find_account((char const *) data)) + game_result->accounts[plnum] = account; + else + ERROR1("account %s not found", (char *) data); - game_result->otheraccount = account; - - if (senderid == num) { + if (senderid == plnum) + { DEBUG1("Packet was sent by %s", (char *) data); game_result->myaccount = account; } @@ -2180,6 +2228,27 @@ static int _cl_nam_general(int num, t_wol_gameres_result * game_result, wol_game return 0; } +static int _client_quit(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) +{ + int quit; + + switch (type) { + case wol_gameres_type_bool: + quit = (unsigned int) bn_byte_get(*((bn_byte *)data)); + break; + default: + WARN1("got unknown gameres type %u for QUIT", type); + break; + } + + if (quit) + DEBUG0("QUIT == true"); + else + DEBUG0("QUIT == false"); + + return 0; +} + static int _cl_ipa_general(int num, t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) { unsigned int ipaddress; @@ -2189,6 +2258,9 @@ static int _cl_ipa_general(int num, t_wol_gameres_result * game_result, wol_game ipaddress = (unsigned int) bn_int_nget(*((bn_int *)data)); DEBUG2("IP address of player%u: %u", num, ipaddress); break; + case wol_gameres_type_string: //PELISH: WOLv1 sends TAG ADR with tape string so we use ipa for that too + DEBUG2("IP address of player%u: %s", num, data); + break; default: WARN2("got unknown gameres type %u for IPA%u", type, num); break; @@ -2252,14 +2324,11 @@ static int _cl_cmp_general(int num, t_wol_gameres_result * game_result, wol_game //CMPx 00 06 00 04 00 00 02 00 //0x0100=WIN 0x0200(0x0210)=LOSE 0x0300=DISCONECT - t_account * other_account = game_result->otheraccount; - t_game * game = game_result->game; - t_game_result result; t_game_result * results = game_result->results; int resultnum; - int i; - switch (type) { + switch (type) + { case wol_gameres_type_int: resultnum = (unsigned int) bn_int_nget(*((bn_int *)data)); break; @@ -2269,44 +2338,36 @@ static int _cl_cmp_general(int num, t_wol_gameres_result * game_result, wol_game } DEBUG2("Got %u player resultnum %u", num , resultnum); - - resultnum &= 0x0000FF00; - resultnum = resultnum >> 8; - - if ((!game) || (!other_account)) { - ERROR0 ("got corrupt gameres packet - game == NULL || other_account == NULL"); + + if (!results) + { + ERROR0 ("have not game_result->results"); return 0; } - - for (i=0; i> 8; + + switch (resultnum) + { case 1: DEBUG0("WIN"); - result = game_result_win; + results[num] = game_result_win; break; case 2: DEBUG0("LOSS"); - result = game_result_loss; + results[num] = game_result_loss; break; case 3: DEBUG0("DISCONECT"); - result = game_result_disconnect; + results[num] = game_result_disconnect; break; default: DEBUG2("Got wrong %u player resultnum %u", num , resultnum); - result = game_result_disconnect; + results[num] = game_result_disconnect; break; } - if (results) { - results[i] = result; - game_result->results = results; - DEBUG0("game result was set"); - } - return 0; } diff --git a/pvpgn/src/bnetd/handle_wol_gameres.h b/pvpgn/src/bnetd/handle_wol_gameres.h index 8fa521ae8..345147ae6 100644 --- a/pvpgn/src/bnetd/handle_wol_gameres.h +++ b/pvpgn/src/bnetd/handle_wol_gameres.h @@ -51,7 +51,7 @@ typedef struct wol_gameres_result t_game_result * results; int senderid; t_account * myaccount; - t_account * otheraccount; + t_account ** accounts; } t_wol_gameres_result; diff --git a/pvpgn/src/common/wol_gameres_protocol.h b/pvpgn/src/common/wol_gameres_protocol.h index c2d77a1c6..249005001 100644 --- a/pvpgn/src/common/wol_gameres_protocol.h +++ b/pvpgn/src/common/wol_gameres_protocol.h @@ -91,6 +91,8 @@ const t_tag CLIENT_CRAT_UINT = 0x43524154; const t_tag CLIENT_AIPL_UINT = 0x4149504C; const t_tag CLIENT_UNIT_UINT = 0x554E4954; const t_tag CLIENT_SCEN_UINT = 0x5343454E; +const t_tag CLIENT_ADR1_UINT = 0x41445231; +const t_tag CLIENT_ADR2_UINT = 0x41445232; const t_tag CLIENT_CMPL_UINT = 0x434D504C; const t_tag CLIENT_PNGS_UINT = 0x504E4753; const t_tag CLIENT_PNGR_UINT = 0x504E4752; @@ -160,6 +162,8 @@ const t_tag CLIENT_NAM5_UINT = 0x4E414D35; const t_tag CLIENT_NAM6_UINT = 0x4E414D36; const t_tag CLIENT_NAM7_UINT = 0x4E414D37; +const t_tag CLIENT_QUIT_UINT = 0x51554954; + const t_tag CLIENT_IPA0_UINT = 0x49504130; const t_tag CLIENT_IPA1_UINT = 0x49504131; const t_tag CLIENT_IPA2_UINT = 0x49504132; From f9ffb4dfe6a0708161bc0df590c73040e8b21c94 Mon Sep 17 00:00:00 2001 From: Pelish Date: Wed, 11 Jan 2012 00:51:35 +0100 Subject: [PATCH 8/8] added Dune 2000 solo ladders --- pvpgn/src/bnetd/game.cpp | 3 +- pvpgn/src/bnetd/handle_wol_gameres.cpp | 190 +++++++++++++++++++++++- pvpgn/src/bnetd/ladder.cpp | 3 + pvpgn/src/common/wol_gameres_protocol.h | 10 ++ pvpgn/version-history.txt | 6 +- 5 files changed, 206 insertions(+), 6 deletions(-) diff --git a/pvpgn/src/bnetd/game.cpp b/pvpgn/src/bnetd/game.cpp index eebdf3274..0930af27a 100644 --- a/pvpgn/src/bnetd/game.cpp +++ b/pvpgn/src/bnetd/game.cpp @@ -737,8 +737,7 @@ static int game_report(t_game * game) // war3 game reporting is done elsewhere, so we can skip this function return 0; - if ((game->clienttag == CLIENTTAG_WCHAT_UINT) - || (game->clienttag == CLIENTTAG_DUNE2000_UINT) || (game->clienttag == CLIENTTAG_NOX_UINT) + if ((game->clienttag == CLIENTTAG_WCHAT_UINT) || (game->clienttag == CLIENTTAG_NOX_UINT) || (game->clienttag == CLIENTTAG_NOXQUEST_UINT) || (game->clienttag == CLIENTTAG_RENEGADE_UINT) || (game->clienttag == CLIENTTAG_RENGDFDS_UINT) || (game->clienttag == CLIENTTAG_EMPERORBD_UINT) || (game->clienttag == CLIENTTAG_LOFLORE3_UINT) || (game->clienttag == CLIENTTAG_WWOL_UINT)) diff --git a/pvpgn/src/bnetd/handle_wol_gameres.cpp b/pvpgn/src/bnetd/handle_wol_gameres.cpp index 39ff67f17..713901478 100644 --- a/pvpgn/src/bnetd/handle_wol_gameres.cpp +++ b/pvpgn/src/bnetd/handle_wol_gameres.cpp @@ -92,6 +92,8 @@ static int _client_svid(t_wol_gameres_result * game_result, wol_gameres_type typ static int _client_snam(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); static int _client_gmap(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); static int _client_dsvr(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); +static int _client_gset(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); +static int _client_gend(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); /* Renegade Player related functions */ static int _client_pnam(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); @@ -265,6 +267,18 @@ static int _client_hrv_generic(t_wol_gameres_result* game_result, wol_gameres_ty return _cl_hrv_general(N, game_result, type, size, data); } +static int _cl_pln_general(int num, t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); +template +static int _client_pln_generic(t_wol_gameres_result* game_result, wol_gameres_type type, int size, void const* data) { +return _cl_pln_general(N, game_result, type, size, data); +} + +static int _cl_scr_general(int num, t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); +template +static int _client_scr_generic(t_wol_gameres_result* game_result, wol_gameres_type type, int size, void const* data) { +return _cl_scr_general(N, game_result, type, size, data); +} + typedef int (* t_wol_gamerestag)(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data); typedef struct { @@ -278,6 +292,7 @@ static const t_wol_gamerestag_table_row wol_gamreres_htable[] = { {CLIENT_SIDN_UINT, _client_sidn}, {CLIENT_SDFX_UINT, _client_sdfx}, {CLIENT_IDNO_UINT, _client_idno}, + {CLIENT_GMID_UINT, _client_idno}, //PELISH: Dune 2000 uses GMID when sending IDNO {CLIENT_GSKU_UINT, _client_gsku}, {CLIENT_DCON_UINT, _client_dcon}, {CLIENT_LCON_UINT, _client_lcon}, @@ -324,6 +339,8 @@ static const t_wol_gamerestag_table_row wol_gamreres_htable[] = { {CLIENT_SNAM_UINT, _client_snam}, {CLIENT_GMAP_UINT, _client_gmap}, {CLIENT_DSVR_UINT, _client_dsvr}, + {CLIENT_GSET_UINT, _client_gset}, //Dune 2000 + {CLIENT_GEND_UINT, _client_gend}, //Dune 2000 /* Renegade Player related tags */ {CLIENT_PNAM_UINT, _client_pnam}, @@ -566,6 +583,12 @@ static const t_wol_gamerestag_table_row wol_gamreres_htable[] = { {CLIENT_HRV6_UINT, &_client_hrv_generic<6>}, {CLIENT_HRV7_UINT, &_client_hrv_generic<7>}, + {CLIENT_PL_0_UINT, &_client_pln_generic<0>}, + {CLIENT_PL_1_UINT, &_client_pln_generic<1>}, + + {CLIENT_SCR0_UINT, &_client_scr_generic<0>}, + {CLIENT_SCR1_UINT, &_client_scr_generic<1>}, + {1, NULL} }; @@ -1275,7 +1298,7 @@ static int _client_cmpl(t_wol_gameres_result * game_result, wol_gameres_type typ if (game_result->senderid == -1) { game_result->senderid = 1; - DEBUG0("Have not got SIDN tag - setting senderid to 2"); + DEBUG0("Have not got SIDN tag - setting senderid to 1"); } return 0; @@ -1361,6 +1384,7 @@ static int _client_time(t_wol_gameres_result * game_result, wol_gameres_type typ DEBUG1("Game was start at %s ", (char *) data); break; case wol_gameres_type_time: + case wol_gameres_type_int: time = (std::time_t) bn_int_nget(*((bn_int *)data)); DEBUG1("Game was start at %s ", ctime(&time)); break; @@ -1734,6 +1758,50 @@ static int _client_dsvr(t_wol_gameres_result * game_result, wol_gameres_type typ return 0; } +/* Dune 2000 specific tag handlers */ + +static int _client_gset(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) +{ + /** + * This is used by Dune 2000 + * + * imput expected: + * Worms 0 Crates 1 Credits 7000 Techlevel 7 + */ + + switch (type) { + case wol_gameres_type_string: + DEBUG1("Game start settings: %s", (char *) data); + break; + default: + WARN1("got unknown gameres type %u for GSET", type); + break; + } + return 0; +} + +static int _client_gend(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) +{ + /** + * This is used by Dune 2000 + * + * imput expected: + * END_STATUS : OPPONENT SURRENDERED + * END_STATUS : ENDED NORMALLY + * END_STATUS : WASH GAME + */ + + switch (type) { + case wol_gameres_type_string: + DEBUG1("Game ended with: %s", (char *) data); + break; + default: + WARN1("got unknown gameres type %u for GEND", type); + break; + } + return 0; +} + /* Renegade player tag handlers */ static int _client_pnam(t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) @@ -2631,6 +2699,126 @@ static int _cl_hrv_general(int num, t_wol_gameres_result * game_result, wol_game return 0; } +static int _cl_pln_general(int num, t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) +{ + t_game_result * results = game_result->results; + t_account * account; + char * line; /* copy of data */ + char * nickname; + char * temp; + + /** + * This is used by Dune 2000 + * here is imput expected in string type: + * [nick]/[side]/1/1/CONNECTION_ALIVE + * + * example: + * test2/Atreides/1/1/CONNECTION_ALIVE + */ + + switch (type) { + case wol_gameres_type_string: + DEBUG2("Player %u data: %s", num, (char *) data); + break; + default: + WARN2("got unknown gameres type %u for PL_%u", type, num); + break; + } + + line = (char *) xmalloc(std::strlen((char *) data)+1); + strcpy(line,(char *) data); + + nickname = line; + if (!(temp = strchr(nickname,'/'))) { + WARN0("got malformed line (missing nickname)"); + xfree(line); + return 0; + } + *temp++ = '\0'; + + if (account = accountlist_find_account((char const *) nickname)) + game_result->accounts[num] = account; + else + { + ERROR1("account %s not found", (char *) nickname); + xfree(line); + return 0; + } + + if (game_result->senderid == -1) { + game_result->senderid = 1; + DEBUG0("Have not got SIDN tag - setting senderid to 1"); + } + + if (game_result->senderid == num) + { + DEBUG1("Packet was sent by %s", (char *) nickname); + game_result->myaccount = account; + } + + if (line) + xfree(line); + + return 0; +} + +static int _cl_scr_general(int num, t_wol_gameres_result * game_result, wol_gameres_type type, int size, void const * data) +{ + t_game_result * results = game_result->results; + char * line; /* copy of data */ + char * result; /* 0 or 1 */ + char * temp; + + /** + * This is used by Dune 2000 + * here is imput expected in string type: + * [player_result]/6/[Building Lost]/[Building Destroyed]/13/[Casualties Received]/[Casualties Inflicted]/[Spice Harvested] + * + * example: + * 1/6/0/2/13/8/11/2800 + * + * known [player_result] 0==LOSS 1==WIN + */ + + switch (type) { + case wol_gameres_type_string: + DEBUG2("Player %u data: %s", num, (char *) data); + break; + default: + WARN2("got unknown gameres type %u for SCR%u", type, num); + return 0; + } + + line = (char *) xmalloc(std::strlen((char *) data)+1); + strcpy(line,(char *) data); + + result = line; + if (!(temp = strchr(result,'/'))) { + WARN0("got malformed line (missing result)"); + xfree(line); + return 0; + } + *temp++ = '\0'; + + if (std::strcmp(result, "0") == 0) + { + DEBUG1("Player %u - LOSS", num); + results[num] = game_result_loss; + } + else if (std::strcmp(result, "1") == 0) + { + DEBUG1("Player %u - WIN", num); + results[num] = game_result_win; + } + else + WARN1("got unknown result %s", result); + + if (line) + xfree(line); + + return 0; +} + } } diff --git a/pvpgn/src/bnetd/ladder.cpp b/pvpgn/src/bnetd/ladder.cpp index 1b34c88a7..fccafb12a 100644 --- a/pvpgn/src/bnetd/ladder.cpp +++ b/pvpgn/src/bnetd/ladder.cpp @@ -1435,6 +1435,9 @@ Ladders::Ladders() LadderKey RALT_solo(ladder_id_solo, CLIENTTAG_REDALERT_UINT, ladder_sort_default, ladder_time_default); ladderMap.insert(std::make_pair(RALT_solo,LadderList(RALT_solo, referenceTypeAccount))); + //DUNE2000 ladders + LadderKey DN2K_solo(ladder_id_solo, CLIENTTAG_DUNE2000_UINT, ladder_sort_default, ladder_time_default); + ladderMap.insert(std::make_pair(DN2K_solo,LadderList(DN2K_solo, referenceTypeAccount))); } Ladders::~Ladders() throw () diff --git a/pvpgn/src/common/wol_gameres_protocol.h b/pvpgn/src/common/wol_gameres_protocol.h index 249005001..cc046c173 100644 --- a/pvpgn/src/common/wol_gameres_protocol.h +++ b/pvpgn/src/common/wol_gameres_protocol.h @@ -74,6 +74,7 @@ const t_tag CLIENT_SERN_UINT = 0x53455223; const t_tag CLIENT_SIDN_UINT = 0x53494423; const t_tag CLIENT_SDFX_UINT = 0x53444658; const t_tag CLIENT_IDNO_UINT = 0x49444E4F; +const t_tag CLIENT_GMID_UINT = 0x474D4944; const t_tag CLIENT_GSKU_UINT = 0x47534B55; const t_tag CLIENT_DCON_UINT = 0x44434F4E; const t_tag CLIENT_LCON_UINT = 0x4C434F4E; @@ -120,6 +121,8 @@ const t_tag CLIENT_SVID_UINT = 0x53564944; const t_tag CLIENT_SNAM_UINT = 0x534e414d; const t_tag CLIENT_GMAP_UINT = 0x474d4150; const t_tag CLIENT_DSVR_UINT = 0x44535652; +const t_tag CLIENT_GSET_UINT = 0x47534554; +const t_tag CLIENT_GEND_UINT = 0x47454e44; /* RNDG Player tags */ const t_tag CLIENT_PNAM_UINT = 0x504e414d; @@ -362,6 +365,13 @@ const t_tag CLIENT_HRV5_UINT = 0x48525635; const t_tag CLIENT_HRV6_UINT = 0x48525636; const t_tag CLIENT_HRV7_UINT = 0x48525637; +/* Dune 2000 specific */ +const t_tag CLIENT_PL_0_UINT = 0x504c5f30; +const t_tag CLIENT_PL_1_UINT = 0x504c5f31; + +const t_tag CLIENT_SCR0_UINT = 0x53435230; +const t_tag CLIENT_SCR1_UINT = 0x53435231; + } #endif /* INCLUDED_WOL_GAMERES_PROTOCOL_TYPES */ diff --git a/pvpgn/version-history.txt b/pvpgn/version-history.txt index 664668eaa..bc962f481 100644 --- a/pvpgn/version-history.txt +++ b/pvpgn/version-history.txt @@ -13,15 +13,15 @@ PvPGN Version History: -- disable account creation via irc/wol when new_accounts=false -- added support to allow/deny WOL clients in bnetd.conf -- added support for battle clans - -- added various protocol related fixes -- added apiregister support -- added autoupdate support for WOLv2 clients -- added variables into bnetd.conf for wol FTP update server specification -- fixed voice flag not shown for clients in channel -- fixed bug in RedAlert2/Yuri when game owner changes maximum players -- added QuickMatch support for RA2/YURI - -- added Ladders support for Red Alert v3.03, Tiberian Sun, Firestorm, - Red Alert 2 and Yuri's Revenge clients + -- added solo ladders support for Red Alert v3.03, Dune 2000, Tiberian Sun, + Firestorm, Red Alert 2 and Yuri's Revenge clients + -- various protocol related fixes [WAR3] -- added support for SRP3 based account creation/login