TheStarport/FLHook

RequestGroupPositions sends first client ID in group

Opened this issue · 2 comments

Currently, Server.RequestGroupPositions sends the lowest client ID in the group. It would be better if it was to cycle through the group's client IDs each time it is called.

We already hook this function, so would be easy to implement:

void __stdcall RequestGroupPositions(ClientId client, uint _genArg1, int _genArg2)

Since this is relatively minor piece of functionality that could be desribed as a "fix". I propose this goes into core rather than a seperate plugin. This should have a configuration option so it can be disabled if not wanted. Default should be enabled.

Credit to Ven on the Starport discord for discovering this.

Ven has prepared a serverside plugin DLL that patches the IServerImpl::RequestGroupPositions method. Sadly the plugin is written in pure assembly so I can't really translate it into a reasonably C++ readable one.

Simply copying Ven's assembly code is an option, but it'd be a bit messy, need a second opinion.

BC46 commented

Currently, Server.RequestGroupPositions sends the lowest client ID in the group.

RequestGroupPositions correctly sends the positions of all group members, as a matter of fact. However, due to a bug in Freelancer.exe's code, only the first position is displayed on the nav map. I came up with the following patch which fixes that bug:

Freelancer.exe, 08DC07, E9 85 FD FF FF 90 90 90 -> 83 C5 18 E9 82 FD FF FF = Show all group members on the nav map.

In the end it was just a matter of adding pointer++ to a while loop which the developers probably forgot about.

EDIT:
See https://the-starport.com/forums/post/65522.