Я уж извиняюсь за то что обратился в этот форум ( я к нему просто привык ) . Есть ли на серве спец-ы по C# а именно по пвпгну. Я хотел бы спросить не могли бы они показать хотя-бы к примеру .. На официальном форуме пвпгна давали подобный код .. но к сожалению возникли ошибки даже при подключении таких файлов как sql_common.h sql_mysql.h . Мб есть люди знающие C# (pvpgn) Вот собст-но сам код Код: /* * Desciption: A command handler for getting game rating from GHost directly from your PvPGN. * Author: Timeout * Link: http://forums.pvpgn.org/index.php?topic=167686 * Code comments by MusicDemon * * Notes: * - Do not forget to add the command to the command list in; * - - commands.cpp * - - command_groups.conf * - - help.conf * - Expected command format: "/rating <UserName>" e.g. "/rating Timeout" * * Version: 1.1 * * Changes: * Removed random else statement for the "if (result != NULL)" statement. | v1.1 | MusicDemon * */ static int _handle_rating_command(t_connection *c,char const * text) { t_account * acc; char query[2048]; t_sql_engine *sql = NULL; t_sql_res * result = NULL; t_sql_row * Row = NULL; text = skip_command(text); // Extract command. (Parameters, etc.) acc = accountlist_find_account(text); // Get account according to the name parameter. sql = &sql_mysql; // The SQL connection. if (!sql) // Check if the SQL connection exists. { eventlog(eventlog_level_error, __FUNCTION__, "sql layer not initilized"); // The SQL connection does not exist. return -1; } if ( acc != NULL ) // Check if the account is NULL or not. { // Run some bad-ass SQL query. snprintf(query,sizeof(query),"select totgames,wins,losses,killstotal,deathstotal,creepkillstotal,creepdeniestotal,assiststotal,neutralkillstotal,towerkillstotal,raxkillstotal,courierkillstotal,kills,deaths,creepkills,creepdenies,assists,neutralkills,towerkills,raxkills,courierkills, server from(select *, (kills/deaths) as killdeathratio, (totgames-wins) as losses from (select gp.name as name,ga.server as server,gp.gameid as gameid, gp.colour as colour, avg(dp.courierkills) as courierkills, sum(dp.raxkills) as raxkillstotal, sum(dp.towerkills) as towerkillstotal, sum(dp.assists) as assiststotal,sum(dp.courierkills) as courierkillstotal, sum(dp.creepdenies) as creepdeniestotal, sum(dp.creepkills) as creepkillstotal,sum(dp.neutralkills) as neutralkillstotal, sum(dp.deaths) as deathstotal, sum(dp.kills) as killstotal,avg(dp.raxkills) as raxkills,avg(dp.towerkills) as towerkills, avg(dp.assists) as assists, avg(dp.creepdenies) as creepdenies, avg(dp.creepkills) as creepkills,avg(dp.neutralkills) as neutralkills, avg(dp.deaths) as deaths, avg(dp.kills) as kills,count(*) as totgames, SUM(case when((dg.winner = 1 and dp.newcolour < 6) or (dg.winner = 2 and dp.newcolour > 6)) then 1 else 0 end) as wins from gameplayers as gp, dotagames as dg, games as ga,dotaplayers as dp where dg.winner <> 0 and dp.gameid = gp.gameid and dg.gameid = dp.gameid and dp.gameid = ga.id and gp.gameid = dg.gameid and gp.colour = dp.colour and gp.name='%s' group by gp.name) as h) as i", account_get_name(acc)); result = sql->query_res(query); // Copy the result of the query. eventlog(eventlog_level_error,__FUNCTION__,query); // Log the query, as an error(?) if (result != NULL) // Check if the query didn't return NULL or is NULL. { if (sql->num_rows(result) < 1) // Check if the user has played any games on linked bots. { message_send_text(c,message_type_error,c,"Rating Doesnt exist"); // No entries found. sql->free_result(result); return 0; } while ((Row = sql->fetch_row(result)) != NULL) // Now we run through all rows found in the result of the query. { uint32_t TotalGames = std::atoi( Row[0] ); if( TotalGames > 0 ) // Make sure the row has at least a total amount of games played higher than zero. { // Parsing is done here. No comments needed. uint32_t TotalWins = std::atoi( Row[1] ); uint32_t TotalLosses = std::atoi( Row[2] ); uint32_t TotalKills = std::atoi( Row[3] ); uint32_t TotalDeaths = std::atoi( Row[4] ); uint32_t TotalCreepKills = std::atoi( Row[5] ); uint32_t TotalCreepDenies = std::atoi( Row[6] ); uint32_t TotalAssists = std::atoi( Row[7] ); uint32_t TotalNeutralKills = std::atoi( Row[8] ); uint32_t TotalTowerKills = std::atoi( Row[9] ); uint32_t TotalRaxKills = std::atoi( Row[10] ); uint32_t TotalCourierKills = std::atoi( Row[11] ); double wpg = 0; double lpg = 0; double kpg = (double)TotalKills/TotalGames; double dpg = (double)TotalDeaths/TotalGames; double ckpg = (double)TotalCreepKills/TotalGames; double cdpg = (double)TotalCreepDenies/TotalGames; double apg = (double)TotalAssists/TotalGames; double nkpg = (double)TotalNeutralKills/TotalGames; double tkpg = (double)TotalTowerKills/TotalGames; double rkpg = (double)TotalRaxKills/TotalGames; double coukpg = (double)TotalCourierKills/TotalGames; double Score = std::atoi( Row[21] ); uint32_t Rank = 0; wpg = (double)TotalWins/TotalGames; lpg = (double)TotalLosses/TotalGames; wpg = wpg * 100; lpg = lpg * 100; uint32_t leavecount = 0; // Make the sendable text and send it. snprintf(msgtemp, sizeof(msgtemp), "Rating >> S/W/L/K/D/CK/CD/A/NK/TK/RK/CK %d/%u/%u/%u/%u/%u/%u/%u/%u/%u/%u/%u",Score,TotalWins,TotalLosses,TotalKills,TotalDeaths,TotalCreepKills,TotalCreepDenies,TotalAssists,TotalNeutralKills,TotalTowerKills,TotalRaxKills,TotalCourierKills); message_send_text(c,message_type_info,c,msgtemp); return 0; } else { // Return this when there are no games found for this user. message_send_text(c,message_type_error,c,"No Game"); return 0; } } } } else { snprintf(msgtemp, sizeof(msgtemp), "User was not found : %s",text); message_send_text(c,message_type_error,c,msgtemp); return 0; } message_send_text(c,message_type_error,c,"User was not found : %s",text); return 0; }
посмотри внимательней никнейм пользователя создавшего тему и отпостившего 1й пост в этой теме... наши никнейм настолько похожи?