Overview | Package | Class | Source | Class tree | Glossary | UnrealScript Documentation |
previous class next class | frames no frames |
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 |
class UTServerSetupPage extends UMenuServerSetupPage; var UWindowEditControl GamePasswordEdit; var localized string GamePasswordText; var localized string GamePasswordHelp; var UWindowEditControl AdminPasswordEdit; var localized string AdminPasswordText; var localized string AdminPasswordHelp; var UWindowCheckbox EnableWebserverCheck; var localized string EnableWebserverText; var localized string EnableWebserverHelp; var UWindowEditControl WebAdminUsernameEdit; var localized string WebAdminUsernameText; var localized string WebAdminUsernameHelp; var UWindowEditControl WebAdminPasswordEdit; var localized string WebAdminPasswordText; var localized string WebAdminPasswordHelp; var UWindowEditControl ListenPortEdit; var localized string ListenPortText; var localized string ListenPortHelp; var bool bInitialized; function Created() { local int ControlWidth, ControlLeft, ControlRight; local int CenterWidth, CenterPos; ControlOffset = 20; bInitialized = False; Super.Created(); ControlWidth = WinWidth/2.5; ControlLeft = (WinWidth/2 - ControlWidth)/2; ControlRight = WinWidth/2 + ControlLeft; CenterWidth = (WinWidth/4)*3; CenterPos = (WinWidth - CenterWidth)/2; GamePasswordEdit = UWindowEditControl(CreateControl(class'UWindowEditControl', CenterPos, ControlOffset, CenterWidth, 1)); GamePasswordEdit.SetText(GamePasswordText); GamePasswordEdit.SetHelpText(GamePasswordHelp); GamePasswordEdit.SetFont(F_Normal); GamePasswordEdit.SetNumericOnly(False); GamePasswordEdit.SetMaxLength(16); GamePasswordEdit.SetDelayedNotify(True); GamePasswordEdit.SetValue(GetPlayerOwner().ConsoleCommand("get engine.gameinfo GamePassword")); ControlOffset += 20; AdminPasswordEdit = UWindowEditControl(CreateControl(class'UWindowEditControl', CenterPos, ControlOffset, CenterWidth, 1)); AdminPasswordEdit.SetText(AdminPasswordText); AdminPasswordEdit.SetHelpText(AdminPasswordHelp); AdminPasswordEdit.SetFont(F_Normal); AdminPasswordEdit.SetNumericOnly(False); AdminPasswordEdit.SetMaxLength(16); AdminPasswordEdit.SetDelayedNotify(True); AdminPasswordEdit.SetValue(GetPlayerOwner().ConsoleCommand("get engine.gameinfo AdminPassword")); ControlOffset += 20; EnableWebserverCheck = UWindowCheckbox(CreateControl(class'UWindowCheckbox', CenterPos, ControlOffset, CenterWidth, 1)); EnableWebserverCheck.SetText(EnableWebserverText); EnableWebserverCheck.SetHelpText(EnableWebserverHelp); EnableWebserverCheck.SetFont(F_Normal); EnableWebserverCheck.Align = TA_Left; EnableWebserverCheck.bChecked = class'WebServer'.default.bEnabled; ControlOffset += 20; WebAdminUsernameEdit = UWindowEditControl(CreateControl(class'UWindowEditControl', CenterPos, ControlOffset, CenterWidth, 1)); WebAdminUsernameEdit.SetText(WebAdminUsernameText); WebAdminUsernameEdit.SetHelpText(WebAdminUsernameHelp); WebAdminUsernameEdit.SetFont(F_Normal); WebAdminUsernameEdit.SetNumericOnly(False); WebAdminUsernameEdit.SetMaxLength(16); WebAdminUsernameEdit.SetDelayedNotify(True); WebAdminUsernameEdit.SetValue(class'UTServerAdmin'.default.AdminUsername); ControlOffset += 20; WebAdminPasswordEdit = UWindowEditControl(CreateControl(class'UWindowEditControl', CenterPos, ControlOffset, CenterWidth, 1)); WebAdminPasswordEdit.SetText(WebAdminPasswordText); WebAdminPasswordEdit.SetHelpText(WebAdminPasswordHelp); WebAdminPasswordEdit.SetFont(F_Normal); WebAdminPasswordEdit.SetNumericOnly(False); WebAdminPasswordEdit.SetMaxLength(16); WebAdminPasswordEdit.SetDelayedNotify(True); WebAdminPasswordEdit.SetValue(class'UTServerAdmin'.default.AdminPassword); ControlOffset += 20; ListenPortEdit = UWindowEditControl(CreateControl(class'UWindowEditControl', CenterPos, ControlOffset, CenterWidth, 1)); ListenPortEdit.SetText(ListenPortText); ListenPortEdit.SetHelpText(ListenPortHelp); ListenPortEdit.SetFont(F_Normal); ListenPortEdit.SetNumericOnly(True); ListenPortEdit.SetMaxLength(16); ListenPortEdit.SetDelayedNotify(True); ListenPortEdit.SetValue(string(class'WebServer'.default.ListenPort)); ControlOffset += 20; bInitialized = True; } function Notify(UWindowDialogControl C, byte E) { if(bInitialized) { switch(E) { case DE_Change: switch(C) { case GamePasswordEdit: GetPlayerOwner().ConsoleCommand("set engine.gameinfo GamePassword "$GamePasswordEdit.GetValue()); break; case AdminPasswordEdit: GetPlayerOwner().ConsoleCommand("set engine.gameinfo AdminPassword "$AdminPasswordEdit.GetValue()); break; case EnableWebserverCheck: class'WebServer'.default.bEnabled = EnableWebserverCheck.bChecked; class'WebServer'.static.StaticSaveConfig(); break; case WebAdminUsernameEdit: class'UTServerAdmin'.default.AdminUsername = WebAdminUsernameEdit.GetValue(); class'UTServerAdmin'.static.StaticSaveConfig(); break; case WebAdminPasswordEdit: class'UTServerAdmin'.default.AdminPassword = WebAdminPasswordEdit.GetValue(); class'UTServerAdmin'.static.StaticSaveConfig(); break; case ListenPortEdit: class'WebServer'.default.ListenPort = Int(ListenPortEdit.GetValue()); class'WebServer'.static.StaticSaveConfig(); break; } } } Super.Notify(C, E); } function BeforePaint(Canvas C, float X, float Y) { local int ControlWidth, ControlLeft, ControlRight; local int CenterWidth, CenterPos; local int EditWidth; Super.BeforePaint(C, X, Y); ControlWidth = WinWidth/2.5; ControlLeft = (WinWidth/2 - ControlWidth)/2; ControlRight = WinWidth/2 + ControlLeft; CenterWidth = (WinWidth/7)*6; CenterPos = (WinWidth - CenterWidth)/2; EditWidth = CenterWidth - 100; GamePasswordEdit.SetSize(CenterWidth, 1); GamePasswordEdit.WinLeft = CenterPos; GamePasswordEdit.EditBoxWidth = EditWidth; AdminPasswordEdit.SetSize(CenterWidth, 1); AdminPasswordEdit.WinLeft = CenterPos; AdminPasswordEdit.EditBoxWidth = EditWidth; WebAdminPasswordEdit.SetSize(CenterWidth, 1); WebAdminPasswordEdit.WinLeft = CenterPos; WebAdminPasswordEdit.EditBoxWidth = EditWidth; WebAdminUsernameEdit.SetSize(CenterWidth, 1); WebAdminUsernameEdit.WinLeft = CenterPos; WebAdminUsernameEdit.EditBoxWidth = EditWidth; EnableWebserverCheck.SetSize(CenterWidth-EditWidth+16, 1); EnableWebserverCheck.WinLeft = CenterPos; ListenPortEdit.SetSize(CenterWidth-EditWidth+35, 1); ListenPortEdit.WinLeft = CenterPos; ListenPortEdit.EditBoxWidth = 35; } defaultproperties { GamePasswordText="Game Password" GamePasswordHelp="If this is set, a player needs use this password to be allowed to login to the server." AdminPasswordText="Admin Password" AdminPasswordHelp="If this is set, a player can join your server using this password and have access to admin-only console commands." EnableWebserverText="WWW Remote Admin" EnableWebserverHelp="If checked, you will be able to administer your UT server remotely using a web browser." WebAdminUsernameText="WWW Username" WebAdminUsernameHelp="The username needed to login to the WWW-based remote server administration." WebAdminPasswordText="WWW Password" WebAdminPasswordHelp="The password needed to login to the WWW-based remote server administration." ListenPortText="Webserver Port No." ListenPortHelp="The port number that the remote administration webserver will listen on for incoming connections." } |
Overview | Package | Class | Source | Class tree | Glossary | UnrealScript Documentation |
previous class next class | frames no frames |