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