DEADSOFTWARE

net: sync moving items and flags
[d2df-sdl.git] / src / game / g_net.pas
index 7dad24c613d1a30243f263f945b77e714f783353..200fd5bedeb52fad78925fe358ae789572a99b0e 100644 (file)
@@ -21,7 +21,7 @@ uses
   e_log, e_msg, utils, ENet, Classes, md5, MAPDEF{$IFDEF USE_MINIUPNPC}, miniupnpc;{$ELSE};{$ENDIF}
 
 const
-  NET_PROTOCOL_VER = 185;
+  NET_PROTOCOL_VER = 187;
 
   NET_MAXCLIENTS = 24;
   NET_CHANS = 12;
@@ -172,6 +172,8 @@ var
   NetGotEverything: Boolean = False;
   NetGotKeys:       Boolean = False;
 
+  NetDeafLevel: Integer = 0;
+
 {$IFDEF USE_MINIUPNPC}
   NetPortForwarded: Word = 0;
   NetPongForwarded: Boolean = False;
@@ -271,7 +273,10 @@ begin
 end;
 
 procedure g_Net_InitLowLevel ();
+  var v: ENetVersion;
 begin
+  v := enet_linked_version();
+  e_LogWritefln('ENet Version: %s.%s.%s', [ENET_VERSION_GET_MAJOR(v), ENET_VERSION_GET_MINOR(v), ENET_VERSION_GET_PATCH(v)]);
   if enet_init_success then raise Exception.Create('wuta?!');
   enet_init_success := (enet_initialize() = 0);
 end;
@@ -2439,6 +2444,7 @@ initialization
   conRegVar('cl_interp', @NetInterpLevel, '', 'net player interpolation steps');
   conRegVar('cl_last_ip', @NetClientIP, '', 'address of the last you have connected to');
   conRegVar('cl_last_port', @NetClientPort, '', 'port of the last server you have connected to');
+  conRegVar('cl_deafen', @NetDeafLevel, '', 'filter server messages (0-3)');
 
   conRegVar('sv_forwardports', @NetForwardPorts, '', 'forward server port using miniupnpc (requires server restart)');
   conRegVar('sv_rcon', @NetAllowRCON, '', 'enable remote console');