0

i'm not a newbie in Java programming. I would like to know how can i proceed with my project.

I want to develop a centralized gaming system in Java using TCP/IP protocol socket system. It should get the player details and display the information in the gaming window.

These are my criterias:

Maximum & Minimum number of players can participate?? The behavior of the server in front of a given state of the game board: should invite one or more players to offer their shots, notify the blow of an opponent or a player can declare the party over? How to update the game when a shot is provided by a player???

I'm not looking for a straight answere here. I'm looking for some guidence which would be helpful for me to start with the project. Is there are any tools for Multi-client multi instance centralised server using TCP protocol???

  • [This could work.](http://www.reddwarfserver.org/?q=content/open-source-online-gaming-universe) It seems to satisfy several of the criteria you mention above. – pg1989 Mar 24 '12 at 20:24

2 Answers2

1

First the network layer

There are several network libraries for java, mina,netty..

With the help of those networking library, you can solve the networking problems easily.

And the Logic Layer

You should maintain all the user_context objects in your server memory, and bind each of them to corresponding tcp connection. In most time, the user_context objects maintain as a hashmap/dictionary of RB-tree.

So,when some events happen, you can find corresponding user/client and send the message to them.

llj098
  • 1,404
  • 11
  • 13
1

I would think the minimum number of players is 0;

The maximum is likely to be dependent on; - your bandwidth, you need to have a significant upload speed for you want thousands of users. - how much work there is in managing each user. You can connect to 10,000 users on a single server if they are not doing much, but as you add functionality, the number of users per server will drop to 1000 possibly only 100.

The choice of IO framework makes a big difference when you have unlimited bandwidth and trivial work per connection (usually copying byte[] of zeros) For real applications, its less likely to matter. I suggest what ever solution you pick you make it easy to replace, should you find a better solution later.

Is there are any tools for Multi-client multi instance centralised server using TCP protocol???

A common tool used is JMS, but games would be one area you might not use it. I would start with ActiveMQ as this will get you up and running quickly, just make sure you can replace it easily later.

Peter Lawrey
  • 525,659
  • 79
  • 751
  • 1,130