• Advertisement

Archived

This topic is now archived and is closed to further replies.

[java] Multi-player servers

This topic is 6404 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I''m developing a realtime multi-player fighting engine for my online RPG. What it will basically do is allow two opponents to fight in realtime using an RPG type battle interface(i.e. menus that allow you to perform actions) across the web. I use a server app that must be up and running for any of the clients to be able to connect and play. (i.e. I have to launch the server app with: "java GameServer" from the command prompt and keep that app running on the server machine so everyone can play. My problem is: I don''t have DSL or cable so my home comp is not the server, I use a pay web host. So in order for me to launch the app I telnet in and launch from the command line. If I log off, however, the app ceases and that''s the end of that. In order for the server to work, I have to be logged onto my telnet account so that the app won''t quit. Well, I''m using a phone modem with only one phone line in the house and I don''t want to tie it up 24/7. My question is: is there another way I can do this? Perhaps some specifics about my server app are required: All my server does is open a ServerSocket and waits for clients to connect. Each connection is assigned to a separate thread and that thread listens to that connection. Data is partially processed through the server and sent back down to the clients. Any suggestions will be appreciated.

Share this post


Link to post
Share on other sites
Advertisement
Do you have any buddies who work at an ISP?

War doesn't determine who is right, war determines who is left.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
You said telnet so i''m assuming this is a unix environment. Put an ampersand (''&'') at the end of your command to get it to run as a background operation. This will free up the telnet session to run other things and keep the program from dying when you log off or hit ctrl-c.
java GameServer &
The server will then tell you the PID of the process incase you need to kill it.
[1] 6748
where 6748 is the process id. You can do
ps -ax /grep java
to find all the processes running with ''java'' in their name and
kill [PID]
to stop a process. I''m not sure if your user would have permissions to do that, but that user might be able to kill processes that it started itself. I don''t know how to stop these ''&'' processes anyother way. You might try a linux/unix msg board.

Share this post


Link to post
Share on other sites
This thing changed my pipe character into a slash, right before "grep java" it should be a vertical pipe. And I forgot to input my name so I can''t edit it.

Share this post


Link to post
Share on other sites
Hmmm... This looks like wikidsmot is running his game server on a ( *gasp* ) school host. :O

Where else would you run a java proggie on a Unix box via a telnet session? Maybe the office, but then you could just start it up at work and leave it going...

someone is a very naughty little student.


makes me proud to be part of this forum


ManaSink


Share this post


Link to post
Share on other sites
I don''t know if it''s the same on unix but you can say localhost or 127.0.0.1 to dial into your own computer. Also I would consider letting players play with each other without using a server. This is how I usually play with friends, just to avoid logging onto the Zone and putting a password so others can''t join in and start lagging the game. For these reasons I am going to allow my game to be a client and a server without using a servlet. This way a servlet can be used so they can particapate in a Zone like atmosphere or just play vs with no extra delays.

Share this post


Link to post
Share on other sites
Thanks for the "localhost" advice, I''ve been doing that in order to debug my program. I''ll look into your other suggestions as well.

Share this post


Link to post
Share on other sites

  • Advertisement