DEADSOFTWARE

raised protocol
[d2df-sdl.git] / src / game / g_net.pas
index 12194483511c729b73f6feaa1d6280cb12d8485d..8738aa24001a67560546c69f05c9da819462d243 100644 (file)
@@ -1,3 +1,19 @@
+(* Copyright (C)  DooM 2D:Forever Developers
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *)
+{$MODE DELPHI}
 unit g_net;
 
 interface
@@ -6,7 +22,7 @@ uses
   e_log, e_fixedbuffer, ENet, ENetTypes, ENetPlatform, Classes;
 
 const
-  NET_PROTOCOL_VER = 164;
+  NET_PROTOCOL_VER = 168;
 
   NET_MAXCLIENTS = 24;
   NET_CHANS = 11;
@@ -423,14 +439,15 @@ procedure g_Net_Host_CheckPings();
 var
   ClAddr: ENetAddress;
   Buf: ENetBuffer;
-  Len, ClTime: Integer;
-  Ping: array [0..5] of Byte;
+  Len: Integer;
+  ClTime: Int64;
+  Ping: array [0..9] of Byte;
   NPl: Byte;
 begin
   if NetPongSock = ENET_SOCKET_NULL then Exit;
 
   Buf.data := Addr(Ping[0]);
-  Buf.dataLength := 6;
+  Buf.dataLength := 2+8;
 
   Ping[0] := 0;
 
@@ -439,7 +456,7 @@ begin
 
   if (Ping[0] = Ord('D')) and (Ping[1] = Ord('F')) then
   begin
-    ClTime := Integer(Addr(Ping[2])^);
+    ClTime := Int64(Addr(Ping[2])^);
 
     e_Buffer_Clear(@NetOut);
     e_Buffer_Write(@NetOut, Byte(Ord('D')));