-
Notifications
You must be signed in to change notification settings - Fork 8
Added Ingame chat mode and Square marking. #11
base: master
Are you sure you want to change the base?
Conversation
The marked field can be marked (if the client recognizes the message) Can be used in the production of video-blogs or strategy discussion, or as a means to call Tak! on a specific field. Markings can be set by players and Observers. Observers see all markings, players only player markings. This prevents interference in the game. A field can be marked by both player and observer. It is up to the client to properly treat this state. The marking of fields is game specific in preparation for players being able to play multiple games simultaniously.
Introducing a relay to mark fields, visible for other players in a game. In the event of the server receiving a Mark/Unmark message, a game specific mark is set for a given field. If the mark/unmark came from an observer, the marking will only be visible to other observers. If the mark/unmark came from a player, it will be visible to all players and observers. It is up to the client to choose both input and visible output for this interface. The mark/unmark interface allows for game specific messages, in preparation for the upcoming change of players being able to play/observe multiple games.
Implemented relaying of ingame chat messages. Only 'Chat' is required as single message, as the server decides itself, to whom the messages are relayed, and in what form.
if (game.white == player || game.black == player) { | ||
msg = " PlayerChat " + msg; | ||
if(!player.isGagged()) { | ||
game.sendToOtherPlayer(game.white, "Game#" + game.no + msg); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The ID of the game is not per se required to display a message, but it might come the time, when different games have different ingame chat windows. For that eventuality, the ID is transmitted.
I'll definitely take the chat feature, but I'm still ambivalent about game marking. The thing is I expect this feature to not be used that much and having this in server code is another potential point of failure (and which would require testing and maintenance after every major code rework). But it might be useful to make videos, etc as you say. I will need to think this over carefully, and will have to review the code thoroughly. I don't have much time right now owing to semester ending, so I can't work on this or any of the playtak features (unless it is a bug fix) until May 12. |
It's also a useful feature to both draw attention to a situation on the board for both players and spectators, not to forget. :) However, focus on your semester. It's more important, I know that. I am just finishing my university deg. too. |
It seems more appropriate to split the two features into two PRs |
Added ingame chat modes and square markers to the server.
In both cases, the server uses a game id to identify the game played and distribute the messages either to all clients in a game, or to players only. This will hopefully uncramp the chat in the future.