Jump to content

Sphinx²

Member
  • Posts

    22
  • Joined

  • Last visited

  • Feedback

    0%

About Sphinx²

  • Birthday 02/11/1993

Informations

  • Gender
    Male

Recent Profile Visitors

4465 profile views

Sphinx²'s Achievements

Apprentice

Apprentice (3/16)

  • Conversation Starter
  • First Post
  • Collaborator
  • Week One Done
  • One Month Later

Recent Badges

23

Reputation

  1. Screenshot of my nVidia center: Windows rating: My SSD is not optimized to AHCI. Need to do that in the next few days. CPU-Z Report: Details: - Asus Rampage IV Black Edition - Intel i7 4930K 3,4 GHZ - GeForce GTX Titan Black - 16 GB Kingston RAm 1666 (I'm not sure) - Corsair Platinum 1000W - 2 SSD 256 GB Ram - 3x 1 TB 7'200 RPM Kind Regards Sphinx
  2. M2 Download Center Download Here ( Internal ) Hey guys, I want to release my old DBManager. I wrote it for my current CMS. I recoded it and now I dont need the old one anymore. You can use multiple instances with setting the instance id to 2 or 3. <?php /** * Author: Sphinx² * Descr: Database manager class */ class dbmanager { private $dbconnection = false; private $connected; private $logging; static private $instance = array(); private $instancen_id; private $host; private $username; private $password; private static $querys = 0; private static $escapes = 0; /** * Set instance id for manage log files */ public function setInstanceID($instance_id) { $this->instancen_id = $instance_id; } /** * dbmanager singleton (with multi instance support for multiple connections over the db manager) */ public static function instance($instance_id=1) { if ( !isset(self::$instance[$instance_id]) ) { self::$instance[$instance_id] = new self; } self::$instance[$instance_id]->setInstanceID($instance_id); return self::$instance[$instance_id]; } /** * dbmanager check instance */ public static function instanceExists($instance_id=1) { if ( !isset(self::$instance[$instance_id]) ) { return false; } else { return self::$instance[$instance_id]->connected(); } return true; } /** * Check if instance is connected */ public function connected() { return $this->connected; } /** * Initialize the log file and other init shit */ public function init() { } /** * Set connect details */ public function setConnection($host,$username,$password="") { $this->host = $host; $this->username = $username; $this->password = $password; } /** * mysql_connect */ public function connect() { if(!$this->connected()) { $this->dbconnection = @mysql_connect($this->host,$this->username,$this->password); if($this->dbconnection) { $this->connected = true; return true; } else { $this->connected = false; return false; } } else { return $this->connected(); } } /** * mysql_query */ public function query($strquery) { if(!$this->dbconnection) { if(!$this->connect()) { // Error reporting } } if($this->dbconnection) { self::$querys++; $query = mysql_query($strquery,$this->dbconnection); if($query) { return $query; } else { return false; } } else { return false; } } /** * mysql_real_escape_string */ public function escape($strescape) { if(!$this->dbconnection) { if(!$this->connect()) { // Error reporting } } if($this->dbconnection) { //$this->escapes++; self::$escapes++; return mysql_real_escape_string($strescape,$this->dbconnection); } else { die("DBManager: Failed to escape string (Connection lost)"); } } /** * mysql_fetch_object first row */ public function fetcho($strquery) { if(!$this->dbconnection) { if(!$this->connect()) { // Error reporting } } if($this->dbconnection) { $query = mysql_query($strquery,$this->dbconnection); if($query) { $object = mysql_fetch_object($query); } else { $object = NULL; } return $object; } return NULL; } /** * mysql_fetch_object */ public static function fetchobj($resource) { return mysql_fetch_object($resource); } /* * mysql_fetch_array */ public static function fetcharr($resource) { return mysql_fetch_array($resource); } /** * mysql_num_row */ public static function num_rows($resource) { return mysql_num_rows($resource); } public function insertID() { return mysql_insert_id($this->dbconnection); } /** * mysql_fetch_assoc */ public function fetcha($strquery) { if(!$this->dbconnection) { if(!$this->connect()) { // Error reporting } } if($this->dbconnection) { $query = mysql_query($strquery,$this->dbconnection); if($query) { $array = mysql_fetch_assoc($query); } else { $array = NULL; } return $array; } return NULL; } /** * return query count */ public static function getQueryCount() { return self::$querys; } /** * return escape count */ public static function getEscapeCount() { return self::$escapes; } /** * shutdown */ public function shutdown() { if($this->dbconnection && $this->connected) { $this->connected = false; mysql_close($this->dbconnection); } } } ?> Method 1: dbmanager::instance(1)->init(); dbmanager::instance(1)->setConnection("127.0.0.1","root","password"); if(dbmanager::instance(1)->connect()) { $ret = dbmanager::instance()->query("SELECT * FROM account WHERE id = '".dbmanager::instance(1)->escape("some string or something else")."'"); if($ret) { // Maybe fetch array or something else $arr = dbmanager::fetcharr($ret); echo $arr["login"]; } else { // Some code here } } dbmanager::instance(1)->shutdown(); // Kill connection Method 2 (Its not important to use the connect function if you dont use the escape function in your query: dbmanager::instance(1)->init(); dbmanager::instance(1)->setConnection("127.0.0.1","root","password"); $ret = dbmanager::instance()->query("SELECT * FROM account"); if($ret) { // Maybe fetch array or something else $arr = dbmanager::fetcharr($ret); echo $arr["login"]; } else { // Some code here } dbmanager::instance(1)->shutdown(); // Kill connection The error reporting is not included. You can write your own reporting with logfiles or something else. This is based on the mysql php extension. To port it to mysqli is easy I think. Kind regards Sphinx
  3. I prefere the usement of direct access to the D partition. Is much better than usement of external tools. Kind regards Sphinx
  4. No one how now how to work with the source will use this Vanilla Core. The reason for that is that the source code isn't available. Kind regards Sphinx
  5. Hello guys, right now I'm working on my base client and I have errors that I saw often. Now I just try to fix them but I can't find the reason for that stupid error. The error description: - Sometimes I have terrains(textures) or actually dds files that can not be loaded by the eterpack library. CEterPackManager::Get (Called from CResource::Load()) return false but the file is existing in the archive (for sure) #ifdef _DEBUG if(!GetFromPack(rMappedFile, c_szFileName, pData)) { Tracenf("CEterPackManager::Get: Failed to get file from pack %s.",c_szFileName); if (GetFromFile(rMappedFile, c_szFileName, pData)) { return true; } else { Tracenf("CEterPackManager::Get: Failed to get file from dir %s.",c_szFileName); return false; } return false; } #else if (GetFromFile(rMappedFile, c_szFileName, pData)) { return true; } return GetFromPack(rMappedFile, c_szFileName, pData); #endif Now I decided to change the file type to 0 (My friend xXDemonenXx had the idea). Then it works. Actually I search the reason for that but I can not find that. With type 2 the file not exists and the terrain is white but with type 0 it is still here. Does anyone of you guys had the same problem or have any idea whats the reason for that? Kind regards Sphinx
  6. First of all I think its not a good idea to use an newer compiler in your release build. I think there is a reaon of ymir for using an old compiler. And try this: [Hidden Content] BTW: Set your compiler in your makefile back to g++ and gcc instead of g++48 and gcc48. Kind regards Sphinx
  7. Download the korean letter. (Language package) Kind regards Sphinx
  8. I think that Heavy's tool is searching for the offsets. So u can use it on your own binary I think. But I'm not sure... You have to test it. Kind regards Sphinx
  9. Sphinx²

    Granny 2.8

    We have the source.... Update the Client to granny 2.8? Kind regards Sphinx
  10. Yeah the same issue I have but with an other script. If anyone know whats wrong please help us . Kind regards Sphinx
  11. Try to write the username over the shell script to a log file. Then check the user his permissions. Kind regards Sphinx
  12. The same error I have with my auto vpn cron. I think there is a permission problem. btw: nice script Kind regards Sphinx
  13. Why not use a license server? (But no one will use your compiled game core anymore... because the source is public). Kind regards Sphinx
×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.