Форум администраторов игровых серверов

Форум администраторов игровых серверов (https://forum.zone-game.info/TT.php)
-   Lineage II (https://forum.zone-game.info/forumdisplay.php?f=34)
-   -   how can i add a language in overword codes (https://forum.zone-game.info/showthread.php?t=28183)

iquelite 11.04.2013 17:14

how can i add a language in overword codes
 
how can i add a language : CHINESE("cn"),

in overword codes

always thanks


Код:

package l2p.gameserver.utils;

/**
 * @author VISTALL
 * @date 13:50/29.03.2011
 */
public enum Language
{
        CHINESE("cn"),
        ENGLISH("en"),
        RUSSIAN("ru");

        public static final Language[] VALUES = Language.values();

        private String _shortName;

        Language(String shortName)
        {
                _shortName = shortName;
        }

        public String getShortName()
        {
                return _shortName;
        }
}

run server then
throwexception in l2p.gameserver.data.htm.HtmCache.java

Код:


        public void clear()
        {
                for(int i = 0; i < _cache.length; i++)
                {
                        _cache[i].removeAll();  // <-- nullpointerexception
                }
        }


L2CCCP 11.04.2013 17:31

Re: how can i add a language in overword codes
 
Цитата:

Сообщение от iquelite (Сообщение 292436)
Код:


        public void clear()
        {
                for(int i = 0; i < _cache.length; i++)
                {
                        _cache[i].removeAll();  // <-- nullpointerexception
                }
        }


 
	public void clear()
	{
		for(int i = 0; i < _cache.length; i++)
		{
			if(_cache[i] != null) 
			{
				_cache[i].removeAll();
			}
		}
	}
 
Code: Java
Test.

UPD: If this is not heal npe, copy error, code HtmCache.java and Player.java (piece of code with the language variables)

iquelite 11.04.2013 17:38

Re: how can i add a language in overword codes
 
Цитата:

Сообщение от L2CCCP (Сообщение 292440)
 
	public void clear()
	{
		for(int i = 0; i < _cache.length; i++)
		{
			if(_cache[i] != null) 
			{
				_cache[i].removeAll();
			}
		}
	}
 
Code: Java
Test.

tried you'll see another exception in line
_log.info(String.format("HtmCache: parsing %d documents; lang: %s.", c.getSize(), Language.VALUES[i]));

i do not know why get this exception

L2CCCP 11.04.2013 17:48

Re: how can i add a language in overword codes
 
copy error, HtmCache.java and Player.java (piece code with the language variables)

KilRoy 11.04.2013 18:13

Re: how can i add a language in overword codes
 
Cache...lol...
ehcache.xml:
Код:

    <!-- HtmCache -->
    <cache name="ru.ljts.gameserver.data.htm.HtmCache.RUSSIAN" eternal="true" memoryStoreEvictionPolicy="LRU" maxElementsInMemory="100000" overflowToDisk="false"/>

to add here;)

L2CCCP 11.04.2013 18:31

Re: how can i add a language in overword codes
 
Цитата:

Сообщение от KilRoy (Сообщение 292450)
Cache...lol...
ehcache.xml:
Код:

    <!-- HtmCache -->
    <cache name="ru.ljts.gameserver.data.htm.HtmCache.RUSSIAN" eternal="true" memoryStoreEvictionPolicy="LRU" maxElementsInMemory="100000" overflowToDisk="false"/>

to add here;)

off:
Свернуть ↑Развернуть ↓

iquelite 12.04.2013 15:16

Re: how can i add a language in overword codes
 
Цитата:

Сообщение от KilRoy (Сообщение 292450)
Cache...lol...
ehcache.xml:
Код:

    <!-- HtmCache -->
    <cache name="ru.ljts.gameserver.data.htm.HtmCache.RUSSIAN" eternal="true" memoryStoreEvictionPolicy="LRU" maxElementsInMemory="100000" overflowToDisk="false"/>

to add here;)

Solved :db:


Текущее время: 02:11. Часовой пояс GMT +3.

Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd. Перевод: zCarot