Update of /cvsroot/netrek/client/netrekxp/src
In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv5901/src
Modified Files:
data.c defaults.c feature.c planetlist.c playback.c socket.c
Log Message:
Added support for new server feature packet FULL_DIRECTION_RESOLUTION.
Added partial support for support for new server feature packet SP_GENERIC_32.
Added new netrekrc option useFullShipInfo, to determine whether user wants to
use the FULL_DIRECTION_RESOLUTION feature packet (all other feature packets
are hard coded in as to on/off).
Index: planetlist.c
===================================================================
RCS file: /cvsroot/netrek/client/netrekxp/src/planetlist.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- planetlist.c 10 Dec 2006 02:49:14 -0000 1.3
+++ planetlist.c 12 Dec 2006 04:47:08 -0000 1.4
@@ -18,9 +18,6 @@
#include "data.h"
#include "proto.h"
-/* Local functions */
-void updatePlanetw (void);
-
static char priorplanets[MAXPLANETS][BUFSIZ];
static char *teamname[9] = {
Index: playback.c
===================================================================
RCS file: /cvsroot/netrek/client/netrekxp/src/playback.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- playback.c 29 Nov 2006 12:40:22 -0000 1.14
+++ playback.c 12 Dec 2006 04:47:08 -0000 1.15
@@ -506,6 +506,7 @@
case SP_S_YOU_SS:
case SP_S_PLAYER:
case SP_SHIP_CAP:
+ case SP_GENERIC_32:
case SP_S_TORP:
case SP_S_TORP_INFO:
case SP_S_8_TORP:
Index: defaults.c
===================================================================
RCS file: /cvsroot/netrek/client/netrekxp/src/defaults.c,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -d -r1.34 -r1.35
--- defaults.c 30 Nov 2006 11:28:56 -0000 1.34
+++ defaults.c 12 Dec 2006 04:47:06 -0000 1.35
@@ -749,6 +749,12 @@
NULL
}
},
+ {"useFullShipInfo", &useFullShipInfo, RC_BOOL,
+ {
+ "Display other ships to 256 directions instead of 16",
+ NULL
+ }
+ },
#ifdef BEEPLITE
{"useLite", &useLite, RC_BOOL,
{
@@ -1491,6 +1497,7 @@
newQuit = booleanDefault ("newQuit", newQuit);
newSound = booleanDefault ("newSound", newSound);
newSoundAngles = booleanDefault ("newSoundAngles", newSoundAngles);
+ useFullShipInfo = booleanDefault ("useFullShipInfo", useFullShipInfo);
tpDotDist = intDefault ("tpDotDist", tpDotDist);
omitTeamLetter = booleanDefault ("omitTeamLetter", omitTeamLetter);
beepOnPrivateMessage = booleanDefault ("beepOnPrivateMessage", beepOnPrivateMessage);
Index: data.c
===================================================================
RCS file: /cvsroot/netrek/client/netrekxp/src/data.c,v
retrieving revision 1.45
retrieving revision 1.46
diff -u -d -r1.45 -r1.46
--- data.c 2 Dec 2006 11:24:43 -0000 1.45
+++ data.c 12 Dec 2006 04:47:05 -0000 1.46
@@ -660,6 +660,8 @@
int F_self_19flags = 1;
int F_ship_cap = 0;
int F_show_all_tractors = 1;
+int F_sp_generic_32 = 0;
+int F_full_direction_resolution = 0;
#ifdef RECORDGAME
int F_many_self = 0;
@@ -786,4 +788,6 @@
int richText = 0; /* temporary variable to select rich text message windows */
int newQuit = 0; /* new quit clock */
int newSound = 1; /* use new SDL sound */
-int newSoundAngles = 1; /* use new SDL sound with angular 3d component */
\ No newline at end of file
+int newSoundAngles = 1; /* use new SDL sound with angular 3d component */
+
+int useFullShipInfo = 1; /* Prefer SP_PLAYER packets over SP_S_PLAYER packets */
\ No newline at end of file
Index: feature.c
===================================================================
RCS file: /cvsroot/netrek/client/netrekxp/src/feature.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- feature.c 21 Apr 2006 12:00:06 -0000 1.3
+++ feature.c 12 Dec 2006 04:47:08 -0000 1.4
@@ -76,6 +76,8 @@
{"SELF_8FLAGS2", &F_self_8flags2, 'S', 0, 0, 0},
{"19FLAGS", &F_self_19flags, 'S', 1, 0, 0},
{"SHIP_CAP", &F_ship_cap, 'S', 1, 0, 0},
+ {"SP_GENERIC_32", &F_sp_generic_32, 'S', 1, 0, 0},
+ {"FULL_DIRECTION_RESOLUTION", &F_full_direction_resolution, 'S', 1, 0, 0},
#ifdef WARP_DEAD
{"DEAD_WARP", &F_dead_warp, 'S', 1, 0, 0},
@@ -107,12 +109,13 @@
if (strcmpi (f->name, "FEATURE_PACKETS") != 0)
sendFeature (f->name,
f->feature_type,
- f->value,
+ (!strcmp(f->name, "FULL_DIRECTION_RESOLUTION") ? useFullShipInfo : f->value),
(char) (f->arg1 ? *f->arg1 : 0),
(char) (f->arg2 ? *f->arg2 : 0));
#ifdef DEBUG
- LineToConsole ("(C->S) %s (%c): %d\n", f->name, f->feature_type, f->value);
+ LineToConsole ("(C->S) %s (%c): %d\n", f->name, f->feature_type,
+ !strcmp(f->name, "FULL_DIRECTION_RESOLUTION") ? useFullShipInfo : f->value);
#endif
}
}
Index: socket.c
===================================================================
RCS file: /cvsroot/netrek/client/netrekxp/src/socket.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- socket.c 10 Dec 2006 02:49:14 -0000 1.10
+++ socket.c 12 Dec 2006 04:47:08 -0000 1.11
@@ -145,7 +145,7 @@
{0, dummy}, /* #31, and dummy won't */
#endif
- {0, dummy}, /* 32 */
+ {sizeof (struct generic_32_spacket), handleGeneric32}, /* SP_GENERIC_32 */
{0, dummy}, /* 33 */
{0, dummy}, /* 34 */
{0, dummy}, /* 35 */
@@ -1680,6 +1680,8 @@
strcpy (packet.login, login);
packet.type = CP_LOGIN;
packet.query = query;
+ //packet.pad2 = 0x69; /* Paradise support */
+ //packet.pad3 = 0x43; /* Paradise support */
sendServerPacket ((struct player_spacket *) &packet);
}
@@ -2360,6 +2362,29 @@
redrawStats ();
}
+void
+handleGeneric32 (struct generic_32_spacket *packet)
+{
+/*
+ unsigned short stype;
+
+ stype = ntohs (packet->s_type);
+ shipvals[stype].s_torpspeed = ntohs (packet->s_torpspeed);
+ shipvals[stype].s_maxshield = ntohl (packet->s_maxshield);
+ shipvals[stype].s_maxdamage = ntohl (packet->s_maxdamage);
+ shipvals[stype].s_maxegntemp = ntohl (packet->s_maxegntemp);
+ shipvals[stype].s_maxwpntemp = ntohl (packet->s_maxwpntemp);
+ shipvals[stype].s_maxarmies = ntohs (packet->s_maxarmies);
+ shipvals[stype].s_maxfuel = ntohl (packet->s_maxfuel);
+ shipvals[stype].s_maxspeed = ntohl (packet->s_maxspeed);
+ shipvals[stype].s_width = ntohs (packet->s_width);
+ shipvals[stype].s_height = ntohs (packet->s_height);
+ shipvals[stype].s_phaserdamage = ntohs (packet->s_phaserrange);
+ getship (myship, myship->s_type);
+*/
+
+}
+
#ifdef RSA
void
handleRSAKey (struct rsa_key_spacket *packet)