MantisBT - Zandronum
View Issue Details
0000354Zandronum[All Projects] Suggestionpublic2011-03-29 12:452017-04-08 12:04
Evo 
Dusk 
normalfeatureN/A
acknowledgedopen 
MicrosoftWindowsXP/Vista/7
98d 
 
0000354: Private chat function (sayto_playername blahblah)
Coming from ZDaemon to play more prominently in Skulltag I often plan to join games with just 1 friend, be it ZH or aow2. In zd we could use their "sayto $player" feature to establish a private communication without tabbing out to msn or irc. This feature is also useful while watching duels with people and wanting to talk to just one person.
Thanks for considering. x
No tags attached.
has duplicate 0001885closed  Console Command: Msg "Message", "User1", "User2", ... 
Issue History
2011-03-29 12:45EvoNew Issue
2014-06-07 11:06JKist3Note Added: 0008867
2014-06-07 14:14WatermelonAssigned To => Watermelon
2014-06-07 14:14WatermelonStatusnew => assigned
2014-06-07 18:06WatermelonNote Added: 0008873
2014-06-07 18:06WatermelonStatusassigned => needs review
2014-06-07 18:07WatermelonNote Edited: 0008873bug_revision_view_page.php?bugnote_id=8873#r4819
2014-06-07 18:07WatermelonNote Edited: 0008873bug_revision_view_page.php?bugnote_id=8873#r4820
2014-06-07 18:08WatermelonNote Edited: 0008873bug_revision_view_page.php?bugnote_id=8873#r4821
2014-06-08 13:51Torr SamahoNote Added: 0008917
2014-06-08 13:58Torr SamahoStatusneeds review => feedback
2014-06-08 14:03WatermelonNote Added: 0008918
2014-06-15 22:13WatermelonAssigned ToWatermelon =>
2014-06-15 22:13WatermelonStatusfeedback => acknowledged
2014-06-15 22:13DuskAssigned To => Dusk
2014-07-13 22:14DuskRelationship addedhas duplicate 0001885
2014-07-13 23:59LeonardNote Added: 0009964
2014-07-14 00:00LeonardNote Edited: 0009964bug_revision_view_page.php?bugnote_id=9964#r5340

Notes
(0008867)
JKist3   
2014-06-07 11:06   
This is a very useful feature. A couple things to note:

-this should play a different sound and have a different color than regular or team chats
-you should be able to send private messages to yourself, but spectators should not be able to send private messages to in game participants
(0008873)
Watermelon   
2014-06-07 18:06   
(edited on: 2014-06-07 18:08)
I need input on the code. It works well so far and I've sanitized the input from the clients.

https://bitbucket.org/ChrisKOmg/zandronum/commits/dcd603ea684a04770d4747389a969ca8b1a939d9 [^]


I set this to 'Needs review' because I'd like to get input before I proceed.

To test it:
- Compile
- Join 3 clients
- Have client 0 type "say_player 1 hello" (NOTE: you can also do "say_player Water hello")
Player 2 will not see the message.




Things to do which aren't in yet:
----------------------------------
1) Display the text being sent on the client's side to itself
2) Add in: if(sender isTrueSpec() == target isTrueSpec()) so that only spectators can chat to other spectators, and alive people can chat to other alive people.

(0008917)
Torr Samaho   
2014-06-08 13:51   
Looks like a good start. Here are some comments:
- Why mode as argument in CLIENTCOMMANDS_SayToPlayer? Doesn't the mode have to be CHATMODE_PLAYER when you want to talk to a single player?
- The "// Special support for "/me" commands." related code duplication is about to get out of hand.
- code duplication in SERVER_SendChatMessage and SERVER_SendChatMessageToPlayer is too big, either merge them into one function or move the duplicated code to helper functions
- in say_player:
  - shouldn't you check (argv.argc() < 3 ) ?
  - Having a function that accepts either name or index is new. So far we have always used separate functions, e.g. ban and ban_idx. This brings new complications, see below.
  - Using an FString for the int check is quite complicated and it will not work for certain player names. For instance, if the player name is "100". As long as you we do not allow more than 99 players and require at least 3 chars for player names, it's possible to uniquely determine whether the user was trying to use an id or a name, but I'm not sure if we want to introduce a concept that will prevent us from raising the player limit beyond 99.
(0008918)
Watermelon   
2014-06-08 14:03   
There are a lot of annoying things in chat.cpp that drove me nuts, and a lot of refactoring that could be done. If you're coming on IRC today, hopefully I can discuss what parts could do with some re-doing, and that would help clear up some of the issues I had.

For the others, all great points. I'll solve them after we can figure out the above.
(0009964)
Leonard   
2014-07-13 23:59   
(edited on: 2014-07-14 00:00)
For the sound I suggest the doom1's chat sound in display->message options by default and should be changeable like the normal chat sound.
As for the color since team chat uses red brick I suggest light blue.

Small question: when using this with a number, is it the corresponding player ID we can find using the playerinfo command?