-
Posts
22 -
Joined
-
Last visited
-
Feedback
0%
Content Type
Forums
Store
Third Party - Providers Directory
Feature Plan
Release Notes
Docs
Events
Posts posted by Sphinx²
-
-
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
-
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
- 8
- 2
- 2
-
I prefere the usement of direct access to the D partition.
Is much better than usement of external tools.
Kind regards
Sphinx
- 1
-
Not everyone can develop their own core and for those who can't I suggest using the Vanilla Core.
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
-
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
-
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:
https://forums.freebsd.org/viewtopic.php?&t=23871
BTW: Set your compiler in your makefile back to g++ and gcc instead of g++48 and gcc48.
Kind regards
Sphinx
-
Download the korean letter. (Language package)
Kind regards
Sphinx
- 1
-
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
-
We have the source....
Update the Client to granny 2.8?
Kind regards
Sphinx
-
Or use Nginx
Kind regards
Sphinx
- 1
-
Yeah the same issue I have but with an other script.
If anyone know whats wrong please help us .
Kind regards
Sphinx
-
Try to write the username over the shell script to a log file.
Then check the user his permissions.
Kind regards
Sphinx
- 1
-
Hi, good afternoon.
This is a very nice script but I have a little problem with the cron part and I would like to know if you also happens and if you could solve.
I put in the crontab this to test it
* * * * * root sh /Cron/auto_back.sh all
It do the auto_back.sh every min, but not dump the tables and not upload the files, it generates a empty empyfiles.gz, to test if the cron works I put in the script header
echo "test" >> /log_auto
And It works, every mins. insert test in the /log_auto.
If I do manually it works.
Does anyone know how can be solved?
Kind regards.
The same error I have with my auto vpn cron.
I think there is a permission problem.
btw: nice script
Kind regards
Sphinx
-
for sure, for better protection, you can make some password protection for your game file with a little c++ codes..
Why not use a license server?
(But no one will use your compiled game core anymore... because the source is public).
Kind regards
Sphinx
-
I hate yasuo.....
The wall is so op...
-
I know, but I don't think its a bad idea to recheck again.
The other functions of ymir dont recheck the permissions.
But if you think you have more security with this check then use it.
- 1
-
Guys this anti_exp ring is very very dangerous.
When the player use the exp ring before a level up like 10.9k exp of 11k exp and he activate the exp ring.
After a kill he gains the next level and the exp will be setted by the quest.
After this he kills again a mob and have the (- exp + the next exp).
You have to freeze the exp function of the character like this (not the full code):
void CHARACTER::SetExp(DWORD exp) { if(!ExpDisabled()) { m_points.exp = exp; } }
Kind regards
Sphinx
-
Why you have this part in your code?
if (!ch || ch->GetGMLevel() != GM_IMPLEMENTOR) // Again change here the rights { sys_log(0, "do_ban without rights %s[%d]", ch->GetName(), ch->GetPlayerID()); return; }
The command interpreter is already checking the permissions.
Kind regards
Sphinx
- 4
-
cool, I remember they had this in Metin2US before using the same color code system and it was removed because people didn't want to only use it to sell and buy items. I've been looking for this modification for such a long time.
UndergroundMt2 used the same system but with python code.
You can append the same color codes over python.
@Topic: Not bad
- 1
-
You have to convert your gr2 models with the granny_converter.
Useless Funny - version.h
in Programming & Scripts
Posted
Just why?