X-Git-Url: http://deadsoftware.ru/gitweb?a=blobdiff_plain;f=src%2Fgame%2Fg_netmaster.pas;h=afc88a72944396474173303e5852c5e486a88afa;hb=af3c404e11867c6794975f1d45dd98932d804ede;hp=e0eed50cdb6668dae4b2fd19671556f3cd92325c;hpb=9abb24523fd7fcb7778fda5920f7d0b39175eb61;p=d2df-sdl.git diff --git a/src/game/g_netmaster.pas b/src/game/g_netmaster.pas index e0eed50..afc88a7 100644 --- a/src/game/g_netmaster.pas +++ b/src/game/g_netmaster.pas @@ -1,3 +1,4 @@ +{$MODE DELPHI} unit g_netmaster; interface @@ -23,7 +24,7 @@ type Port: Word; Map: string; Players, MaxPlayers, LocalPl, Bots: Byte; - Ping: Integer; + Ping: Int64; GameMode: Byte; Password: Boolean; PingAddr: ENetAddress; @@ -57,7 +58,7 @@ implementation uses SysUtils, e_fixedbuffer, e_input, e_graphics, e_log, g_window, g_net, g_console, - g_map, g_game, g_sound, g_textures, g_gui, g_menu, g_options, g_language, WADEDITOR, + g_map, g_game, g_sound, g_textures, g_gui, g_menu, g_options, g_language, wadreader, ENetPlatform; var @@ -66,7 +67,7 @@ var slFetched: Boolean = False; slDirPressed: Boolean = False; -function GetTimerMS(): Integer; +function GetTimerMS(): Int64; begin Result := GetTimer() {div 1000}; end; @@ -74,17 +75,17 @@ end; procedure PingServer(var S: TNetServer; Sock: ENetSocket); var Buf: ENetBuffer; - Ping: array [0..5] of Byte; - ClTime: Integer; + Ping: array [0..9] of Byte; + ClTime: Int64; begin ClTime := GetTimerMS(); Buf.data := Addr(Ping[0]); - Buf.dataLength := 6; + Buf.dataLength := 2+8; Ping[0] := Ord('D'); Ping[1] := Ord('F'); - LongInt(Addr(Ping[2])^) := ClTime; + Int64(Addr(Ping[2])^) := ClTime; enet_socket_send(Sock, Addr(S.PingAddr), @Buf, 1); end; @@ -94,7 +95,8 @@ var Cnt: Byte; P: pENetPacket; MID: Byte; - I, T, RX: Integer; + I, RX: Integer; + T: Int64; Sock: ENetSocket; Buf: ENetBuffer; SvAddr: ENetAddress; @@ -196,7 +198,7 @@ begin begin with SL[I] do begin - Ping := e_Buffer_Read_LongInt(@NetIn); + Ping := e_Buffer_Read_Int64(@NetIn); Ping := GetTimerMS() - Ping; Name := e_Buffer_Read_String(@NetIn); Map := e_Buffer_Read_String(@NetIn); @@ -221,8 +223,8 @@ var Wad, Map: string; Cli: Byte; begin - g_ProcessResourceStr(gMapInfo.Map, @Wad, nil, @Map); - Wad := ExtractFileName(Wad); + Wad := g_ExtractWadNameNoPath(gMapInfo.Map); + Map := g_ExtractFileName(gMapInfo.Map); e_Buffer_Write(@NetOut, NetServerName);