Ejects a user from the world.
None (returns immediately)
The attribute AW_EJECT_SESSION specifies the user (or bot) to eject. AW_EJECT_DURATION specifies for how many seconds the eject should persist.
The instance must have the EJECT right in order to use aw_world_eject.
In version 3.3 or later world servers, up to 3 different ejection types will be added to the world ejection database for each user ejected. Every eject adds an IP address block (AW_EJECT_BY_ADDRESS) for the IP address of the user being ejected. If the user is on a computer with a unique ID (not every computer has one), a second ejection of type AW_EJECT_BY_COMPUTER is also added. This type of ejection will keep the user out even if they change their IP address. Finally, if the ejected user is a citizen, a third ejection of type AW_EJECT_BY_CITIZEN is added. This type of ejection will keep the user out as long as they remain on that citizen account.
/* eject a user for saying a bad word */
void handle_chat (void)
{
if (strstr (aw_string (AW_CHAT_MESSAGE), BAD_WORD)) {
aw_int_set (AW_EJECT_SESSION, aw_int (AW_CHAT_SESSION));
aw_int_set (AW_EJECT_DURATION, 5 * 60); /* eject for 5 minutes */
if (aw_world_eject ())
printf ("Unable to eject session %d\n", aw_int (AW_CHAT_SESSION));
else
printf ("Session %d ejected\n", aw_int (AW_CHAT_SESSION));
}
}
aw_event_set (AW_EVENT_CHAT, handle_chat);