mirror of
https://port.numenaute.org/aleajactaest/khanat-opennel-code.git
synced 2024-12-21 16:38:43 +00:00
Use the correct ring database
This commit is contained in:
parent
49804e6d73
commit
22c1d33aa1
5 changed files with 12 additions and 11 deletions
|
@ -21,7 +21,6 @@ $DBName = $cfg['db']['shard']['name'];
|
|||
|
||||
$RingDBUserName = $cfg['db']['ring']['user'];
|
||||
$RingDBPassword = $cfg['db']['ring']['pass'];
|
||||
$RingDBName = $cfg['db']['ring']['name'];
|
||||
|
||||
// If true, the server will add automatically unknown user in the database
|
||||
// (in nel.user, nel.permission, ring.ring_user and ring.characters
|
||||
|
|
|
@ -16,10 +16,10 @@
|
|||
|
||||
$domainInfo = getDomainInfo($domainId);
|
||||
|
||||
global $DBHost, $RingDBUserName, $RingDBPassword, $RingDBName;
|
||||
global $DBHost, $RingDBUserName, $RingDBPassword;
|
||||
|
||||
$link = mysqli_connect($DBHost, $RingDBUserName, $RingDBPassword) or die ("Can't connect to database host:$DBHost user:$RingDBUserName");
|
||||
mysqli_select_db($link, $RingDBName) or die ("Can't access to the db dbname:$RingDBName");
|
||||
mysqli_select_db($link, $domainInfo['ring_db_name']) or die ("Can't access to the db dbname:" . $domainInfo['ring_db_name']);
|
||||
|
||||
// Find out if the character has an open editing session
|
||||
$query = "SELECT session_id, state ";
|
||||
|
|
|
@ -42,10 +42,10 @@
|
|||
if (isset($_POST["execute"]))
|
||||
{
|
||||
// lookup in the database to convert character name into
|
||||
global $DBHost, $RingDBUserName, $RingDBPassword, $RingDBName;
|
||||
global $DBHost, $RingDBUserName, $RingDBPassword;
|
||||
|
||||
$link = mysqli_connect($DBHost, $RingDBUserName, $RingDBPassword) or die ("Can't connect to database host:$DBHost user:$RingDBUserName");
|
||||
mysqli_select_db($link, $RingDBName) or die ("Can't access to the table dbname:$RingDBName");
|
||||
mysqli_select_db($link, $domainInfo['ring_db_name']) or die ("Can't access to the table dbname:" . $domainInfo['ring_db_name']);
|
||||
|
||||
// extract the character that have the specified name
|
||||
$charName = mysqli_real_escape_string($link, $_POST['charName']);
|
||||
|
|
|
@ -107,14 +107,14 @@ function inviteOwnerInSession($charId, $domainId, $sessionId)
|
|||
$RSMHost = $addr[0];
|
||||
$RSMPort = $addr[1];
|
||||
|
||||
global $rsmProxy, $rsmSkel, $userId, $charId, $callbackClient, $RingDBName, /*$SessionId,*/ $SessionToolsResult;
|
||||
global $rsmProxy, $rsmSkel, $userId, $charId, $callbackClient, /*$SessionId,*/ $SessionToolsResult;
|
||||
global $DBHost, $RingDBUserName, $RingDBPassword;
|
||||
|
||||
$SessionId = $sessionId;
|
||||
$DomainId = $domainId;
|
||||
|
||||
$link = mysqli_connect($DBHost, $RingDBUserName, $RingDBPassword) or die("Can't connect to ring database");
|
||||
mysqli_select_db($link, $RingDBName) or die ("Can't access to the db dbname:$RingDBName");
|
||||
mysqli_select_db($link, $domainInfo['ring_db_name']) or die ("Can't access to the db dbname:" . $domainInfo['ring_db_name']);
|
||||
|
||||
$sessionId = (int) $sessionId;
|
||||
$query = "select session_type from sessions where session_id=".$sessionId;
|
||||
|
@ -146,7 +146,7 @@ class StartSessionCb extends CRingSessionManagerWeb
|
|||
{
|
||||
function invokeResult($userId, $resultCode, $resultString)
|
||||
{
|
||||
global $rsmProxy, $rsmSkel, $userId, $charId, $callbackClient, $RingDBName, $SessionId, $DomainId, $SessionToolsResult;
|
||||
global $rsmProxy, $rsmSkel, $userId, $charId, $callbackClient, $SessionId, $DomainId, $SessionToolsResult;
|
||||
|
||||
if ($resultCode != 0)
|
||||
{
|
||||
|
@ -170,7 +170,7 @@ class InviteOwnerCb extends CRingSessionManagerWeb
|
|||
{
|
||||
function invokeResult($userId, $resultCode, $resultString)
|
||||
{
|
||||
global $rsmProxy, $rsmSkel, $userId, $charId, $callbackClient, $RingDBName, $SessionId, $DomainId, $SessionToolsResult;
|
||||
global $rsmProxy, $rsmSkel, $userId, $charId, $callbackClient, $SessionId, $DomainId, $SessionToolsResult;
|
||||
|
||||
// jump back to main page
|
||||
echo "<h1>The session ".$SessionId." have been started</h1>";
|
||||
|
|
|
@ -16,7 +16,9 @@
|
|||
|
||||
function validateCookie(&$userId, &$domainId, &$charId)
|
||||
{
|
||||
global $DBHost, $RingDBUserName, $RingDBPassword, $RingDBName, $AcceptUnknownUser;
|
||||
$domainInfo = getDomainInfo($domainId);
|
||||
|
||||
global $DBHost, $RingDBUserName, $RingDBPassword, $AcceptUnknownUser;
|
||||
|
||||
if (!isset($_COOKIE["ryzomId"]))
|
||||
{
|
||||
|
@ -41,7 +43,7 @@
|
|||
|
||||
// check the cookie in the database
|
||||
$link = mysqli_connect($DBHost, $RingDBUserName, $RingDBPassword) or die ("Can't connect to database host:$DBHost user:$RingDBUserName");
|
||||
mysqli_select_db($link, $RingDBName) or die ("Can't access to the table dbname:$RingDBName");
|
||||
mysqli_select_db($link, $domainInfo['ring_db_name']) or die ("Can't access to the table dbname:" . $domainInfo['ring_db_name']);
|
||||
|
||||
$cookie = mysqli_real_escape_string($link, $cookie);
|
||||
$query = "SELECT user_id, current_status, current_domain_id FROM ring_users where cookie='$cookie'";
|
||||
|
|
Loading…
Reference in a new issue