mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-16 07:24:53 +09:00
Adapt config and link library to web
Make the config and link libraries compatible with packing for web with webpack. This would fail due to ws not being web compatible and config using a node function not available in the web shim for util.
This commit is contained in:
1 parent
fbf2843f5b
commit
f318f8826b
5 files changed
+54
-29
No files matched your search
@@ -18,6 +18,23 @@ class MockSocket {
|
||||
this.events.set(event, fn);
|
||||
}
|
||||
|
||||
/* eslint-disable accessor-pairs */
|
||||
set onclose(fn) {
|
||||
this.on("close", (code, reason) => fn({ code, reason }));
|
||||
}
|
||||
|
||||
set onerror(fn) {
|
||||
this.on("error", fn);
|
||||
}
|
||||
|
||||
set onopen(fn) {
|
||||
this.on("open", fn);
|
||||
}
|
||||
|
||||
set onmessage(fn) {
|
||||
this.on("message", (data) => fn({ data }));
|
||||
}
|
||||
|
||||
terminate() {
|
||||
this.terminateCalled = true;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user