From de8739c74d32376d82da3c617bda2cd83f9fff4b Mon Sep 17 00:00:00 2001 From: Bukz Date: Tue, 28 Jun 2011 00:13:59 +0000 Subject: [PATCH] saved.cfg cleanup, take two for alias "tmpClientData" :) git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@6546 e016b1c5-ed68-44aa-a2f7-31cac88cffde --- changelog.txt | 4 ++-- config/on_quit.cfg | 25 ++++++++++++++++++++++++- config/survival.cfg | 5 ++++- 3 files changed, 30 insertions(+), 4 deletions(-) diff --git a/changelog.txt b/changelog.txt index 96f3457b..a7f7fa30 100644 --- a/changelog.txt +++ b/changelog.txt @@ -59,7 +59,7 @@ Rendering / HUD / ... [*] Fixed flag icon transparency. [*] Nearplane fix. [*] screenshotscale - in-engine scaling of screenshots. -[*] showtargetname" - turns on/off showing the player name on the HUD when in your crosshair. +[*] showtargetname - turns on/off showing the player name on the HUD when in your crosshair. Physics --------------------- @@ -176,7 +176,7 @@ CubeScript [*] Substr crash bug is fixed. Also the command can now use a negative position value. [*] New stat in (pstat_score) for teamkills. New list is: FLAGS FRAGS DEATHS POINTS TEAM TEAMKILLS NAME // TODO move to compatibility.cfg [*] on_quit.cfg for deleting aliases from saved.cfg upon quit. -[*] Many aliases that were stored in saved.cfg are now being stored as a single alias (list) "tmpClientData" and being restored on start. (see on_quit.cfg) // Not yet, still buggy. :P +[*] Many aliases that were stored in saved.cfg are now being stored as a single alias (list) "tmpClientData" and being restored on start. (see on_quit.cfg) // Should be working now, please report any problems like unknown alias lookup errors though! [*] Missing bracket ([], (), etc.) errors now also notify the client of what file the error resides in. [*] New automatically executed scripts folder in the root install directory of AC. [*] New delta_edit/game_# aliases for easily tweaking gamma/fov/flyspeed on-the-fly. (e.g. Hold F5 and scroll for gamma, F6 for fov, bind "domodifier 10" to a key for flyspeed) diff --git a/config/on_quit.cfg b/config/on_quit.cfg index 7be36030..a309e6c0 100644 --- a/config/on_quit.cfg +++ b/config/on_quit.cfg @@ -1,6 +1,27 @@ // Adds a list of aliases to be deleted (cleared from saved.cfg) on every quit. // Do not modify. (unless you really know what you're doing) +tmpClientList = "curname LANG nickhighlight soundqualityalias dyngamma __gibsgore gfxqualityalias poniesmodeon old_editbinds" +tmpSurvList = "survMaxBots survDifficulty timeBetChkPts survNumBots nonSurvDefaults survBotsToAdd timeUntilTele survMap spamSurvMsgs" + +addOnQuit [ + persistidents 1 + tmpClientData = ""; tmpSurvData = "" + loop cql (listlen $tmpClientList) [ add2list tmpClientData (getalias (at $tmpClientList $cql))) ] + loop oql (listlen $tmpSurvList) [ add2list tmpSurvData (getalias (at $tmpSurvList $oql)) ] +] + +add2alias afterinit [ + sleep 10 [ + if (&& (checkalias tmpClientData) (= (listlen $tmpClientData) (listlen $tmpClientList))) [ + loop cil (listlen $tmpClientData) [ (at $tmpClientList $cil) = (at $tmpClientData $cil) ] + ] + if (&& (checkalias tmpSurvData) (= (listlen $tmpSurvData) (listlen $tmpSurvList))) [ + loop ail (listlen $tmpSurvData) [ (at $tmpSurvList $ail) = (at $tmpSurvData $ail) ] + ] + ] 1 +] + addListOnQuit = [ alias_list = $arg1; loop al (listlen $alias_list) [ addOnQuit (concat "delalias" (at $alias_list $al)) ] ] on_quit_aliases = [ @@ -42,4 +63,6 @@ on_quit_aliases = [ on_quit_aliases ] -addListOnQuit $on_quit_aliases; addOnQuit [ delalias alias_list ] \ No newline at end of file +addListOnQuit $on_quit_aliases +addListOnQuit (concat $tmpClientList $tmpSurvList) +addOnQuit [ delalias alias_list ] \ No newline at end of file diff --git a/config/survival.cfg b/config/survival.cfg index 42b48114..62ea0e9c 100644 --- a/config/survival.cfg +++ b/config/survival.cfg @@ -16,7 +16,10 @@ resetSurvAliases = [ aliasinit survBotsToAdd 1; aliasinit "spamSurvMsgs survDifficulty" 0; aliasinit survNumBots 12; aliasinit survMaxBots 32; aliasinit timeBetChkPts 60000; aliasinit timeUntilTele 120000 ] -resetSurvAliases; if (! (checkalias afterinit)) [ afterinit = "" ]; if (! (strstr $afterinit survMap)) [ add2alias afterinit [ if (! (checkalias survMap)) [ survMap = (rnd (listlen $defaultmaps)) ] ] ] +if (! (checkalias afterinit)) [ afterinit = "" ] +if (! (strstr $afterinit resetSurvAliases)) [ + add2alias afterinit [ sleep 20 [ resetSurvAliases ] 1 ] +] genSurvDifStr = [ if $nonSurvDefaults [ result "[CUSTOM]" ] [