From a4a575d49e71da2c70f57876012a2acb4358037e Mon Sep 17 00:00:00 2001 From: Nimetu Date: Tue, 28 Jan 2014 00:47:13 +0200 Subject: [PATCH 01/14] Replace deprecated mysql functions with mysqli in login and ring scripts --- .../tools/server/www/login/client_install.php | 15 +-- .../ryzom/tools/server/www/login/r2_login.php | 111 +++++++++--------- .../tools/server/www/ring/edit_session.php | 31 ++--- .../tools/server/www/ring/invite_pioneer.php | 19 +-- .../tools/server/www/ring/join_shard.php | 14 ++- .../tools/server/www/ring/session_tools.php | 16 ++- .../tools/server/www/tools/domain_info.php | 17 +-- .../server/www/tools/validate_cookie.php | 18 +-- 8 files changed, 131 insertions(+), 110 deletions(-) diff --git a/code/ryzom/tools/server/www/login/client_install.php b/code/ryzom/tools/server/www/login/client_install.php index 4387387f1..db93f8caa 100644 --- a/code/ryzom/tools/server/www/login/client_install.php +++ b/code/ryzom/tools/server/www/login/client_install.php @@ -74,19 +74,21 @@ die2(); } $domainName = getPost("domain"); - $nelLink = mysql_connect($DBHost, $DBUserName, $DBPassword) or die2 (__FILE__. " " .__LINE__." Can't connect to database host:$DBHost user:$DBUserName"); - mysql_select_db ($DBName, $nelLink) or die2 (__FILE__. " " .__LINE__." Can't access to the table dbname:$DBName"); + $nelLink = mysqli_connect($DBHost, $DBUserName, $DBPassword) or die2 (__FILE__. " " .__LINE__." Can't connect to database host:$DBHost user:$DBUserName"); + mysqli_select_db ($nelLink, $DBName) or die2 (__FILE__. " " .__LINE__." Can't access to the table dbname:$DBName"); + + $domainName = mysqli_real_escape_string($nelLink, $domainName); $query = "SELECT backup_patch_url, patch_urls FROM domain WHERE domain_name='$domainName'"; - $result = mysql_query ($query, $nelLink) or die2 (__FILE__. " " .__LINE__." Can't execute the query: ".$query); + $result = mysqli_query ($nelLink, $query) or die2 (__FILE__. " " .__LINE__." Can't execute the query: ".$query); - if (mysql_num_rows($result) != 1) + if (mysqli_num_rows($result) != 1) { // unrecoverable error, we must giveup $reason = "Can't find domain '".$domainName."' (error code x)"; $res = false; } - $req = mysql_fetch_array($result); + $req = mysqli_fetch_array($result); $backup_patch_url = $req["backup_patch_url"]; $patch_urls = $req["patch_urls"]; @@ -114,7 +116,7 @@ } echo "\n"; - mysql_close($nelLink); + mysqli_close($nelLink); unset($nelLink); break; @@ -124,4 +126,3 @@ } -?> diff --git a/code/ryzom/tools/server/www/login/r2_login.php b/code/ryzom/tools/server/www/login/r2_login.php index c6a9de6f2..45f17a949 100644 --- a/code/ryzom/tools/server/www/login/r2_login.php +++ b/code/ryzom/tools/server/www/login/r2_login.php @@ -34,16 +34,16 @@ // gather the domain information (server version, patch urls and backup patch url global $DBHost, $DBUserName, $DBPassword, $DBName, $AutoInsertInRing; - $link = mysql_connect($DBHost, $DBUserName, $DBPassword) or die (errorMsgBlock(3004, 'main', $DBHost, $DBUserName)); - mysql_select_db ($DBName) or die (errorMsgBlock(3005, 'main', $DBName, $DBHost, $DBUserName)); + $link = mysqli_connect($DBHost, $DBUserName, $DBPassword) or die (errorMsgBlock(3004, 'main', $DBHost, $DBUserName)); + mysqli_select_db ($link, $DBName) or die (errorMsgBlock(3005, 'main', $DBName, $DBHost, $DBUserName)); $query = "SELECT * FROM domain WHERE domain_id=$domainId"; - $result = mysql_query ($query) or die (errorMsgBlock(3006, $query, 'main', $DBName, $DBHost, $DBUserName, mysql_error())); + $result = mysqli_query ($link, $query) or die (errorMsgBlock(3006, $query, 'main', $DBName, $DBHost, $DBUserName, mysqli_error($link))); - if( mysql_num_rows($result) != 1) + if( mysqli_num_rows($result) != 1) { die(errorMsgBlock(3001, $domainId)); } - $row = mysql_fetch_array($result); + $row = mysqli_fetch_array($result); // set the cookie setcookie ( "ryzomId" , $cookie, 0, "/"); @@ -178,27 +178,28 @@ { ////////////// Temporary code alpha 0 only ///////////////////////////////////// // check if the ring user exist, and create it if not - $ringDb = mysql_connect($DBHost, $RingDBUserName, $RingDBPassword) or die(errorMsgBlock(3004, 'Ring', $DBHost, $RingDBUserName)); - mysql_select_db ($domainInfo['ring_db_name'], $ringDb) or die(errorMsgBlock(3005, 'Ring', $domainInfo['ring_db_name'], $DBHost, $RingDBUserName)); + $ringDb = mysqli_connect($DBHost, $RingDBUserName, $RingDBPassword) or die(errorMsgBlock(3004, 'Ring', $DBHost, $RingDBUserName)); + mysqli_select_db ($ringDb, $domainInfo['ring_db_name']) or die(errorMsgBlock(3005, 'Ring', $domainInfo['ring_db_name'], $DBHost, $RingDBUserName)); $query = "SELECT user_id FROM ring_users where user_id = '".$id."'"; - $result = mysql_query ($query) or die(errorMsgBlock(3006, $query, 'Ring', $domainInfo['ring_db_name'], $DBHost, $RingDBUserName, mysql_error())); + $result = mysqli_query ($ringDb, $query) or die(errorMsgBlock(3006, $query, 'Ring', $domainInfo['ring_db_name'], $DBHost, $RingDBUserName, mysqli_error($ringDb))); - if (mysql_num_rows($result) == 0) + if (mysqli_num_rows($result) == 0) { // no ring user record, build one - $query = "INSERT INTO ring_users SET user_id = '".$id."', user_name = '".$_GET["login"]."', user_type='ut_pioneer'"; - $result = mysql_query ($query) or die(errorMsgBlock(3006, $query, 'Ring', $domainInfo['ring_db_name'], $DBHost, $RingDBUserName, mysql_error())); + $login = mysqli_real_escape_string($ringDb, $_GET['login']); + $query = "INSERT INTO ring_users SET user_id = '$id', user_name = '$login', user_type='ut_pioneer'"; + $result = mysqli_query ($ringDb, $query) or die(errorMsgBlock(3006, $query, 'Ring', $domainInfo['ring_db_name'], $DBHost, $RingDBUserName, mysqli_error($ringDb))); } // // check that there is a character record (deprecated) // $query = "SELECT user_id FROM characters where user_id = '".$id."'"; -// $result = mysql_query ($query) or die("Query ".$query." failed"); -// if (mysql_num_rows($result) == 0) +// $result = mysqli_query ($ringDb, $query) or die("Query ".$query." failed"); +// if (mysqli_num_rows($result) == 0) // { // // no characters record, build a default one // $charId = ($id * 16); // $query = "INSERT INTO characters SET char_id='".$charId."', char_name='".$_GET["login"]."_default', user_id = '".$id."'"; -// $result = mysql_query ($query) or die("Query ".$query." failed"); +// $result = mysqli_query ($ringDb, $query) or die("Query ".$query." failed"); // } } @@ -269,24 +270,25 @@ setMsgLanguage($lang); - // we map the client application to the domain name - $domainName = $clientApplication; + $link = mysqli_connect($DBHost, $DBUserName, $DBPassword) or die (errorMsgBlock(3004, 'main', $DBHost, $DBUserName)); + mysqli_select_db ($link, $DBName) or die (errorMsgBlock(3005, 'main', $DBName, $DBHost, $DBUserName)); + + // we map the client application to the domain name + $domainName = mysqli_real_escape_string($link, $clientApplication); - $link = mysql_connect($DBHost, $DBUserName, $DBPassword) or die (errorMsgBlock(3004, 'main', $DBHost, $DBUserName)); - mysql_select_db ($DBName) or die (errorMsgBlock(3005, 'main', $DBName, $DBHost, $DBUserName)); // retreive the domain id $query = "SELECT domain_id FROM domain WHERE domain_name='$domainName'"; - $result = mysql_query ($query) or die (errorMsgBlock(3006, $query, 'main', $DBName, $DBHost, $DBUserName, mysql_error())); + $result = mysqli_query ($link, $query) or die (errorMsgBlock(3006, $query, 'main', $DBName, $DBHost, $DBUserName, mysqli_error($link))); - if (mysql_num_rows($result) == 0) + if (mysqli_num_rows($result) == 0) { // unrecoverable error, we must giveup $reason = errorMsg(3007, $domainName); - mysql_close($link); + mysqli_close($link); return false; } - $row = mysql_fetch_array($result); + $row = mysqli_fetch_array($result); $domainId = $row[0]; // retreive the domain info @@ -296,32 +298,34 @@ $accessPriv = strtoupper(substr($domainInfo['status'], 3)); // now, retrieve the user infos + $login = mysqli_real_escape_string($link, $login); $query = "SELECT * FROM user where Login='$login'"; - $result = mysql_query ($query) or die (errorMsgBlock(3006, $query, 'main', $DBName, $DBHost, $DBUserName, mysql_error())); + $result = mysqli_query ($link, $query) or die (errorMsgBlock(3006, $query, 'main', $DBName, $DBHost, $DBUserName, mysqli_error($link))); - if (mysql_num_rows ($result) == 0) + if (mysqli_num_rows ($result) == 0) { if ($AcceptUnknownUser) { // login doesn't exist, create it + $password = mysqli_real_escape_string($link, $password); $query = "INSERT INTO user (Login, Password) VALUES ('$login', '$password')"; - $result = mysql_query ($query) or die (errorMsgBlock(3006, $query, 'main', $DBName, $DBHost, $DBUserName, mysql_error())); + $result = mysqli_query ($link, $query) or die (errorMsgBlock(3006, $query, 'main', $DBName, $DBHost, $DBUserName, mysqli_error($link))); // get the user to have his UId $query = "SELECT * FROM user WHERE Login='$login'"; - $result = mysql_query ($query) or die (errorMsgBlock(3006, $query, 'main', $DBName, $DBHost, $DBUserName, mysql_error())); + $result = mysqli_query ($link, $query) or die (errorMsgBlock(3006, $query, 'main', $DBName, $DBHost, $DBUserName, mysqli_error($link))); - if (mysql_num_rows ($result) == 1) + if (mysqli_num_rows ($result) == 1) { $reason = errorMsg(3008, $login); - $row = mysql_fetch_array ($result); + $row = mysqli_fetch_assoc ($result); $id = $row["UId"]; $priv = $row["Privilege"]; $extended = $row["ExtendedPrivilege"]; // add the default permission $query = "INSERT INTO permission (UId, ClientApplication, AccessPrivilege) VALUES ('$id', 'r2', '$accessPriv')"; - $result = mysql_query ($query) or die (errorMsgBlock(3006, $query, 'main', $DBName, $DBHost, $DBUserName, mysql_error())); + $result = mysqli_query ($link, $query) or die (errorMsgBlock(3006, $query, 'main', $DBName, $DBHost, $DBUserName, mysqli_error($link))); $res = false; } @@ -335,9 +339,9 @@ { // Check if this is not an unconfirmed account $query = "SELECT GamePassword, Email, Language FROM signup_data WHERE login='$login'"; - $result = mysql_query($query) or die (errorMsgBlock(3006, $query, 'main', $DBName, $DBHost, $DBUserName, mysql_error())); + $result = mysqli_query($link, $query) or die (errorMsgBlock(3006, $query, 'main', $DBName, $DBHost, $DBUserName, mysqli_error($link))); - if (mysql_num_rows($result) == 0) + if (mysqli_num_rows($result) == 0) { $reason = errorMsg(2001, $login, 'checkUserValidity'); $res = false; @@ -346,7 +350,7 @@ { // Check password to avoid revealing email address to third-party $passwordMatchedRow = false; - while ($row = mysql_fetch_array($result)) + while ($row = mysqli_fetch_assoc($result)) { $salt = substr($row['GamePassword'],0,2); if (($cp && $row['GamePassword'] == $password) || (!$cp && $row['GamePassword'] == crypt($password, $salt))) @@ -369,7 +373,7 @@ } else { - $row = mysql_fetch_array ($result); + $row = mysqli_fetch_assoc ($result); $salt = substr($row["Password"],0,2); if (($cp && $row["Password"] == $password) || (!$cp && $row["Password"] == crypt($password, $salt))) { @@ -377,15 +381,16 @@ $_GET['login'] = $row['Login']; // check if the user can use this application + $clientApplication = mysqli_real_escape_string($link, $clientApplication); $query = "SELECT * FROM permission WHERE UId='".$row["UId"]."' AND ClientApplication='$clientApplication'"; - $result = mysql_query ($query) or die (errorMsgBlock(3006, $query, 'main', $DBName, $DBHost, $DBUserName, mysql_error())); - if (mysql_num_rows ($result) == 0) + $result = mysqli_query ($link, $query) or die (errorMsgBlock(3006, $query, 'main', $DBName, $DBHost, $DBUserName, mysqli_error($link))); + if (mysqli_num_rows ($result) == 0) { if ($AcceptUnknownUser) { // add default permission $query = "INSERT INTO permission (UId, ClientApplication, ShardId, AccessPrivilege) VALUES ('".$row["UId"]."', '$clientApplication', -1, '$domainStatus')"; - $result = mysql_query ($query) or die (errorMsgBlock(3006, $query, 'main', $DBName, $DBHost, $DBUserName, mysql_error())); + $result = mysqli_query ($link, $query) or die (errorMsgBlock(3006, $query, 'main', $DBName, $DBHost, $DBUserName, mysqli_error($link))); $reason = errorMsg(3010); $res = false; @@ -400,7 +405,7 @@ else { // check that the access privilege for the domain - $permission = mysql_fetch_array($result); + $permission = mysqli_fetch_assoc($result); if (!strstr($permission['AccessPrivilege'], $accessPriv)) { @@ -409,7 +414,7 @@ { // set an additionnal privilege for this player $query = "UPDATE permission set AccessPrivilege='".$permission['AccessPrivilege'].",$accessPriv' WHERE prim=".$permission['prim']; - $result = mysql_query ($query) or die (errorMsgBlock(3006, $query, 'main', $DBName, $DBHost, $DBUserName, mysql_error())); + $result = mysqli_query ($link, $query) or die (errorMsgBlock(3006, $query, 'main', $DBName, $DBHost, $DBUserName, mysqli_error($link))); $reason = errorMsg(3012, $accessPriv); $res = false; @@ -435,10 +440,10 @@ // $reason = $reason."was just disconnected. Now you can retry the identification (error code 54)"; // // $query = "update shard set NbPlayers=NbPlayers-1 where ShardId=".$row["ShardId"]; -// $result = mysql_query ($query) or die ("Can't execute the query: '$query' errno:".mysql_errno().": ".mysql_error()); +// $result = mysqli_query ($link, $query) or die ("Can't execute the query: '$query' errno:".mysqli_errno($link).": ".mysqli_error($link)); // // $query = "update user set ShardId=-1, State='Offline' where UId=".$row["UId"]; -// $result = mysql_query ($query) or die ("Can't execute the query: '$query' errno:".mysql_errno().": ".mysql_error()); +// $result = mysqli_query ($link, $query) or die ("Can't execute the query: '$query' errno:".mysqli_errno($link).": ".mysqli_error($link)); // } // else // { @@ -462,7 +467,7 @@ $res = false; } } - mysql_close($link); + mysqli_close($link); return $res; } @@ -474,13 +479,14 @@ setMsgLanguage($lang); - $link = mysql_connect($DBHost, $DBUserName, $DBPassword) or die (errorMsgBlock(3004, 'main', $DBHost, $DBUserName)); - mysql_select_db ($DBName) or die (errorMsgBlock(3005, 'main', $DBName, $DBHost, $DBUserName)); + $link = mysqli_connect($DBHost, $DBUserName, $DBPassword) or die (errorMsgBlock(3004, 'main', $DBHost, $DBUserName)); + mysqli_select_db ($link, $DBName) or die (errorMsgBlock(3005, 'main', $DBName, $DBHost, $DBUserName)); + $login = mysqli_real_escape_string($link, $login); $query = "SELECT Password FROM user WHERE Login='$login'"; - $result = mysql_query ($query) or die (errorMsgBlock(3006, $query, 'main', $DBName, $DBHost, $DBUserName, mysql_error())); + $result = mysqli_query ($link, $query) or die (errorMsgBlock(3006, $query, 'main', $DBName, $DBHost, $DBUserName, mysqli_error($link))); - if (mysql_num_rows ($result) != 1) + if (mysqli_num_rows ($result) != 1) { if ($AcceptUnknownUser) { @@ -492,17 +498,17 @@ { // Check if this is not an unconfirmed account $query = "SELECT GamePassword, Language FROM signup_data WHERE login='$login'"; - $result = mysql_query($query) or die (errorMsgBlock(3006, $query, 'main', $DBName, $DBHost, $DBUserName, mysql_error())); + $result = mysqli_query($link, $query) or die (errorMsgBlock(3006, $query, 'main', $DBName, $DBHost, $DBUserName, mysqli_error($link))); - if (mysql_num_rows($result) == 0) + if (mysqli_num_rows($result) == 0) { // no user record, reject it die (errorMsgBlock(2001, $login, 'askSalt')); } - else if (mysql_num_rows($result) == 1) + else if (mysqli_num_rows($result) == 1) { // one unconfirmed record, let the client send the encrypted password to get the corresponding email address - $row = mysql_fetch_array($result); + $row = mysqli_fetch_assoc($result); $salt = substr($row['GamePassword'], 0, 2); } else @@ -511,7 +517,7 @@ { // several matching records => display a multi-language message now $languages = array(); - while ($row = mysql_fetch_array($result)) + while ($row = mysqli_fetch_assoc($result)) { $languages[$row['Language']] = true; } @@ -523,12 +529,11 @@ } else { - $res_array = mysql_fetch_array($result); + $res_array = mysqli_fetch_assoc($result); $salt = substr($res_array['Password'], 0, 2); } echo "1:".$salt; - mysql_close($link); + mysqli_close($link); } -?> diff --git a/code/ryzom/tools/server/www/ring/edit_session.php b/code/ryzom/tools/server/www/ring/edit_session.php index c782a408d..e567f2296 100644 --- a/code/ryzom/tools/server/www/ring/edit_session.php +++ b/code/ryzom/tools/server/www/ring/edit_session.php @@ -16,9 +16,10 @@ $domainInfo = getDomainInfo($domainId); - global $DBHost, $DBUserName, $DBPassword, $DBName, $RingDBName; - $link = mysql_connect($DBHost, $DBUserName, $DBPassword) or die ("Can't connect to database host:$DBHost user:$DBUserName"); - mysql_select_db ($RingDBName) or die ("Can't access to the db dbname:$RingDBName"); + global $DBHost, $RingDBUserName, $RingDBPassword, $RingDBName; + + $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"); // Find out if the character has an open editing session $query = "SELECT session_id, state "; @@ -26,8 +27,8 @@ $query .= " WHERE (owner = '".$charId."')"; $query .= " AND (session_type = 'st_edit')"; $query .= " AND (NOT (state IN ('ss_closed', 'ss_locked')))"; - $result = mysql_query ($query) or die ("Can't execute the query: ".$query); - $num = mysql_num_rows ($result); + $result = mysqli_query($link, $query) or die ("Can't execute the query: ".$query); + $num = mysqli_num_rows($result); if ($num > 1) { echo "Error: more than one editing sessions for char".$charId; @@ -39,11 +40,14 @@ { // Not found => first, create an editing session for this character, start the session and invite himself $query = "SELECT char_name FROM characters WHERE char_id = $charId"; - $result = mysql_query ($query) or die ("Can't execute the query: ".$query); - $num = mysql_num_rows ($result); + $result = mysqli_query($link, $query) or die ("Can't execute the query: ".$query); + $num = mysqli_num_rows($result); $characterName = ""; if ($num > 0) - $characterName = mysql_result($result, 0, 0); + { + $row = mysqli_fetch_assoc($result); + $characterName = $row['char_name']; + } global $SessionId, $SessionToolsResult; planEditSession($charId, $domainId, "st_edit", $characterName, ""); if ($SessionToolsResult === false) @@ -55,7 +59,7 @@ } else { - $row = mysql_fetch_array($result); + $row = mysqli_fetch_assoc($result); $sessionId = $row['session_id']; $state = $row['state']; echo "Found your session: $sessionId ($state)
"; @@ -73,13 +77,12 @@ } // check that we character have a participation in the session and invite him if needed - mysql_select_db ($RingDBName) or die ("Can't access to the db dbname:$RingDBName"); $query = "SELECT count(*) FROM session_participant WHERE session_id = $sessionId AND char_id = $charId"; - $result = mysql_query ($query) or die ("Can't execute the query: ".$query); - $num = mysql_num_rows ($result); + $result = mysqli_query($link, $query) or die ("Can't execute the query: ".$query); + $num = mysqli_num_rows($result); if ($num != 1) die ("Invalid result whil checking participation for char $charId in session $sessionId
"); - $value = mysql_fetch_array($result); + $value = mysqli_fetch_row($result); if ($value[0] == 0) { // the character have not is own invitation ! @@ -91,4 +94,4 @@ // Join the session joinSessionFromId($userId, $domainId, $sessionId); -?> + diff --git a/code/ryzom/tools/server/www/ring/invite_pioneer.php b/code/ryzom/tools/server/www/ring/invite_pioneer.php index b86ca5c9a..44cd83349 100644 --- a/code/ryzom/tools/server/www/ring/invite_pioneer.php +++ b/code/ryzom/tools/server/www/ring/invite_pioneer.php @@ -42,24 +42,25 @@ if (isset($_POST["execute"])) { // lookup in the database to convert character name into - global $DBHost, $DBUserName, $DBPassword, $RingDBName; + global $DBHost, $RingDBUserName, $RingDBPassword, $RingDBName; - $link = mysql_connect($DBHost, $DBUserName, $DBPassword) or die ("Can't connect to database host:$DBHost user:$DBUserName"); - mysql_select_db ($RingDBName) or die ("Can't access to the table dbname:$RingDBName"); + $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"); // extract the character that have the specified name - $query = "select * from characters where char_name = '".$_POST["charName"]."'"; - $result = mysql_query ($query) or die ("Can't execute the query: ".$query); + $charName = mysqli_real_escape_string($link, $_POST['charName']); + $query = "select char_id, char_name from characters where char_name = '$charName'"; + $result = mysqli_query($link, $query) or die ("Can't execute the query: ".$query); - if (mysql_num_rows ($result) == 0) + if (mysqli_num_rows($result) == 0) { echo "

Can't find the character ".$_POST["charName"]."

"; } else { - $row = mysql_fetch_row($result); - $currentSession = $row[0]; - $currentchar = $row[1]; + $row = mysqli_fetch_assoc($result); + $currentSession = $row['char_id']; + $currentchar = $row['char_name']; // send the invitation info to the session manager $invitePioneer = new InvitePioneerCb; diff --git a/code/ryzom/tools/server/www/ring/join_shard.php b/code/ryzom/tools/server/www/ring/join_shard.php index e5fcdffeb..4fc798fab 100644 --- a/code/ryzom/tools/server/www/ring/join_shard.php +++ b/code/ryzom/tools/server/www/ring/join_shard.php @@ -184,13 +184,17 @@ function displayAllShards(&$onlineShardsBySessionId) } // 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"); + global $DBName, $DBHost, $DBUserName, $DBPassword; + $link = mysqli_connect($DBHost, $DBUserName, $DBPassword) or die("Can't connect to nel database"); + mysqli_select_db($link, $DBName) or die ("Can't access to the db dbname:$DBName"); + + $domainId = (int) $domainId; $query = "select * from shard where domain_id = $domainId"; - $resShards = mysql_query ($query) or die ("Can't execute the query: ".$query." ".mysql_error()); + $resShards = mysqli_query($link, $query) or die ("Can't execute the query: ".$query." ".mysqli_error($link)); + echo "Select a shard to join:
"; //echo "
"; - while ($rowShard = mysql_fetch_array($resShards)) + while ($rowShard = mysqli_fetch_assoc($resShards)) { $mainlandSessionId = $rowShard['FixedSessionId']; $isOnline = isset($onlineShardsBySessionId[$mainlandSessionId]); @@ -245,4 +249,4 @@ function joinMainland($userId, $domainId) global $FSHostResult; return $FSHostResult; } -?> \ No newline at end of file + diff --git a/code/ryzom/tools/server/www/ring/session_tools.php b/code/ryzom/tools/server/www/ring/session_tools.php index 5b762ec88..de6900727 100644 --- a/code/ryzom/tools/server/www/ring/session_tools.php +++ b/code/ryzom/tools/server/www/ring/session_tools.php @@ -108,19 +108,23 @@ function inviteOwnerInSession($charId, $domainId, $sessionId) $RSMPort = $addr[1]; global $rsmProxy, $rsmSkel, $userId, $charId, $callbackClient, $RingDBName, /*$SessionId,*/ $SessionToolsResult; + global $DBHost, $RingDBUserName, $RingDBPassword; $SessionId = $sessionId; $DomainId = $domainId; - - mysql_select_db ($RingDBName) or die ("Can't access to the db dbname:$RingDBName"); + + $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"); + + $sessionId = (int) $sessionId; $query = "select session_type from sessions where session_id=".$sessionId; - $result = mysql_query ($query) or die ("Can't execute the query: ".$query); - if (mysql_num_rows ($result) != 1) + $result = mysqli_query($link, $query) or die ("Can't execute the query: ".$query); + if (mysqli_num_rows($result) != 1) { echo "Can't find 1 row for ring session ".$sessionId."
"; die(); } - $row = mysql_fetch_row($result); + $row = mysqli_fetch_row($result); $session_type = $row[0]; $mode = ($session_type == "st_edit") ? "sps_edit_invited" : "sps_anim_invited"; echo "Inviting character ".$charId." of user ".$userId." in session ".$sessionId."
"; @@ -184,4 +188,4 @@ class InviteOwnerCb extends CRingSessionManagerWeb echo '

Back to menu'; } } -?> \ No newline at end of file + diff --git a/code/ryzom/tools/server/www/tools/domain_info.php b/code/ryzom/tools/server/www/tools/domain_info.php index 40b07b08c..afed3949e 100644 --- a/code/ryzom/tools/server/www/tools/domain_info.php +++ b/code/ryzom/tools/server/www/tools/domain_info.php @@ -6,19 +6,20 @@ { global $DBHost, $DBUserName, $DBPassword, $DBName; - $nelDb = mysql_connect($DBHost, $DBUserName, $DBPassword) or die("can't connect to nel db"); - mysql_select_db ($DBName, $nelDb) or die("can't select nel db"); - $query = "SELECT * FROM domain WHERE domain_id = '".$domainId."'"; - $result = mysql_query ($query) or die("query ".$query." failed"); + $link = mysqli_connect($DBHost, $DBUserName, $DBPassword) or die("can't connect to nel db"); + mysqli_select_db ($link, $DBName) or die("can't select nel db"); + + $domainId = (int)$domainId; + $query = "SELECT * FROM domain WHERE domain_id = $domainId"; + $result = mysqli_query($link, $query) or die("query ($query) failed"); - if (mysql_num_rows($result) == 0) + if (mysqli_num_rows($result) == 0) { die("Can't find row for domain ".$domainId); } - $domainInfo = mysql_fetch_array($result); + $domainInfo = mysqli_fetch_array($result); return $domainInfo; } - -?> \ No newline at end of file + diff --git a/code/ryzom/tools/server/www/tools/validate_cookie.php b/code/ryzom/tools/server/www/tools/validate_cookie.php index 53ccf7d7c..edea9904e 100644 --- a/code/ryzom/tools/server/www/tools/validate_cookie.php +++ b/code/ryzom/tools/server/www/tools/validate_cookie.php @@ -16,7 +16,7 @@ function validateCookie(&$userId, &$domainId, &$charId) { - global $DBHost, $DBUserName, $DBPassword, $DBName, $RingDBName, $AcceptUnknownUser; + global $DBHost, $RingDBUserName, $RingDBPassword, $RingDBName, $AcceptUnknownUser; if (!isset($_COOKIE["ryzomId"])) { @@ -40,18 +40,20 @@ } // check the cookie in the database - $link = mysql_connect($DBHost, $DBUserName, $DBPassword) or die ("Can't connect to database host:$DBHost user:$DBUserName"); - mysql_select_db ($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 = mysql_query ($query) or die ("Can't execute the query: ".$query); + $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"); - if (mysql_num_rows ($result) == 0) + $cookie = mysqli_real_escape_string($link, $cookie); + $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 = mysql_fetch_array($result); + $row = mysqli_fetch_assoc($result); if ($row["current_status"] != "cs_logged" && $row["current_status"] != "cs_online" ) { @@ -77,4 +79,4 @@ else return 0; // temp dev: use 0 as the "ring character" } -?> \ No newline at end of file + From a8cabc90d1292c3e972f18d85bd42f77bb3b4ea6 Mon Sep 17 00:00:00 2001 From: botanic Date: Tue, 28 Jan 2014 11:41:26 -0800 Subject: [PATCH 02/14] Fixed typo issue 60 --- code/nel/src/gui/group_html.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/code/nel/src/gui/group_html.cpp b/code/nel/src/gui/group_html.cpp index 1d82292b0..d0fcd050e 100644 --- a/code/nel/src/gui/group_html.cpp +++ b/code/nel/src/gui/group_html.cpp @@ -4104,7 +4104,8 @@ namespace NLGUI { setTitle(_TitlePrefix); } - } + } + } // *************************************************************************** From 2fe67e96e4c98529b6ef2880c5e407c68071e437 Mon Sep 17 00:00:00 2001 From: kervala Date: Wed, 29 Jan 2014 13:06:22 +0100 Subject: [PATCH 03/14] Fixed: Don't set CMAKE_OSX_DEPLOYMENT_TARGET anymore by default, only use that if you need --- code/CMakeLists.txt | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/code/CMakeLists.txt b/code/CMakeLists.txt index 926d28345..b608fe082 100644 --- a/code/CMakeLists.txt +++ b/code/CMakeLists.txt @@ -41,10 +41,8 @@ INCLUDE(${CMAKE_ROOT}/Modules/Documentation.cmake OPTIONAL) # Force out of source builds. CHECK_OUT_OF_SOURCE() -# Specify Mac OS X deployment target before including Darwin.cmake -IF(NOT CMAKE_OSX_DEPLOYMENT_TARGET) - SET(CMAKE_OSX_DEPLOYMENT_TARGET "10.6") -ENDIF(NOT CMAKE_OSX_DEPLOYMENT_TARGET) +# To be able to specify a different deployment target on Mac OS X, specify : +# -DCMAKE_OSX_DEPLOYMENT_TARGET=10.6 -DCMAKE_OSX_SYSROOT=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk CMAKE_MINIMUM_REQUIRED(VERSION 2.6) PROJECT(RyzomCore CXX C) From 37d36e0ab5f7127cff277e0c60268bbdc0c2353f Mon Sep 17 00:00:00 2001 From: kervala Date: Thu, 30 Jan 2014 14:43:51 +0100 Subject: [PATCH 04/14] Fixed: Compilation under Mac OS X 10.9 --- code/CMakeModules/nel.cmake | 8 ++++++-- code/nel/include/nel/misc/variable.h | 4 ++-- code/ryzom/client/src/CMakeLists.txt | 4 ---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/code/CMakeModules/nel.cmake b/code/CMakeModules/nel.cmake index c75e2e580..ad6fbb2ae 100644 --- a/code/CMakeModules/nel.cmake +++ b/code/CMakeModules/nel.cmake @@ -786,11 +786,15 @@ MACRO(NL_SETUP_BUILD) ADD_PLATFORM_FLAGS("${XARCH}-isysroot${CMAKE_IOS_SIMULATOR_SYSROOT}") ADD_PLATFORM_FLAGS("${XARCH}-mios-simulator-version-min=${IOS_VERSION}") - SET(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} ${XARCH}-Wl,-macosx_version_min,${CMAKE_OSX_DEPLOYMENT_TARGET}") + IF(CMAKE_OSX_DEPLOYMENT_TARGET) + SET(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} ${XARCH}-Wl,-macosx_version_min,${CMAKE_OSX_DEPLOYMENT_TARGET}") + ENDIF(CMAKE_OSX_DEPLOYMENT_TARGET) ENDIF(CMAKE_IOS_SIMULATOR_SYSROOT AND TARGET_X86) ELSE(IOS) # Always force -mmacosx-version-min to override environement variable - SET(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -Wl,-macosx_version_min,${CMAKE_OSX_DEPLOYMENT_TARGET}") + IF(CMAKE_OSX_DEPLOYMENT_TARGET) + SET(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -Wl,-macosx_version_min,${CMAKE_OSX_DEPLOYMENT_TARGET}") + ENDIF(CMAKE_OSX_DEPLOYMENT_TARGET) ENDIF(IOS) SET(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -Wl,-headerpad_max_install_names") diff --git a/code/nel/include/nel/misc/variable.h b/code/nel/include/nel/misc/variable.h index 80528a928..fa4ccd19c 100644 --- a/code/nel/include/nel/misc/variable.h +++ b/code/nel/include/nel/misc/variable.h @@ -316,14 +316,14 @@ public: // output the oldest part of the buffer first for (uint i=_Mean.getCurrentFrame(); i<_Mean.getNumFrame(); ++i) { - str << _Mean.getLastFrames()[i]; + str << (T)_Mean.getLastFrames()[i]; if (i < _Mean.getNumFrame()-1 || _Mean.getCurrentFrame() != 0) str << ","; } // then output the newest part for (uint i = 0; i < _Mean.getCurrentFrame(); i++) { - str << _Mean.getLastFrames()[i]; + str << (T)_Mean.getLastFrames()[i]; if (i < _Mean.getCurrentFrame()-1) str << ","; } diff --git a/code/ryzom/client/src/CMakeLists.txt b/code/ryzom/client/src/CMakeLists.txt index 6a08a5e76..324735ff8 100644 --- a/code/ryzom/client/src/CMakeLists.txt +++ b/code/ryzom/client/src/CMakeLists.txt @@ -47,10 +47,6 @@ SOURCE_GROUP("r2" FILES ${SRC_R2}) # on Mac, create a .App Bundle if(APPLE) - IF(NOT CMAKE_OSX_DEPLOYMENT_TARGET) - SET(CMAKE_OSX_DEPLOYMENT_TARGET "10.6") - ENDIF(NOT CMAKE_OSX_DEPLOYMENT_TARGET) - SET(MACOSX_BUNDLE_INFO_STRING "Ryzom Core Client") SET(MACOSX_BUNDLE_ICON_FILE "ryzom.icns") SET(MACOSX_BUNDLE_GUI_IDENTIFIER "") From 62e62d2e72e96f1c7bfefee42fb7dfdc85229458 Mon Sep 17 00:00:00 2001 From: kervala Date: Thu, 30 Jan 2014 16:14:25 +0100 Subject: [PATCH 05/14] Fixed: Compilation under Mac OS X 10.9 (new libc++ tr1 namespace is std not std::tr1) --- code/nel/include/nel/misc/types_nl.h | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/code/nel/include/nel/misc/types_nl.h b/code/nel/include/nel/misc/types_nl.h index ce9d88bae..5c3b80475 100644 --- a/code/nel/include/nel/misc/types_nl.h +++ b/code/nel/include/nel/misc/types_nl.h @@ -90,6 +90,7 @@ # if defined(_HAS_TR1) && (_HAS_TR1 + 0) // VC9 TR1 feature pack or later # define NL_ISO_STDTR1_AVAILABLE # define NL_ISO_STDTR1_HEADER(header)

+# define NL_ISO_STDTR1_NAMESPACE std::tr1 # endif # ifdef _DEBUG # define NL_DEBUG @@ -153,8 +154,16 @@ #ifdef NL_COMP_GCC # define GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) # if GCC_VERSION > 40100 -# define NL_ISO_STDTR1_AVAILABLE -# define NL_ISO_STDTR1_HEADER(header) + // new libc++ bundled with clang under Mac OS X 10.9+ doesn't define __GLIBCXX__ +# ifdef __GLIBCXX__ +# define NL_ISO_STDTR1_AVAILABLE +# define NL_ISO_STDTR1_HEADER(header) +# define NL_ISO_STDTR1_NAMESPACE std::tr1 +# else +# define NL_ISO_STDTR1_AVAILABLE +# define NL_ISO_STDTR1_HEADER(header)
+# define NL_ISO_STDTR1_NAMESPACE std +# endif # endif #endif @@ -331,9 +340,9 @@ typedef unsigned int uint; // at least 32bits (depend of processor) #elif defined(NL_ISO_STDTR1_AVAILABLE) // use std::tr1 for CHash* classes, if available (gcc 4.1+ and VC9 with TR1 feature pack) # include NL_ISO_STDTR1_HEADER(unordered_map) # include NL_ISO_STDTR1_HEADER(unordered_set) -# define CHashMap std::tr1::unordered_map -# define CHashSet std::tr1::unordered_set -# define CHashMultiMap std::tr1::unordered_multimap +# define CHashMap NL_ISO_STDTR1_NAMESPACE::unordered_map +# define CHashSet NL_ISO_STDTR1_NAMESPACE::unordered_set +# define CHashMultiMap NL_ISO_STDTR1_NAMESPACE::unordered_multimap #elif defined(NL_COMP_VC) && (NL_COMP_VC_VERSION >= 70 && NL_COMP_VC_VERSION <= 90) // VC7 through 9 # include # include From 9b058de0e6ced60de233018ba5dccb2199c692a8 Mon Sep 17 00:00:00 2001 From: kervala Date: Thu, 30 Jan 2014 16:26:16 +0100 Subject: [PATCH 06/14] Changed: CMAKE_OSX_DEPLOYMENT_TARGET is useless because CMake set it automatically based on MACOSX_DEPLOYMENT_TARGET --- code/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/CMakeLists.txt b/code/CMakeLists.txt index b608fe082..4f0439dfd 100644 --- a/code/CMakeLists.txt +++ b/code/CMakeLists.txt @@ -41,8 +41,8 @@ INCLUDE(${CMAKE_ROOT}/Modules/Documentation.cmake OPTIONAL) # Force out of source builds. CHECK_OUT_OF_SOURCE() -# To be able to specify a different deployment target on Mac OS X, specify : -# -DCMAKE_OSX_DEPLOYMENT_TARGET=10.6 -DCMAKE_OSX_SYSROOT=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk +# To be able to specify a different deployment target on Mac OS X : +# export MACOSX_DEPLOYMENT_TARGET=10.6 CMAKE_MINIMUM_REQUIRED(VERSION 2.6) PROJECT(RyzomCore CXX C) From cb5a600578a449610123ffc1099279d1c0a07f06 Mon Sep 17 00:00:00 2001 From: kervala Date: Sat, 1 Feb 2014 13:59:47 +0100 Subject: [PATCH 07/14] Fixed: Compilation with freetype under Linux --- code/CMakeModules/FindFreeType.cmake | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/code/CMakeModules/FindFreeType.cmake b/code/CMakeModules/FindFreeType.cmake index 36d109a18..f6b827899 100644 --- a/code/CMakeModules/FindFreeType.cmake +++ b/code/CMakeModules/FindFreeType.cmake @@ -9,7 +9,25 @@ IF(FREETYPE_LIBRARIES AND FREETYPE_INCLUDE_DIRS) SET(Freetype_FIND_QUIETLY TRUE) ENDIF(FREETYPE_LIBRARIES AND FREETYPE_INCLUDE_DIRS) -FIND_PATH(FREETYPE_INCLUDE_DIR +FIND_PATH(FREETYPE_INCLUDE_DIRS + freetype + PATHS + $ENV{FREETYPE_DIR}/include + /usr/local/include + /usr/include + /sw/include + /opt/local/include + /opt/csw/include + /opt/include + PATH_SUFFIXES freetype2 +) + +IF(NOT FREETYPE_INCLUDE_DIRS) + SET(FREETYPE_INCLUDE_DIRS "") +ENDIF(NOT FREETYPE_INCLUDE_DIRS) + +# ft2build.h does not reside in the freetype include dir +FIND_PATH(FREETYPE_ADDITIONAL_INCLUDE_DIR ft2build.h PATHS /usr/local/include @@ -21,9 +39,10 @@ FIND_PATH(FREETYPE_INCLUDE_DIR PATH_SUFFIXES freetype2 ) -IF(FREETYPE_INCLUDE_DIR) - SET(FREETYPE_INCLUDE_DIRS ${FREETYPE_INCLUDE_DIR}) -ENDIF(FREETYPE_INCLUDE_DIR) +# combine both include directories into one variable +IF(FREETYPE_ADDITIONAL_INCLUDE_DIR) + SET(FREETYPE_INCLUDE_DIRS ${FREETYPE_INCLUDE_DIRS} ${FREETYPE_ADDITIONAL_INCLUDE_DIR}) +ENDIF(FREETYPE_ADDITIONAL_INCLUDE_DIR) FIND_LIBRARY(FREETYPE_LIBRARY_RELEASE NAMES freetype libfreetype freetype219 freetype246 From 91163ba7bb6ec08f1464ab33c8df8d83563778f9 Mon Sep 17 00:00:00 2001 From: kaetemi Date: Sun, 2 Feb 2014 00:47:33 +0100 Subject: [PATCH 08/14] Properly handle NeL dependencies for Ryzom tools when disabling NeL libraries --- code/ryzom/tools/CMakeLists.txt | 19 ++++++++---- code/ryzom/tools/leveldesign/CMakeLists.txt | 33 ++++++++++++++------- code/ryzom/tools/server/CMakeLists.txt | 10 +++++-- 3 files changed, 44 insertions(+), 18 deletions(-) diff --git a/code/ryzom/tools/CMakeLists.txt b/code/ryzom/tools/CMakeLists.txt index 456336254..631a3ad28 100644 --- a/code/ryzom/tools/CMakeLists.txt +++ b/code/ryzom/tools/CMakeLists.txt @@ -3,13 +3,22 @@ ADD_SUBDIRECTORY(make_alias_file) ADD_SUBDIRECTORY(make_anim_by_race) ADD_SUBDIRECTORY(make_anim_melee_impact) ADD_SUBDIRECTORY(pd_parser) -ADD_SUBDIRECTORY(translation_tools) ADD_SUBDIRECTORY(assoc_mem) ADD_SUBDIRECTORY(leveldesign) -ADD_SUBDIRECTORY(patch_gen) -ADD_SUBDIRECTORY(pdr_util) -ADD_SUBDIRECTORY(stats_scan) -ADD_SUBDIRECTORY(sheets_packer) + +IF(WITH_LIGO) + ADD_SUBDIRECTORY(translation_tools) +ENDIF(WITH_LIGO) + +IF(WITH_NET) + ADD_SUBDIRECTORY(stats_scan) + ADD_SUBDIRECTORY(pdr_util) + ADD_SUBDIRECTORY(patch_gen) +ENDIF(WITH_NET) + +IF(WITH_LIGO AND WITH_NET) + ADD_SUBDIRECTORY(sheets_packer) +ENDIF(WITH_LIGO AND WITH_NET) IF(WITH_RYZOM_CLIENT) ADD_SUBDIRECTORY(client) diff --git a/code/ryzom/tools/leveldesign/CMakeLists.txt b/code/ryzom/tools/leveldesign/CMakeLists.txt index fd3ddc94a..9a56a2fac 100644 --- a/code/ryzom/tools/leveldesign/CMakeLists.txt +++ b/code/ryzom/tools/leveldesign/CMakeLists.txt @@ -1,26 +1,39 @@ -ADD_SUBDIRECTORY(alias_synchronizer) -ADD_SUBDIRECTORY(prim_export) + ADD_SUBDIRECTORY(uni_conv) ADD_SUBDIRECTORY(csv_transform) ADD_SUBDIRECTORY(icon_search) -ADD_SUBDIRECTORY(mission_compiler_lib) +IF(WITH_LIGO) + ADD_SUBDIRECTORY(alias_synchronizer) + ADD_SUBDIRECTORY(prim_export) + ADD_SUBDIRECTORY(mission_compiler_lib) +ENDIF(WITH_LIGO) ADD_SUBDIRECTORY(mp_generator) ADD_SUBDIRECTORY(named_items_2_csv) IF(WIN32) - ADD_SUBDIRECTORY(export) - ADD_SUBDIRECTORY(world_editor) + IF(WITH_LIGO) + ADD_SUBDIRECTORY(export) + ADD_SUBDIRECTORY(world_editor) + ENDIF(WITH_LIGO) IF(WITH_MFC) - ADD_SUBDIRECTORY(mission_compiler_fe) - ADD_SUBDIRECTORY(georges_dll) - ADD_SUBDIRECTORY(georges_exe) - ADD_SUBDIRECTORY(georges_plugin_sound) + IF(WITH_LIGO) + ADD_SUBDIRECTORY(mission_compiler_fe) + ENDIF(WITH_LIGO) + IF(WITH_GEORGES) + ADD_SUBDIRECTORY(georges_dll) + ADD_SUBDIRECTORY(georges_exe) + IF(WITH_SOUND) + ADD_SUBDIRECTORY(georges_plugin_sound) + ENDIF(WITH_SOUND) + ENDIF(WITH_GEORGES) ENDIF(WITH_MFC) ENDIF(WIN32) IF(WITH_QT) - ADD_SUBDIRECTORY(georges_editor_qt) + IF(WITH_GEORGES) + ADD_SUBDIRECTORY(georges_editor_qt) + ENDIF(WITH_GEORGES) ENDIF(WITH_QT) # folders not handled yet. diff --git a/code/ryzom/tools/server/CMakeLists.txt b/code/ryzom/tools/server/CMakeLists.txt index a9b765870..982c47718 100644 --- a/code/ryzom/tools/server/CMakeLists.txt +++ b/code/ryzom/tools/server/CMakeLists.txt @@ -1,6 +1,10 @@ -# Deprecated, no longer used -ADD_SUBDIRECTORY(ai_build_wmap) -ADD_SUBDIRECTORY(build_world_packed_col) + +IF(WITH_LIGO) + ADD_SUBDIRECTORY(ai_build_wmap) +ENDIF(WITH_LIGO) +IF(WITH_3D) + ADD_SUBDIRECTORY(build_world_packed_col) +ENDIF(WITH_3D) # Not done yet. #admin From ce88e5836a0c5808606c1aac1faeabd7172ff64a Mon Sep 17 00:00:00 2001 From: kaetemi Date: Mon, 3 Feb 2014 00:16:35 +0100 Subject: [PATCH 09/14] Remove georges4cvs feature --- code/nel/include/nel/georges/form.h | 4 +- code/nel/include/nel/georges/form_dfn.h | 2 +- code/nel/include/nel/georges/form_loader.h | 2 +- code/nel/include/nel/georges/header.h | 5 +- code/nel/include/nel/georges/type.h | 2 +- code/nel/include/nel/georges/u_form.h | 3 +- code/nel/samples/georges/main.cpp | 2 +- code/nel/src/georges/form.cpp | 8 +-- code/nel/src/georges/form_dfn.cpp | 4 +- code/nel/src/georges/header.cpp | 38 ++----------- code/nel/src/georges/type.cpp | 4 +- .../tools/georges/georges2csv/georges2csv.cpp | 2 +- .../leveldesign/georges_dll/georges_edit.cpp | 11 ---- .../leveldesign/georges_dll/georges_edit.h | 3 - .../georges_dll/georges_edit_doc.cpp | 6 +- .../georges_dll/georges_implementation.cpp | 4 +- .../leveldesign/georges_dll/header_dialog.cpp | 55 ++----------------- .../georges_dll/settings_dialog.cpp | 4 -- .../leveldesign/georges_dll/settings_dialog.h | 1 - .../tools/leveldesign/install/georges.cfg | 1 - 20 files changed, 32 insertions(+), 129 deletions(-) diff --git a/code/nel/include/nel/georges/form.h b/code/nel/include/nel/georges/form.h index aa734cc1d..d2b6a2f2d 100644 --- a/code/nel/include/nel/georges/form.h +++ b/code/nel/include/nel/georges/form.h @@ -44,7 +44,7 @@ public: UFormElm& getRootNode (); const UFormElm& getRootNode () const; const std::string &getComment () const; - void write (class NLMISC::IStream &stream, bool georges4CVS); + void write (class NLMISC::IStream &stream); void getDependencies (std::set &dependencies) const; uint getNumParent () const; UForm *getParentForm (uint parent) const; @@ -73,7 +73,7 @@ public: // ** IO functions // Set the filename before saving the form - void write (xmlDocPtr doc, const char *filename, bool georges4CVS); + void write (xmlDocPtr doc, const char *filename); // ** Parent access diff --git a/code/nel/include/nel/georges/form_dfn.h b/code/nel/include/nel/georges/form_dfn.h index d31dd5d39..283fd0fdd 100644 --- a/code/nel/include/nel/georges/form_dfn.h +++ b/code/nel/include/nel/georges/form_dfn.h @@ -161,7 +161,7 @@ public: }; // ** IO functions - void write (xmlDocPtr root, const char *filename, bool georges4CVS); + void write (xmlDocPtr root, const char *filename); // Count parent DFN uint countParentDfn (uint32 round=0) const; diff --git a/code/nel/include/nel/georges/form_loader.h b/code/nel/include/nel/georges/form_loader.h index 83ae86490..75d7152ec 100644 --- a/code/nel/include/nel/georges/form_loader.h +++ b/code/nel/include/nel/georges/form_loader.h @@ -63,7 +63,7 @@ private: TTypeMap _MapType; // Map of filename / CRefPtr - TFormDfnMap _MapFormDfn; + TFormDfnMap _MapFormDfn; // Map of form / CRefPtr TFormMap _MapForm; diff --git a/code/nel/include/nel/georges/header.h b/code/nel/include/nel/georges/header.h index 3733f0707..21b05445e 100644 --- a/code/nel/include/nel/georges/header.h +++ b/code/nel/include/nel/georges/header.h @@ -54,9 +54,6 @@ public: /// State of the form TState State; - /// CVS Revision string - std::string Revision; - /// Comments of the form std::string Comments; @@ -65,7 +62,7 @@ public: /// ** IO functions void read (xmlNodePtr root); - void write (xmlNodePtr node, bool georges4CVS) const; + void write (xmlNodePtr node) const; // Get state string static const char *getStateString (TState state); diff --git a/code/nel/include/nel/georges/type.h b/code/nel/include/nel/georges/type.h index a57015a26..936506c7c 100644 --- a/code/nel/include/nel/georges/type.h +++ b/code/nel/include/nel/georges/type.h @@ -55,7 +55,7 @@ public: static bool uiCompatible (TType type, TUI ui); // ** IO functions - void write (xmlDocPtr doc, bool georges4CVS) const; + void write (xmlDocPtr doc) const; // Header CFileHeader Header; diff --git a/code/nel/include/nel/georges/u_form.h b/code/nel/include/nel/georges/u_form.h index 45d623340..d53e415f7 100644 --- a/code/nel/include/nel/georges/u_form.h +++ b/code/nel/include/nel/georges/u_form.h @@ -53,9 +53,8 @@ public: /** Write the form in a stream. * * \param stream is the stream used to write the form - * \param georges4CVS should be true if you use Georges with CVS false else */ - virtual void write (NLMISC::IStream &stream, bool georges4CVS) = 0; + virtual void write (NLMISC::IStream &stream) = 0; /** * Access form parents diff --git a/code/nel/samples/georges/main.cpp b/code/nel/samples/georges/main.cpp index da2f09e37..bd7624689 100644 --- a/code/nel/samples/georges/main.cpp +++ b/code/nel/samples/georges/main.cpp @@ -289,7 +289,7 @@ int main(void) // and finally save the form out in case we made changes. // if you're accessing a form read-only (not using set*) you can skip this. NLMISC::COFile saveSample(sampleConfigFile); - form->write(saveSample, false); + form->write(saveSample); nlinfo("Saved sample config file."); } else { // CPath didn't find the file, just print an error and exit. diff --git a/code/nel/src/georges/form.cpp b/code/nel/src/georges/form.cpp index 65eb5ac89..5a23441ee 100644 --- a/code/nel/src/georges/form.cpp +++ b/code/nel/src/georges/form.cpp @@ -104,7 +104,7 @@ CForm::~CForm () // *************************************************************************** -void CForm::write (xmlDocPtr doc, const char *filename, bool georges4CVS) +void CForm::write (xmlDocPtr doc, const char *filename) { // Save the filename if (filename) @@ -137,7 +137,7 @@ void CForm::write (xmlDocPtr doc, const char *filename, bool georges4CVS) } // Header - Header.write (node, georges4CVS); + Header.write (node); } // *************************************************************************** @@ -259,14 +259,14 @@ const std::string &CForm::getComment () const // *************************************************************************** -void CForm::write (class NLMISC::IStream &stream, bool georges4CVS) +void CForm::write (class NLMISC::IStream &stream) { // Xml stream COXml xmlStream; xmlStream.init (&stream); // Write the file - write (xmlStream.getDocument (), NULL, georges4CVS); + write (xmlStream.getDocument (), NULL); } // *************************************************************************** diff --git a/code/nel/src/georges/form_dfn.cpp b/code/nel/src/georges/form_dfn.cpp index 2b9e53c87..715961a72 100644 --- a/code/nel/src/georges/form_dfn.cpp +++ b/code/nel/src/georges/form_dfn.cpp @@ -41,7 +41,7 @@ void warning (bool exception, const char *format, ... ); // *************************************************************************** -void CFormDfn::write (xmlDocPtr doc, const char *filename, bool georges4CVS) +void CFormDfn::write (xmlDocPtr doc, const char *filename) { // Save filename _Filename = CFile::getFilename (filename); @@ -101,7 +101,7 @@ void CFormDfn::write (xmlDocPtr doc, const char *filename, bool georges4CVS) } // Header - Header.write (node, georges4CVS); + Header.write (node); } // *************************************************************************** diff --git a/code/nel/src/georges/header.cpp b/code/nel/src/georges/header.cpp index 1fc215eda..ff92d60ea 100644 --- a/code/nel/src/georges/header.cpp +++ b/code/nel/src/georges/header.cpp @@ -38,27 +38,16 @@ CFileHeader::CFileHeader () MajorVersion = 0; MinorVersion = 0; State = Modified; - Revision = "$R"; - Revision += "evision$"; } // *************************************************************************** -void CFileHeader::write (xmlNodePtr node, bool georges4CVS) const +void CFileHeader::write (xmlNodePtr node) const { - // Version for CVS ? - if (georges4CVS) - { - // Georges version system - xmlSetProp (node, (const xmlChar*)"Revision", (const xmlChar*)Revision.c_str ()); - } - else - { - // Georges version system - char tmp[512]; - smprintf (tmp, 512, "%d.%d", MajorVersion, MinorVersion); - xmlSetProp (node, (const xmlChar*)"Version", (const xmlChar*)tmp); - } + // Georges version system + char tmp[512]; + smprintf (tmp, 512, "%d.%d", MajorVersion, MinorVersion); + xmlSetProp (node, (const xmlChar*)"Version", (const xmlChar*)tmp); // State if (State == Modified) @@ -137,23 +126,6 @@ void CFileHeader::read (xmlNodePtr root) MinorVersion = 0; } - // Get the revision - value = (const char*)xmlGetProp (root, (xmlChar*)"Revision"); - if (value) - { - // Set the value - Revision = value; - - // Delete the value - xmlFree ((void*)value); - } - else - { - // Set default - Revision = "$R"; - Revision += "evision$"; - } - // Get the version value = (const char*)xmlGetProp (root, (xmlChar*)"State"); if (value) diff --git a/code/nel/src/georges/type.cpp b/code/nel/src/georges/type.cpp index 688a0f72f..f401c7ee8 100644 --- a/code/nel/src/georges/type.cpp +++ b/code/nel/src/georges/type.cpp @@ -54,7 +54,7 @@ CType::~CType () // *************************************************************************** -void CType::write (xmlDocPtr doc, bool georges4CVS) const +void CType::write (xmlDocPtr doc) const { // Create the first node xmlNodePtr node = xmlNewDocNode (doc, NULL, (const xmlChar*)"TYPE", NULL); @@ -98,7 +98,7 @@ void CType::write (xmlDocPtr doc, bool georges4CVS) const } // Header - Header.write (node, georges4CVS); + Header.write (node); } // *************************************************************************** diff --git a/code/nel/tools/georges/georges2csv/georges2csv.cpp b/code/nel/tools/georges/georges2csv/georges2csv.cpp index 790c308b4..f400a2976 100644 --- a/code/nel/tools/georges/georges2csv/georges2csv.cpp +++ b/code/nel/tools/georges/georges2csv/georges2csv.cpp @@ -1200,7 +1200,7 @@ void convertCsvFile( const string &file, bool generate, const string& sheetType } else { - form->write(output, true); + form->write(output); output.close(); if (!CPath::exists(filename + ext)) diff --git a/code/ryzom/tools/leveldesign/georges_dll/georges_edit.cpp b/code/ryzom/tools/leveldesign/georges_dll/georges_edit.cpp index dd10a9bb6..c1bffe96c 100644 --- a/code/ryzom/tools/leveldesign/georges_dll/georges_edit.cpp +++ b/code/ryzom/tools/leveldesign/georges_dll/georges_edit.cpp @@ -73,7 +73,6 @@ CGeorgesEditApp::CGeorgesEditApp() : MemStream (false, false, 1024*1024) ResizeMain = true; ExeStandalone = false; StartExpanded = true; - Georges4CVS = true; FormClipBoardFormatStruct = RegisterClipboardFormat ("GeorgesFormStruct"); FormClipBoardFormatVirtualStruct = RegisterClipboardFormat ("GeorgesFormVirtualStruct"); @@ -547,11 +546,6 @@ bool CGeorgesEditApp::loadCfg () if (start_expanded) StartExpanded = start_expanded->asInt () != 0; - // Georges4CVS - CConfigFile::CVar *georges_for_cvs = cf.getVarPtr ("GeorgesForCvs"); - if (georges_for_cvs) - Georges4CVS = georges_for_cvs->asInt () != 0; - // MaxUndo CConfigFile::CVar *max_undo = cf.getVarPtr ("MaxUndo"); if (max_undo) @@ -633,11 +627,6 @@ bool CGeorgesEditApp::saveCfg () if (start_expanded) start_expanded->setAsInt (StartExpanded); - // Georges4CVS - CConfigFile::CVar *georges_for_cvs= cf.getVarPtr ("GeorgesForCvs"); - if (georges_for_cvs) - georges_for_cvs->setAsInt (Georges4CVS); - // MaxUndo CConfigFile::CVar *max_undo= cf.getVarPtr ("MaxUndo"); if (max_undo) diff --git a/code/ryzom/tools/leveldesign/georges_dll/georges_edit.h b/code/ryzom/tools/leveldesign/georges_dll/georges_edit.h index ec70cf093..6b233f590 100644 --- a/code/ryzom/tools/leveldesign/georges_dll/georges_edit.h +++ b/code/ryzom/tools/leveldesign/georges_dll/georges_edit.h @@ -99,9 +99,6 @@ public: // If true, expand document's content node at loading bool StartExpanded; - // Georges for CVS - bool Georges4CVS; - // Clipboards ID UINT FormClipBoardFormatStruct; UINT FormClipBoardFormatVirtualStruct; diff --git a/code/ryzom/tools/leveldesign/georges_dll/georges_edit_doc.cpp b/code/ryzom/tools/leveldesign/georges_dll/georges_edit_doc.cpp index 4255273bf..035113bcd 100644 --- a/code/ryzom/tools/leveldesign/georges_dll/georges_edit_doc.cpp +++ b/code/ryzom/tools/leveldesign/georges_dll/georges_edit_doc.cpp @@ -766,7 +766,7 @@ BOOL CGeorgesEditDoc::OnSaveDocument(LPCTSTR lpszPathName) Type->Header.MinorVersion++; flushValueChange (); } - Type->write (xmlStream.getDocument (), theApp.Georges4CVS); + Type->write (xmlStream.getDocument ()); modify (NULL, NULL, false); flushValueChange (); UpdateAllViews (NULL); @@ -782,7 +782,7 @@ BOOL CGeorgesEditDoc::OnSaveDocument(LPCTSTR lpszPathName) Dfn->Header.MinorVersion++; flushValueChange (); } - Dfn->write (xmlStream.getDocument (), lpszPathName, theApp.Georges4CVS); + Dfn->write (xmlStream.getDocument (), lpszPathName); modify (NULL, NULL, false); UpdateAllViews (NULL); return TRUE; @@ -797,7 +797,7 @@ BOOL CGeorgesEditDoc::OnSaveDocument(LPCTSTR lpszPathName) ((CForm*)(UForm*)Form)->Header.MinorVersion++; flushValueChange (); } - ((CForm*)(UForm*)Form)->write (xmlStream.getDocument (), lpszPathName, theApp.Georges4CVS); + ((CForm*)(UForm*)Form)->write (xmlStream.getDocument (), lpszPathName); if (strcmp (xmlStream.getErrorString (), "") != 0) { char message[512]; diff --git a/code/ryzom/tools/leveldesign/georges_dll/georges_implementation.cpp b/code/ryzom/tools/leveldesign/georges_dll/georges_implementation.cpp index 2422d4b65..73fa3fcd9 100644 --- a/code/ryzom/tools/leveldesign/georges_dll/georges_implementation.cpp +++ b/code/ryzom/tools/leveldesign/georges_dll/georges_implementation.cpp @@ -513,7 +513,7 @@ void CGeorgesImpl::MakeTyp( const std::string& filename, TType type, TUI ui, con outputXml.init (&output); // Write - t.write (outputXml.getDocument (), theApp.Georges4CVS); + t.write (outputXml.getDocument ()); } catch (Exception &e) { @@ -560,7 +560,7 @@ void CGeorgesImpl::createInstanceFile (const std::string &_sxFullnameWithoutExt, if (f.open (fullName)) { ox.init(&f); - ((NLGEORGES::CForm*)((UForm*)Form))->write (ox.getDocument(), _sxFullnameWithoutExt.c_str (), theApp.Georges4CVS); + ((NLGEORGES::CForm*)((UForm*)Form))->write (ox.getDocument(), _sxFullnameWithoutExt.c_str ()); ox.flush(); f.close(); } diff --git a/code/ryzom/tools/leveldesign/georges_dll/header_dialog.cpp b/code/ryzom/tools/leveldesign/georges_dll/header_dialog.cpp index 6ecfe13fc..8bdf3e165 100644 --- a/code/ryzom/tools/leveldesign/georges_dll/header_dialog.cpp +++ b/code/ryzom/tools/leveldesign/georges_dll/header_dialog.cpp @@ -96,7 +96,6 @@ BOOL CHeaderDialog::OnInitDialog() IncrementVersion.Create ("Increment Version", WS_VISIBLE|WS_TABSTOP, currentPos, this, BtIncrement); initWidget (IncrementVersion); getNextPos (currentPos); - IncrementVersion.EnableWindow ( theApp.Georges4CVS ? FALSE : TRUE ); // Create the state combo setStaticSize (currentPos); @@ -243,55 +242,11 @@ void CHeaderDialog::getFromDocument (const NLGEORGES::CFileHeader &header) { if (View) { - if (theApp.Georges4CVS) - { - // CVS revision number - IncrementVersion.EnableWindow ( theApp.Georges4CVS ? FALSE : TRUE ); - - // Performs some checks - bool ok = false; - const char *revision = header.Revision.c_str (); - char name[32]; - char name2[512]; - if (strncmp (revision, "$Revision: ", 11) == 0) - { - // String start - const char *start = revision + 11; - - // String end - const char *end = strchr (start, '$'); - if (end) - { - // Build a string - int length = std::min (31, (int)(end-start)); - memcpy (name, start, length); - name[length] = 0; - - // Nice version - smprintf (name2, 512, "CVS Revision %s", name); - - // Set the label - LabelVersion.SetWindowText (name2); - - // Success - ok = true; - } - } - - // Revision not found ? - if (!ok) - { - LabelVersion.SetWindowText ("CVS Revision number not found"); - } - } - else - { - // Nel standard version number - ComboState.SetCurSel (header.State); - char name[512]; - smprintf (name, 512, "Version %d.%d", header.MajorVersion, header.MinorVersion); - LabelVersion.SetWindowText (name); - } + // Nel standard version number + ComboState.SetCurSel (header.State); + char name[512]; + smprintf (name, 512, "Version %d.%d", header.MajorVersion, header.MinorVersion); + LabelVersion.SetWindowText (name); // Set comments setEditTextMultiLine (Comments, header.Comments.c_str()); diff --git a/code/ryzom/tools/leveldesign/georges_dll/settings_dialog.cpp b/code/ryzom/tools/leveldesign/georges_dll/settings_dialog.cpp index 28f50e7e1..e57888595 100644 --- a/code/ryzom/tools/leveldesign/georges_dll/settings_dialog.cpp +++ b/code/ryzom/tools/leveldesign/georges_dll/settings_dialog.cpp @@ -39,7 +39,6 @@ CSettingsDialog::CSettingsDialog(CWnd* pParent /*=NULL*/) TypeDfnSubDirectory = _T(""); MaxUndo = 0; StartExpanded = TRUE; - Georges4CVS = TRUE; //}}AFX_DATA_INIT } @@ -55,7 +54,6 @@ void CSettingsDialog::DoDataExchange(CDataExchange* pDX) DDX_Text(pDX, IDC_TYP_DFN_PATH, TypeDfnSubDirectory); DDX_Text(pDX, IDC_MAX_UNDO, MaxUndo); DDX_Check(pDX, IDC_START_EXPANDED, StartExpanded); - DDX_Check(pDX, IDC_GEORGES_4_CVS, Georges4CVS); //}}AFX_DATA_MAP } @@ -93,7 +91,6 @@ BOOL CSettingsDialog::OnInitDialog() DefaultDfn = theApp.DefaultDfn.c_str (); DefaultType = theApp.DefaultType.c_str (); StartExpanded = theApp.StartExpanded; - Georges4CVS = theApp.Georges4CVS; UpdateData (FALSE); @@ -110,7 +107,6 @@ void CSettingsDialog::OnOK() theApp.TypeDfnSubDirectory = TypeDfnSubDirectory; theApp.RememberListSize = RememberListSize; theApp.StartExpanded = StartExpanded ? TRUE : FALSE; - theApp.Georges4CVS = Georges4CVS ? TRUE : FALSE; theApp.MaxUndo = MaxUndo; theApp.DefaultDfn = DefaultDfn; theApp.DefaultType = DefaultType; diff --git a/code/ryzom/tools/leveldesign/georges_dll/settings_dialog.h b/code/ryzom/tools/leveldesign/georges_dll/settings_dialog.h index 1bc3aaffe..622e959e4 100644 --- a/code/ryzom/tools/leveldesign/georges_dll/settings_dialog.h +++ b/code/ryzom/tools/leveldesign/georges_dll/settings_dialog.h @@ -44,7 +44,6 @@ public: CString TypeDfnSubDirectory; UINT MaxUndo; BOOL StartExpanded; - BOOL Georges4CVS; //}}AFX_DATA NLMISC::CConfigFile ConfigFile; diff --git a/code/ryzom/tools/leveldesign/install/georges.cfg b/code/ryzom/tools/leveldesign/install/georges.cfg index 12551f57e..c7d975479 100644 --- a/code/ryzom/tools/leveldesign/install/georges.cfg +++ b/code/ryzom/tools/leveldesign/install/georges.cfg @@ -11,6 +11,5 @@ SuperUser = 1; UserType = { }; StartExpanded = 1; -GeorgesForCvs = 1; SamplePath = "L:\sound_files\samplebanks"; PackedSheetPath = "L:\sound_files\"; From f3a1dad1d2d6b2a67e2a471ef9befdc59335e967 Mon Sep 17 00:00:00 2001 From: kaetemi Date: Mon, 3 Feb 2014 01:25:02 +0100 Subject: [PATCH 10/14] Remove georges4cvs feature --- .../src/plugins/georges_editor/georges_treeview_dialog.cpp | 2 +- .../georges_editor_qt/src/georges_treeview_dialog.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_treeview_dialog.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_treeview_dialog.cpp index 0dda2c9a9..c19a01fd7 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_treeview_dialog.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/georges_editor/georges_treeview_dialog.cpp @@ -364,7 +364,7 @@ namespace GeorgesQt // ((CForm*)(UForm*)Form)->Header.MinorVersion++; // }*/ // //((CForm*)(UForm*)Form)->write (xmlStream.getDocument (), lpszPathName, theApp.Georges4CVS); - m_form->write(file, false); + m_form->write(file); setWindowTitle(windowTitle().remove("*")); m_modified = false; // //if (strcmp (xmlStream.getErrorString (), "") != 0) diff --git a/code/ryzom/tools/leveldesign/georges_editor_qt/src/georges_treeview_dialog.cpp b/code/ryzom/tools/leveldesign/georges_editor_qt/src/georges_treeview_dialog.cpp index 088170a6d..b5ab13ba3 100644 --- a/code/ryzom/tools/leveldesign/georges_editor_qt/src/georges_treeview_dialog.cpp +++ b/code/ryzom/tools/leveldesign/georges_editor_qt/src/georges_treeview_dialog.cpp @@ -269,7 +269,7 @@ namespace NLQT ((CForm*)(UForm*)Form)->Header.MinorVersion++; }*/ //((CForm*)(UForm*)Form)->write (xmlStream.getDocument (), lpszPathName, theApp.Georges4CVS); - _form->write(file, false); + _form->write(file); setWindowTitle(windowTitle().remove("*")); _modified = false; //if (strcmp (xmlStream.getErrorString (), "") != 0) From 2833cc42d4b376c531659905b4366139336a8054 Mon Sep 17 00:00:00 2001 From: kaetemi Date: Tue, 4 Feb 2014 19:21:13 +0100 Subject: [PATCH 11/14] Fix georges sound plugin compilation --- code/ryzom/tools/leveldesign/georges_plugin_sound/PageBase.h | 1 + code/ryzom/tools/leveldesign/georges_plugin_sound/PageComplex.h | 1 + .../tools/leveldesign/georges_plugin_sound/loading_dialog.h | 1 + code/ryzom/tools/leveldesign/georges_plugin_sound/sound_dialog.h | 1 + 4 files changed, 4 insertions(+) diff --git a/code/ryzom/tools/leveldesign/georges_plugin_sound/PageBase.h b/code/ryzom/tools/leveldesign/georges_plugin_sound/PageBase.h index 04ec0b9cc..16449a4d3 100644 --- a/code/ryzom/tools/leveldesign/georges_plugin_sound/PageBase.h +++ b/code/ryzom/tools/leveldesign/georges_plugin_sound/PageBase.h @@ -19,6 +19,7 @@ #include #include +#include "resource.h" namespace NLGEORGES { diff --git a/code/ryzom/tools/leveldesign/georges_plugin_sound/PageComplex.h b/code/ryzom/tools/leveldesign/georges_plugin_sound/PageComplex.h index eaa28a365..74eb65e07 100644 --- a/code/ryzom/tools/leveldesign/georges_plugin_sound/PageComplex.h +++ b/code/ryzom/tools/leveldesign/georges_plugin_sound/PageComplex.h @@ -24,6 +24,7 @@ // #include "PageBase.h" + ///////////////////////////////////////////////////////////////////////////// // CPageComplex dialog diff --git a/code/ryzom/tools/leveldesign/georges_plugin_sound/loading_dialog.h b/code/ryzom/tools/leveldesign/georges_plugin_sound/loading_dialog.h index adca151c1..c21df7c2d 100644 --- a/code/ryzom/tools/leveldesign/georges_plugin_sound/loading_dialog.h +++ b/code/ryzom/tools/leveldesign/georges_plugin_sound/loading_dialog.h @@ -22,6 +22,7 @@ #endif // _MSC_VER > 1000 // LoadingDialog.h : header file // +#include "resource.h" ///////////////////////////////////////////////////////////////////////////// // CLoadingDialog dialog diff --git a/code/ryzom/tools/leveldesign/georges_plugin_sound/sound_dialog.h b/code/ryzom/tools/leveldesign/georges_plugin_sound/sound_dialog.h index 884c52423..12b1a6ac8 100644 --- a/code/ryzom/tools/leveldesign/georges_plugin_sound/sound_dialog.h +++ b/code/ryzom/tools/leveldesign/georges_plugin_sound/sound_dialog.h @@ -21,6 +21,7 @@ #include "std_sound_plugin.h" #include "listener_view.h" #include "nel/sound/u_audio_mixer.h" +#include "resource.h" #include "../georges_dll/plugin_interface.h" From 7989e9e6bcc56a4cbc6a378ba176d894ee427fc6 Mon Sep 17 00:00:00 2001 From: kaetemi Date: Tue, 4 Feb 2014 20:52:15 +0100 Subject: [PATCH 12/14] Do not select stereo display debugger when HMD is set to Auto in Snowballs --- code/nel/include/nel/3d/stereo_display.h | 1 + code/nel/src/3d/stereo_debugger.cpp | 1 + code/nel/src/3d/stereo_libvr.cpp | 1 + code/nel/src/3d/stereo_ovr.cpp | 1 + code/snowballs2/client/src/camera.cpp | 8 +++++++- 5 files changed, 11 insertions(+), 1 deletion(-) diff --git a/code/nel/include/nel/3d/stereo_display.h b/code/nel/include/nel/3d/stereo_display.h index e3b5b3716..3b9c73b74 100644 --- a/code/nel/include/nel/3d/stereo_display.h +++ b/code/nel/include/nel/3d/stereo_display.h @@ -77,6 +77,7 @@ public: std::string Manufacturer; std::string ProductName; std::string Serial; // A unique device identifier + bool AllowAuto; // Allow this device to be automatically selected when no device is configured }; /** diff --git a/code/nel/src/3d/stereo_debugger.cpp b/code/nel/src/3d/stereo_debugger.cpp index c5c5e262a..34a348c80 100644 --- a/code/nel/src/3d/stereo_debugger.cpp +++ b/code/nel/src/3d/stereo_debugger.cpp @@ -453,6 +453,7 @@ void CStereoDebugger::listDevices(std::vector &devicesOut) devInfo.Manufacturer = "NeL"; devInfo.ProductName = "Stereo Debugger"; devInfo.Serial = "NL-3D-DEBUG"; + devInfo.AllowAuto = false; devicesOut.push_back(devInfo); } diff --git a/code/nel/src/3d/stereo_libvr.cpp b/code/nel/src/3d/stereo_libvr.cpp index 8ce64e07c..44a5a0a5a 100644 --- a/code/nel/src/3d/stereo_libvr.cpp +++ b/code/nel/src/3d/stereo_libvr.cpp @@ -612,6 +612,7 @@ void CStereoLibVR::listDevices(std::vector &devicesOut) deviceInfoOut.Factory = static_cast(handle); deviceInfoOut.Class = CStereoDeviceInfo::StereoHMD; deviceInfoOut.Library = CStereoDeviceInfo::LibVR; + deviceInfoOut.AllowAuto = true; //TODO: manufacturer, produc name //TODO: serial devicesOut.push_back(deviceInfoOut); diff --git a/code/nel/src/3d/stereo_ovr.cpp b/code/nel/src/3d/stereo_ovr.cpp index 46a8d147c..402d9b2d0 100644 --- a/code/nel/src/3d/stereo_ovr.cpp +++ b/code/nel/src/3d/stereo_ovr.cpp @@ -816,6 +816,7 @@ void CStereoOVR::listDevices(std::vector &devicesOut) deviceInfoOut.Library = CStereoDeviceInfo::OVR; // "Oculus SDK"; deviceInfoOut.Manufacturer = deviceInfo.Manufacturer; deviceInfoOut.ProductName = deviceInfo.ProductName; + deviceInfoOut.AllowAuto = true; stringstream ser; ser << id; deviceInfoOut.Serial = ser.str(); // can't get the real serial from the sdk... diff --git a/code/snowballs2/client/src/camera.cpp b/code/snowballs2/client/src/camera.cpp index 28ce273bb..9d9a5f777 100644 --- a/code/snowballs2/client/src/camera.cpp +++ b/code/snowballs2/client/src/camera.cpp @@ -94,7 +94,13 @@ void initCamera() if (hmdDeviceCfg == std::string("Auto") && devices.begin() != devices.end()) { - deviceInfo = &devices[0]; + for (std::vector::iterator it(devices.begin()), end(devices.end()); it != end; ++it) + { + if (it->AllowAuto) + { + deviceInfo = &devices[0]; + } + } } else { From 44d5dc56c557b7ffe6237e9e8c89b8caf9cc26bc Mon Sep 17 00:00:00 2001 From: kaetemi Date: Tue, 4 Feb 2014 20:58:06 +0100 Subject: [PATCH 13/14] Hg ignore buildsite configuration --- .hgignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgignore b/.hgignore index d2b2848bb..29345540d 100644 --- a/.hgignore +++ b/.hgignore @@ -160,6 +160,7 @@ code/build/* code/build-2010/* build/* install/* +code/nel/tools/build_gamedata/configuration/buildsite.py # Linux nel compile code/nel/build/nel-config From c88790dc9603b9a3115ae2dee18242359fc9d0e9 Mon Sep 17 00:00:00 2001 From: botanic Date: Wed, 5 Feb 2014 13:04:18 -0800 Subject: [PATCH 14/14] remove sleep on ams install --- .../ryzom/tools/server/ryzom_ams/www/html/installer/libsetup.php | 1 - 1 file changed, 1 deletion(-) diff --git a/code/ryzom/tools/server/ryzom_ams/www/html/installer/libsetup.php b/code/ryzom/tools/server/ryzom_ams/www/html/installer/libsetup.php index 17288784a..2809ab05d 100644 --- a/code/ryzom/tools/server/ryzom_ams/www/html/installer/libsetup.php +++ b/code/ryzom/tools/server/ryzom_ams/www/html/installer/libsetup.php @@ -40,7 +40,6 @@ //var used to access the DB; global $cfg; - sleep(15); try{ //SETUP THE WWW DB $dbw = new DBLayer("install", "web");