Server Help

ASSS Questions - Config files

Snidjer - Mon Jun 23, 2003 6:05 am
Post subject: Config files
There should be some kind of parser for the config files, newbies (which most people running servers are) will be confused when their program segfaults due to incorrect configuration syntax. Instead, a syntax error should be thrown.

Death greens do not work. Mr. Twit and I have created code that gives a random green to a user as long as the green is allowed in that arena/zone. Unfortunately, it doesn't handle the specific random weights of the greens yet, but at least it works.

I've experienced random segfaults, though I've not been able to trace where they're from.

Kind regards,

Devon H. O'Dell
sitetronics.com
Mine GO BOOM - Mon Jun 23, 2003 1:10 pm
Post subject:
For the Death Green, ASSS just sets it to random, which means the client can pick whatever green it wants for it (found in game.c, function PDie). So thats the client's fault there. It also correctly loads the Prize:DeathPrizeTime setting, so check to make sure you have that value set to something reasonable.

For the configs, that can be worked around with later.

For your random segfaults you cannot find: type out the errors your getting (it will log/show somewhere), which OS you using, and if you compiled it, which compiler you used.
Snidjer - Mon Jun 23, 2003 5:22 pm
Post subject:
Hm. Well, because the client isn't required to do it, and because it can cause cheating, here's the code we've made to do it: (btw, in PDie, the kp.green had a big /* FIXME */ next to it icon_wink.gif

Code: Show/Hide

local int RandomizeGreen(Player *);
...
kp.green = RandomizeGreen(p);
...
local int RandomizeGreen(Player *p) {
  int green;
  char *EnumToStr[] = {
    "QuickCharge", "Energy",
    "Rotation",    "Stealth",
    "Cloak",       "XRadar",
    "Warp",        "Gun",
    "Bomb",        "BouncingBullets",
    "Thruster",    "TopSpeed",
    "Recharge",    "Glue",
    "MultiFire",   "Proximity",
    "AllWeapons",  "Shields",
    "Shrapnel",    "AntiWarp",
    "Repel",       "Burst",
    "Decoy",       "Thor",
    "MultiPrize",  "Brick",
    "Rocket",      "Portal"
    };
  while(1) {

    green = (int)(1 + random()%(PRIZE_PORTAL + 1));
    if (cfg == '\0') return 10;
    if (p == '\0') return 11;

    lm->Log(L_INFO, "Green is %d and string is %s.", green, EnumToStr[green]);

    /*Check prizeweight*/
    if (cfg->GetInt(p->arena->cfg, "PrizeWeight",
      EnumToStr[green], 0) > 0) {
      break;
    }
  }

  return green;
}


I don't quite understand why you guys are so anal about code modifications when you've GPLed the code icon_smile.gif

Although I'd like to point out that I *am* a programmer, so if you guys do need help lemme know. Otherwise I might start my own fork, lol icon_wink.gif

Kind regards,

Devon H. O'Dell
sitetronics.com
Grelminar - Tue Jun 24, 2003 12:54 am
Post subject:
Right, MGB is wrong: the client doesn't do anything with the zero, unfortunately. But the point is moot: I fixed it already, and it's in cvs.

About the parser, it's not supposed to crash icon_smile.gif I know it does, but I've never taken the time to figure out where. If you send me a file that it crashes on, I'll try to find the bug(s).
Mine GO BOOM - Tue Jun 24, 2003 1:06 am
Post subject:
Please note i did all my learning of how subspace works with the VIE client, so its still the client's fault. Posting bug into BugTraq.
Snidjer - Tue Jun 24, 2003 2:01 am
Post subject:
Ah, even better, I'll just write a quick parser for ya icon_smile.gif.

Kind regards,

Devon H. O'Dell
All times are -5 GMT
View topic
Powered by phpBB 2.0 .0.11 © 2001 phpBB Group