Author Topic: MSAC ScriptCore extensions  (Read 7258 times)

0 Members and 3 Guests are viewing this topic.

Offline Mr

  • Inactive Soldat Developer
  • Soldier
  • ******
  • Posts: 166
MSAC ScriptCore extensions
« on: April 21, 2011, 01:50:34 pm »
Script Name: MSAC ScriptCore extensions
Core Version: 2.6.5

Hey there!

The most recent MSAC server update (0.2.001) added ScriptCore extensions and other useful patches to your server!
If you are already using MSAC on your server, it should automatically have installed them.

Of course the following functions are only available if you installed the MSAC server on your gameserver.
You can download the MSAC server from http://msac.mologie.de/?page=download_server.


The following options are added to GetPlayerStat by MSAC:

Code: (pascal) [Select]
GetPlayerStat(ID, 'MSAC.ClientInstalled'): boolean;
GetPlayerStat(ID, 'MSAC.Status'): integer;
GetPlayerStat(ID, 'MSAC.GUID'): string;

If MSAC is not installed on the server, false will be returned by the above calls.

Use the following constants to query the client's status using GetPlayerStat with MSAC.Status as parameter:

Code: (pascal) [Select]
const
{ Return values of GetPlayerStat(ID, 'MSAC.Status') }
MSAC_STATUS_CONNECTING = 0;
MSAC_STATUS_UPDATING = 1;
MSAC_STATUS_READY = 2;
MSAC_STATUS_IDLING = 3;
MSAC_STATUS_NO_CLIENT = 4;
MSAC_STATUS_NO_CLIENT_AND_WARNED = 5;


The following events are added by MSAC:

Code: (pascal) [Select]
procedure MSAC_OnConnect(ID: Byte);
procedure MSAC_OnConnectionFailure(ID: Byte);

MSAC_OnConnect will be called once a MSAC client successfully connected to the MSAC server. When this event is called, GetPlayerStat(ID, 'MSAC.ClientInstalled') will return true and GetPlayerStat(ID, 'MSAC.GUID') will return a valid GUID. If you call GetPlayerStat(ID, 'MSAC.GUID') before ClientInstalled is set to true, an empty string will be returned.

MSAC_OnConnectionFailure will only be called if you set kick_if_not_installed to false (see http://msac.mologie.de/?page=download_server#config) and indicates that a player joined who does not have the MSAC client installed. This ScriptCore function can be used for executing a custom action (for example redirecting the player to a different server) if a player joins without having the MSAC client installed. Please make sure to call KickPlayer after calling ForwardClient as clients can be hacked to ignore the forward packet.


Example code:

Code: (pascal) [Select]
procedure MSAC_OnConnect(ID: Byte);
begin
WriteLn(' [*] MSAC_OnConnect(' + IntToStr(ID) + '), GUID ' + GetPlayerStat(ID, 'MSAC.GUID'));
end;

procedure MSAC_OnConnectionFailure(ID: Byte);
begin
WriteLn(' [*] MSAC_OnConnectionFailure(' + IntToStr(ID) + ')');
end;

Also, using these functions and procedures will not stop your script from compiling on non-MSAC servers!
However, if you know that your script will also be used on non-MSAC servers aswell, make sure to integrate checks for skipping the MSAC-specific parts on such servers.


Please post any questions, suggestions, pizza and beer you have regarding the MSAC ScriptCore extensions in this thread.
You can also email them to anti-cheat@mologie.de.
« Last Edit: April 21, 2011, 02:33:52 pm by Mr »

Offline VirtualTT

  • Veteran
  • *****
  • Posts: 1026
Re: MSAC ScriptCore extensions
« Reply #1 on: April 21, 2011, 02:38:09 pm »
Is it possible to use this stuff with new 2.7.0 beta?

Offline Mr

  • Inactive Soldat Developer
  • Soldier
  • ******
  • Posts: 166
Re: MSAC ScriptCore extensions
« Reply #2 on: April 21, 2011, 02:43:27 pm »
Is it possible to use this stuff with new 2.7.0 beta?

No, right now MSAC is only available for Soldat 1.5.0 and the dedicated server version 2.6.5.
MSAC will be added to Soldat 1.5.1 as soon as the Soldat dev team is done with implementing the new anti-cheat API.

Offline Furai

  • Administrator
  • Veteran
  • *****
  • Posts: 1908
    • TransHuman Design
Re: MSAC ScriptCore extensions
« Reply #3 on: April 21, 2011, 03:00:16 pm »
*COUGH* Shoozza *COUGH* :)

Nicely "hacked", Mr.
"My senses are so powerful that I can hear the blood pumping through your veins."

Offline Leo

  • Soldat Beta Team
  • Veteran
  • ******
  • Posts: 1011
Re: MSAC ScriptCore extensions
« Reply #4 on: April 21, 2011, 03:36:08 pm »
Nice work Mr, now I get this change to ask for a script that checks a player's ratio and if it's more than a setting we have and no msac installed it kicks him after a few warnings ;)

Offline Mr

  • Inactive Soldat Developer
  • Soldier
  • ******
  • Posts: 166
Re: MSAC ScriptCore extensions
« Reply #5 on: April 21, 2011, 04:07:05 pm »
Nice work Mr, now I get this change to ask for a script that checks a player's ratio and if it's more than a setting we have and no msac installed it kicks him after a few warnings ;)

Wish granted. Make sure to change the ratio in ratiochecker.pas before using this script :)

Offline Leo

  • Soldat Beta Team
  • Veteran
  • ******
  • Posts: 1011
Re: MSAC ScriptCore extensions
« Reply #6 on: April 21, 2011, 04:52:56 pm »
Many thanks :D

Offline Szewczuq

  • Soldier
  • **
  • Posts: 115
  • WOOH! ROCKS ON MY HEAD!
    • POLISH GAMERS COMMUNITY
Re: MSAC ScriptCore extensions
« Reply #7 on: April 22, 2011, 03:39:07 am »
and little script showing list of non-msac players every 2min? :)



Offline Mighty

  • Camper
  • ***
  • Posts: 276
Re: MSAC ScriptCore extensions
« Reply #8 on: April 22, 2011, 03:48:41 am »
Great job there ;)
xFire: macmil        e-mail: macekmil@gmail.com
My scripts: Accuracy Script       Flashbang       Punishments GUID
            CatchMe Gamemod       AntiFake
            CW System             AntiFakeGUID

Offline steppenwo1f

  • Major(1)
  • Posts: 36
Re: MSAC ScriptCore extensions
« Reply #9 on: April 22, 2011, 05:49:15 am »
and little script showing list of non-msac players every 2min? :)
ye, or list of no-msac players available through command

Offline Prodigyx

  • Soldier
  • **
  • Posts: 188
    • SoldatX Brasil
Re: MSAC ScriptCore extensions
« Reply #10 on: April 22, 2011, 07:50:26 am »
Nice job, man  :)
SoldatX - SX Brasil - www.soldatx.com

Offline DorkeyDear

  • Veteran
  • *****
  • Posts: 1507
  • I also go by Curt or menturi
Re: MSAC ScriptCore extensions
« Reply #11 on: April 22, 2011, 03:40:10 pm »
Good job.

Offline Szewczuq

  • Soldier
  • **
  • Posts: 115
  • WOOH! ROCKS ON MY HEAD!
    • POLISH GAMERS COMMUNITY
Re: MSAC ScriptCore extensions
« Reply #12 on: April 23, 2011, 08:41:40 am »
and little script showing list of non-msac players every 2min? :)
ye, or list of no-msac players available through command

yea, could anyone write script like this?



Offline Mr

  • Inactive Soldat Developer
  • Soldier
  • ******
  • Posts: 166
Re: MSAC ScriptCore extensions
« Reply #13 on: April 23, 2011, 11:29:38 am »
and little script showing list of non-msac players every 2min? :)
ye, or list of no-msac players available through command

Great idea, done!

http://www.mologie.de/content/soldat/msac-liststatus.pas

I've written this through SSH and have no option to test it right now, however it should work.

Also, for those who asked me, I am now accepting donations at http://msac.mologie.de/?page=donate :)

Offline Szewczuq

  • Soldier
  • **
  • Posts: 115
  • WOOH! ROCKS ON MY HEAD!
    • POLISH GAMERS COMMUNITY
Re: MSAC ScriptCore extensions
« Reply #14 on: April 23, 2011, 03:38:53 pm »
  • rrt -> [Error] (24:30): Unknown identifier 'status'



Offline Mr

  • Inactive Soldat Developer
  • Soldier
  • ******
  • Posts: 166
Re: MSAC ScriptCore extensions
« Reply #15 on: April 23, 2011, 05:30:25 pm »
  • rrt -> [Error] (24:30): Unknown identifier 'status'

Missing letter in the variable definitions, yay! Fixed.

Offline Beowulf Agate

  • Major
  • *
  • Posts: 73
Re: MSAC ScriptCore extensions
« Reply #16 on: April 24, 2011, 02:04:26 am »
  • msac-liststatus -> [Error] (45:1): Syntax error
  • msac-liststatus -> [Error] (45:1): Unexpected end of file

Offline Polifen

  • Soldier
  • **
  • Posts: 127
Re: MSAC ScriptCore extensions
« Reply #17 on: April 24, 2011, 04:12:46 am »
Are you able to create event like OnRequestGame,  but with HWID? If i get how it works now, I'd guess it's not possible, but maybe you could try somehow. It'd be usefull for making a VIP/remote admin list with dynamic IPs. I know that in Delphi it's possible to create functions with optional parameters, but I don't use real pascal too much. If it wasn't possible, you could just add a new event.

Offline Mr

  • Inactive Soldat Developer
  • Soldier
  • ******
  • Posts: 166
Re: MSAC ScriptCore extensions
« Reply #18 on: April 24, 2011, 04:55:18 am »
  • msac-liststatus -> [Error] (45:1): Syntax error
  • msac-liststatus -> [Error] (45:1): Unexpected end of file

Sounds like you didnt copy the whole file, I dont get this error.


Are you able to create event like OnRequestGame,  but with HWID? If i get how it works now, I'd guess it's not possible, but maybe you could try somehow. It'd be usefull for making a VIP/remote admin list with dynamic IPs. I know that in Delphi it's possible to create functions with optional parameters, but I don't use real pascal too much. If it wasn't possible, you could just add a new event.

Unfortunately not without tinkering with Soldat's netcode. As I do not have the sourcecode and only created these modifications using a disassembler, it would pretty much take forever. The reason for this is that I don't know the GUID before the player actually joined. Soldat 1.5.1 however will be shipped with the new AC API, which allows me to receive the players GUID before he actually joins the game. I am sure it is possible for the Soldat devs to update the ScriptCore to include it into OnReqesGame.
« Last Edit: April 24, 2011, 04:57:12 am by Mr »

Offline Szewczuq

  • Soldier
  • **
  • Posts: 115
  • WOOH! ROCKS ON MY HEAD!
    • POLISH GAMERS COMMUNITY
Re: MSAC ScriptCore extensions
« Reply #19 on: April 24, 2011, 07:06:07 am »
also u can add this script to MSAC.dll file, ya? it would be turning on/off by command :)