Jump to content

ionutxp

Inactive Member
  • Posts

    61
  • Joined

  • Last visited

  • Feedback

    0%

Posts posted by ionutxp

  1. Hi,

     

    For some time I started to work on the source for my own server. Currently I'm at cleaning / optimizing source stage. 
    Until I get end result I need to thoroughly test any changes, to find all bugs, so I share the binary for who want to test and use in the future.
    The next step is moving all the constants from the source in configuration file to maximize the flexibility.
     

    Changelog (striped from git):

    1. - Removed texts files (item_names.txt, item_proto.txt ... ) Please use SQL.
    2. - Removed auth_brazil
    3. - Removed over9refine
    4. - Removed xtrap
    5. - Removed openid
    6. - Removed pcbang
    7. - Fixed number_ex (dice bug) and /war bug
    8. - Fixed invisibility bug
    9. - Removed non-GF locale stuff
    10. - Removed many warnings
    11. - Moved exp_table to file. For eg: /home/game/share/locale/romania/exp_table.txt
    12. - Increased exp and gold to long long.
    13. - Removed passpod
    14. - Removed timelimit
    15. - Fixed bonus changing bug
    16. - Locale unification - use your locale: ex romania and specify your charset. Default: latin2
    17. - Changed mp and hp type to int. (fixed hp/mp bug)
    18. - Changed the config to YAML format file
    19. - Fixed bonus/stone exploits
    20. - Reworked exp_table loader. Now in exp_table.txt you can overwrite default values.
    21. - Added guild_exp_table overwriter.

    Download Zone:
    http://ionutmilica.com/downloads/revs/

    Latest builds:
    http://ionutmilica.com/downloads/revs/game_r1.3.5.zip
    http://ionutmilica.com/downloads/revs/db_r1.3.0.zip

    Launcher Test - compiled in debug mode (source from here): 
    http://ionutmilica.com/downloads/revs/launcher_1.2.0.zip

    Exp table overwrite:
     

    1: 100000
    4: 95
    8: 31239
    105: 99000000
    120: 43123113
    

    How to fix:

    Shared object "libboost_system.so.1.55.0" not found, required by "game"

    cd /usr/ports/devel/boost-libs
    make install clean

    I do not recommend this builds in production servers.

    • Love 14
  2. Hey,

    Today I was working to extend the qc features. I managed to add:

    - Lua defines

    - When clause functions

     

    Example:

    define DOG ""Anne has apples.""
    define NAB "red"
    define TESTX 323
    define PI 3.14
    define EXPR "if x == 10 then say(22) end"
    define _TRA_ "translate"
    quest test begin
        state start begin
            function doStuff(x, y)
                say(DOG);
            end
            function doStuffAgain(www)
                say("Test")
                say(22)
            end
            when 20088.chat.translate."SD2.ENTER" begin
                say(DOG)
                doStuff(TESTX, 12)
            end
            when TESTX.chat."Testx" begin
                EXPR;
                say("Random text ! ");
            end
        end
    end
    Now, you can translate your quest select fields with ease:
    quest test begin
        state start begin
            when 2222.chat.tra."ENTER.TITLE" begin
                say(DOG)
            end
        end
    end
    
    Make sure to have a:
    
    function tra(str_key)
       return global_table[get_language()][str_key];
    end

    when 2222.chat.x.y.z.tra.d."ENTER.TITLE" begin

    will convert to: when x(y(z(tra(d("ENTER.TITLE)))))

     

    I'll come back with the source code after some tests and, a new description and new examples.

     

    Download:

    http://ionutmilica.ro/downloads/revs/qc_last.rar

    Source code:

    This is the hidden content, please

    • Metin2 Dev 10
    • Angry 1
    • Good 1
    • Love 1
    • Love 17
  3. What is Metin2Framework ?
    - It's an old project (metin2 homepage) made 2 years ago, when I started learning OOP.
    - Has all features from the official with the old design.
    - Is mature and stable
    - It's in Romanian for the moment
     
    TODO:
    - Rewrite the site using modern code practices.
      - Remove garbage mysql_* functions
      - Add full MVC support
      - Remove noobish code
    - Split the code in modules
    - Improve theme system
    - Implement a plugin system
    - Add multi-language support
     
    This homepage was tested on production env for my server and many other romanian servers, meaning
    that all security bugs founded were fixed.
    Soon i'll post a live demo.
     
    How to install:
    1. Drop the files in a directory
    2. Edit the .htaccess Change "RewriteBase /" to "RewriteBase /metin2" if you put the files in a subdir or leave as it is if you don't.
    3. Edit application/config/config.php & application/config/database.php & application/config/email.php
    4. Change account table structure:
    CREATE TABLE IF NOT EXISTS `account` (
      `id` int(11) NOT NULL AUTO_INCREMENT,
      `login` varchar(30) NOT NULL DEFAULT '',
      `password` varchar(45) NOT NULL DEFAULT '',
      `social_id` varchar(7) NOT NULL DEFAULT '',
      `email` varchar(64) NOT NULL DEFAULT '',
      `create_time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
      `is_testor` tinyint(1) NOT NULL DEFAULT '0',
      `status` varchar(8) NOT NULL DEFAULT 'OK',
      `availDt` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
      `mileage` int(11) NOT NULL DEFAULT '0',
      `gold_expire` datetime NOT NULL DEFAULT '2012-01-01 00:00:00',
      `silver_expire` datetime NOT NULL DEFAULT '2012-01-01 00:00:00',
      `safebox_expire` datetime NOT NULL DEFAULT '2012-01-01 00:00:00',
      `autoloot_expire` datetime NOT NULL DEFAULT '2012-01-01 00:00:00',
      `fish_mind_expire` datetime NOT NULL DEFAULT '2012-01-01 00:00:00',
      `marriage_fast_expire` datetime NOT NULL DEFAULT '2012-01-01 00:00:00',
      `money_drop_rate_expire` datetime NOT NULL DEFAULT '2012-01-01 00:00:00',
      `coins` int(11) unsigned NOT NULL DEFAULT '0',
      `jd` int(11) unsigned NOT NULL DEFAULT '0',
      `register_token` varchar(64) NOT NULL,
      `register_expire` int(11) NOT NULL,
      `passlost_token` varchar(64) NOT NULL,
      `socialid_token` varchar(64) NOT NULL,
      `socialid_expire` int(11) unsigned NOT NULL DEFAULT '0',
      `new_email` varchar(64) NOT NULL,
      `email_token` varchar(64) NOT NULL,
      `email_expire` int(11) unsigned NOT NULL DEFAULT '0',
      `email_step` tinyint(2) unsigned NOT NULL DEFAULT '0',
      PRIMARY KEY (`id`),
      UNIQUE KEY `login` (`login`),
      KEY `social_id` (`social_id`)
    ) ENGINE=MyISAM  DEFAULT CHARSET=big5;
     
    Here is a github link if you want to post a issue or send a patch:
    This is the hidden content, please
    Here is the latest stable build from the master branch:
     
    All this, meanwhile I work at metin2cms that will be written in php with Laravel as framework.
     
    • Love 1
  4. Ignoring the fact that mysql_* is deprecated.

    When you make a fetch like in this example:  SELECT * FROM player.player WHERE id = 'someID'; the mysqli or pdo methods will return an array.

    How you could optimize the script (by number of lines)

    <?php
    
    class Player
    {
    	private $data;
    
    	public function __construct($playerId)
    	{
    		/** 
    		 * if playerId is integer fetch player data by `id` field else
    		 * by `name` field 
    		 */
    	}
    
    	private function fetchById($id)
    	{
    		$this->data = .....;
    	}
    
    	private function fetchByName($name)
    	{
    		$this->data = .....;
    	}
    
    	public function __get($name)
    	{
    		if (isset($this->data[$name]))
    		{
    			return $this->data[$name];
    		}
    		return false;
    	}
    
    	public function __set($name, $value)
    	{
    		if (isset($this->data[$name]))
    		{
    			$this->data[$name] = $value;
    
    			// mark field to be updated
    		}
    	}
    
    	public function __destruct()
    	{
    		// update the player table query
    	}
    }
    
    $p = new Player(10);
    // $p = new Player('Tdog');
    
    echo $p->name;
    echo $p->job;
    
    $p->name = 'JBond'; // will update the field in the database

    As for the cache, you could use JSON because is easy to use and portable. (You can load info about char with javascript, C# ... )

    Anyway thanks for the share :D

×
×
  • 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.