Class xVoteWebApp extends Object implements(IQueryHandler); var WebAdmin webadmin; var string MapVoterURL; var int EditSettingLine; function cleanup() { webadmin = None; } function init(WebAdmin webapp) { webadmin = webapp; } function registerMenuItems(WebAdminMenu menu) { menu.addMenu(MapVoterURL, "X - Mapvote", self, "Modify settings of mapvote.", -88); } function bool handleQuery(WebAdminQuery q) { switch (q.request.URI) { case MapVoterURL: handleMapVotes(q); return true; } return false; } final function IncludeFile(WebAdminQuery q, string file) { local string S; if (webadmin.HTMLSubDirectory!="") { S = webadmin.Path $ "/" $ webadmin.HTMLSubDirectory $ "/" $ file; if (q.response.FileExists(S)) { q.response.IncludeUHTM(S); return; } } q.response.IncludeUHTM(webadmin.Path $ "/" $ file); } final function SendHeader(WebAdminQuery q, string Title) { local IQueryHandler handler; q.response.Subst("page.title", Title); q.response.Subst("page.description", ""); foreach webadmin.handlers(handler) { handler.decoratePage(q); } q.response.Subst("messages", webadmin.renderMessages(q)); if (q.session.getString("privilege.log") != "") { q.response.Subst("privilege.log", webadmin.renderPrivilegeLog(q)); } IncludeFile(q,"header.inc"); q.response.SendText("

"$Title$"

"); } final function SendFooter(WebAdminQuery q) { IncludeFile(q,"navigation.inc"); IncludeFile(q,"footer.inc"); q.response.ClearSubst(); } final function AddConfigEditbox(WebAdminQuery q, string InfoStr, string CurVal, int MaxLen, string ResponseVar, string Tooltip, optional bool bNoTR) { local string S; S = ""$InfoStr$":"; if (!bNoTR) S = ""$S$""; q.response.SendText(S); } final function AddInLineEditbox(WebAdminQuery q, string CurVal, int MaxLen, string ResponseVar, string Tooltip) { q.response.SendText(""); } function handleMapVotes(WebAdminQuery q) { local int i; local string S; S = q.request.getVariable("edit"); if (S=="Submit") { class'xVotingHandler'.Default.VoteTime = int(q.request.getVariable("VT",string(class'xVotingHandler'.Default.VoteTime))); class'xVotingHandler'.Default.MidGameVotePct = float(q.request.getVariable("MV",string(class'xVotingHandler'.Default.MidGameVotePct))); class'xVotingHandler'.Default.MapWinPct = float(q.request.getVariable("VP",string(class'xVotingHandler'.Default.MapWinPct))); class'xVotingHandler'.Default.MapChangeDelay = float(q.request.getVariable("SD",string(class'xVotingHandler'.Default.MapChangeDelay))); class'xVotingHandler'.Default.MaxMapsOnList = int(q.request.getVariable("MXP",string(class'xVotingHandler'.Default.MaxMapsOnList))); class'xVotingHandler'.Static.StaticSaveConfig(); EditSettingLine = -1; } else if (S=="New") { i = class'xVotingHandler'.Default.GameModes.Length; class'xVotingHandler'.Default.GameModes.Length = i+1; class'xVotingHandler'.Default.GameModes[i].GameName = "Killing Floor"; class'xVotingHandler'.Default.GameModes[i].GameShortName = "KF"; class'xVotingHandler'.Default.GameModes[i].GameClass = "KFGameContent.KFGameInfo_Survival"; EditSettingLine = i; class'xVotingHandler'.Static.StaticSaveConfig(); } else if (S=="Save") { if (EditSettingLine>=0 && EditSettingLine"); q.response.SendText(""); AddConfigEditbox(q,"Mapvote time",string(class'xVotingHandler'.Default.VoteTime),8,"VT","Time in seconds people have to cast mapvote"); AddConfigEditbox(q,"Mid-Game vote pct",string(class'xVotingHandler'.Default.MidGameVotePct),12,"MV","Number of people in percent needs to vote to make game initiate mid-game mapvote"); AddConfigEditbox(q,"Map win vote pct",string(class'xVotingHandler'.Default.MapWinPct),12,"VP","Number of people in percent needs to vote for same map for mapvote instantly switch to it"); AddConfigEditbox(q,"Map switch delay",string(class'xVotingHandler'.Default.MapChangeDelay),12,"SD","Time in seconds delay after a mapvote has passed, when server actually switches map"); AddConfigEditbox(q,"Max Maps On List",string(class'xVotingHandler'.Default.MaxMapsOnList),8,"MXP","Maximum maps that should show on mapvote GUI before starting to remove random ones (0 = no limit)"); q.response.SendText(""); q.response.SendText("
Mapvote settings
"); q.response.SendText("
"); q.response.SendText(""); q.response.SendText(""); for (i=0; i",false); AddInLineEditbox(q,class'xVotingHandler'.Default.GameModes[i].GameName,48,"GN","Game type long display name"); AddInLineEditbox(q,class'xVotingHandler'.Default.GameModes[i].GameShortName,12,"GS","Game type short display name"); AddInLineEditbox(q,class'xVotingHandler'.Default.GameModes[i].GameClass,38,"GC","Game type class name to run"); AddInLineEditbox(q,class'xVotingHandler'.Default.GameModes[i].Mutators,120,"MM","List of mutators to run along with this game option (separated with commas)"); AddInLineEditbox(q,class'xVotingHandler'.Default.GameModes[i].Options,100,"OP","List of options to run along with this game option (separated with question mark)"); AddInLineEditbox(q,class'xVotingHandler'.Default.GameModes[i].Prefix,16,"PF","Maps prefix to filter out maps not wanted for this game mode"); AddInLineEditbox(q,class'xVotingHandler'.Default.GameModes[i].ServerName,16,"SN","Server name that will be set when this mode is selected "); q.response.SendText(""); } else { q.response.SendText(""); } } q.response.SendText(""); q.response.SendText("
Mapvote game modes
Game NameGame Short NameGame ClassMutatorsOptionsMap PrefixServer Name
"$class'xVotingHandler'.Default.GameModes[i].GameName$ ""$class'xVotingHandler'.Default.GameModes[i].GameShortName$ ""$class'xVotingHandler'.Default.GameModes[i].GameClass$ ""$class'xVotingHandler'.Default.GameModes[i].Mutators$ ""$class'xVotingHandler'.Default.GameModes[i].Options$ ""$class'xVotingHandler'.Default.GameModes[i].Prefix$ ""$class'xVotingHandler'.Default.GameModes[i].ServerName$ "
"); q.response.SendText("
"); SendFooter(q); } function bool producesXhtml() { return true; } function bool unhandledQuery(WebAdminQuery q); function decoratePage(WebAdminQuery q); defaultproperties { MapVoterURL="/settings/xMapVoter" EditSettingLine=-1 }