Author Topic: remoteNet |updated|  (Read 5511 times)

0 Members and 1 Guest are viewing this topic.

Offline cooz

  • Soldier
  • **
  • Posts: 187
  • BANNED
remoteNet |updated|
« on: November 29, 2006, 04:14:22 pm »
Script Name: remoteNet
Script Description: script allowing to add subnets to admin list
Original Author: cooz
Core Version: 2.5.2

Code: [Select]
var
  i: integer;
  remotenet,adminip,joinip: TStringArray;

function OnRequestGame(IP: string;State: integer):integer;
begin
  remotenet:= split(ReadFile('remotenet.txt'),chr(13)+chr(10));
  for i:=0 to arrayhigh(remotenet)-1 do begin
    adminip:= split(remotenet[i],'.');
    joinip:= split(IP,'.');
    if((adminip[0]+adminip[1]+adminip[2])=(joinip[0]+joinip[1]+joinip[2])) then begin command('/admip '+IP); end;
  end;
result := state;
end;

notes:
you have to create remotenet.txt file and add to it IPs, example file could look like this:
127.0.0.*
10.0.0.*
192.168.10.*

notice that script use split() function so it won't work properly on current linux server version
[!!]warning, script used in incorrect way can cause security risks[!!]

that would be all,
« Last Edit: November 30, 2006, 05:40:50 am by cooz »
Dead man! Dead man walking! We got a dead man walking here! Banned man crawling more like

Offline EnEsCe

  • Retired Soldat Developer
  • Flamebow Warrior
  • ******
  • Posts: 3101
  • http://enesce.com/
    • [eC] Official Website
Re: remoteNet
« Reply #1 on: November 29, 2006, 07:21:00 pm »
Why dont you just use the MaskCheck function?
Or use StrPos instead of making your own function >_>

Offline cooz

  • Soldier
  • **
  • Posts: 187
  • BANNED
Re: remoteNet
« Reply #2 on: November 29, 2006, 08:15:09 pm »
sorry, i just made it for entertainment,
it was fun for me to create those functions

does it make script run slower?
i can rewrite it... but then it will look so simple, hehe
Dead man! Dead man walking! We got a dead man walking here! Banned man crawling more like

Offline Frenchie

  • Camper
  • ***
  • Posts: 358
  • SoldatHQ
Re: remoteNet
« Reply #3 on: November 30, 2006, 02:40:05 am »
Sweet just what I needed  ;D
Good Work Cooz. ++
Soldat Lobby Avec Players -New Release! - Updated AGAIN!


Offline chrisgbk

  • Moderator
  • Veteran
  • *****
  • Posts: 1739
Re: remoteNet
« Reply #4 on: November 30, 2006, 02:42:18 am »
If you use this script, be aware of the possible security risks. Used wrongly, it's possible for people to get admin that you don't want.

Offline cooz

  • Soldier
  • **
  • Posts: 187
  • BANNED
Re: remoteNet |updated|
« Reply #5 on: November 30, 2006, 09:06:06 am »
script updated,

it uses default functions now,
i also added warning about security risk to first post
Dead man! Dead man walking! We got a dead man walking here! Banned man crawling more like