Complete.Org: Mailing Lists: Archives: freeciv-dev: March 2001:
[Freeciv-Dev] PATCH: worklists saved on client side
Home

[Freeciv-Dev] PATCH: worklists saved on client side

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv-dev <freeciv-dev@xxxxxxxxxxx>
Subject: [Freeciv-Dev] PATCH: worklists saved on client side
From: Mike Kaufman <mkaufman@xxxxxxxxxxxxxx>
Date: Tue, 13 Mar 2001 16:30:17 -0600 (CST)

I personally hate to reenter my favorite worklists every time I start a
new game, and half the time I just don't bother.
attached is a patch that saves your global worklists to the .civclientrc
file (when you save your options)

(from March 9 snapshot)

There are several issues with this patch that make it more a proof of
concept and not ready for inclusion:

1. I changed the save_options() from fprintf to secfile_insert_*() is this
a problem?

2. send_saved_worklists() overwrites any global worklists defined in the
savefile making it fairly useless to put any in the savefile (I think)

3. send_saved_worklists() puts packet code in options.c it could probably
be put elsewhere (where?)

4. load_options() has to be called twice to let this code work (the
rulesets have got to be sent first).

    if ((pwl->wlefs[i] <= WEF_END) || (pwl->wlefs[i] >= WEF_LAST) ||
       ((pwl->wlefs[i] == WEF_UNIT) && !unit_type_exists(pwl->wlids[i])) ||
       ((pwl->wlefs[i] == WEF_IMPR) && !improvement_exists(pwl->wlids[i]))) {

I would have taken load_options() out of the gui code, but for the comment
in the mui code that says that that function needs to be called first.

we could load all the options save for the worklists and then load the
worklists when we call send_saved_worklists(), but then we get spurious
unused entry warnings... solutions?

5. worklist_save() and worklist_load() are [practically] duplicated from
server/savegame.c, they could go somewhere in common/ (maybe worklist.c?) 

I wanted to change as little code as possible to provide code to look at.

--mike

Attachment: wl_patch
Description: Text document


[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] PATCH: worklists saved on client side, Mike Kaufman <=