Jump to content
Sign in to follow this  
stif1er

lostworld 0.4v lottery

Recommended Posts

Добрый день товарищи! Может найдется у кого время на подсказку.. Решил включить лоттерею на сборке и при попытке выбрать число у нпс диалог закрывается и сервер выдает ошибку в логах. Может кто знает как решить? Что-то с байпасами..

[22:40:24] ERROR Error while handling bypass: npc_268445360_Loto 1 via NPC 30990 Lottery Ticket Seller
java.lang.IllegalArgumentException: Incorrect name: fore="L2UI.lottoNum01" back="L2UI.lottoNum01a_check"
        at org.mmocore.gameserver.network.l2.components.HtmlMessage.replace(HtmlMessage.java:97)
        at org.mmocore.gameserver.model.instances.LotteryManagerInstance.showLotoWindow(LotteryManagerInstance.java:118)
        at org.mmocore.gameserver.model.instances.LotteryManagerInstance.onBypassFeedback(LotteryManagerInstance.java:34)
        at org.mmocore.gameserver.network.l2.c2s.RequestBypassToServer.runImpl(RequestBypassToServer.java:102)
        at org.mmocore.gameserver.network.l2.c2s.L2GameClientPacket.run(L2GameClientPacket.java:50)
        at org.mmocore.commons.net.nio.impl.MMOExecutableQueue.run(MMOExecutableQueue.java:55)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748)
        at org.mmocore.commons.threading.PriorityThreadFactory$1.run(PriorityThreadFactory.java:35)

Share this post


Link to post
Share on other sites

по ошибке же все и так понятно - некорректно сформирована ссылка в диалоге

изучай хтмлки лотореи и думай что не так

Share this post


Link to post
Share on other sites
В 18.07.2020 в 22:45, Gaikotsu сказал:

по ошибке же все и так понятно - некорректно сформирована ссылка в диалоге

изучай хтмлки лотореи и думай что не так

Проблема в том что в хтмлке все правильно. Сравнил с другими сборками. Даже в файле(путь ниже) все аналогично другим сборкам.  Знать бы как дебажить сборку  в тех или иных местах :)

org.mmocore.gameserver.model.instances.LotteryManagerInstance

 

Share this post


Link to post
Share on other sites
1 час назад, stif1er сказал:

Проблема в том что в хтмлке все правильно. Сравнил с другими сборками. Даже в файле(путь ниже) все аналогично другим сборкам.  Знать бы как дебажить сборку  в тех или иных местах :)


org.mmocore.gameserver.model.instances.LotteryManagerInstance

 

запускаешь через ide, ставишь точку и дальше уже дебажишь)

Share this post


Link to post
Share on other sites

а судя по ошибки у тебя bypass не верно сформирован походу. На две части поделилась строка

[22:40:24] ERROR Error while handling bypass: npc_268445360_Loto 1 via NPC 30990 Lottery Ticket Seller
java.lang.IllegalArgumentException: Incorrect name: fore="L2UI.lottoNum01" back="L2UI.lottoNum01a_check"

Share this post


Link to post
Share on other sites
17 часов назад, Evolution сказал:

а судя по ошибки у тебя bypass не верно сформирован походу. На две части поделилась строка


[22:40:24] ERROR Error while handling bypass: npc_268445360_Loto 1 via NPC 30990 Lottery Ticket Seller
java.lang.IllegalArgumentException: Incorrect name: fore="L2UI.lottoNum01" back="L2UI.lottoNum01a_check"

Уже все посмотрел что можно. Не могу понять как она формируется еще и сборка  нормально не загружается в eclipse с показом всех связностей и ошибок. Закомментил часть в LotteryManagerInstance.java с реплейсом теперь нажимается 5 раз и снова вываливается в ошибку. Может есть какой материал по байпасам где поглядеть можно как они работают?

			count = 0;
			for(int i = 0; i < 5; i++)
				if(player.getLoto(i) > 0)
				{
					count++;
					String button = String.valueOf(player.getLoto(i));
					if(player.getLoto(i) < 10)
						button = "0" + button;
					//String search = "fore=\"L2UI.lottoNum" + button + "\" back=\"L2UI.lottoNum" + button + "a_check\"";
					//String replace = "fore=\"L2UI.lottoNum" + button + "a_check\" back=\"L2UI.lottoNum" + button + "\"";
					//html.replace(search, replace);

				}

 

Share this post


Link to post
Share on other sites

Спасибо тем кто помог! Возможно не самое лучшее решение но сделал. Было две проблемы. Может кому пригодится 

Закомментить проверку в gameserver\src\main\java\org\mmocore\gameserver\network\l2\components\HtmlMessage.java

        //if(!name.startsWith("%") || !name.endsWith("%"))
        //    throw new IllegalArgumentException("Incorrect name: " + name);

Здесь  заменить строки gameserver\src\main\java\org\mmocore\gameserver\model\instances\LotteryManagerInstance.java

                String search = "0\">" + HtmlUtils.htmlNpcString(1000170);
                String replace = "22\">" + HtmlUtils.htmlNpcString(1000179);

на

                String search = "0\">Return";
                String replace = "22\">The winner selected the numbers above.";

  • Upvote 1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...