Changeset View
Standalone View
binaries/data/mods/public/gui/session/messages.js
Show First 20 Lines • Show All 464 Lines • ▼ Show 20 Lines | if (cmd.entities) | ||||
selection = cmd.entities; | selection = cmd.entities; | ||||
if (cmd.target) | if (cmd.target) | ||||
selection.push(cmd.target); | selection.push(cmd.target); | ||||
// Allow gaia in selection when gathering | // Allow gaia in selection when gathering | ||||
g_Selection.reset(); | g_Selection.reset(); | ||||
g_Selection.addList(selection, false, cmd.type == "gather"); | g_Selection.addList(selection, false, cmd.type == "gather"); | ||||
}, | }, | ||||
"play-tracks": function (notification, player) | "play-tracks": function(notification, player) | ||||
{ | { | ||||
if (notification.lock) | if (notification.lock) | ||||
{ | { | ||||
global.music.storeTracks(notification.tracks.map(track => ({ "Type": "custom", "File": track }))); | global.music.storeTracks(notification.tracks.map(track => ({ "Type": "custom", "File": track }))); | ||||
global.music.setState(global.music.states.CUSTOM); | global.music.setState(global.music.states.CUSTOM); | ||||
} | } | ||||
global.music.setLocked(notification.lock); | global.music.setLocked(notification.lock); | ||||
}, | |||||
"map-ping": function(notification, player) | |||||
{ | |||||
// Don't display for the player that did the ping because he will see it immediately | |||||
elexis: (Should be taken care of that this can't cause any OOS, or asynchronicities without hash… | |||||
Done Inline ActionsThat's all purely gui, so no simulation involved. (Besides the action marker) So I don't see a OOS posssibility. Imarok: That's all purely gui, so no simulation involved. (Besides the action marker) So I don't see a… | |||||
Done Inline ActionsOOS could happen if displayMapPing changes serialized data, depends on how it will be implemented.
Imagine if the game is paused and a player tries communicating via the markers and assumes that his allies see these commands immediately, because he himself sees these immediately. This could be solved by displaying one actor when the command was started and the other when the marker was finished. I guess that can be neglected, since one currently is not supposed to be able to send commands during pauses. But that might actually change again in the future. Anyhow, not so important edge case and the affected player might just learn that he can't use these to communicate during pauses. elexis: OOS could happen if `displayMapPing` changes serialized data, depends on how it will be… | |||||
Done Inline ActionsWhat's about possible OOS? Also it's the code duplication. Is it possible to remove the displayFlare call before the network command posting and remove the condition below? vladislavbelov: What's about possible OOS?
Also it's the code duplication. Is it possible to remove the… | |||||
Done Inline ActionsOOS: This command does not alter any simulation data → no OOS. duplication: With your proposal the player doing the ping gets the feedback delayed by the sim and network delay. This means it feels way less responsive Imarok: OOS: This command does not alter any simulation data → no OOS.
duplication: With your proposal… | |||||
if (player != Engine.GetPlayerID() && g_Players[player].isMutualAlly[Engine.GetPlayerID()]) | |||||
DisplayMapPing(notification.target); | |||||
} | } | ||||
}; | }; | ||||
/** | /** | ||||
Not Done Inline ActionsReally sucks this function doesn't take a SoundGroup. Hardcoding ogg files is wrong and might lead to oversights Stan: Really sucks this function doesn't take a SoundGroup. Hardcoding ogg files is wrong and might… | |||||
* Loads all known cheat commands. | * Loads all known cheat commands. | ||||
*/ | */ | ||||
function getCheatsData() | function getCheatsData() | ||||
{ | { | ||||
let cheats = {}; | let cheats = {}; | ||||
for (let fileName of Engine.ListDirectoryFiles("simulation/data/cheats/", "*.json", false)) | for (let fileName of Engine.ListDirectoryFiles("simulation/data/cheats/", "*.json", false)) | ||||
{ | { | ||||
let currentCheat = Engine.ReadJSONFile(fileName); | let currentCheat = Engine.ReadJSONFile(fileName); | ||||
▲ Show 20 Lines • Show All 803 Lines • Show Last 20 Lines |
(Should be taken care of that this can't cause any OOS, or asynchronicities without hash-mismatch. For example if the game is paused or lagging the local player might see it already but the other clients wouldn't. Likely not a problem as the commands aren't delayed anyhow.)