Package edu.wisc.game.websocket
Class WatchPlayer
- java.lang.Object
-
- edu.wisc.game.websocket.WatchPlayer
-
public class WatchPlayer extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
WatchPlayer.PickEncoder
See https://docs.oracle.com/javaee/7/tutorial/websocket007.htm or https://www.baeldung.com/java-websockets for documentation on encodersstatic class
WatchPlayer.Ready
Messages sent to a GUI client to tell it that something is ready for it, and it can make another /newEpisode or /display callstatic class
WatchPlayer.ReadyEncoder
static class
WatchPlayer.WatchMessage
-
Constructor Summary
Constructors Constructor Description WatchPlayer()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
end()
void
incoming(String message)
Expectsvoid
onError(Throwable t)
static void
sendHimChat(String pid, String s)
void
start(jakarta.websocket.Session session)
static <T> void
tellAbout(String pid, T msg)
Methods handling important events during the game call this method to let watchers now about the most recent eventstatic void
tellHim(String pid, WatchPlayer.Ready msg)
String
toString()
-
-
-
Method Detail
-
start
public void start(jakarta.websocket.Session session)
-
end
public void end()
-
incoming
public void incoming(String message)
ExpectsWATCH pid IAM pid CHAT text
-
tellAbout
public static <T> void tellAbout(String pid, T msg)
Methods handling important events during the game call this method to let watchers now about the most recent event- Parameters:
pid
- The sender's player ID. The message will be sent to everyone who is watching that player. (In a 2PG, that will be that player's partner, of course)
-
tellHim
public static void tellHim(String pid, WatchPlayer.Ready msg)
- Parameters:
pid
- The destination player ID
-
-