Why a unique pointer? The glob. pointer is a unique pointer and can be used to identify the entity. With enet_ent_creator you get the clientid of the creator of the entity. if CreatorID equals myClientID allow controls.
On the server you set up the physicparameters and on the client that controls the entity you fill a skill with the input. Everytime the skill has changed, send it to the server with enet_send_skill(). The server always updates the positions and angles with enet_send_pos/ang.
This would be the entity function:
function player_function()
{
if(enet_ent_creator(enet_ent_globpointer(my)) == enet_get_clientid())
{ //Every client controls his own player
while(1)
{
//store the keys as bits in a skill1
if(my.skill1 != oldskill1) enet_send_skill(enet_ent_globpointer(my),1,1,SERVER);
}
}
if(enet_get_connection() == SERVER_MODE)
{
//set up the physic stuff
while(1)
{
//use skill1 for the controls of the entity
enet_send_pos(enet_ent_globpointer(my),BROADCAST);
enet_send_ang(enet_ent_globpointer(my),BROADCAST);
}
}
}
That's all
Simple? Yes it is
All you have to notice is that every client must create his player using enet_ent_create().