🎉 Celebrating 25 Years of GameDev.net! 🎉
Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!
Quick question
OK, I was just working on my game, and I suddenly started wondering about something. I have an input "handler". When the user hits the keyboard or uses the mouse, should I send the message to the client, the server, or something else?
Thanks.
Presumably, the user *is* the client - so you don''t need to send the client a message.
Whether you send the server a message for every keystroke or not depends on your protocol. Usually the client sends a message to the server everytime a significant event occurs. The client also usually sends it''s idea of it''s position on a regular basis (piggybacked on a ''significant event'' message if possible).
A significant event would be something like "attack on" or "use skill" or "send tell to player X". It may or may not be something like "turn left".
-Mike
Whether you send the server a message for every keystroke or not depends on your protocol. Usually the client sends a message to the server everytime a significant event occurs. The client also usually sends it''s idea of it''s position on a regular basis (piggybacked on a ''significant event'' message if possible).
A significant event would be something like "attack on" or "use skill" or "send tell to player X". It may or may not be something like "turn left".
-Mike
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement