Пример #1
0
 /**
  * Join the specified shard
  */
 function joinSessionResult($userId, $sessionId, $result, $shardAddr, $participantStatus)
 {
     global $JoinSessionResultCode, $JoinSessionResultMsg;
     $JoinSessionResultCode = $result;
     $JoinSessionResultMsg = $shardAddr;
     if ($result != 0) {
         global $FSHostLuaMode, $FSHostResult, $FSHostResultStr;
         $FSHostResult = 0;
         $FSHostResultStr = "Error " . $result . " : '" . $shardAddr . "' while trying to join a shard";
         if ($FSHostLuaMode) {
             echo $FSHostResultStr;
             echo '<p><p><a href="web_start.php">Back to menu</a>';
         }
     } else {
         // ok, we have the info to connect !
         // generate the lua script
         $cookie = convertCookieForActionHandler($_COOKIE["ryzomId"]);
         global $FSHostLuaMode, $FSHostResult, $FSHostResultStr;
         $FSHostResult = 1;
         $FSHostResultStr = $shardAddr;
         if ($FSHostLuaMode) {
             $luaScript = 'runAH(nil, "on_connect_to_shard", "cookie=' . $cookie . '|fsAddr=' . $shardAddr . '")';
             //echo 'luaScript : '.$luaScript.'<br>';
             echo '<lua>' . $luaScript . '</lua>';
             global $verbose;
             if ($verbose) {
                 echo '<br>Teleporting to shard<br>';
             }
         }
     }
 }
Пример #2
0
 /**
  * Join the specified session
  */
 function joinSessionResult($userId, $sessionId, $result, $shardAddr, $participantStatus)
 {
     if ($result != 0) {
         echo "<h1>Error " . $result . " : '" . $shardAddr . "' while trying to join a session </h1>";
         echo '<p><p><a href="web_start.php">Back to menu</a>';
     } else {
         // ok, we have the info to connect !
         // generate the lua script
         $cookie = convertCookieForActionHandler($_COOKIE["ryzomId"]);
         $luaScript = 'runAH(nil, "on_connect_to_shard", "cookie=' . $cookie . '|fsAddr=' . $shardAddr . '")';
         //echo 'luaScrip : '.$luaScript.'<br>';
         echo '<lua>' . $luaScript . '</lua>';
         echo 'You are allowed in the session <br>';
     }
 }