Server Help

ASSS Questions - MaxFreq setting

stag shot - Sat Mar 11, 2006 12:41 pm
Post subject: MaxFreq setting
We had problems with players being able to enter ships that they were not supposed to have access to. After scanning the code, I found the following in fm_normal.c:

Code: Show/Hide

maxfreq = cfg->GetInt(ch, "Team", "MaxFrequency", 9999);

   /* special case: speccer re-entering spec freq */
   if (s == SHIP_SPEC && f == arena->specfreq)
      return;

   if (f < 0 || f > maxfreq)
      /* he requested a bad freq. drop him elsewhere. */
      f = BalanceFreqs(arena, p, inclspec);
   else


The bug is within that last if statement (should be >= maxfreq since freq 0 exists)...Either I'm mistaken or that seems like a really obvious bug that shouldn't have persisted this long!

stag
Dr Brain - Sat Mar 11, 2006 2:28 pm
Post subject:
I don't see any problem.

If a player asks to go to freq 9999, then it should let them.
Mr Ekted - Sat Mar 11, 2006 2:57 pm
Post subject:
Dr Brain wrote:
I don't see any problem.

If a player asks to go to freq 9999, then it should let them.


So much for asking you for help any more. icon_wink.gif
stag shot - Sat Mar 11, 2006 3:58 pm
Post subject:
Dr Brain wrote:
I don't see any problem.

If a player asks to go to freq 9999, then it should let them.


It was allowing one too many freqs.

stag
Smong - Sat Mar 11, 2006 6:13 pm
Post subject:
Couldn't you just set the value of MaxFrequency one lower if that's your problem?

It's not as if the setting is called NumberOfAllowedFrequencies. If MaxFrequency = 1, then it should be allowing anything from 0 to 1 inclusive, since you would type =1 to change freq.

And I think what Dr Brain is trying to say is if you change > to >= then you can't get on freq 9999, only up to 9998.
Mr Ekted - Sat Mar 11, 2006 6:33 pm
Post subject:
It is consistent with subgame.
Smong - Sat Mar 11, 2006 6:44 pm
Post subject:
Fair enough.
Dr Brain - Sun Mar 12, 2006 1:36 am
Post subject:
Smong wrote:
And I think what Dr Brain is trying to say is if you change > to >= then you can't get on freq 9999, only up to 9998.


That's exactly what I was saying. The fact that freqs start at 0 doesn't change where the max is.
Mr Ekted - Sun Mar 12, 2006 2:03 am
Post subject:
MaxFreq is really MaxFreqs, which is a count of the number of valid frequencies (0 to n-1). The variable name in the code is similarly misnamed.
Cyan~Fire - Sun Mar 12, 2006 4:04 pm
Post subject:
Ekted wrote:
The variable name in the code is similarly misnamed.

You have the code?

So I guess VIE just made a mistake in their if statement, then. It seems sad to keep the mistake just for reverse-compatibility. Maybe a new key like "MaxFreq2" or something a bit more creatively named is in order?

On a side note, does this mean that the bold statement on the wiki is wrong?
Mr Ekted - Sun Mar 12, 2006 4:17 pm
Post subject:
Cyan~Fire wrote:
You have the code?


I meant in the asss code.
Smong - Sun Mar 12, 2006 7:12 pm
Post subject:
Cyan~Fire wrote:
On a side note, does this mean that the bold statement on the wiki is wrong?
The emphasised statement applies to asss. I can only imagine either grel (or whoever coded that part of fm_normal) either didn't look at template.sss and concluded the function of the setting from its name, or thought this was another bugged vie setting that could be fixed.

Asss doesn't claim to be a clone of subgame, kill points for example are managed differently in asss (in fact I think the code that calculates kill points might be incomplete, bountyrewardpercent off the top of my head).
Cyan~Fire - Sun Mar 12, 2006 7:52 pm
Post subject:
I know it's not a clone, but seeing as it's so easy to drop a subgame cfg into arena.conf, someone could easily get caught out with this discrepancy.
Mr Ekted - Sun Mar 12, 2006 7:54 pm
Post subject:
Smong wrote:
The emphasised statement applies to asss. I can only imagine either grel (or whoever coded that part of fm_normal) either didn't look at template.sss and concluded the function of the setting from its name, or thought this was another bugged vie setting that could be fixed.

Asss doesn't claim to be a clone of subgame, kill points for example are managed differently in asss (in fact I think the code that calculates kill points might be incomplete, bountyrewardpercent off the top of my head).


I understand that. Being willing to "move forward" is THE strength of asss. But making subtle tweaks to functionality that are not obvious serves to make adoption a bumpy ride. It took us an hour just to figure out why people were able to get in a spider when no settings were changed. Is there a guide to migration from subgame to asss that covers all the changes in settings (and additional settings) to be expected?
CypherJF - Sun Mar 12, 2006 9:50 pm
Post subject:
Quote:
Is there a guide to migration from subgame to asss that covers all the changes in settings (and additional settings) to be expected?


Nope. Though, I'm sure it has been suggested more than once. Whenever I suggested such things all I got was, don't have "time" to do it and that I could "feel free" to do it if I wished.

So good luck. icon_smile.gif
Smong - Mon Mar 13, 2006 6:20 am
Post subject:
Start adding stuff Wiki:Migration Guide.

Edit: Just found this too, although aimed more at developers than zone operators. Wiki:Misc ASSS 'you should know this'.
Grelminar - Tue Mar 14, 2006 2:51 am
Post subject:
This was unintentional. In this case, compatibility is worth more than semantic technicalities. I'll change it to be compatible with subgame.
All times are -5 GMT
View topic
Powered by phpBB 2.0 .0.11 © 2001 phpBB Group