[ENet-discuss] Object unique ID's

Martin Sherburn spacedude at konggame.co.uk
Mon Mar 17 03:53:49 PDT 2008


Hi Ruud,

The way I handle it is that the server sends a slightly different packet 
to the owner client than the others. The packet to the owner client has 
a bit set to 1, while everybody else receives the packet with a bit set 
to 0.

Hope that solves your problem,

Martin.

Ruud van Gaal wrote:
> Hi Martin,
>
> Thanks for that. Indeed your method is what I attempt to do. The only thing
> left is to determine which client actually owns the car after the new-car
> message comes in. The flow:
>
> - client1 requests car
> - server accepts, sends newCar message (with unique car.NetworkID) to all
> clients
> - client1 sees the newCar message and creates the car
>
> Now how does client1 know that it's his car and not a car from another
> client? A useful method then would be if clients also had an ID that would
> be the same on each computer. That way you can say 'newCar with networkID
> <x> and ownerClient <y>' which would work on all clients.
> You'd need the following (I really think I'll add that to ENet):
> - server starts
> - client attempts connect to server
> - server generates unique ID for client and replies connectOK with uniqueID
>
> If this happens in connection phase (inside ENet) that would help in
> debugging connections.
>
> How would you determine whether the car just generated was owned by the
> requesting client?
>
> Cheers,
> Ruud
> (who now goes to have a look at the enet source to see if there's something
> in the structures that could help)
>   


This message has been checked for viruses but the contents of an attachment
may still contain software viruses, which could damage your computer system:
you are advised to perform your own checks. Email communications with the
University of Nottingham may be monitored as permitted by UK legislation.



More information about the ENet-discuss mailing list