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
Periodic.c

 
Post new topic   Reply to topic Printable version
 View previous topic  asss.yi.org is down -- Anyone have ASS... Post :: Post Detecting Mines  View next topic  
Author Message
Hakaku
Server Help Squatter


Joined: Apr 07 2006
Posts: 299
Location: Canada
Offline

PostPosted: Mon Feb 09, 2009 7:28 am    Post subject: Periodic.c Reply to topic Reply with quote

Concerning periodic.c; I don't really understand how it works, but how would it be possible for it not to send a player/frequency the periodic reward packet if the reward returns 0 points? Subgame never announced the reward when it was 0, so it's really a nuisanced.
Back to top
View users profile Send private message Add User to Ignore List Send email
D1st0rt
Miss Directed Wannabe


Age:37
Gender:Gender:Male
Joined: Aug 31 2003
Posts: 2247
Location: Blacksburg, VA
Offline

PostPosted: Mon Feb 09, 2009 10:55 am    Post subject: Reply to topic Reply with quote

The way it works right now is that it sends one packet containing the periodic reward values for all frequencies as 4 repeating bytes.

This patch should do it, but I haven't tested

Code: Show/Hide
--- periodic.c  2009-02-09 11:53:14.000000000 -0500
+++ periodic.c.2        2009-02-09 11:53:04.000000000 -0500
@@ -80,14 +80,21 @@
                        fd = (freq_data*)TrGet(fdata, freq);
                        if (fd == NULL)
                        {
-                               fd = amalloc(sizeof(*fd));
-                               fd->head.key = freq;
-                               fd->players = 0;
-                               fd->flags = flagcore->CountFreqFlags(set->arena, freq);
-                               TrPut(&fdata, &fd->head);
-                               freqcount++;
+                               int flags = flagcore->CountFreqFlags(set->arena, freq);
+                               if(flags)
+                               {
+                                       fd = amalloc(sizeof(*fd));
+                                       fd->head.key = freq;
+                                       fd->players = 1;
+                                       fd->flags = flags;
+                                       TrPut(&fdata, &fd->head);
+                                       freqcount++;
+                               }
+                       }
+                       else
+                       {
+                               fd->players++;
                        }
-                       fd->players++;
                        totalplayers++;
                }
        pd->Unlock();

_________________

Back to top
View users profile Send private message Add User to Ignore List Visit posters website
Hakaku
Server Help Squatter


Joined: Apr 07 2006
Posts: 299
Location: Canada
Offline

PostPosted: Tue Feb 10, 2009 4:41 pm    Post subject: Reply to topic Reply with quote

Thanks D1st0rt, I'll give it a shot and see how it goes.



Edit: Yep, it works as hoped it would.
Back to top
View users profile Send private message Add User to Ignore List Send email
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: 174 page(s) served in previous 5 minutes.

phpBB Created this page in 0.494297 seconds : 28 queries executed (94.5%): GZIP compression disabled