MCPcopy Create free account
hub / github.com/OpenEndedGroup/Field2 / EditorUtils

Method EditorUtils

src/main/java/fielded/EditorUtils.java:31–45  ·  view source on GitHub ↗
(RemoteEditor editor)

Source from the content-addressed store, hash-verified

29 public int lastCh;
30
31 public EditorUtils(RemoteEditor editor) {
32 this.editor = editor;
33 editor.getServer()
34 .addHandlerLast((s, ws, a, p) -> {
35
36 if (!a.startsWith(prefix)) return p;
37
38 Consumer<JSONObject> c = messageTable.remove(a);
39 if (c == null) Log.log("editorUtils.error", ()->"no handler for message :" + a +" "+p);
40 else {
41 c.accept((JSONObject) p);
42 }
43 return p;
44 });
45 }
46
47 public JSONObject sendAndRespond(String message) {
48

Callers

nothing calls this directly

Calls 5

logMethod · 0.95
addHandlerLastMethod · 0.80
acceptMethod · 0.65
getServerMethod · 0.45
removeMethod · 0.45

Tested by

no test coverage detected