Topic: bnproxy + stats
Привет всем
пытался сделай статистику при заходе в игру
в game.cpp -> game_add_player
t_account * account;
account = conn_get_account(c);
t_connection * user;
game=conn_get_game(c);
char * dotastats = new char[ MAX_MESSAGE_LEN ];
char * dotastats2 = new char[ MAX_MESSAGE_LEN ];
snprintf(dotastats, MAX_MESSAGE_LEN, "Joined ladder game. Game owner is Unknown");
message_send_text(c,message_type_info,c, dotastats);
for (i=0; i<game_get_count(game); i++)
{
if (user = game_get_player_conn(game, i))
{
if (user)
snprintf(dotastats2, MAX_MESSAGE_LEN, "%s Dota(5x5):[%s] %s pts W/L: %s%s%s",conn_get_username(c),account_get_drank(account),account_get_pts(account),account_get_wins(account),account_get_losses(account),account_get_winrate(account));
message_send_text(user,message_type_info,user, dotastats2);
}
}
и в handle_bnet.cpp -> client_joingame
unsigned int i;
t_connection * user;
if ((game=conn_get_game(c)))
{
for (i=0; i<game_get_count(game); i++)
{
if ((user = game_get_player_conn(game, i)))
{
char * dotastats = new char[ MAX_MESSAGE_LEN ];
t_account * myacc;
myacc = conn_get_account(user);
snprintf( dotastats , MAX_MESSAGE_LEN , "%s Dota(5x5):[%s] %s pts W/L: %s%s%s",account_get_name(myacc),account_get_drank(myacc),account_get_pts(myacc),account_get_wins(myacc),account_get_losses(myacc),account_get_winrate(myacc));
message_send_text(c,message_type_info,c,dotastats);
}
}
}
при заходе игру в чате всё норм но в bnproxy не показывает статы