TakWeb icon indicating copy to clipboard operation
TakWeb copied to clipboard

Feature request: per-game chat for watchers

Open njx opened this issue 9 years ago • 13 comments

Would be great to have a per-game chat window that only watchers can see, for kibitzing purposes :)

njx avatar Apr 25 '16 04:04 njx

That'd be great to have. The problem is fitting it into the UI. Any ideas are welcome.

chaitu236 avatar Apr 25 '16 04:04 chaitu236

Server side, this is no problem: Chat messages can be categorized, by using not jsut the 'Shout' but also 'Ingame' as additional message type, where Ingame would be sent with a game id, in the same fashion as moves and such. The Server would then write messages in the following hierarchy:

  • Observers of a game get all messages in and outside the game.
  • Players get all, but the Observer messages.
  • People outside of games only get global shout chat. The server would filter, who gets which messages (observers are listed in a game object, so they can be addressed separately).

As for the client side. This is a thing that can be implemented in a variety of ways. If the above chat-modes would exist server sided, I would probably implement them in the same chat window, by applying different style-ids to the received messages. Then I would probably add a filter button to the chat window (at the bottom somewhere) to toggle all/shout chat. That hidden state would then not be applied, if a players name was included in a message. Last, I would make two additions: A button (left) next to the chat message box where to click, to change the chat mode of chat messages currently sent: Shout, Ingame/Observer The Observer chat does not need to be specifically selected, as it is the same as Ingame for the observers (though treated as observer). Then I would also implement that if someone started a chat message by typing: '/s ', '/g ', '/i ', '/o' or '/a ' it would automatically change to the corresponding mode:

  • '/s ' and '/a ' are both shout/all chat.
  • '/g ' is game chat and, depending on my relation to the current game either ingame or observer chat.
  • '/i ' is ingame chat.
  • '/o ' is observer chat. This is extremely space-saving, as it only requires two new buttons (one of which is sort of a dropdown menu) instead of an entire chat window with separate chat box and so forth...

Of course, different clients can handle the messages in a different fashion, the above is just what I would probably do with my fork.

Oh I forgot: Joining a game (as player or observer) should automatically switch you to the specific mode. They reenter all chat, after the game ends (as the game gets deleted server-side and cannot be used as a relay anymore).

TreffnonX avatar Apr 25 '16 08:04 TreffnonX

I added this to the pull request I had already going. It is practically implemented server side. Client side yet to come.

TreffnonX avatar Apr 25 '16 20:04 TreffnonX

On the UI side, I think it might be better if global and per-game chat went to different "rooms", controlled by tabs on the chat window, instead of just filters on a single chat stream, and that new messages you type always go to the current room you're viewing (global or per-game). Decoupling what you type from what you're reading could lead to errors like accidentally sending to global chat when you meant to send to per-game chat, which would be bad since players would see it.

njx avatar Apr 25 '16 21:04 njx

That is easiely enough implemented this way. It is a question of how the filters and buttons apply to the chat. What you describe as 'Tabs' are ultimately just selectors for filters AND chat targets then...

TreffnonX avatar Apr 25 '16 21:04 TreffnonX

Yup, I don't think it changes anything on the server and is mostly a little tweak on the client from what you described.

njx avatar Apr 25 '16 21:04 njx

I for one would prefer the separate filter though, as I want to see world AND ingame chat at the same time. When ingame chatting is possible, the global chatter will hopefully reduce anyway.

Ultimately this is entirely up to Chaitu. I can just apply the way I want it to my client fork. What chaitu does with the master is his buissness =D - I am gonna write him a suggestion though. He may or may not want to work from that then...

TreffnonX avatar Apr 25 '16 21:04 TreffnonX

I agree with @njx . It would be confusing to everyone but the developers to have all chats on same window.

chaitu236 avatar Apr 25 '16 21:04 chaitu236

I plan to color them differently on my end. You do what you want ;)

TreffnonX avatar Apr 25 '16 21:04 TreffnonX

Sure. The way I'd probably implement is have small tab selectors on right for global chat, game chat, and one-to-one player chat which can be toggled through with something like a tab key. Non displayed tabs can be highlighted when a new message arrives.

chaitu236 avatar Apr 25 '16 21:04 chaitu236

one-to-one chat? like whisper?

TreffnonX avatar Apr 25 '16 21:04 TreffnonX

like i can chat directly with some logged-in user Edit: who may not be playing a game with me

chaitu236 avatar Apr 25 '16 21:04 chaitu236

Edit: You mean who may not be observing my game? - Why would you forbid p2p between active players?

I am working suggested changes in the client from the master. How you configure the filters/mode-selectors, i leave up to you. For now, I add a class to the different chat messages and select the mode via slash-character. The specifics I leave to you. However It'd be cool, if you could see over the sever changes I made so far. I can add the p2p chat, if you want.

TreffnonX avatar Apr 25 '16 21:04 TreffnonX