[java] Multi-player servers

Started by
7 comments, last by wikidsmot 23 years, 9 months ago
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.
Advertisement
Do you have any buddies who work at an ISP?

War doesn't determine who is right, war determines who is left.
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.
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.
Hey thanks a lot, I''ll try it.
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


LOL, you caught me, I''m an EE student at UCSD!
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.
author of the Helping Phriendly Book
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.

This topic is closed to new replies.

Advertisement