Updated sendClient and sendServer format.
This commit is contained in:
parent
26bbb171f7
commit
b54817e418
|
@ -199,13 +199,8 @@ public final class BesterConnection : Thread
|
|||
|
||||
try
|
||||
{
|
||||
/* Provide the following "data" : ..., "from" : username */
|
||||
JSONValue handlerInput;
|
||||
handlerInput["data"] = payloadData;
|
||||
handlerInput["from"] = username;
|
||||
|
||||
/* Provide the handler the message and let it process it and send us a reply */
|
||||
HandlerResponse handlerResponse = chosenHandler.handleMessage(handlerInput);
|
||||
HandlerResponse handlerResponse = chosenHandler.handleMessage(payloadData);
|
||||
|
||||
/* TODO: Continue here, we will make all error handling do on construction as to make this all more compact */
|
||||
debugPrint("<<< Message Handler [" ~ chosenHandler.getPluginName() ~ "] response >>>\n\n" ~ handlerResponse.toString());
|
||||
|
|
|
@ -167,19 +167,19 @@ public final class HandlerResponse
|
|||
/* The fully response message to send back */
|
||||
JSONValue clientPayload;
|
||||
|
||||
/* Set the `handlerName` field of the header block */
|
||||
JSONValue handlerName;
|
||||
handlerName["handlerName"] = handler.getPluginName();
|
||||
// /* Set the `handlerName` field of the header block */
|
||||
// JSONValue handlerName;
|
||||
// handlerName["handlerName"] = handler.getPluginName();
|
||||
|
||||
/* Set the header of the response */
|
||||
JSONValue headerBlock = handlerName;
|
||||
JSONValue headerBlock;
|
||||
clientPayload["header"] = headerBlock;
|
||||
|
||||
/* Set the payload of the response */
|
||||
JSONValue payloadBlock;
|
||||
payloadBlock["data"] = messageResponse["data"];
|
||||
payloadBlock["type"] = handler.getPluginName();
|
||||
clientPayload["data"] = payloadBlock;
|
||||
clientPayload["payload"] = payloadBlock;
|
||||
|
||||
|
||||
/**
|
||||
|
@ -240,7 +240,7 @@ public final class HandlerResponse
|
|||
|
||||
/* Set the header of the response */
|
||||
JSONValue headerBlock;
|
||||
headerBlock["handlerName"] = handler.getPluginName();
|
||||
// headerBlock["handlerName"] = handler.getPluginName();
|
||||
headerBlock["scope"] = "server";
|
||||
serverPayload["header"] = headerBlock;
|
||||
|
||||
|
|
Loading…
Reference in New Issue