Author |
Message |
Doc Flabby Server Help Squatter
Joined: Feb 26 2006 Posts: 636 Offline
|
Posted: Wed Mar 05, 2008 1:44 pm Post subject: clientset.h What is override |
|
|
|
|
#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 |
|
|
Dr Brain Flip-flopping like a wind surfer
Age:38 Gender: Joined: Dec 01 2002 Posts: 3502 Location: Hyperspace Offline
|
|
Back to top |
|
|
tcsoccerman Server Help Squatter
Age:31 Gender: Joined: Jan 15 2007 Posts: 694 Location: Atlantis Offline
|
Posted: Wed Mar 05, 2008 4:06 pm Post subject: |
|
|
|
|
Such as radar .
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 |
|
|
Doc Flabby Server Help Squatter
Joined: Feb 26 2006 Posts: 636 Offline
|
Posted: Wed Mar 05, 2008 5:39 pm Post subject: |
|
|
|
|
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 |
|
|
Doc Flabby Server Help Squatter
Joined: Feb 26 2006 Posts: 636 Offline
|
Posted: Wed Mar 12, 2008 5:32 pm Post subject: |
|
|
|
|
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 |
|
|
Dr Brain Flip-flopping like a wind surfer
Age:38 Gender: Joined: Dec 01 2002 Posts: 3502 Location: Hyperspace Offline
|
Posted: Wed Mar 12, 2008 6:41 pm Post subject: |
|
|
|
|
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 |
|
|
|