uvolnenie portu

Dotazy k ostatním službám poskytovaným k herním serverům zdarma jako je např. Psychostats nebo amxbans
Message
Autor
eidosik
Příspěvky: 15
Registrován: 04 zář 2012, 11:29
Reputation: 0

uvolnenie portu

#1 Příspěvekod eidosik » 04 zář 2012, 21:23

Server: IP:93.91.250.112:27517
ver. 1.3.2

Zdravim, mam problem... Riesil som to aj v sekcii minecraft ale ziadna odpoved :( a pisem to tu lebo mam pocit ze je to potrebne odomknut zo strany fakahedy (otvorit port). Pokusil som sa nainstalovat pluginy PHPsend a Websend (samozrejme zlvast, pretoze ani jeden ani druhy nefungoval) ... PHPscript na stranke sa nechce spojit so serverom. Skusal som uz XYZ portov... ako napr: 25517,26517(rcon),28517,29517,29000,30000, a co ja viem este ake..asi vsetky...

PHPsend v logfile:
Spoiler: zobrazit
...
2012-09-04 01:37:05 [INFO] [AutoMessage] AutoMessage Enabled!
2012-09-04 01:37:05 [INFO] [PHPsend] Enabling PHPsend v0.9
2012-09-04 01:37:05 [INFO] [PHPsend] Config loaded.
2012-09-04 01:37:05 [INFO] [PHPsend] PHPsend started main thread.
2012-09-04 01:37:05 [INFO] [PHPsend] Started hosting.
2012-09-04 01:37:05 [INFO] [iConomy] Enabling iConomy v7.0
...


PHPsend config.yml:
Spoiler: zobrazit
password: *****
postPassword: *****
port: 29517 (aktualny, skusal som aj ine)
postDataUrl: http://www.*****.sk/web/


index.php na webe:
Spoiler: zobrazit
<?php

include_once("PHPsend.php");

$con = new PHPsend();
$succ = $con->PHPconnect("93.91.250.112","*****","29517");

$con->PHPcommand("say Hallo ...");
$con->PHPcommand("say Server sets time to Day!");
$con->PHPcommand("time day");


$succ = $con->PHPdisconnect();

?>


PHPsend.php na webe:
Spoiler: zobrazit
<?php

error_reporting(0);

class PHPresponse
{
var $msg;
var $from;

function isFrom($who)
{
if ($who==$from)
return true;
else
return false;
}
}

function recv($socket)
{
$r=socket_read($socket, 256, PHP_NORMAL_READ);
return substr($r,0,-1);
}

class PHPsend
{
var $socket=null;

function PHPconnect($adress, $password, $port=29517)
{
$this->socket = socket_create(AF_INET, SOCK_STREAM, 0);

socket_set_block($this->socket);

$result = socket_connect($this->socket, $adress, $port);

if ($this->socket==null)
return 1;

socket_write($this->socket, md5($password)."\n", strlen(md5($password))+2); //auth
$result=recv($this->socket);

/*echo 'RESULT: '.$result."\n";
echo md5($result)."\n";*/

if ($result!="PHPpass0")
return 2;
else
return 0;
}

function PHPcommand($command)
{
socket_write($this->socket, $command."\n",strlen($command)+2);
$result=recv($this->socket);

if ($result!="PHPcmd0")
return 1;
return 0;
}

function PHPdisconnect()
{
socket_write($this->socket, "PHPdisconnect\n",15);
$result=recv($this->socket);

if ($result!="PHPdisconnect0")
return 1;
return 0;
}

function PHPrecv()
{
$result=recv($this->socket);
$resp=explode(':',$result,2);
$r=new PHPresponse();
$r->from=$resp[0];
$r->msg=$resp[1];
return $r;
}

function PHPrecvMsg()
{
$result=recv($this->socket);
$resp=explode(':',$result,2);
return $resp[1];
}
}

?>


Samozrejme index a phpsend php su v rovnakom adresary na webe...

To iste je aj s Websend, vsetko nastavene podla googlu,bukkitu, a videi, no marne, absolutne...pri websende vypisovalo nieco ako chyba pri otvarani socketu... Dokonca mi ani ta aktivacia sms nefnguje co je tu navod na fore... Neviete mi prosim poradit pripadne odblokvoat (fowardovanie) nejaky port, resp nejak ho odomknut, pretoze uz som skuil websend,phpsend,mcmyadmin,socketcraft, vsetky dost podrobne nastudovane na bukkite nastavene naladene, skusal som rozne varianty portov nechapem uz co mam robit....

pls help, samozrejme +karma, dakujem
Obrázek

Uživatelský avatar
MiniMe
Site Admin
Příspěvky: 2188
Věk: 37
Registrován: 08 pro 2009, 19:31
Reputation: 10
Kontaktovat uživatele:

Re: uvolnenie portu

#2 Příspěvekod MiniMe » 05 zář 2012, 11:53

1. Proč nepoužiješ vestavěný rcon protokol?
2. Ten plugin na serveru nevidím.
FakaHeda admin
Nezapomeňte ohodnotit karmou ty, kteří Vám pomohli.

eidosik
Příspěvky: 15
Registrován: 04 zář 2012, 11:29
Reputation: 0

Re: uvolnenie portu

#3 Příspěvekod eidosik » 05 zář 2012, 13:02

Skusal som aj cez RCON ten na platbamobilem ci co to je... a pouzil som ten rcon.php resp komplet script na stiahnutie + podla navodu na FH len som zmenil prikaz z PEX co tam bol na napr SAY .... hesla vsetko nastavene aj porty podla server.config .... a NIC ... samozrejme som troska upravil pretoze bol nastaveny na citanize n url adresy z platbamobilem ci co... kedze programujem PHP tak som si to troska upravil ale komunikaciu PHP cez RCON som nemenil...

Tamtie pluginy som uz pomazal... aj tak nic... nechapem ale keby len jeden plugin ale 5 pluginov mi nefungovalo.. :)
Obrázek

eidosik
Příspěvky: 15
Registrován: 04 zář 2012, 11:29
Reputation: 0

Re: uvolnenie portu

#4 Příspěvekod eidosik » 05 zář 2012, 15:44

Skusil som uz dalsi system na RCON:
ale uz na dalsom servery pre istotu: 93.91.250.106:37495

rcon.class.php na webe:
Spoiler: zobrazit
<?php
/*
Basic CS:S Rcon class by Freman. (V1.00)
----------------------------------------------
Ok, it's a completely working class now with with multi-packet responses

Contact: printf("%s%s%s%s%s%s%s%s%s%d%s%s%s","rc","on",chr(46),"cl","ass",chr(64),"pri","ya",chr(46),2,"y",chr(46),"net")

Behaviour I've noticed:
rcon is not returning the packet id.
*/

define("SERVERDATA_EXECCOMMAND",2);
define("SERVERDATA_AUTH",3);

class RCon {
var $Password;
var $Host;
var $Port = 37505;
var $_Sock = null;
var $_Id = 0;

function RCon ($Host,$Port,$Password) {
$this->Password = $Password;
$this->Host = $Host;
$this->Port = $Port;
$this->_Sock = @fsockopen($this->Host,$this->Port, $errno, $errstr, 30) or
die("Unable to open socket: $errstr ($errno)\n");
$this->_Set_Timeout($this->_Sock,2,500);
}

function Auth () {
$PackID = $this->_Write(SERVERDATA_AUTH,$this->Password);

// Real response (id: -1 = failure)
$ret = $this->_PacketRead();
if ($ret[1]['id'] == -1) {
die("Authentication Failure\n");
}
}

function _Set_Timeout(&$res,$s,$m=0) {
if (version_compare(phpversion(),'4.3.0','<')) {
return socket_set_timeout($res,$s,$m);
}
return stream_set_timeout($res,$s,$m);
}

function _Write($cmd, $s1='', $s2='') {
// Get and increment the packet id
$id = ++$this->_Id;

// Put our packet together
$data = pack("VV",$id,$cmd).$s1.chr(0).$s2.chr(0);

// Prefix the packet size
$data = pack("V",strlen($data)).$data;

// Send packet
fwrite($this->_Sock,$data,strlen($data));

// In case we want it later we'll return the packet id
return $id;
}

function _PacketRead() {
//Declare the return array
$retarray = array();
//Fetch the packet size
while ($size = @fread($this->_Sock,4)) {
$size = unpack('V1Size',$size);
//Work around valve breaking the protocol
if ($size["Size"] > 4096) {
//pad with 8 nulls
$packet = "\x00\x00\x00\x00\x00\x00\x00\x00".fread($this->_Sock,4096);
} else {
//Read the packet back
$packet = fread($this->_Sock,$size["Size"]);
}
array_push($retarray,unpack("V1ID/V1Response/a*S1/a*S2",$packet));
}
return $retarray;
}

function Read() {
$Packets = $this->_PacketRead();

foreach($Packets as $pack) {
if (isset($ret[$pack['ID']])) {
$ret[$pack['ID']]['S1'] .= $pack['S1'];
$ret[$pack['ID']]['S2'] .= $pack['S1'];
} else {
$ret[$pack['ID']] = array(
'Response' => $pack['Response'],
'S1' => $pack['S1'],
'S2' => $pack['S2'],
);
}
}
return $ret;
}

function sendCommand($Command) {
$Command = '"'.trim(str_replace(' ','" "', $Command)).'"';
$this->_Write(SERVERDATA_EXECCOMMAND,$Command,'');
}

function rconCommand($Command) {
$this->sendcommand($Command);

$ret = $this->Read();

//ATM: Source servers don't return the request id, but if they fix this the code below should read as
// return $ret[$this->_Id]['S1'];
return $ret[0]['S1'];
}
}
?>


index.php na webe:
Spoiler: zobrazit
<?php

include_once("rcon.class.php");

$r = new rcon("93.91.250.106",37505,"******");
$r->Auth();

echo "Authenticated\n";

//Send a request
var_dump($r->rconCommand("say hallo"));


?>


port je samozrejme z rcon.port z server.properties:
Spoiler: zobrazit
#Minecraft server properties
#Wed Sep 05 06:32:19 CEST 2012
allow-nether=false
level-name=palaven
enable-query=true
allow-flight=false
rcon.password=*****
server-port=37495
query.port=37495
level-type=DEFAULT
enable-rcon=true
hellworld=false
level-seed=1672184498917379323
port=37495
server-ip=93.91.250.106
max-build-height=256
spawn-npcs=true
allow-end=false
debug=false
white-list=false
spawn-animals=true
texture-pack=
snooper-enabled=true
hardcore=false
online-mode=false
server-id=unnamed
pvp=true
difficulty=1
server-name=^ \![CZ&SK]Www.Relicted-X.Com Craft[ECONOMY] 1.3.2\! ^
gamemode=0
max-players=25
rcon.port=37505
spawn-monsters=true
generate-structures=true
view-distance=7
motd=RELICTED-X ECONOMY [1.3.2]


Nechapem a to skusam uz na druhom servery pre istotu...
Obrázek

Uživatelský avatar
MiniMe
Site Admin
Příspěvky: 2188
Věk: 37
Registrován: 08 pro 2009, 19:31
Reputation: 10
Kontaktovat uživatele:

Re: uvolnenie portu

#5 Příspěvekod MiniMe » 12 zář 2012, 23:13

Jsme na téma pozapomněl. Přes ten rcon to jede ne?
FakaHeda admin
Nezapomeňte ohodnotit karmou ty, kteří Vám pomohli.

eidosik
Příspěvky: 15
Registrován: 04 zář 2012, 11:29
Reputation: 0

Re: uvolnenie portu

#6 Příspěvekod eidosik » 13 zář 2012, 09:14

Uz to ide, vsetko v poriadku... chyba bol v hostingu, nechapem preco na platenom hostingu to nejde ale na free endore to uz ide... nechapem :) no kazdopadne ten script funguje na endore takze je dobre si vyskusat hosting pred jeho zakupenim :) :)

Dakujem
Obrázek


Zpět na „Ostatní služby k herním serverům“

Kdo je online

Uživatelé prohlížející si toto fórum: Žádní registrovaní uživatelé a 6 hostů