Gothic Online Forums
[0.1.4.*] [client/server] Simple anty-cheat - Printable Version

+- Gothic Online Forums (https://archive.gothic-online.com)
+-- Forum: Scripting (English) (https://archive.gothic-online.com/forum-11.html)
+--- Forum: Resources (https://archive.gothic-online.com/forum-14.html)
+---- Forum: Scripts (https://archive.gothic-online.com/forum-17.html)
+---- Thread: [0.1.4.*] [client/server] Simple anty-cheat (/thread-2344.html)



[0.1.4.*] [client/server] Simple anty-cheat - Profesores - 19.02.2018

Description:
This is simple anty-cheat, that protects the server from unexpected change strength, dexterity, health, maxhealth, mana and maxmana.

WIKI: CLICK ME

If you have any suggestion, report it here: Issues

Current Version: 0.7

Readme: README
Download: CLICK ME

Requirements:
packets.nut client/server side from default G2O scripts (you must include it before AC)

Installation:
1. Extract G2O_Simple_AC.zip
2. Move all resulting files to main server-files folder.
3. Add the following to your config.xml (BEFORE YOUR GAMEMODE SCRIPTS!):
Code:
<import src="ac.xml" />

5. Add to onInit() (server-side):
Code:
initAntyCheat(true);

6. Add to onPlayerDisconnect(pid, reason) SERVER-SIDE:
Code:
clearACStructure(pid);


New callbacks (example usage in ac-server/callbacks.nut):
Code:
onPlayerUseCheats(int pid, string category, int newvalue, int oldvalue)



New functions(SERVER-SIDE):
Code:
array getEquipment(int pid)

getEquipment is a function which returns only synchronized items (protection from Daedalus CreateInvItems and other method to unexpected giveItem or clone items).


Repository


RE: [0.1.3] [client/server] Simple anty-cheat - Sative - 19.02.2018

gut gut


RE: [0.1.3] [client/server] Simple anty-cheat - Profesores - 20.02.2018

Release 0.4:

New Functions(SERVER-SIDE):
Code:
array getEquipment(pid)

getEquipment is a function which returns only synchronized items (protection from Daedalus CreateInvItems and other method to unexpected giveItem or clone items).

Example usage:
Code:
addEventHandler("onPlayerCommand", function(pid, cmd, params)
{
    switch(cmd)
    {
        case "geteq":
        {
            local items = getEquipment(pid);
            
            foreach(k, v in items)
                sendMessageToPlayer(pid, 255, 255, 255, Items.name(v[0]) + " " + v[1]);
        };
        
        break;
    };
});


Enjoy it ! ;-)


RE: [0.1.3] [client/server] Simple anty-cheat - Profesores - 21.02.2018

Release 0.5:

Changelog:
  • From now getEquipment(pid) include ItemsGround objects.




RE: [0.1.3] [client/server] Simple anty-cheat - Profesores - 01.03.2018

Release 0.6:

Changelog:
  • From now array with items react to clientside function "clearInventory()"
  • Array with items also react to consumption food and plants
  • Added protection from unexpected change mana and maxmana




RE: [0.1.4] [client/server] Simple anty-cheat - Sative - 01.03.2018

good boy


RE: [0.1.4] [client/server] Simple anty-cheat - Sative - 01.03.2018

You can add checking hashes of GOTHIC.DAT


RE: [0.1.4] [client/server] Simple anty-cheat - Profesores - 20.03.2018

Release 0.7:

Changelog:
  • Fixed duplicate items in arrray




RE: [0.1.4.*] [client/server] Simple anty-cheat - Patrix - 20.03.2018

Maybe instead of creating numerical array for every player, you should create a associative table?
A string index (instance of item) allows you to get value from table immediately.

It will require less looping, but table will take more memory.
It's only a suggestion Smile.