コード例 #1
0
		extern int handle_anongame_packet(t_connection * c, t_packet const * const packet)
		{
			switch (bn_byte_get(packet->u.client_anongame.option))
			{
			case CLIENT_FINDANONGAME_PROFILE:
				return _client_anongame_profile(c, packet);

			case CLIENT_FINDANONGAME_CANCEL:
				return _client_anongame_cancel(c);

			case CLIENT_FINDANONGAME_SEARCH:
			case CLIENT_FINDANONGAME_AT_INVITER_SEARCH:
			case CLIENT_FINDANONGAME_AT_SEARCH:
				return handle_anongame_search(c, packet); /* located in anongame.c */

			case CLIENT_FINDANONGAME_GET_ICON:
				return _client_anongame_get_icon(c, packet);

			case CLIENT_FINDANONGAME_SET_ICON:
				return _client_anongame_set_icon(c, packet);

			case CLIENT_FINDANONGAME_INFOS:
				return _client_anongame_infos(c, packet);

			case CLIENT_ANONGAME_TOURNAMENT:
				return _client_anongame_tournament(c, packet);

			case CLIENT_FINDANONGAME_PROFILE_CLAN:
				return _client_anongame_profile_clan(c, packet);

			default:
				eventlog(eventlog_level_error, __FUNCTION__, "got unhandled option %d", bn_byte_get(packet->u.client_findanongame.option));
				return -1;
			}
		}
コード例 #2
0
ファイル: handle_anongame.cpp プロジェクト: soarqin/pvpgn
extern int handle_anongame_search(t_connection * c, t_packet const *packet)
{
    if (account_get_auth_ladderban(conn_get_account(c))==1)
    {
        message_send_text(c,message_type_error,c,"Sorry, the following option is no longer available for your account.");
        return _client_anongame_cancel(c);
    }

    if (conn_get_latency(c) > 300) //todo: pick not allowed ping
    {
        message_send_text(c,message_type_error,c,"Your ping is too high, Please try again later.");
        return _client_anongame_cancel(c);
    }

    return _handle_anongame_search(c, packet);
}