Jump to content

.InyaProduction

Former Staff
  • Posts

    511
  • Joined

  • Last visited

  • Days Won

    10
  • Feedback

    0%

Posts posted by .InyaProduction

  1.  

    With other bin i can connet with my server it not habe any problem :S and I have 40k sv (40250)

     

    This is my syserr.txt:

    0324 01:03:11346 :: Traceback (most recent call last):
    
    0324 01:03:11347 ::   File "networkModule.py", line 205, in SetSelectCharacterPhase
    
    0324 01:03:11347 ::   File "exception.py", line 28, in Abort
    
    0324 01:03:11347 ::   File "exception.py", line 9, in GetExceptionString
    
    0324 01:03:11347 ::   File "system.py", line 137, in __pack_import
    
    0324 01:03:11347 :: ImportError
    0324 01:03:11347 :: : 
    0324 01:03:11347 :: Bad magic number in libtraceback.pyc
    0324 01:03:11347 :: 
    
    

    Use this lib folder for you client:

     

    ExternPython26lib

     

    copy the whole one to your client ;)

  2. Kill counted twice fix:

    0017F637: 89 90
    0017F638: 5C 90
    0017F639: 24 90
    0017F63A: 04 90
    0017F63B: 89 90
    0017F63C: 04 90
    0017F63D: 24 90
    0017F63E: E8 90
    0017F63F: 9D 90
    0017F640: DC 90
    0017F641: 00 90
    0017F642: 00 90 
  3. Invisible bug.

    Hp/Mp bug overflow.

    Item.remove -> removing whole stack of items instead of one.

    Remove Metin2Server_Check|isInvalid functions.

    INTERNAL Ip fix.

    @up

    To remove licence you should search for "GLOBAL_TIME" and simply comment all of that code.

    Item.remove is meant to remove the stack..

     

    pc.remove_item(item.vnum, wished number) is made to remove only a number ;)

  4. M2 Download Center

    This is the hidden content, please
    ( Internal )

    This one is just interesting for ppl with php knowledge.

    You have to have an active mysql connection to your server with SELECT rights to player.player

    There are 2 methods for now:

    loadPlayerByName($string);

    loadPlayerById($int);

    it will return an array with the most important information, aswell as caching the informations for 5 minutes (variable with setCacheTime($seconds) ;)

    The cache will look like this atm:

     

    ID:::11159
    NAME:::Rain
    LEVEL:::80
    ACC_ID:::1
    EXP:::277
    JOB:::6
    X:::64184
    Y:::183833
    MAP:::21
    E_X:::64184
    E_Y:::183833
    E_MAP:::21
    HP:::3693
    MP:::1722
    PLAYTIME:::79
    VIT:::3
    STR:::5
    INT:::5
    DEX:::3
    STATS:::238
    GOLD:::0
    IP:::5.148.132.52
    SKGRP:::1
    HORSE_LEVEL:::0
    RIDING:::0
    HSTATS:::0
    STATRESET:::0
    CHANGENAME:::0
    SKILL_POINT:::0
    LAST_PLAY:::2011-05-16 16:02:57
    ALIGNMENT:::491

    Ok without further speaking heres the code (at the bottom is an example for initialising an an print_r on the return:

     

    <?php
    class char{
    	function __construct(){
    		$this->charinfo['id'] = 0;
    		$this->charinfo['name'] = "";
    		$this->charinfo['level'] = 0;
    		$this->charinfo['account_id'] = 0;
    		$this->charinfo['exp'] = 0;
    		$this->charinfo['job'] = 0;
    		$this->charinfo['x'] = 0;
    		$this->charinfo['y'] = 0;
    		$this->charinfo['map_index'] = 0;
    		$this->charinfo['exit_x'] = 0;
    		$this->charinfo['exit_y'] = 0;
    		$this->charinfo['exit_map_index'] = 0;
    		$this->charinfo['hp'] = 0;
    		$this->charinfo['mp'] = 0;
    		$this->charinfo['playtime'] = 0;
    		$this->charinfo['ht'] = 0;
    		$this->charinfo['st'] = 0;
    		$this->charinfo['iq'] = 0;
    		$this->charinfo['dx'] = 0;
    		$this->charinfo['stat_point'] = 0;
    		$this->charinfo['skill_point'] = 0;
    		$this->charinfo['alignment'] = 0;
    		$this->charinfo['last_play'] = "";
    		$this->charinfo['gold'] = 0;
    		$this->charinfo['ip'] = "";
    		$this->charinfo['skill_group'] = 0;
    		$this->charinfo['horse_level'] = 0;
    		$this->charinfo['horse_riding'] = 0;
    		$this->charinfo['horse_skill_point'] = 0;
    		$this->charinfo['stat_reset_count'] = 0;
    		$this->charinfo['change_name'] = 0;
    		$this->cache = new char_cachemanager();
    	}
    	
    	public function loadPlayerById($id, $reload = false){
    		$cached_char = $this->cache->loadCharById($id);
    		if($cached_char != false && $reload == false){
    			$this->charinfo['id'] = $id;
    			$this->charinfo['name'] = $cached_char['NAME'];
    			$this->charinfo['level'] = $cached_char['LEVEL'];
    			$this->charinfo['account_id'] = $cached_char['ACC_ID'];
    			$this->charinfo['exp'] = $cached_char['EXP'];
    			$this->charinfo['job'] = $cached_char['JOB'];
    			$this->charinfo['x'] = $cached_char['X'];
    			$this->charinfo['y'] = $cached_char['Y'];
    			$this->charinfo['map_index'] = $cached_char['MAP'];
    			$this->charinfo['exit_x'] = $cached_char['E_X'];
    			$this->charinfo['exit_y'] = $cached_char['E_Y'];
    			$this->charinfo['exit_map_index'] = $cached_char['E_MAP'];
    			$this->charinfo['hp'] = $cached_char['HP'];
    			$this->charinfo['mp'] = $cached_char['MP'];
    			$this->charinfo['playtime'] = $cached_char['PLAYTIME'];
    			$this->charinfo['ht'] = $cached_char['VIT'];
    			$this->charinfo['st'] = $cached_char['STR'];
    			$this->charinfo['iq'] = $cached_char['INT'];
    			$this->charinfo['dx'] = $cached_char['DEX'];
    			$this->charinfo['stat_point'] = $cached_char['STATS'];
    			$this->charinfo['skill_point'] = $cached_char['SKILL_POINT'];
    			$this->charinfo['alignment'] = $cached_char['ALIGNMENT'];
    			$this->charinfo['last_play'] = $cached_char['LAST_PLAY'];
    			$this->charinfo['gold'] = $cached_char['GOLD'];
    			$this->charinfo['ip'] = $cached_char['IP'];
    			$this->charinfo['skill_group'] = $cached_char['SKGRP'];
    			$this->charinfo['horse_level'] = $cached_char['HORSE_LEVEL'];
    			$this->charinfo['horse_riding'] = $cached_char['RIDING'];
    			$this->charinfo['horse_skill_point'] = $cached_char['HSTATS'];
    			$this->charinfo['stat_reset_count'] = $cached_char['STATRESET'];
    			$this->charinfo['change_name'] = $cached_char['CHANGENAME'];
    			return $this->charinfo;
    		} else {
    			$player_mysql = mysql_query("SELECT `id`, `account_id`, `name`, `job`, `voice`, `dir`, `x`, `y`, `z`, `map_index`, `exit_x`, `exit_y`, `exit_map_index`, `hp`, `mp`, `stamina`, `random_hp`, `random_sp`, `playtime`, `level`, `level_step`, `st`, `ht`, `dx`, `iq`, `exp`, `gold`, `stat_point`, `skill_point`, `quickslot`, `ip`, `part_main`, `part_base`, `part_hair`, `skill_group`, `skill_level`, `alignment`, `last_play`, `change_name`, `mobile`, `sub_skill_point`, `stat_reset_count`, `horse_hp`, `horse_stamina`, `horse_level`, `horse_hp_droptime`, `horse_riding`, `horse_skill_point` FROM `player`.`player` WHERE id = ".$id);
    			$player = mysql_fetch_array($player_mysql);
    			if(!$player)
    				return false;
    			foreach ($player as $key => $info){
    				if(!is_numeric($key))
    					$this->charinfo[$key] = $info;
    			}
    			$this->cache->writeCache($this->charinfo);
    			return $this->charinfo;
    		}
    	}
    	
    	public function loadPlayerByName($name, $reload = false){
    		$cached_char = $this->cache->loadCharByName($name);
    		if($cached_char != false && $reload == false){
    			$this->charinfo['id'] = $cached_char['ID'];
    			$this->charinfo['name'] = $cached_char['NAME'];
    			$this->charinfo['level'] = $cached_char['LEVEL'];
    			$this->charinfo['account_id'] = $cached_char['ACC_ID'];
    			$this->charinfo['exp'] = $cached_char['EXP'];
    			$this->charinfo['job'] = $cached_char['JOB'];
    			$this->charinfo['x'] = $cached_char['X'];
    			$this->charinfo['y'] = $cached_char['Y'];
    			$this->charinfo['map_index'] = $cached_char['MAP'];
    			$this->charinfo['exit_x'] = $cached_char['E_X'];
    			$this->charinfo['exit_y'] = $cached_char['E_Y'];
    			$this->charinfo['exit_map_index'] = $cached_char['E_MAP'];
    			$this->charinfo['hp'] = $cached_char['HP'];
    			$this->charinfo['mp'] = $cached_char['MP'];
    			$this->charinfo['playtime'] = $cached_char['PLAYTIME'];
    			$this->charinfo['ht'] = $cached_char['VIT'];
    			$this->charinfo['st'] = $cached_char['STR'];
    			$this->charinfo['iq'] = $cached_char['INT'];
    			$this->charinfo['dx'] = $cached_char['DEX'];
    			$this->charinfo['stat_point'] = $cached_char['STATS'];
    			$this->charinfo['skill_point'] = $cached_char['SKILL_POINT'];
    			$this->charinfo['alignment'] = $cached_char['ALIGNMENT'];
    			$this->charinfo['last_play'] = $cached_char['LAST_PLAY'];
    			$this->charinfo['gold'] = $cached_char['GOLD'];
    			$this->charinfo['ip'] = $cached_char['IP'];
    			$this->charinfo['skill_group'] = $cached_char['SKGRP'];
    			$this->charinfo['horse_level'] = $cached_char['HORSE_LEVEL'];
    			$this->charinfo['horse_riding'] = $cached_char['RIDING'];
    			$this->charinfo['horse_skill_point'] = $cached_char['HSTATS'];
    			$this->charinfo['stat_reset_count'] = $cached_char['STATRESET'];
    			$this->charinfo['change_name'] = $cached_char['CHANGENAME'];
    			return $this->charinfo;
    		} else {
    			$player_mysql = mysql_query("SELECT `id`, `account_id`, `name`, `job`, `voice`, `dir`, `x`, `y`, `z`, `map_index`, `exit_x`, `exit_y`, `exit_map_index`, `hp`, `mp`, `stamina`, `random_hp`, `random_sp`, `playtime`, `level`, `level_step`, `st`, `ht`, `dx`, `iq`, `exp`, `gold`, `stat_point`, `skill_point`, `quickslot`, `ip`, `part_main`, `part_base`, `part_hair`, `skill_group`, `skill_level`, `alignment`, `last_play`, `change_name`, `mobile`, `sub_skill_point`, `stat_reset_count`, `horse_hp`, `horse_stamina`, `horse_level`, `horse_hp_droptime`, `horse_riding`, `horse_skill_point` FROM inyaproduction_.`player` WHERE name = '".$name."'") or die(mysql_error());
    			$player = mysql_fetch_array($player_mysql);
    			if(!$player)
    				return false;
    			foreach ($player as $key => $info){
    				if(!is_numeric($key))
    					$this->charinfo[$key] = $info;
    			}
    			$this->cache->writeCache($this->charinfo);
    			return $this->charinfo;
    		}
    	}
    
        public function setCacheTime($seconds){
            $this->cache->setCacheTime($seconds);
        }
    
    	function __destruct(){
    	}
    	
    }
    
    class char_cachemanager{
    	function __construct(){
    		$this->cachedir = "./cached_chars/";
    		if(!is_dir($this->cachedir)){
    			mkdir($this->cachedir);
    		}
    		$this->chars = array();
    		if(!$this->loadCachedChars())
    			die("Character Cache: Error on loading cache");
            $this->cachetime = 300; //5 minutes
    	}
    
        public function setCacheTime($seconds){
            $this->cachetime = $seconds;
        }
    	public function loadCachedChars(){
    		$cachefiles = scandir($this->cachedir);
    		foreach ($cachefiles as $file) {
    			if(!($file == "." or $file == "..")){
    				$filename = $file;
    				$temp = explode(".", $file);
    				$file = $temp[0];
    				$data = explode("_", $file);
    				$this->chars[$data[0]]['name'] = $data[1];
    				$this->chars[$data[0]]['time'] = $data[2];
    				$this->chars[$data[0]]['filename'] = $filename;
    			}
    		};
    		return true;
    	}
    	
    	public function loadFile($filename){
    		if(file_exists($this->cachedir.$filename)){
    			$data = file_get_contents($this->cachedir.$filename);
    			$lines = explode("n", $data);
    			$character = array();
    			foreach($lines as $line){
    				$detail = explode(":::", $line);
    				$character[$detail[0]] = $detail[1];
    			}
    			return $character;
    		}
    		return false;
    	}
    	
    	public function loadCharById($id){
    		if(isset($this->chars[$id]) && $this->chars[$id]['time'] + $this->cachetime < time())
    			return $this->loadFile($this->chars[$id]['filename']);
    
    		return false;
    	}
    	
    	public function loadCharByName($name){
    		foreach($this->chars as $key => $char){
    			if($char['name'] == $name && $this->chars[$key]['time'] + $this->cachetime < time())
    				return $this->loadFile($this->chars[$key]['filename']);
    		}
    		return false;
    	}
    	
    	public function writeCache($array){
    		$filename = $array['id']."_".$array['name']."_".time();
    		$file = fopen($this->cachedir.$filename, 'w');
    		$text = "
    ID:::".$array['id']."
    NAME:::".$array['name']."
    LEVEL:::".$array['level']."
    ACC_ID:::".$array['account_id']."
    EXP:::".$array['exp']."
    JOB:::".$array['job']."
    X:::".$array['x']."
    Y:::".$array['y']."
    MAP:::".$array['map_index']."
    E_X:::".$array['exit_x']."
    E_Y:::".$array['exit_y']."
    E_MAP:::".$array['exit_map_index']."
    HP:::".$array['hp']."
    MP:::".$array['mp']."
    PLAYTIME:::".$array['playtime']."
    VIT:::".$array['ht']."
    STR:::".$array['st']."
    INT:::".$array['iq']."
    DEX:::".$array['dx']."
    STATS:::".$array['stat_point']."
    GOLD:::".$array['gold']."
    IP:::".$array['ip']."
    SKGRP:::".$array['skill_group']."
    HORSE_LEVEL:::".$array['horse_level']."
    RIDING:::".$array['horse_riding']."
    HSTATS:::".$array['horse_skill_point']."
    STATRESET:::".$array['stat_reset_count']."
    CHANGENAME:::".$array['change_name']."
    SKILL_POINT:::".$array['skill_point']."
    LAST_PLAY:::".$array['last_play']."
    ALIGNMENT:::".$array['alignment'];
    		fwrite($file, $text);
    	}
    	
    }
    
    $character = new char();
    print_r($character->loadPlayerByName("Rain"));

    Have fun with that :P

    • Metin2 Dev 1
    • Love 8
×
×
  • 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.