X-Git-Url: http://deadsoftware.ru/gitweb?a=blobdiff_plain;f=src%2Fgame%2Fg_net.pas;h=b8f957a32cfb32840360e0382db804f931611506;hb=bd49d7f62886832d9d3b4bf0169269315fe7262f;hp=a1c07701018a99b84c38dcf198214d923bbd0e77;hpb=dfd3e97bffa213f5b21206b8a292b80180bab948;p=d2df-sdl.git diff --git a/src/game/g_net.pas b/src/game/g_net.pas index a1c0770..b8f957a 100644 --- a/src/game/g_net.pas +++ b/src/game/g_net.pas @@ -1,3 +1,4 @@ +{$MODE DELPHI} unit g_net; interface @@ -6,7 +7,7 @@ uses e_log, e_fixedbuffer, ENet, ENetTypes, ENetPlatform, Classes; const - NET_PROTOCOL_VER = 164; + NET_PROTOCOL_VER = 165; NET_MAXCLIENTS = 24; NET_CHANS = 11; @@ -423,14 +424,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 +441,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'))); @@ -535,7 +537,7 @@ begin ENET_EVENT_TYPE_DISCONNECT: begin ID := Byte(NetEvent.peer^.data^); - if ID > High(NetClients) then Exit; + if ID > High(NetClients) then Exit; TC := @NetClients[ID]; if TC = nil then Exit; @@ -745,7 +747,7 @@ begin end; ProcessLoading(); - + e_PollInput(); if e_KeyPressed(IK_ESCAPE) or e_KeyPressed(IK_SPACE) then