Allow "client" when setting element.syncer.

Started by Vortrex, October 10, 2018, 05:53:55 AM

Previous topic - Next topic

Vortrex

Currently when setting an element syncer manually via server scripts, you have to use a client's ID as syncer.

Example: element.syncer = clientID
Right now the only way to get a client's ID is through a loop of all connected clients (terrible!) ... I figured it'd be nice to allow something like: element.syncer = client
An very basic example, in JavaScript:
addNetworkHandler("my_car", function(client, vehicle) {
vehicle.syncer = client;
});

Vortrex

#1
So client.index is available now but it's still inconsistent with the other uses for syncer.

For example, when triggering a network event for an element's syncer you use the client object itself in the args (meaning you still have to use a loop to get which client's index matches element.syncer), but when setting it's syncer you have to use the client's index instead.

Vortrex

This has been added and awaiting the next update.
Topic closed.