MCPcopy Create free account
hub / github.com/catabriga/graphwar / addChatMessage

Method addChatMessage

src/Graphwar/GameData.java:661–678  ·  view source on GitHub ↗
(String[] info)

Source from the content-addressed store, hash-verified

659 }
660
661 private void addChatMessage(String[] info) throws Exception
662 {
663 int playerID = Integer.parseInt(info[1]);
664 String chatMessage = URLDecoder.decode(info[2], "UTF-8");
665
666 Player player = this.getPlayer(playerID);
667
668 if(gameState == Constants.PRE_GAME)
669 {
670 ((PreGameScreen)graphwar.getUI().getScreen(Constants.PRE_GAME_SCREEN)).addChat(player, chatMessage);
671 }
672 else if(gameState == Constants.GAME)
673 {
674 ((GameScreen)graphwar.getUI().getScreen(Constants.GAME_SCREEN)).addChat(player, chatMessage);
675 }
676
677 //handleCommands(chatMessage);
678 }
679
680 private void handleCommands(String msg)
681 {

Callers 1

handleMessageMethod · 0.95

Calls 4

getPlayerMethod · 0.95
getScreenMethod · 0.80
getUIMethod · 0.80
addChatMethod · 0.45

Tested by

no test coverage detected