diff --git a/source/birchwood/client/client.d b/source/birchwood/client/client.d index 1e2c7da..5c79113 100644 --- a/source/birchwood/client/client.d +++ b/source/birchwood/client/client.d @@ -139,22 +139,25 @@ public class Client : Thread if(commandReply.getReplyType() == ReplyType.RPL_BOUNCE) { - logger.log(); - logger.log("<<<>>>"); + // TODO: Testing code was here + // logger.log(); + // logger.log("<<<>>>"); - logger.log("Take a look:\n\n"~commandReply.getParams()); + // logger.log("Take a look:\n\n"~commandReply.getParams()); - logger.log("And here is key-value pairs: ", commandReply.getKVPairs()); - logger.log("And here is array: ", commandReply.getPairs()); + // logger.log("And here is key-value pairs: ", commandReply.getKVPairs()); + // logger.log("And here is array: ", commandReply.getPairs()); - // TODO: DLog bug, this prints nothing - logger.log("And here is trailing: ", commandReply.getTrailing().length); + // // TODO: DLog bug, this prints nothing + // logger.log("And here is trailing: ", commandReply.getTrailing()); - import std.stdio; - writeln("Trailer: "~commandReply.getTrailing()); + // import std.stdio; + // writeln("Trailer: "~commandReply.getTrailing()); - logger.log("<<<>>>"); - logger.log(); + // writeln(cast(ubyte[])commandReply.getTrailing()); + + // logger.log("<<<>>>"); + // logger.log(); diff --git a/source/birchwood/protocol/messages.d b/source/birchwood/protocol/messages.d index c088e70..1e29dc1 100644 --- a/source/birchwood/protocol/messages.d +++ b/source/birchwood/protocol/messages.d @@ -279,17 +279,35 @@ public final class Message return params; } - + /** + * Retrieves the trailing text in the paramaters + * (if any) + * + * Returns: the trailing text + */ public string getTrailing() { return ppTrailing; } + /** + * Returns the parameters excluding the trailing text + * which are seperated by spaces but only those + * which are key-value pairs + * + * Returns: the key-value pair parameters + */ public string[string] getKVPairs() { return ppKVPairs; } + /** + * Returns the parameters excluding the trailing text + * which are seperated by spaces + * + * Returns: the parameters + */ public string[] getPairs() { return ppPairs; @@ -300,10 +318,13 @@ public final class Message private string[] ppPairs; - unittest + version(unittest) { import std.stdio; + } + unittest + { string testInput = "A:=1 A=2 :Hello this is text"; writeln("Input: ", testInput); @@ -323,8 +344,6 @@ public final class Message unittest { - import std.stdio; - string testInput = ":Hello this is text"; bool hasTrailer; string[] splitted = splitting(testInput, hasTrailer);