summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: ada6277)
raw | patch | inline | side by side (parent: ada6277)
author | Ketmar Dark <ketmar@ketmar.no-ip.org> | |
Wed, 16 Oct 2019 19:10:30 +0000 (22:10 +0300) | ||
committer | Ketmar Dark <ketmar@ketmar.no-ip.org> | |
Wed, 16 Oct 2019 19:11:16 +0000 (22:11 +0300) |
src/game/g_game.pas | patch | blob | history | |
src/game/g_net.pas | patch | blob | history | |
src/game/g_netmaster.pas | patch | blob | history |
diff --git a/src/game/g_game.pas b/src/game/g_game.pas
index 3356c80981de79eb3f32169ebeb6aaf5403590a7..22265652546f9a396905fc16ddd1d86ada2eb107 100644 (file)
--- a/src/game/g_game.pas
+++ b/src/game/g_game.pas
OuterLoop := True;
while OuterLoop do
begin
+ // 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.
while (enet_host_service(NetHost, @NetEvent, 50) > 0) do
begin
if (NetEvent.kind = ENET_EVENT_TYPE_RECEIVE) then
diff --git a/src/game/g_net.pas b/src/game/g_net.pas
index b2543fb84a8a2e53d7eb465ce1f518531d9dd991..261df8cad6e0aa6e08b42ccd41c3a312f8601410 100644 (file)
--- a/src/game/g_net.pas
+++ b/src/game/g_net.pas
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();
index e696d873a41e14ac95dc8f0b220ffbdfe1e2b27f..95fbb5f5b1b7584717b34911043cd036fd7bfd4b 100644 (file)
--- a/src/game/g_netmaster.pas
+++ b/src/game/g_netmaster.pas
ct := GetTimerMS();
if (ct < stt) or (ct-stt >= 1500) then break;
+ // 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.
sres := enet_host_service(NetMHost, @NetMEvent, 100);
// if (sres < 0) then break;
if (sres <= 0) then continue;
mlist[f].pulse();
end;
+ // 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.
sres := enet_host_service(NetMHost, @NetMEvent, timeout);
while (sres > 0) do
begin