Captive Imagination
September 06, 2010, 08:26:29 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Hosting change completed. Please send an e-mail to support@captiveimagination.com if you have any problems.
 
   Home   Help Search Calendar Login Register  
Pages: [1]   Go Down
  Print  
Author Topic: Suggestions on Server hosting Game?  (Read 550 times)
0 Members and 1 Guest are viewing this topic.
Xyle
Newbie
*
Offline Offline

Posts: 11


View Profile WWW
« on: April 23, 2009, 07:10:43 PM »

Well I tried implementing a solution where a hosting client would send the server a command saying that its hosting a game, the server then creates a new game instance as a client running on the server.

The problem is when the client connects to server and tells it it would like to host a game, wether automatically through code or by manually typing the command in, the server receives the command then I get a bunch of message failed lines in the command log, then I get a bunch of connected clients with the same name as the hosting client and the game gui never pops up.

I have spent almost a week looking it over and cant seem to find whats happening. Its then I realize how little I understand about JGN and the many many classes and methods it contains along with the overall architecture. Its quite daunting for a newb like me.

I created a game class based off the client code that would get instantiated by the server when a hosting client connects. The main thing I added was parameters in the constructor so the server can tell the game what its name is, what its ID is and who the hosting player is.

I tried the client automatically telling the server to start the game class by sending a data packet in the clients initialization, I also tried having the client send the start game class command by typing the command and sending that data. Either way the server seems to get an error when trying to com.captiveimagination.jgn.MessageClient setStatus, because an error gets reported in the log right after that line. With alot of message received from the game class lines and it keeps trying to initialize the game. Its quite strange seeing that I dont have any code sending a message from the Game to the server when the game starts up. I think it must be a connection message and the server is having a hard time trying to figure out whats going on due to everything being run on the same machine?

I'm not sure and of course I'm stuck. So I will continue on with my own endeavers while peeking at the JGN game attempt of mine at the same time. Maybe something will click.
Logged

Life is just a game, learn to play!
__________________________
╬-Mighty Realms! Java Online Games-╬
Grin
darkfrog
Administrator
Inspired Imagination
*****
Offline Offline

Posts: 2650


View Profile
« Reply #1 on: April 24, 2009, 08:05:17 AM »

I know how tempting it is just to dig into a framework like JGN and just try to run with it.  A lot of times it works out well, but a lot of times you get half-way down the road and realize you don't understand the core framework well enough to debug your problems...I do this frequently myself.  I would highly recommend taking a step back, setting all the code you've written aside, and dig deep into the "tests" in the source code.  After you've walked through and understood every one of the tests I think you'll feel much more confident and much more capable to move forward with your development.  You may also come back around and realize some major design changes you want to make as a result.

Also, JGN is open-source and the code is entirely available to you and as such is not intended to be a black box, but a system you can understand every part of if you desire to.
Logged
Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
Page created in 0.168 seconds with 22 queries.