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 classWatchPlayer.PickEncoderSee https://docs.oracle.com/javaee/7/tutorial/websocket007.htm or https://www.baeldung.com/java-websockets for documentation on encodersstatic classWatchPlayer.ReadyMessages sent to a GUI client to tell it that something is ready for it, and it can make another /newEpisode or /display callstatic classWatchPlayer.ReadyEncoderstatic classWatchPlayer.WatchMessage
-
Constructor Summary
Constructors Constructor Description WatchPlayer()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidend()voidincoming(String message)ExpectsvoidonError(Throwable t)static voidsendHimChat(String pid, String s)voidstart(jakarta.websocket.Session session)static <T> voidtellAbout(String pid, T msg)Methods handling important events during the game call this method to let watchers now about the most recent eventstatic voidtellHim(String pid, WatchPlayer.Ready msg)StringtoString()
-
-
-
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
-
-