diff --git a/src/game/g_net.pas b/src/game/g_net.pas
index 2518bede333e6272e934a02050124f2dbf992a9a..261df8cad6e0aa6e08b42ccd41c3a312f8601410 100644 (file)
--- a/src/game/g_net.pas
+++ b/src/game/g_net.pas
NetPongSock: ENetSocket = ENET_SOCKET_NULL;
NetUseMaster: Boolean = True;
- NetSlistAddr: ENetAddress;
NetSlistIP: string = 'mpms.doom2d.org';
NetSlistPort: Word = 25665;
+ NetSlistList: string = 'deadsoftware.ru:25665';
NetClientIP: string = '127.0.0.1';
NetClientPort: Word = 25666;
implementation
+// *enet_host_service()*
+// fuck! https://www.mail-archive.com/enet-discuss@cubik.org/msg00852.html
+// tl;dr: on shitdows, we can get -1 sometimes, and it is *NOT* a failure.
+// thank you, enet. let's ignore failures altogether then.
+
uses
SysUtils,
e_input, g_nethandler, g_netmsg, g_netmaster, g_player, g_window, g_console,
ett := getNewTimeoutEnd();
repeat
status := enet_host_service(NetHost, @ev, 300);
+ {
if (status < 0) then
begin
g_Console_Add(_lc[I_NET_MSG_ERROR] + _lc[I_NET_ERR_CONN] + ' network error', True);
Result := -1;
exit;
end;
- if (status = 0) then
+ }
+ if (status <= 0) then
begin
// check for timeout
ct := GetTimerMS();
ett := getNewTimeoutEnd();
repeat
status := enet_host_service(NetHost, @ev, 300);
+ {
if (status < 0) then
begin
g_Console_Add(_lc[I_NET_MSG_ERROR] + _lc[I_NET_ERR_CONN] + ' network error', True);
Result := -1;
exit;
end;
- if (status = 0) then
+ }
+ if (status <= 0) then
begin
// check for timeout
ct := GetTimerMS();
repeat
//stx := -GetTimerMS();
status := enet_host_service(NetHost, @ev, 300);
+ {
if (status < 0) then
begin
g_Console_Add(_lc[I_NET_MSG_ERROR] + _lc[I_NET_ERR_CONN] + ' network error', True);
Result := -1;
exit;
end;
- if (status = 0) then
+ }
+ if (status <= 0) then
begin
// check for timeout
ct := GetTimerMS();