Hello! This is my first post on java-gaming, so bare with me if I’m not precise enough
I am developing a multiplayer game, which is really quite simple. You have an avatar, you can be in a room, you can collect items, you can chat with other people (avatars). That’s really the basics. I have a working client and a working server.
Now, what I want to create is a server-side event-trigger system, which can be modified and expanded as needed; by that I mean, I wont have to actually alter the servers code, in order to add a new ‘event’.
Example of an event: If a user is in specific room X, every time he moves, the server rolls a number between 1-100. If the number is <95, he receives item Y.
This would be very simple to hard-code into the server, but I want to be able to modify/remove/add these kinds of events without having to shutdown, rewrite, recompile the online server. I also need to consider performance - it would probably be a strain for the server to evaluate all of these event, all the time, for every user.
How would I go about this? I was thinking maybe a separate thread in the server, dedicated to these events, loading them in from a database, looking for callbacks from the game logic thread… No idea if it’s the best solution, or even can be accomplished.
Any kind of help and suggestions is welcome!
Ps. the server is pure Java. Also, i’m sorry if this is the wrong subforum, wasn’t really sure where it belonged… :clue: