Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames

UWebAdmin.MessagingSpectator


00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112
00113
00114
00115
00116
00117
//=============================================================================
// MessagingSpectator. (Webadmin spectator)
//=============================================================================
class MessagingSpectator expands Spectator
	Config(WebServer);

var string LastMessageLines[20];
var config bool bHideWebSpectator;
var config array<string> BannedKeywords;

function InitPlayerReplicationInfo()
{
	Super.InitPlayerReplicationInfo();
	PlayerReplicationInfo.PlayerName = "WebAdmin";
	PlayerReplicationInfo.PlayerID = 0;
	if( bHideWebSpectator )
	{
		PlayerReplicationInfo.bAlwaysRelevant = False;
		PlayerReplicationInfo.RemoteRole = ROLE_None;
	}
	if( Level.Game.CurrentID==0 )
		Level.Game.CurrentID++;
	bIsPlayer = true;
	bAdmin = True;
}
exec function Fly();
function ClientReStart();
exec function Say( string Msg )
{
	local Pawn P;

	Log("WebAdmin:"@Msg,'ChatLog');
	if( bHideWebSpectator )
	{
		for( P=Level.PawnList; P!=None; P=P.nextPawn )
			if( P.bIsPlayer )
				P.ClientMessage("WebAdmin:"@Msg,'Event',True);
		Return;
	}
	for( P=Level.PawnList; P!=None; P=P.nextPawn )
		if( P.bIsPlayer )
			P.TeamMessage( PlayerReplicationInfo, Msg, 'Say' );
}
function Possess();
function PostBeginPlay()
{
	bIsPlayer = true;
}
exec function Fire( optional float F );
exec function AltFire( optional float F );
function ChangeTeam( int N );
exec function BehindView( Bool B );
exec function ActivateItem();
event TeamMessage( PlayerReplicationInfo PRI, coerce string S, name Type )
{
	if( PRI!=None )
		AddMessage("("$PRI.PlayerName$"):"@S);
	else AddMessage("(None):"@S);
}
event ClientMessage( coerce string S, optional name Type, optional bool bBeep )
{
	AddMessage("("$Type$"):"@S);
}
function AddMessage( string Msg )
{
	local int i;
	
	Msg = Class'SubWebManager'.Static.ReplaceChar(Msg,"<","<");
	Msg = Class'SubWebManager'.Static.ReplaceChar(Msg,">",">");
	Msg = Class'SubWebManager'.Static.RemoveSpecChars(Msg,"%frd:");
	Msg = Class'SubWebManager'.Static.RemoveSpecChars(Msg,"%Content:");
	Msg = Class'SubWebManager'.Static.RemoveSpecChars(Msg,"/n");
	Msg = Class'SubWebManager'.Static.RemoveSpecChars(Msg,"/Ctime");
	Msg = Class'SubWebManager'.Static.RemoveSpecChars(Msg,"/Cdate");
	For( i=19; i>=1; i-- )
	{
		LastMessageLines[i] = LastMessageLines[i-1];
	}
	LastMessageLines[0] = Msg;
}
function string ConsoleCommand( string Command )
{
	local int i,l;
	local string CCmd;

	if( Left(Command,4)~="Say " )
	{
		Say(Mid(Command,4));
		Return "";
	}
	CCmd = Caps(Command);
	if( InStr(CCmd," BANNEDKEYWORDS")>0 )
		return "Command not allowed to execute, keyword 'BannedKeywords' is blocked.";
	l = Array_Size(BannedKeywords);
	for( i=0; i<l; i++ )
		if( InStr(CCmd,Caps(BannedKeywords[i]))>=0 )
			return "Command not allowed to execute, keyword '"$BannedKeywords[i]$"' is blocked.";
	Return Super(Actor).ConsoleCommand(Command);
}
function Destroyed()
{
	local int NumSp,NumPl;
	
	NumSp = Level.Game.NumSpectators;
	NumPl = Level.Game.NumPlayers;
	Super.Destroyed();
	Level.Game.NumSpectators = NumSp;
	Level.Game.NumPlayers = NumPl;
}

defaultproperties
{
				RemoteRole=ROLE_None
				CollisionRadius=0.000000
				CollisionHeight=0.000000
}

Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames
Class file time: zo 11-11-2012 21:10:30.000 - Creation time: zo 11-11-2012 21:14:19.303 - Created with UnCodeX