Opět mobilniplatby automatické VIP

Technická podpora k herním serverům Minecraft a Tekkit
Message
Autor
partizan155
Příspěvky: 93
Registrován: 28 črc 2011, 09:43
Reputation: 0

Opět mobilniplatby automatické VIP

#1 Příspěvekod partizan155 » 27 led 2013, 21:24

IP serveru 93.91.240.148:27493

Dobrý den jelikož o tomto bylo již více tématů a vlastně se to nikde nedořešilo tak to sem dávám já znova...
Takže bych rád věděl co je tedy zde špatně nebo nějaké další pokyny pro zprovoznění automatického VIP z mobilnichplateb.cz ....

server properties
Spoiler: zobrazit

Kód: Vybrat vše

#Minecraft server properties
#Sun Jan 27 05:26:36 CET 2013
generator-settings=
allow-nether=true
level-name=world
enable-query=true
allow-flight=true
rcon.password=*****
server-port=25565
query.port=27493
level-type=DEFAULT
enable-rcon=true
level-seed=
server-ip=
max-build-height=256
spawn-npcs=true
white-list=false
debug=false
spawn-animals=true
texture-pack=
snooper-enabled=true
hardcore=false
online-mode=false
pvp=true
difficulty=1
enable-command-block=true
server-name=czechgamesservers.cz 1.4.7
gamemode=0
max-players=25
rcon.port=26493
spawn-monsters=true
generate-structures=true
view-distance=6
spawn-protection=0
motd=u00A7c czechgamesservers.cz 1.4.7




PHP KOD KTERÝ JSEM UPLOADOVAL NA ENDORU


Spoiler: zobrazit

Kód: Vybrat vše

<?php
$server = "93.91.240.148";
$port = "26493";
$heslo = "*****";

$credit = $_GET['price'];
$player = $_GET['text'];

if(empty($credit)) { die('Error'); }

$jenTak = explode(" ", $player);
$typ     = $jenTak[0];
$hrac    = $jenTak[1];
$switch   = "".$credit." ".$typ."";

$commands = array();
 
switch($switch) {

  //vip za 79kč //
  case "79.00 wvip": 
    $commands[] = "money give ".$player." 2000";
    $commands[] = "pex user ".$player." group add wvip world 1296000";
    $commands[] = "pex user ".$player." group add wvip world_nether 1296000";
    $commands[] = "pex user ".$player." group add wvip world_ender 1296000";
    $commands[] = "broadcast Hrac ".$player." si aktivoval WVIP! Aktivuj si ho take na www.woc-games.cz";
  break;
 
  //vip za 99kč //
  case "99.00 vip": 
    $commands[] = "money give ".$player." 2000";
    $commands[] = "pex user ".$player." group add vip world 2592000";
    $commands[] = "pex user ".$player." group add vip world_nether 2592000";
    $commands[] = "pex user ".$player." group add vip world_ender 2592000";
    $commands[] = "broadcast Hrac ".$player." si aktivoval VIP! + Ktomu dostal 2.000 dollaru jako bonus. Aktivuj si ho take na http://minecraft-x-game.4fan.cz";
  break;
 
  case "99.00 money": 
    $commands[] = "money give ".$player." 12000";
  break;
 
  case "79.00 money": 
    $commands[] = "money give ".$player." 6000";
  break;
 
  case "50.00 money": 
    $commands[] = "money give ".$player." 3500";
  break;
 
  case "30.00 money": 
    $commands[] = "money give ".$player." 1500";
  break;
 
}



include_once("rcon.php");
$r = new rcon($server,$port,$heslo);
if($r->Auth())
{
   foreach($commands as $command) 
    $r->rconCommand($command);           
}

?>


Nahrál jsem tam i nějakej RCON.PHP (ale nic jsem tam neměnil..)



Spoiler: zobrazit

Kód: Vybrat vše

<?php
/*
RCON remote console class, modified for minecraft compability by Tehbeard.

!!!YOU MUST CONFIGURE RCON ON YOUR MINECRAFT SERVER FOR THIS TO WORK
AT TIME OF WRITING ONLY 1.9pr4+ HAVE BUILTIN RCON SUPPORT!!!

Example Code:
============
include_once("rcon.class.php"); //Include this file
$r = new rcon("127.0.0.1",25575,"foobar"); //create rcon object for server on the rcon port with a specific password
if($r->Auth()){ //Connect and attempt to authenticate
{
  $r->rconCommand("say Saving in 10 seconds!"); //send a command
  sleep(10);
  $r->rconCommand("save-all"); //send a command
  $r->rconCommand("say Save complete!");//send a command
  echo $r->rconCommand("list");//send a command, echo returned value
}
============



Based upon the following work:
[<<<
   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 = 27015;
   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();
      //var_dump($ret);
      if ($ret[0]['ID'] == -1) {
         return false;
      }
      return true;
   }

   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)).'"';
      //$Command="stop";
      $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[$this->_Id]['S1'];
   }
}
?>


Na mobilních platbách jdu do emulátoru tam vše nastavím a jak psali ostatní ukáže se že se to provedlo správně dle specifikací ale ve hře mi to to VIP nedá....

Uživatelský avatar
Shadowhacker
Příspěvky: 640
Věk: 30
Registrován: 23 led 2012, 18:31
Reputation: 0
Bydliště: Plzeň

Re: Opět mobilniplatby automatické VIP

#2 Příspěvekod Shadowhacker » 28 led 2013, 05:18

http://forum.fakaheda.eu/viewtopic.php?f=85&t=7250
A to ti má dát VIP i když pošleš test SMS? Ukáže se v mobilniplatby.cz, že se to uspěšně odeslalo? a co na serveru, vše v poho?
Obrázek

partizan155
Příspěvky: 93
Registrován: 28 črc 2011, 09:43
Reputation: 0

Re: Opět mobilniplatby automatické VIP

#3 Příspěvekod partizan155 » 28 led 2013, 22:58

tak tedy script jsem předělal takto tedy dle tebe...
Port jsem raději předělal jak tady tak v serverproperties...

odzkoušeno na norm smsce..... a nic se ve hře neukázalo žádnej příkaz se nevykonal když jsem přes spšel url kterou mi vygenerovaala služba mobilniplatby šel na ten PHP script tak se tam objevilo že se sms zpracovava a když jsem tam šel normálně na ten script tak bylo sms se zpracovava ERROR což je pochopytelné když se tam nezadala cena... ale zkusil jsem to teda i přes svůj mobil a bez výsledku

Spoiler: zobrazit

Kód: Vybrat vše

Vaše sms byla zpracována
<?php
///////////////
// NASTAVENÍ //
///////////////
$server = "93.91.240.148";
$port = "25493";
$pw = "****";
//////////////////////////////
// VYTAŽENÍ INFORMACÍ Z SMS //
//////////////////////////////
$price = $_GET['price'];
$player = $_GET['text'];

if(empty($price)) { die('Error'); }

$commands = array();
//////////////////////////////
// JEDNOTLIVÉ CENOVÉ HLADINY//
//////////////////////////////
switch($price) {

  case 99.000: 
    $commands[] = "money give".$player." 1500"; //přičte hráči 1500 money, můžete dát jakýkoli libovolný příkaz cena 99kč
  break;
 
  case 79.000: 
    $commands[] = "money give ".$player." 1100"; //79kč cena
  break;
 
  case 50.000: 
    $commands[] = "money give ".$player." 700"; //50kč cena
  break;
 
  case 30.000: 
    $commands[] = "money give ".$player." 300"; //30kč cena
  break;
 
  case 20.000: 
    $commands[] = "money give ".$player." 200"; //20kč cena
  break;
 
  case 10.000: 
    $commands[] = "money give ".$player." 1000"; //10kč cena
   $commands[] = "broadcast Hrac ".$player." si aktivoval 1.000 dollaru!";
  break;
 
  case 0.500: 
    $commands[] = "money give ".$player." 150"; //sms za 0,5 €
  break;
 
  case 1.000: 
    $commands[] = "money give ".$player." 300"; //sms za 1 €
  break;
 
  case 1.205: 
    $commands[] = "money give ".$player." 400"; //sms za 1.205 €
  break;
 
  case 1.607: 
    $commands[] = "money give ".$player." 500"; //sms za 1,607 €
  break;     
 
}

include_once("rcon.php");
$r = new rcon($server,$port,$pw);
if($r->Auth())
{
   foreach($commands as $command) 
    $r->rconCommand($command);           
}

?>

Uživatelský avatar
Shadowhacker
Příspěvky: 640
Věk: 30
Registrován: 23 led 2012, 18:31
Reputation: 0
Bydliště: Plzeň

Re: Opět mobilniplatby automatické VIP

#4 Příspěvekod Shadowhacker » 30 led 2013, 23:54

To je divný, doufám, že máš zapnutý (prozatím) alespoň od FH to klasické.
Od MP je to fajn, sic omezené na SK až později,ale..
No - Já ti teď odpovídám ze slušnosti, jelikož nemam teď čas se na to mrknout, aby sis nemyslel, že jsem se na tebe úplně..
Pokud se zde nikdo neobjeví, třeba ti pomůžu. Možná zítra tu budu na chvíli. Zkus to pořešit, třeba jen něco přehlížíš.. :-) A zkus i Google

Editováno:Endoru mám též, ale nevím, jestli podporuje posílání PHP scriptů, teď si nejsem jist a nerad bych kecal.. Jelikož máš ty věci jinde, než na serveru, (železu, kde je CB) tak jestli to neblbne.. Pak se mrknu na ten kod a tak :)
Obrázek

partizan155
Příspěvky: 93
Registrován: 28 črc 2011, 09:43
Reputation: 0

Re: Opět mobilniplatby automatické VIP

#5 Příspěvekod partizan155 » 31 led 2013, 16:47

Script jsem zkusil uploadovat na webzdarma.cz abych zkusil jakou to bude mít odezvu tam a stejný script mi zde napsal

Kód: Vybrat vše

Unable to open socket: ()



Takže bych řekl že endora to podporuje ale webzdarma ne....

Jinak mobilniplatby.cz tam mám už ji schválené SK platby....

Zkusím něco pohledat na google uvidím jestli něco najdu no


Zpět na „Minecraft, Tekkit“

Kdo je online

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