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

Method sendChatMessage

src/Graphwar/GameData.java:244–265  ·  view source on GitHub ↗
(String chat)

Source from the content-addressed store, hash-verified

242 }
243
244 public void sendChatMessage(String chat)
245 {
246 try
247 {
248 Player player = getFirstLocalPlayer();
249 int id = -1;
250
251 if(player != null)
252 {
253 id = player.getID();
254 }
255
256 String message = NetworkProtocol.CHAT_MSG+"&"+id+"&"+URLEncoder.encode(chat, "UTF-8");
257 serverConnection.sendMessage(message);
258
259 handleCommands(chat);
260 }
261 catch (UnsupportedEncodingException e)
262 {
263 e.printStackTrace();
264 }
265 }
266
267 public void sendChatMessage(Player player, String chat)
268 {

Callers 3

actionPerformedMethod · 0.45
actionPerformedMethod · 0.45
actionPerformedMethod · 0.45

Calls 5

getFirstLocalPlayerMethod · 0.95
getIDMethod · 0.95
handleCommandsMethod · 0.95
isLocalPlayerMethod · 0.80
sendMessageMethod · 0.45

Tested by

no test coverage detected