Browse Source

SinusBot support - READ THE UPDATE LOG TO INSTALL THE BOT (#444)

Start installation by clicking the 'Install/Update via Steam' button in Panel (a trick is used to have this button to trigger the post install script), and CAREFULLY READ THE UPDATE LOG it contains important instructions to finish SinusBot installation.

What It will install from Panel is the Installation and diagnostic scripts for easy manual installation from terminal, as there is a lot of dependencies this method ensures everything is perfectly setup. Also some programs have interactive prompts in order to install them like Teamspeak client and it is not possible to bypass them so in the end manual installation from terminal was always needed.

All proper instruction for installation will be shown in the "Install/Update via Steam" page log in Panel.

* Update lgsl_protocol.php
* Add files via upload
* Add files via upload
®omano 6 years ago
parent
commit
39dffa9a79

BIN
images/icons/sinusbot.png


+ 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)
 	{