亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? anongame_gameresult.c

?? 打魔獸戰(zhàn)網(wǎng)的都知道他是什么
?? C
字號:
/* * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA. */#include "common/setup_before.h"#ifdef STDC_HEADERS# include <stdlib.h>#else# ifdef HAVE_MALLOC_H#  include <malloc.h># endif#endif#ifdef HAVE_STRING_H# include <string.h>#else# ifdef HAVE_STRINGS_H#  include <strings.h># endif#endif#include "compat/strrchr.h"#include <errno.h>#include "compat/strerror.h"#include "common/list.h"#include "common/eventlog.h"#include "common/util.h"#include "common/packet.h"#include "common/tag.h"#include "common/bn_type.h"#include "common/packet.h"#ifdef HAVE_ASSERT_H# include <assert.h>#endif#include "common/xalloc.h"#define ANONGAME_GAMERESULT_INTERNAL_ACCESS#include "anongame_gameresult.h"#include "common/setup_after.h"extern int gameresult_destroy(t_anongame_gameresult * gameresult){  if (!(gameresult))  {    eventlog(eventlog_level_error,__FUNCTION__,"got NULL gameresult");    return -1;  }  if ((gameresult->players)) xfree((void *)gameresult->players);  if ((gameresult->heroes)) xfree((void *)gameresult->heroes);  xfree((void *)gameresult);  return 0;}extern t_anongame_gameresult * anongame_gameresult_parse(t_packet const * const packet){  t_anongame_gameresult 			* gameresult;  t_client_w3route_gameresult_player 		* player;  t_client_w3route_gameresult_part2 		* part2;  t_client_w3route_gameresult_hero		* hero;  t_client_w3route_gameresult_part3		* part3;  int counter, heroes_count;  int expectedsize;  //still without hero infos   unsigned int offset = 0;  int result_count = bn_byte_get(packet->u.client_w3route_gameresult.number_of_results);  expectedsize =  sizeof(t_client_w3route_gameresult) +   		  sizeof(t_client_w3route_gameresult_player) * result_count +		  sizeof(t_client_w3route_gameresult_part2) +		  sizeof(t_client_w3route_gameresult_part3);  if (packet_get_size(packet) < expectedsize)  {	eventlog(eventlog_level_error,__FUNCTION__,"gameresult packet is smaller than expected");	return NULL;  }  gameresult = xmalloc(sizeof(t_anongame_gameresult));  gameresult->players = xmalloc(sizeof(t_anongame_player)*result_count);  gameresult->number_of_results = result_count;  offset+= sizeof(t_client_w3route_gameresult);  for (counter=0; counter<result_count;counter++)  {    player = (t_client_w3route_gameresult_player *)packet_get_raw_data_const(packet,offset);    gameresult->players[counter].number = bn_byte_get(player->number);    gameresult->players[counter].result = bn_int_get(player->result);    gameresult->players[counter].race   = bn_int_get(player->race);    offset+= sizeof(t_client_w3route_gameresult_player);  }  part2 = (t_client_w3route_gameresult_part2 *)packet_get_raw_data_const(packet,offset);  gameresult->unit_score 		= bn_int_get(part2->unit_score);  gameresult->heroes_score 		= bn_int_get(part2->heroes_score);  gameresult->resource_score 		= bn_int_get(part2->resource_score);  gameresult->units_produced 		= bn_int_get(part2->units_produced);  gameresult->units_killed 		= bn_int_get(part2->units_killed);  gameresult->buildings_produced 	= bn_int_get(part2->buildings_produced);  gameresult->buildings_razed 		= bn_int_get(part2->buildings_razed);  gameresult->largest_army 		= bn_int_get(part2->largest_army);  heroes_count 				= bn_int_get(part2->heroes_used_count);  gameresult->heroes_used_count 	= heroes_count;  offset+= sizeof(t_client_w3route_gameresult_part2);  if ((heroes_count))  {    gameresult->heroes = xmalloc(sizeof(t_anongame_hero)*heroes_count);    if (packet_get_size(packet) < expectedsize + sizeof(t_client_w3route_gameresult_hero)*heroes_count)    {	eventlog(eventlog_level_error,__FUNCTION__,"gameresult packet is smaller than expected");	return NULL;    }    for (counter=0; counter < heroes_count; counter++)    {      hero = (t_client_w3route_gameresult_hero *)packet_get_raw_data_const(packet,offset);      gameresult->heroes[counter].level = bn_int_get(hero->level);      gameresult->heroes[counter].race_and_name = bn_int_get(hero->race_and_name);      gameresult->heroes[counter].hero_xp = bn_int_get(hero->hero_xp);      offset+= sizeof(t_client_w3route_gameresult_hero);    }  }  else    gameresult->heroes = NULL;      part3 = (t_client_w3route_gameresult_part3 *)packet_get_raw_data_const(packet,offset);  gameresult->heroes_killed = bn_int_get(part3->heroes_killed);  gameresult->items_obtained = bn_int_get(part3->items_obtained);  gameresult->mercenaries_hired = bn_int_get(part3->mercenaries_hired);  gameresult->total_hero_xp = bn_int_get(part3->total_hero_xp);  gameresult->gold_mined = bn_int_get(part3->gold_mined);  gameresult->lumber_harvested = bn_int_get(part3->lumber_harvested);  gameresult->resources_traded_given = bn_int_get(part3->resources_traded_given);  gameresult->resources_traded_taken = bn_int_get(part3->resources_traded_taken);  gameresult->tech_percentage = bn_int_get(part3->tech_percentage);  gameresult->gold_lost_to_upkeep = bn_int_get(part3->gold_lost_to_upkeep);    return gameresult;}extern char gameresult_get_number_of_results(t_anongame_gameresult * gameresult){  assert(gameresult);  return gameresult->number_of_results;}extern int gameresult_get_player_result(t_anongame_gameresult * gameresult, int player){  if (!(gameresult))    return -1;  if (player >= gameresult->number_of_results)  {    eventlog(eventlog_level_error,__FUNCTION__,"request for invalid player number");    return -1;  }  return gameresult->players[player].result;}extern int gameresult_get_player_number(t_anongame_gameresult * gameresult, int player){  if (!(gameresult))    return -1;  if (player >= gameresult->number_of_results)  {    eventlog(eventlog_level_error,__FUNCTION__,"request for invalid player number");    return -1;  }  return gameresult->players[player].number;}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美影院一区二区三区| 亚洲精品乱码久久久久久黑人| 国产视频一区二区三区在线观看 | 99精品视频一区二区三区| 欧美日韩精品一区二区三区| 国产女主播一区| 久久精品久久久精品美女| 一本久久综合亚洲鲁鲁五月天| 日韩欧美国产不卡| 亚洲高清三级视频| av影院午夜一区| 欧美成人一区二区三区片免费 | 欧美日韩不卡一区二区| 中文字幕亚洲欧美在线不卡| 久久精品久久久精品美女| 欧美日韩一级大片网址| 亚洲精品国久久99热| 岛国精品一区二区| 久久综合av免费| 麻豆精品视频在线观看| 91精品一区二区三区久久久久久| 亚洲精品一二三| 91免费在线播放| 国产精品情趣视频| 懂色av一区二区在线播放| 精品日韩在线一区| 另类欧美日韩国产在线| 91麻豆精品国产91久久久久久| 夜色激情一区二区| 欧美午夜精品久久久| 亚洲成人动漫在线免费观看| 色香色香欲天天天影视综合网| 亚洲人成伊人成综合网小说| 成人毛片在线观看| 国产精品理伦片| 99久久精品国产导航| |精品福利一区二区三区| 不卡电影一区二区三区| ...中文天堂在线一区| 91麻豆文化传媒在线观看| 亚洲精品ww久久久久久p站| 在线欧美一区二区| 香港成人在线视频| 日韩午夜精品视频| 国产综合色产在线精品| 国产日韩欧美在线一区| 97精品国产露脸对白| 亚洲综合视频网| 日韩一区二区三区四区| 韩国女主播一区| 中文字幕一区二区在线播放| 色素色在线综合| 日韩av不卡一区二区| 久久久99精品久久| 99久久99久久综合| 亚洲国产va精品久久久不卡综合| 欧美一区二区三区精品| 国产精品1区二区.| 一区二区日韩av| 精品国产亚洲在线| 91毛片在线观看| 蜜臀精品久久久久久蜜臀| 国产精品水嫩水嫩| 欧美三级日本三级少妇99| 六月婷婷色综合| 亚洲欧美乱综合| 日韩欧美成人激情| av高清不卡在线| 免费在线观看视频一区| 国产亚洲欧美在线| 欧美系列日韩一区| 国产激情一区二区三区四区 | 91精品免费观看| 春色校园综合激情亚洲| 亚洲午夜久久久久久久久久久| 欧美v日韩v国产v| 91网址在线看| 韩国av一区二区三区| 亚洲电影欧美电影有声小说| 精品国产污污免费网站入口| 91国偷自产一区二区三区观看 | 天天色综合成人网| 国产精品蜜臀av| 日韩欧美国产三级| 91激情在线视频| 成人教育av在线| 久草中文综合在线| 婷婷夜色潮精品综合在线| 国产喂奶挤奶一区二区三区| 欧美一区二区大片| 欧美在线免费观看亚洲| 成人18视频在线播放| 久久99久久99| 日韩精品电影在线观看| 1024精品合集| 国产精品国产三级国产| 精品少妇一区二区三区在线播放| 欧美日本国产一区| 99在线视频精品| 国产成人久久精品77777最新版本| 日韩国产在线一| 午夜视黄欧洲亚洲| 亚洲一区二区三区四区在线 | 91女神在线视频| 成人性生交大合| 国产成人a级片| 久久国产尿小便嘘嘘尿| 秋霞午夜鲁丝一区二区老狼| 亚洲 欧美综合在线网络| 亚洲三级在线免费| 亚洲欧洲99久久| 最新不卡av在线| 亚洲欧洲三级电影| 亚洲人xxxx| 亚洲精选视频在线| 一区二区日韩av| 亚洲电影激情视频网站| 日韩国产一区二| 日韩黄色一级片| 老司机免费视频一区二区三区| 人人超碰91尤物精品国产| 美女精品自拍一二三四| 国产一区二区日韩精品| 九九九久久久精品| 国产精一品亚洲二区在线视频| 国产精品一级黄| 成人av第一页| 欧洲亚洲精品在线| 欧美一区二区在线不卡| 日韩欧美国产1| 国产欧美日韩三区| 亚洲色图.com| 五月综合激情婷婷六月色窝| 免费成人在线影院| 国内国产精品久久| 99久久精品免费精品国产| 色综合一个色综合亚洲| 7777精品久久久大香线蕉 | 一本色道综合亚洲| 欧美日韩色综合| 精品成人佐山爱一区二区| 国产欧美一区二区精品婷婷 | 欧洲一区二区av| 日韩你懂的在线播放| 国产精品福利在线播放| 午夜精品福利一区二区三区av| 黄色精品一二区| 色综合久久久久久久| 欧美一级在线观看| 亚洲欧洲美洲综合色网| 日韩影院免费视频| av影院午夜一区| 精品理论电影在线观看 | 国产精品卡一卡二| 午夜视频在线观看一区二区| 国产福利精品导航| 欧美高清一级片在线| 中文字幕精品三区| 日本不卡中文字幕| 91麻豆精东视频| 久久众筹精品私拍模特| 一区二区三区小说| 国内精品国产三级国产a久久| 99精品久久久久久| 欧美精品xxxxbbbb| 亚洲欧美综合网| 久久国产尿小便嘘嘘| av电影在线观看一区| 亚洲精品在线网站| 亚洲精品国产品国语在线app| 日日夜夜精品免费视频| 99视频国产精品| 欧美一区二区免费视频| 国产欧美日韩在线视频| 亚洲成av人片在www色猫咪| 91视频观看视频| 精品国产乱码久久久久久免费| 国产精品久久久久影院| 亚洲精品欧美二区三区中文字幕| 经典三级在线一区| 在线观看成人小视频| 国产拍欧美日韩视频二区| 国产一区二区在线视频| 欧美日韩一区二区三区四区| 日本一区二区三区视频视频| 亚洲午夜视频在线| 在线国产电影不卡| 日本一区二区三区在线不卡| 日本美女一区二区| 欧美一区二区三区电影| 夜夜夜精品看看| 成人高清免费在线播放| 中文字幕欧美国产| 国产一区视频在线看| 7777精品伊人久久久大香线蕉超级流畅 | 国产女主播视频一区二区| 日日摸夜夜添夜夜添亚洲女人| 91蜜桃视频在线| 中文字幕欧美国产| 亚洲国产精品一区二区久久|