Skip to content
This repository has been archived by the owner on Apr 23, 2024. It is now read-only.

Added Ingame chat mode and Square marking. #11

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

TreffnonX
Copy link

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.

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);
Copy link
Author

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.

@chaitu236
Copy link
Owner

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.

@TreffnonX
Copy link
Author

TreffnonX commented Apr 25, 2016

It's also a useful feature to both draw attention to a situation on the board for both players and spectators, not to forget. :)
But I see your point. Though you have to admit, this is a total of 90 lines, so not that much new code.

However, focus on your semester. It's more important, I know that. I am just finishing my university deg. too.

@Daenyth
Copy link

Daenyth commented Jun 17, 2016

It seems more appropriate to split the two features into two PRs

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants