undef HALF_FREQUENCY_SENDING_TO_CLIENT
[ryzomcore.git] / web / public_php / ring / cancel_session.php
blobe0552b5e0d0f6c3e4d2339b0e244e332fe3f75f2
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');
8 class CancelSessionCb extends CRingSessionManagerWeb
10 function invokeResult($userId, $resultCode, $resultString)
12 global $step, $rsmProxy, $rsmSkel, $userId, $callbackClient;
14 if ($resultCode != 0)
16 echo "<h1>Error ".$resultCode." : '".$resultString."' will trying to cancel the session ".$_POST["sessionId"]."</h1>";
17 echo '<p><p><a href="web_start.php">Back to menu</a>';
19 else
21 // ok, the session is closed (or almost to close)
22 echo "<h1>Session ".$_POST["sessionId"]." has been cancelled</h1>";
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 $cancelSessionCb = new CancelSessionCb;
42 $res = "";
43 $cancelSessionCb->connect($RSMHost, $RSMPort, $res);
44 $cancelSessionCb->cancelSession($charId, $_POST["sessionId"]);
46 // wait the the return message
47 $cancelSessionCb->waitCallback();
50 <p><a href="web_start.php">Return to main</a> </p>