General statistics
List of Youtube channels
Youtube commenter search
Distinguished comments
About
xybersurfer
The Daily Blob
comments
Comments by "xybersurfer" (@xybersurfer) on "Do Real Programmers Copy/ Paste Code From Stack Overflow?" video.
the annoying thing is that databases don't really notify about changes (i wouldn't do anything with database triggers because that's not what they are for). in the ideal case i would have the web server update the database to make the player banned. then i would have the web server notify the game server that it needs to kick the player or "poll" the database once. on the other hand this creates a dependency for 2 systems that were separate, you could lessen this a bit by making it possible to ban players if the game server is not online. i also don't think continuous polling is that wrong. if you retrieve all the banned players in one go it might not be too bad. on the other hand, it creates some overhead and it may require that you change your server to actively do things if it wasn't already instead of just responding to requests. i personally wouldn't go for polling unless it's a bit impractical to notify the game server from the web server
2
i wouldn't leave the decision of whether a player is banned up to the client side. because they can do whatever they want with their client. i would leave this decision on the server side. you could have your clients connect to the same server as the admin web interface and fire an event at the server fire when the admin changes something. maybe the even just means the server has to poll the database or maybe the event is more specific and contains all the information (endless possibilities). this complicates things but i think its the right way. but only you can decide what is more practically and worth your time. i think it depends on the reason why you are creating your game (to learn something, proof of concept etc...) for communication i would say whatever is easier. i use a lot of JSON in my protocols. i find it fast enough. and if it isn't i will start to optimize it. just don't start optimizing things pre-maturely. that's the real evil. it complicates code and wastes development time. keep things as simple as possible. i wouldn't worry about others being able to read the messages because even binary is not safe. even real time is usually not actually real time. there are all kinds of tricks games use to make things look real time
1