Raised This Month: $51 Target: $400
 12% 

[TF2] TF2 Item DB (replaces tf2itemsinfo)


Post New Thread Reply   
 
Thread Tools Display Modes
Pitbull3
AlliedModders Donor
Join Date: Aug 2009
Location: Degree-Gaming.com
Old 10-17-2016 , 21:05   Re: [TF2] TF2 Item DB (replaces tf2itemsinfo)
Reply With Quote #111

Ah okay, thanks for the info. Wasn't sure.
Pitbull3 is offline
FlaminSarge
Veteran Member
Join Date: Jul 2010
Old 10-18-2016 , 16:26   Re: [TF2] TF2 Item DB (replaces tf2itemsinfo)
Reply With Quote #112

Sorry about the whitespace diff. If you wanna take a look, here's the same without the whitespace change: https://gist.github.com/FlaminSarge/...dd8e350858aaea

I felt that the reading Quality from items_game was faster than getting it from the DB. Even if I moved it to the Python script, I'd still load the quality array into the plugin at load and read from there rather than going to the DB for it every time. However, having the data exist in the DB for use with custom queries (joins, etc) definitely makes sense. Thoughts?

Caching seems like a really good idea, ye.

Oop, found a bug in tf2idb.py that exists in the current release version. `prefab_aggregate.update(item)` doesn't do a deep merge, so things like prefab attributes get wiped by the item's own attributes, rather than updated.
__________________
Bread EOTL GunMettle Invasion Jungle Inferno will break everything. Don't even ask.

All plugins: Randomizer/GiveWeapon, ModelManager, etc.
Post in plugin threads with questions.
Steam is for playing games.
You will be fed to javalia otherwise.
Psyduck likes replays.

Last edited by FlaminSarge; 10-18-2016 at 21:17.
FlaminSarge is offline
RRRRUUUUNNNN
Junior Member
Join Date: Jun 2016
Old 10-30-2016 , 09:05   Re: [TF2] TF2 Item DB (replaces tf2itemsinfo)
Reply With Quote #113

Quote:
Originally Posted by FlaminSarge View Post
Hi guys, I've put up a preliminary version of TF2IDB with attribute support (and nosoop's class/slot changes), as well as a plugin that pretends that it's TF2ItemsInfo and makes calls to TF2IDB, essentially completely replacing TF2ItemsInfo.
http://github.com/flaminsarge/tf2idb

This is NOT READY for formal release. I need testers. Testers that know what they're doing. As such, if you don't know how to compile either plugin properly or install either on the server, including updating the SQLite database using the repository's Python script, then this plugin isn't for you yet.

If you plan to test them, put the new tf2idb.inc in your includes and compile both .sp files; put both up on the server and delete tf2itemsinfo. Run the included Python script (change the file paths at the top to point to the right items_game.txt), and place the resulting SQLite DB (sq3 file) into sourcemod/data/sqlite. Reboot the server and see if plugins that use TF2ItemsInfo now run without it. Ignore the repository's 'test' folder unless you want to test attribute KeyValues generation for some reason.

Let me know how it goes, thanks, and feel free to test out other things in tf2idb such as the new attribute functions or TF2IDB_CustomQuery. All the new stuff can be found in the include file.
Hello FlaminSarge,
I can test your test version, and I have a question,
when I compile the sp files, before I movin the smx and sp to the folders, do i have to rename the tf2itemsinfo_testvk files to tf2itemsinfo?

Last edited by RRRRUUUUNNNN; 10-30-2016 at 09:47.
RRRRUUUUNNNN is offline
nosoop
Veteran Member
Join Date: Aug 2014
Old 10-31-2016 , 04:38   Re: [TF2] TF2 Item DB (replaces tf2itemsinfo)
Reply With Quote #114

Quote:
Originally Posted by RRRRUUUUNNNN View Post
when I compile the sp files, before I movin the smx and sp to the folders, do i have to rename the tf2itemsinfo_testvk files to tf2itemsinfo?
As mentioned in that quoted post:

Quote:
Originally Posted by FlaminSarge View Post
Ignore the repository's 'test' folder unless you want to test attribute KeyValues generation for some reason.
If you do want to test KeyValues generation for some reason, just copy tf2itemsinfo_testkv.smx to the plugins folder and load it.

You probably don't, though -- it just dumps a KeyValues structure to a file, nothing really interesting.
__________________
I do TF2, TF2 servers, and TF2 plugins.
I don't do DMs over Discord -- PM me on the forums regarding inquiries.
AlliedModders Releases / Github / TF2 Server / Donate (BTC / BCH / coffee)
nosoop is offline
bottiger
AlliedModders Donor
Join Date: Dec 2010
Old 11-03-2016 , 18:36   Re: [TF2] TF2 Item DB (replaces tf2itemsinfo)
Reply With Quote #115

Quote:
Originally Posted by FlaminSarge View Post
Sorry about the whitespace diff. If you wanna take a look, here's the same without the whitespace change: https://gist.github.com/FlaminSarge/...dd8e350858aaea

I felt that the reading Quality from items_game was faster than getting it from the DB. Even if I moved it to the Python script, I'd still load the quality array into the plugin at load and read from there rather than going to the DB for it every time. However, having the data exist in the DB for use with custom queries (joins, etc) definitely makes sense. Thoughts?

Caching seems like a really good idea, ye.

Oop, found a bug in tf2idb.py that exists in the current release version. `prefab_aggregate.update(item)` doesn't do a deep merge, so things like prefab attributes get wiped by the item's own attributes, rather than updated.
You can cache the quality names into a trie so it isn't fetching from sqlite for every query. That is why I've implemented a cache for the most frequently used functions I could find.

I want all the data calculations moved out of the plugin and into the python as possible. I don't want the plugin to become bloated and take 20 seconds to load like what happened to tf2itemsinfo.

I just saw you've made those changes, and they look good to me so far.
__________________

Last edited by bottiger; 11-03-2016 at 18:40.
bottiger is offline
FlaminSarge
Veteran Member
Join Date: Jul 2010
Old 11-04-2016 , 01:15   Re: [TF2] TF2 Item DB (replaces tf2itemsinfo)
Reply With Quote #116

@bottiger are you online on Steam/Discord/etc. at all? We can chat about cleaning this up for release on one of those platforms, if you've got time. I've been mostly busy for a few weeks so I haven't had time to do any more with it since then.
__________________
Bread EOTL GunMettle Invasion Jungle Inferno will break everything. Don't even ask.

All plugins: Randomizer/GiveWeapon, ModelManager, etc.
Post in plugin threads with questions.
Steam is for playing games.
You will be fed to javalia otherwise.
Psyduck likes replays.
FlaminSarge is offline
MaloModo
Veteran Member
Join Date: Aug 2008
Old 12-07-2016 , 23:06   Re: [TF2] TF2 Item DB (replaces tf2itemsinfo)
Reply With Quote #117

Was trying out the new tf2idb (github) to replace tf2itemsinfo for uber upgrades. Plugins compiled fine, created database file. Uploaded to respective places, removed itemsinfo plugin but getting some errors:

Code:
L 12/07/2016 - 21:22:16: [SM] Exception reported: Invalid query Handle 0 (error: 4)
L 12/07/2016 - 21:22:16: [SM] Blaming: tf2idb.smx
L 12/07/2016 - 21:22:16: [SM] Call stack trace:
L 12/07/2016 - 21:22:16: [SM]   [0] SQL_FetchRow
L 12/07/2016 - 21:22:16: [SM]   [1] Line 209, tf2idb.sp::PrepareCache
L 12/07/2016 - 21:22:16: [SM]   [2] Line 148, tf2idb.sp::OnPluginStart
On plugin list:

Code:
 Errors:
         tf2attributes_ubup.smx: Could not find required plugin "tf2itemsinfo"
         tf2idb.smx (TF2IDB): Error detected in plugin startup (see error logs)
         tf2idb_tf2ii_compat.smx ([DEV] TF2IDB Adapter for TF2ItemsInfo): Could not find required plugin "tf2idb"
Do realize this is beta but getting ready for official release? The database file looks fine.
Attached Files
File Type: zip tf2idb.zip (678.2 KB, 149 views)
MaloModo is offline
kamild1996
Senior Member
Join Date: May 2011
Old 01-02-2017 , 06:10   Re: [TF2] TF2 Item DB (replaces tf2itemsinfo)
Reply With Quote #118

Why does the Python script create a database with tables starting with "new_" if the plugin is looking for tables that do not start with that prefix?

Last edited by kamild1996; 01-02-2017 at 06:19.
kamild1996 is offline
Wormy
Senior Member
Join Date: Jan 2013
Location: 2fort
Old 01-22-2017 , 10:41   Re: [TF2] TF2 Item DB (replaces tf2itemsinfo)
Reply With Quote #119

I'm getting these errors when trying to compile.

Code:
tf2idb_tf2ii_compat.sp(269) : error 029: invalid expression, assumed zero
tf2idb_tf2ii_compat.sp(269) : error 029: invalid expression, assumed zero
tf2idb_tf2ii_compat.sp(269) : warning 215: expression has no effect
tf2idb_tf2ii_compat.sp(269) : error 001: expected token: ";", but found "]"
tf2idb_tf2ii_compat.sp(269) : fatal error 190: too many error messages on one line
__________________
Wormy is offline
Chdata
Veteran Member
Join Date: Aug 2012
Location: Computer Chair, Illinois
Old 01-27-2017 , 12:19   Re: [TF2] TF2 Item DB (replaces tf2itemsinfo)
Reply With Quote #120

A quick lookthrough and I see it does some unthreaded queries for natives and stuff.

Is that safe?

Ever since I was a young-un I was taught that unthreaded queries are the plague.

Could it ever cause bad lag?

Why/Why not?

I was told that even for SQLite it's good to do threaded with a callback because it can still take time to read the database if it's large or something.

----

Maybe a better question is, when is it alright to use unthreaded queries, considering the functions for doing that still exist anyway?

I assume that means there is sooome place where they're applicable?
__________________

Last edited by Chdata; 01-27-2017 at 13:58.
Chdata is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 06:48.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode