Guild id: ([[:digit:]]+)\:([[:digit:]]+) \(([^\ ]+)\), name: \'([A-Za-z0-9\ _-]+)\', eid: (\(0x[[:alnum:]]+\:[[:alnum:]]+\:[[:alnum:]]+\:[[:alnum:]]+\))/',$rline,$params))
+ {
+ $guild_name = $params[4];
+ $result[$server] = array();
+ $result[$server]['dump'] = $params;
+ }
+ // Description: 'French CSR'
+ elseif (preg_match('/^[[:space:]]*Description: \'(.*)\'/',$rline,$params))
+ {
+ if ($server != '')
+ {
+ $result[$server]['desc'] = $params[1];
+ }
+ }
+ // Icon: 0x0000000000000681
+ elseif (preg_match('/^[[:space:]]*Icon: (0x[[:alnum:]]+)/',$rline,$params))
+ {
+ if ($server != '')
+ {
+ $result[$server]['icon'] = hexdec($params[1]);
+ }
+ }
+ // Money: 65500000
+ elseif (preg_match('/^[[:space:]]*Money: ([[:alnum:]]+)/',$rline,$params))
+ {
+ if ($server != '')
+ {
+ $result[$server]['money'] = $params[1];
+ }
+ }
+ // Race: Fyros
+ elseif (preg_match('/^[[:space:]]*Race: (.*)/',$rline,$params))
+ {
+ if ($server != '')
+ {
+ $result[$server]['race'] = $params[1];
+ }
+ }
+ // Building: building_instance_FY_guild_327
+ elseif (preg_match('/^[[:space:]]*Building: (.*)/',$rline,$params))
+ {
+ if ($server != '')
+ {
+ $result[$server]['building'] = $params[1];
+ }
+ }
+ // Civ Allegiance: Fyros
+ elseif (preg_match('/^[[:space:]]*Civ Allegiance: (.*)/',$rline,$params))
+ {
+ if ($server != '')
+ {
+ $result[$server]['civ'] = $params[1];
+ }
+ }
+ // Cult Allegiance: Kami
+ elseif (preg_match('/^[[:space:]]*Cult Allegiance: (.*)/',$rline,$params))
+ {
+ if ($server != '')
+ {
+ $result[$server]['cult'] = $params[1];
+ }
+ }
+ // Nb of members: 27
+ elseif (preg_match('/^[[:space:]]*Nb of members: ([[:digit:]]+)/',$rline,$params))
+ {
+ if ($server != '')
+ {
+ $result[$server]['count'] = $params[1];
+ }
+ }
+ // Member 'Yotto' (0x00000096f0:00:00:86), index: 2, grade: HighOfficer, enter time: 60960905
+ elseif (preg_match('/^[[:space:]]*Member \'([^\ ]+)\' (\(0x[[:alnum:]]+\:[[:alnum:]]+\:[[:alnum:]]+\:[[:alnum:]]+\)), index: ([[:digit:]]+), grade: ([[:alnum:]]+), enter time: ([[:digit:]]+)/',$rline,$params))
+ {
+ if ($server != '')
+ {
+ $result[$server][$params[4]][] = $params[1];
+ }
+ }
+ }
+ }
+ return $result;
+ }
+
+ function querySelectedShard($name, $service_name, $fullcmd, $cmd='', $waitCallback=true, $is_control=false) {
+ global $command_return_data;
+
+ $nel_result = array();
+ $nel_status = !$waitCallback;
+
+ $p_result = null;
+
+ $adminService = new MyAdminService;
+
+ if ($adminService->connect($name, '46700', $res) !== false) {
+ $command_return_data = '';
+
+ //echo "NEL[$service_name] : $service_command\n";
+ if (is_array($fullcmd)) {
+ foreach ($fullcmd as $service_command) {
+ if ($is_control)
+ $adminService->controlCmd($service_name, $service_command);
+ else
+ $adminService->serviceCmd($service_name, $service_command);
+ }
+ } else {
+ if ($is_control)
+ $adminService->controlCmd($service_name, $fullcmd);
+ else
+ $adminService->serviceCmd($service_name, $fullcmd);
+ $service_command = $fullcmd;
+ //echo "NEL[$service_name] : OK\n";
+ if ($waitCallback && $adminService->waitCallback()) {
+ //echo "NEL[$service_name] : Successful!\n";
+
+ $nel_status = true;
+ $nel_result[] = $command_return_data;
+ //print_r($command_return_data);
+ } else {
+ //echo "NEL[$service_name] : Failed!\n";
+ }
+ }
+
+ @$adminService->close();
+ }
+
+ if ($nel_status) {
+ if (strlen($cmd) > 0) {
+ $func_name = 'parse'.ucfirst($cmd);
+ if (function_exists($func_name))
+ $p_result = call_user_func($func_name,$nel_result);
+ }
+ }
+
+ return array('status' => $nel_status, 'query' => $service_name.':'.$service_command, 'raw' => $nel_result, 'parsed' => $p_result);
+ }
+
+ function queryShard($service_name, $fullcmd, $cmd='', $waitCallback=true, $is_control=false)
+ {
+ return querySelectedShard('localhost', $service_name, $fullcmd, $cmd, $waitCallback, $is_control);
+ }
+
diff --git a/ryzom/server/www/libs/nel_message.php b/ryzom/server/www/libs/nel_message.php
new file mode 100644
index 000000000..b2dc74484
--- /dev/null
+++ b/ryzom/server/www/libs/nel_message.php
@@ -0,0 +1,296 @@
+InputStream = false;
+ $this->Pos = 0;
+ $this->Buffer = "";
+ debug("A : ".gettype($this->Buffer)."
");
+ }
+
+ function setBuffer ($Buffer)
+ {
+ $this->InputStream = true;
+ $this->Buffer = $Buffer;
+ $this->Pos = 0;
+ }
+
+ function isReading () { return $this->InputStream; }
+
+ function serialUInt8 (&$val)
+ {
+ if ($this->isReading())
+ {
+ $val = ord($this->Buffer{$this->Pos++});
+ debug(sprintf ("read uint8 '%d'
\n", $val));
+ }
+ else
+ {
+ debug("B".gettype($this->Buffer)."
");
+ debug(sprintf ("write uint8 Buffer size before = %u
\n", strlen($this->Buffer)));
+ $this->Buffer = $this->Buffer . chr($val & 0xFF);
+ $this->Pos++;
+ debug("C".gettype($this->Buffer)."
");
+ debug(sprintf ("write uint8 '%d' %d
\n", $val, $this->Pos));
+ debug(sprintf ("write uint8 Buffer size after = %u
\n", strlen($this->Buffer)));
+ }
+ }
+
+ function serialUInt32 (&$val)
+ {
+ if ($this->isReading())
+ {
+ $val = ord($this->Buffer{$this->Pos++});
+ $val += ord($this->Buffer{$this->Pos++})*256;
+ $val += ord($this->Buffer{$this->Pos++})*(double)256*256;
+ $val += ord($this->Buffer{$this->Pos++})*(double)256*256*256;
+ debug(sprintf ("read uint32 '%d'
\n", $val));
+// var_dump($val);
+ }
+ else
+ {
+ debug("D".gettype($this->Buffer)."
");
+ $this->Buffer .= chr($val & 0xFF);
+ $this->Buffer .= chr(($val>>8) & 0xFF);
+ $this->Buffer .= chr(($val>>16) & 0xFF);
+ $this->Buffer .= chr(($val>>24) & 0xFF);
+ $this->Pos += 4;
+ debug("E".gettype($this->Buffer)."
");
+ debug(sprintf ("write uint32 '%d' %d
\n", $val, $this->Pos));
+ }
+ }
+
+ function serialString (&$val)
+ {
+ if ($this->isReading())
+ {
+ $this->serialUInt32($size);
+ debug(sprintf ("read string : size = %u
\n", $size));
+ $val = substr ($this->Buffer, $this->Pos, $size);
+ debug(sprintf ("read string '%s'
\n", $val));
+ $this->Pos += strlen($val);
+ }
+ else
+ {
+ $valLen = strlen($val);
+ $this->serialUInt32($valLen);
+ $this->Buffer .= $val;
+ $this->Pos += $valLen;
+ debug(sprintf ("write string '%s' %d
\n", $val, $this->Pos));
+ }
+ }
+ function serialEnum (&$val)
+ {
+ if ($this->isReading())
+ {
+ $intValue = 0;
+ $this->serialUInt32($intValue);
+ $val->fromInt((int)$intValue);
+ debug(sprintf ("read enum '%s'
\n", $val->toString()));
+ }
+ else
+ {
+ $intValue = $val->toInt();
+ $this->serialUInt32($intValue);
+ debug(sprintf ("write enum '%s' %d
\n", $val->toString(), $this->Pos));
+ }
+ }
+ }
+
+ class CMessage extends CMemStream
+ {
+ var $MsgName;
+
+ function CMessage()
+ {
+ $this->CMemStream();
+ }
+
+ function setName($name)
+ {
+ $this->MsgName = $name;
+ }
+ }
+
+ class CCallbackClient
+ {
+ var $ConSock = false;
+
+ var $MsgNum = 0;
+
+ function connect($addr, $port, &$res)
+ {
+ global $SockTimeOut;
+
+ debug(sprintf("Connect
"));
+ $this->MsgNum = 0;
+
+ $this->ConSock = fsockopen ($addr, $port, $errno, $errstr, $SockTimeOut);
+ debug("H".gettype($this->ConSock)."
");
+
+ if (!$this->ConSock)
+ {
+ $res = "Can't connect to the callback server '$addr:$port' ($errno: $errstr)";
+
+ return false;
+ }
+ else
+ {
+ // set time out on the socket to 2 secondes
+ stream_set_timeout($this->ConSock, $SockTimeOut);
+ $res = "";
+ return true;
+ }
+ }
+
+ function close()
+ {
+ if ($this->ConSock)
+ {
+ fclose($this->ConSock);
+ debug(sprintf("Close
"));
+ }
+ else
+ debug(sprintf("Already Closed !
"));
+ }
+
+ function sendMessage(&$message)
+ {
+ if (!$this->ConSock)
+ {
+ debug(sprintf ("Socket is not valid\n"));
+ return false;
+ }
+ debug(sprintf ("sendMessage : message Buffer is '%d'
\n", $message->Pos));
+ debug(sprintf ("sendMessage : message Buffer is '%d'
\n", strlen($message->Buffer)));
+ $hd = new CMemStream;
+ debug(sprintf("SendMessage number %u
", $this->MsgNum));
+ $hd->serialUInt32 ($this->MsgNum); // number the packet
+ $this->MsgNum += 1;
+ debug(sprintf("After SendMessage, number %u
", $this->MsgNum));
+ $messageType = 0;
+ $hd->serialUInt8 ($messageType);
+ $hd->serialString ($message->MsgName);
+
+ debug(sprintf ("sendMessage : header size is '%d'
\n", $hd->Pos));
+
+// $sb .= $message->Buffer;
+
+ $size = $hd->Pos + $message->Pos;
+ $Buffer = (string) chr(($size>>24)&0xFF);
+ $Buffer .= chr(($size>>16)&0xFF);
+ $Buffer .= chr(($size>>8)&0xFF);
+ $Buffer .= chr($size&0xFF);
+ debug( "E".gettype($hd->Buffer)."
");
+ debug("F".gettype($message->Buffer)."
");
+ $Buffer .= (string) $hd->Buffer;
+ $Buffer .= (string) $message->Buffer;
+
+ debug("G".gettype($this->ConSock)."
");
+
+ if (!fwrite ($this->ConSock, $Buffer))
+ {
+ debug(sprintf ("Error writing to socket\n"));
+ return false;
+ }
+ debug(sprintf ("sent packet size '%d' (written size = %d)
\n", strlen($Buffer), $size));
+ fflush ($this->ConSock);
+
+ return true;
+ }
+
+ function waitMessage()
+ {
+ if (!$this->ConSock)
+ {
+ debug(sprintf ("Socket is not valid\n"));
+ return false;
+ }
+
+
+ $size = 0;
+ $val = fread ($this->ConSock, 1);
+ $info = stream_get_meta_data($this->ConSock);
+ if ($info['timed_out'])
+ {
+ debug('Connection timed out!');
+ return false;
+ }
+ $size = ord($val) << 24;
+ $val = fread ($this->ConSock, 1);
+ $info = stream_get_meta_data($this->ConSock);
+ if ($info['timed_out'])
+ {
+ debug('Connection timed out!');
+ return false;
+ }
+ $size = ord($val) << 16;
+ $val = fread ($this->ConSock, 1);
+ $info = stream_get_meta_data($this->ConSock);
+ if ($info['timed_out'])
+ {
+ debug('Connection timed out!');
+ return false;
+ }
+ $size += ord($val) << 8;
+ $val = fread ($this->ConSock, 1);
+ $info = stream_get_meta_data($this->ConSock);
+ if ($info['timed_out'])
+ {
+ debug('Connection timed out!');
+ return false;
+ }
+ $size += ord($val);
+ debug(sprintf ("receive packet size '%d'
\n", $size));
+ $fake = fread ($this->ConSock, 5);
+ $info = stream_get_meta_data($this->ConSock);
+ if ($info['timed_out'])
+ {
+ debug('Connection timed out!');
+ return false;
+ }
+ $size -= 5; // remove the fake
+
+ $Buffer = "";
+ while ($size > 0 && strlen($Buffer) != $size)
+ {
+ $Buffer .= fread ($this->ConSock, $size - strlen($Buffer));
+ $info = stream_get_meta_data($this->ConSock);
+ if ($info['timed_out'])
+ {
+ debug('Connection timed out!');
+ return false;
+ }
+ }
+ $msgin = new CMemStream;
+ $msgin->setBuffer ($Buffer);
+
+ // decode msg name
+ $msgin->serialString($name);
+
+ debug(sprintf("Message name = '%s'
", $name));
+ $message = new CMessage;
+ $message->setBuffer(substr($msgin->Buffer, $msgin->Pos));
+ $message->setName($name);
+
+ debug(sprintf("In message name = '%s'
", $message->MsgName));
+
+ return $message;
+ }
+ }
+
+?>
diff --git a/ryzom/server/www/login/libs/domain_info.php b/ryzom/server/www/login/libs/domain_info.php
new file mode 100644
index 000000000..816958bd2
--- /dev/null
+++ b/ryzom/server/www/login/libs/domain_info.php
@@ -0,0 +1,25 @@
+
diff --git a/ryzom/server/www/login/libs/join_shard.php b/ryzom/server/www/login/libs/join_shard.php
new file mode 100644
index 000000000..e97ccdd6f
--- /dev/null
+++ b/ryzom/server/www/login/libs/join_shard.php
@@ -0,0 +1,249 @@
+Back to menu';
+ }
+ }
+ 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.'
';
+ echo ''.$luaScript.'';
+ global $verbose;
+ if ($verbose)
+ echo '
Teleporting to shard
';
+ }
+ }
+ }
+
+ /**
+ * Receive the result of the shard list, then call the global $getShardListCallback with the associative array as argument
+ */
+ function getShardsResult($userId, $resultStr)
+ {
+ global $getShardListCallback;
+
+ $onlineShardsBySessionId = array();
+ $resultArray = split(';', $resultStr);
+ foreach ($resultArray as $shardInfo)
+ {
+ $shardAttr = split(',', $shardInfo);
+ if (isset($shardAttr[1]))
+ $onlineShardsBySessionId[$shardAttr[0]] = $shardAttr[1];
+ }
+ $getShardListCallback($onlineShardsBySessionId);
+ }
+}
+
+// External use
+$FSHostLuaMode = false;
+$FSHostResultStr = 0;
+
+// Internal use
+$verbose = true;
+$FSHostResult = 0;
+
+// THE ABOVE DECLARATIONS ARE NEEDED FOR ALL CODE BELOW THIS LINE
+if (isset($_POST["ml"]))
+ joinMainlandPost();
+if (isset($_POST["destSessionId"]))
+ joinShardFromIdPost($_POST["destSessionId"]);
+
+/**
+ * Authenticate and request to join a mainland shard
+ */
+function joinMainlandPost()
+{
+ global $FSHostLuaMode;
+ $FSHostLuaMode = true;
+ $domainId = -1;
+ if (!validateCookie($userId, $domainId, $charId))
+ {
+ echo "Invalid cookie !";
+ die();
+ }
+ else
+ {
+ joinMainland($userId, $domainId);
+ }
+}
+
+/**
+ * Authenticate and request to join the specified shard
+ */
+function joinShardFromIdPost( $destSessionId )
+{
+ $domainId = -1;
+ if (!validateCookie($userId, $domainId, $charId))
+ {
+ echo "Invalid cookie !";
+ die();
+ }
+ else
+ {
+ joinShardFromId($userId, $domainId, $destSessionId);
+ }
+}
+
+/**
+ * Request to join the specified shard
+ */
+function joinShardFromId( $userId, $domainId, $destSessionId )
+{
+ $domainInfo = getDomainInfo($domainId);
+ $addr = split(":", $domainInfo["session_manager_address"]);
+ $RSMHost = $addr[0];
+ $RSMPort = $addr[1];
+
+ // request join to the session manager
+ $joinShard = new JoinShardCb;
+ $res = "";
+ $joinShard->connect($RSMHost, $RSMPort, $res);
+ $charSlot = getCharSlot(); // if ingame (!=15), the RSM can check if this character has the right to connect to the specified shard
+ $charId = ($userId<<4) + $charSlot;
+ echo "Requesting teleportation of $charId/$userId to shard session ".$destSessionId."...
";
+ $joinShard->joinSession($charId, $destSessionId, $domainInfo["domain_name"]);
+
+ // wait the the return message
+ if ($joinShard->waitCallback() == false)
+ {
+ // Note: the answer is a joinSessionResult message
+ echo "No response from server, joinShard failed
";
+ }
+ exit;
+}
+
+/**
+ * Request to get the shard list
+ */
+function getShardList($userId, $domainId)
+{
+ $domainInfo = getDomainInfo($domainId);
+ $addr = split(":", $domainInfo["session_manager_address"]);
+ $RSMHost = $addr[0];
+ $RSMPort = $addr[1];
+
+ // request get to the session manager
+ $joinShard = new JoinShardCb;
+ $res = "";
+ $joinShard->connect($RSMHost, $RSMPort, $res);
+
+ $charId = ($userId<<4)+15;
+ echo "Retrieving online shards for $charId...
";
+ $joinShard->getShards($charId);
+
+ // wait the the return message
+ if ($joinShard->waitCallback() == false)
+ {
+ echo "No response from server, getShards failed
";
+ }
+ exit;
+}
+
+/**
+ * Display the list of mainland shards
+ * This is a candidate to the callback $getShardListCallback
+ */
+function displayAllShards(&$onlineShardsBySessionId)
+{
+ // Get the userId and domainId back
+ $domainId = -1;
+ if (!validateCookie($userId, $domainId, $charId))
+ {
+ echo "Invalid cookie !";
+ die();
+ }
+
+ // List all shards of the domain, including offline ones
+ global $DBName;
+ mysql_select_db ($DBName) or die ("Can't access to the db dbname:$DBName");
+ $query = "select * from shard where domain_id = $domainId";
+ $resShards = mysql_query ($query) or die ("Can't execute the query: ".$query." ".mysql_error());
+ echo "Select a shard to join:
";
+ //echo "
";
+ }
+
+ //echo "";
+ //echo "";
+ exit;
+}
+
+
+/**
+ * Auto-join a shard.
+ * Returns true in case of success, and the FSHost address in $FSHostResultStr.
+ * Returns false in case of error, and an explanatory string in $FSHostResultStr.
+ */
+function joinMainland($userId, $domainId)
+{
+ $domainInfo = getDomainInfo($domainId);
+// $addr = split(":", $domainInfo["session_manager_address"]);
+ $addr = explode(":", $domainInfo["session_manager_address"]);
+ $RSMHost = $addr[0];
+ $RSMPort = $addr[1];
+
+ // request get to the session manager
+ $joinsShard = new JoinShardCb;
+ $res = "";
+ $joinsShard->connect($RSMHost, $RSMPort, $res);
+
+ // set the shard Id to allow any character (by using the special value '15')
+ $charId = ($userId<<4)+15;
+ global $FSHostLuaMode, $verbose;
+ if ($FSHostLuaMode && $verbose)
+ echo "Joining a mainland shard for $charId...
";
+ $joinsShard->joinMainland($charId, $domainInfo["domain_name"]);
+
+ // wait the the return message
+ if ($joinsShard->waitCallback() == false)
+ {
+ global $FSHostResultStr;
+ $FSHostResultStr = "No response from server for joinMainland
";
+ return false;
+ }
+ global $FSHostResult;
+ return $FSHostResult;
+}
+?>
diff --git a/ryzom/server/www/login/libs/login_service_itf.php b/ryzom/server/www/login/libs/login_service_itf.php
new file mode 100644
index 000000000..51cce5788
--- /dev/null
+++ b/ryzom/server/www/login/libs/login_service_itf.php
@@ -0,0 +1,108 @@
+setName("LG");
+
+
+ $msg->serialUint32($userId);
+ $msg->serialString($ipAddress);
+ $msg->serialUint32($domainId);
+
+ return parent::sendMessage($msg);
+
+
+ }
+
+ function logout($userId)
+ {
+ $msg = new CMessage;
+ $msg->setName("LO");
+
+
+ $msg->serialUint32($userId);
+
+ return parent::sendMessage($msg);
+
+
+ }
+
+
+ function waitCallback()
+ {
+ $message = parent::waitMessage();
+
+ if ($message == false)
+ return false;
+
+ switch($message->MsgName)
+ {
+ case "LGR":
+ $this->loginResult_skel($message);
+ break;
+ case "LGOR":
+ $this->logoutResult_skel($message);
+ break;
+ default:
+ return false;
+ }
+
+ return true;
+ }
+
+
+ function loginResult_skel(&$message)
+ {
+ $message->serialUint32($userId);
+ $message->serialString($cookie);
+ $message->serialUint32($resultCode);
+ $message->serialString($errorString);
+
+ $this->loginResult($userId, $cookie, $resultCode, $errorString);
+ }
+
+ function logoutResult_skel(&$message)
+ {
+ $message->serialUint32($errorCode);
+ $message->serialString($reason);
+
+ $this->logoutResult($errorCode, $reason);
+ }
+
+
+ /////////////////////////////////////////////////////////////////
+ // Copy paste this part of code in your derived class
+ // and implement code to ract to incoming message
+ /////////////////////////////////////////////////////////////////
+ // Return the cookie generated for this user session
+ // Eventualy, return an empty string as cookie in case of error
+ // resultCode : 0 - ok, login success
+ // 1 - invalid user
+ // 2 - user already online, must relog
+ // errorString contain a stringified description in case of error
+
+ function loginResult($userId, $cookie, $resultCode, $errorString)
+ {
+ }
+
+ // Return an error code for the logout attemp
+ // If return is not 0, then reason contains a debug string
+ // Return values : 0 - ok
+ // 1 - invalid user
+ // 2 - user already offline
+
+ function logoutResult($errorCode, $reason)
+ {
+ }
+
+ }
+?>
diff --git a/ryzom/server/www/login/libs/login_translations.php b/ryzom/server/www/login/libs/login_translations.php
new file mode 100644
index 000000000..2fcff90d2
--- /dev/null
+++ b/ryzom/server/www/login/libs/login_translations.php
@@ -0,0 +1,310 @@
+ ex 56; signup_data => ex 56B
+$ErrMsgs[2004]['en'] = "Invalid password";
+$ErrMsgs[2004]['fr'] = "Mot de passe erroné";
+$ErrMsgs[2004]['de'] = "Falsches Passwort";
+$ErrMsgs[2004]['log'] = false;
+
+// Translated Login Service error messages
+define('BASE_TRANSLATED_LS_ERROR_NUM', 2100);
+
+$ErrMsgs[2101]['dbg'] = '(LS error %1: %2 for userId %3)';
+$ErrMsgs[2101]['en'] = 'Invalid account'; // ex 1?: 'invalid user'
+$ErrMsgs[2101]['fr'] = 'Compte erroné';
+$ErrMsgs[2101]['de'] = 'Ungültiger Account';
+
+$ErrMsgs[2102]['dbg'] = '(LS error %1: %2 for userId %3)';
+$ErrMsgs[2102]['en'] = 'Your account is already in online state, please retry in a few seconds'; // ex 2: 'User already online, please relog'
+$ErrMsgs[2102]['fr'] = "Votre compte est encore dans l'état en ligne, merci de réessayer dans quelques secondes";
+$ErrMsgs[2102]['de'] = 'Dein Account ist schon als online gekennzeichnet, bitte versuche es in ein paar Sekunden nochmals';
+$ErrMsgs[2102]['log'] = false;
+
+$ErrMsgs[2103]['dbg'] = '(LS error %1: %2 for userId %3)';
+$ErrMsgs[2103]['en'] = 'Dual logging with a Privileged account is not permitted; this action has been logged and Gameforge CS has been notified';
+$ErrMsgs[2103]['fr'] = 'TODO';
+$ErrMsgs[2103]['de'] = 'TODO';
+$ErrMsgs[2103]['mail'] = array('duallog@ryzom.com', "Dual Logging with GM account detected",
+ "UserId %3 attempted to log-in while related account (linked through GMId) was in online state (error code %0).\n".
+ "Message from server: %2\n".
+ "This could be a false positive if the user just disconnected without waiting for 30 s, and tried to log-in with their other account.");
+
+$ErrMsgs[2104]['dbg'] = '(LS error %1: %2 for userId %3)';
+$ErrMsgs[2104]['lnk'] = $ErrMsgs[2103];
+
+$ErrMsgs[2105]['dbg'] = '(LS error %1: %2 for userId %3)';
+$ErrMsgs[2105]['lnk'] = $ErrMsgs[2101];
+
+$ErrMsgs[2106]['dbg'] = '(LS error %1: %2 for userId %3)';
+$ErrMsgs[2106]['lnk'] = $msgDBInMaintenance;
+
+
+/*
+ * Technical error messages:
+ * "visible" error messages (server down, etc.) are localized,
+ * unlike errors that should never occur (ex: bad parameters from client)
+ */
+define('BASE_TECHNICAL_ERROR_NUM', 3000);
+
+$ErrMsgs[3001]['dbg'] = 'Failed to find a ring domain record for domainId: %1';
+
+$ErrMsgs[3002]['dbg'] = 'Missing cmd';
+
+$ErrMsgs[3003]['dbg'] = 'No response from Shard Unifier';
+$ErrMsgs[3003]['lnk'] = $msgLSInMaintenance;
+
+$ErrMsgs[3004]['dbg'] = "Can't connect to the %1 db server host:%2 user:%3";
+$ErrMsgs[3004]['lnk'] = $msgDBInMaintenance;
+
+$ErrMsgs[3005]['dbg'] = "Can't access the %1 database db:%2 host:%3 user:%4 (check privileges)";
+$ErrMsgs[3005]['lnk'] = $msgDBInMaintenance;
+
+$ErrMsgs[3006]['dbg'] = "Can't execute query '%1' on the %2 database db:%3 host:%4 user:%5 error:%6";
+$ErrMsgs[3006]['lnk'] = $msgDBInMaintenance;
+
+$ErrMsgs[3007]['dbg'] = "Can't find domain: %1"; // ex 'x'
+$ErrMsgs[3007]['lnk'] = $msgMisconfiguredClient;
+$ErrMsgs[3007]['add'] = 'dbg';
+
+$ErrMsgs[3008]['dbg'] = "Login '%1' was created because it was not found in database"; // ex 50
+
+$ErrMsgs[3009]['dbg'] = "Can't fetch login '%1' after insertion"; // ex 51
+
+$ErrMsgs[3010]['dbg'] = "No permission found, but I need to accept Unknown user, so permission created, please RELOG";
+
+$ErrMsgs[3011]['dbg'] = "(client application: %1 domain: %2)"; // ex 53
+$ErrMsgs[3011]['en'] = "Your account needs a proper subscription to connect";
+$ErrMsgs[3011]['fr'] = "Votre compte doit avoir un abonnement actif pour se connecter";
+$ErrMsgs[3011]['de'] = 'Du kannst dich nicht ohne abgeschlossenes Abonemment in deinen Account einloggen';
+$ErrMsgs[3011]['add'] = 'dbg';
+$ErrMsgs[3011]['log'] = false;
+
+$ErrMsgs[3012]['dbg'] = "No access privilege found for %1, but I need to accept Unknown user, so permission created, RELOG";
+
+$ErrMsgs[3013]['dbg'] = "(client application: %1 domain: %2 reqPriv: %3)";
+$ErrMsgs[3013]['en'] = "You don't have sufficient privilege to connect now, please try later";
+$ErrMsgs[3013]['fr'] = "Vous n'avez pas les privilèges nécessaires pour vous connecter maintenant, veuillez essayer plus tard";
+$ErrMsgs[3013]['de'] = 'Du hast nicht die nötigen Rechte um dich jetzt zu verbinden, bitte versuch es später nochmal';
+$ErrMsgs[3013]['log'] = false;
+
+// Translated Ring Session Manager (joinSession) error messages
+define('BASE_TRANSLATED_RSM_ERROR_NUM', 4000);
+
+$ErrMsgs[4001]['dbg'] = 'joinSession error %1: %2 for userId %3';
+$ErrMsgs[4002]['dbg'] = 'joinSession error %1: %2 for userId %3';
+$ErrMsgs[4003]['dbg'] = 'joinSession error %1: %2 for userId %3';
+$ErrMsgs[4004]['dbg'] = 'joinSession error %1: %2 for userId %3';
+
+$ErrMsgs[4005]['dbg'] = '(joinSession error %1: %2 for userId %3)';
+$ErrMsgs[4005]['lnk'] = $msgGameServersClosed;
+
+$ErrMsgs[4006]['dbg'] = 'joinSession error %1: %2 for userId %3';
+$ErrMsgs[4007]['dbg'] = 'joinSession error %1: %2 for userId %3';
+$ErrMsgs[4008]['dbg'] = 'joinSession error %1: %2 for userId %3';
+$ErrMsgs[4009]['dbg'] = 'joinSession error %1: %2 for userId %3';
+
+$ErrMsgs[4010]['dbg'] = '(joinSession error %1: %2 for userId %3)';
+$ErrMsgs[4010]['lnk'] = $msgGameServersClosed;
+
+$ErrMsgs[4011]['dbg'] = 'joinSession error %1: %2 for userId %3';
+$ErrMsgs[4012]['dbg'] = 'joinSession error %1: %2 for userId %3';
+$ErrMsgs[4013]['dbg'] = 'joinSession error %1: %2 for userId %3';
+
+$ErrMsgs[4014]['dbg'] = '(joinSession error %1: %2 for userId %3)';
+$ErrMsgs[4014]['lnk'] = $msgGameServersClosed;
+
+$ErrMsgs[4015]['dbg'] = 'joinSession error %1: %2 for userId %3';
+$ErrMsgs[4016]['dbg'] = 'joinSession error %1: %2 for userId %3';
+$ErrMsgs[4017]['dbg'] = 'joinSession error %1: %2 for userId %3';
+$ErrMsgs[4018]['dbg'] = 'joinSession error %1: %2 for userId %3';
+$ErrMsgs[4019]['dbg'] = 'joinSession error %1: %2 for userId %3';
+$ErrMsgs[4020]['dbg'] = 'joinSession error %1: %2 for userId %3';
+
+
+$MsgLanguages = array('en');
+$DisplayDbg = true;
+
+/**
+ * Whenever a language information is known, use this method to refine the language used for error messages.
+ * Accepted values:
+ * 'en', 'fr', 'de', array of this values, or 'all' ('all' will display all versions)
+ */
+function setMsgLanguage($languages='en')
+{
+ global $MsgLanguages;
+ if ($languages == 'all')
+ {
+ $MsgLanguages = $languages;
+ return;
+ }
+ if (!is_array($languages))
+ $languages = array($languages);
+ foreach ($languages as $index => $lg)
+ {
+ switch ($lg)
+ {
+ case 'fr':
+ case 'de':;
+ break;
+ default:
+ $languages[$index] = 'en';
+ }
+ }
+ $MsgLanguages = $languages;
+}
+
+/**
+ * Find the specified error message, and return the first found with the following precedence:
+ * 1. Current language(s) set by setMsgLangage()
+ * 2. English message
+ * 3. Debug message
+ * 4. Generic error
+ * Each language can be found through ['lnk'] if needed
+ * Tags (%1..%n) in the message are replaced by mixed arguments specified after $errNum.
+ * Ex: errorMsg(55, $domainName)
+ * if 'dbg' is found in ['add'] or $DisplayDbg is true, the 'dbg' version is appended to the found version.
+ */
+function errorMsg($errNum=GENERIC_ERROR_NUM) // $mixedArgs
+{
+ // Find specified message using precedence rules
+ global $MsgLanguages;
+ $precedence = array(
+ array($errNum, ($MsgLanguages == 'all') ? array('en', 'fr', 'de') : $MsgLanguages),
+ array($errNum, array('en')),
+ array($errNum, array('dbg')),
+ array(GENERIC_ERROR_NUM, $MsgLanguages),
+ array(GENERIC_ERROR_NUM, array('en')));
+ global $ErrMsgs;
+ $args = func_get_args();
+ $msg = '';
+ foreach ($precedence as $rule)
+ {
+ // Find message
+ list($actualErrNum, $languages) = $rule;
+ foreach ($languages as $lg)
+ {
+ if (isset($ErrMsgs[$actualErrNum][$lg]) && ($ErrMsgs[$actualErrNum][$lg] != 'TODO'))
+ appendToMsg($msg, $errNum, $ErrMsgs[$actualErrNum][$lg], $args);
+ else if (isset($ErrMsgs[$actualErrNum]['lnk']) && isset($ErrMsgs[$actualErrNum]['lnk'][$lg]) && ($ErrMsgs[$actualErrNum]['lnk'][$lg] != 'TODO'))
+ appendToMsg($msg, $errNum, $ErrMsgs[$actualErrNum]['lnk'][$lg], $args);
+ }
+
+ // Try next rule only if not found
+ if (!empty($msg))
+ break;
+ }
+
+ // Add debug version if needed
+ global $DisplayDbg;
+ $msgHasDebug = in_array('dbg', $languages);
+ $logExtMsg = '';
+ if ((!$msgHasDebug) && isset($ErrMsgs[$actualErrNum]['dbg']))
+ {
+ if ($DisplayDbg || (isset($ErrMsgs[$actualErrNum]['add']) && ($ErrMsgs[$actualErrNum]['add'] == 'dbg')))
+ $msg .= '['.$ErrMsgs[$actualErrNum]['dbg']."]\n"; // to result/screen message
+ else
+ $logExtMsg .= '['.$ErrMsgs[$actualErrNum]['dbg'].']'; // to log message
+ }
+
+ // Get mail data if specified
+ $mailData = (isset($ErrMsgs[$actualErrNum]['mail']) ? $ErrMsgs[$actualErrNum]['mail'] :
+ (isset($ErrMsgs[$actualErrNum]['lnk']['mail']) ? $ErrMsgs[$actualErrNum]['lnk']['mail'] :
+ array()));
+
+ // Apply params if applicable
+ $numArgs = func_num_args();
+ if ($numArgs > 1)
+ {
+ for ($i=0; $i!=$numArgs; ++$i) // include $errNum (%0)
+ {
+ $msg = str_replace("%$i", $args[$i], $msg);
+ $logExtMsg = str_replace("%$i", $args[$i], $logExtMsg);
+ $mIdx = 0;
+ foreach ($mailData as $field)
+ {
+ $mailData[$mIdx] = str_replace("%$i", $args[$i], $field);
+ ++$mIdx;
+ }
+ }
+ }
+
+ // Log technical errors if possible
+ $logMode = (isset($ErrMsgs[$actualErrNum]['log']) ? $ErrMsgs[$actualErrNum]['log'] :
+ (isset($ErrMsgs[$actualErrNum]['lnk']['log']) ? $ErrMsgs[$actualErrNum]['lnk']['log'] :
+ true));
+ if ($logMode && class_exists('CWwwLog'))
+ {
+ $logFile = new CWwwLog();
+ $logFile->logStr(/*$msg.*/$logExtMsg); // message is already logged by ob_callback_r2login()
+ }
+
+ return $msg;
+}
+
+// Helper for errorMsg()
+function appendToMsg(&$msg, $errNum, $str, &$args)
+{
+ $msg .= "$str ($errNum)";
+ if (($errNum == GENERIC_ERROR_NUM) && !empty($args))
+ {
+ foreach ($args as $arg)
+ {
+ $msg .= " [$arg]"; // display all passed args if returning the default generic error
+ }
+ }
+ $msg .= "\n";
+}
+
+
+?>
diff --git a/ryzom/server/www/login/libs/r2_login_db.php b/ryzom/server/www/login/libs/r2_login_db.php
new file mode 100644
index 000000000..f1320535a
--- /dev/null
+++ b/ryzom/server/www/login/libs/r2_login_db.php
@@ -0,0 +1,52 @@
+db, $value);
+}
+
+class LoginDB {
+
+ function __construct($DBHost, $DBUserName, $DBPassword, $DefaultDBName) {
+ $this->host = $DBHost;
+ $this->user = $DBUserName;
+ $this->pass = $DBPassword;
+ $this->default_name = $DefaultDBName;
+ return $this->connect();
+ }
+
+ function connect() {
+ $this->db = mysqli_connect($this->host, $this->user, $this->pass) or die(errorMsgBlock(3004, 'DB', $this->host, $this->user));
+ return $this->db;
+ }
+
+ function select($db='') {
+ if ($db)
+ $this->name = $db;
+ else
+ $this->name = $this->default_name;
+ mysqli_select_db($this->db, $this->name) or die(errorMsgBlock(3005, 'DB', $this->name, $this->host, $this->user));
+ }
+
+ function query($query) {
+ $result = mysqli_query($this->db, $query) or die(errorMsgBlock(3006, $query, 'DB', $this->name, $this->host, $this->user, mysqli_error($this->db)));
+ $ret = array();
+ if (!is_bool($result)) {
+ while ($row = mysqli_fetch_array($result))
+ $ret[] = $row;
+ }
+ return $ret;
+ }
+
+ function querySingle($query) {
+ $result = mysqli_query($this->db, $query) or die(errorMsgBlock(3006, $query, 'DB', $this->name, $this->host, $this->user, mysqli_error($this->db)));
+ if (mysqli_num_rows($result))
+ return mysqli_fetch_array($result);
+ return array();
+ }
+
+ function getLastId() {
+ return mysqli_insert_id($this->db);
+ }
+
+}
diff --git a/ryzom/server/www/login/libs/r2_login_domain.php b/ryzom/server/www/login/libs/r2_login_domain.php
new file mode 100644
index 000000000..8599176ab
--- /dev/null
+++ b/ryzom/server/www/login/libs/r2_login_domain.php
@@ -0,0 +1,56 @@
+db = $db;
+ $this->db->select();
+ $this->domainInfo = $this->db->querySingle('SELECT * FROM domain WHERE domain_name = "'._e($clientApplication).'"');
+ if (!$this->domainInfo)
+ die('Can\'t find row for domain '.$clientApplication);
+ $this->id = $this->domainInfo['domain_id'];
+ $this->shardInfo = $this->db->querySingle('SELECT * FROM shard WHERE domain_id = "'.$this->id.'"');
+ if (!$this->shardInfo)
+ die('Can\'t find row for shard '.$clientApplication);
+ $this->domainInfo['shard'] = $this->shardInfo;
+ return $this->domainInfo;
+ }
+
+ function get($info) {
+ return $this->domainInfo[$info];
+ }
+
+ function getShard($info) {
+ return $this->domainInfo['shard'][$info];
+ }
+
+ function checkStatus($status, $User) {
+ $error = '';
+
+ if ($status == 'ds_close')
+ $error = '0:Reboot sequence...';
+ else if ($status == 'ds_dev' && strstr($User->priv, ':DEV:') == false)
+ $error = '0:You are not allowed to connect now, retry later';
+ else if ($status == 'ds_restricted') {
+ if ( strstr($User->priv, ':DEV:') == false
+ && strstr($User->priv, ':SGM:') == false
+ && strstr($User->priv, ':GM:') == false
+ && strstr($User->priv, ':EM:') == false
+ && strstr($User->priv, ':EG:') == false
+ && strstr($User->priv, ':TEST:') == false
+ ) {
+ $error = '0: Reboot sequence...'."\n\n";
+ $error .= 'The server has been rebooted. The Ryzom Team are carefully inspecting the shard to get it ready for you.'."\n\n";
+ $error .= 'Le serveur a été redémarré. L\'équipe de Ryzom est en train de le vérifier méticuleusement et le prépare pour vous.'."\n\n";
+ $error .= 'Der Server wurde neu gestartet. Das Ryzom-Team führt eine ausführliche Überprüfung des Servers durch, um ihn für Dich vorzubereiten!'."\n\n";
+ $error .= 'El servidor va a reiniciar. El equipo de Ryzom está revisando suavemente el servidor y preparándolo para ti!'."\n\n";
+ }
+ }
+
+ if ($error) {
+ echo iconv('UTF-8', 'ISO-8859-1', $error);
+ die();
+ }
+ }
+
+}
diff --git a/ryzom/server/www/login/libs/r2_login_logincb.php b/ryzom/server/www/login/libs/r2_login_logincb.php
new file mode 100644
index 000000000..83bdf91d8
--- /dev/null
+++ b/ryzom/server/www/login/libs/r2_login_logincb.php
@@ -0,0 +1,48 @@
+db = $db;
+ $this->domainInfo = $ServerDomain->domainInfo;
+ $this->domainId = $ServerDomain->id;
+ }
+
+
+ // receive the login result sent back by the LS
+ function loginResult($userId, $cookie, $resultCode, $errorString) {
+ if ($resultCode == 0 && $cookie != '') {
+ // gather the domain informations (server version, patch urls and backup patch url
+
+ $RingWebHost = $this->domainInfo['web_host'];
+ $RingWebHostPHP = $this->domainInfo['web_host_php'];
+
+ // set the cookie
+ setcookie('ryzomId' , $cookie, 0, '/');
+ $_COOKIE['ryzomId'] = $cookie; // make it available immediately
+
+ // Auto-join an available mainland shard
+ global $FSHostLuaMode, $FSHostResultStr;
+ $FSHostLuaMode = false;
+ $res = joinMainland($userId, $this->domainId, $this->domainInfo['domain_name']);
+
+ if ($res) {
+ // return the cookie to the user, il will then be used as an auth to browse the site and to connect to the shard
+ //echo "1#".$cookie."#http://".$RingWebHost."/ring/web_start.php\n";
+// use this line to use woopra stats
+// echo "1#".$cookie."#".$FSHostResultStr."#http://".$RingWebHost."/ring/web_start.php#http://".$RingWebHostPHP."/ring/#1\n";
+ echo '1#'.$cookie.'#'.$FSHostResultStr.'#http://'.$RingWebHost.'/ring/web_start.php#http://'.$RingWebHostPHP.'/ring/'."\n";
+ // return the ring domain information
+ echo $this->domainInfo['patch_version'].'#'.$this->domainInfo['backup_patch_url'].'#'.$this->domainInfo['patch_urls'];
+
+ } else {
+ global $JoinSessionResultCode, $JoinSessionResultMsg;
+ echo errorMsgBlock(BASE_TRANSLATED_RSM_ERROR_NUM + $JoinSessionResultCode, $JoinSessionResultCode, $JoinSessionResultMsg, $userId);
+ }
+ } else {
+ // empty cookie, this mean the user id can't be validated by the LS
+ echo errorMsgBlock(BASE_TRANSLATED_LS_ERROR_NUM + $resultCode, $resultCode, $errorString, $userId);
+ }
+ }
+}
diff --git a/ryzom/server/www/login/libs/r2_login_logs.php b/ryzom/server/www/login/libs/r2_login_logs.php
new file mode 100644
index 000000000..e9a748857
--- /dev/null
+++ b/ryzom/server/www/login/libs/r2_login_logs.php
@@ -0,0 +1,68 @@
+logStr(str_replace("\n",'\n',$buffer));
+ }
+ return $buffer; // sent to output
+}
+
+
+///////////////////////////////////////////////////////
+// Callback called on error
+function err_callback($errno, $errmsg, $filename, $linenum, $vars)
+{
+ // don't log "PHP ERROR/2048 Only variables should be passed by reference"
+ if($errno == 2048) return;
+
+ $logFile = new CWwwLog();
+ $logFile->logStr("PHP ERROR/$errno $errmsg ($filename:$linenum)");
+ // Never die after an error
+}
+
+function dieError($errNum=GENERIC_ERROR_NUM) // $mixedArgs
+{
+ $args = func_get_args();
+ die('0:'.call_user_func_array('errorMsg', $args));
+}
diff --git a/ryzom/server/www/login/libs/r2_login_user.php b/ryzom/server/www/login/libs/r2_login_user.php
new file mode 100644
index 000000000..21431258f
--- /dev/null
+++ b/ryzom/server/www/login/libs/r2_login_user.php
@@ -0,0 +1,108 @@
+db = $db;
+ $this->login = $login;
+ $this->password = $password;
+ $this->lang = $submittedLang;
+ $this->client = $clientApplication;
+
+ $this->db->select();
+
+ $this->user = $this->db->querySingle('SELECT * FROM user WHERE Login="'._e($this->login).'"');
+ if ($this->user) {
+ $this->uid = $this->user['UId'];
+ } else {
+ if ($AcceptUnknownUser && $this->password) {
+ $this->db->query('INSERT INTO user SET Login = "'._e($this->login).'", Password = "'._e($this->password).'", ShardId=-1, Privilege=":DEV:"');
+ $this->user = $this->db->querySingle('SELECT * FROM user WHERE Login="'._e($this->login).'"');
+ $this->uid = $this->user['UId'];
+ } else {
+ $this->uid = 0;
+ $this->user = array('Password' => 'AA');
+ }
+ }
+ $this->authenticate = False;
+ setMsgLanguage($submittedLang);
+ }
+
+
+ function askSalt() {
+ $user = $this->user;
+ if ($user)
+ echo '1:'.substr($user['Password'], 0, 2);
+ else
+ dieError(2001, '', 'askSalt');
+ }
+
+ function createRingInfo($ServerDomain) {
+ $domainInfo = $ServerDomain->domainInfo;
+ $this->db->select($domainInfo['ring_db_name']);
+ $result = $this->db->querySingle('SELECT user_id FROM ring_users where user_id = "'._e($this->uid).'"');
+ if (!$result)
+ $this->db->query('INSERT INTO ring_users SET user_id = "'._e($this->uid).'", user_name = "'._e($this->login).'", user_type="ut_pioneer"');
+ }
+
+ function checkAccess() {
+ }
+
+ function updatePrivs($privs) {
+ $this->db->query('UPDATE user SET ExtendedPrivilege="'._e($privs).'" WHERE UId='._e($this->uid));
+ $this->user['ExtendedPrivilege'] = $privs;
+ }
+
+ function addPriv($priv) {
+ $eprivs = explode(':', $this->user['ExtendedPrivilege']);
+ $privs = array();
+ foreach ($eprivs as $p)
+ $privs[$p] = $p;
+ unset($privs['']);
+ $privs[$priv] = $priv;
+ $this->updatePrivs(':'.implode(':', array_keys($privs)).':');
+ }
+
+ function removePriv($priv) {
+ $eprivs = explode(':', $this->user['ExtendedPrivilege']);
+ $privs = array();
+ foreach ($eprivs as $p)
+ $privs[$p] = $p;
+ unset($privs['']);
+ unset($privs[$priv]);
+ $this->updatePrivs(':'.implode(':', array_keys($privs)).':');
+ }
+
+
+ function checkPermission($ServerDomain) {
+ $perm = $this->db->querySingle('SELECT * FROM permission WHERE UId="'._e($this->uid).'" AND ClientApplication="'._e($this->client).'"');
+ if (!$perm)
+ $this->db->query('INSERT INTO permission (UId, ClientApplication, ShardId, AccessPrivilege) VALUES ("'._e($this->uid).'", "'._e($this->client).'", "'.$ServerDomain->getShard('ShardId').'", "OPEN")');
+ }
+
+ function logConnection() {
+ }
+
+ function checkValidity($password, $ServerDomain) {
+ $user = $this->user;
+
+ if (!$user)
+ dieError(3009, $this->login);
+
+ if ($this->user['Password'] == $password) {
+ $this->login = $this->user['Login']; // Correct case
+
+ $this->checkAccess();
+ $this->checkPermission($ServerDomain);
+ $this->logConnection();
+
+ $this->priv = $this->user['Privilege'];
+
+ return True;
+ } else
+ dieError(2004);
+ return False;
+ }
+
+}
diff --git a/ryzom/server/www/login/libs/ring_session_manager_itf.php b/ryzom/server/www/login/libs/ring_session_manager_itf.php
new file mode 100644
index 000000000..26386487c
--- /dev/null
+++ b/ryzom/server/www/login/libs/ring_session_manager_itf.php
@@ -0,0 +1,1876 @@
+
+Value = $RSMGR_TSessionPartStatus_InvalidValue;
+ }
+
+ function toString()
+ {
+ global $RSMGR_TSessionPartStatus_EnumValues;
+ return $RSMGR_TSessionPartStatus_EnumValues[$this->Value];
+ }
+
+ function fromString($strValue)
+ {
+ global $RSMGR_TSessionPartStatus_EnumValues;
+ foreach ($RSMGR_TSessionPartStatus_EnumValues as $k => $v)
+ {
+ if ($strValue === $v)
+ {
+ $this->Value = $k;
+ return;
+ }
+ }
+
+ $this->Value = $RSMGR_TSessionPartStatus_InvalidValue;
+ }
+
+ function toInt()
+ {
+ return $this->Value;
+ }
+
+ function fromInt($intValue)
+ {
+ global $RSMGR_TSessionPartStatus_InvalidValue;
+ global $RSMGR_TSessionPartStatus_EnumValues;
+ if (array_key_exists($intValue, $RSMGR_TSessionPartStatus_EnumValues))
+ $this->Value = $intValue;
+ else
+ $this->Value = $RSMGR_TSessionPartStatus_InvalidValue;
+ }
+ }
+?>
+Value = $RSMGR_TSessionType_InvalidValue;
+ }
+
+ function toString()
+ {
+ global $RSMGR_TSessionType_EnumValues;
+ return $RSMGR_TSessionType_EnumValues[$this->Value];
+ }
+
+ function fromString($strValue)
+ {
+ global $RSMGR_TSessionType_EnumValues;
+ foreach ($RSMGR_TSessionType_EnumValues as $k => $v)
+ {
+ if ($strValue === $v)
+ {
+ $this->Value = $k;
+ return;
+ }
+ }
+
+ $this->Value = $RSMGR_TSessionType_InvalidValue;
+ }
+
+ function toInt()
+ {
+ return $this->Value;
+ }
+
+ function fromInt($intValue)
+ {
+ global $RSMGR_TSessionType_InvalidValue;
+ global $RSMGR_TSessionType_EnumValues;
+ if (array_key_exists($intValue, $RSMGR_TSessionType_EnumValues))
+ $this->Value = $intValue;
+ else
+ $this->Value = $RSMGR_TSessionType_InvalidValue;
+ }
+ }
+?>
+Value = $RSMGR_TSessionOrientation_InvalidValue;
+ }
+
+ function toString()
+ {
+ global $RSMGR_TSessionOrientation_EnumValues;
+ return $RSMGR_TSessionOrientation_EnumValues[$this->Value];
+ }
+
+ function fromString($strValue)
+ {
+ global $RSMGR_TSessionOrientation_EnumValues;
+ foreach ($RSMGR_TSessionOrientation_EnumValues as $k => $v)
+ {
+ if ($strValue === $v)
+ {
+ $this->Value = $k;
+ return;
+ }
+ }
+
+ $this->Value = $RSMGR_TSessionOrientation_InvalidValue;
+ }
+
+ function toInt()
+ {
+ return $this->Value;
+ }
+
+ function fromInt($intValue)
+ {
+ global $RSMGR_TSessionOrientation_InvalidValue;
+ global $RSMGR_TSessionOrientation_EnumValues;
+ if (array_key_exists($intValue, $RSMGR_TSessionOrientation_EnumValues))
+ $this->Value = $intValue;
+ else
+ $this->Value = $RSMGR_TSessionOrientation_InvalidValue;
+ }
+ }
+?>
+Value = $RSMGR_TSessionState_InvalidValue;
+ }
+
+ function toString()
+ {
+ global $RSMGR_TSessionState_EnumValues;
+ return $RSMGR_TSessionState_EnumValues[$this->Value];
+ }
+
+ function fromString($strValue)
+ {
+ global $RSMGR_TSessionState_EnumValues;
+ foreach ($RSMGR_TSessionState_EnumValues as $k => $v)
+ {
+ if ($strValue === $v)
+ {
+ $this->Value = $k;
+ return;
+ }
+ }
+
+ $this->Value = $RSMGR_TSessionState_InvalidValue;
+ }
+
+ function toInt()
+ {
+ return $this->Value;
+ }
+
+ function fromInt($intValue)
+ {
+ global $RSMGR_TSessionState_InvalidValue;
+ global $RSMGR_TSessionState_EnumValues;
+ if (array_key_exists($intValue, $RSMGR_TSessionState_EnumValues))
+ $this->Value = $intValue;
+ else
+ $this->Value = $RSMGR_TSessionState_InvalidValue;
+ }
+ }
+?>
+Value = $RSMGR_TAnimMode_InvalidValue;
+ }
+
+ function toString()
+ {
+ global $RSMGR_TAnimMode_EnumValues;
+ return $RSMGR_TAnimMode_EnumValues[$this->Value];
+ }
+
+ function fromString($strValue)
+ {
+ global $RSMGR_TAnimMode_EnumValues;
+ foreach ($RSMGR_TAnimMode_EnumValues as $k => $v)
+ {
+ if ($strValue === $v)
+ {
+ $this->Value = $k;
+ return;
+ }
+ }
+
+ $this->Value = $RSMGR_TAnimMode_InvalidValue;
+ }
+
+ function toInt()
+ {
+ return $this->Value;
+ }
+
+ function fromInt($intValue)
+ {
+ global $RSMGR_TAnimMode_InvalidValue;
+ global $RSMGR_TAnimMode_EnumValues;
+ if (array_key_exists($intValue, $RSMGR_TAnimMode_EnumValues))
+ $this->Value = $intValue;
+ else
+ $this->Value = $RSMGR_TAnimMode_InvalidValue;
+ }
+ }
+?>
+Value = $RSMGR_TAccessType_InvalidValue;
+ }
+
+ function toString()
+ {
+ global $RSMGR_TAccessType_EnumValues;
+ return $RSMGR_TAccessType_EnumValues[$this->Value];
+ }
+
+ function fromString($strValue)
+ {
+ global $RSMGR_TAccessType_EnumValues;
+ foreach ($RSMGR_TAccessType_EnumValues as $k => $v)
+ {
+ if ($strValue === $v)
+ {
+ $this->Value = $k;
+ return;
+ }
+ }
+
+ $this->Value = $RSMGR_TAccessType_InvalidValue;
+ }
+
+ function toInt()
+ {
+ return $this->Value;
+ }
+
+ function fromInt($intValue)
+ {
+ global $RSMGR_TAccessType_InvalidValue;
+ global $RSMGR_TAccessType_EnumValues;
+ if (array_key_exists($intValue, $RSMGR_TAccessType_EnumValues))
+ $this->Value = $intValue;
+ else
+ $this->Value = $RSMGR_TAccessType_InvalidValue;
+ }
+ }
+?>
+Value = $RSMGR_TRuleType_InvalidValue;
+ }
+
+ function toString()
+ {
+ global $RSMGR_TRuleType_EnumValues;
+ return $RSMGR_TRuleType_EnumValues[$this->Value];
+ }
+
+ function fromString($strValue)
+ {
+ global $RSMGR_TRuleType_EnumValues;
+ foreach ($RSMGR_TRuleType_EnumValues as $k => $v)
+ {
+ if ($strValue === $v)
+ {
+ $this->Value = $k;
+ return;
+ }
+ }
+
+ $this->Value = $RSMGR_TRuleType_InvalidValue;
+ }
+
+ function toInt()
+ {
+ return $this->Value;
+ }
+
+ function fromInt($intValue)
+ {
+ global $RSMGR_TRuleType_InvalidValue;
+ global $RSMGR_TRuleType_EnumValues;
+ if (array_key_exists($intValue, $RSMGR_TRuleType_EnumValues))
+ $this->Value = $intValue;
+ else
+ $this->Value = $RSMGR_TRuleType_InvalidValue;
+ }
+ }
+?>
+Value = $RSMGR_TLevelFilter_InvalidValue;
+ }
+
+ function toString()
+ {
+ global $RSMGR_TLevelFilter_EnumValues;
+ return $RSMGR_TLevelFilter_EnumValues[$this->Value];
+ }
+
+ function fromString($strValue)
+ {
+ global $RSMGR_TLevelFilter_EnumValues;
+ foreach ($RSMGR_TLevelFilter_EnumValues as $k => $v)
+ {
+ if ($strValue === $v)
+ {
+ $this->Value = $k;
+ return;
+ }
+ }
+
+ $this->Value = $RSMGR_TLevelFilter_InvalidValue;
+ }
+
+ function toInt()
+ {
+ return $this->Value;
+ }
+
+ function fromInt($intValue)
+ {
+ global $RSMGR_TLevelFilter_InvalidValue;
+ global $RSMGR_TLevelFilter_EnumValues;
+ if (array_key_exists($intValue, $RSMGR_TLevelFilter_EnumValues))
+ $this->Value = $intValue;
+ else
+ $this->Value = $RSMGR_TLevelFilter_InvalidValue;
+ }
+ }
+?>
+Value = $RSMGR_TEstimatedDuration_InvalidValue;
+ }
+
+ function toString()
+ {
+ global $RSMGR_TEstimatedDuration_EnumValues;
+ return $RSMGR_TEstimatedDuration_EnumValues[$this->Value];
+ }
+
+ function fromString($strValue)
+ {
+ global $RSMGR_TEstimatedDuration_EnumValues;
+ foreach ($RSMGR_TEstimatedDuration_EnumValues as $k => $v)
+ {
+ if ($strValue === $v)
+ {
+ $this->Value = $k;
+ return;
+ }
+ }
+
+ $this->Value = $RSMGR_TEstimatedDuration_InvalidValue;
+ }
+
+ function toInt()
+ {
+ return $this->Value;
+ }
+
+ function fromInt($intValue)
+ {
+ global $RSMGR_TEstimatedDuration_InvalidValue;
+ global $RSMGR_TEstimatedDuration_EnumValues;
+ if (array_key_exists($intValue, $RSMGR_TEstimatedDuration_EnumValues))
+ $this->Value = $intValue;
+ else
+ $this->Value = $RSMGR_TEstimatedDuration_InvalidValue;
+ }
+ }
+?>
+Value = $RSMGR_TRaceFilter_InvalidValue;
+ }
+
+ function toString()
+ {
+ global $RSMGR_TRaceFilter_EnumValues;
+ return $RSMGR_TRaceFilter_EnumValues[$this->Value];
+ }
+
+ function fromString($strValue)
+ {
+ global $RSMGR_TRaceFilter_EnumValues;
+ foreach ($RSMGR_TRaceFilter_EnumValues as $k => $v)
+ {
+ if ($strValue === $v)
+ {
+ $this->Value = $k;
+ return;
+ }
+ }
+
+ $this->Value = $RSMGR_TRaceFilter_InvalidValue;
+ }
+
+ function toInt()
+ {
+ return $this->Value;
+ }
+
+ function fromInt($intValue)
+ {
+ global $RSMGR_TRaceFilter_InvalidValue;
+ global $RSMGR_TRaceFilter_EnumValues;
+ if (array_key_exists($intValue, $RSMGR_TRaceFilter_EnumValues))
+ $this->Value = $intValue;
+ else
+ $this->Value = $RSMGR_TRaceFilter_InvalidValue;
+ }
+ }
+?>
+Value = $RSMGR_TReligionFilter_InvalidValue;
+ }
+
+ function toString()
+ {
+ global $RSMGR_TReligionFilter_EnumValues;
+ return $RSMGR_TReligionFilter_EnumValues[$this->Value];
+ }
+
+ function fromString($strValue)
+ {
+ global $RSMGR_TReligionFilter_EnumValues;
+ foreach ($RSMGR_TReligionFilter_EnumValues as $k => $v)
+ {
+ if ($strValue === $v)
+ {
+ $this->Value = $k;
+ return;
+ }
+ }
+
+ $this->Value = $RSMGR_TReligionFilter_InvalidValue;
+ }
+
+ function toInt()
+ {
+ return $this->Value;
+ }
+
+ function fromInt($intValue)
+ {
+ global $RSMGR_TReligionFilter_InvalidValue;
+ global $RSMGR_TReligionFilter_EnumValues;
+ if (array_key_exists($intValue, $RSMGR_TReligionFilter_EnumValues))
+ $this->Value = $intValue;
+ else
+ $this->Value = $RSMGR_TReligionFilter_InvalidValue;
+ }
+ }
+?>
+Value = $RSMGR_TGuildFilter_InvalidValue;
+ }
+
+ function toString()
+ {
+ global $RSMGR_TGuildFilter_EnumValues;
+ return $RSMGR_TGuildFilter_EnumValues[$this->Value];
+ }
+
+ function fromString($strValue)
+ {
+ global $RSMGR_TGuildFilter_EnumValues;
+ foreach ($RSMGR_TGuildFilter_EnumValues as $k => $v)
+ {
+ if ($strValue === $v)
+ {
+ $this->Value = $k;
+ return;
+ }
+ }
+
+ $this->Value = $RSMGR_TGuildFilter_InvalidValue;
+ }
+
+ function toInt()
+ {
+ return $this->Value;
+ }
+
+ function fromInt($intValue)
+ {
+ global $RSMGR_TGuildFilter_InvalidValue;
+ global $RSMGR_TGuildFilter_EnumValues;
+ if (array_key_exists($intValue, $RSMGR_TGuildFilter_EnumValues))
+ $this->Value = $intValue;
+ else
+ $this->Value = $RSMGR_TGuildFilter_InvalidValue;
+ }
+ }
+?>
+Value = $RSMGR_TShardFilter_InvalidValue;
+ }
+
+ function toString()
+ {
+ global $RSMGR_TShardFilter_EnumValues;
+ return $RSMGR_TShardFilter_EnumValues[$this->Value];
+ }
+
+ function fromString($strValue)
+ {
+ global $RSMGR_TShardFilter_EnumValues;
+ foreach ($RSMGR_TShardFilter_EnumValues as $k => $v)
+ {
+ if ($strValue === $v)
+ {
+ $this->Value = $k;
+ return;
+ }
+ }
+
+ $this->Value = $RSMGR_TShardFilter_InvalidValue;
+ }
+
+ function toInt()
+ {
+ return $this->Value;
+ }
+
+ function fromInt($intValue)
+ {
+ global $RSMGR_TShardFilter_InvalidValue;
+ global $RSMGR_TShardFilter_EnumValues;
+ if (array_key_exists($intValue, $RSMGR_TShardFilter_EnumValues))
+ $this->Value = $intValue;
+ else
+ $this->Value = $RSMGR_TShardFilter_InvalidValue;
+ }
+ }
+?>
+Value = $RSMGR_TSessionEvent_InvalidValue;
+ }
+
+ function toString()
+ {
+ global $RSMGR_TSessionEvent_EnumValues;
+ return $RSMGR_TSessionEvent_EnumValues[$this->Value];
+ }
+
+ function fromString($strValue)
+ {
+ global $RSMGR_TSessionEvent_EnumValues;
+ foreach ($RSMGR_TSessionEvent_EnumValues as $k => $v)
+ {
+ if ($strValue === $v)
+ {
+ $this->Value = $k;
+ return;
+ }
+ }
+
+ $this->Value = $RSMGR_TSessionEvent_InvalidValue;
+ }
+
+ function toInt()
+ {
+ return $this->Value;
+ }
+
+ function fromInt($intValue)
+ {
+ global $RSMGR_TSessionEvent_InvalidValue;
+ global $RSMGR_TSessionEvent_EnumValues;
+ if (array_key_exists($intValue, $RSMGR_TSessionEvent_EnumValues))
+ $this->Value = $intValue;
+ else
+ $this->Value = $RSMGR_TSessionEvent_InvalidValue;
+ }
+ }
+?>
+setName("SSS");
+
+
+ $msg->serialUint32($charId);
+ $msg->serialEnum($sessionType);
+ $msg->serialString($sessionTitle);
+ $msg->serialString($sessionDesc);
+ $msg->serialEnum($sessionLevel);
+ $msg->serialEnum($ruleType);
+ $msg->serialEnum($estimatedDuration);
+ $msg->serialUint32($subscriptionSlot);
+ $msg->serialEnum($animMode);
+ $msg->serialEnum($raceFilter);
+ $msg->serialEnum($religionFilter);
+ $msg->serialEnum($guildFilter);
+ $msg->serialEnum($shardFilter);
+ $msg->serialEnum($levelFilter);
+ $msg->serialString($language);
+ $msg->serialEnum($orientation);
+ $msg->serialUint32($subscriptionClosed);
+ $msg->serialUint32($autoInvite);
+
+ return parent::sendMessage($msg);
+
+
+ }
+
+ function setSessionStartParams($charId, $sessionId, $initialIslandLocation, $initialEntryPointLocation, $initialSeason)
+ {
+ $msg = new CMessage;
+ $msg->setName("SSSP");
+
+
+ $msg->serialUint32($charId);
+ $msg->serialUint32($sessionId);
+ $msg->serialUint32($initialIslandLocation);
+ $msg->serialUint32($initialEntryPointLocation);
+ $msg->serialUint32($initialSeason);
+
+ return parent::sendMessage($msg);
+
+
+ }
+
+ function getSessionInfo($charId, $sessionId)
+ {
+ $msg = new CMessage;
+ $msg->setName("GSI");
+
+
+ $msg->serialUint32($charId);
+ $msg->serialUint32($sessionId);
+
+ return parent::sendMessage($msg);
+
+
+ }
+
+ function updateSessionInfo($charId, $sessionId, $sessionTitle, $plannedDate, $sessionDesc, $sessionLevel, $estimatedDuration, $subscriptionSlot, $raceFilter, $religionFilter, $guildFilter, $shardFilter, $levelFilter, $subscriptionClosed, $autoInvite, $language, $orientation)
+ {
+ $msg = new CMessage;
+ $msg->setName("USS");
+
+
+ $msg->serialUint32($charId);
+ $msg->serialUint32($sessionId);
+ $msg->serialString($sessionTitle);
+ $msg->serialUint32($plannedDate);
+ $msg->serialString($sessionDesc);
+ $msg->serialEnum($sessionLevel);
+ $msg->serialEnum($estimatedDuration);
+ $msg->serialUint32($subscriptionSlot);
+ $msg->serialEnum($raceFilter);
+ $msg->serialEnum($religionFilter);
+ $msg->serialEnum($guildFilter);
+ $msg->serialEnum($shardFilter);
+ $msg->serialEnum($levelFilter);
+ $msg->serialUint32($subscriptionClosed);
+ $msg->serialUint32($autoInvite);
+ $msg->serialString($language);
+ $msg->serialEnum($orientation);
+
+ return parent::sendMessage($msg);
+
+
+ }
+
+ function cancelSession($charId, $sessionId)
+ {
+ $msg = new CMessage;
+ $msg->setName("CANSS");
+
+
+ $msg->serialUint32($charId);
+ $msg->serialUint32($sessionId);
+
+ return parent::sendMessage($msg);
+
+
+ }
+
+ function startSession($charId, $sessionId)
+ {
+ $msg = new CMessage;
+ $msg->setName("STSS");
+
+
+ $msg->serialUint32($charId);
+ $msg->serialUint32($sessionId);
+
+ return parent::sendMessage($msg);
+
+
+ }
+
+ function closeSession($charId, $sessionId)
+ {
+ $msg = new CMessage;
+ $msg->setName("CLSS");
+
+
+ $msg->serialUint32($charId);
+ $msg->serialUint32($sessionId);
+
+ return parent::sendMessage($msg);
+
+
+ }
+
+ function closeEditSession($charId)
+ {
+ $msg = new CMessage;
+ $msg->setName("CLESS");
+
+
+ $msg->serialUint32($charId);
+
+ return parent::sendMessage($msg);
+
+
+ }
+
+ function addFriendCharacter($userId, $friendCharId)
+ {
+ $msg = new CMessage;
+ $msg->setName("AFC");
+
+
+ $msg->serialUint32($userId);
+ $msg->serialUint32($friendCharId);
+
+ return parent::sendMessage($msg);
+
+
+ }
+
+ function removeFriendCharacter($userId, $friendCharId)
+ {
+ $msg = new CMessage;
+ $msg->setName("RFC");
+
+
+ $msg->serialUint32($userId);
+ $msg->serialUint32($friendCharId);
+
+ return parent::sendMessage($msg);
+
+
+ }
+
+ function addBannedCharacter($userId, $bannedCharId)
+ {
+ $msg = new CMessage;
+ $msg->setName("ABC");
+
+
+ $msg->serialUint32($userId);
+ $msg->serialUint32($bannedCharId);
+
+ return parent::sendMessage($msg);
+
+
+ }
+
+ function removeBannedCharacter($userId, $bannedCharId)
+ {
+ $msg = new CMessage;
+ $msg->setName("RBC");
+
+
+ $msg->serialUint32($userId);
+ $msg->serialUint32($bannedCharId);
+
+ return parent::sendMessage($msg);
+
+
+ }
+
+ function addFriendDMCharacter($userId, $friendDMCharId)
+ {
+ $msg = new CMessage;
+ $msg->setName("AFDC");
+
+
+ $msg->serialUint32($userId);
+ $msg->serialUint32($friendDMCharId);
+
+ return parent::sendMessage($msg);
+
+
+ }
+
+ function removeFriendDMCharacter($userId, $friendDMCharId)
+ {
+ $msg = new CMessage;
+ $msg->setName("RFDC");
+
+
+ $msg->serialUint32($userId);
+ $msg->serialUint32($friendDMCharId);
+
+ return parent::sendMessage($msg);
+
+
+ }
+
+ function setKnownCharacterComments($userId, $charId, $relation, $comments)
+ {
+ $msg = new CMessage;
+ $msg->setName("SKCC");
+
+
+ $msg->serialUint32($userId);
+ $msg->serialUint32($charId);
+ $msg->serialString($relation);
+ $msg->serialString($comments);
+
+ return parent::sendMessage($msg);
+
+
+ }
+
+ function inviteCharacter($ownerCharId, $sessionId, $invitedCharId, $charRole)
+ {
+ $msg = new CMessage;
+ $msg->setName("IC");
+
+
+ $msg->serialUint32($ownerCharId);
+ $msg->serialUint32($sessionId);
+ $msg->serialUint32($invitedCharId);
+ $msg->serialEnum($charRole);
+
+ return parent::sendMessage($msg);
+
+
+ }
+
+ function removeInvitedCharacter($ownerCharId, $sessionId, $removedCharId)
+ {
+ $msg = new CMessage;
+ $msg->setName("RIC");
+
+
+ $msg->serialUint32($ownerCharId);
+ $msg->serialUint32($sessionId);
+ $msg->serialUint32($removedCharId);
+
+ return parent::sendMessage($msg);
+
+
+ }
+
+ function subscribeSession($charId, $sessionId)
+ {
+ $msg = new CMessage;
+ $msg->setName("SBS");
+
+
+ $msg->serialUint32($charId);
+ $msg->serialUint32($sessionId);
+
+ return parent::sendMessage($msg);
+
+
+ }
+
+ function unsubscribeSession($charId, $sessionId)
+ {
+ $msg = new CMessage;
+ $msg->setName("USBS");
+
+
+ $msg->serialUint32($charId);
+ $msg->serialUint32($sessionId);
+
+ return parent::sendMessage($msg);
+
+
+ }
+
+ function joinSession($charId, $sessionId, $clientApplication)
+ {
+ $msg = new CMessage;
+ $msg->setName("JSS");
+
+
+ $msg->serialUint32($charId);
+ $msg->serialUint32($sessionId);
+ $msg->serialString($clientApplication);
+
+ return parent::sendMessage($msg);
+
+
+ }
+
+ function joinMainland($charId, $clientApplication)
+ {
+ $msg = new CMessage;
+ $msg->setName("JML");
+
+
+ $msg->serialUint32($charId);
+ $msg->serialString($clientApplication);
+
+ return parent::sendMessage($msg);
+
+
+ }
+
+ function joinEditSession($charId, $clientApplication)
+ {
+ $msg = new CMessage;
+ $msg->setName("JES");
+
+
+ $msg->serialUint32($charId);
+ $msg->serialString($clientApplication);
+
+ return parent::sendMessage($msg);
+
+
+ }
+
+ function hibernateEditSession($charId)
+ {
+ $msg = new CMessage;
+ $msg->setName("HES");
+
+
+ $msg->serialUint32($charId);
+
+ return parent::sendMessage($msg);
+
+
+ }
+
+ function getShards($charId)
+ {
+ $msg = new CMessage;
+ $msg->setName("GSH");
+
+
+ $msg->serialUint32($charId);
+
+ return parent::sendMessage($msg);
+
+
+ }
+
+ function kickCharacter($ownerCharId, $sessionId, $kickedCharId)
+ {
+ $msg = new CMessage;
+ $msg->setName("KC");
+
+
+ $msg->serialUint32($ownerCharId);
+ $msg->serialUint32($sessionId);
+ $msg->serialUint32($kickedCharId);
+
+ return parent::sendMessage($msg);
+
+
+ }
+
+ function unkickCharacter($ownerCharId, $sessionId, $unkickedCharId)
+ {
+ $msg = new CMessage;
+ $msg->setName("UKC");
+
+
+ $msg->serialUint32($ownerCharId);
+ $msg->serialUint32($sessionId);
+ $msg->serialUint32($unkickedCharId);
+
+ return parent::sendMessage($msg);
+
+
+ }
+
+ function inviteGuild($charId, $sessionId, $guildId)
+ {
+ $msg = new CMessage;
+ $msg->setName("IG");
+
+
+ $msg->serialUint32($charId);
+ $msg->serialUint32($sessionId);
+ $msg->serialUint32($guildId);
+
+ return parent::sendMessage($msg);
+
+
+ }
+
+ function removeInvitedGuild($charId, $sessionId, $guildId)
+ {
+ $msg = new CMessage;
+ $msg->setName("RIG");
+
+
+ $msg->serialUint32($charId);
+ $msg->serialUint32($sessionId);
+ $msg->serialUint32($guildId);
+
+ return parent::sendMessage($msg);
+
+
+ }
+
+ function setScenarioInfo($charId, $sessionId, $title, $numPlayer, $playType)
+ {
+ $msg = new CMessage;
+ $msg->setName("SSCI");
+
+
+ $msg->serialUint32($charId);
+ $msg->serialUint32($sessionId);
+ $msg->serialString($title);
+ $msg->serialUint32($numPlayer);
+ $msg->serialString($playType);
+
+ return parent::sendMessage($msg);
+
+
+ }
+
+ function addJournalEntry($charId, $sessionId, $entryType, $text)
+ {
+ $msg = new CMessage;
+ $msg->setName("AJE");
+
+
+ $msg->serialUint32($charId);
+ $msg->serialUint32($sessionId);
+ $msg->serialString($entryType);
+ $msg->serialString($text);
+
+ return parent::sendMessage($msg);
+
+
+ }
+
+ function setPlayerRating($charId, $sessionId, $rateFun, $rateDifficulty, $rateAccessibility, $rateOriginality, $rateDirection)
+ {
+ $msg = new CMessage;
+ $msg->setName("SPR");
+
+
+ $msg->serialUint32($charId);
+ $msg->serialUint32($sessionId);
+ $msg->serialUint32($rateFun);
+ $msg->serialUint32($rateDifficulty);
+ $msg->serialUint32($rateAccessibility);
+ $msg->serialUint32($rateOriginality);
+ $msg->serialUint32($rateDirection);
+
+ return parent::sendMessage($msg);
+
+
+ }
+
+
+ function waitCallback()
+ {
+ $message = parent::waitMessage();
+
+ if ($message == false)
+ return false;
+
+ switch($message->MsgName)
+ {
+ case "RET":
+ $this->invokeResult_skel($message);
+ break;
+ case "SSSR":
+ $this->scheduleSessionResult_skel($message);
+ break;
+ case "SIR":
+ $this->sessionInfoResult_skel($message);
+ break;
+ case "JSSR":
+ $this->joinSessionResult_skel($message);
+ break;
+ case "JSSRE":
+ $this->joinSessionResultExt_skel($message);
+ break;
+ case "GSHR":
+ $this->getShardsResult_skel($message);
+ break;
+ default:
+ return false;
+ }
+
+ return true;
+ }
+
+
+ function invokeResult_skel(&$message)
+ {
+ $message->serialUint32($userId);
+ $message->serialUint32($resultCode);
+ $message->serialString($resultString);
+
+ $this->invokeResult($userId, $resultCode, $resultString);
+ }
+
+ function scheduleSessionResult_skel(&$message)
+ {
+ $message->serialUint32($charId);
+ $message->serialUint32($sessionId);
+ $message->serialUInt8($result);
+ $message->serialString($resultString);
+
+ $this->scheduleSessionResult($charId, $sessionId, $result, $resultString);
+ }
+
+ function sessionInfoResult_skel(&$message)
+ {
+ $message->serialUint32($charId);
+ $message->serialUint32($sessionId);
+
+ $raceFilter = new RSMGR_TRaceFilter;
+ $message->serialEnum($raceFilter);
+
+ $religionFilter = new RSMGR_TReligionFilter;
+ $message->serialEnum($religionFilter);
+
+ $guildFilter = new RSMGR_TGuildFilter;
+ $message->serialEnum($guildFilter);
+
+ $shardFilter = new RSMGR_TShardFilter;
+ $message->serialEnum($shardFilter);
+
+ $levelFilter = new RSMGR_TLevelFilter;
+ $message->serialEnum($levelFilter);
+ $message->serialUint32($subscriptionClosed);
+ $message->serialUint32($autoInvite);
+ $message->serialString($language);
+
+ $orientation = new RSMGR_TSessionOrientation;
+ $message->serialEnum($orientation);
+ $message->serialString($description);
+
+ $this->sessionInfoResult($charId, $sessionId, $raceFilter, $religionFilter, $guildFilter, $shardFilter, $levelFilter, $subscriptionClosed, $autoInvite, $language, $orientation, $description);
+ }
+
+ function joinSessionResult_skel(&$message)
+ {
+ $message->serialUint32($userId);
+ $message->serialUint32($sessionId);
+ $message->serialUint32($result);
+ $message->serialString($shardAddr);
+
+ $participantStatus = new RSMGR_TSessionPartStatus;
+ $message->serialEnum($participantStatus);
+
+ $this->joinSessionResult($userId, $sessionId, $result, $shardAddr, $participantStatus);
+ }
+
+ function joinSessionResultExt_skel(&$message)
+ {
+ $message->serialUint32($userId);
+ $message->serialUint32($sessionId);
+ $message->serialUint32($result);
+ $message->serialString($shardAddr);
+
+ $participantStatus = new RSMGR_TSessionPartStatus;
+ $message->serialEnum($participantStatus);
+ $message->serialUint32($securityCheckForFastDisconnection);
+
+ $this->joinSessionResultExt($userId, $sessionId, $result, $shardAddr, $participantStatus, $securityCheckForFastDisconnection);
+ }
+
+ function getShardsResult_skel(&$message)
+ {
+ $message->serialUint32($userId);
+ $message->serialString($result);
+
+ $this->getShardsResult($userId, $result);
+ }
+
+
+ /////////////////////////////////////////////////////////////////
+ // Copy paste this part of code in your derived class
+ // and implement code to ract to incoming message
+ /////////////////////////////////////////////////////////////////
+ // Generic response to invoke.
+ // result contains 0 if no error, more than 0 in case of error
+
+ function invokeResult($userId, $resultCode, $resultString)
+ {
+ }
+
+ // result is : 0 : session have been created fine
+ // 1 : invalid session type
+ // 2 : invalid level
+ // 3 : unknown character
+ // 4 : not used
+ // 5 : invalid access type
+ // 6 : invalid rule type
+ // 7 : invalid duration
+ // 8 : invalid user
+ // 9 : free trial account can't create anim session
+ // 10 : user is ban from ring anim session
+
+ function scheduleSessionResult($charId, $sessionId, $result, $resultString)
+ {
+ }
+
+ // session info result (anim)
+
+ function sessionInfoResult($charId, $sessionId, $raceFilter, $religionFilter, $guildFilter, $shardFilter, $levelFilter, $subscriptionClosed, $autoInvite, $language, $orientation, $description)
+ {
+ }
+
+ // Return the result of the session joining attempt
+ // If join is ok, the shardAddr contain of the
+ // Front end that waits for the player to come in and the.
+ // participation mode for the character (editor, animator or player).
+ // If ok, the web must return a page with a lua script.
+ // that trigger the action handler 'on_connect_to_shard' :
+ // runAH(nul, "on_connect_to_shard", "cookie=cookieValue|fsAddr=shardAddr|mode=participantStatus");
+ // result : 0 : ok the client can join the session
+ // 1 : char not found
+ // 2 : session not found
+ // 3 : no session participant for this character (not used for a mainland shard)
+ // 4 : can't find session server (not used for a mainland shard)
+ // 5 : shard hosting session is not reachable
+ // 6 : nel user info not found
+ // 7 : ring user not found
+ // 8 : welcome service rejected connection request
+ // 9 : session service shutdown (not used for a mainland shard)
+ // 10 : no mainland shard found (joinMainland only)
+ // 11 : internal error
+ // 12 : failed to request for access permission
+ // 13 : can't find access permission for user and domain
+ // 14 : Welcome service is closed for you
+ // 15 : Session is not open
+ // 16 : User banned from ring
+ // 17 : Newcomer flag missmatch
+ // 18 : Can't find session log to validate session access
+ // 19 : Can't find scenario info to validate session access
+ // 20 : Scenario is not allowed to free trial players
+
+ function joinSessionResult($userId, $sessionId, $result, $shardAddr, $participantStatus)
+ {
+ }
+
+ // See joinSessionResult.
+ // Adds a security code.
+
+ function joinSessionResultExt($userId, $sessionId, $result, $shardAddr, $participantStatus, $securityCheckForFastDisconnection)
+ {
+ }
+
+ // Return the list of online shards on which the user is allowed to connect,
+ // and their current dynamic attributes. Other attributes (e.g. names)
+ // can be queried from the database. Offline shards are the ones in the database
+ // of the same domain but not listed in the result.
+ // Then the client will have to call joinShard to connect on an online shard.
+
+ function getShardsResult($userId, $result)
+ {
+ }
+
+ }
+?>
+setName("AUTH");
+
+
+ $msg->serialUint32($userId);
+ $msg->serialUint32($cookie);
+
+ return parent::sendMessage($msg);
+
+
+ }
+
+ function getSessionList($charId)
+ {
+ $msg = new CMessage;
+ $msg->setName("GSL");
+
+
+ $msg->serialUint32($charId);
+
+ return parent::sendMessage($msg);
+
+
+ }
+
+ function getCharList($charId, $sessionId)
+ {
+ $msg = new CMessage;
+ $msg->setName("GCL");
+
+
+ $msg->serialUint32($charId);
+ $msg->serialUint32($sessionId);
+
+ return parent::sendMessage($msg);
+
+
+ }
+
+ function inviteCharacterByName($charId, $invitedCharName)
+ {
+ $msg = new CMessage;
+ $msg->setName("ICBN");
+
+
+ $msg->serialUint32($charId);
+ $msg->serialUint32($invitedCharName);
+
+ return parent::sendMessage($msg);
+
+
+ }
+
+ function getMyRatings($charId, $sessionId)
+ {
+ $msg = new CMessage;
+ $msg->setName("GMSR");
+
+
+ $msg->serialUint32($charId);
+ $msg->serialUint32($sessionId);
+
+ return parent::sendMessage($msg);
+
+
+ }
+
+ function getSessionAverageScores($sessionId)
+ {
+ $msg = new CMessage;
+ $msg->setName("GSAS");
+
+
+ $msg->serialUint32($sessionId);
+
+ return parent::sendMessage($msg);
+
+
+ }
+
+ function getScenarioAverageScores($md5)
+ {
+ $msg = new CMessage;
+ $msg->setName("GSCAS");
+
+
+ $msg->serialUint32($md5);
+
+ return parent::sendMessage($msg);
+
+
+ }
+
+ function getRingRatings($charId)
+ {
+ $msg = new CMessage;
+ $msg->setName("GRR");
+
+
+ $msg->serialUint32($charId);
+
+ return parent::sendMessage($msg);
+
+
+ }
+
+ function getRingPoints($charId)
+ {
+ $msg = new CMessage;
+ $msg->setName("GRP");
+
+
+ $msg->serialUint32($charId);
+
+ return parent::sendMessage($msg);
+
+
+ }
+
+ function forwardToDss($charId, $msg)
+ {
+ $msg = new CMessage;
+ $msg->setName("DSS_FW");
+
+
+ $msg->serialUint32($charId);
+ $msg->serialUint32($msg);
+
+ return parent::sendMessage($msg);
+
+
+ }
+
+
+ function waitCallback()
+ {
+ $message = parent::waitMessage();
+
+ if ($message == false)
+ return false;
+
+ switch($message->MsgName)
+ {
+ case "SL":
+ $this->sessionList_skel($message);
+ break;
+ case "CL":
+ $this->charList_skel($message);
+ break;
+ case "PR":
+ $this->playerRatings_skel($message);
+ break;
+ case "SAS":
+ $this->sessionAverageScores_skel($message);
+ break;
+ case "SCAS":
+ $this->scenarioAverageScores_skel($message);
+ break;
+ case "RR":
+ $this->ringRatings_skel($message);
+ break;
+ case "RP":
+ $this->ringPoints_skel($message);
+ break;
+ default:
+ return false;
+ }
+
+ return true;
+ }
+
+
+ function sessionList_skel(&$message)
+ {
+ $message->serialUint32($charId);
+ $message->serialUint32($sessions);
+
+ $this->sessionList($charId, $sessions);
+ }
+
+ function charList_skel(&$message)
+ {
+ $message->serialUint32($charId);
+ $message->serialUint32($sessionId);
+ $message->serialUint32($characters);
+
+ $this->charList($charId, $sessionId, $characters);
+ }
+
+ function playerRatings_skel(&$message)
+ {
+ $message->serialUint32($charId);
+ $message->serialUint32($scenarioRated);
+ $message->serialUint32($rateFun);
+ $message->serialUint32($rateDifficulty);
+ $message->serialUint32($rateAccessibility);
+ $message->serialUint32($rateOriginality);
+ $message->serialUint32($rateDirection);
+
+ $this->playerRatings($charId, $scenarioRated, $rateFun, $rateDifficulty, $rateAccessibility, $rateOriginality, $rateDirection);
+ }
+
+ function sessionAverageScores_skel(&$message)
+ {
+ $message->serialUint32($scenarioRated);
+ $message->serialUint32($rateFun);
+ $message->serialUint32($rateDifficulty);
+ $message->serialUint32($rateAccessibility);
+ $message->serialUint32($rateOriginality);
+ $message->serialUint32($rateDirection);
+ $message->serialUint32($rrpTotal);
+
+ $this->sessionAverageScores($scenarioRated, $rateFun, $rateDifficulty, $rateAccessibility, $rateOriginality, $rateDirection, $rrpTotal);
+ }
+
+ function scenarioAverageScores_skel(&$message)
+ {
+ $message->serialUint32($scenarioRated);
+ $message->serialUint32($rateFun);
+ $message->serialUint32($rateDifficulty);
+ $message->serialUint32($rateAccessibility);
+ $message->serialUint32($rateOriginality);
+ $message->serialUint32($rateDirection);
+ $message->serialUint32($rrpTotal);
+
+ $this->scenarioAverageScores($scenarioRated, $rateFun, $rateDifficulty, $rateAccessibility, $rateOriginality, $rateDirection, $rrpTotal);
+ }
+
+ function ringRatings_skel(&$message)
+ {
+ $message->serialUint32($charId);
+ $message->serialUint32($authorRating);
+ $message->serialUint32($AMRating);
+ $message->serialUint32($masterlessRating);
+
+ $this->ringRatings($charId, $authorRating, $AMRating, $masterlessRating);
+ }
+
+ function ringPoints_skel(&$message)
+ {
+ $message->serialUint32($charId);
+ $message->serialUint32($ringPoints);
+ $message->serialUint32($maxRingPoints);
+
+ $this->ringPoints($charId, $ringPoints, $maxRingPoints);
+ }
+
+
+ /////////////////////////////////////////////////////////////////
+ // Copy paste this part of code in your derived class
+ // and implement code to ract to incoming message
+ /////////////////////////////////////////////////////////////////
+ // Return the list of available session
+
+ function sessionList($charId, $sessions)
+ {
+ }
+
+ // Return the list of player characters in the session
+
+ function charList($charId, $sessionId, $characters)
+ {
+ }
+
+ // Return current player rating of the current session scenario
+
+ function playerRatings($charId, $scenarioRated, $rateFun, $rateDifficulty, $rateAccessibility, $rateOriginality, $rateDirection)
+ {
+ }
+
+ // Return average scores of a session
+
+ function sessionAverageScores($scenarioRated, $rateFun, $rateDifficulty, $rateAccessibility, $rateOriginality, $rateDirection, $rrpTotal)
+ {
+ }
+
+ // Return average scores of a scenario
+
+ function scenarioAverageScores($scenarioRated, $rateFun, $rateDifficulty, $rateAccessibility, $rateOriginality, $rateDirection, $rrpTotal)
+ {
+ }
+
+ // Return the author rating, the AM rating and the Masterless rating
+
+ function ringRatings($charId, $authorRating, $AMRating, $masterlessRating)
+ {
+ }
+
+ // Return the ring points of the character
+
+ function ringPoints($charId, $ringPoints, $maxRingPoints)
+ {
+ }
+
+ }
+?>
diff --git a/ryzom/server/www/login/libs/validate_cookie.php b/ryzom/server/www/login/libs/validate_cookie.php
new file mode 100644
index 000000000..d0ff8dd26
--- /dev/null
+++ b/ryzom/server/www/login/libs/validate_cookie.php
@@ -0,0 +1,79 @@
+";
+ return false;
+ }
+
+ // read the ip and compare with client ip
+ $cookie = $_COOKIE["ryzomId"];
+ echo "Cookie is $cookie
";
+ sscanf($cookie, "%02X%02X%02X%02X", $b0, $b1, $b2, $b3);
+ $addr = $b0 + ($b1<<8) + ($b2<<16) + ($b3<<24);
+ printf("Addr is %X
", $addr);
+ $addrStr = long2ip($addr);
+ echo "addrStr is $addrStr
";
+
+ if ($_SERVER["REMOTE_ADDR"] != $addrStr)
+ {
+ echo "Client ip don't match cookie
";
+ return false;
+ }
+
+ // check the cookie in the database
+ $link = mysqli_connect($DBHost, $DBUserName, $DBPassword) or die ("Can't connect to database host:$DBHost user:$DBUserName");
+ mysqli_select_db($link, $RingDBName) or die ("Can't access to the table dbname:$RingDBName");
+ $query = "SELECT user_id, current_status, current_domain_id FROM ring_users where cookie='$cookie'";
+ $result = mysqli_query($link, $query) or die ("Can't execute the query: ".$query);
+
+ if (mysqli_num_rows($result) == 0)
+ {
+ echo "Can't find cookie $cookie in database
";
+ return false;
+ }
+
+ $row = mysqli_fetch_array($result);
+
+ if ($row["current_status"] != "cs_logged" && $row["current_status"] != "cs_online" )
+ {
+ echo "User $row[user_id] is not looged or online
";
+ return false;
+ }
+
+ $userId = $row["user_id"];
+ $domainId = $row["current_domain_id"];
+// $charId = ($userId*16) + (getCharSlot()) & 0xf;
+ $charId = $userId*16 + getCharSlot();
+
+ return true;
+}
+
+function getCharSlot()
+{
+ global $_GET, $_POST;
+ if (isset($_GET["charSlot"]))
+ return $_GET["charSlot"];
+ else if (isset($_POST["charSlot"]))
+ return $_POST["charSlot"];
+ else
+ return 0; // temp dev: use 0 as the "ring character"
+}
diff --git a/ryzom/server/www/login/libs/welcome_service_itf.php b/ryzom/server/www/login/libs/welcome_service_itf.php
new file mode 100644
index 000000000..9c31cbbf3
--- /dev/null
+++ b/ryzom/server/www/login/libs/welcome_service_itf.php
@@ -0,0 +1,59 @@
+Value = $WS_TUserRole_InvalidValue;
+ }
+
+ function toString()
+ {
+ global $WS_TUserRole_EnumValues;
+ return $WS_TUserRole_EnumValues[$this->Value];
+ }
+
+ function fromString($strValue)
+ {
+ global $WS_TUserRole_EnumValues;
+ foreach ($WS_TUserRole_EnumValues as $k => $v)
+ {
+ if ($strValue === $v)
+ {
+ $this->Value = $k;
+ return;
+ }
+ }
+
+ $this->Value = $WS_TUserRole_InvalidValue;
+ }
+
+ function toInt()
+ {
+ return $this->Value;
+ }
+
+ function fromInt($intValue)
+ {
+ global $WS_TUserRole_InvalidValue;
+ global $WS_TUserRole_EnumValues;
+ if (array_key_exists($intValue, $WS_TUserRole_EnumValues))
+ $this->Value = $intValue;
+ else
+ $this->Value = $WS_TUserRole_InvalidValue;
+ }
+ }
+?>
diff --git a/ryzom/server/www/login/logs/.empty b/ryzom/server/www/login/logs/.empty
new file mode 100644
index 000000000..e69de29bb
diff --git a/ryzom/server/www/login/nel.sql b/ryzom/server/www/login/nel.sql
new file mode 100644
index 000000000..c32434ba6
--- /dev/null
+++ b/ryzom/server/www/login/nel.sql
@@ -0,0 +1,201 @@
+-- phpMyAdmin SQL Dump
+-- version 4.8.5
+-- https://www.phpmyadmin.net/
+--
+-- Hôte : localhost:3306
+-- Généré le : jeu. 21 fév. 2019 à 23:46
+-- Version du serveur : 5.7.25-0ubuntu0.18.04.2
+-- Version de PHP : 7.2.15-0ubuntu0.18.04.1
+
+SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
+SET AUTOCOMMIT = 0;
+START TRANSACTION;
+SET time_zone = "+00:00";
+
+
+/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
+/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
+/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
+/*!40101 SET NAMES utf8mb4 */;
+
+--
+-- Base de données : `nel`
+--
+
+-- --------------------------------------------------------
+
+--
+-- Structure de la table `domain`
+--
+
+CREATE TABLE `domain` (
+ `domain_id` int(10) UNSIGNED NOT NULL,
+ `domain_name` varchar(32) NOT NULL DEFAULT '',
+ `status` enum('ds_close','ds_dev','ds_restricted','ds_open') NOT NULL DEFAULT 'ds_dev',
+ `patch_version` int(10) UNSIGNED NOT NULL DEFAULT '0',
+ `backup_patch_url` varchar(255) DEFAULT NULL,
+ `patch_urls` text,
+ `login_address` varchar(255) NOT NULL DEFAULT '',
+ `session_manager_address` varchar(255) NOT NULL DEFAULT '',
+ `ring_db_name` varchar(255) NOT NULL DEFAULT '',
+ `web_host` varchar(255) NOT NULL DEFAULT '',
+ `web_host_php` varchar(255) NOT NULL DEFAULT '',
+ `description` varchar(200) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+
+-- --------------------------------------------------------
+
+--
+-- Structure de la table `permission`
+--
+
+CREATE TABLE `permission` (
+ `UId` int(10) UNSIGNED NOT NULL DEFAULT '0',
+ `ClientApplication` char(64) NOT NULL DEFAULT 'r2',
+ `ShardId` int(10) NOT NULL DEFAULT '-1',
+ `AccessPrivilege` set('DEV','RESTRICTED','OPEN') NOT NULL DEFAULT 'OPEN',
+ `prim` int(10) UNSIGNED NOT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+
+-- --------------------------------------------------------
+
+--
+-- Structure de la table `shard`
+--
+
+CREATE TABLE `shard` (
+ `ShardId` int(10) NOT NULL DEFAULT '0',
+ `domain_id` int(11) UNSIGNED NOT NULL DEFAULT '0',
+ `WsAddr` varchar(64) DEFAULT NULL,
+ `NbPlayers` int(10) UNSIGNED DEFAULT '0',
+ `Name` varchar(255) DEFAULT 'unknown shard',
+ `WSOnline` tinyint(1) UNSIGNED DEFAULT '0',
+ `ClientApplication` varchar(64) DEFAULT 'ryzom',
+ `Version` varchar(64) NOT NULL DEFAULT '',
+ `PatchURL` varchar(255) NOT NULL DEFAULT '',
+ `DynPatchURL` varchar(255) NOT NULL DEFAULT '',
+ `FixedSessionId` int(11) UNSIGNED NOT NULL DEFAULT '0',
+ `State` enum('ds_close','ds_dev','ds_restricted','ds_open') NOT NULL DEFAULT 'ds_dev',
+ `MOTD` text NOT NULL,
+ `prim` int(10) UNSIGNED NOT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='contains all shards informations for login system';
+
+-- --------------------------------------------------------
+
+--
+-- Structure de la table `user`
+--
+
+CREATE TABLE `user` (
+ `UId` int(10) NOT NULL,
+ `Login` varchar(64) NOT NULL DEFAULT '',
+ `Password` varchar(13) DEFAULT NULL,
+ `ShardId` int(10) NOT NULL DEFAULT '-1',
+ `State` enum('Offline','Online') NOT NULL DEFAULT 'Offline',
+ `Privilege` varchar(255) DEFAULT NULL,
+ `GroupName` varchar(255) NOT NULL DEFAULT '',
+ `FirstName` varchar(255) NOT NULL DEFAULT '',
+ `LastName` varchar(255) NOT NULL DEFAULT '',
+ `Birthday` varchar(32) NOT NULL DEFAULT '',
+ `Gender` tinyint(1) UNSIGNED NOT NULL DEFAULT '0',
+ `Country` char(2) NOT NULL DEFAULT '',
+ `Email` varchar(255) NOT NULL DEFAULT '',
+ `Address` varchar(255) NOT NULL DEFAULT '',
+ `City` varchar(100) NOT NULL DEFAULT '',
+ `PostalCode` varchar(10) NOT NULL DEFAULT '',
+ `USState` char(2) NOT NULL DEFAULT '',
+ `Chat` char(2) NOT NULL DEFAULT '0',
+ `BetaKeyId` int(10) UNSIGNED NOT NULL DEFAULT '0',
+ `CachedCoupons` varchar(255) NOT NULL DEFAULT '',
+ `ProfileAccess` varchar(45) DEFAULT NULL,
+ `Level` int(2) NOT NULL DEFAULT '0',
+ `CurrentFunds` int(4) NOT NULL DEFAULT '0',
+ `IdBilling` varchar(255) NOT NULL DEFAULT '',
+ `Community` char(2) NOT NULL DEFAULT '--',
+ `Newsletter` tinyint(1) NOT NULL DEFAULT '1',
+ `Account` varchar(64) NOT NULL DEFAULT '',
+ `ChoiceSubLength` tinyint(2) NOT NULL DEFAULT '0',
+ `CurrentSubLength` varchar(255) NOT NULL DEFAULT '0',
+ `ValidIdBilling` int(4) NOT NULL DEFAULT '0',
+ `GMId` int(4) NOT NULL DEFAULT '0',
+ `ExtendedPrivilege` varchar(255) NOT NULL DEFAULT '',
+ `ToolsGroup` varchar(255) NOT NULL DEFAULT '',
+ `Unsubscribe` date DEFAULT NULL,
+ `SubDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
+ `SubIp` varchar(20) NOT NULL DEFAULT '',
+ `SecurePassword` varchar(32) NOT NULL DEFAULT '',
+ `LastInvoiceEmailCheck` date DEFAULT NULL,
+ `FromSource` varchar(8) NOT NULL DEFAULT '',
+ `ValidMerchantCode` varchar(11) NOT NULL DEFAULT '',
+ `PBC` tinyint(1) NOT NULL DEFAULT '0'
+) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+
+--
+-- Index pour les tables déchargées
+--
+
+--
+-- Index pour la table `domain`
+--
+ALTER TABLE `domain`
+ ADD PRIMARY KEY (`domain_id`),
+ ADD UNIQUE KEY `name_idx` (`domain_name`);
+
+--
+-- Index pour la table `permission`
+--
+ALTER TABLE `permission`
+ ADD PRIMARY KEY (`prim`),
+ ADD KEY `UIdIndex` (`UId`);
+
+--
+-- Index pour la table `shard`
+--
+ALTER TABLE `shard`
+ ADD PRIMARY KEY (`prim`);
+
+--
+-- Index pour la table `user`
+--
+ALTER TABLE `user`
+ ADD PRIMARY KEY (`UId`),
+ ADD KEY `LoginIndex` (`Login`),
+ ADD KEY `GroupIndex` (`GroupName`),
+ ADD KEY `Email` (`Email`),
+ ADD KEY `ToolsGroup` (`ToolsGroup`),
+ ADD KEY `CurrentSubLength` (`CurrentSubLength`),
+ ADD KEY `Community` (`Community`),
+ ADD KEY `GMId` (`GMId`);
+
+--
+-- AUTO_INCREMENT pour les tables déchargées
+--
+
+--
+-- AUTO_INCREMENT pour la table `domain`
+--
+ALTER TABLE `domain`
+ MODIFY `domain_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;
+
+--
+-- AUTO_INCREMENT pour la table `permission`
+--
+ALTER TABLE `permission`
+ MODIFY `prim` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;
+
+--
+-- AUTO_INCREMENT pour la table `shard`
+--
+ALTER TABLE `shard`
+ MODIFY `prim` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;
+
+--
+-- AUTO_INCREMENT pour la table `user`
+--
+ALTER TABLE `user`
+ MODIFY `UId` int(10) NOT NULL AUTO_INCREMENT;
+COMMIT;
+
+/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
+/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
+/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
diff --git a/ryzom/server/www/login/r2_login.php b/ryzom/server/www/login/r2_login.php
new file mode 100644
index 000000000..283bcf544
--- /dev/null
+++ b/ryzom/server/www/login/r2_login.php
@@ -0,0 +1,66 @@
+askSalt();
+ die();
+
+ case 'login':
+ // client sent is login info
+ $ServerDomain = new ServerDomain($RingDb, $clientApplication);
+ if ($User->checkValidity($password, $ServerDomain)) {
+
+ if ($AutoCreateRingInfo)
+ $User->createRingInfo($ServerDomain);
+
+ $LSaddr = explode(":", $ServerDomain->domainInfo['login_address']);
+ // ask for a session cookie to the login service
+ $Login = new LoginCb();
+ $Login->init($RingDb, $ServerDomain);
+
+ $res = "";
+ $Login->connect($LSaddr[0], $LSaddr[1], $res);
+ $Login->login($User->uid, $_SERVER['REMOTE_ADDR'], $ServerDomain->id);
+
+ if (!$Login->waitCallback())
+ die(errorMsgBlock(3003));
+
+ }
+
+ die();
+}
+
diff --git a/ryzom/server/www/login/ring.sql b/ryzom/server/www/login/ring.sql
new file mode 100644
index 000000000..e9dc9c967
--- /dev/null
+++ b/ryzom/server/www/login/ring.sql
@@ -0,0 +1,524 @@
+-- phpMyAdmin SQL Dump
+-- version 4.8.5
+-- https://www.phpmyadmin.net/
+--
+-- Hôte : localhost:3306
+-- Généré le : jeu. 21 fév. 2019 à 23:47
+-- Version du serveur : 5.7.25-0ubuntu0.18.04.2
+-- Version de PHP : 7.2.15-0ubuntu0.18.04.1
+
+SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
+SET AUTOCOMMIT = 0;
+START TRANSACTION;
+SET time_zone = "+00:00";
+
+
+/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
+/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
+/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
+/*!40101 SET NAMES utf8mb4 */;
+
+--
+-- Base de données : `ring_test`
+--
+
+-- --------------------------------------------------------
+
+--
+-- Structure de la table `characters`
+--
+
+CREATE TABLE `characters` (
+ `char_id` int(10) UNSIGNED NOT NULL DEFAULT '0',
+ `char_name` varchar(20) NOT NULL DEFAULT '',
+ `user_id` int(10) UNSIGNED NOT NULL DEFAULT '0',
+ `guild_id` int(10) UNSIGNED NOT NULL DEFAULT '0',
+ `best_combat_level` int(10) UNSIGNED NOT NULL DEFAULT '0',
+ `home_mainland_session_id` int(10) UNSIGNED NOT NULL DEFAULT '0',
+ `ring_access` varchar(63) NOT NULL DEFAULT '',
+ `race` enum('r_fyros','r_matis','r_tryker','r_zorai') NOT NULL DEFAULT 'r_fyros',
+ `civilisation` enum('c_neutral','c_fyros','c_fyros','c_matis','c_tryker','c_zorai') NOT NULL DEFAULT 'c_neutral',
+ `cult` enum('c_neutral','c_kami','c_karavan') NOT NULL DEFAULT 'c_neutral',
+ `current_session` int(11) UNSIGNED NOT NULL DEFAULT '0',
+ `rrp_am` int(11) UNSIGNED NOT NULL DEFAULT '0',
+ `rrp_masterless` int(11) UNSIGNED NOT NULL DEFAULT '0',
+ `rrp_author` int(11) UNSIGNED NOT NULL DEFAULT '0',
+ `newcomer` tinyint(1) NOT NULL DEFAULT '1',
+ `creation_date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
+ `last_played_date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00'
+) ENGINE=MyISAM DEFAULT CHARSET=latin1;
+
+-- --------------------------------------------------------
+
+--
+-- Structure de la table `folder`
+--
+
+CREATE TABLE `folder` (
+ `Id` int(10) UNSIGNED NOT NULL,
+ `owner` int(10) UNSIGNED NOT NULL DEFAULT '0',
+ `title` varchar(40) NOT NULL DEFAULT '',
+ `comments` text NOT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+
+-- --------------------------------------------------------
+
+--
+-- Structure de la table `folder_access`
+--
+
+CREATE TABLE `folder_access` (
+ `Id` int(10) UNSIGNED NOT NULL,
+ `folder_id` int(10) UNSIGNED NOT NULL DEFAULT '0',
+ `user_id` int(10) UNSIGNED NOT NULL DEFAULT '0'
+) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+
+-- --------------------------------------------------------
+
+--
+-- Structure de la table `guilds`
+--
+
+CREATE TABLE `guilds` (
+ `guild_id` int(10) UNSIGNED NOT NULL DEFAULT '0',
+ `guild_name` varchar(20) NOT NULL DEFAULT '',
+ `shard_id` int(11) NOT NULL DEFAULT '0'
+) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+
+-- --------------------------------------------------------
+
+--
+-- Structure de la table `guild_invites`
+--
+
+CREATE TABLE `guild_invites` (
+ `Id` int(10) UNSIGNED NOT NULL,
+ `session_id` int(10) UNSIGNED NOT NULL DEFAULT '0',
+ `guild_id` int(10) UNSIGNED NOT NULL DEFAULT '0'
+) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+
+-- --------------------------------------------------------
+
+--
+-- Structure de la table `journal_entry`
+--
+
+CREATE TABLE `journal_entry` (
+ `Id` int(10) UNSIGNED NOT NULL,
+ `session_id` int(10) UNSIGNED NOT NULL DEFAULT '0',
+ `author` int(10) UNSIGNED NOT NULL DEFAULT '0',
+ `type` enum('jet_credits','jet_notes') NOT NULL DEFAULT 'jet_notes',
+ `text` text NOT NULL,
+ `time_stamp` datetime NOT NULL DEFAULT '2005-09-07 12:41:33'
+) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+
+-- --------------------------------------------------------
+
+--
+-- Structure de la table `known_users`
+--
+
+CREATE TABLE `known_users` (
+ `Id` int(10) UNSIGNED NOT NULL,
+ `owner` int(10) UNSIGNED NOT NULL DEFAULT '0',
+ `targer_user` int(10) UNSIGNED NOT NULL DEFAULT '0',
+ `targer_character` int(10) UNSIGNED NOT NULL DEFAULT '0',
+ `relation_type` enum('rt_friend','rt_banned','rt_friend_dm') NOT NULL DEFAULT 'rt_friend',
+ `comments` varchar(255) NOT NULL DEFAULT ''
+) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+
+-- --------------------------------------------------------
+
+--
+-- Structure de la table `mfs_erased_mail_series`
+--
+
+CREATE TABLE `mfs_erased_mail_series` (
+ `erased_char_id` int(11) UNSIGNED NOT NULL DEFAULT '0',
+ `erased_char_name` varchar(32) NOT NULL DEFAULT '',
+ `erased_series` int(11) UNSIGNED NOT NULL,
+ `erase_date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00'
+) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+
+-- --------------------------------------------------------
+
+--
+-- Structure de la table `mfs_guild_thread`
+--
+
+CREATE TABLE `mfs_guild_thread` (
+ `thread_id` int(11) NOT NULL,
+ `guild_id` int(11) UNSIGNED NOT NULL DEFAULT '0',
+ `topic` varchar(255) NOT NULL DEFAULT '',
+ `author_name` varchar(32) NOT NULL DEFAULT '',
+ `last_post_date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
+ `post_count` int(11) UNSIGNED NOT NULL DEFAULT '0'
+) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+
+-- --------------------------------------------------------
+
+--
+-- Structure de la table `mfs_guild_thread_message`
+--
+
+CREATE TABLE `mfs_guild_thread_message` (
+ `id` int(11) NOT NULL,
+ `thread_id` int(11) UNSIGNED NOT NULL DEFAULT '0',
+ `author_name` varchar(32) NOT NULL DEFAULT '',
+ `date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
+ `content` text NOT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+
+-- --------------------------------------------------------
+
+--
+-- Structure de la table `mfs_mail`
+--
+
+CREATE TABLE `mfs_mail` (
+ `id` int(11) NOT NULL,
+ `sender_name` varchar(32) NOT NULL DEFAULT '',
+ `subject` varchar(250) NOT NULL DEFAULT '',
+ `date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
+ `status` enum('ms_new','ms_read','ms_erased') NOT NULL DEFAULT 'ms_new',
+ `dest_char_id` int(11) UNSIGNED NOT NULL DEFAULT '0',
+ `erase_series` int(11) UNSIGNED NOT NULL DEFAULT '0',
+ `content` text NOT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+
+-- --------------------------------------------------------
+
+--
+-- Structure de la table `player_rating`
+--
+
+CREATE TABLE `player_rating` (
+ `Id` int(10) UNSIGNED NOT NULL,
+ `session_id` int(10) UNSIGNED NOT NULL DEFAULT '0',
+ `author` int(10) UNSIGNED NOT NULL DEFAULT '0',
+ `rating` int(10) NOT NULL DEFAULT '0',
+ `comments` text NOT NULL,
+ `time_stamp` datetime NOT NULL DEFAULT '2005-09-07 12:41:33'
+) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+
+-- --------------------------------------------------------
+
+--
+-- Structure de la table `ring_users`
+--
+
+CREATE TABLE `ring_users` (
+ `user_id` int(10) UNSIGNED NOT NULL DEFAULT '0',
+ `user_name` varchar(20) NOT NULL DEFAULT '',
+ `user_type` enum('ut_character','ut_pioneer') NOT NULL DEFAULT 'ut_character',
+ `current_char` varchar(255) NOT NULL DEFAULT '',
+ `current_session` int(10) UNSIGNED NOT NULL DEFAULT '0',
+ `current_activity` enum('ca_none','ca_play','ca_edit','ca_anim') NOT NULL DEFAULT 'ca_none',
+ `current_status` enum('cs_offline','cs_logged','cs_online') NOT NULL DEFAULT 'cs_offline',
+ `public_level` varchar(255) NOT NULL DEFAULT 'pl_none',
+ `account_type` enum('at_normal','at_gold') NOT NULL DEFAULT 'at_normal',
+ `content_access_level` varchar(20) NOT NULL DEFAULT '',
+ `description` text,
+ `lang` enum('lang_en','lang_fr','lang_de') NOT NULL DEFAULT 'lang_en',
+ `cookie` varchar(30) NOT NULL DEFAULT '',
+ `current_domain_id` int(10) NOT NULL DEFAULT '-1',
+ `pioneer_char_id` int(11) UNSIGNED NOT NULL DEFAULT '0',
+ `add_privileges` varchar(255) NOT NULL DEFAULT ''
+) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+
+-- --------------------------------------------------------
+
+--
+-- Structure de la table `scenario_desc`
+--
+
+CREATE TABLE `scenario_desc` (
+ `session_id` int(10) UNSIGNED NOT NULL DEFAULT '0',
+ `parent_scenario` int(10) UNSIGNED NOT NULL DEFAULT '0',
+ `description` text NOT NULL,
+ `relation_to_parent` enum('rtp_same','rtp_variant','rtp_different') NOT NULL DEFAULT 'rtp_same',
+ `title` varchar(40) NOT NULL DEFAULT '',
+ `num_player` int(10) UNSIGNED NOT NULL DEFAULT '0',
+ `content_access_level` varchar(20) NOT NULL DEFAULT ''
+) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+
+-- --------------------------------------------------------
+
+--
+-- Structure de la table `sessions`
+--
+
+CREATE TABLE `sessions` (
+ `session_id` int(10) UNSIGNED NOT NULL,
+ `session_type` enum('st_edit','st_anim','st_outland','st_mainland') NOT NULL DEFAULT 'st_edit',
+ `title` varchar(40) NOT NULL DEFAULT '',
+ `owner` int(10) UNSIGNED NOT NULL DEFAULT '0',
+ `plan_date` datetime NOT NULL DEFAULT '2005-09-21 12:41:33',
+ `start_date` datetime NOT NULL DEFAULT '2005-08-31 00:00:00',
+ `description` text NOT NULL,
+ `orientation` enum('so_newbie_training','so_story_telling','so_mistery','so_hack_slash','so_guild_training','so_other') NOT NULL DEFAULT 'so_other',
+ `level` enum('sl_a','sl_b','sl_c','sl_d','sl_e','sl_f') NOT NULL DEFAULT 'sl_a',
+ `rule_type` enum('rt_strict','rt_liberal') NOT NULL DEFAULT 'rt_strict',
+ `access_type` enum('at_public','at_private') NOT NULL DEFAULT 'at_private',
+ `state` enum('ss_planned','ss_open','ss_locked','ss_closed') NOT NULL DEFAULT 'ss_planned',
+ `host_shard_id` int(11) NOT NULL DEFAULT '0',
+ `subscription_slots` int(11) UNSIGNED NOT NULL DEFAULT '0',
+ `reserved_slots` int(10) UNSIGNED NOT NULL DEFAULT '0',
+ `free_slots` int(10) UNSIGNED NOT NULL DEFAULT '0',
+ `estimated_duration` enum('et_short','et_medium','et_long') NOT NULL DEFAULT 'et_short',
+ `final_duration` int(10) UNSIGNED NOT NULL DEFAULT '0',
+ `folder_id` int(10) UNSIGNED NOT NULL DEFAULT '0',
+ `lang` varchar(20) NOT NULL DEFAULT '',
+ `icone` varchar(70) NOT NULL DEFAULT '',
+ `anim_mode` enum('am_dm','am_autonomous') NOT NULL DEFAULT 'am_dm',
+ `race_filter` set('rf_fyros','rf_matis','rf_tryker','rf_zorai') NOT NULL DEFAULT '',
+ `religion_filter` set('rf_kami','rf_karavan','rf_neutral') NOT NULL DEFAULT '',
+ `guild_filter` enum('gf_only_my_guild','gf_any_player') DEFAULT 'gf_only_my_guild',
+ `shard_filter` set('sf_shard00','sf_shard01','sf_shard02','sf_shard03','sf_shard04','sf_shard05','sf_shard06','sf_shard07','sf_shard08','sf_shard09','sf_shard10','sf_shard11','sf_shard12','sf_shard13','sf_shard14','sf_shard15','sf_shard16','sf_shard17','sf_shard18','sf_shard19','sf_shard20','sf_shard21','sf_shard22','sf_shard23','sf_shard24','sf_shard25','sf_shard26','sf_shard27','sf_shard28','sf_shard29','sf_shard30','sf_shard31') NOT NULL DEFAULT 'sf_shard00,sf_shard01,sf_shard02,sf_shard03,sf_shard04,sf_shard05,sf_shard06,sf_shard07,sf_shard08,sf_shard09,sf_shard10,sf_shard11,sf_shard12,sf_shard13,sf_shard14,sf_shard15,sf_shard16,sf_shard17,sf_shard18,sf_shard19,sf_shard20,sf_shard21,sf_shard22,sf_shard23,sf_shard24,sf_shard25,sf_shard26,sf_shard27,sf_shard28,sf_shard29,sf_shard30,sf_shard31',
+ `level_filter` set('lf_a','lf_b','lf_c','lf_d','lf_e','lf_f') NOT NULL DEFAULT 'lf_a,lf_b,lf_c,lf_d,lf_e,lf_f',
+ `subscription_closed` tinyint(1) NOT NULL DEFAULT '0',
+ `newcomer` tinyint(1) UNSIGNED ZEROFILL NOT NULL DEFAULT '0'
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC;
+
+-- --------------------------------------------------------
+
+--
+-- Structure de la table `session_participant`
+--
+
+CREATE TABLE `session_participant` (
+ `Id` int(10) UNSIGNED NOT NULL,
+ `session_id` int(10) UNSIGNED NOT NULL DEFAULT '0',
+ `char_id` int(10) UNSIGNED NOT NULL DEFAULT '0',
+ `status` enum('sps_play_subscribed','sps_play_invited','sps_edit_invited','sps_anim_invited','sps_playing','sps_editing','sps_animating') NOT NULL DEFAULT 'sps_play_subscribed',
+ `kicked` tinyint(1) UNSIGNED NOT NULL DEFAULT '0',
+ `session_rated` tinyint(1) UNSIGNED NOT NULL DEFAULT '0'
+) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+
+-- --------------------------------------------------------
+
+--
+-- Structure de la table `shard`
+--
+
+CREATE TABLE `shard` (
+ `shard_id` int(10) NOT NULL DEFAULT '0',
+ `WSOnline` tinyint(1) NOT NULL DEFAULT '0',
+ `MOTD` text NOT NULL,
+ `OldState` enum('ds_close','ds_dev','ds_restricted','ds_open') NOT NULL DEFAULT 'ds_restricted',
+ `RequiredState` enum('ds_close','ds_dev','ds_restricted','ds_open') NOT NULL DEFAULT 'ds_dev'
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 ROW_FORMAT=FIXED;
+
+--
+-- Index pour les tables déchargées
+--
+
+--
+-- Index pour la table `characters`
+--
+ALTER TABLE `characters`
+ ADD PRIMARY KEY (`char_id`),
+ ADD UNIQUE KEY `char_name_idx` (`char_name`,`home_mainland_session_id`),
+ ADD KEY `user_id_idx` (`user_id`),
+ ADD KEY `guild_idx` (`guild_id`),
+ ADD KEY `guild_id_idx` (`guild_id`);
+
+--
+-- Index pour la table `folder`
+--
+ALTER TABLE `folder`
+ ADD PRIMARY KEY (`Id`),
+ ADD KEY `owner_idx` (`owner`),
+ ADD KEY `title_idx` (`title`);
+
+--
+-- Index pour la table `folder_access`
+--
+ALTER TABLE `folder_access`
+ ADD PRIMARY KEY (`Id`),
+ ADD KEY `folder_id_idx` (`folder_id`),
+ ADD KEY `user_idx` (`user_id`);
+
+--
+-- Index pour la table `guilds`
+--
+ALTER TABLE `guilds`
+ ADD PRIMARY KEY (`guild_id`),
+ ADD UNIQUE KEY `huild_name_idx` (`guild_name`),
+ ADD KEY `shard_id_idx` (`shard_id`);
+
+--
+-- Index pour la table `guild_invites`
+--
+ALTER TABLE `guild_invites`
+ ADD PRIMARY KEY (`Id`),
+ ADD KEY `guild_id_idx` (`guild_id`),
+ ADD KEY `session_id_idx` (`session_id`);
+
+--
+-- Index pour la table `journal_entry`
+--
+ALTER TABLE `journal_entry`
+ ADD PRIMARY KEY (`Id`),
+ ADD KEY `session_id_idx` (`session_id`);
+
+--
+-- Index pour la table `known_users`
+--
+ALTER TABLE `known_users`
+ ADD PRIMARY KEY (`Id`),
+ ADD KEY `user_index` (`owner`);
+
+--
+-- Index pour la table `mfs_erased_mail_series`
+--
+ALTER TABLE `mfs_erased_mail_series`
+ ADD PRIMARY KEY (`erased_series`);
+
+--
+-- Index pour la table `mfs_guild_thread`
+--
+ALTER TABLE `mfs_guild_thread`
+ ADD PRIMARY KEY (`thread_id`),
+ ADD KEY `guild_index` (`guild_id`);
+
+--
+-- Index pour la table `mfs_guild_thread_message`
+--
+ALTER TABLE `mfs_guild_thread_message`
+ ADD PRIMARY KEY (`id`);
+
+--
+-- Index pour la table `mfs_mail`
+--
+ALTER TABLE `mfs_mail`
+ ADD PRIMARY KEY (`id`),
+ ADD KEY `dest_index` (`dest_char_id`);
+
+--
+-- Index pour la table `player_rating`
+--
+ALTER TABLE `player_rating`
+ ADD PRIMARY KEY (`Id`),
+ ADD KEY `session_id_idx` (`session_id`),
+ ADD KEY `author_idx` (`author`);
+
+--
+-- Index pour la table `ring_users`
+--
+ALTER TABLE `ring_users`
+ ADD PRIMARY KEY (`user_id`),
+ ADD UNIQUE KEY `user_name_idx` (`user_name`),
+ ADD KEY `cookie_idx` (`cookie`);
+
+--
+-- Index pour la table `scenario_desc`
+--
+ALTER TABLE `scenario_desc`
+ ADD PRIMARY KEY (`session_id`),
+ ADD UNIQUE KEY `title_idx` (`title`),
+ ADD KEY `parent_idx` (`parent_scenario`);
+
+--
+-- Index pour la table `sessions`
+--
+ALTER TABLE `sessions`
+ ADD PRIMARY KEY (`session_id`),
+ ADD KEY `owner_idx` (`owner`),
+ ADD KEY `folder_idx` (`folder_id`),
+ ADD KEY `state_type_idx` (`state`,`session_type`);
+
+--
+-- Index pour la table `session_participant`
+--
+ALTER TABLE `session_participant`
+ ADD PRIMARY KEY (`Id`),
+ ADD KEY `session_idx` (`session_id`),
+ ADD KEY `user_idx` (`char_id`);
+
+--
+-- Index pour la table `shard`
+--
+ALTER TABLE `shard`
+ ADD PRIMARY KEY (`shard_id`);
+
+--
+-- AUTO_INCREMENT pour les tables déchargées
+--
+
+--
+-- AUTO_INCREMENT pour la table `folder`
+--
+ALTER TABLE `folder`
+ MODIFY `Id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;
+
+--
+-- AUTO_INCREMENT pour la table `folder_access`
+--
+ALTER TABLE `folder_access`
+ MODIFY `Id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;
+
+--
+-- AUTO_INCREMENT pour la table `guild_invites`
+--
+ALTER TABLE `guild_invites`
+ MODIFY `Id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;
+
+--
+-- AUTO_INCREMENT pour la table `journal_entry`
+--
+ALTER TABLE `journal_entry`
+ MODIFY `Id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;
+
+--
+-- AUTO_INCREMENT pour la table `known_users`
+--
+ALTER TABLE `known_users`
+ MODIFY `Id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;
+
+--
+-- AUTO_INCREMENT pour la table `mfs_erased_mail_series`
+--
+ALTER TABLE `mfs_erased_mail_series`
+ MODIFY `erased_series` int(11) UNSIGNED NOT NULL AUTO_INCREMENT;
+
+--
+-- AUTO_INCREMENT pour la table `mfs_guild_thread`
+--
+ALTER TABLE `mfs_guild_thread`
+ MODIFY `thread_id` int(11) NOT NULL AUTO_INCREMENT;
+
+--
+-- AUTO_INCREMENT pour la table `mfs_guild_thread_message`
+--
+ALTER TABLE `mfs_guild_thread_message`
+ MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
+
+--
+-- AUTO_INCREMENT pour la table `mfs_mail`
+--
+ALTER TABLE `mfs_mail`
+ MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
+
+--
+-- AUTO_INCREMENT pour la table `player_rating`
+--
+ALTER TABLE `player_rating`
+ MODIFY `Id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;
+
+--
+-- AUTO_INCREMENT pour la table `sessions`
+--
+ALTER TABLE `sessions`
+ MODIFY `session_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;
+
+--
+-- AUTO_INCREMENT pour la table `session_participant`
+--
+ALTER TABLE `session_participant`
+ MODIFY `Id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;
+COMMIT;
+
+/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
+/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
+/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
diff --git a/ryzom/server/www/tools/broadcast.php b/ryzom/server/www/tools/broadcast.php
new file mode 100644
index 000000000..f9384a751
--- /dev/null
+++ b/ryzom/server/www/tools/broadcast.php
@@ -0,0 +1,39 @@
+
diff --git a/ryzom/server/www/tools/get_connected_players.php b/ryzom/server/www/tools/get_connected_players.php
new file mode 100644
index 000000000..bb0894ecf
--- /dev/null
+++ b/ryzom/server/www/tools/get_connected_players.php
@@ -0,0 +1,29 @@
+= 1) {
+ foreach ($data['parsed'] as $cid => $user) {
+ $name = explode('(', $user[2]);
+ $priv = substr($user[4], 2, strlen($user[4])-4);
+ if ($priv)
+ $priv_users[] = array($name[0], $priv);
+ else
+ $users[] = array($name[0]);
+ }
+ echo ''.count($priv_users).' Users with Privs
';
+ foreach($priv_users as $u)
+ echo ''.$u[0].'('.$u[1].') ';
+ echo '
'.count($users).' Users
';
+ foreach($users as $u)
+ echo $u[0].' ';
+ echo '';
+} else {
+ echo 'No players connected!';
+ exit(1);
+}
diff --git a/ryzom/server/www/tools/getfromshard.php b/ryzom/server/www/tools/getfromshard.php
new file mode 100644
index 000000000..3071f9254
--- /dev/null
+++ b/ryzom/server/www/tools/getfromshard.php
@@ -0,0 +1,14 @@
+ $id) {
+ $sid = explode(' ', $id);
+ if ($sid[0] == 'Player:') {
+ queryShard('egs', 'disconnectPlayer '.$sid[1], false);
+ echo $sid[3].' has been kicked!'."\n";
+ }
+ }
+ sendToChat('is killing all services...', '#pub-general', $ShardName, ':broken_heart:');
+ break;
+}
+
diff --git a/ryzom/server/www/tools/sendtoios.php b/ryzom/server/www/tools/sendtoios.php
new file mode 100644
index 000000000..3c6429a47
--- /dev/null
+++ b/ryzom/server/www/tools/sendtoios.php
@@ -0,0 +1,6 @@
+
diff --git a/ryzom/server/www/tools/utils.php b/ryzom/server/www/tools/utils.php
new file mode 100644
index 000000000..edaab0228
--- /dev/null
+++ b/ryzom/server/www/tools/utils.php
@@ -0,0 +1,34 @@
+ $channel,
+ 'username' => $username,
+ 'icon_emoji' => $icon,
+ 'text' => $message,
+ )
+ );
+ $ch = curl_init('https://'.$RocketChatServer.'/hooks/'.$RocketChatHook);
+ curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
+ curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
+ curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
+ $result = curl_exec($ch);
+ curl_close($ch);
+ return $result;
+ } else {
+ echo ''.$message.'
';
+ return true;
+ }
+}
+
+
+function shardLockAccess() {
+ global $ShardId;
+ @queryShard('su', 'rsm.setWSState '. $ShardId .' RESTRICTED ""');
+}
+