Quote:
I already thought about that, and i think i will do it like that. Would that cost less traffic?


You can count the required traffic by looking into the manual. Every function has informations about the produced traffic. It should be easy to calculate.
But sometimes it's better to use a technic that requires a bit more traffic and have a cleaner code instead.

Code:
you = entity_pointer;
you.health -= 120;



Ok you misunderstood how the global pointers work. All global entities are listed in an array. So if enet_ent_create() is called, every host performs a normal ent_create() and stores the local pointer in this array. All hosts store it at the same position in the array (so the index to access the local pointer is the same on every host).

And this array index is the global pointer. It's nothing more than a number.

=> you = entity_pointer; would make no sence. You need to get the local pointer according to the global pointer. => use enet_get_locpointer(entity_pointer); This function returns the content of the array on the position entity_pointer. The result is different on every host but on every host the same entity is ment.

enet_get_globpointer() searches for an entry in the array with the passed local pointer and returns the index/position where the local pointer is stored in the array.


ANet - A stable and secure network plugin with multi-zone, unlimited players, voip, server-list features,... (for A7/A8)!
get free version