Update of /cvsroot/netrek/client/netrekxp/src In directory sc8-pr-cvs16:/tmp/cvs-serv17999/src Modified Files: data.c feature.c input.c map.c mswindow.c socket.c Log Message: Bug fix using = when should have used ==. Added support for server feature packets TURN_KEYS and SHOW_VISIBILITY_RANGE, client will only be allowed to show visibility range on galactic if server allows it. Same with using keypad to turn ship. Changed CHECK_PLANETS to send a request for a planet cross-check at a rate of 10 planets/second, rather than updating all planets at once. Also, dashboard packet lights will no longer show packet requests from CP_PLANET. Index: mswindow.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/mswindow.c,v retrieving revision 1.78 retrieving revision 1.79 diff -u -d -r1.78 -r1.79 --- mswindow.c 22 Apr 2007 07:24:30 -0000 1.78 +++ mswindow.c 23 Apr 2007 07:19:30 -0000 1.79 @@ -1888,7 +1888,7 @@ { if (wParam == SC_MAXIMIZE) mainMaximized = 1; - else if (wParam = SC_RESTORE) + else if (wParam == SC_RESTORE) mainMaximized = 0; } break; Index: input.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/input.c,v retrieving revision 1.36 retrieving revision 1.37 diff -u -d -r1.36 -r1.37 --- input.c 14 Apr 2007 07:44:35 -0000 1.36 +++ input.c 23 Apr 2007 07:19:30 -0000 1.37 @@ -3545,6 +3545,9 @@ { unsigned char course; + /* Server must allow turn keys */ + if (!F_turn_keys) return; + /* Observers can't turn */ if (me->p_flags & PFOBSERV) return; @@ -3561,6 +3564,9 @@ { unsigned char course; + /* Server must allow turn keys */ + if (!F_turn_keys) return; + /* Observers can't turn */ if (me->p_flags & PFOBSERV) return; Index: socket.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/socket.c,v retrieving revision 1.28 retrieving revision 1.29 diff -u -d -r1.28 -r1.29 --- socket.c 9 Apr 2007 07:46:13 -0000 1.28 +++ socket.c 23 Apr 2007 07:19:30 -0000 1.29 @@ -1550,8 +1550,13 @@ #endif if (packetLights) - light_send(); - + { + // Planet cross-checks get sent very rapidly, thus negating the + // usefulness of packet lights. + if (packet->type != CP_PLANET) + light_send(); + } + if (commMode == COMM_UDP) { /* for now, just sent everything via TCP */ Index: data.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/data.c,v retrieving revision 1.85 retrieving revision 1.86 diff -u -d -r1.85 -r1.86 --- data.c 18 Apr 2007 09:41:32 -0000 1.85 +++ data.c 23 Apr 2007 07:19:30 -0000 1.86 @@ -686,6 +686,8 @@ int F_show_army_count = 0; int F_show_other_speed = 0; int F_show_cloakers = 0; +int F_turn_keys = 0; +int F_show_visibility_range = 0; #ifdef RECORDGAME int F_many_self = 0; Index: feature.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/feature.c,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- feature.c 5 Apr 2007 12:57:22 -0000 1.14 +++ feature.c 23 Apr 2007 07:19:30 -0000 1.15 @@ -97,6 +97,8 @@ {"SHOW_ARMY_COUNT", &F_show_army_count, 'S', 1, 0, 0}, {"SHOW_OTHER_SPEED", &F_show_other_speed, 'S', 1, 0, 0}, {"SHOW_CLOAKERS", &F_show_cloakers, 'S', 1, 0, 0}, + {"TURN_KEYS", &F_turn_keys, 'S', 1, 0, 0}, + {"SHOW_VISIBILITY_RANGE", &F_show_visibility_range, 'S', 1, 0, 0}, {0, 0, 0, 0, 0, 0} }; @@ -278,6 +280,8 @@ F_show_army_count = 1; F_show_other_speed = 1; F_show_cloakers = 1; + F_turn_keys = 1; + F_show_visibility_range = 1; #endif #endif /* BEEPLITE */ } Index: map.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/map.c,v retrieving revision 1.52 retrieving revision 1.53 diff -u -d -r1.52 -r1.53 --- map.c 14 Apr 2007 02:56:19 -0000 1.52 +++ map.c 23 Apr 2007 07:19:30 -0000 1.53 @@ -504,8 +504,10 @@ for (l = planets + MAXPLANETS - 1; l >= planets; --l) { - /* Synchronize planet info (up to 10 times/second) for current orbitted planet - and once every 5 seconds for all other planets we have info on */ + /* Synchronize planet info (up to 10 times/second) for current orbitted + planet. For all other planets, send info on planet 0 through planet + MAXPLANETS every MAXPLANETS/10 seconds, one planet at a time, + 10 times/second. Only send info is planet is "touched" */ if (F_check_planets) { if ((me->p_flags & PFORBIT) @@ -518,11 +520,9 @@ orbit_planet_refresh = 0; } } - else if (l->pl_info & me->p_team) - { - if ((planet_refresh * 10 / server_ups) >= 50) - sendPlanetsPacket(l->pl_no); - } + else if ((planet_refresh == l->pl_no * server_ups / 10) + && (l->pl_info & me->p_team)) + sendPlanetsPacket(l->pl_no); } if (!(l->pl_flags & PLREDRAW)) @@ -984,7 +984,7 @@ /* Increment counter for requesting planet sync (F_check_planets) */ if (F_check_planets) { - if ((planet_refresh * 10 / server_ups) >= 50) + if ((planet_refresh * 10 / server_ups) >= MAXPLANETS) planet_refresh = 0; else planet_refresh++; @@ -1112,7 +1112,8 @@ #endif /* Draw range circle */ - if (viewRange && (myPlayer(j) || isObsLockPlayer(j)) + if (viewRange && F_show_visibility_range + && (myPlayer(j) || isObsLockPlayer(j)) && j->p_ship.s_type != STARBASE) { /* Orbitting any non-owned planet gets you seen,