-
Posts
1,899 -
Credits
0 -
Joined
-
Last visited
-
Days Won
14 -
Feedback
0%
Content Type
Articles
Profiles
Forums
Store
Everything posted by vampir
-
Help Respawn After...(Threadpoolmanager)
vampir replied to StealthyS4m's question in Request Server Development Help [L2J]
Yes, but your code isn't complete. The goal: -6 Seconds: Send "Respawn in 6 Seconds" message -5 Seconds: Send "Respawn in 5 Seconds" message -4 Seconds: Send "Respawn in 4 Seconds" message -3 Seconds: Send "Respawn in 3 Seconds" message -2 Seconds: Send "Respawn in 2 Seconds" message -1 Seconds: Send "Respawn in 1 Second" message 0 Second: Respawn Player The First code is bad because of scheduleGeneralAtFixedRate. This method is good if you want to make same repeated task every x amount of time, cancel it in rare cases. It's hard to cancel the method and to get "countdown" variable from inside the method. The Second Code is quite fine, but it would be better with just 1 Thread. Your code doesn't print any messages -
Help Respawn After...(Threadpoolmanager)
vampir replied to StealthyS4m's question in Request Server Development Help [L2J]
It does, but we are talking about first example(with scheduleGeneralAtFixedRate(Runnable, long, long) method) -
Discussion Lineage Application
vampir replied to SQL Developer's topic in General Discussion [English]
It would be possible to write it, but the result is totally not worth the effort -
Help Respawn After...(Threadpoolmanager)
vampir replied to StealthyS4m's question in Request Server Development Help [L2J]
You could make something like that: private ScheduledFuture<?> thread; public void startThread() { thread = ThreadPoolManager.getInstance().scheduleGeneralAtFixedRate(new Something(), 5000L, 5000L); } private static class Something implements Runnable { @Override public void run() { getInstance().stopThread(); } } private void stopThread() { thread.cancel(false); } private static class SingletonHolder { private static final MainClass instance = new MainClass(); } public static MainClass getInstance() { return SingletonHolder.instance; } But it's a lot better to use schedule(and if you want to cancel it, just put if(shouldThreadBeCancelled()) return;) than scheduleGeneralAtFixedRate and cancelling it that kind of way. -
Help Respawn After...(Threadpoolmanager)
vampir replied to StealthyS4m's question in Request Server Development Help [L2J]
The second code is about fine, you could have done it with one thread but thats nothing for the resources. Never use that shutdown, it will destroy your thread manager. You can cancel thread by first saving it as ScheduledFuture<?>, for example: ScheduledFuture<?> thread = ThreadPoolManager.getInstance().schedule(new Something(), 5000L); thread.cancel(false); However, in the first program it would be hard to use that method(you would need to get ScheduledFuture<?> thread from inside somehow) -
Help Respawn After...(Threadpoolmanager)
vampir replied to StealthyS4m's question in Request Server Development Help [L2J]
About the problem of shorter waiting if you die once again. There are 2 ways: 1. When the thread stops to send the message, you can check if player is still dead, if not then cancel the thread 2. You can save thread somewhere and when player have been resurrected you can cancel the thread -
Help Respawn After...(Threadpoolmanager)
vampir replied to StealthyS4m's question in Request Server Development Help [L2J]
You can use my code that i have wrote for starting new Event: private static class StartEventThread implements Runnable { private static final int[] STOP_TIMES = {1800, 900, 600, 300, 60, 30, 15, 10, 5, 0};//In which seconds Thread have to stop to show the message private final AbstractFightClub duplicatedEvent;//This is for starting event, you don't need it private final int secondsToStartEvent; private StartEventThread(AbstractFightClub duplicatedEvent, int secondsToStartEvent) { this.duplicatedEvent = duplicatedEvent; this.secondsToStartEvent = secondsToStartEvent; } @Override public void run() { try { if(getInstance().isNextEventBlocked()) return; int timeToShow = -1;//Time in Seconds to show in the message int timeToWait = -1;//Seconds to wait until next STOP_TIME //This is a bit advanced, the reason is if i would start StartEventThread to finish after 1900 seconds, it would first wait 100 seconds, print the message and then go on normally for(int i = 0;i < STOP_TIMES.length;i++) { if (secondsToStartEvent >= STOP_TIMES[i]) { if (secondsToStartEvent == STOP_TIMES[i]) { timeToShow = STOP_TIMES[i]; if(i == STOP_TIMES.length - 1) timeToWait = 0; else timeToWait = STOP_TIMES[i] - STOP_TIMES[i + 1]; } else { timeToWait = secondsToStartEvent - STOP_TIMES[i]; } break; } } if(timeToShow >= 0)//Also timeToShow is only above 0, if left seconds until event == one of the STOP_TIMES. So in the example with 1900 seconds, message wouldnt show { if(timeToShow > 60) sendMsg(duplicatedEvent.getName() + " will start in " + (timeToShow / 60) + " minutes!"); else if(timeToShow == 60) sendMsg(duplicatedEvent.getName() + " will start in 1 minute!"); else if(timeToShow > 0) sendMsg(duplicatedEvent.getName() + " will start in " + timeToShow + " seconds!"); else if(timeToShow == 0) sendMsg(duplicatedEvent.getName() + " Started!"); } if(timeToWait > 0) { ThreadPoolManager.getInstance().schedule(new StartEventThread(duplicatedEvent, secondsToStartEvent - timeToWait), (long) timeToWait * 1000L); } else { getInstance().startCurrentEvent(); } } catch (RuntimeException e) { LOG.error("Error while launching Event ", e); } } } } -
I would do main class like that: http://pastebin.com/bDRiUxLX Code will not work because the imports and few methods are from my h5 sources but its really easy to change it. You should change this definitely, because it will give ArrayOutOfBoundsException: last++; p.getAppearance().setNameColor(color[last]);
-
Oh. i am really sorry. I understood that the code should switch the color every 100 seconds(not after 100 pvps). So the code is quite fine, i can show you later(when i am at home) how it could be made with one thread and without int[] color and int last so it would be a bit faster(but i don't think you would notice any difference in performance even on server with large amount of players)
-
Thanks, added
-
- Cellpadding(it is set to "1" by default) <table cellpadding=10 bgcolor=ffffff> If you have problem with last letter or 2 last letters of text to be dropped into next line like this: cellpadding being > 0 is the problem. Set it to 0, for example: <table cellpadding=0> - Border("0" by default) <table border=3> Window Sizes: - NpcHtmlWindow width=294 height=359 - Community Board HIGH FIVE: Size without <br> at the beginning: width=773 height=506 INTERLUDE: Size without <br> at the beginning: width=630 height=465 Note: Always 10 first pixels of Community Board Height are hidden. <br> will lower everything by 9 pixels, so you should always use it at the beginning of the Community Board Html. HIGH FIVE: Size with <br> at the beginning: width=773 height=496 INTERLUDE: Size with <br> at the beginning: width=630 height=455 - Tutorial Window width=294 height=316 - Example: <table border=0 cellpadding=0 cellspacing=0 width=294 height=359 background="L2UI_CH3.refinewnd_back_Pattern"> <tr> <td height=359> <br> <br> <center> Some Text </center> </td> </tr> </table> Usefull features: - Combobox <combobox width=80 var="comboList" list="Choice 1;Choice 2;Choice 3"> - Edit(You can't press enter on it, to skip to new line) <edit width=80 var="editName"> <edit width=80 var="editName2" type="password"> <edit width=80 var="editName3" type="number"> - Multiedit(Scrollbar Up and Down arrows are always present) <multiedit width=80 height=80 var="multiEditName"> - What is var="multiEditName" for? So you can use it in bypass, example: <a action="bypass -h npc_%objectId%_PetitionContentBypass $multiEditName">Send Petition</a> $multiEditName will be replaced by content of the Multiedit(same for Edit, Combobox) Nice Examples: <button value="" action="bypass -h npc_%objectId%_Chat 1" width=32 height=32 back="L2UI_CT1.MiniMap_DF_PlusBtn_Red_Down" fore="L2UI_CT1.MiniMap_DF_PlusBtn_Red"> (INTERLUDE doesn't handle background tag, such images must be put directly into client) <table border=0 cellspacing=0 cellpadding=0 width=32 height=32 background="icon.accessary_phoenixs_ring_i00"><tr><td> <table cellspacing=0 cellpadding=0 width=34 height=34 background="L2UI.item_click"> <tr><td><br></td><td height=16><br></td></tr> <tr> <td width=16><br></td> <td width=18> <table height=17 cellspacing=0 cellpadding=0 background="L2UI_CT1.Windows_DF_TooltipBG"> <tr> <td height=17 width=17 align=center> <font color="FFFFFF">A</font> </td> </tr> </table> </td></tr></table></td></tr></table> (INTERLUDE doesn't handle background tag, such images must be put directly into client) <table cellspacing=0 cellpadding=0 width=130 height=124 background="L2UI_CH3.refinegrade2_03"> <tr> <td width=170 align=center> <img src="icon.skill5762" width=32 height=32> </td> </tr> </table> <button value="" action="bypass -h npc_%objectId%_Chat 1" width=15 height=15 back="L2UI.CheckBox_checked" fore="L2UI.CheckBox_checked"> <button value="" action="bypass -h npc_%objectId%_Chat 1" width=15 height=15 back="L2UI.CheckBox" fore="L2UI.CheckBox"> http://pastebin.com/9Zsj4Fxe Edit Box that cannot be edited: (INTERLUDE doesn't handle background tag, this is not possible to be done) <table> <tr><td> <table height=21> <tr><td width=40> Fee: </td></tr> </table> </td><td> <table width=125 height=21 background="L2UI_CT1.CharacterPassword_DF_EditBox"> <tr> <td fixwidth=121 align=right> 123 </td><td width=4> <br1> </td></tr> </table> </td></tr> </table> (INTERLUDE doesn't handle background tag, simple <img src="Crest.crest_%serverId%_%clanCrestId%" width=16 height=16> must be put) My Clan Crest:<br1> <table cellpadding=0 cellspacing=0 width=16 height=16 background="Crest.crest_%serverId%_%clanCrestId%"> <tr> <td width=16 height=4> <img src="L2.NonEdistingImage" width=16 height=5>//For getting non Transparent Black Color </td> </tr><tr> <td width=16 height=12> <br> </td> </tr> </table> Note: %serverId% and %clanCrestId% should be replaced in Java Files by real values. Server Id will be most likely 1, Clan Crest can be 2033832109 for example Usefull Icons & Textures: High Five in PNG: https://www.4shared.com/rar/aDWwBOU2ba/Icon.html Interlude in TGA: https://mega.nz/#!cNVFiCaK!Korm1LZKRQbMtBqwuvaJs3AYJ7_svd8NJa1yTdq-lHg If i forgot about something, let me know. I will try to make it larger in time Goddness of Destruction: - Tooltip <button width=32 height=32 tooltip="Click here to find out more!" back="L2UI_CH3.Botsystem_DF_Key2" fore="L2UI_CH3.Botsystem_DF_Key2"></button> - Itemtooltip <button width=32 height=32 itemtooltip="57" back="L2UI_CH3.aboutotpicon" fore="L2UI_CH3.aboutotpicon"></button> It doesn't matter what you put in back and fore, icon will be icon of the item anyway. - Icon Buttons(Since ERTHEIA) <button align="LEFT" icon="RETURN" action="bypass -h npc_%objectId%_Chat 0">Go back</button> Icon value can be: NORMAL, QUEST, TELEPORT, RETURN CENTER and RIGHT align:
-
I hope you don't mind if i say what could be done better - you could make one thread for whole server, not one for each player - you could replace int[] color and int last with just String currentColor - This run() method in Coloring class is some kind of bullshit. You can just send packet every 100 seconds, not once a second.
-
Basics: <html><body>Content of the page</body></html> It is not required to add <html><body> tags. - NoScrollBar (Not available in INTERLUDE) Default: No Scroll Bar: <html noscrollbar> - IMGSRC <html imgsrc="l2ui_ch3.tutorial_img10"> - Title <title>Text</text> - BR Text Line 1<br1> Text Line 2<br> Text Line 3 Changing Text - You can change the color <font color="882323">Red Text</font> Number 882323 is Html Color Code, you can use this web to get them: http://html-color-codes.info/ - You can change the font (Not available in INTERLUDE) <font name="hs16">Big Text</font> List of all possible fonts in H5: - You can change both <font name="__SystemEditBoxFont" color="666666">Text</font> Buttons and Action: - Normal Bypass <a action="bypass -h npc_%objectId%_Chat 1">Normal</a> <font color="b31a1a"><a action="bypass -h npc_%objectId%_Chat 1">Colored</a></font> - Bypass to Website (Not available in INTERLUDE) <a action="url !2265">Go to Web</a> Note: 2265 is Id in sysstring-e.dat containing Web Page that will open. Just Ids 2265, 2266 and 2267 are available - Buttons <button value="Button Name" action="bypass -h npc_%objectId%_Chat 1" width=100 height=30 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"> fore - Image of the button that shows up when mouse cursor is away back - Image that shows when player clicks on the button What about image that shows when cursor is on image, but it's not clicked? Game Client is taking content of fore and adds "_over" at the end. For example "L2UI_CT1.Button_DF_Over". It's NOT possible to change that path. Adding "over="blabla"" will not work. - Action Prefix There are 3 types of prefixes for action="" tag: 1. "Bypass -h" - Use it in Npc Window(it closes page upon click). It can also be used in Community Board, but NOT IN INTERLUDE! 2. "Bypass" - Use it in Npc Window or Community Board 3. "link" - Use it in Tutorial Window Setting bypass/link in action will trigger RequestBypassToServer or RequestTutorialLinkHtml packet upon click. Simple Image: <img src="L2UI_CH3.map_Moon" width=32 height=32> Tables <table width=300> <tr> <td width=100> Text 1 </td> <td width=100> Text 2 </td> <td width=100> Text 3 </td> </tr> <tr> <td width=100> Text 4 </td> <td width=100> Text 5 </td> <td width=100> Text 6 </td> </tr> </table> <tr> - New Line <td> - New Column - Sizes Width Fixwidth - Simple text will not resize the table in width Height - Bgcolor (Only following colors are available in INTERLUDE: 000000, ffffff, ff0000, ff00ff, ffff00, 00ff00, 00ffff, 0000ff) <table bgcolor=b31a1a> <tr> <td> Some text </td> </tr> </table> Value of bgcolor is HTML color code, you can get them from Gimp, Photoshop or this web: https://html-color-codes.info/ - Background (Not available in INTERLUDE) <table cellspacing=0 cellpadding=0 background="icon.skill0226"> <tr> <td> <button value="" action="bypass -h npc_%objectId%_Chat 1" width=34 height=34 back="L2UI_CH3.menu_outline_Down" fore="L2UI_CH3.menu_outline"> </td> </tr> </table> Value of Background is image from Game Client UTX or U files. You can also use Server Side image if you have PledgeCrest addon. - Align <td width=100 align=right> Text 1 </td> <td width=100 align=left> Text 2 </td> <td width=100> <center> Text 3 </center> </td> - Cellspacing(it is set to "2" by default) <table cellspacing=10 bgcolor=ffffff>
- 47 replies
-
- 18
-
-
-
-
Help Chain Heal Blue And How To Edit Interface.xdat
vampir replied to arturo134's topic in [Request] Client Dev Help
Did you try it? Interface.xdat isn't encrypted so you don't need to decrypt it with any software -
umodel -export -all Icon.utx Bat is named "umodel - Export"
-
Hi, thats really strange because i am exporting them with umodel without a problem. I have exported most of the files from systextures that might have icons(like icon.utx, L2UI_CH3.utx etc). I have downloaded umodel from: http://www.gildor.org/en/projects/umodel
-
Ye, l2scripts have stolen codes from me. If you will give those codes to developer, i think it will be a lot faster(cheaper) than making everything from zero :)
-
Why do you want to copy my work? :( Order different visual look at least
-
more professions <3 I am waiting with curiosity to see that live, too bad i cannot help :(
-
Help How Can I Edit L2 Icon.utx File?
vampir replied to flyfreedom87's topic in [Request] Client Dev Help
UModel: http://www.gildor.org/en/projects/umodel Guide: http://www.progamercity.net/lineage-guides/1491-guide-unreal-model-viewer-how-get-textures-package-utx-ukx.html -
Help Help With Class Name In Olympiad List
vampir replied to b0rto's question in Request Server Development Help [L2J]
If you will revert your changes and make fields Player 1 and Player 2 show names of the players, then all you will have to do is: - go to OlympiadGameNormal.java - modify getPlayerNames() - you can make each name like: _playerOne.getName() + " (" + playerOne.getClassId().getName() + ")" I dont know the method for getting name of the class(playerOne.getClassId().getName() - that was example) in l2jserver, so you will have to find it by youself. -
My friend... i asked you if i understood correctly and the visible effects of your system are the same as shared version(except performance) and it looks like they are(please prove me wrong). - This code(for Hopzone and for Topzone) can be done and fully working WITHOUT adding some 10mb of bullshit - 1 Thread running every 30 seconds and checking for vote count is NOTHING - it would be something if you would run it on PC made out of wood and i think admins are running servers on dedicated machines... - Of course .JAR can be opened, if you don't believe so you can send me the jar and i will send you it's source :)
-
Let me understand. This code is checking vote count on Hopzone and Topzone every 30 seconds and when difference between last checked count(saved in database too) and new count is >= x, then all players are rewarded right? If i am correct then: - 10 mb of new code to make Topzone work too? WTF? - How shared version of this code could affect performance when many players are online on the server? - "You can have it on other computer" - your code is so heavy for PC that it is better to more it to other machine? :O Give more info please because you can see by yourself this doesn't make sense :P
-
L2-Scripts High Five 5 09.07.2014
vampir replied to DarkEmpire's topic in Server Shares & Files [L2J]
Take a look: http://jd.benow.ca/ -
Help 2X Rates For Donators
vampir replied to GrenD731's question in Request Server Development Help [L2J]
In my pack i have got stat called "DropMultiplier", if you don't have it then you will need to edit the core.