edu.umk.mat.merdacz.JGFramework
Class GameReplies

java.lang.Object
  extended byedu.umk.mat.merdacz.JGFramework.GameReplies

public class GameReplies
extends java.lang.Object

At the moment all "outer" server protocol part of xml message are attached here TODO place it in parseRequest in ServerThread

Author:
Marcin Daczkowski

Constructor Summary
GameReplies()
           
 
Method Summary
static java.lang.String gameBroadcast(java.lang.String type, java.lang.String content)
          Sends messgae to all but not "name" player in actual game
static java.lang.String reply(java.lang.String type, java.lang.String content)
          Generates reply with given content
static java.lang.String replyFailed(java.lang.String type, java.lang.String reason)
          Generates Failed reply for given gameRequest type, with given explaination
static java.lang.String replyOK(java.lang.String type)
          Generates OK reply for given gameRequest type
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GameReplies

public GameReplies()
Method Detail

replyOK

public static java.lang.String replyOK(java.lang.String type)
Generates OK reply for given gameRequest type

Parameters:
type - Type of request for which reply will be generated
Returns:
XML messages to send (on per line)

replyFailed

public static java.lang.String replyFailed(java.lang.String type,
                                           java.lang.String reason)
Generates Failed reply for given gameRequest type, with given explaination

Parameters:
type - Type of request for which reply will be generated
reason - Reason why failure occured
Returns:
XML messages to send (on per line)

reply

public static java.lang.String reply(java.lang.String type,
                                     java.lang.String content)
Generates reply with given content

Parameters:
type -
content -
Returns:

gameBroadcast

public static java.lang.String gameBroadcast(java.lang.String type,
                                             java.lang.String content)
Sends messgae to all but not "name" player in actual game

Parameters:
type - Which type of request caused this broadcast
content - What should be wrapped in broadcast reply
Returns:
XML to broadcast