Wednesday 15 June 2011

Passing coordinates from a java client to a java server -


First of all I know that Coordinate is probably the wrong terminology? I thought I just passes the X and Y variables, but coordinates tell it better.

Now I should be a server, which can be accessed by 2 clients, it is a racing game and for this, each client needs to be able to run a race factor together, each Using a different control scheme, but it's neither here nor there.

I was hoping someone could be able to help me when he came to send X and Y posts of a racecard on the server and the server was sent to the next player and For this, to move both the rider on the same window at the same time, I have only made simple server stuff, such as knocking on the sun's website, and a simple echo server Repeats Tring will send what I server.

When I tried to use int instead of string I got an error which I wanted was that the difference was dynamic (obviously turns into every movement) and static (using readInt and writeInt Can not be passed)

The desired movement on both the client windows through the server will be appreciated.

Thanks

A simple solution is to use it:

  class coordinates the SerialJobile {...} ObjectOutputStream Out = New ObjectOutputStream (...); Out.writeObject (new coordinate (...));  

No comments:

Post a Comment