index 194a1eda69d89aaaa2212206c09b3f4cc2293086..916f7cdf3fbf9d31524d04bc7e35c9a6f122a114 100644 (file)
--- a/src/game/g_netmaster.pas
+++ b/src/game/g_netmaster.pas
+{$MODE DELPHI}
unit g_netmaster;
interface
unit g_netmaster;
interface
Port: Word;
Map: string;
Players, MaxPlayers, LocalPl, Bots: Byte;
Port: Word;
Map: string;
Players, MaxPlayers, LocalPl, Bots: Byte;
- Ping: Integer;
+ Ping: Int64;
GameMode: Byte;
Password: Boolean;
PingAddr: ENetAddress;
GameMode: Byte;
Password: Boolean;
PingAddr: ENetAddress;
uses
SysUtils, e_fixedbuffer, e_input, e_graphics, e_log, g_window, g_net, g_console,
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
ENetPlatform;
var
slFetched: Boolean = False;
slDirPressed: Boolean = False;
slFetched: Boolean = False;
slDirPressed: Boolean = False;
-function GetTimerMS(): Integer;
+function GetTimerMS(): Int64;
begin
begin
- Result := GetTimer() div 1000;
+ Result := GetTimer() {div 1000};
end;
procedure PingServer(var S: TNetServer; Sock: ENetSocket);
var
Buf: ENetBuffer;
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]);
begin
ClTime := GetTimerMS();
Buf.data := Addr(Ping[0]);
- Buf.dataLength := 6;
+ Buf.dataLength := 2+8;
Ping[0] := Ord('D');
Ping[1] := Ord('F');
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;
enet_socket_send(Sock, Addr(S.PingAddr), @Buf, 1);
end;
Cnt: Byte;
P: pENetPacket;
MID: Byte;
Cnt: Byte;
P: pENetPacket;
MID: Byte;
- I, T, RX: Integer;
+ I, RX: Integer;
+ T: Int64;
Sock: ENetSocket;
Buf: ENetBuffer;
SvAddr: ENetAddress;
Sock: ENetSocket;
Buf: ENetBuffer;
SvAddr: ENetAddress;
begin
with SL[I] do
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);
Ping := GetTimerMS() - Ping;
Name := e_Buffer_Read_String(@NetIn);
Map := e_Buffer_Read_String(@NetIn);
if SL = nil then Exit;
if SL = nil then Exit;
- if e_KeyPressed(IK_RETURN) then
+ if e_KeyPressed(IK_RETURN) or e_KeyPressed(IK_KPRETURN) then
begin
if not slReturnPressed then
begin
begin
if not slReturnPressed then
begin
else
slReturnPressed := False;
else
slReturnPressed := False;
- if e_KeyPressed(IK_DOWN) then
+ if e_KeyPressed(IK_DOWN) or e_KeyPressed(IK_KPDOWN) then
begin
if not slDirPressed then
begin
begin
if not slDirPressed then
begin
end;
end;
end;
end;
- if e_KeyPressed(IK_UP) then
+ if e_KeyPressed(IK_UP) or e_KeyPressed(IK_KPUP) then
begin
if not slDirPressed then
begin
begin
if not slDirPressed then
begin
end;
end;
end;
end;
- if (not e_KeyPressed(IK_DOWN)) and (not e_KeyPressed(IK_UP)) then
+ if (not e_KeyPressed(IK_DOWN)) and (not e_KeyPressed(IK_UP)) and (not e_KeyPressed(IK_KPDOWN)) and (not e_KeyPressed(IK_KPUP)) then
slDirPressed := False;
end;
slDirPressed := False;
end;