Compare commits
2 Commits
ecf4f9c719
...
bca366d7e5
| Author | SHA1 | Date | |
|---|---|---|---|
| bca366d7e5 | |||
| bbdbef889a |
2
Makefile
2
Makefile
@@ -2,7 +2,7 @@ BUNDLE_NAME = bundle.lua
|
||||
HAXE_NAME = haxe.lua
|
||||
MINIFYD_NAME = bundle.min.lua
|
||||
BUILD_DIR = build
|
||||
HAXE_FLAGS = -D webconsole --debug
|
||||
HAXE_FLAGS =
|
||||
POLYFILLED_NAME = bundle.polyfill.lua
|
||||
POLYFILL_SRC = src/polyfill.lua
|
||||
|
||||
|
||||
@@ -1,12 +1,11 @@
|
||||
package kernel;
|
||||
|
||||
import lua.TableTools;
|
||||
import lua.Coroutine;
|
||||
import util.Vec.Vec2;
|
||||
import haxe.Exception;
|
||||
|
||||
using tink.CoreApi;
|
||||
|
||||
import cc.OS;
|
||||
|
||||
using lua.Table;
|
||||
|
||||
/**
|
||||
@@ -134,7 +133,7 @@ class KernelEvents {
|
||||
**/
|
||||
public function startEventLoop() {
|
||||
while (true) {
|
||||
var event:Table<Int, Dynamic> = OS.pullEventRaw();
|
||||
var event:Table<Int, Dynamic> = pullEvents();
|
||||
|
||||
var eventName:String = event[1];
|
||||
|
||||
@@ -142,6 +141,10 @@ class KernelEvents {
|
||||
}
|
||||
}
|
||||
|
||||
private function pullEvents():Table<Int, Dynamic> {
|
||||
return cast TableTools.pack(Coroutine.yield(null));
|
||||
}
|
||||
|
||||
private function fireSignal(eventName: String,event:Table<Int, Dynamic> ) {
|
||||
switch eventName {
|
||||
case "alarm":
|
||||
|
||||
@@ -74,11 +74,7 @@ class Routing {
|
||||
data: null
|
||||
}
|
||||
|
||||
// HACK: Because Lua is singelthreaded the computer we respond to can get overwhelmed with
|
||||
// the responses and can swollow events.
|
||||
new Timer(Net.instance.networkID / 3,()->{
|
||||
interf.send(response.toID,Net.instance.networkID,response);
|
||||
});
|
||||
interf.send(response.toID,Net.instance.networkID,response);
|
||||
}
|
||||
|
||||
private function genRouteList(): Array<{id:NetworkID,cost:Int}> {
|
||||
|
||||
Reference in New Issue
Block a user