Jump to content
  • 0

Problems for Arma3 Epoch Linux Server!


eno

Question

Hello i have 2 Problems by my Epoch Linux Server.

 

I have Ubuntu 14

 

1. I can not starting the map Australia, I always get the message that I should delete FILES or because to install correct key.

 

2. We can i a restart message for my Server. I have tries this https://github.com/deannreid/BattlEye-RCON-Control-PHP#for-webmin

 but I get an error message "

Output from command php -q /home/bob/napf/tools/2hr.php ..

PHP Parse error:  syntax error, unexpected '.21' (T_DNUMBER) in /home/bob/napf/tools/2hr.php on line 13

"

 

 

 

<?php
include("config.php");
	$text = 'say -1 ';
	if(isset($argv[1]))
	{
		$text .= $argv[1];
	} else {
		$text .= "Server Restart in 2 Hours.";
	}
	
	//Settings
	$pass = *************;
	$ip = 178.254.21.143;
	$port = 2305;
	
	//Dont touch
	$msgseq = 0;
	
	//Generate CRC32 for pass and msg
        $authCRC = crc32(chr(255).chr(00).trim($pass));
	$authCRC = sprintf("%x", $authCRC);
	$msgCRC = crc32(chr(255).chr(01).chr(hexdec(sprintf('%01b',$msgseq))).$text);
	$msgCRC = sprintf("%x", $msgCRC);
	//Reverse the CRCs and put into array
	$authCRC = array(substr($authCRC,-2,2),substr($authCRC,-4,2),substr($authCRC,-6,2),substr($authCRC,0,2));
	$msgCRC = array(substr($msgCRC,-2,2),substr($msgCRC,-4,2),substr($msgCRC,-6,2),substr($msgCRC,0,2));
	
        //Socket comm
        $sock = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP);
	
	if(!$sock)
	{
		die("Socket create failed: ".socket_last_error()."\n");
	} else {
		echo "Got Socket!\n";
	}
	
	//header
        $loginmsg = "BE".chr(hexdec($authCRC[0])).chr(hexdec($authCRC[1])).chr(hexdec($authCRC[2])).chr(hexdec($authCRC[3]));
	//Add payload
	$loginmsg .= chr(hexdec('ff')).chr(hexdec('00')).$pass;
        $len = strlen($loginmsg);
        
	echo "Attempting Login\n";
        $sent = socket_sendto($sock, $loginmsg, $len, 0, $ip, $port);
	
	if($sent == false)
	{
		die("failed to send login ".socket_last_error()."\n");
	} else {
		//echo "Login sent: ".$sent." bytes\n";
	}
	
        socket_recvfrom($sock, $buf, 64, 0, $ip, $port);
	//var_dump($buf);
	if(ord($buf[strlen($buf)-1]) == 1)
	{
		echo "Login Successful!\n";
	} else if(ord($buf[strlen($buf)-1]) == 0) {
		echo "Login Failed!\n";
	} else {
		echo "Unknown result from login!\n";
		exit;
	}
	
	$recv = socket_recvfrom($sock, $buf, 64, 0, $ip, $port);
        if($recv == false)
	{
		die("failed to recv ".socket_last_error()."\n");
	} else {
		//echo "Recieved: ".$recv." bytes\n\n";
	}
        //var_dump($buf);
	echo substr($buf,9)."\n";
	
	
	//Send a heartbeat packet
	$statusmsg = "BE".chr(hexdec("7d")).chr(hexdec("8f")).chr(hexdec("ef")).chr(hexdec("73"));
	$statusmsg .= chr(hexdec('ff')).chr(hexdec('02')).chr(hexdec('00'));
	$len = strlen($statusmsg);
	socket_sendto($sock, $statusmsg, $len, 0, $ip, $port);

	
	//header
	$saymsg = "BE".chr(hexdec($msgCRC[0])).chr(hexdec($msgCRC[1])).chr(hexdec($msgCRC[2])).chr(hexdec($msgCRC[3]));
	//msg
	$saymsg .= chr(hexdec('ff')).chr(hexdec('01')).chr(hexdec(sprintf('%01b',$msgseq))).$text;
	$len = strlen($saymsg);

	$sent = socket_sendto($sock, $saymsg, $len, 0, $ip, $port);
	$msgseq++;
	if($sent == false)
	{
		die("failed to send msg ".socket_last_error()."\n");
	} else {
		echo $text."\n";
	}


	//socket_recvfrom($sock, $buf, 64, 0, $ip, $port);
        //var_dump($buf);
        
        socket_close($sock);
?>

 

 

 

sry vor my bad englich

Edited by eno
Link to comment
Share on other sites

4 answers to this question

Recommended Posts

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
  • Discord

×
×
  • Create New...