undef HALF_FREQUENCY_SENDING_TO_CLIENT
[ryzomcore.git] / web / public_php / ring / close_session.php
blob0f70d4bbde09169c23e54cde5b1534031a265f75
1 <?php
2 require_once('../tools/validate_cookie.php');
3 include_once('../login/config.php');
4 include_once('../tools/domain_info.php');
5 include_once('ring_session_manager_itf.php');
7 class CloseSessionCb extends CRingSessionManagerWeb
9 function invokeResult($userId, $resultCode, $resultString)
11 global $step, $rsmProxy, $rsmSkel, $userId, $callbackClient;
13 if ($resultCode != 0)
15 echo "<h1>Error ".$resultCode." : '".$resultString."' will trying to close the session ".$_POST["sessionId"]."</h1>";
16 echo '<p><p><a href="web_start.php">Back to menu</a>';
18 else
20 // ok, the session is closed (or almost to close)
21 echo "<h1>Session ".$_POST["sessionId"]." is begin closed</h1>";
22 echo '<p><a href="web_start.php">Return to main</a> </p>';
27 $domainId = -1;
28 if (!validateCookie($userId, $domainId, $charId))
30 echo "Invalid cookie !";
31 die();
33 else
35 $domainInfo = getDomainInfo($domainId);
36 $addr = split(":", $domainInfo["session_manager_address"]);
37 $RSMHost = $addr[0];
38 $RSMPort = $addr[1];
40 // ask to start the session
41 $closeSession = new CloseSessionCb;
42 $res = "";
43 $closeSession->connect($RSMHost, $RSMPort, $res);
44 // $rsmProxy = new CRingSessionManagerWebProxy;
45 $closeSession->closeSession($charId, $_POST["sessionId"]);
47 // wait the the return message
48 // $rsmSkel = new CRingSessionManagerWebSkel;
49 $closeSession->waitCallback();
51 die();
55 <p><a href="web_start.php">Return to main</a> </p>