Explorar o código

Merge remote-tracking branch 'upstream/master'

own3mall %!s(int64=6) %!d(string=hai) anos
pai
achega
cb7fbfc4f8

BIN=BIN
images/icons/sinusbot.png


+ 16 - 1
modules/config_games/server_configs/insurgencysandstorm_linux64.xml

@@ -28,6 +28,21 @@
     </mod>
   </mods>
   <server_params>
+    <param key="-GSLTToken=" type="text">
+      <caption>Game Server Login Token</caption>
+      <desc>Manage your tokens &lt;a href=https://steamcommunity.com/dev/managegameservers target=_blank&gt;here&lt;/a&gt;</desc>
+      <option>ns</option>
+    </param>
+    <param key="-GameStats" type="checkbox_key_value">
+      <caption>Game Stats</caption>
+      <desc>Enable Game Stats</desc>
+    </param>
+    <param key="-mutators=" type="text">
+      <default>OfficialRules</default>
+      <caption>Mutators</caption>
+      <desc>Mutators to be used on the server, separate multiple mutators with a comma and no space</desc>
+      <option>ns</option>
+    </param>
     <param id="SERVERNAME" key="-hostname=" type="text">
       <option>q</option>
       <caption>Server name</caption>
@@ -239,4 +254,4 @@ MaximumSupply=15" > $configs -->
 		<file description="Custom Map Cycle">Insurgency/Config/Server/MapCycleCustom.txt</file>
 		<file description="Admins List">Insurgency/Config/Server/Admins.txt</file>
 	</configuration_files>
-</game_config>
+</game_config>

+ 110 - 0
modules/config_games/server_configs/sinusbot_linux64.xml

@@ -0,0 +1,110 @@
+<game_config>
+  <game_key>sinusbot_linux64</game_key>
+  <protocol>lgsl</protocol>
+  <lgsl_query_name>sinusbot</lgsl_query_name>
+  <installer>steamcmd</installer>
+  <game_name>SinusBot for TS 3 and Discord</game_name>
+  <server_exec_name>sinusbot</server_exec_name>
+  <cli_template>%CONTROL_PASSWORD%</cli_template>
+  <cli_params>
+    <cli_param id="CONTROL_PASSWORD" cli_string="--override-password=" />
+  </cli_params>
+  <max_user_amount>1</max_user_amount>
+  <mods>
+    <mod key="sinusbot">
+      <name>none</name>
+      <installer_name>0</installer_name> 
+      <installer_login>anonymous</installer_login>
+    </mod>
+  </mods>
+  <replace_texts>
+    <text key="ip">
+      <default>ListenHost.*</default>
+      <var>ListenHost =</var>
+      <filepath>config.ini</filepath>
+      <options>sq</options>
+    </text>
+    <text key="port">
+      <default>ListenPort.*</default>
+      <var>ListenPort =</var>
+      <filepath>config.ini</filepath>
+      <options>s</options>
+    </text>
+  </replace_texts>
+  <post_install>
+rm -R steamapps
+if [ ! -s "sinusbot_installer.sh" ]; then
+  wget https://raw.githubusercontent.com/SinusBot/installer-linux/master/sinusbot_installer.sh
+  chmod +x sinusbot_installer.sh
+fi
+if [ ! -s "diagSinusbot.sh" ]; then
+  wget https://raw.githubusercontent.com/patschi/sinusbot-tools/master/tools/diagSinusbot.sh
+  chmod +x diagSinusbot.sh
+fi
+if [ ! -s "sinusbot" ]; then
+  echo "Sinusbot is not installed!"
+fi
+OGPUSERNAME=$(whoami)
+mkdir -p tempogp
+echo
+echo
+echo "\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\   R E A D    T H I S   ////////////////////"
+echo "\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ ////////////////////////////////"
+echo "\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\   R E A D    T H I S   ////////////////////"
+echo "\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ ////////////////////////////////"
+echo "\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\   R E A D    T H I S   ////////////////////"
+echo
+echo
+echo "Install Sinusbot with the provided script with the following command:"
+echo
+echo "sudo su - $OGPUSERNAME"
+echo "sudo $PWD/sinusbot_installer.sh"
+echo
+echo "Use the 'INSTALL' option, then select 'Own path' and use this location:"
+echo
+echo "$PWD"
+echo
+echo "Note that the path needs to have NO '/' at the end. Continue by carefuly following"
+echo "the instructions and when asked, use the following user name for sinusbot: $OGPUSERNAME"
+echo
+echo "Follow the Teamspeak client install instructions."
+echo "Basically you will need to press in order the ENTER, q, y, and ENTER keys."
+echo
+echo "WARNING: After Installation, you will need to REMOVE the Sinusbot service by executing"
+echo "the sinusbot_installer.sh script again. This is mandatory or else you will have"
+echo "Sinusbot running as a service in the background and messing with OGP!"
+echo
+echo "sudo su - $OGPUSERNAME"
+echo "sudo $PWD/sinusbot_installer.sh"
+echo
+echo "Select the 'REMOVE' option, then select 'Own path' and be sure to use this location:"
+echo
+echo "$PWD/tempogp"
+echo
+echo "after that, when asked confirm and continue, DO NOT remove Youtube-DL, confirm the 'tempogp' folder location,"
+echo "DO NOT remove the '$OGPUSERNAME' user, and finish you're done, this should have you a working installation."
+echo
+echo
+echo "At any time, to make sure you have all dependencies before starting Sinusbot you can use the"
+echo "diagnostic script available in this folder, execute the following command from terminal:"
+echo
+echo "sudo $PWD/diagSinusbot.sh"
+echo
+echo "Follow the instructions to install all the dependencies"
+echo "Once all is clear you should be able to start the bot"
+echo
+echo
+echo "\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\   R E A D    T H I S    A B O V E   ///////////////////"
+echo "\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ /////////////////////////////////////"
+echo "\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\   R E A D    T H I S    A B O V E   ///////////////////"
+echo "\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ /////////////////////////////////////"
+echo "\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\   R E A D    T H I S    A B O V E   ///////////////////"
+echo
+  </post_install>
+  <lock_files>
+	teamspeak3-client/ts3client_linux_amd64
+  </lock_files>
+  <configuration_files>
+    <file description="Main Config File">config.ini</file>
+  </configuration_files>
+</game_config>

+ 25 - 0
protocol/lgsl/lgsl_protocol.php

@@ -133,6 +133,7 @@ if (!function_exists('lgsl_version')) { // START OF DOUBLE LOAD PROTECTION
 		"shoutcast"		=> "SHOUTcast Server", 
 		"serioussam2"	=> "Serious Sam 2",
 		"shatteredh"	=> "Shattered Horizon",
+		"sinusbot"		=> "SinusBot for TS 3 and Discord",
 		"sniperelitev2"	=> "Sniper Elite V2",
 		"sof2"			=> "Soldier of Fortune 2",
 		"soldat"		=> "Soldat",
@@ -295,6 +296,7 @@ if (!function_exists('lgsl_version')) { // START OF DOUBLE LOAD PROTECTION
 		"serioussam2"	=> "09",
 		"shatteredh"	=> "05",
 		"shoutcast"		=> "37",
+		"sinusbot"		=> "42",
 		"sniperelitev2"	=> "31",
 		"sof2"			=> "02",
 		"soldat"		=> "08",
@@ -454,6 +456,7 @@ if (!function_exists('lgsl_version')) { // START OF DOUBLE LOAD PROTECTION
 		"serioussam2"	=> "qtracker://{IP}:{S_PORT}?game=Serious_Sam2&action=show",
 		"shatteredh"	=> "http://en.wikipedia.org/wiki/Shattered_Horizon",
 		"shoutcast"		=> "http://{IP}:{S_PORT}/index.html",
+		"sinusbot"		=> "http://{IP}:{C_PORT}",
 		"sniperelitev2"	=> "steam://connect/{IP}:{Q_PORT}",
 		"sof2"			=> "qtracker://{IP}:{S_PORT}?game=SoldierOfFortune2&action=show",
 		"soldat"		=> "http://www.soldat.pl",
@@ -4342,6 +4345,28 @@ if (!function_exists('lgsl_version')) { // START OF DOUBLE LOAD PROTECTION
 		return true;
 	}
 //------------------------------------------------------------------------------------------------------------+
+//------------------------------------------------------------------------------------------------------------+
+	function lgsl_query_42(&$server, &$lgsl_need, &$lgsl_fp)
+	{
+	//---------------------------------------------------------+
+	//  Check for a 200 status code on http://ip:port/  
+
+		$ip = $server['b']['ip'];
+		$port = $server['b']['c_port'];
+		$server_url = "http://$ip:$port/";
+		$ch = curl_init();
+		curl_setopt ( $ch, CURLOPT_URL, $server_url );
+		curl_setopt ( $ch, CURLOPT_RETURNTRANSFER, 1 );
+		curl_setopt ( $ch, CURLOPT_TIMEOUT, 10 );
+		$http_respond = curl_exec($ch);
+		$http_respond = trim( strip_tags( $http_respond ) );
+		$http_code = curl_getinfo( $ch, CURLINFO_HTTP_CODE );
+		curl_close( $ch );
+		if ( ( $http_code == "200" ) ) {
+		  return true;
+		} 
+	}
+//------------------------------------------------------------------------------------------------------------+
 //------------------------------------------------------------------------------------------------------------+
 	function lgsl_query_feed(&$server, $request, $lgsl_feed_method, $lgsl_feed_url, $home_info = False)
 	{