Thread: online game
View Single Post
Old Apr 20th, 2008, 5:51 PM   #24
cwl157
Professional Programmer
 
Join Date: Feb 2005
Posts: 327
Rep Power: 4 cwl157 is on a distinguished road
Re: online game

well i think what i have works because i connect 2 clients and then whatever i type into 1 client's keyboard input gets printed on the other clients screen. I think that is really all i need. The string is passed from one client to the other via the Server. I am just wondering the best way to organize it with my battleship game because it would be better i think if there was a way where the clients would only connect once and the streams would only be established once. It would be less work but i have taken those methods out of the loops and have not gotten it to work right. I guess if the connections have to be made and streams created each time then it wouldn't be the end of the world. I also need to figure out how the put the Client NewMain into a method because then i would just use that method on the input the user enters on the keyboard and that would be sent to the client and used in the player's takeTurn method in the battleship game.
cwl157 is offline   Reply With Quote