Jump to content

  • Log In with Google      Sign In   
  • Create Account

FREE SOFTWARE GIVEAWAY

We have 4 x Pro Licences (valued at $59 each) for 2d modular animation software Spriter to give away in this Thursday's GDNet Direct email newsletter.


Read more in this forum topic or make sure you're signed up (from the right-hand sidebar on the homepage) and read Thursday's newsletter to get in the running!


[java] Multi-player servers


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
8 replies to this topic

#1 wikidsmot   Members   -  Reputation: 122

Like
Likes
Like

Posted 05 July 2000 - 10:29 AM

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.

Sponsor:

#2 Wrathnut   Members   -  Reputation: 400

Like
Likes
Like

Posted 05 July 2000 - 10:43 AM

Do you have any buddies who work at an ISP?

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

#3 Anonymous Poster_Anonymous Poster_*   Guests   -  Reputation:

Likes

Posted 06 July 2000 - 03:43 AM

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.

#4 Jim_Ross   Members   -  Reputation: 122

Like
Likes
Like

Posted 06 July 2000 - 03:45 AM

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.

#5 wikidsmot   Members   -  Reputation: 122

Like
Likes
Like

Posted 06 July 2000 - 05:01 AM

Hey thanks a lot, I''ll try it.

#6 ManaSink   Members   -  Reputation: 122

Like
Likes
Like

Posted 06 July 2000 - 07:24 AM

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




#7 wikidsmot   Members   -  Reputation: 122

Like
Likes
Like

Posted 06 July 2000 - 01:45 PM

LOL, you caught me, I''m an EE student at UCSD!

#8 Icculus   Members   -  Reputation: 122

Like
Likes
Like

Posted 06 July 2000 - 01:50 PM

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.

#9 wikidsmot   Members   -  Reputation: 122

Like
Likes
Like

Posted 07 July 2000 - 11:56 AM

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.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS