?? bnstat.c
字號:
else temp = ""; j++; if (bnettime_set_str(&bntime,temp)<0) strcpy(timestr,"NEVER"); else { tm = bnettime_to_time(bntime); strftime(timestr,STAT_TIME_MAXLEN,STAT_TIME_FORMAT,localtime(&tm)); } printf(" Last game time: %s\n",timestr); if (j<keys && (temp = packet_get_str_const(rpacket,strpos,256))) strpos += strlen(temp)+1; else temp = ""; j++; printf(" Last game result: %s\n",temp); if (j<keys && (temp = packet_get_str_const(rpacket,strpos,256))) strpos += strlen(temp)+1; else temp = ""; j++; if (str_to_uint(temp,&wins)<0) wins = 0; if (j<keys && (temp = packet_get_str_const(rpacket,strpos,256))) strpos += strlen(temp)+1; else temp = ""; j++; if (str_to_uint(temp,&losses)<0) losses = 0; if (j<keys && (temp = packet_get_str_const(rpacket,strpos,256))) strpos += strlen(temp)+1; else temp = ""; j++; if (str_to_uint(temp,&disconnects)<0) disconnects = 0; if (j<keys && (temp = packet_get_str_const(rpacket,strpos,256))) strpos += strlen(temp)+1; else temp = ""; j++; if (str_to_uint(temp,&draws)<0) draws = 0; printf(" Record: (%u/%u/%u) %u draws\n",wins,losses,disconnects,draws); } if (strcmp(clienttag,"STAR")==0 || strcmp(clienttag,"SEXP")==0 || strcmp(clienttag,"W2BN")==0) { t_bnettime bntime; unsigned int wins,losses,disconnects,draws; unsigned int rating,rank; unsigned int active_rating,active_rank; unsigned int high_rating,high_rank; if (j<keys && (temp = packet_get_str_const(rpacket,strpos,256))) strpos += strlen(temp)+1; else temp = ""; j++; if (bnettime_set_str(&bntime,temp)<0) strcpy(timestr,"NEVER"); else { tm = bnettime_to_time(bntime); strftime(timestr,STAT_TIME_MAXLEN,STAT_TIME_FORMAT,localtime(&tm)); } printf(" Last standard ladder game time: %s\n",timestr); if (j<keys && (temp = packet_get_str_const(rpacket,strpos,256))) strpos += strlen(temp)+1; else temp = ""; j++; printf("Last standard ladder game result: %s\n",temp); if (j<keys && (temp = packet_get_str_const(rpacket,strpos,256))) strpos += strlen(temp)+1; else temp = ""; j++; if (str_to_uint(temp,&rating)<0) rating = 0; if (rating) printf(" Current standard ladder rating: %u\n",rating); else printf(" Current standard ladder rating: UNRATED\n"); if (j<keys && (temp = packet_get_str_const(rpacket,strpos,256))) strpos += strlen(temp)+1; else temp = ""; j++; if (str_to_uint(temp,&active_rating)<0) active_rating = 0; if (active_rating) printf(" Active standard ladder rating: %u\n",active_rating); else printf(" Active standard ladder rating: UNRATED\n"); if (j<keys && (temp = packet_get_str_const(rpacket,strpos,256))) strpos += strlen(temp)+1; else temp = ""; j++; if (str_to_uint(temp,&high_rating)<0) high_rating = 0; if (high_rating) printf(" High standard ladder rating: %u\n",high_rating); else printf(" High standard ladder rating: UNRATED\n"); if (j<keys && (temp = packet_get_str_const(rpacket,strpos,256))) strpos += strlen(temp)+1; else temp = ""; j++; if (str_to_uint(temp,&rank)<0) rank = 0; if (rank) printf(" Current standard ladder rank: #%u\n",rank); else printf(" Current standard ladder rank: UNRANKED\n"); if (j<keys && (temp = packet_get_str_const(rpacket,strpos,256))) strpos += strlen(temp)+1; else temp = ""; j++; if (str_to_uint(temp,&active_rank)<0) active_rank = 0; if (active_rank) printf(" Active standard ladder rank: #%u\n",active_rank); else printf(" Active standard ladder rank: UNRANKED\n"); if (j<keys && (temp = packet_get_str_const(rpacket,strpos,256))) strpos += strlen(temp)+1; else temp = ""; j++; if (str_to_uint(temp,&high_rank)<0) high_rank = 0; if (high_rank) printf(" High standard ladder rank: #%u\n",high_rank); else printf(" High standard ladder rank: UNRANKED\n"); if (j<keys && (temp = packet_get_str_const(rpacket,strpos,256))) strpos += strlen(temp)+1; else temp = ""; j++; if (str_to_uint(temp,&wins)<0) wins = 0; if (j<keys && (temp = packet_get_str_const(rpacket,strpos,256))) strpos += strlen(temp)+1; else temp = ""; j++; if (str_to_uint(temp,&losses)<0) losses = 0; if (j<keys && (temp = packet_get_str_const(rpacket,strpos,256))) strpos += strlen(temp)+1; else temp = ""; j++; if (str_to_uint(temp,&disconnects)<0) disconnects = 0; if (j<keys && (temp = packet_get_str_const(rpacket,strpos,256))) strpos += strlen(temp)+1; else temp = ""; j++; if (str_to_uint(temp,&draws)<0) draws = 0; printf(" Standard ladder record: (%u/%u/%u) %u draws\n",wins,losses,disconnects,draws); } if (strcmp(clienttag,"W2BN")==0) { t_bnettime bntime; unsigned int wins,losses,disconnects,draws; unsigned int rating,rank; unsigned int active_rating,active_rank; unsigned int high_rating,high_rank; if (j<keys && (temp = packet_get_str_const(rpacket,strpos,256))) strpos += strlen(temp)+1; else temp = ""; j++; if (bnettime_set_str(&bntime,temp)<0) strcpy(timestr,"NEVER"); else { tm = bnettime_to_time(bntime); strftime(timestr,STAT_TIME_MAXLEN,STAT_TIME_FORMAT,localtime(&tm)); } printf(" Last Ironman ladder game time: %s\n",timestr); if (j<keys && (temp = packet_get_str_const(rpacket,strpos,256))) strpos += strlen(temp)+1; else temp = ""; j++; printf(" Last Ironman ladder game result: %s\n",temp); if (j<keys && (temp = packet_get_str_const(rpacket,strpos,256))) strpos += strlen(temp)+1; else temp = ""; j++; if (str_to_uint(temp,&rating)<0) rating = 0; if (rating) printf(" Current Ironman ladder rating: %u\n",rating); else printf(" Current Ironman ladder rating: UNRATED\n"); if (j<keys && (temp = packet_get_str_const(rpacket,strpos,256))) strpos += strlen(temp)+1; else temp = ""; j++; if (str_to_uint(temp,&active_rating)<0) active_rating = 0; if (active_rating) printf(" Active Ironman ladder rating: %u\n",active_rating); else printf(" Active Ironman ladder rating: UNRATED\n"); if (j<keys && (temp = packet_get_str_const(rpacket,strpos,256))) strpos += strlen(temp)+1; else temp = ""; j++; if (str_to_uint(temp,&high_rating)<0) high_rating = 0; if (high_rating) printf(" High Ironman ladder rating: %u\n",high_rating); else printf(" High Ironman ladder rating: UNRATED\n"); if (j<keys && (temp = packet_get_str_const(rpacket,strpos,256))) strpos += strlen(temp)+1; else temp = ""; j++; if (str_to_uint(temp,&rank)<0) rank = 0; if (rank) printf(" Current Ironman ladder rank: #%u\n",rank); else printf(" Current Ironman ladder rank: UNRANKED\n"); if (j<keys && (temp = packet_get_str_const(rpacket,strpos,256))) strpos += strlen(temp)+1; else temp = ""; j++; if (str_to_uint(temp,&active_rank)<0) active_rank = 0; if (active_rank) printf(" Active Ironman ladder rank: #%u\n",active_rank); else printf(" Active Ironman ladder rank: UNRANKED\n"); if (j<keys && (temp = packet_get_str_const(rpacket,strpos,256))) strpos += strlen(temp)+1; else temp = ""; j++; if (str_to_uint(temp,&high_rank)<0) high_rank = 0; if (high_rank) printf(" High Ironman ladder rank: #%u\n",high_rank); else printf(" High Ironman ladder rank: UNRANKED\n"); if (j<keys && (temp = packet_get_str_const(rpacket,strpos,256))) strpos += strlen(temp)+1; else temp = ""; j++; if (str_to_uint(temp,&wins)<0) wins = 0; if (j<keys && (temp = packet_get_str_const(rpacket,strpos,256))) strpos += strlen(temp)+1; else temp = ""; j++; if (str_to_uint(temp,&losses)<0) losses = 0; if (j<keys && (temp = packet_get_str_const(rpacket,strpos,256))) strpos += strlen(temp)+1; else temp = ""; j++; if (str_to_uint(temp,&disconnects)<0) disconnects = 0; if (j<keys && (temp = packet_get_str_const(rpacket,strpos,256))) strpos += strlen(temp)+1; else temp = ""; j++; if (str_to_uint(temp,&draws)<0) draws = 0; printf(" Ironman ladder record: (%u/%u/%u) %u draws\n",wins,losses,disconnects,draws); } if (strcmp(clienttag,"DSHR")==0 || strcmp(clienttag,"DRTL")==0) { unsigned int level; unsigned int class; unsigned int diablo_kills; unsigned int strength; unsigned int magic; unsigned int dexterity; unsigned int vitality; unsigned int gold; if (use_bnetd) { if (j<keys && (temp = packet_get_str_const(rpacket,strpos,256))) strpos += strlen(temp)+1; else temp = ""; j++; if (str_to_uint(temp,&level)<0) level = 0; if (level>0) printf(" Level: %u\n",level); else printf(" Level: NONE\n"); if (j<keys && (temp = packet_get_str_const(rpacket,strpos,256))) strpos += strlen(temp)+1; else temp = ""; j++; if (str_to_uint(temp,&class)<0) class = 99; printf(" Class: %s\n",bnclass_get_str(class)); if (j<keys && (temp = packet_get_str_const(rpacket,strpos,256))) strpos += strlen(temp)+1; else temp = ""; j++; if (str_to_uint(temp,&strength)<0) strength = 0; if (j<keys && (temp = packet_get_str_const(rpacket,strpos,256))) strpos += strlen(temp)+1; else temp = ""; j++; if (str_to_uint(temp,&magic)<0) magic = 0; if (j<keys && (temp = packet_get_str_const(rpacket,strpos,256))) strpos += strlen(temp)+1; else temp = ""; j++; if (str_to_uint(temp,&dexterity)<0) dexterity = 0; if (j<keys && (temp = packet_get_str_const(rpacket,strpos,256))) strpos += strlen(temp)+1; else temp = ""; j++; if (str_to_uint(temp,&vitality)<0) vitality = 0; if (j<keys && (temp = packet_get_str_const(rpacket,strpos,256))) strpos += strlen(temp)+1; else temp = ""; j++; if (str_to_uint(temp,&gold)<0) gold = 0; printf(" Stats: %u str %u mag %u dex %u vit %u gld\n", strength, magic, dexterity, vitality, gold); if (j<keys && (temp = packet_get_str_const(rpacket,strpos,256))) strpos += strlen(temp)+1; else temp = ""; j++; if (str_to_uint(temp,&diablo_kills)<0) diablo_kills = 0; printf(" Diablo Kills: %u\n",diablo_kills); } } } printf("----\n"); } if (gotplayer) break; commpos = 0; text[0] = '\0'; } psock_close(sd); if (changed_in) tcsetattr(fd_stdin,TCSAFLUSH,&in_attr_old); return STATUS_SUCCESS;}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -