Hello !
I have been developing my MMO server for couple of years and i have re-wrote it couple of times as i have improved in coding in general. I'm using asynchronous socket whit google's protobuf, SRP authentication on login server, token transaction to correct game server and efficient stream cipher for encryption. Whole authentication process takes 400ms while database is on the AWS cloud.
For the question, i'm having hard time to understand correct way to handle game events.
In example:
Player is wandering in the world and wants to talk to NPC to obtain quest.
Player interacts NPC by sending NPC's id to server
Server answers to client is that interaction possible (ie. wrong faction npc don't wanna talk to you) and server also send that particularly NPC data to client so we can build up simple questlog or text menu for user.
How this happens internally on the server side ? In my mind i'm thinking that every time player interacts with NPC it would popup event OnInteract/onAction on the NPC class and that class will forward correct data for correct client internally (check my "logic picture"). But im not sure is this correct way to do it. Also i'm thinking of should i queue these events and process them on each server frame/loop to have synchronized world ?
Do you have any example of such event manager and answer for my later game loop question or can you point me to the valid source of information ?
I'm happy to reply if you like to ask anything more specific.
Thank you in advance!
↧