Thread: online game
View Single Post
Old Apr 19th, 2008, 1:19 PM   #15
BinarySurfer
Programmer
 
BinarySurfer's Avatar
 
Join Date: Dec 2006
Posts: 50
Rep Power: 2 BinarySurfer is on a distinguished road
Re: online game

Sorry, I think you go what I said to FreakyChris mixed in, but if you want to keep the client class separated from the game class, that's fine. In the newMain class, you have the idea down, but the problem is the Client class never attempted to established a connection with the server, which is why there is no error or output and it quits. Keeping it the way you have it, change the newMain as follows:
java Syntax (Toggle Plain Text)
  1. ...
  2.  
  3. Client c = new Client();
  4. c.connect();
  5. c.streams().
  6. c.processConnection();
  7. c.sendData("here you go");
  8.  
  9. ...
In the newMain, Client never ran though the needed methods that establish the connection or anything. Now that the needed methods are called, it should connect and what not.
Now the server and client should connect and communicate.

Last edited by BinarySurfer; Apr 19th, 2008 at 1:20 PM. Reason: Needed more dots :P
BinarySurfer is offline   Reply With Quote