Introduction:
SpeedBlock is Gothic 2 Online module consisting of both server and client side components. It allows to detect undesirable (game process) speed changes performed by using applications such as Cheat Engine and measure speed multiplier with an accuracy of 0.001. Any reactions and penalties are configurable via adding handlers to provided server-side events. False positive results are very unlikely to happen.
Server-side events:
onSpeedHackDetect(int pid, float multiplier) - called if measured player speed multiplier for player is incorect. Provides measured multiplier as parameter.
onSpeedBlockModuleMissing(int pid) - called if player has no module, module is not loaded on client side or module file hash mismatch occurs. Event won't be called right after player joins, it will trigger in few seconds - this allows to prevent false positive on overloaded server. If you wish to detect missing module on client-side instantly, you should use custom script similar to presented below.
onSpeedBlockModuleError(int pid) - rare event occuring only when someone is trying to mess with module protection algorithm. Should be also penalised.
Example implementation:
For instantly detecting missing module on client-side, include in onInit:
Download links:
Client Module (Windows) - SpeedBlock.dll
SHA256: 9369ae58679040f2c2e657779f79dbe864d967ae54582536f18d4564dfbfcec7
Server Module (Windows) - SpeedBlockServer.dll
SHA256: fc8ac3cfc67208ec4b6f987b977c9567246048d14ad630096b2d731688151397
Server Module (Linux) - SpeedBlockServer.so
SHA256: 3ca49fbf140291ac28887590630e8d85d176e7670febe1a229ca10e8d62e3f63
Configuration (exact while placing server-side modules in main server directory):
Client module should be placed in Multiplayer/Modules folder and in a desired server directory.
For both Windows and Linux based servers, add line to config.xml:
If hosting server on Windows, add another line:
If hosting server on Linux, add line:
For Linux version, it might be required to put ./ before module names/directories. Example:
SpeedBlock is Gothic 2 Online module consisting of both server and client side components. It allows to detect undesirable (game process) speed changes performed by using applications such as Cheat Engine and measure speed multiplier with an accuracy of 0.001. Any reactions and penalties are configurable via adding handlers to provided server-side events. False positive results are very unlikely to happen.
Server-side events:
onSpeedHackDetect(int pid, float multiplier) - called if measured player speed multiplier for player is incorect. Provides measured multiplier as parameter.
onSpeedBlockModuleMissing(int pid) - called if player has no module, module is not loaded on client side or module file hash mismatch occurs. Event won't be called right after player joins, it will trigger in few seconds - this allows to prevent false positive on overloaded server. If you wish to detect missing module on client-side instantly, you should use custom script similar to presented below.
onSpeedBlockModuleError(int pid) - rare event occuring only when someone is trying to mess with module protection algorithm. Should be also penalised.
Example implementation:
Code:
addEventHandler("onSpeedHackDetect",function(pid, multiplier)
{
if(isPlayerConnected(pid))
kick(pid, "SpeedHack detected with multiplier: " + multiplier);
});
addEventHandler("onSpeedBlockModuleError",function(pid)
{
if(isPlayerConnected(pid))
kick(pid, "SpeedBlock module error.");
});
addEventHandler("onSpeedBlockModuleMissing",function(pid)
{
if(isPlayerConnected(pid))
kick(pid, "Missing SpeedBlock module.");
});
For instantly detecting missing module on client-side, include in onInit:
Code:
local function initHandler()
{
try{
_7fdgkt(0xFF);
}
catch(Exception){
//send packet to notify server, exitGame, w/e
}
}
addEventHandler("onInit", initHandler);
Download links:
Client Module (Windows) - SpeedBlock.dll
SHA256: 9369ae58679040f2c2e657779f79dbe864d967ae54582536f18d4564dfbfcec7
Server Module (Windows) - SpeedBlockServer.dll
SHA256: fc8ac3cfc67208ec4b6f987b977c9567246048d14ad630096b2d731688151397
Server Module (Linux) - SpeedBlockServer.so
SHA256: 3ca49fbf140291ac28887590630e8d85d176e7670febe1a229ca10e8d62e3f63
Configuration (exact while placing server-side modules in main server directory):
Client module should be placed in Multiplayer/Modules folder and in a desired server directory.
For both Windows and Linux based servers, add line to config.xml:
PHP Code:
<module src="SpeedBlock.dll" type="client" />
If hosting server on Windows, add another line:
PHP Code:
<module src="SpeedBlockServer.dll" type="server" />
If hosting server on Linux, add line:
PHP Code:
<module src="SpeedBlockServer.so" type="server" />
For Linux version, it might be required to put ./ before module names/directories. Example:
PHP Code:
<module src="./SpeedBlockServer.so" type="server" />