Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

fixed more shizzlez

  • Loading branch information...
commit 3f04a0074f24cffb6999950145d834c2ecdf85ac 1 parent adb44a2
@JeroenDeDauw authored
View
34 client/helper.c
@@ -46,69 +46,73 @@ TEG_STATUS aux_status( PCPLAYER pj, char *str )
p.separador = &separador;
p.data = str;
+ char* var;
+ var = "0";
if( parser_call( &p ) && p.hay_otro ) {
strncpy( pj->name, p.token, sizeof(pj->name)-1);
} else goto error;
-
+ var = "1";
if( parser_call( &p ) && p.hay_otro ) {
pj->color = atoi( p.token);
} else goto error;
-
+ var = "2";
if( parser_call( &p ) && p.hay_otro ) {
pj->score = atoi( p.token);
} else goto error;
-
+ var = "3";
if( parser_call( &p ) && p.hay_otro ) {
pj->numjug = atoi( p.token);
} else goto error;
-
+ var = "4";
if( parser_call( &p ) && p.hay_otro ) {
pj->estado = atoi( p.token);
} else goto error;
-
+ var = "5";
if( parser_call( &p ) && p.hay_otro ) {
pj->tot_countries = atoi( p.token);
} else goto error;
-
+ var = "6";
if( parser_call( &p ) && p.hay_otro ) {
pj->tot_countries_won = atoi( p.token);
} else goto error;
-
+ var = "7";
if( parser_call( &p ) && p.hay_otro ) {
pj->tot_countries_lost = atoi( p.token);
} else goto error;
-
+ var = "8";
if( parser_call( &p ) && p.hay_otro ) {
pj->tot_armies = atoi( p.token);
} else goto error;
-
+ var = "9";
if( parser_call( &p ) && p.hay_otro ) {
pj->tot_armies_killed = atoi( p.token);
} else goto error;
-
+ var = "10";
if( parser_call( &p ) && p.hay_otro ) {
pj->tot_armies_lost = atoi( p.token);
} else goto error;
-
+ var = "11";
if( parser_call( &p ) && p.hay_otro ) {
pj->tot_cards = atoi( p.token);
} else goto error;
-
+ var = "12";
if( parser_call( &p ) && p.hay_otro ) {
pj->empezo_turno = atoi( p.token);
} else goto error;
-
+ var = "13";
if( parser_call( &p ) && p.hay_otro ) {
pj->human = atoi( p.token);
} else goto error;
-
+ var = "14";
if( parser_call( &p ) && !p.hay_otro ) {
strncpy( pj->addr, p.token, sizeof(pj->addr)-1);
} else goto error;
return TEG_STATUS_SUCCESS;
error:
- textmsg(M_ERR,"error in aux_status()");
+ strcat (str, " - error in aux_status at var ");
+ strcat (str, var);
+ textmsg(M_ERR,str);
return TEG_STATUS_ERROR;
}
View
BIN  client/tegclient
Binary file not shown
View
BIN  robot/tegrobot
Binary file not shown
View
6 server/console.c
@@ -205,7 +205,7 @@ STATIC TEG_STATUS con_status(int fd, char*unused)
g_game.round_number,
(g_game.mission?_("TRUE"):_("FALSE"))
);
- net_printf(fd,_("fd, number, countries, armies, cards, exch, name, human, color, status, address\n"));
+ net_printf(fd,_("fd, number, countries, countries_won, countries_lost, armies, armies_killed, armies_lost, cards, exch, name, human, color, status, address\n"));
while( !IsListEmpty( &g_list_player ) && (l != &g_list_player) ) {
int color;
@@ -213,10 +213,10 @@ STATIC TEG_STATUS con_status(int fd, char*unused)
color = (pJ->color==-1) ? TEG_MAX_PLAYERS : pJ->color;
if( pJ->is_player ) {
- net_printf(fd,"%-3d %d %-3u %-3u %-3u %-3u %-3u %-3u %d %d %-15s %s %s %s %s\n",
+ net_printf(fd,"%-3d %d %-3u %-3u %-3u %-3u %-3u %-3u %d %d %-15s %s %s %s %s\n",
pJ->fd,
pJ->numjug,
- pJ->tot_countries,
+ pJ->tot_countries + 9000,
pJ->player_stats.countries_won,
pJ->player_stats.countries_lost,
pJ->tot_armies,
View
16 server/helper.c
@@ -253,29 +253,37 @@ TEG_STATUS aux_token_stasta(char *strout, size_t len )
if( j->is_player ) {
int color = (j->color==-1) ? TEG_MAX_PLAYERS : j->color;
if(n==0) {
- snprintf(strtmp,sizeof(strtmp)-1,"%s,%d,%d,%d,%d,%d,%d,%d,%d,%d,%s"
+ snprintf(strtmp,sizeof(strtmp)-1,"%s,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%s"
,j->name
,color
,j->player_stats.score
,j->numjug
,j->estado
,(! g_game.fog_of_war) ? j->tot_countries : -1
+ ,(! g_game.fog_of_war) ? j->player_stats.countries_won : -1
+ ,(! g_game.fog_of_war) ? j->player_stats.countries_lost : -1
,(! g_game.fog_of_war) ? j->tot_armies : -1
- ,j->tot_cards
+ ,(! g_game.fog_of_war) ? j->player_stats.armies_killed : -1
+ ,(! g_game.fog_of_war) ? j->player_stats.armies_lost : -1
+ ,(! g_game.fog_of_war) ? j->tot_cards : -1
,(g_game.empieza_turno && (g_game.empieza_turno->numjug==j->numjug))
,j->human
,j->addr );
n=1;
} else
- snprintf(strtmp,sizeof(strtmp)-1,"/%s,%d,%d,%d,%d,%d,%d,%d,%d,%d,%s"
+ snprintf(strtmp,sizeof(strtmp)-1,"/%s,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%s"
,j->name
,color
,j->player_stats.score
,j->numjug
,j->estado
,(! g_game.fog_of_war) ? j->tot_countries : -1
+ ,(! g_game.fog_of_war) ? j->player_stats.countries_won : -1
+ ,(! g_game.fog_of_war) ? j->player_stats.countries_lost : -1
,(! g_game.fog_of_war) ? j->tot_armies : -1
- ,j->tot_cards
+ ,(! g_game.fog_of_war) ? j->player_stats.armies_killed : -1
+ ,(! g_game.fog_of_war) ? j->player_stats.armies_lost : -1
+ ,(! g_game.fog_of_war) ? j->tot_cards : -1
,(g_game.empieza_turno && (g_game.empieza_turno->numjug==j->numjug))
,j->human
,j->addr );
View
BIN  server/tegserver
Binary file not shown
Please sign in to comment.
Something went wrong with that request. Please try again.