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
clientset.h What is override

 
Post new topic   Reply to topic Printable version
 View previous topic  Ball friction (that time of year again?) Post :: Post baffled by this coding  View next topic  
Author Message
Doc Flabby
Server Help Squatter


Joined: Feb 26 2006
Posts: 636
Offline

PostPosted: Wed Mar 05, 2008 1:44 pm    Post subject: clientset.h What is override Reply to topic Reply with quote

Code: Show/Hide

#ifndef __CLIENTSET_H
#define __CLIENTSET_H

/* Iclientset
*
* this is the interface to the module that manages the client-side
* settings. it loads them from disk when the arena is loaded and when
* the config files change change. arenaman calls SendClientSettings as
* part of the arena response procedure.
*/

typedef u32 override_key_t;

#define I_CLIENTSET "clientset-4"

typedef struct Iclientset
{
   INTERFACE_HEAD_DECL

   void (*SendClientSettings)(Player *p);

   u32 (*GetChecksum)(Player *p, u32 key);

   int (*GetRandomPrize)(Arena *arena);

   override_key_t (*GetOverrideKey)(const char *section, const char *key);
   /* zero return means failure */

   void (*ArenaOverride)(Arena *arena, override_key_t key, i32 val);
   void (*ArenaUnoverride)(Arena *arena, override_key_t key);

   void (*PlayerOverride)(Player *p, override_key_t key, i32 val);
   void (*PlayerUnoverride)(Player *p, override_key_t key);
} Iclientset;


#endif


I'm creating a custom clientsettings module, that sends (result of, ie after inheritance) all the current arena settings to the client as a text file but i need to understand what the "override " means. Also if anyone knows of a module that does this already please let me know.
_________________
Rediscover online gaming. Get Subspace | STF The future...prehaps
Back to top
View users profile Send private message Add User to Ignore List
Dr Brain
Flip-flopping like a wind surfer


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

PostPosted: Wed Mar 05, 2008 3:22 pm    Post subject: Reply to topic Reply with quote

This (untested) code,

Code: Show/Hide
override_key_t warbird_repels = clientset->GetOverrideKey("Warbird", "InitialRepel");
clientset->PlayerOverride(p, warbird_repels, 8);
clientset->SendClientSettings(p);


will make player p's warbird start with 8 repels, but leave the rest of the arena alone. All of the neat settings stuff in hscore is accomplished with overrides.
_________________
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
tcsoccerman
Server Help Squatter


Age:32
Gender:Gender:Male
Joined: Jan 15 2007
Posts: 694
Location: Atlantis
Offline

PostPosted: Wed Mar 05, 2008 4:06 pm    Post subject: Reply to topic Reply with quote

Such as radar icon_smile.gif.

take a look at this module smong made. it helped me ALOT.

this overrides either a freq or player's radarzoom. i forget which one.




radarzoom.c - 3.26 KB
File downloaded or viewed 19 time(s)
Back to top
View users profile Send private message Add User to Ignore List Send email AIM Address
Doc Flabby
Server Help Squatter


Joined: Feb 26 2006
Posts: 636
Offline

PostPosted: Wed Mar 05, 2008 5:39 pm    Post subject: Reply to topic Reply with quote

So essentially it overrides an existing configuration value in a .conf file temporarily, either by player or arena.

(i know it doesn't work exactly like that now, but thats what i want it do to)

cross-link which might help you understand why i'm asking this.
http://www.ssforum.net/index.php?showtopic=19562
Back to top
View users profile Send private message Add User to Ignore List
Doc Flabby
Server Help Squatter


Joined: Feb 26 2006
Posts: 636
Offline

PostPosted: Wed Mar 12, 2008 5:32 pm    Post subject: Reply to topic Reply with quote

I've got another question that kinda follows on from this.

Is there a way to get a listing of ALL the settings associated with an arena, are the settings stored in a list or similar i can iterate over (i assume they are). Basically where are the settings for an arena stored, including those from config files that are included.
Back to top
View users profile Send private message Add User to Ignore List
Dr Brain
Flip-flopping like a wind surfer


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

PostPosted: Wed Mar 12, 2008 6:41 pm    Post subject: Reply to topic Reply with quote

The settings are stored in a hash map. You'll probably have to probe into the depths of config.c to get access to it, since you're trying to violate its encapsulation. Each arena has a ConfigHandle, but the contents are only known to config.h.

It's almost certainly not the approach you want to take, since clients don't need all of the settings (and they shouldn't even have access to some), and some sort of arena backup system should access the files rather than the individual settings so as to keep around useful things like comments and file hierarchy.
Back to top
View users profile Send private message Add User to Ignore List AIM Address Yahoo Messenger MSN Messenger
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: 812 page(s) served in previous 5 minutes.

phpBB Created this page in 0.438411 seconds : 33 queries executed (92.2%): GZIP compression disabled