src/server/netserver.c: Send_eyes

Discussions related to the BloodsPilot server
Post Reply
Angeba
Posts: 88
Joined: Sun Feb 06, 2011 11:23 pm

src/server/netserver.c: Send_eyes

Post by Angeba »

It seems that no XPilot-server (4.5.x, ng, fxi) ever sends a PKT_EYES to a client.
The respective function `src/server/netserver.c: Send_eyes' is present, but never
called.

Therefore it is not trivial for the client to determine through whose eyes we currently
view (i.e. for whom the server sends us frame updates). The client currently looks at all
ships it receives and sets its eyes variable(s) if it finds a ship in the window center. There
are some annoyances with this approach, which appear under certain conditions
(eyes set to the wrong ship).

I think the best solution would be if the server sent a PKT_EYES to the client (probably
best to do this before other frame data, especially ships, are sent).
Problems might occur here if such a packet gets lost. Perhaps it would help here to send
the packet with each frame.

AFAIU, the client uses the eyes information to classify game objects (e.g. which ships/
treasure boxes/targets are allied/team and which are enemy).


Any idea why no XPilot server uses `Send_eyes' so far?
rotunda
Site Admin
Posts: 77
Joined: Wed Mar 24, 2010 2:19 pm

Re: src/server/netserver.c: Send_eyes

Post by rotunda »

Very good point. I have found nothing in the git log of server that would indicate PKT_EYES was ever sent, but indeed it is supported. I guess somebody implemented it and then it was forgotten, or put back for an unknown reason. I will try sending the eyes packet in fxi server and see if there are no side-effects.
Post Reply