mirror of
https://github.com/RandomityGuy/MBHaxe.git
synced 2025-10-30 08:11:25 +00:00
Revert "...reduce gc to reduce blocking lag??"
This reverts commit f64efc3a6b.
This commit is contained in:
parent
f64efc3a6b
commit
9a6e68fb0b
1 changed files with 16 additions and 0 deletions
|
|
@ -44,6 +44,8 @@ class MasterServerClient {
|
|||
public function new(onOpenFunc:() -> Void, onErrorFunc:() -> Void) {
|
||||
#if hl
|
||||
wsThread = sys.thread.Thread.create(() -> {
|
||||
hl.Gc.enable(false);
|
||||
hl.Gc.blocking(true); // Wtf is this shit
|
||||
#end
|
||||
wsToken++;
|
||||
|
||||
|
|
@ -51,6 +53,8 @@ class MasterServerClient {
|
|||
|
||||
ws = WebSocket.create(serverIp);
|
||||
#if hl
|
||||
hl.Gc.enable(true);
|
||||
hl.Gc.blocking(false);
|
||||
#end
|
||||
ws.onopen = () -> {
|
||||
open = true;
|
||||
|
|
@ -127,10 +131,22 @@ class MasterServerClient {
|
|||
var s = toSend.pop(false);
|
||||
if (s == null)
|
||||
break;
|
||||
#if hl
|
||||
hl.Gc.blocking(true);
|
||||
#end
|
||||
ws.sendString(s);
|
||||
#if hl
|
||||
hl.Gc.blocking(false);
|
||||
#end
|
||||
}
|
||||
|
||||
#if hl
|
||||
hl.Gc.blocking(true);
|
||||
#end
|
||||
ws.process();
|
||||
#if hl
|
||||
hl.Gc.blocking(false);
|
||||
#end
|
||||
stopMutex.release();
|
||||
Sys.sleep(0.1);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue