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
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();
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