Java-Gaming.org    
Featured games (79)
games approved by the League of Dukes
Games in Showcase (477)
Games in Android Showcase (107)
games submitted by our members
Games in WIP (535)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
   Home   Help   Search   Login   Register   
  Show Posts
Pages: [1]
1  Game Development / Networking & Multiplayer / Re: Multithreaded or SelectNow? on: 2006-06-06 09:55:34
I think it works if all threads read/write commands queues in a synchronized environment, as you suggest.
If I understood your approach basically you have a server thread that pool all active clients queue, process each command, and send a response throw client connection.
The only thing to take care in such solution is to synchronize queues (both clients and server), well... it not soo difficult, but debugging can be a nightmare if something do not work as expected (there are something wrong in client threads? in server thread? in queues synchronization?).
When I developed a mud server I choose to do it in a different way.
Each player is an object that "speak" with the clinet throw a connection (so one player one thread as in your solution, but only for I/O), a player receive a command string and pass the command to a command manager with a reference to itself. No queue in the "client side", only a command queue in the "server side" (server thread).
When the command manager receive this instruction process it and, if there are some feedback for player, use the payer reference to perform back comunications.
It's a quite similar approach, but I have only one command queue and I don't have a thread that "pool" each active connection; my server thread waits command from players and process it in a First In First Out way.
I don't know if this is the "best way to do this"(TM), just an idea.
I think develop a mud environment is an interesting exercise, there are a lot of possibilities to do the same things  Grin

Have a good job  Wink
2  Game Development / Networking & Multiplayer / Re: networking libraries on: 2006-01-20 13:24:48
MINA is cool! It uses NIO as underlaying protocol. Seems pretty fast, though I didn't
do a speed test.

I also use MINA in some little project.
It's an interesting library if you would like to build a custom protocol layer over TCP/IP.
Actually I can say it have some limits due to the fact that isn't so stable; documentations isn't clear (sometimes is simply too old) and there isn't a "state framework" that help to build a statefull client/server interaction (not a problem if you don't need it... and nothing soo difficult to write).
Do not seems to have speed issue (of course, I use it only in little environments).
I think is a good idea to take a look about it.
3  Game Development / Newbie & Debugging Questions / Re: how to expand a .jar file on: 2006-01-19 09:23:08
Try  with jar -xvf some_file.jar
4  Game Development / Newbie & Debugging Questions / Re: KeyListener probs, noo not another one on: 2005-10-25 11:23:37
Maybe you have to call  getVel() in your keyPressed method.

In your code when you press a key  (e.g. up key) you set  upkey to true, but nobody know that happend; on release you set it to false, and again nobody "see" this change.  Wink
5  Game Development / Networking & Multiplayer / Re: Forcing J2EE Servlets to be single-threaded? on: 2005-08-01 09:59:14
I don't know what exactly you want to do in your servlet; I think you use it like a door for some kind of service call.
So, if this is your environment, maybe you can use a service locator.
You may use Spring like service locator in your web app (service class is singleton by default in Spring).
Your servlets get the service instance from Spring, and it serve to you a shared instance.
It is not important that your servlet is a singleton instance, isn't his nature; move logic in external class, outside the J2EE behavior, and maybe you get the point.
Pages: [1]
 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

pw (36 views)
2014-07-24 01:59:36

Riven (37 views)
2014-07-23 21:16:32

Riven (25 views)
2014-07-23 21:07:15

Riven (27 views)
2014-07-23 20:56:16

ctomni231 (57 views)
2014-07-18 06:55:21

Zero Volt (49 views)
2014-07-17 23:47:54

danieldean (39 views)
2014-07-17 23:41:23

MustardPeter (43 views)
2014-07-16 23:30:00

Cero (59 views)
2014-07-16 00:42:17

Riven (56 views)
2014-07-14 18:02:53
HotSpot Options
by dleskov
2014-07-08 03:59:08

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:58:24

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:47:22

How do I start Java Game Development?
by ra4king
2014-05-17 11:13:37

HotSpot Options
by Roquen
2014-05-15 09:59:54

HotSpot Options
by Roquen
2014-05-06 15:03:10

Escape Analysis
by Roquen
2014-04-29 22:16:43

Experimental Toys
by Roquen
2014-04-28 13:24:22
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!