Jump to content

Uphillyout

Members
  • Posts

    15
  • Credits

  • Joined

  • Last visited

  • Feedback

    0%

Posts posted by Uphillyout

  1. try this configuration your MYSQL server

    [client]
    
    port=3306
    
    
    
    [mysql]
    
    default-character-set=latin1
    
    
    
    [mysqld]
    
    port=3306
    
    basedir="C:/Program Files/MySQL/MySQL Server 5.1/"
    
    datadir="C:/Program Files/MySQL/MySQL Server 5.1/Data/"
    
    default-character-set=latin1
    
    default-storage-engine=INNODB
    
    sql-mode="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"
    
    max_connections=300
    
    table_cache=3000
    
    
    
    query_cache_size=350M
    
    query_cache_type=1
    
    query_cache_limit=512k
    
    
    
    #posible que no hacen falta
    
    tmp_table_size=0M
    
    #max_heap_table_size=512M
    
    
    
    thread_cache_size=2048
    
    log_slow_queries
    
    memlock
    
    
    
    #probar esto, antes 14400
    
    wait_timeout =3600
    
    interactive_timeout=3600
    
    
    
    
    
    query_prealloc_size=16k
    
    
    
    #*** MyISAM Specific options
    
    myisam_max_sort_file_size=100G
    
    myisam_max_extra_sort_file_size=100G
    
    myisam_sort_buffer_size=30M
    
    key_buffer_size=350M
    
    read_buffer_size=64K
    
    read_rnd_buffer_size=256K
    
    sort_buffer_size=256k
    
    
    
    #*** INNODB Specific options ***
    
    innodb_data_home_dir="C:/MySQL Datafiles/"
    
    #skip-innodb
    
    innodb_additional_mem_pool_size=6M
    
    innodb_flush_log_at_trx_commit=1
    
    innodb_log_buffer_size=3M
    
    innodb_buffer_pool_size=350M
    
    innodb_log_file_size=50M
    
    innodb_thread_concurrency=8
    
    innodb_lock_wait_timeout =50
    
    innodb_file_per_table
    
    innodb_open_files=2400
    

  2. Well... is this code have any mistakes? why does not work?

     

    L2PcInstance.java

     
    // Character Transformation SQL String Definitions:
    private static final String SELECT_CHAR_TRANSFORM = "SELECT transform_id FROM characters WHERE charId=?";
    private static final String UPDATE_CHAR_TRANSFORM = "UPDATE characters SET transform_id=? WHERE charId=?";
    
    +	// Character Color System by =)
    +	private static final String INSERT_CHAR_COLOR = "INSERT INTO character_color(charId, name_color, title_color) VALUES (?,?,?)";
    +	private static final String SELECT_CHAR_COLOR = "SELECT * FROM character_color WHERE charId=?";
    +	private static final String UPDATE_CHAR_COLOR = "UPDATE character_color SET name_color=?, title_color=? WHERE charId=?";
    
    =====================================
    
    case L2PcInstance.STORE_PRIVATE_MANUFACTURE:
            		activeChar.sendPacket(new RecipeShopMsg(this));
            		break;
            }
        }
    
    +	/**
    +	 * method fo restore colors from database
    +	 * and insert if in database if not exists
    +	 * @author =)
    +	 */
    +	public void restoreColor()
    +	{
    +		Connection con = null;
    +		PreparedStatement statement = null;
    +		ResultSet rset = null;
    +        try
    +        {
    +            con = L2DatabaseFactory.getInstance().getConnection();
    +            statement = con.prepareStatement(SELECT_CHAR_COLOR);
    +            statement.setInt(1, getObjectId());
    +            rset = statement.executeQuery();
    +
    +			if (rset.next())
    +            {
    +               	getAppearance().setNameColor(Integer.decode((new +StringBuilder()).append("0x").append(rset.getString("name_color")).toString()).intValue());
    +                getAppearance().setTitleColor(Integer.decode((new +StringBuilder()).append("0x").append(rset.getString("title_color")).toString()).intValue());
    +            }
    +			else
    +			{
    +				con = L2DatabaseFactory.getInstance().getConnection();
    +           	 	statement = con.prepareStatement(INSERT_CHAR_COLOR);
    +            	statement.setInt(1, getObjectId());
    +            	statement.setString(2, Integer.toHexString(getAppearance().getNameColor()).toUpperCase());
    +            	statement.setString(3, Integer.toHexString(getAppearance().getTitleColor()).toUpperCase());
    +            	statement.execute();
    +			}
    +        }
    +        catch (Exception e)
    +        {
    +            _log.warning("could not restore colors: "+e);
    +        }
    +        finally
    +        {
    +            try{ con.close(); statement.close(); rset.close();}
    +
    +			catch(SQLException e) {}
    +        }
    +	}
    +
    +	/**
    +	 * Store colors
    +	 * @author =)
    +	 */
    +    private void storeColor()
    +    {
    +
    +       	Connection con = null;
    +		PreparedStatement statement = null;
    +        try
    +        {
    +            con = L2DatabaseFactory.getInstance().getConnection();
    +            statement = con.prepareStatement(UPDATE_CHAR_COLOR);
    +            statement.setString(1, Integer.toHexString(getAppearance().getNameColor()).toUpperCase());
    +            statement.setString(2, Integer.toHexString(getAppearance().getTitleColor()).toUpperCase());
    +            statement.setInt(3, getObjectId());
    +            statement.execute();
    +        }
    +        catch (Exception e)
    +        {
    +            _log.warning("could not store colors: "+e);
    +			e.printStackTrace();
    +        }
    +        finally
    +        {
    +            try
    +			{
    +				con.close(); statement.close();
    +			}
    +            catch(SQLException e) {}
    +        }
    +	}

     

    And MYSQL

    -- ----------------------------------------
    -- Table structure for `character_color` --
    -- ----------------------------------------
    DROP TABLE IF EXISTS `character_color`;
    CREATE TABLE `character_color` (
      `charId` decimal(11,0) NOT NULL DEFAULT '0',
      `name_color` char(6) NOT NULL DEFAULT 'FFFFFF',
      `title_color` char(6) NOT NULL DEFAULT 'FFFF77',
      PRIMARY KEY (`charId`)
    ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
    -------------------------------------------

  3. Can anyone tell me plz, how i can TODO this "mod"...

     

    On server allow only latin, without any special symbols like "$" "#" "=" etc...

    I want to spawn NPC. For donation money that NPC will change player's name to "iam^bad^**#@BOY" or other... how wish donator...

     

    i mean like this, but with special symbols... I wanna to have this NPC !! =)) thx

    1233956542_name.jpg

     

×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock