Autobuy in version 1.6.0
-
Has any else had problems using the autobuy command with flhook plugin 1.6.0 - I think it is broken?
During the base docking process, items are automatically bought and added to the player’s ship but the player gets kicked when this happens. The “flserver-errors.log” file contains an entry like:
1: E:\FL\Scratch\Source\Server\gf\BaseDB.cpp(1645) : *** ERROR: Location 0 is invalid
Looking at the code, BaseEnter() calls HkPlayerAutoBuy() which calls HkAddCargo(). HkAddCargo() uses a base/location exit/enter trick to deal with the flserver cheat detection but the location isn’t valid when the BaseEnter function is called.
I tried the following modification in HkAddCargo() and it seemed to fix the problem…I’m not sure it does but it works for a few simple test cases I tried.
if(iBase) {
if(iLocation) // ADDED THIS CHECK
Server.LocationExit(iLocation,iClientID);
Server.BaseExit(iBase,iClientID);
if(!HkIsValidClientID(iClientID)) // got cheat kicked
return HKE_PLAYER_NOT_LOGGED_IN;
}and
if(iBase) {
Server.BaseEnter(iBase, iClientID);
if(iLocation) // ADDED THIS CHECK
Server.LocationEnter(iLocation, iClientID);
} -
i believe this has been fixed in he latest version???
-
Already done (an unofficial version): http://forge.the-starport.net/gf/download/user/106/89/flhook1.6.0_plugin-p3.7z
and it is also fixed the next release - which isn’t released yet.