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

    • General Trackers :   IPTorrents invite IPTorrents account 1 tb TorrentLeech invite Torrentleech account 1 tb buffer  InTheShaDow ( ITS ) account Acid-lounge invite Torrentday invite Crnaberza account Abn.Lol account Limit-of-eden account Norbits account Xspeeds account Xspeeds invite Bemaniso invite Wigornot account Bithumen invite Filelist account Funfile invite AvistaZ invite Potuk.net invite ResurrectThe.Net invite GrabThe.Info invite Greek-Team invite LinkoManija invite Fano.in account tracker.czech-server.com Speed.cd invite Arab-torrents.net account Arabscene.me account Scenetime account 4thd.xyz invite Btarg.com.ar account Dedbit invite Estone.cc account Speedapp invite Finvip invite Fluxzone account GigaTorrents account Gimmepeers account Haidan.video invite Mojblink account Mycarpathians invite Newinsane.info account Oscarworld.xyz account Peers.FM invite Pt.msg.vg account Ransackedcrew account Redemption invite Scene-rush account Seedfile.io invite Teracod invite Torrent.ai account Torrentmasters invite Ttsweb invite X-files invite X-ite invite Ncore account TorrentHR account Rptorrents account BwTorrents account Superbits invite Krazyzone account Immortalseed account Tntracker invite Pt.eastgame.org account Bitturk account Rstorrent account Tracker.btnext invite Torrent-turk.de account BeiTai.PT account Pt.keepfrds account 52pt.site account Pthome account Torrentseeds account Aystorrent account Blues-brothers.biz invite Divteam account Thesceneplace invite CinemaMovies.pl account Brasiltracker account Patiodebutacas account Newheaven.nl account  Swarmazon.club invite Bc-reloaded account Crazyspirits account Silentground invite Omg.wtftrackr invite Milkie.cc invite Breathetheword invite Madsrevolution account Chilebt account Yubraca account Uniongang.tv account Frboard account Exvagos account Diablotorrent account Microbit account Carp-hunter.hu account Majomparade.eu account Theshinning.me account Youiv.info account Dragonworld-reloaded account Sharewood.tv account Partis.si account Digitalcore.club invite Fuzer.me account R3vuk.wtf invite Ztracker account 1 tb buffer 3changtrai account Best-core.info account Bitsite.us account Eliteunitedcrew invite Exitorrent.org account Tophos invite Torrent.lt account Sktorrent.eu account Oshen account Blackhattorrent account Pirata.digital account Esharenet account Ohmenarikgi.la Pirate-share account Immortuos account Kiesbits account Cliente.amigos-share.club account Broadcity invite Ilovetorzz account Torrentbytes account Polishsource account Portugas invite Shareisland account ArabaFenice account Hudbt.hust.edu.cn account Audiences account Nanyangpt account Pt.sjtu.edu.cn account Pt.zhixing.bjtu.edu.cn account Byr.pt invite Ptfiles invite Red-bits account Pt.hdpost.top account Irrenhaus.dyndns.dk (NewPropaganda) account Mnvv2.info (MaxNewVision V2) account 1ptba.com account Spidertk.top account Film-paleis account Generation-free account Aftershock-tracker account Twilightsdreams account Back-ups.me invite Sor-next.tk ( Spirit Of Revolution ) account Tfa.tf ( The Falling Angels ) account Hdmayi account S-f-p.dyndns.dk ( Share Friends Projekt ) account Unlimitz.biz account Pttime account St-tracker.eu account New-retro.eu account Zbbit account Tigers-dl.net account Jptvts.us account Lat-team account Club.hares.top account Falkonvision-team account Concen account Drugari account T.ceskeforum account Peeratiko.org account Zamunda.se account Central-torrent.eu account h-o-d.org account Torrentleech.pl account Demonoid invite Lst.gg account Fakedoor.store account LaidBackManor account Vrbsharezone.co.uk invite Torrenteros account Arenaelite account Datascene account Tracker.0day.community Tapochek.net invite Ptchina invite Lesaloon account Exyusubs account Therebels.tv account Ubits.club invite Zmpt.cc account Turktorrent.us account Dasunerwarte account Hawke.uno account Monikadesign account Fearnopeer account Alpharatio account Wukongwendao.top account Chinapyg account Azusa.wiki account Yggtorrent.top account Torrentdd account Cyanbug.net invite Hhanclub.top account Wintersakura.net account Xthor account Tctg.pm account Finelite invite Agsvpt.com account Pt.0ff.cc invite Qingwapt.com account Xingtan.one account Ptcafe.club invite W-o-t.pro account Coastal-crew.bounceme.net account Darkpeers.org account Pianyuan.org account Seedpool.org  account Tempelbox account Pt.itzmx.com account Itatorrents.xyz  account Letseed.org account The-new-fun.com  account Malayabits.cc account Trellas.me account Yu-scene.net account Futuretorrent.org account Bitpt.cn account Tocashare.biz  account Videoteka.org  account White-angel.hu account Xbytesv2.li account Torr9  account Desitorrents account   Movies Trackers :   Secret-cinema account Anthelion account Pixelhd account Cinemageddon account Cinemageddon account Cinemaz account Retroflix account Classix-unlimited - invite Movie-Torrentz (m2g.link) invite Punck-tracker.net account Tmghub account Cathode-ray.tube account Greatposterwall account Arabicsource.net account Upload.cx account Crabpt.vip invite Onlyencodes.cc account Exyusubs account Hellashut.net invite Nordichd.sytes.net invite Locadora.cc account BJ-Share.info account   HD Trackers :   Blutopia buffered account Hd-olimpo buffered account Hdf.world account Torrentland.li account HdSky account Hdchina account Chdbits account Totheglory account Hdroute account Hdhome account TorrentCCF aka et8.org account 3DTorrents invite HD-Torrents account Bit-HDTV account HDME.eu invite Hdarea.co account Asiancinema.me account JoyHD invite HDSpace invite CrazyHD invite Bluebird-hd invite Htpt.cc account Hdtime invite Ourbits.club account Hd4fans account Siambit account Privatehd account Springsunday account Tjupt account Hdcity.leniter invite Ccfbits account Discfan account Pt.btschool.club account Ptsbao.club invite Hdzone.me invite Danishbytes account Zonaq.pw account Tracker.tekno3d account Arabp2p account Hd-united account Reelflix.xyz account Hdatmos.club account Anasch.cc invite Tigris-t account Nethd.org account Hd.ai invite Hitpt.com account Hdmonkey account Dragonhd.xyz account Hdclub.eu account Forum.bluraycd.com account Carpt account Hdfun.me invite Pt.hdupt invite Puntotorrent account Ultrahd account Rousi.zip account Bearbit account Hdturk.club account Asiandvdclub account Star-space.net account Nordicq.org account Hdkyl.in account Utp.to account Hdzero account   Music Trackers :   Dicmusic account Music-Vid account Open.cd account LzTr account ProAudioTorrents invite Jpopsuki invite TranceTraffic invite Audionews invite Kraytracker invite Libble.me invite Losslessclub invite Indietorrents.com invite Dimeadozen account Funkytorrents invite Karaokedl account zombtracker.the-zomb account Concertos account Sugoimusic account Satclubbing.club invite Metal.iplay invite Psyreactor invite Panda.cd account Adamsfile account Freehardmusic account Tracker.hqmusic.vn accouunt Twilightzoom account 3 tb buffer Hiresmusic account Metalguru account Musictorrents.org account Musebootlegs.com invite Zappateers.com account Jungleland.dnsalias.com account Naftamusic account   E-Learning Trackers :   Theplace account Thevault account Myanonamouse account Libranet account 420Project account Learnflakes account Pt.soulvoice.club account P2pelite account Aaaaarg.fail invite Ebooks-shares.org account Abtorrents account Pt.tu88.men invite Docspedia.world invite   TV-Trackers :   Skipthecommericals Cryptichaven account TV-Vault invite Shazbat.TV account Myspleen account Tasmanit.es invite Tvstore.me account Tvchaosuk account Jptv.club account   XXX - Porn Trackers :   FemdomCult account Pussytorrents account Adult-cinema-network account Bootytape account 1 Tb buffer Exoticaz account Bitporn account Kufirc account Gaytorrent.ru invite Nicept account Gay-torrents.org invite Ourgtn account Pt.hdbd.us account BitSexy account Happyfappy.org account Kamept.com account Lesbians4u.org account   Gaming Trackers :   Mteam.fr account BitGamer invite Retrowithin invite Gamegamept account   Cartoon/Anime/Comic Trackers :   Animeworld account Oldtoons.world account U2.dmhy account CartoonChaos invite Animetorrents account Mononoke account Totallykids.tv account Bakabt.me invite Revanime account Ansktracker account Tracker.shakaw.com.br invite Bt.mdan.org account Skyey2.com account Animetracker.cc Adbt.it.cx invite Tracker.uniotaku.com account Mousebits.com account   Sports Trackers :   MMA-Tracker invite T3nnis.tv invite AcrossTheTasman account RacingForMe invite Sportscult invite Ultimatewrestlingtorrents account Worldboxingvideoarchive invite CyclingTorrents account Xtremewrestlingtorrents account Tc-boxing invite Mma-torrents account Aussierul invite Xwt-classics account Racing4everyone account Talk.tenyardtracker account Stalker.societyglitch invite Extremebits invite Rgfootball.net account F1carreras.xyz account Software/Apps Trackers : Brokenstones account Appzuniverse invite Teamos.xyz account Macbb.org account   Graphics Trackers:   Forum.Cgpersia account   Others   Fora.snahp.eu account Board4all.biz account Makingoff.org/forum account Xrel.to account Undergunz.su account Corebay account Endoftheinter.net ( EOTI ) account Thismight.be invite Skull.facefromouter.space account Avxhm.se (AvaxHome) account Ssdforum account Notfake.vip account Intotheinter.net account Tildes.net invite Thetoonz account Usinavirtual account Hdclasico invite HispaShare account Valentine.wtf account Adit-hd account Forum-andr.net account Warezforums account Justanothermusic.site account Forbiddenlibrary.moe account Senturion.to account Movieparadise account Dcdnet.ru account Sftdevils.net account Heavy-r.com account New-team.org account Ddl.tv account Filewarez.club account Hispamula.org account Hubwarez.tv account Ultim-zone.in account   NZB :   Ninjacentral.co.za account Tabula-rasa.pw account Drunkenslug account Drunkenslug invite Usenet-4all account Dognzb.cr invite Kleverig account Nzb.cat account Nzbplanet.net invite Ng4you.com account NZB.to account Samuraiplace account Abhdtv.net account Abook.link account Comix.pw account House-of-usenet Secretbinaries.net account Vnext.to account Stockboxx.top account Sky-of-use.net account   Prices start from 3 $ to 100 $   Payment methods: Crypto, Neteller, Webmoney, Revolut   If you want to buy something send me a pm or contact me on:   Email: morrison2102@gmail.com   Discord: LFC4LIFE#4173   Telegram: https://t.me/LFC4LIFE4173   Skype: morrison2102@hotmail.com
    • Classic interlude files = Heavily modified classic Saviors/Zaken , adjusted to interlude features. to make your already interlude files compatible with the any other client you need to modify all network packets in your core or you can achieve the "classic" feeling by adding an interface to your client. Example or You can buy ready classic interlude files from the likes of lucera2 and adapt your mods there.
    • New account, few posts, came out of nowhere with "big" developer knowledge and selling "something special" use your main account, is clearly you are on this forum since 2012 minimum, we are not stupid, we are already old enough, everybody in this forum is 32+ y old...
    • Hello guys i was wondering , how all new servers are having interlude files with classic client developed how they want i mean l2reborn , l2 ovc ,l2 dex , l2 flauron etc has interlude files with classic client  where they found this client or where to buy who is making those clients i have interlude files already developed i need to addapt classic client to interlude files  but with not all theses extra skills items etc   
  • 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..