Raised This Month: $261 Target: $400
 65% 

Notices

Dynamic Objects and Properties - v.0.0.32 - [2018.05.08]


Post New Thread Reply   
 
Thread Tools Display Modes
Neuro Toxin
Veteran Member
Join Date: Oct 2013
Location: { closing the void; }
Old 05-11-2018 , 08:07   Re: Dynamic Objects and Properties - v.0.0.32 - [2018.05.08]
Reply With Quote #261

You should be able to override Dispose already.

Just make sure you call this.Dispose inside your override.
__________________
Neuro Toxin is offline
popey456963
Member
Join Date: Mar 2016
Old 06-30-2018 , 20:28   Re: Dynamic Objects and Properties - v.0.0.32 - [2018.05.08]
Reply With Quote #262

Woah, just discovered this. Really sad I hadn't found it a couple of years ago. Real classes!

Just a couple of questions that I've found in the first week of usage:

1. You might consider adding a README.md file to your Git repository that includes a link to the wiki? Initially, I didn't see it (until I saw this thread) and just learnt by looking at the source code.
2. I see MySQL persistence is on your list of improvements, interested to know what your thoughts are on how to implement this? My initial thought was that you would need to define a MySQL schema on first run, then you can just loop over the names. However, wondering if you had a better idea in place? I have some time over the next week and was thinking of trying to implement it.
popey456963 is offline
popey456963
Member
Join Date: Mar 2016
Old 07-01-2018 , 07:28   Re: Dynamic Objects and Properties - v.0.0.32 - [2018.05.08]
Reply With Quote #263

Or, thinking about it more, if you always just search based upon a dynamic name then you could just use MySQL as a dumb key value store? Have just two columns and make it a fake schema-less DB.
popey456963 is offline
Neuro Toxin
Veteran Member
Join Date: Oct 2013
Location: { closing the void; }
Old 07-01-2018 , 07:40   Re: Dynamic Objects and Properties - v.0.0.32 - [2018.05.08]
Reply With Quote #264

I was thinking of creating an dynamic class that would have a member like so which is parsed through the initialiser.

<String>dynamic.Query: An INSERT INTO ... ON DUPLICATE UPDATE statement

This class would have an LinkObject method which accepts a <Dynamic>dynamic parameter which adds the dynamic parameter change hooks.

When a change hook is called the Dynamic instance is added to an array if not already in there (maybe remove hooks and readd later).

Then on each frame get the updated instances and run the query.

Edit: ive already written code to grab dynamic objects from a collection with LINQ style code for selecting elements from the database so every table row isnt in memory.

https://github.com/ntoxin66/Dynamic/...ftest.sp#L1125

So writting this around a collection is key.

The collection acts like a table and you should be able:

1. Select items to it
2. Items in it auto update like first part of this post
3. Remove items from it
__________________

Last edited by Neuro Toxin; 07-01-2018 at 07:46.
Neuro Toxin is offline
Neuro Toxin
Veteran Member
Join Date: Oct 2013
Location: { closing the void; }
Old 07-01-2018 , 09:25   Re: Dynamic Objects and Properties - v.0.0.32 - [2018.05.08]
Reply With Quote #265

Here is the start I've done.

https://github.com/ntoxin66/Dynamic/...e6339dae6dd438

Let me know your thoughts.
__________________
Neuro Toxin is offline
Neuro Toxin
Veteran Member
Join Date: Oct 2013
Location: { closing the void; }
Old 07-02-2018 , 00:30   Re: Dynamic Objects and Properties - v.0.0.32 - [2018.05.08]
Reply With Quote #266

It's coming together...

https://github.com/ntoxin66/Dynamic/...s/dbscheme.inc
__________________
Neuro Toxin is offline
Neuro Toxin
Veteran Member
Join Date: Oct 2013
Location: { closing the void; }
Old 07-02-2018 , 23:52   Re: Dynamic Objects and Properties - v.0.0.32 - [2018.05.08]
Reply With Quote #267

I'm making good headway.

Here is an example of usage after really nutting it out.

Code:
// This is a Dynamic instance that holds the data that will be used in the query
Dynamic test = Dynamic();
test.SetString("stringvalue", "a string value");
test.SetInt("intvalue", 666);
test.SetFloat("floatvalue", 666.666666666);
test.SetBool("boolvalue", true);
test.SetString("ID", "STEAMID:XXXXXXXXXXX");

// Create a prepared query
PreparedQuery query = PreparedQuery();
query.CompileQuery("UPDATE `table` SET `stringvalue`=?, `intvalue`=?, `floatvalue`=?, `boolvalue`=? WHERE `ID`=?");
query.SendQuery(test, "default");

// Always clean up after yourself
test.Dispose();
query.Dispose();
https://github.com/ntoxin66/Dynamic/...paredquery.inc
__________________
Neuro Toxin is offline
popey456963
Member
Join Date: Mar 2016
Old 07-03-2018 , 09:05   Re: Dynamic Objects and Properties - v.0.0.32 - [2018.05.08]
Reply With Quote #268

Woah, that was impressively quick, I was travelling all of the previous days so hadn't even started.

Looks amazing! Testing it out today with in a real world scenario.

EDIT: Just realised there's no way to unserialise at the moment, so may hold off on it until that's a thing.

Last edited by popey456963; 07-03-2018 at 09:24.
popey456963 is offline
Neuro Toxin
Veteran Member
Join Date: Oct 2013
Location: { closing the void; }
Old 07-03-2018 , 18:23   Re: Dynamic Objects and Properties - v.0.0.32 - [2018.05.08]
Reply With Quote #269

I haven't finished it yet. It's close.

What do you mean by unserialise?
__________________

Last edited by Neuro Toxin; 07-03-2018 at 18:23.
Neuro Toxin is offline
popey456963
Member
Join Date: Mar 2016
Old 07-07-2018 , 08:10   Re: Dynamic Objects and Properties - v.0.0.32 - [2018.05.08]
Reply With Quote #270

I meant to go from a saved DB entry to a dynamic. As far as I can see this isn't possible yet?
popey456963 is offline
Reply


Thread Tools
Display Modes

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 23:09.


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