Reputation: 503
I'm developing a game server and decided to go with Netty as the server framework.
The idea is that Server will receive status and actions from clients (TCP) and forward back to him and to all others, what these actions resulted.
1) How to store the shared content of the game logic (Like player life, speed, etc), so when I receive some commands, read from there and process game logic? After game logic, then send back information processed.
2) I need to every 1 sec or any other kind of event, send some info to clients. How to access the handler from these events?
I know these are beginner questions, could you guys point me directions where to get these info?
Thanks
Upvotes: 1
Views: 496
Reputation: 432
https://github.com/menacher/java-game-server
Download this source code and study it. It took me a week of reading Netty in Action and studying this until it all made sense, but this project greatly contributed to my understanding of Netty. Note this project is in Netty 3, and it has changed a fair amount since 4/5 came out so you will have to figure a few things out.
Upvotes: 2