CheeseLord / warts

WAcky Real Time Strategy
MIT License
1 stars 0 forks source link

Client backend shouldn't forward unvalidated server messages to other components #40

Closed kronmillerg closed 7 years ago

kronmillerg commented 7 years ago

client/graphics_interface.py, in function backendMessage, handles several types of messages in a big if-elif-else. Most of those messages come from the server, but RequestUnitAt originates in the client. Since we use the same error reporting for all of them, an invalid RequestUnitAt results in a warning that blames the server, when the client should be outright crashing.

The real solution is probably that all server-to-client messages should be handled in backend.networkMessage, rather than being forwarded on to other client components.

kronmillerg commented 7 years ago

RequestUnitAt is now gone, so the bug is fixed. But the underlying issue remains: messages from the server should be handled in client.backend; they shouldn't be blindly forwarded on to other components.