Freelancer Community Network
Reminder: Internet Explorer 6 or below are NOT supported.
HomeHome
ForumForum
WikiWiki
DownloadsDownloads
ForgeForge
Multiplayer Connection Tutorial
Collapse/Expand Random Image
Collapse/Expand Login
Username:

Password:

Remember me



Lost Password?

Register now!
Collapse/Expand Chat
Collapse/Expand Who's Online
258 user(s) are online (225 user(s) are browsing Forum)

Members: 0
Guests: 258

more...
Collapse/Expand Donations
Monthly costs: -30€
Income (ads): +5€
Donations (last month): +0€

Current balance: 55€
(last updated 04/2021)

Please make a donation if you want to help keeping The-Starport online:

Thanks!
Collapse/Expand Links
Collapse/Expand Advertisement
There are currently 78 users playing Freelancer on 44 servers.
May. 31, 2023

Browsing this Thread:   1 Anonymous Users



 Bottom   Previous Topic   Next Topic  Register To Post



Problem mit FLHook Plugin 1.6.0
Just popping in
Joined:
2008/7/2 15:03
Group:
Registered Users
Posts: 17
Offline

Sorry my English is to bad…

Mahlzeit,

Ich hab da nen kleines Problem, und zwar wenn ich nen FL Server mit dem flhook plugin 1.6.0 starte und dann Ingame autobuy all on schalte wird man gekickt sobald man gedockt wird und Munition nach kaufen muss, bei allen anderen hook Versionen passiert das nich, getestet hab ich das mit 1.5.5, 1.5.8, 1.5.9 und sogar mit der letzten LC hook Variante

Ich hab darauf hin mal die src codes der verschiedenen Hook Versionen mit einander verglichen, Speziell die Hkfuncplayers.ccp in der Hoffnung dem Problem so auf die spur zu kommen.
Aber alles was ich dabei herausfand war das alle Vorgänger Versionen von hook mit einem festen munitions wer von 50 arbetiten

Quote:
#define ADD_EQUIP_TO_CART(desc) { aci.iArchID = eq->iAmmoArchID; \
aci.iCount = 50 - HkPlayerAutoBuyGetCount(lstCargo, aci.iArchID); \
aci.wscDescription = desc; \
lstCart.push_back(aci); }


und die 1.6.0 anscheinend davon ausgeht das es Player relevant ist wie viel ammo nach gekauft wird

Quote:
#define ADD_EQUIP_TO_CART(desc) { aci.iArchID = eq->iAmmoArchID; \
aci.iCount = MAX_PLAYER_AMMO - HkPlayerAutoBuyGetCount(lstCargo, aci.iArchID); \
aci.wscDescription = desc; \
lstCart.push_back(aci); }


ich hab mit den beiden werten ein wenig rum experimentiert aber da ich nich wirklich der c++ Guru bin (noob) konnte ich das Problem mit den kicks nich beheben

kann jemand helfen? hat einer nen tipp?

Grüsse,

Andi

Posted on: 2009/5/2 19:25
Top
Re: Problem mit FLHook Plugin 1.6.0
Just popping in
Joined:
2008/7/2 15:03
Group:
Registered Users
Posts: 17
Offline
ok bin mitlerweile von alleine.. ähm ok fast alleine drauf gekommen^^

das hier,

Quote:
Autobuy in version 1.6.0
« on: November 19, 2008, 03:01:48 pm »
Reply with quoteQuote
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.
Code:

  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);

}


und die übernahme des volgenden Codes aus der 1.5.9 konnte das Problem beheben

Code:
HK_ERROR HkAddCargo(wstring wscCharname, uint iGoodID, int iCount, bool bMission)
{
HK_GET_CLIENTID(iClientID, wscCharname);

if(iClientID == -1 || HkIsInCharSelectMenu(iClientID))
return HKE_PLAYER_NOT_LOGGED_IN;

// anti-cheat related
char *szClassPtr;
memcpy(&szClassPtr, &Players, 4);
szClassPtr += 0x418 * (iClientID - 1);
EquipDescList *edlList = (EquipDescList*)szClassPtr + 0x328;
bool bCargoFound = true;
if(!edlList->find_matching_cargo(iGoodID, 0, 1))
bCargoFound = false;

// add
const GoodInfo *gi;
if(!(gi = GoodList::find_by_id(iGoodID)))
return HKE_INVALID_GOOD;

bool bMultiCount;
memcpy(&bMultiCount, (char*)gi + 0x70, 1);

if(bMultiCount) { // it's a good that can have multiple units(commodities, missile ammo, etc)
int iRet;

// we need to do this, else server or client may crash
list<CARGO_INFO> lstCargo;
HkEnumCargo(wscCharname, lstCargo, iRet);
foreach(lstCargo, CARGO_INFO, it)
{
if(((*it).iArchID == iGoodID) && ((*it).bMission != bMission))
{
HkRemoveCargo(wscCharname, (*it).iID, (*it).iCount);
iCount += (*it).iCount;
}
}

pub::Player::AddCargo(iClientID, iGoodID, iCount, 1, bMission);
} else {
for(int i = 0; (i < iCount); i++)
pub::Player::AddCargo(iClientID, iGoodID, 1, 1, bMission);
}

uint iBase = 0;
pub::Player::GetBase(iClientID, iBase);
if(iBase)
{ // player docked on base
///////////////////////////////////////////////////
// fix, else we get anti-cheat msg when undocking
// this DOES NOT disable anti-cheat-detection, we're
// just making some adjustments so that we dont get kicked

// fix "Ship or Equipment not sold on base" kick
if(!bCargoFound)
{
// get last equipid
char *szLastEquipID = szClassPtr + 0x3C8;
ushort sEquipID;
memcpy(&sEquipID, szLastEquipID, 2);

// add to check-list which is being compared to the users equip-list when saving char
EquipDesc ed;
memset(&ed, 0, sizeof(ed));
ed.id = sEquipID;
ed.count = iCount;
ed.archid = iGoodID;
edlList->add_equipment_item(ed, true);
}

// fix "Ship Related" kick, update crc
ulong lCRC;
__asm
{
mov ecx, [szClassPtr]
call [CRCAntiCheat]
mov [lCRC], eax
}
memcpy(szClassPtr + 0x320, &lCRC, 4);
}


grüsse,

Andi

Posted on: 2009/5/4 16:08
Top