SHARE
TWEET

Untitled

a guest Nov 12th, 2015 243 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //ForwardClient(SrcIP: string; SrcPort: integer; TargetIP: string; TargetPort: integer; Message: string);
  2. // Script by Swompie.
  3. // some bug fixing and optimization by dnmr
  4. const
  5.    MaxServerID = 2; // Max servers
  6.  
  7.    // Colors <3
  8.    cNo = $FF0000;
  9.    cStuff = $00CED1;
  10.  
  11. type
  12.     TServers = Record
  13.       IP, Name: string;
  14.       Port: integer;
  15.     end;
  16.  
  17. var
  18.     Servers: Array [0..MaxServerID] of TServers;
  19.     CurrentServerID: integer;
  20.  
  21. procedure Msg(ID: byte; Text: string; Color: longint);
  22. begin
  23.   WriteConsole(ID, Text + '                                                      ', Color);
  24. end;
  25.  
  26. procedure ActivateServer;
  27. begin
  28. { template for lazy ppl :]
  29.   Servers[].IP   := '';
  30.   Servers[].Port := '';
  31.   Servers[].Name := '';
  32. }
  33.   Servers[1].IP   := '80.72.37.12';
  34.   Servers[1].Port := 23073;
  35.   Servers[1].Name := 'Zabijaka.pl [CTF]';
  36.   CurrentServerID := 2;
  37.  
  38.   Servers[2].IP   := '176.9.104.241';
  39.   Servers[2].Port := 23074;
  40.   Servers[2].Name := 'Zabijaka.pl [CTF]#2';
  41.   CurrentServerID := 1;
  42.  
  43.  
  44.  
  45. end;
  46.  
  47.  
  48. function OnRequestGame(IP: string; State: integer): integer;
  49. var i, NewServerID: integer;
  50. begin
  51.   // getting current server ID (won't work in ActivateServer)
  52.   if CurrentServerID = 0 then begin
  53.     for CurrentServerID := 1 to MaxServerID do
  54.       if (Servers[CurrentServerID].IP = ServerIP) and (Servers[CurrentServerID].Port = ServerPort) then
  55.         break;
  56.  
  57.     WriteLn('[Redirect] Server ID: ' + inttostr(CurrentServerID));
  58.  
  59.   end;
  60.  
  61.   if State = 5 then begin
  62.  
  63.     if CurrentServerID = MaxServerID then
  64.       NewServerID := 1
  65.     else
  66.       NewServerID := CurrentServerID + 1;
  67.  
  68.     ForwardClient(IP, ReqPort, Servers[NewServerID].IP, Servers[NewServerID].Port,
  69.     Servers[CurrentServerID].Name + ' is full, wanna join ' + Servers[NewServerID].Name + ' ?');
  70.  
  71.   end;
  72.  
  73.   Result := State;
  74.  
  75. end;
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top