| 283 |
unsigned int seqno, reply; |
unsigned int seqno, reply; |
| 284 |
unsigned int pos; |
unsigned int pos; |
| 285 |
t_elem * elem; |
t_elem * elem; |
|
char checksum_con; |
|
| 286 |
|
|
| 287 |
|
|
| 288 |
|
|
| 302 |
return -1; |
return -1; |
| 303 |
} |
} |
| 304 |
|
|
|
/* get checknum from client, by sowater */ |
|
|
checksum_con=d2cs_conn_get_checknum(c); |
|
|
|
|
|
|
|
| 305 |
tempflag=bn_int_get(packet->u.client_d2cs_creategamereq.gameflag); |
tempflag=bn_int_get(packet->u.client_d2cs_creategamereq.gameflag); |
| 306 |
leveldiff=bn_byte_get(packet->u.client_d2cs_creategamereq.leveldiff); |
leveldiff=bn_byte_get(packet->u.client_d2cs_creategamereq.leveldiff); |
| 307 |
maxchar=bn_byte_get(packet->u.client_d2cs_creategamereq.maxchar); |
maxchar=bn_byte_get(packet->u.client_d2cs_creategamereq.maxchar); |
| 324 |
reply=D2CS_CLIENT_CREATEGAMEREPLY_NAME_EXIST; |
reply=D2CS_CLIENT_CREATEGAMEREPLY_NAME_EXIST; |
| 325 |
|
|
| 326 |
/* right checknum? sowater */ |
/* right checknum? sowater */ |
| 327 |
} else if((*gamedesc!=checksum_con) && (prefs_antibot_when_password()==0) && prefs_enable_antibot()) { |
} else if((prefs_antibot_when_password()==0) && prefs_enable_antibot() && d2cs_conn_verify_checknum(c, *gamedesc)) { |
| 328 |
eventlog(eventlog_level_info,__FUNCTION__,"checksum %c from packet not match checksum %c from connection",*gamedesc,checksum_con); |
eventlog(eventlog_level_info,__FUNCTION__,"checksum %c from packet not match checksum from connection",*gamedesc); |
| 329 |
reply=D2CS_CLIENT_CREATEGAMEREPLY_FAILED; |
reply=D2CS_CLIENT_CREATEGAMEREPLY_FAILED; |
| 330 |
/* when antibot_when_password is true, by sowater, 20051001 */ |
/* when antibot_when_password is true, by sowater, 20051001 */ |
| 331 |
} else if((*gamedesc!=checksum_con) && (strlen(gamepass)!=0) && prefs_antibot_when_password() |
} else if((strlen(gamepass)!=0) && prefs_antibot_when_password() && prefs_enable_antibot() |
| 332 |
&& prefs_enable_antibot()) { |
&& d2cs_conn_verify_checknum(c, *gamedesc)) { |
| 333 |
eventlog(eventlog_level_info,__FUNCTION__,"checksum %c from packet not match checksum %c from connection",*gamedesc,checksum_con); |
eventlog(eventlog_level_info,__FUNCTION__,"checksum %c from packet not match checksum from connection",*gamedesc); |
| 334 |
reply=D2CS_CLIENT_CREATEGAMEREPLY_FAILED; |
reply=D2CS_CLIENT_CREATEGAMEREPLY_FAILED; |
| 335 |
} else if (!gq && gqlist_find_game(gamename)) { |
} else if (!gq && gqlist_find_game(gamename)) { |
| 336 |
eventlog(eventlog_level_info,__FUNCTION__,"game name %s is already exist in game queue",gamename); |
eventlog(eventlog_level_info,__FUNCTION__,"game name %s is already exist in game queue",gamename); |