Jump to content

Recommended Posts

Posted

The reason for this post is to report a problem that can seriously affect the performance of your servers. Some of you maybe have not noticed, ought not to have many people using the buffer at the same time, but in my case 1 week ago, I had two total freezes when the whole server (500-700 players) attempted use the bufer after an event ;D. But I found something, a person is enough to knock over a server, with many people. Looks this code in script both original rin4a's buffer and my version have a problem, but is easy to fix.

 

as you can see in these lines of code, is open a connection to the database but is never closed, every time a user attempted to remove a buff of his scheme, open a new connection that was never closed causing a total server freeze.

 

                          if event == "remove_buff" :
                                      event = eventParam1.split("_")
                                      scheme = event[0]
                                      skill = event[1]
                                      level = event[2]
                                      con=L2DatabaseFactory.getInstance().getConnection()
                                      rem=con.prepareStatement("DELETE FROM buffer_scheme_contents WHERE scheme_id=? AND skill_id=? AND skill_level=? LIMIT 1")
                                      rem.setString(1, scheme)
                                      rem.setString(2, skill)
                                      rem.setString(3, level)
                                      try : rem.executeUpdate()
                                      except : pass

 

to fix the problem only adds to what I show below  :). thats all!

 

                          if event == "remove_buff" :
                                      event = eventParam1.split("_")
                                      scheme = event[0]
                                      skill = event[1]
                                      level = event[2]
                                      con=L2DatabaseFactory.getInstance().getConnection()
                                      rem=con.prepareStatement("DELETE FROM buffer_scheme_contents WHERE scheme_id=? AND skill_id=? AND skill_level=? LIMIT 1")
                                      rem.setString(1, scheme)
                                      rem.setString(2, skill)
                                      rem.setString(3, level)
                                      try :
                                                   rem.executeUpdate()
                                                   rem.close()         # <------------ADD----------
                                                   con.close()         # <------------ADD----------
                                      except : pass

 

After this modification, the performance of my server increase substantially (not more freezing, less lagg).

 

PD: I would recommend that only allow certain people to use the buffer for servers with more than 100 users (Use the VIP Option, i used and everything is fine).

 

I added that lines but when server try to load the script i got errors :

 

Failed executing script: C:\server\GameServer\data\scripts\custom\555_NPCBUFFER\

__init__.py. See __init__.py.error.log for details.

 

and in log is :

 

Error on: C:\server\GameServer\data\scripts\custom\555_NPCBUFFER\__init__.py.error.log

Line: -1 - Column: -1

 

Traceback (innermost last):

  (no code object) at line 0

SyntaxError: ('invalid syntax', ('__init__.py', 763, 25, '                        rem.close()'))

 

how it work at you ?

Posted

Anyone know a way to pull the description of the buff for each buff then display it under the icon/button/text for the actual buff?

 

A lot of people have a hard time making schemes because they forget what each one does. I am trying to edit and implement this into the buffer.

Posted

Well this information isn't embedded in the server's core, so you would have to make a new column in the buffers_buff_list table, add the description, and make the script to fetch that information. But there is a down side. You won't be able to list more than lets say 12 buffs per page. There are more than 130 buffs added, of course if you haven't added your own ones. So the script will have 10+ pages, and as far as I know, there can be some weird malfunctions in the HTML file.

Posted

Yeah anything after 9 pages starts getting glitchey...Guess I'll have to do this another way.

Thanks for the quick response Rin4a, I've always loved your buffer.

 

PS: You are everywhere xD

Posted

To be honest, I never took a look at the code of this buffer, that Allen modified. I just went with it, because it seemed to be working quite well. But performance wise - it's a mess. It's like every single script, that is out there, merged into a single file, and I'm not quite happy with that. But anyway - let's get back to my original script. I took some time out from L2j, but meanwhile I was studying pythons advanced features and I understood where I went wrong, while making this buffer. It was a total crap, if we judge it by it's performance. Features were OK. So what do I have in my mind. In this summer, I will try to rewrite this buffer completely. There won't be any stand alone functions, that are being called elsewhere, because I will be using classes. For tech geeks that are out there (yeah, I'm one of them lol) - I will be fully utilizing python's advanced OOP features and I will use string formatting feature, that is really cool.

To give a brief example:

# We will define a dummy variable, only to show, how to output it
dummy_var = "dog"

But for this example, we will output dog in double quotes. How did we do that earlier? Well..

print "I have a \"" + dummy_var + "\" and it's name is Rex"

So we had to concatenate dummy_var in the string and to output quotes, we had to use double double quotes and escape them and that might and will create a mess, but there is an other option, that works the same way, but is much clearer:

print "I have a \"%s\" and it's name is Rex" % dummy_var

We still had to escape double quotes, but if we had a bunch of variables that we would want to concatenate in the string, this method would work much much better.

Don't know why I wrote this, but someone might use it in their script.

Cheers.

Posted

Thats right, and this is important too http://www.skymind.com/~ocrow/python_string/. i will use Method 5 for now in my scripts. Thanks for advice. By the way, I think this method and what you said, can greatly increase the concatenation speed of any code, but implementing it in this buffer, is almost the same :S, this code is based in data base queries for everything (and that's just i try to avoid lately), so the concatenation speed and performance will be bad anyway :).

Posted

Queries ain't that bad, if you handle them correctly. In my old buffer, I used queries all the time, without thinking about the performance, but I will avoid that in my next release. I will fetch all the data from the database, when script will be initialized (when server will be starting) and store them in global arrays. So that way, the data will be there, when I need it, and I won't have to call any queries. In other words, I will be utilizing server's RAM more efficiently. I haven't thought about scheme system, because there might be more than 10k entries in the database, so I guess that I will have to use queries, despite everything, or I could make a dictionary, that will hold player's ID as a key and an array of skill ID's will be passed along. In total, 10k wouldn't be that much of a deal, but we will see..

  • 1 month later...
Posted

Ok I had your buffer working fine but I updated the server to a newer revision and now I get an error.

 

On Gameserver and htm of npc I get this error:

 

C:\Users\Giovanni Amorim\Desktop\magg\gameserver\data\scripts\custom\555_NPCBUFF
ER\__init__.py
Traceback (innermost last):
 (no code object) at line 0
       at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

       at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)

       at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Sou
rce)
       at java.lang.reflect.Constructor.newInstance(Unknown Source)
       at com.mysql.jdbc.Util.handleNewInstance(Util.java:409)
       at com.mysql.jdbc.Util.getInstance(Util.java:384)
       at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1054)
       at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3562)
       at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3494)
       at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1960)
       at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2114)
       at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2696)
       at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.ja
va:2105)
       at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:
2264)
       at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeQuery(NewPr
oxyPreparedStatement.java:76)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
       at java.lang.reflect.Method.invoke(Unknown Source)

com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: com.mysql.jdbc.except
ions.jdbc4.MySQLSyntaxErrorException: Table 'l2j_magg.buffer_scheme_list' doesn'
t exist

       at org.python.core.Py.JavaError(Unknown Source)
       at org.python.core.PyObject._jthrow(Unknown Source)
       at org.python.core.PyObject._jcall(Unknown Source)
       at org.python.proxies.main$Quest$437.onAdvEvent(Unknown Source)
       at com.l2jserver.gameserver.model.quest.Quest.notifyEvent(Quest.java:405
)
       at com.l2jserver.gameserver.model.actor.instance.L2PcInstance.processQue
stEvent(L2PcInstance.java:1838)
       at com.l2jserver.gameserver.network.clientpackets.RequestBypassToServer.
runImpl(RequestBypassToServer.java:259)
       at com.l2jserver.gameserver.network.clientpackets.L2GameClientPacket.run
(L2GameClientPacket.java:93)
       at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source
)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
       at java.lang.Thread.run(Unknown Source)

 

 

 

 

EDIT: I FIXED THE PROBLEM< I FORGOT TO ADD THE TABLES ON THE DATABASE

 

 

 

 

 

 

Guest
This topic is now closed to further replies.



  • Posts

    • Reconstructed the MSNP8 client/server chain in Lineage 2 (from C4 to HFp5) with full protocol capabilities + added Discord integration    Clean MSNP8:       MSNP8 + Discord Bridge:   
    • I'm looking for the GVE code for Luecera2.
    • Recommended seller, I'm using his services. Good luck @Ave
    • https://l2.gamedream.pl/ Update #2 — GameDream Interlude (C6)     This update focuses on Epic bosses, quest chains and overall QoL :cool Highlights: Frintezza access follows a full retail-like chain: Four Goblets → Last Imperial Prince → Journey to a Settlement Retail-like entry requirements restored (scroll + Command Channel) Four Goblets quest is now available in-game Shot visuals synced with attack/skill usage Community Board Premium Shop refreshed with classic Interlude buttons and cleaner tables Epic Raidboss access: Frintezza — 4–5 party Command Channel + scroll + Antique Brooch Antharas — Portal Stone Baium — Bloody Fabric Valakas — Floating Stone Queen Ant / Core / Orfen / Zaken — no quest gates Bug Fixes & QoL: Frintezza quest chain fully fixed TvT rewards — single reward + anti-abuse protection Shots — no double triggering Premium Shop — no blank tabs Mammon NPCs in Giran working correctly Cancel works retail-like (up to 5 buffs removed) Summon Friend fixed with anti-exploit guards YetiBuffer — Saved Buff Profiles (Save / Clear / Restore) PvE — increased aggro range + balance tweaks EXP toggle commands: expoff / expon / expblock Thanks for testing and feedback — more updates coming soon ❤️
    • Hello I would like to offer You my NEW 2026 Updater / Launcher with custom skins.   - UPDATER FEATURES -   1. Performance and Intelligent Resource Management: Smart Disk Detection (SSD/HDD): The updater automatically detects the user's drive type. For SSD/NVMe drives: Launches up to 8-12 concurrent threads, utilizing the full yet optimized connection speed. For HDD drives: Limits the thread count (to 2-3) to prevent computer slowdowns and avoid overloading the drive head. Multi-threaded Downloading: Instead of downloading file by file, the updater downloads multiple files simultaneously, drastically reducing update time. ZSTD Compression: Support for the modern Zstandard compression algorithm (.zst). Files are downloaded in compressed form and decompressed on the fly, saving bandwidth and accelerating downloads. HTTP/2 and Keep-Alive Support: Utilizing the HTTP/2 protocol and persistent connections allows for the instant download of thousands of small files without establishing a new connection for each one.   2. Modern User Interface (UI/UX): Transparency and PNG Graphics: Support for irregular window shapes, allowing for the creation of a unique, modern launcher look. Taskbar Integration: The progress bar is displayed not only in the window but also on the Windows taskbar icon. Built-in News Browser (Optional): The updater features a built-in browser module that displays news/changelogs directly within the launcher (without opening an external browser). Multi-language Support (Optional): Built-in language switching system (e.g., EN/PL/RU, etc.) with dynamic loading of button graphics and text. Animated Buttons (Optional): Dedicated, animated buttons redirecting to Discord, Facebook, YouTube, Instagram, and the website.   3. Technical Features and Application Security: Anti-Dual Run (Optional): The updater checks if the game is already running to prevent file conflicts during updates. Error Diagnostics: Built-in logging system (debug_log.txt) and hardware exception handling (SEH), facilitating the diagnosis of problems for players who cannot run the game. Internal Configuration: Updater settings are stored inside the .exe file, eliminating publicly accessible configuration files.   4. File Categorization (Normal vs. Critical vs. Once): Critical Files: Critical files are verified more thoroughly (via MD5 Hash) even in quick check mode to guarantee stability. Normal Files: Standard game files (textures, models, sounds) are checked depending on the selected mode (Quick vs. Full). Once Files (Overwrite Exclusions): Applies to user configuration files (e.g., Option.ini, User.ini).   5. Check Modes (Verification Algorithms): Self-Update: The updater can update itself before checking game files, allowing for easy deployment of launcher fixes. The updater supports two main operating modes that switch intelligently based on user action: Smart Check (Startup Quick Check): Runs automatically upon updater startup or pressing the START button (unless a full check is forced). Full Check (Full MD5 Verification): Manually triggered by the player via the "Full Check" button. Automatic Update Detection: If a newer version of a file appears on the server, it is automatically detected and downloaded without player interaction. Atomic Updates: Files are downloaded and verified first, and only then saved to the disk. This prevents game client corruption in case of internet connection loss. The entire process takes seconds, even with clients weighing 30GB+. - PATCH BUILDER FEATURES -   1. Professional File Structure Management (Tree-List Hybrid): Directory Tree Visualization: Instead of a flat file list, the Builder displays a clear structure of folders and subfolders. You can collapse and expand entire tree branches, facilitating work with thousands of files. Normal and Critical Division: A clear window division into two main zones: Normal Files and Critical Files. Ghost and Excluded Files Division: The interface visually informs about the status of unchanged files (existing in the previous patch version) and files excluded from the update. Show/Hide Ghosts: With one click, you can hide unchanged files to focus solely on what you are actually sending to players in this update.   2. Intuitive Interaction: Drag & Drop: Full Drag & Drop support. You can grab files or entire folders and drag them between the "Normal" and "Critical" lists. Transfer is intelligent – it moves the entire content of selected folders. Keyboard Shortcuts: Fast workflow thanks to keyboard support: Delete, Enter, Ctrl+A / Ctrl+C (select and copy paths).   3. Advanced Filtering and Searching: Context Search: The search bar works in real-time, filtering the file tree. Type /folder: Searches only within folder names. Type *ex: Shows only excluded files. Standard Typing: Searches files by name.   4. Automation and Security: Auto Self-Update: The Builder automatically detects the updater executable file. Real-Time Statistics: The status bar continuously shows the file count (Normal/Critical), total patch weight (in Bytes/MB/GB), and the last update date. System File Protection: Files marked as "Critical" cannot be accidentally added to the exclusion list – the program blocks such actions.   5. Performance (Backend): ZSTD Compression: The Builder uses the latest Zstandard algorithm to compress files before sending, ensuring a significantly smaller patch size than standard ZIP, saving server bandwidth and player time. Multi-threading: The packing and MD5 checksum generation process utilizes multiple CPU threads, drastically reducing patch building time.   - PRICING - NEW Updater standard price: 79 euro (if You ask for mods, price will change).   - CONTACT - Discord: ave7309   CLICK HERE TO CHECK LATEST TEMPLATES!                         * I have right to REFUSE to take an order. * Supported games: Lineage 2 / Black Desert / MU Online / Tantra / Rohan / Aion / Cabal / Fiesta any more...  
  • Topics

×
×
  • Create New...

Important Information

This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and 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..