Server Help Forum Index Server Help
Community forums for Subgame, ASSS, and bots
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   StatisticsStatistics   RegisterRegister 
 ProfileProfile   Login to check your private messagesLogin to check your private messages   LoginLogin (SSL) 

Server Help | ASSS Wiki (0) | Shanky.com
MaxFreq setting

 
Post new topic   Reply to topic Printable version
 View previous topic  ml->SetTimer() Post :: Post Empty arena sound message and sgcompat  View next topic  
Author Message
stag shot
Newbie


Joined: Jan 18 2005
Posts: 10
Offline

PostPosted: Sat Mar 11, 2006 12:41 pm    Post subject: MaxFreq setting Reply to topic Reply with quote

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
Back to top
View users profile Send private message Add User to Ignore List
Dr Brain
Flip-flopping like a wind surfer


Age:39
Gender:Gender:Male
Joined: Dec 01 2002
Posts: 3502
Location: Hyperspace
Offline

PostPosted: Sat Mar 11, 2006 2:28 pm    Post subject: Reply to topic Reply with quote

I don't see any problem.

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

Smong> so long as 99% deaths feel lame it will always be hyperspace to me
Back to top
View users profile Send private message Add User to Ignore List AIM Address Yahoo Messenger MSN Messenger
Mr Ekted
Movie Geek


Gender:Gender:Male
Joined: Feb 09 2004
Posts: 1379
Offline

PostPosted: Sat Mar 11, 2006 2:57 pm    Post subject: Reply to topic Reply with quote

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
_________________
4,691 irradiated haggis!
Back to top
View users profile Send private message Add User to Ignore List
stag shot
Newbie


Joined: Jan 18 2005
Posts: 10
Offline

PostPosted: Sat Mar 11, 2006 3:58 pm    Post subject: Reply to topic Reply with quote

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
Back to top
View users profile Send private message Add User to Ignore List
Smong
Server Help Squatter


Joined: 1043048991
Posts: 0x91E
Offline

PostPosted: Sat Mar 11, 2006 6:13 pm    Post subject: Reply to topic Reply with quote

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.
Back to top
View users profile Send private message Add User to Ignore List Visit posters website MSN Messenger
Mr Ekted
Movie Geek


Gender:Gender:Male
Joined: Feb 09 2004
Posts: 1379
Offline

PostPosted: Sat Mar 11, 2006 6:33 pm    Post subject: Reply to topic Reply with quote

It is consistent with subgame.
Back to top
View users profile Send private message Add User to Ignore List
Smong
Server Help Squatter


Joined: 1043048991
Posts: 0x91E
Offline

PostPosted: Sat Mar 11, 2006 6:44 pm    Post subject: Reply to topic Reply with quote

Fair enough.
Back to top
View users profile Send private message Add User to Ignore List Visit posters website MSN Messenger
Dr Brain
Flip-flopping like a wind surfer


Age:39
Gender:Gender:Male
Joined: Dec 01 2002
Posts: 3502
Location: Hyperspace
Offline

PostPosted: Sun Mar 12, 2006 1:36 am    Post subject: Reply to topic Reply with quote

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.
Back to top
View users profile Send private message Add User to Ignore List AIM Address Yahoo Messenger MSN Messenger
Mr Ekted
Movie Geek


Gender:Gender:Male
Joined: Feb 09 2004
Posts: 1379
Offline

PostPosted: Sun Mar 12, 2006 2:03 am    Post subject: Reply to topic Reply with quote

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.
Back to top
View users profile Send private message Add User to Ignore List
Cyan~Fire
I'll count you!
I'll count you!


Age:37
Gender:Gender:Male
Joined: Jul 14 2003
Posts: 4608
Location: A Dream
Offline

PostPosted: Sun Mar 12, 2006 4:04 pm    Post subject: Reply to topic Reply with quote

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?
_________________
This help is informational only. No representation is made or warranty given as to its content. User assumes all risk of use. Cyan~Fire assumes no responsibility for any loss or delay resulting from such use.
Wise men STILL seek Him.
Back to top
View users profile Send private message Add User to Ignore List Visit posters website
Mr Ekted
Movie Geek


Gender:Gender:Male
Joined: Feb 09 2004
Posts: 1379
Offline

PostPosted: Sun Mar 12, 2006 4:17 pm    Post subject: Reply to topic Reply with quote

Cyan~Fire wrote:
You have the code?


I meant in the asss code.
Back to top
View users profile Send private message Add User to Ignore List
Smong
Server Help Squatter


Joined: 1043048991
Posts: 0x91E
Offline

PostPosted: Sun Mar 12, 2006 7:12 pm    Post subject: Reply to topic Reply with quote

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).
Back to top
View users profile Send private message Add User to Ignore List Visit posters website MSN Messenger
Cyan~Fire
I'll count you!
I'll count you!


Age:37
Gender:Gender:Male
Joined: Jul 14 2003
Posts: 4608
Location: A Dream
Offline

PostPosted: Sun Mar 12, 2006 7:52 pm    Post subject: Reply to topic Reply with quote

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.
Back to top
View users profile Send private message Add User to Ignore List Visit posters website
Mr Ekted
Movie Geek


Gender:Gender:Male
Joined: Feb 09 2004
Posts: 1379
Offline

PostPosted: Sun Mar 12, 2006 7:54 pm    Post subject: Reply to topic Reply with quote

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?
Back to top
View users profile Send private message Add User to Ignore List
CypherJF
I gargle nitroglycerin


Gender:Gender:Male
Joined: Aug 14 2003
Posts: 2582
Location: USA
Offline

PostPosted: Sun Mar 12, 2006 9:50 pm    Post subject: Reply to topic Reply with quote

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
_________________
Performance is often the art of cheating carefully. - James Gosling
Back to top
View users profile Send private message Add User to Ignore List
Smong
Server Help Squatter


Joined: 1043048991
Posts: 0x91E
Offline

PostPosted: Mon Mar 13, 2006 6:20 am    Post subject: Reply to topic Reply with quote

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'.
Back to top
View users profile Send private message Add User to Ignore List Visit posters website MSN Messenger
Grelminar
Creator of Asss


Joined: Feb 26 2003
Posts: 378
Offline

PostPosted: Tue Mar 14, 2006 2:51 am    Post subject: Reply to topic Reply with quote

This was unintentional. In this case, compatibility is worth more than semantic technicalities. I'll change it to be compatible with subgame.
Back to top
View users profile Send private message Add User to Ignore List Send email Visit posters website
Display posts from previous:   
Post new topic   Reply to topic    Server Help Forum Index -> ASSS Questions All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum
View online users | View Statistics | View Ignored List


Software by php BB © php BB Group
Server Load: 243 page(s) served in previous 5 minutes.

phpBB Created this page in 0.488599 seconds : 41 queries executed (92.8%): GZIP compression disabled