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