## Engine
Class Admin

source: C:\XIII\Engine\Classes\Admin.uc

    Core.Object
       |
       +--Engine.Actor
          |
          +--Engine.Controller
             |
             +--Engine.PlayerController
                |
                +--Engine.Admin

Direct Known Subclasses:None

class Admin
extends Engine.PlayerController

Function Summary
`void` | `Admin(string CommandLine)`
    // Execute an administrative console command on the server.
`void` | `Kick(string S)`
`void` | `KickBan(string S)`
`void` | `PlayerList()`
`void` | `RestartMap()`
`void` | `Say(string Msg)`
    // center print admin messages which start with #
`void` | `Switch(string URL)`

Source Code

    00001	class Admin extends PlayerController;
    00002
    00003	replication
    00004	{
    00005		reliable if( Role<ROLE_Authority )
    00006			RestartMap, Switch, Kick, KickBan, Admin;
    00007	}
    00008
    00009	// Execute an administrative console command on the server.
    00010	exec function Admin( string CommandLine )
    00011	{
    00012		local string Result;
    00013
    00014		Result = ConsoleCommand( CommandLine );
    00015		if( Result!="" )
    00016			ClientMessage( Result );
    00017	}
    00018
    00019	exec function KickBan( string S )
    00020	{
    00021		Level.Game.KickBan(S);
    00022	}
    00023
    00024	// center print admin messages which start with #
    00025	exec function Say( string Msg )
    00026	{
    00027		local controller C;
    00028
    00029		if ( left(Msg,1) == "#" )
    00030		{
    00031			Msg = right(Msg,len(Msg)-1);
    00032			for( C=Level.ControllerList; C!=None; C=C.nextController )
    00033				if( C.IsA('PlayerController') )
    00034				{
    00035					PlayerController(C).ClearProgressMessages();
    00036					PlayerController(C).SetProgressTime(6);
    00037					PlayerController(C).SetProgressMessage(0, Msg, class'Canvas'.Static.MakeColor(255,255,255));
    00038				}
    00039			return;
    00040		}
    00041		Super.Say(Msg);
    00042	}
    00043
    00044	exec function Kick( string S )
    00045	{
    00046		Level.Game.Kick(S);
    00047	}
    00048
    00049	exec function PlayerList()
    00050	{
    00051		local PlayerReplicationInfo PRI;
    00052
    00053		log("Player List:");
    00054		ForEach DynamicActors(class'PlayerReplicationInfo', PRI)
    00055			log(PRI.PlayerName@"( ping"@PRI.Ping$")");
    00056	}
    00057
    00058	exec function RestartMap()
    00059	{
    00060		ClientTravel( "?restart", TRAVEL_Relative, false );
    00061	}
    00062
    00063	exec function Switch( string URL )
    00064	{
    00065		Level.ServerTravel( URL, false );
    00066	}
    00067
    00068	defaultproperties
    00069	{
    00070	     bOnlySpectator=True
    00071	}

End Source Code