0 Members and 1 Guest are viewing this topic.
(...)// 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 Eventsprocedure 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; (...)
Last year, I dreamt I was pissing at a restroom, but I missed the urinal and my penis exploded.
Also, what if there are 2 people from the same ISP?