Official Soldat Forums

Server Talk => Scripting Releases => Topic started by: Mighty on July 03, 2010, 04:15:39 pm

Title: AntiFake
Post by: Mighty on July 03, 2010, 04:15:39 pm
Name: AntiFake

Author: Mighty (http://soldatcentral.com/index.php?page=profile&u=406) (idea by Silnikos)
Script version: 2.2.0
Server version: 2.6.5
Release Date: 6th of February 2011
Compile Test: (http://soldatcentral.com/images/pass.gif) Passed
Description:
Script made to avoid faking on the servers, without any accounts.
It's based on IP and visits.

Commands:
 * /whoiz X - shows who X is (X = ID or nickname part)
 * /whoizall - shows everyone's most probable 'personality'
 * /readwhoiz X - shows more details about player X
Admin Commands:
 * /mark <who> <num> <as_who> - use this when you're sure about some1. e.g. /mark 1 100 ~Sn. Mighty
 * /octets - now you don't need to have a player ingame to check his personality. e.g. /octets 127.0

Requirements:
 *  Folder "antifake" must be created in root soldatserver folder (included in .rar)

Uses:
 * Explode function by DorkeyDear (http://soldatcentral.com/index.php?page=profile&u=4), CurryWurst (http://forums.soldat.pl/index.php?action=profile;u=10539)

---
(http://soldatcentral.com/images/download.gif) (http://forums.soldat.pl/index.php?action=dlattach;topic=38525.0;attach=27214)
The also attached file AntiFake.zip is just the previous version (2.1.0), if you're interested.
---
Code: {snippets}
Code: [Select]
(...)
// AntiFake file handling

Procedure UpdateFile(ID: byte);
var
needle: string;
i,j: integer;
infile, name, number, filename: string;
begin
filename := 'antifake/'+GetOctets(IdToIp(ID))+'..txt';
list := Explode(ReadFile(filename),chr(10));
needle := chr(4)+IdToName(ID)+chr(3);
for i:=0 to ArrayHigh(list)-1 do
if ContainsString(list[i],needle) then
begin
list[i] := Copy(list[i],1,Length(list[i])-1);
number := Copy(list[i],StrPos(chr(3),list[i])+1,Length(list[i]));
name := Copy(list[i],1,StrPos(chr(3),list[i])-1);
number := inttostr(1+strtoint(number));
list[i] := name+chr(3)+number;
for j:=0 to ArrayHigh(list)-1 do
infile := infile + list[j] + chr(10);
WriteFile(filename,infile);
exit;
end;
WriteFile(filename,ReadFile(filename)+chr(4)+IdToName(ID)+chr(3)+'1'+chr(10))
end;

Procedure UnCover(ID: byte);
var
needle: string;
i,number: integer;
infile, name, filename: string;
begin
if not(FileExists('antifake/'+GetOctets(IdToIp(ID))+'..txt')) then
WriteLn('File does not exist! Check your folders!')
else
begin
filename := 'antifake/'+GetOctets(IdToIp(ID))+'..txt';
list := Explode(ReadFile(filename),chr(10));
needle := chr(4)+IdToName(ID)+chr(3);
for i:=0 to ArrayHigh(list)-1 do
begin
list[i] := Copy(list[i],1,Length(list[i])-1);
number := strtoint(Copy(list[i],StrPos(chr(3),list[i])+1,Length(list[i])));
name := Copy(list[i],2,StrPos(chr(3),list[i])-2);
Player[ID].Names[i] := name;
Player[ID].Count[i] := number;
end;

i:=0;
while not(Player[ID].Names[i] = '') do
i:=i+1;

Player[ID].RealHigh := i-1;
SortArray(ID);
end;
end;

// Default Events

procedure OnJoinGame(ID, Team: byte);
begin
if not(FileExists('antifake/'+GetOctets(IdToIp(ID))+'..txt')) then
WriteFile('antifake/'+GetOctets(IdToIp(ID))+'..txt',chr(4)+IdToName(ID)+chr(3)+'1'+chr(10))
else
begin
UpdateFile(ID);
UnCover(ID);
Player[ID].RealName := Player[ID].Names[0];
if Player[ID].RealName = '' then Player[ID].RealName := '>>unknown<<'
end;
end;
(...)

Questions? Bugs? Report please --> macekmil@gmail.com
Title: Re: AntiFake
Post by: Stuffy on July 03, 2010, 07:12:35 pm
Good idea, but I think its not a big protection, because you can change your ip so easily and some people have got a dynamic ip so...
Title: Re: AntiFake
Post by: Mighty on July 04, 2010, 03:40:02 am
It's based on 1st 2 octets of IP. Usually dynamic IP doesnt change them. (Right? :P)
Title: Re: AntiFake
Post by: Swompie on July 04, 2010, 03:42:23 am
For me it doesn't, gj
Title: Re: AntiFake
Post by: tk on July 04, 2010, 03:47:19 am
For me it does.
Title: Re: AntiFake
Post by: croat1gamer on July 04, 2010, 06:40:39 am
2nd octet is also changing, but mostly its 2-4 different ones, shouldnt be more than that.

Also, what if there are 2 people from the same ISP?
Title: Re: AntiFake
Post by: Mighty on July 04, 2010, 10:53:16 am
Also, what if there are 2 people from the same ISP?

You mean when octets are same?
Generaly it searches octets. then it gets 1st fifty nicknames under these octets. it checks their visits count. Then u get 15 highest counts of visits.
Title: Re: AntiFake
Post by: Leo on July 18, 2010, 05:25:31 am
Nice but how to make it so that it works for admins only ?

p.s Also when I tried it in an empty server it takes me to spectator even when I choose a team when I join.
Title: Re: AntiFake
Post by: Mighty on February 06, 2011, 04:14:06 pm
I guess i added autospec on join then 0o didn't even know that, lol

The script doesn't work actually, or at least at my general testing it sucked ass, but at least i know what should be fixed, so someday i'll fix it.

Update! Script completely rewritten
Script seems to be working finally :) Enjoy

Title: Re: AntiFake
Post by: Irlandec on February 08, 2011, 11:33:55 am
Good script out of here Mighty! Hope no one will have issues with it, you coded it fully right :P
Title: Re: AntiFake
Post by: Damian[Eater] on February 22, 2011, 11:12:13 am
Running on Beo's servers. Working well. Good job Mighty. :)
Title: Re: AntiFake
Post by: Mighty on March 01, 2011, 01:38:42 pm
UPDATE

* Added /mark and /octets commands for admin.
* Made use or WriteLn so admin can check anyone without joining game

Details in first post, download link: Click! (http://forums.soldat.pl/index.php?action=dlattach;topic=38525.0;attach=27214)

OFC files with players data don't have to be reset :)
Enjoy