Re: [Freeciv-Dev] (PR#8737) mapview centering error caused by panel resize

2007-12-11 Thread Christian Knoke

URL: http://bugs.freeciv.org/Ticket/Display.html?id=8737 

Jason schrieb am 10. Dec um 22:51 Uhr:

  What about adding just one (constant) line and break up the terrain
  properties properly?
 
 What does that mean?

Line 1: Road|Railroad, Irrigation
Line 2: Mined, Oil|River|...

  An alternative might be to embed this widget into a scrollable frame. 
  Then if it exceeds the size rather than resizing the container it will
  just add scrollbars.  Not perfect but surely better than the current 
  system.
  
  Hey you'll get two scrollbars then ...
 
 You mean in addition to the mapview scrollbar?  That's not a problem.

If the left panel gets a (vertical) scrollbar it needs space for it, and
you'll either get a horizontal scrollbar, too, or you'll have to resize the
panel again.

Christian

-- 
Christian Knoke* * *http://cknoke.de
* * * * * * * * *  Ceterum censeo Microsoft esse dividendum.



___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


Re: [Freeciv-Dev] (PR#39935) cities not disbanded by building engineers at 1pop.

2007-12-11 Thread William Allen Simpson

URL: http://bugs.freeciv.org/Ticket/Display.html?id=39935 

Jason Dorje Short wrote:
 But engineer doesn't take population.  It's not a bug.  Nor is there 
 anything that needs fixing, unless someone finds some part of the 
 documentation that doesn't differentiate worker-type from settler-type 
 units.
 
Civ II Manual, SETTLERS  ENGINEERS, page 114:

 Your civilization produces Settlers and Engineers in the same
manner as it does any other unit, with one caveat. When one of these
units is completed, the population of the city that produced it is
reduced by one point (one citizen on the POPULATION ROSTER),
representing the emigration of these pioneers. If a city has only one
population point when it completes the task of building a Settlers or
Engineer unit, the city disappears when its population is absorbed into
the new unit. This is one of the only ways to eliminate a city that is
in a poor or inconvenient location.

(If that's not working, it's a bug.)



___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


Re: [Freeciv-Dev] (PR#12188) Alt-t key does not work

2007-12-11 Thread William Allen Simpson

URL: http://bugs.freeciv.org/Ticket/Display.html?id=12188 

Jason Dorje Short wrote:
 This command depends on the mouse location - maybe it should be a mouse 
 click and not a keyboard command?
 
Perhaps it should -- in 2.2 -- but that would be a different report.

It's a keyboard command in 2.1.  If it had been fixed 2 years ago, that
would have been a good time to change it.  Now, it's embedded in the help
system and translations.

Let's keep the eye on the prize here.  Waiting for the German translator
to verify whether it fixes his bug report.



___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


Re: [Freeciv-Dev] (PR#39957) multiple bugs in HACK handling

2007-12-11 Thread William Allen Simpson

URL: http://bugs.freeciv.org/Ticket/Display.html?id=39957 

Jason Dorje Short wrote:
 Also the whole point of the HACK check is that the client SHOULD have 
 permission to delete the file created.  If the client cannot write to 
 that file then it should not be granted hack access.

Speaking as an Internet security expert, that's just plain wrong.  It's
merely a token, used as a shared-secret.  It's bad enough that it's used
as a plaintext password.

For security, the files should be controlled and updated by the server.
The client should have no more than read access, especially as the
current scheme is designed for multiple clients accessing the server
installed in a common directory.

Moreover, in a properly designed protocol, the client should be able to
access the server at various control levels remotely.  For 2.2 or 2.3

For 2.1, I'm just fixing the wrongly sent packets!



___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


Re: [Freeciv-Dev] (PR#8737) mapview centering error caused by panel resize

2007-12-11 Thread William Allen Simpson

URL: http://bugs.freeciv.org/Ticket/Display.html?id=8737 

Christian Knoke wrote:
 Line 1: Road|Railroad, Irrigation
 Line 2: Mined, Oil|River|...
 
I almost agree.  More like:

1: terrain description
2: Irrigation, Mine
3: (river)
4: F:%d P:%d T:%d (abbreviations for better right-left translations)
5: %s territory
6: (%d turn cease-fire)
7: cityname, or Minor Tribe Village
...

The current version has most of the lines optional, and that should work.


 If the left panel gets a (vertical) scrollbar it needs space for it, and
 you'll either get a horizontal scrollbar, too, or you'll have to resize the
 panel again.
 
Let's try to avoid scrollbars here.  We already have key conflicts for
PageUp/Down (upper window), and Shift PageUp/Down (lower window), and
don't really want another set for upper left pane

The current version already has some kind of popup feature on the panel,
and that should work!

The multi-line improvement (above) would help all clients, and be useful
for the option/middle mouse button popup, too!



___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] (PR#39957) multiple bugs in HACK handling

2007-12-11 Thread Pepeto _

URL: http://bugs.freeciv.org/Ticket/Display.html?id=39957 

 [jdorje - Mar. Déc. 11 06:55:12 2007]:
 
  [book - Mon Dec 10 16:22:28 2007]:
 
  We ameliorated this situation somewhat for warserver by
  introducing/modifying the cmdlevels to:
 
 [...]
 
 What's the difference between ADMIN and CTRL access levels?
 
 -jason
 
 

ADMIN allows all commands which are not dangerous for the server
(doesn't have file support) but which cannot be obtain by vote. One of
the main possibility of ADMIN is the user support (action list).

However, by experience, people who host warservers doesn't give ADMIN to
anyone, but HACK directly. In a classical action list, you have only:
version=1
basic username=pepeto # your own nick, to don't get hack, which can be
annoying while the game is running
hack address=82.236.117.22 # your ip to get hack otherwise
basic address=* # basic for all others connection


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] (PR#39962) [tracking] 2.1 client saving server settings

2007-12-11 Thread William Allen Simpson

URL: http://bugs.freeciv.org/Ticket/Display.html?id=39962 

Here's an overall tracking ticket for the too often reported problems
with the inability of the client(s) to save and restore server settings.

In 2.1.1, here's a list of game.info fields not saved in the savegames.
Each time the savegame is loaded, they are reset to DEFAULT.

Of course, most of these should not be saved in savegames.  Some are
ruleset dependent, and the client doesn't have the ability to set them.

However, those settable should be /set by the client on reload (only
when the setting is different than that sent by the server).

game.info.add_to_size_limit
game.info.autoupgrade_veteran_loss
game.info.base_bribe_cost
game.info.base_incite_cost
game.info.base_pollution
game.info.base_tech_cost
game.info.celebratesize
game.info.changable_tax
game.info.food_cost
game.info.forced_gold
game.info.forced_luxury
game.info.forced_science
game.info.global_advances
game.info.government_when_anarchy_id
game.info.granary_food_inc
game.info.granary_food_ini
game.info.granary_num_inis
game.info.great_wonders (now in game.destroyed_wonders_new?)
game.info.happy_cost
game.info.hut_overflight
game.info.incite_improvement_factor
game.info.incite_total_factor
game.info.incite_unit_factor
game.info.init_vis_radius_sq
game.info.killstack
game.info.land_defend_building
game.info.min_city_center_output
game.info.min_dist_bw_cities
game.info.natural_city_names
game.info.nbarbarians
game.info.netwait
game.info.nuke_contamination
game.info.num_phases
game.info.num_teams
game.info.palace_building
game.info.phase
game.info.pillage_select
game.info.pingtime
game.info.pingtimeout
game.info.player_idx
game.info.ransom_gold
game.info.save_compress_level
game.info.seconds_to_phasedone
game.info.slow_invasions
game.info.tcptimeout
game.info.team_names_orig
game.info.tech_cost_double_year
game.info.tech_cost_style
game.info.tech_leakage



___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


Re: [Freeciv-Dev] (PR#39962) [tracking] 2.1 client saving server settings

2007-12-11 Thread William Allen Simpson

URL: http://bugs.freeciv.org/Ticket/Display.html?id=39962 

Here is the much shorter list of game.info settable, but not in savegames:

game.info.natural_city_names
game.info.netwait
game.info.pingtime
game.info.pingtimeout
game.info.save_compress_level
game.info.tcptimeout



___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


Re: [Freeciv-Dev] (PR#39935) cities not disbanded by building engineers at 1pop.

2007-12-11 Thread Erik Johansson

URL: http://bugs.freeciv.org/Ticket/Display.html?id=39935 

On Dec 11, 2007 10:05 AM, William Allen Simpson
[EMAIL PROTECTED] wrote:

 URL: http://bugs.freeciv.org/Ticket/Display.html?id=39935 

 Jason Dorje Short wrote:
  But engineer doesn't take population.  It's not a bug.  Nor is there
  anything that needs fixing, unless someone finds some part of the
  documentation that doesn't differentiate worker-type from settler-type
  units.
 
 Civ II Manual, SETTLERS  ENGINEERS, page 114:

Freeciv isn't Civ II, so it works prefectly in freeciv.

Civ2 rulset:
[unit_engineers]
pop_cost  = 1

default rulset:
[unit_engineers]
pop_cost  = 0



___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


Re: [Freeciv-Dev] (PR#39961) Open trading tabs from previous turns have wrong data during current trading...

2007-12-11 Thread Erik Johansson

URL: http://bugs.freeciv.org/Ticket/Display.html?id=39961 

On Dec 11, 2007 12:16 AM, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:

 URL: http://bugs.freeciv.org/Ticket/Display.html?id=39961 

 Any open trading tabs from previous turns have wrong data during current 
 trading because there is no refresh.  For example, Gold data is not refreshed 
 and a NEW trading tab is not opened, so... trading with Gold is all wrong.

Yes the gold amount your opponents have isn't updated in real time on
your client when it is changed on the server side e.g. by
1. diplomatic clause
2. city conquering
3. Caravan arrival

I think it is a feature that you only get new gold updates on turn
done/client reconnect.. :-) It's nice being able to swap gold with
people with out that being seen by the people with embassies.



___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] (PR#39749) [Bug] battle groups keys don't work

2007-12-11 Thread Pepeto _

URL: http://bugs.freeciv.org/Ticket/Display.html?id=39749 

 [wsimpson - Lun. Déc. 10 23:06:36 2007]:
 
 Pepeto _ wrote:
  Battle groups short cuts seems work only with English keyboard. Mine is
  French, and I cannot use this any of this short cuts: I have é'
  instead of [EMAIL PROTECTED]
  
 Problems with the French keyboard have been mentioned before.  It was
 suggested in (PR#15850) 1, 2, 3, and 4 keys don't move unit that
 control and shiftF1 to F12 be used.  Although the ticket was marked
 resolved, it didn't even fix its subject, let alone the underlying issues.
 
 These are completely undocumented, so changing is not a problem
 
 
 

Actually the problem is more complex like this. French and Belgium use
different keyboards (maybe some other nations too). So instead of:
1 - 
2 - é
3 - 
4 - '

shift+1 (!) - 1
shift+2 (@) - 2
shift+3 ($) - 3
shift+4 ($) - 4

In Belgium, this is different too.
When I press 1, it matches shift+1, and there is no way to do 1 or ctrl+1

Let have a look here http://en.wikipedia.org/wiki/AZERTY


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


Re: [Freeciv-Dev] (PR#39749) [Bug] battle groups keys don't work

2007-12-11 Thread William Allen Simpson

URL: http://bugs.freeciv.org/Ticket/Display.html?id=39749 

Yes, but the question is whether control-F1 and control-shift-F1 would fix
the problem on your keyboard?  The code is easy



___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


Re: [Freeciv-Dev] (PR#39935) cities not disbanded by building engineers at 1pop.

2007-12-11 Thread William Allen Simpson

URL: http://bugs.freeciv.org/Ticket/Display.html?id=39935 

Erik Johansson wrote:
 Civ2 rulset:
 [unit_engineers]
 pop_cost  = 1
 
 default rulset:
 [unit_engineers]
 pop_cost  = 0
 
I am already aware of this, and I presume Egor is as well, as he wrote:

   I'm dancing with civ2 ruleset now, so this is my reason of fail.

Could somebody look at the code?  Or even find the code?  I've tried to
figure out disbanding cities (PR#39373), I was unable to fix it.  And
Marko had an earlier report, too.



___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


Re: [Freeciv-Dev] (PR#39962) [tracking] 2.1 client saving server settings

2007-12-11 Thread Jason Dorje Short

URL: http://bugs.freeciv.org/Ticket/Display.html?id=39962 

William Allen Simpson wrote:
 URL: http://bugs.freeciv.org/Ticket/Display.html?id=39962 
 
 Here is the much shorter list of game.info settable, but not in savegames:
 
 game.info.natural_city_names
 game.info.netwait
 game.info.pingtime
 game.info.pingtimeout
 game.info.save_compress_level
 game.info.tcptimeout

That's from 2.1, trunk adds compress_type as well.

Natural_city_names should also be saved.

The others are all network settings and I'm not so sure, but it couldn't 
hurt to include them I suppose.

-jason



___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


Re: [Freeciv-Dev] (PR#39957) multiple bugs in HACK handling

2007-12-11 Thread Jason Dorje Short

URL: http://bugs.freeciv.org/Ticket/Display.html?id=39957 

William Allen Simpson wrote:
 URL: http://bugs.freeciv.org/Ticket/Display.html?id=39957 
 
 Jason Dorje Short wrote:
 Also the whole point of the HACK check is that the client SHOULD have 
 permission to delete the file created.  If the client cannot write to 
 that file then it should not be granted hack access.
 
 Speaking as an Internet security expert, that's just plain wrong.  It's
 merely a token, used as a shared-secret.  It's bad enough that it's used
 as a plaintext password.
 
 For security, the files should be controlled and updated by the server.
 The client should have no more than read access, especially as the
 current scheme is designed for multiple clients accessing the server
 installed in a common directory.
 
 Moreover, in a properly designed protocol, the client should be able to
 access the server at various control levels remotely.  For 2.2 or 2.3
 
 For 2.1, I'm just fixing the wrongly sent packets!

But the point is that having HACK access allows you to write directly to 
the filesystem, through the /save command among others.  HACK access 
should only be given when you do not mind the user having write access. 
  That is why the hack check is done the way it is now and the client is 
supposed to be able to write to the file to get it.

-jason



___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


Re: [Freeciv-Dev] (PR#39935) cities not disbanded by building engineers at 1pop.

2007-12-11 Thread Jason Dorje Short

URL: http://bugs.freeciv.org/Ticket/Display.html?id=39935 

William Allen Simpson wrote:
 URL: http://bugs.freeciv.org/Ticket/Display.html?id=39935 
 
 Erik Johansson wrote:
 Civ2 rulset:
 [unit_engineers]
 pop_cost  = 1

 default rulset:
 [unit_engineers]
 pop_cost  = 0

 I am already aware of this, and I presume Egor is as well, as he wrote:
 
I'm dancing with civ2 ruleset now, so this is my reason of fail.
 
 Could somebody look at the code?  Or even find the code?  I've tried to
 figure out disbanding cities (PR#39373), I was unable to fix it.  And
 Marko had an earlier report, too.

A quick runthrough with civ2 ruleset and techlevel set to 5000 shows 
that cities are disbanded properly when engineers are built.

-jason



___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] (PR#39963) bad things when techlevel goes into future techs

2007-12-11 Thread Jason Dorje Short

URL: http://bugs.freeciv.org/Ticket/Display.html?id=39963 

This is a minor bug and doesn't seem to cause any problems.  But when I
set techlevel 5000 (not normally possible) it takes a while for the game
to start and then I *don't* get any future techs.  Looking at the code
it would seem future techs should be given.

Simplest thing might just be to break the loop once future tech is
reached.  It may also be possible to shorten the loop considerably as
each pick_random_tech() call is rather slow and there are a lot of them.

-jason



___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


Re: [Freeciv-Dev] (PR#39935) cities not disbanded by building engineers at 1pop.

2007-12-11 Thread William Allen Simpson

URL: http://bugs.freeciv.org/Ticket/Display.html?id=39935 

Thanks for confirming, not-a-bug!



___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


Re: [Freeciv-Dev] (PR#39959) SaveGame compression level changes when Leaving (re)Loading savegames!

2007-12-11 Thread William Allen Simpson

URL: http://bugs.freeciv.org/Ticket/Display.html?id=39959 

Jason Dorje Short wrote:
 Are you sure it's the same server session?

I'm sure it's the same *client* session.  I've verified the problem.

Think like a user.  Users don't care that servers are forked and reloaded,
they just see that something worked and then quit working, hidden from
view in a closed menu with no change notification.


 The compress level is no more of a client setting than the savename, 
 which is also saved in the savegame.  It is, in fact, a server setting. 
   Having it controlled by the client is possible 

It is, indeed, controlled by the _Game server options menu.

I'm glad this was brought to our attention.  This old and crufty code
turned out to have wrong data sent from server to client, uninitialized
variable and bad data problems, and doesn't perform according to the
documentation.  It is one of several settings with this problem.

See PR#39962 and PR#39964.



___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] (PR#39964) BUG: server settable options uninitialized and bad values

2007-12-11 Thread William Allen Simpson

URL: http://bugs.freeciv.org/Ticket/Display.html?id=39964 

This is old and crufty code!  Used malloc() instead of calloc(), so
uninitialized variables have bad data.

Server sent 0 for bool max (bad), and other fields (probably OK).

The client never set the default values (leaving them uninitialized),
although they were sent over the network.

And, client assert() for negative id, but never tested for id out of range.

And, client assert() for bad type.

And, client never tested for missing categories.

And, client never set various string pointers to NULL, so free() potentially
could have problems

Fixed all the above, adding LOG_ERROR instead of dying.

Never trust network data!

Also, use the same variable names in client, network, and server.

Compiles and runs for both GTK2 and XAW.

gui-win32 doesn't use proper symbols, so somebody else should fix it.

Index: server/settings.h
===
--- server/settings.h   (revision 14152)
+++ server/settings.h   (working copy)
@@ -71,9 +71,9 @@
* etc, and should end with a .
*/
   const char *extra_help;
-  enum sset_type type;
-  enum sset_category category;
-  enum sset_level level;
+  enum sset_type stype;
+  enum sset_category scategory;
+  enum sset_level slevel;
 
   /* 
* About the *_validate functions: If the function is non-NULL, it
Index: server/stdinhand.c
===
--- server/stdinhand.c  (revision 14152)
+++ server/stdinhand.c  (working copy)
@@ -1114,7 +1114,7 @@
 for (i=0;settings[i].name;i++) {
   struct settings_s *op = settings[i];
 
-  switch (op-type) {
+  switch (op-stype) {
   case SSET_INT:
fprintf(script_file, set %s %i\n, op-name, *op-int_value);
break;
@@ -1551,7 +1551,7 @@
  ? _(changeable) : _(fixed)));
   
   if (may_view_option(caller, id)) {
-switch (op-type) {
+switch (op-stype) {
 case SSET_BOOL:
   cmd_reply(help_cmd, caller, C_COMMENT,
_(Value: %d, Minimum: 0, Default: %d, Maximum: 1),
@@ -1678,19 +1678,21 @@
 sz_strlcpy(packet.short_help, setting-short_help);
 sz_strlcpy(packet.extra_help, setting-extra_help);
 
-packet.category = setting-category;
-packet.type = setting-type;
-packet.class = setting-sclass;
+packet.stype = setting-stype;
+packet.scategory = setting-scategory;
+packet.sclass = setting-sclass;
 packet.is_visible = (sset_is_to_client(setting_id)
 || pconn-access_level == ALLOW_HACK);
 
 if (packet.is_visible) {
-  switch (setting-type) {
+  switch (setting-stype) {
   case SSET_STRING:
strcpy(packet.strval, setting-string_value);
strcpy(packet.default_strval, setting-string_default_value);
break;
   case SSET_BOOL:
+   packet.min = FALSE;
+   packet.max = TRUE;
packet.val = *(setting-bool_value);
packet.default_val = setting-bool_default_value;
break;
@@ -1968,9 +1970,9 @@
   int len = 0;
 
  
-   if ((level == SSET_ALL || op-level == level || cmd = 0 
+   if ((level == SSET_ALL || op-slevel == level || cmd = 0 
  || level == SSET_CHANGED))  {
-   switch (op-type) {
+   switch (op-stype) {
 case SSET_BOOL: 
  if (*op-bool_value != op-bool_default_value) {
is_changed = TRUE;
@@ -2485,7 +2487,7 @@
   do_update = FALSE;
   buffer[0] = '\0';
 
-  switch (op-type) {
+  switch (op-stype) {
   case SSET_BOOL:
 if (sscanf(arg, %d, val) != 1) {
   cmd_reply(CMD_SET, caller, C_SYNTAX, _(Value must be an integer.));
Index: common/packets.def
===
--- common/packets.def  (revision 14152)
+++ common/packets.def  (working copy)
@@ -1327,8 +1327,8 @@
   STRING short_help[MAX_LEN_PACKET];
   STRING extra_help[MAX_LEN_PACKET];
 
-  SSET_TYPE type;
-  SSET_CLASS class;
+  SSET_TYPE stype;
+  SSET_CLASS sclass;
   BOOL is_visible;
 
   SINT32 val;  /* value for bool or int */
@@ -1339,7 +1339,7 @@
   STRING strval[MAX_LEN_PACKET];   /* space for string */
   STRING default_strval[MAX_LEN_PACKET];   /* space for string */
 
-  UINT8 category;  /* which category this is in */
+  UINT8 scategory;
 end
 
 /** Effects hash packets **/
Index: manual/civmanual.c
===
--- manual/civmanual.c  (revision 14152)
+++ manual/civmanual.c  (working copy)
@@ -141,9 +141,9 @@
   fprintf(doc, pre%s/pre\n\n, abuf.str);
 }
 fprintf(doc, p class=\misc\);
-fprintf(doc, _(Level: %s.br), _(sset_level_names[op-level]));
+fprintf(doc, _(Level: %s.br), _(sset_level_names[op-slevel]));
 fprintf(doc, _(Category: %s.br),
-_(sset_category_names[op-category]));
+