Пример #1
0
/* <ee430> ../engine/sv_steam3.cpp:290 */
void CSteam3Server::OnGSClientApprove(GSClientApprove_t *pGSClientSteam2Accept)
{
    client_t* cl = ClientFindFromSteamID(pGSClientSteam2Accept->m_SteamID);
    if (!cl)
        return;


    if (SV_FilterUser(&cl->network_userid))
    {
        char msg[256];
        Q_sprintf(msg, "You have been banned from this server\n");
        SV_RejectConnection(&cl->netchan.remote_address, msg);
        SV_DropClient(cl, 0, "STEAM UserID %s is in server ban list\n", SV_GetClientIDString(cl));
    }
    else if (SV_CheckForDuplicateSteamID(cl) != -1)
    {
        char msg[256];
        Q_sprintf(msg, "Your UserID is already in use on this server.\n");
        SV_RejectConnection(&cl->netchan.remote_address, msg);
        SV_DropClient(cl, 0, "STEAM UserID %s is already\nin use on this server\n", SV_GetClientIDString(cl));
    }
    else
    {
        char msg[512];
        Q_snprintf(msg, ARRAYSIZE(msg), "\"%s<%i><%s><>\" STEAM USERID validated\n", cl->name, cl->userid, SV_GetClientIDString(cl));
#ifdef REHLDS_CHECKS
        msg[ARRAYSIZE(msg) - 1] = 0;
#endif
        Con_DPrintf("%s", msg);
        Log_Printf("%s", msg);
    }
}
Пример #2
0
/*
==================
SV_Kick_f

Kick a user off of the server
==================
*/
void SV_Kick_f( void )
{
	if( Cmd_Argc() != 2 )
	{
		Msg( "Usage: kick <userid> | <name>\n" );
		return;
	}

	if( !SV_SetPlayer( )) return;

	if( NET_IsLocalAddress( svs.currentPlayer->netchan.remote_address ))
	{
		Msg( "The local player cannot be kicked!\n" );
		return;
	}

	SV_BroadcastPrintf( PRINT_HIGH, "%s was kicked\n", svs.currentPlayer->name );
	SV_ClientPrintf( svs.currentPlayer, PRINT_HIGH, "You were kicked from the game\n" );
	SV_DropClient( svs.currentPlayer );

	Log_Printf( "Kick: \"%s<%i><%s><>\" was kicked by \"Console\"\n", svs.currentPlayer->name,
				svs.currentPlayer->userid, SV_GetClientIDString ( svs.currentPlayer ) );

	// min case there is a funny zombie
	svs.currentPlayer->lastmessage = host.realtime;
}