Summary: cleanup of load_ruleset_game()
                 Project: Freeciv
            Submitted by: syntron
            Submitted on: Dienstag 18.08.2009 um 12:23
                Category: general
                Priority: 3 - Low
                  Status: None
                 Privacy: Public
             Assigned to: None
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
         Planned Release: None



cleanup of load_ruleset_game()
* define min/max/default values for most ruleset settings
* define the standard values for all ruleset settings in game.h using 'RS_*'
* add secfile_lookup_int_default_min_max() function which uses the min/max
value if the ruleset setting is out of range

(see also patch 1203)

Marko said:

> 3) I'm against secfile_lookup_int_default_min_max() that would directly
exit() the server. We should change ruleset loading failure to act nicely in
general and proposed secfile_lookup_int_default_min_max() goes to opposite
direction. It's even worse than rest of the current ruleset loading code in
that it doesn't send failure messages to client that spawned the server. 

So this changed version uses the min/max value if the ruleset setting is out
of range. This is reported as LOG_ERROR. 
How should the functions in registry.c be changed to send a message to the
clients? An extra argument 'char *err_msg' could be added to each of these
functions. It would be NULL if there is no error, else it would contain the
error message which will be send to the client.

If there are default values for all ruleset settings one could start with an
empty (/default/)game.ruleset file ...


File Attachments:

Date: Dienstag 18.08.2009 um 12:23  Name:
0004-cleanup-of-load_ruleset_game.patch  Size: 29kB   By: syntron



Reply to this item at:


  Nachricht geschickt von/durch Gna!

Freeciv-dev mailing list

Reply via email to