H-uru / Plasma

Cyan Worlds's Plasma game engine
http://h-uru.github.io/Plasma/
GNU General Public License v3.0
205 stars 81 forks source link

Screen more kinds of unwanted network messages #1550

Closed dgelessus closed 8 months ago

dgelessus commented 9 months ago

Like H-uru/dirtsand#191, but on the client side. This expands plNetClientMsgScreener to also screen messages nested inside other messages, as can happen for avatar messages.

Also disallows receiving any kind of plInputEventMsg over the network - particularly plControlEventMsg, which can execute console commands, like the already blocked plConsoleMsg. This should have no effect on normal gameplay, but will probably break bot effects that modify other clients' fog settings (I haven't tested this though). If this is a problem, we could selectively allow "known safe" console commands instead of blocking everything.

dpogue commented 9 months ago

I think the preferred option would be to actual deal with https://github.com/H-uru/Plasma/issues/711 except we're stuck on not having any good receiver for the fog change messages because plFogEnvironment doesn't actually exist in any Ages, and I don't love network messages addressed to global objects or fixed keys like the client 😕

dgelessus commented 9 months ago

Broadcast by type could work as a stopgap until we have proper receivers for the fog messages.

In any case, I agree that would be the right solution in the long term. But the bots are currently set up to use networked console commands, and because they're deployed on Cyan's shard, the receiving clients will generally only understand networked console commands and not any new fog messages we might add. So for the time being, I think we're stuck with networked console commands...

Plus, there are other renderer settings that aren't covered by plFogEnvironment, like the clear color, which the bots also want to change.