WIP: Class being initted again
This commit is contained in:
parent
8dafb94a37
commit
69a399b928
|
@ -41,8 +41,12 @@ public final class HandlerResponse
|
||||||
/* Set the handler who caused this reponse to occur */
|
/* Set the handler who caused this reponse to occur */
|
||||||
this.handler = handler;
|
this.handler = handler;
|
||||||
|
|
||||||
|
writeln("Heyo ", server);
|
||||||
|
|
||||||
/* Attempt parsing the message and error checking it */
|
/* Attempt parsing the message and error checking it */
|
||||||
parse(messageResponse);
|
parse(messageResponse);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void parse(JSONValue handlerResponse)
|
private void parse(JSONValue handlerResponse)
|
||||||
|
@ -279,14 +283,21 @@ public final class HandlerResponse
|
||||||
}
|
}
|
||||||
else if (commandType == CommandType.SEND_HANDLER)
|
else if (commandType == CommandType.SEND_HANDLER)
|
||||||
{
|
{
|
||||||
|
debugPrint(messageResponse.toPrettyString());
|
||||||
/* Name of the handler to send the message to */
|
/* Name of the handler to send the message to */
|
||||||
string handler = messageResponse["header"]["command"]["data"]["type"].str();
|
string handler = messageResponse["header"]["command"]["data"].str();
|
||||||
debugPrint("Handler to forward to: " ~ handler);
|
debugPrint("Handler to forward to: " ~ handler);
|
||||||
|
|
||||||
/* TODO: Add me, shit is going to get recursive here */
|
/* TODO: Add me, shit is going to get recursive here */
|
||||||
|
|
||||||
|
writeln("jdfjfdhhjfh", HandlerResponse.server);
|
||||||
|
writeln("jdfjfdhhjfh", server);
|
||||||
|
writeln(server is null);
|
||||||
|
|
||||||
/* Lookup the payloadType handler */
|
/* Lookup the payloadType handler */
|
||||||
MessageHandler chosenHandler = server.findHandler(handler);
|
MessageHandler chosenHandler = server.findHandler(handler);
|
||||||
|
|
||||||
|
writeln(chosenHandler is null);
|
||||||
|
|
||||||
HandlerResponse handlerResponse = chosenHandler.handleMessage(messageResponse["data"]);
|
HandlerResponse handlerResponse = chosenHandler.handleMessage(messageResponse["data"]);
|
||||||
|
|
||||||
|
|
|
@ -78,6 +78,7 @@ public final class BesterServer
|
||||||
* to be this server.
|
* to be this server.
|
||||||
*/
|
*/
|
||||||
HandlerResponse.server = this;
|
HandlerResponse.server = this;
|
||||||
|
writeln("jdfjfdhhjfh", HandlerResponse.server);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setupHandlers(JSONValue handlerBlock)
|
private void setupHandlers(JSONValue handlerBlock)
|
||||||
|
|
Loading…
Reference in New Issue