Created a new chat history class that allows for rich formatting of individual messages. Current implementation allows for bold and coloured text only. Has been manually tested. Fixed 3/5 chat command tests.

#implement #test #story[1246]
This commit is contained in:
Calum
2017-09-04 23:10:54 +12:00
parent 5026c568a7
commit 47f3f6e27d
9 changed files with 220 additions and 180 deletions
@@ -386,9 +386,6 @@ public class ServerToClientThread implements Runnable, Observer {
Arrays.copyOfRange(chatterPayload, 3, 3 + chatterPayload.length)
);
String[] words = chatterText.split("\\s+");
for (String s : words) {
System.out.println(s);
}
if (words.length > 2 && isHost) {
switch (words[2].trim()) {
case ">speed":
@@ -396,19 +393,18 @@ public class ServerToClientThread implements Runnable, Observer {
GameState.setSpeedMultiplier(Double.valueOf(words[3]));
GameState.broadcastChatter(new ChatterMessage(
Byte.toUnsignedInt(chatterPayload[1]),
words[0] + "Host has set speed modifier to x" + words[3]
"SERVER: Speed modifier set to x" + words[3]
));
} catch (Exception e) {
logger.error("cannot parse >speed value");
}
return;
case ">finish":
System.out.println(words[2].trim());
GameState.endRace();
GameState.broadcastChatter(new ChatterMessage(
chatterPayload[1],
words[0] + "Host has ended the game"
"SERVER: Game will now finish"
));
GameState.endRace();
return;
}
}