<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://wiki.soldat.pl/index.php?action=history&amp;feed=atom&amp;title=OnRequestGame</id>
		<title>OnRequestGame - Revision history</title>
		<link rel="self" type="application/atom+xml" href="https://wiki.soldat.pl/index.php?action=history&amp;feed=atom&amp;title=OnRequestGame"/>
		<link rel="alternate" type="text/html" href="https://wiki.soldat.pl/index.php?title=OnRequestGame&amp;action=history"/>
		<updated>2026-05-26T00:18:12Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.30.0</generator>

	<entry>
		<id>https://wiki.soldat.pl/index.php?title=OnRequestGame&amp;diff=134&amp;oldid=prev</id>
		<title>Freeman: Created page with &quot;===From the Scripting Manual===   ''function OnRequestGame(IP: string; State: integer): integer;''      '''Parameter Info:'''    IP (String): IP Address of the player requesti...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.soldat.pl/index.php?title=OnRequestGame&amp;diff=134&amp;oldid=prev"/>
				<updated>2012-08-15T09:52:03Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;quot;===From the Scripting Manual===   &amp;#039;&amp;#039;function OnRequestGame(IP: string; State: integer): integer;&amp;#039;&amp;#039;      &amp;#039;&amp;#039;&amp;#039;Parameter Info:&amp;#039;&amp;#039;&amp;#039;    IP (String): IP Address of the player requesti...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;===From the Scripting Manual===&lt;br /&gt;
  ''function OnRequestGame(IP: string; State: integer): integer;''&lt;br /&gt;
  &lt;br /&gt;
  '''Parameter Info:'''&lt;br /&gt;
   IP (String): IP Address of the player requesting game.&lt;br /&gt;
   State (integer): Current state of the player who requested. See below for values.&lt;br /&gt;
  &lt;br /&gt;
  '''State Values:'''&lt;br /&gt;
   OK = 1;&lt;br /&gt;
   WRONG_VERSION = 2;&lt;br /&gt;
   WRONG_PASSWORD = 3;&lt;br /&gt;
   BANNED_IP = 4;&lt;br /&gt;
   SERVER_FULL = 5;&lt;br /&gt;
   DUPLICATE_IP = 6;&lt;br /&gt;
  &lt;br /&gt;
  '''Description:'''&lt;br /&gt;
   This function will be called every time a player tries to join your server.&lt;br /&gt;
   OnRequestGame can be used as an intercept to change the state of the reply that is sent to the Player, so if you modify the State variable, the new State will be sent to the player. With this, you will be able to have your own limitations to the server such as a &amp;quot;Reserved Slot&amp;quot; list, and much more. See the example below for how to code a &amp;quot;Reserved&amp;quot; list.&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
===Reserved IP list===&lt;br /&gt;
This example will show you how to code a Reserved IP list:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;pascal&amp;quot;&amp;gt;function OnRequestGame(IP: string;State: integer):integer;&lt;br /&gt;
var&lt;br /&gt;
VIPList: TStringArray;&lt;br /&gt;
i: integer;&lt;br /&gt;
begin&lt;br /&gt;
 VIPList := split(ReadFile('viplist.txt'),chr(13)+chr(10)); // Open viplist.txt and split into array&lt;br /&gt;
 for i := 0 to ArrayHigh(VIPList) do&lt;br /&gt;
  if (IP = VIPList[i]) And (State = 1) or (State = 5) then begin&lt;br /&gt;
// If player IP is in list, and they arent banned.&lt;br /&gt;
    State := 1; // OK&lt;br /&gt;
    break; //End looping&lt;br /&gt;
  end;&lt;br /&gt;
 result := State; // Return new state&lt;br /&gt;
end;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Note that the function Split no longer exists. You would need to create the [[XSplit]] function and use that instead.&lt;br /&gt;
&lt;br /&gt;
==External Links==&lt;br /&gt;
* [http://enesce.com/help/index.html?Events/OnRequestGame.html Scripting Manual page for OnRequestGame]&lt;br /&gt;
&lt;br /&gt;
[[Category:Server Scripting]][[Category:Server Scripting Events]]&lt;/div&gt;</summary>
		<author><name>Freeman</name></author>	</entry>

	</feed>