Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/gui/session/messages.js
Show First 20 Lines • Show All 1,168 Lines • ▼ Show 20 Lines | |||||
{ | { | ||||
if (msg.text[0] != '/') | if (msg.text[0] != '/') | ||||
return true; | return true; | ||||
// Split addressee command and message-text | // Split addressee command and message-text | ||||
msg.cmd = msg.text.split(/\s/)[0]; | msg.cmd = msg.text.split(/\s/)[0]; | ||||
msg.text = msg.text.substr(msg.cmd.length + 1); | msg.text = msg.text.substr(msg.cmd.length + 1); | ||||
// GUID is "local" in singleplayer, some string in multiplayer. | // GUID is "local" in single-player, some string in multiplayer. | ||||
// Chat messages sent by the simulation (AI) come with the playerID. | // Chat messages sent by the simulation (AI) come with the playerID. | ||||
let senderID = msg.player ? msg.player : (g_PlayerAssignments[msg.guid] || msg).player; | let senderID = msg.player ? msg.player : (g_PlayerAssignments[msg.guid] || msg).player; | ||||
let isSender = msg.guid ? | let isSender = msg.guid ? | ||||
msg.guid == Engine.GetPlayerGUID() : | msg.guid == Engine.GetPlayerGUID() : | ||||
senderID == Engine.GetPlayerID(); | senderID == Engine.GetPlayerID(); | ||||
// Parse private message | // Parse private message | ||||
▲ Show 20 Lines • Show All 121 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator