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

GUI2K4.AdminPanelPlayers


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
//==============================================================================
//  Created on: 11/12/2003
//  Contains controls for administering players on the server (kick/ban)
//
//  Written by Ron Prestenback
//  © 2003, Epic Games, Inc. All Rights Reserved
//==============================================================================

class AdminPanelPlayers extends AdminPanelBase;

var  automated GUIMultiColumnListbox lb_Players;
var            AdminPlayerList       li_Players;
var automated GUIButton              b_Kick, b_Ban;

function InitComponent(GUIController MyController, GUIComponent MyOwner)
{
    Super.InitComponent(MyController,MyOwner);

    li_Players = AdminPlayerList(lb_Players.List);
}

function ProcessPlayer(string PlayerInfo)
{
    if (PlayerInfo=="Done")
        XPlayer(PlayerOwner()).ProcessRule = None;
    else li_Players.Add(PlayerInfo);
}

function ReloadList()
{
    local xPlayer PC;

    PC = xPlayer(PlayerOwner());
    if ( PC == None )
        return;

    li_Players.Clear();
    PC.ProcessRule = ProcessPlayer;
    PC.ServerRequestPlayerInfo();
}

function bool InternalOnClick(GUIComponent Sender)
{
    switch ( Sender )
    {
    case b_Kick:
        if ( bAdvancedAdmin )
            AdminCommand( "kick"@li_Players.MyPlayers[li_Players.Index].PlayerID );
        else AdminCommand( "kick"@li_Players.MyPlayers[li_Players.Index].PlayerName );

        ReloadList();
        return true;

    case b_Ban:
        if ( bAdvancedAdmin )
            AdminCommand( "kick ban"@li_Players.MyPlayers[li_Players.Index].PlayerID );
        else AdminCommand( "kickban"@li_Players.MyPlayers[li_Players.Index].PlayerName);

        ReloadList();
        return true;
    }
}

defaultproperties
{
     Begin Object Class=GUIMultiColumnListBox Name=AdminPlayersListBox
         DefaultListClass="XInterface.AdminPlayerList"
         bVisibleWhenEmpty=Wahr
         OnCreateComponent=AdminPlayersListBox.InternalOnCreateComponent
         StyleName="ServerBrowserGrid"
         WinHeight=0.878127
         bBoundToParent=Wahr
         bScaleToParent=Wahr
     End Object
     lb_Players=GUIMultiColumnListBox'GUI2K4.AdminPanelPlayers.AdminPlayersListBox'

     Begin Object Class=GUIButton Name=KickButton
         Caption="Kick"
         Hint="Kick this Player"
         WinTop=0.900000
         WinLeft=0.743750
         WinWidth=0.120000
         WinHeight=0.070625
         bBoundToParent=Wahr
         bScaleToParent=Wahr
         OnClick=AdminPanelPlayers.InternalOnClick
         OnKeyEvent=KickButton.InternalOnKeyEvent
     End Object
     b_Kick=GUIButton'GUI2K4.AdminPanelPlayers.KickButton'

     Begin Object Class=GUIButton Name=BanButton
         Caption="Ban"
         Hint="Ban this player"
         WinTop=0.900000
         WinLeft=0.868750
         WinWidth=0.120000
         WinHeight=0.070625
         bBoundToParent=Wahr
         bScaleToParent=Wahr
         OnClick=AdminPanelPlayers.InternalOnClick
         OnKeyEvent=BanButton.InternalOnKeyEvent
     End Object
     b_Ban=GUIButton'GUI2K4.AdminPanelPlayers.BanButton'

     PanelCaption="Players"
     WinTop=0.000000
     WinHeight=0.625003
}

Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames
Class file time: Fr 30.3.2007 08:44:00.000 - Creation time: Mo 16.4.2007 11:20:44.093 - Created with UnCodeX