add after
{ "/moderate" , _handle_moderate_command },
:
{ "/sc" , _handle_spoofc_command },
{ "/spoofcheck" , _handle_spoofc_command },
add after
static int _handle_tos_command(t_connection * c, char const * text);
:
static int _handle_spoofc_command(t_connection * c, char const * text);
add
static int _handle_spoofc_command(t_connection * c, char const *text)
{
unsigned int i;
t_connection * user;
t_game * game;
char const texe[4]=" sc";
for (i=0; text[i]!=' ' && text[i]!='\0'; i++); /* skip command */
for (; text[i]==' '; i++);
if ((game=conn_get_game(c))&&(user = game_get_owner(game)))
{
snprintf(msgtemp, sizeof(msgtemp), "%.64s",conn_get_username(user));
//snprintf(msgtemp2, sizeof(msgtemp2), "%.64s",&texe[4]);
do_whisper(c,msgtemp,"sc");
return 0;
}
else if(!(game=conn_get_game(c)))
{
message_send_text(c,message_type_error,c,"Only in game!");
return 0;
}
else
{
message_send_text(c,message_type_error,c,"Error: you're in the game,but host not found.");
return 0;
}
return 0;
}