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

GUI2K4.UT2K4Tab_ServerRulesPanel


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
00118
00119
00120
00121
00122
00123
00124
00125
00126
00127
00128
00129
00130
00131
00132
00133
00134
00135
00136
00137
00138
00139
00140
00141
00142
00143
00144
00145
00146
00147
00148
00149
00150
00151
00152
00153
00154
00155
00156
00157
00158
00159
00160
00161
00162
00163
00164
00165
00166
00167
00168
00169
00170
00171
00172
00173
00174
00175
00176
00177
00178
00179
00180
00181
00182
00183
00184
00185
00186
00187
00188
00189
00190
00191
00192
00193
00194
00195
00196
00197
00198
00199
00200
00201
00202
00203
00204
00205
00206
00207
00208
00209
00210
00211
//==============================================================================
//  Server version of IAMultiColumnRulesPanel.
//  Only shows Voting and Server settings.
//
//  Created by Bruce Bickar
//  © 2003, Epic Games, Inc.  All Rights Reserved
//==============================================================================
class UT2K4Tab_ServerRulesPanel extends IAMultiColumnRulesPanel
	config;

var config bool bLANServer;

var automated moCheckbox     ch_Webadmin, ch_LANServer;
var automated moNumericEdit  nu_Port;

var int Port;
var bool bWebadmin;

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

	// Shrink the list to make room for additional options
	lb_Rules.WinHeight=0.875008;

	// move checkbox over to the left
	ch_Advanced.WinWidth=0.331250;
	ch_Advanced.WinHeight=0.043750;
	ch_Advanced.WinLeft=0.073126;
	ch_Advanced.WinTop=0.890000;

	RemoveComponent(b_Symbols);

	i_BK.SetPosition(0.000505,0.014733,0.996997,0.853123);
	lb_Rules.SetPosition(0.024912,0.066344,0.950175,0.735499);

}
//------------------------------------------------------------------------------------------------
protected function bool ShouldDisplayRule(int Index)
{
	if ( GamePI.Settings[Index].bAdvanced && !Controller.bExpertMode )
		return false;

    // Only multiplayer-specific setting on this page
    return GamePI.Settings[Index].bMPOnly;
}
//------------------------------------------------------------------------------------------------
// rjp --
protected function SetGamePI()
{
	GamePI = p_Anchor.RuleInfo;
	GamePI.Sort(6);
}

function Change(GUIComponent Sender)
{
	if ( Sender == ch_Webadmin )
	{
		bWebadmin = ch_Webadmin.IsChecked();
		UpdatePortState();
	}

	else if ( Sender == ch_LANServer )
	{
		bLANServer = ch_LANServer.IsChecked();
		SaveConfig();
	}

	else if ( Sender == nu_Port )
		Port = nu_Port.GetValue();
}

function string Play()
{
	local bool b;

	if ( bWebadmin != class'UWeb.WebServer'.default.bEnabled )
	{
		class'UWeb.WebServer'.default.bEnabled = bWebadmin;
		b = True;
	}

	if ( Port != class'UWeb.WebServer'.default.ListenPort )
	{
		class'UWeb.Webserver'.default.ListenPort = Port;
		b = True;
	}

	if ( b )
		class'UWeb.Webserver'.static.StaticSaveConfig();

	if ( bLANServer )
		return " -lanplay";

	return "";
}

function InternalOnLoadINI(GUIComponent Sender, string S)
{
	switch (Sender)
	{
		case ch_Webadmin:
			bWebadmin = class'UWeb.WebServer'.default.bEnabled;
			ch_Webadmin.Checked(bWebAdmin);
			UpdatePortState();
			break;

		case ch_LANServer:
			ch_LANServer.Checked(bLANServer);
			break;

		case nu_Port:
			Port = class'UWeb.WebServer'.default.ListenPort;
			nu_Port.SetValue(Port);
			break;
	}
}

function UpdateBotSetting(int i)
{
}
function UpdateSymbolButton()
{
}

function UpdatePortState()
{
	if ( bWebAdmin )
		EnableComponent(nu_Port);
	else DisableComponent(nu_Port);
}

event Closed(GUIComponent Sender, bool bCancelled)  // Called when the Menu Owner is closed
{
	local bool b;

	Super.Closed(Sender, bCancelled);

	if ( bWebadmin != class'UWeb.WebServer'.default.bEnabled )
	{
		class'UWeb.WebServer'.default.bEnabled = bWebadmin;
		b = True;
	}

	if ( Port != class'UWeb.WebServer'.default.ListenPort )
	{
		class'UWeb.Webserver'.default.ListenPort = Port;
		b = True;
	}

	if ( b )
		class'UWeb.Webserver'.static.StaticSaveConfig();
}
// -- rjp

defaultproperties
{
     bLANServer=True
     Begin Object Class=moCheckBox Name=EnableWebadmin
         Caption="Enable WebAdmin"
         OnCreateComponent=EnableWebadmin.InternalOnCreateComponent
         IniOption="@Internal"
         Hint="Enables remote web-based administration of the server"
         WinTop=0.893334
         WinLeft=0.586874
         WinWidth=0.295063
         WinHeight=0.043750
         TabOrder=4
         OnChange=UT2K4Tab_ServerRulesPanel.Change
         OnLoadINI=UT2K4Tab_ServerRulesPanel.InternalOnLoadINI
     End Object
     ch_Webadmin=moCheckBox'GUI2K4.UT2K4Tab_ServerRulesPanel.EnableWebadmin'

     Begin Object Class=moCheckBox Name=LANServer
         Caption="LAN Server"
         OnCreateComponent=LANServer.InternalOnCreateComponent
         IniOption="@Internal"
         Hint="Optimizes various engine and network settings for LAN-based play.  Enabling this option when running an internet server will cause EXTREME lag during the match!"
         WinTop=0.953334
         WinLeft=0.073126
         WinWidth=0.331250
         WinHeight=0.043750
         TabOrder=3
         OnChange=UT2K4Tab_ServerRulesPanel.Change
         OnLoadINI=UT2K4Tab_ServerRulesPanel.InternalOnLoadINI
     End Object
     ch_LANServer=moCheckBox'GUI2K4.UT2K4Tab_ServerRulesPanel.LANServer'

     Begin Object Class=moNumericEdit Name=WebadminPort
         MinValue=1
         MaxValue=65536
         CaptionWidth=0.700000
         ComponentWidth=0.300000
         Caption="WebAdmin Port"
         OnCreateComponent=WebadminPort.InternalOnCreateComponent
         IniOption="@Internal"
         Hint="Select which port should be used to connect to the remote web-based administration"
         WinTop=0.953334
         WinLeft=0.586874
         WinWidth=0.295063
         WinHeight=0.043750
         TabOrder=5
         OnChange=UT2K4Tab_ServerRulesPanel.Change
         OnLoadINI=UT2K4Tab_ServerRulesPanel.InternalOnLoadINI
     End Object
     nu_Port=moNumericEdit'GUI2K4.UT2K4Tab_ServerRulesPanel.WebadminPort'

     RedSym=
}

Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames
Class file time: pr 5-2-2018 12:35:54.000 - Creation time: sk 18-3-2018 09:50:25.194 - Created with UnCodeX