How to deal with Flee Tools/Pos Hacks
-
- Posts: 129
- Joined: Wed May 27, 2015 4:23 pm
How to deal with Flee Tools/Pos Hacks
Is there any way to help prevent the usage of Flee Tools and POS hacks on a server other than catching players and jailing them? And are there any flags that can be enabled or created in the core to help find players who are participating in the use of these tools?
-
- Posts: 129
- Joined: Wed May 27, 2015 4:23 pm
Re: How to deal with Flee Tools/Pos Hacks
Thanks, I guess the only thing is just to watch the Zone messages and then if they are going from Zone A to B to C too quickly, just to write it down and then send a /tell via GM to let them know not to do it again.
-
- Posts: 129
- Joined: Wed May 27, 2015 4:23 pm
Re: How to deal with Flee Tools/Pos Hacks
As more people start moving away from Windower and onto Ashita, I see this as becoming more prevalent on private servers. I tried a few things but it looks like certain tools like Flee Tools modify the position packet and not the actual speed variable for the character as speed is reported normally by the server. I can't see any way to far to detect other than having a GM be on the lookout visually for people doing it.
Re: How to deal with Flee Tools/Pos Hacks
Has nothing to do with which windowing app you use, most tools I've seen are not dependent on either, the few that are could easily be ported between them, ppl who wan to do these things will find a way.As more people start moving away from Windower and onto Ashita
Hi, I run The Demiurge server.
Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live. - Martin Golding
Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live. - Martin Golding
DO NOT PRIVATE MESSAGE ME ABOUT BUGSPLS USE [ code ] CODE TAGS [ /code ] WHEN POSTING CODE
Re: How to deal with Flee Tools/Pos Hacks
This won't fix the problem, but it's 100% detectable with this. There are some exceptions I haven't taken into account such as portals that will throw false positives, but after looking at the data for a bit you'll see it's fairly good at getting most people. I can't guarantee it'll work out of the box with the most recent dsp build, but it should get you most of the way there.
Open mmo.h and find position_t and make it look like this:
Open time_server.cpp and right after this line:
Add this block:
In lua_baseentity.cpp find setPos( and after
add
In lua_baseentity.cpp add this block which you can put in lua scripts to prevent false positives when a script warps them such as portals:
Under charutils.cpp for loadchar add this:
Open your db and create a table:
Open mmo.h and find position_t and make it look like this:
Code: Select all
struct position_t
{
uint8 rotation; // угол поворота сущности относительно своей позиции (используется 255 система, место 360°)
float x;
float y; // высота расположения сущности относительно "уровня моря"
float z;
float px;
float py;
float pz;
int16 zone;
uint16 moving; // что-то вроде расстояния перемещения, необходимое для правильной отрисовки в клиенте количества шагов сущности
};
Code: Select all
uint8 WeekDay = (uint8)CVanaTime::getInstance()->getWeekday();
Code: Select all
zoneutils::ForEachZone([](CZone* PZone)
{
luautils::OnGameTick(PZone);
const int8* fmtQuery = "update server_status set tick = unix_timestamp(now()) where zoneid = %i";
Sql_Query(SqlHandle, fmtQuery, map_port-56000);
PZone->ForEachChar([](CCharEntity* PChar)
{
float x = PChar->loc.p.x;
float y = PChar->loc.p.y;
float z = PChar->loc.p.z;
float px = PChar->loc.p.px;
float py = PChar->loc.p.py;
float pz = PChar->loc.p.pz;
float d = sqrt(pow((x - px), 2) + pow((z - pz), 2));
if (PChar->loc.p.zone != 1 && d /2.4*10 > 60 && PChar->animation != ANIMATION_CHOCOBO && !PChar->StatusEffectContainer->HasStatusEffect(EFFECT_FLEE))
{
const int8* fmtQuery = "INSERT INTO speed values (%u, '%s',%u,'%.3f',concat('%.3f',' ','%.3f',' ','%.3f','|','%.3f',' ','%.3f',' ','%.3f'),now());";
Sql_Query(SqlHandle, fmtQuery, PChar->id,PChar->GetName(),map_port-56000,d/2.4*10,x,y,z,px,py,pz);
ShowDebug(CL_YELLOW"%s's speed to high: %.3f\n" CL_RESET,PChar->GetName(), d / 2.4 * 10);
}
if (PChar->loc.p.zone != 1 && d / 2.4 * 10 > 100 && PChar->animation == ANIMATION_CHOCOBO)
{
const int8* fmtQuery = "INSERT INTO speed values (%u, '%s',%u,'%.3f',concat('%.3f',' ','%.3f',' ','%.3f','|','%.3f',' ','%.3f',' ','%.3f'),now());";
Sql_Query(SqlHandle, fmtQuery, PChar->id, PChar->GetName(), map_port - 56000, d / 2.4 * 10, x, y, z, px, py, pz);
ShowDebug(CL_YELLOW"%s's Chocobo is on fire! %.3f\n" CL_RESET, PChar->GetName(), d / 2.4 * 10);
}
if (PChar->loc.p.zone == 1)
{
ShowDebug(CL_YELLOW"%s zoned, ignoring speed, unzoning.\n" CL_RESET, PChar->GetName());
}
PChar->loc.p.px = PChar->loc.p.x;
PChar->loc.p.py = PChar->loc.p.y;
PChar->loc.p.pz = PChar->loc.p.z;
PChar->loc.p.zone = 0;
});
});
Code: Select all
if (m_PBaseEntity->objtype == TYPE_PC)
{
Code: Select all
m_PBaseEntity->loc.p.zone = 1;
Code: Select all
inline int32 CLuaBaseEntity::setZoneFlag(lua_State *L)
{
m_PBaseEntity->loc.p.zone = 1;
}
Code: Select all
PChar->loc.p.zone = 1;
Code: Select all
create table speed2 (charid int(10),charname varchar(30),zone smallint(6),speed varchar(10), pos varchar(300),time datetime);
Nasomi FFXI Community Server - Classic CoP era fun!
http://www.facebook.com/nasomi
http://www.twitter.com/nasomi
http://www.facebook.com/nasomi
http://www.twitter.com/nasomi
Re: How to deal with Flee Tools/Pos Hacks
you're storing the values in the db? Why? You only need them while they're in that zone. Why can't you add it to the player controller and check every tick or something?
-- Whasf
Re: How to deal with Flee Tools/Pos Hacks
I am storing it in the player controller, and check every tick. It's only stored in the database if they break the speed.
loc px, pz, x, z stored. Previous x, previous z, current x, current z. Then calculates the distancance between the two points.
That's why they need the updated position_t to store the additional positions. You'll see at the end px, py, pz are updated to store current x, y, z.
Since this is recorded every 2.5 seconds:
if (PChar->loc.p.zone != 1 && d /2.4*10 > 60 && PChar->animation != ANIMATION_CHOCOBO && !PChar->StatusEffectContainer->HasStatusEffect(EFFECT_FLEE))
value d for distance /2.4*10 gives you speed ~40 with normal run. The threshold is 60 to allow for some wiggle room like lag/latency, and makes sure they're not on chocobo or fleeing. It also now has pchar->loc.p.zone so every time you zone it doesn't trigger what looks like a pos hax.
Code: Select all
float x = PChar->loc.p.x;
float y = PChar->loc.p.y;
float z = PChar->loc.p.z;
float px = PChar->loc.p.px;
float py = PChar->loc.p.py;
float pz = PChar->loc.p.pz;
float d = sqrt(pow((x - px), 2) + pow((z - pz), 2));
That's why they need the updated position_t to store the additional positions. You'll see at the end px, py, pz are updated to store current x, y, z.
Since this is recorded every 2.5 seconds:
if (PChar->loc.p.zone != 1 && d /2.4*10 > 60 && PChar->animation != ANIMATION_CHOCOBO && !PChar->StatusEffectContainer->HasStatusEffect(EFFECT_FLEE))
value d for distance /2.4*10 gives you speed ~40 with normal run. The threshold is 60 to allow for some wiggle room like lag/latency, and makes sure they're not on chocobo or fleeing. It also now has pchar->loc.p.zone so every time you zone it doesn't trigger what looks like a pos hax.
Nasomi FFXI Community Server - Classic CoP era fun!
http://www.facebook.com/nasomi
http://www.twitter.com/nasomi
http://www.facebook.com/nasomi
http://www.twitter.com/nasomi