#3270 closed defect (fixed)
Private messages for observers cause error
Reported by: | elexis | Owned by: | elexis |
---|---|---|---|
Priority: | Nice to Have | Milestone: | Alpha 20 |
Component: | UI & Simulation | Keywords: | |
Cc: | Patch: |
Description
If you send a private message addressed to an observer using /msg
, then the following error is thrown on the observer client (but not on the sender):
WARNING: JavaScript warning: gui/session/messages.js line 656 reference to undefined property g_Players[Engine.GetPlayerID(...)] ERROR: JavaScript error: gui/session/messages.js line 656 TypeError: g_Players[Engine.GetPlayerID(...)] is undefined parseChatCommands@gui/session/messages.js:656:7 addChatMessage@gui/session/messages.js:412:4 handleNetMessage@gui/session/messages.js:288:61 onTick@gui/session/session.js:402:3 __eventhandler145 (tick)@sn tick:0:1
Looks like a simple check is missing.
PMs from observers to players are prohibited already. Should PMs from players to observers be prohibited as well?
Change History (6)
comment:1 by , 9 years ago
comment:2 by , 9 years ago
attachment:t3241_kick_v4.3.patch:ticket:3241 contains a fix that should be extracted for this ticket. In particular the function GetHostGUID
and/or GetPlayerGUID
was needed.
comment:4 by , 8 years ago
Receiving PMs as observer is still broken.
Also /team doesn't echo the chatmessage locally while /allies and /enemies do (both on svn and a19).
comment:6 by , 8 years ago
Milestone: | Backlog → Alpha 20 |
---|
Notice the bots send chat messages to allies. That's why many checks use the playerID.
In case an "/observer" command or PMs from observer to observer should be supported in the future, NetClient.cpp must expose it's GUID to JS via ScriptFunctions.cpp
. Many fun edgecases arise from the inconsistency of accessing the playerproperties either by ID or GUID.
It would also be nice if observers were allowed to send private messages to each other, so that they can comment on the gameplay without disturbing the players.
Also the /observers command might be implemented to send a message only to observers.