View previous topic :: View next topic |
Author |
Message |
PNJ
Joined: 30 Jun 2007 Posts: 67
|
Posted: Mon Jun 02, 2008 14:06 Post subject: |
|
|
I saw that SCO & RCO are using the storecampaigneobject and retrievecampaignobject function.
Are they used to hook the object data ? |
|
Back to top |
|
|
virusman
Joined: 30 Jan 2005 Posts: 1020 Location: Russia
|
Posted: Mon Jun 02, 2008 14:35 Post subject: |
|
|
PNJ wrote: | I saw that SCO & RCO are using the storecampaigneobject and retrievecampaignobject function.
Are they used to hook the object data ? | SCO and RCO actually stand for StoreCampaignObject and RetrieveCampaignObject. |
|
Back to top |
|
|
PNJ
Joined: 30 Jun 2007 Posts: 67
|
Posted: Mon Jun 02, 2008 17:10 Post subject: |
|
|
aw, since i updated to 0.1.0 my PW keep crashing when someone log on.
Switched back to 0.8 working again
Seem i fixed my issues with memory limitation, will retry to see. |
|
Back to top |
|
|
PNJ
Joined: 30 Jun 2007 Posts: 67
|
Posted: Sat Jun 07, 2008 1:42 Post subject: |
|
|
Seem not to be compatible with DCarter Craft plugin
Using both make the server crash |
|
Back to top |
|
|
Saulus
Joined: 24 Mar 2008 Posts: 7
|
Posted: Wed Jun 18, 2008 23:24 Post subject: |
|
|
Is this confirmed? I've had problems with the new version as well, I had some crashing. |
|
Back to top |
|
|
virusman
Joined: 30 Jan 2005 Posts: 1020 Location: Russia
|
Posted: Sun Jun 29, 2008 14:33 Post subject: |
|
|
Thanks for the reports; the bug has been fixed, an updated version will be released with NWNX4 0.0.9 final. |
|
Back to top |
|
|
virusman
Joined: 30 Jan 2005 Posts: 1020 Location: Russia
|
Posted: Thu Jul 17, 2008 21:50 Post subject: |
|
|
Since NWNX4 1.0.9 is still in development for quite some time, I'm releasing the updated MySQL plugin.
XP MySQL 0.1.1
http://data.virusman.ru/nwn/nwnx4/xp_mysql-0.1.1.rar
- Fixed the NWN DB access crash
The internal version is still 0.0.9. It's ok, it's the right binary. |
|
Back to top |
|
|
TroveLord
Joined: 22 Nov 2006 Posts: 136 Location: Italy
|
Posted: Wed Oct 08, 2008 12:42 Post subject: |
|
|
I'm using the plugin included in nwnx4 1.09, which should be this very version.
I have no idea how to properly use it to store objects in the database.
My include file has these three functions.
Code: | void SQLSCORCOExec(string sSQL)
{
NWNXSetString("SQL", "SETSCORCOSQL", sSQL, 0, "");
}
void SQLStoreObject(object oObject)
{
StoreCampaignObject("NWNX", "-", oObject);
}
object SQLRetrieveObject(location lLocation, object oOwner = OBJECT_INVALID, string sMode="-")
{
return RetrieveCampaignObject("NWNX", sMode, lLocation, oOwner);
} |
SQLRetrieveObject() looks easy to use but I have no idea what's the exact procedure to store a object. Anyone care to explain? Thanks in advance. |
|
Back to top |
|
|
virusman
Joined: 30 Jan 2005 Posts: 1020 Location: Russia
|
Posted: Wed Oct 08, 2008 12:53 Post subject: |
|
|
To store an object in MySQL, you need a table with BLOB field.
Saving an object:
Code: | SQLSCORCOExec("INSERT INTO table_name (name, data) VALUES('something', %s)");
SQLStoreObject(oObject); //%s from the query is replaced with the object's GFF data when you call StoreObject |
Retrieving an object:
Code: | SQLSCORCOExec("SELECT data FROM table_name WHERE name='something'");
object oObject = SQLRetrieveObject(lLocation); |
|
|
Back to top |
|
|
TroveLord
Joined: 22 Nov 2006 Posts: 136 Location: Italy
|
Posted: Wed Oct 08, 2008 13:19 Post subject: |
|
|
Awesome, thanks a bunch |
|
Back to top |
|
|
TroveLord
Joined: 22 Nov 2006 Posts: 136 Location: Italy
|
Posted: Wed Oct 08, 2008 19:27 Post subject: |
|
|
I can't seem to make it work with loops, it only stores the first object. Is there something I'm missing?
Thanks in advance. |
|
Back to top |
|
|
Gryphyn
Joined: 20 Jan 2005 Posts: 431
|
Posted: Thu Oct 09, 2008 0:26 Post subject: |
|
|
TroveLord wrote: | I can't seem to make it work with loops, it only stores the first object. Is there something I'm missing?
Thanks in advance. |
sMode="FETCHNEXT" (IIRC) - It'll be in the RetrieveObject code somewhere. |
|
Back to top |
|
|
TroveLord
Joined: 22 Nov 2006 Posts: 136 Location: Italy
|
Posted: Thu Oct 09, 2008 21:37 Post subject: |
|
|
Neither FETCHNEXT and NEXT didn't work. |
|
Back to top |
|
|
virusman
Joined: 30 Jan 2005 Posts: 1020 Location: Russia
|
Posted: Thu Oct 09, 2008 23:25 Post subject: |
|
|
Regular query (not SQLSCORCOExec) with a result loop and "FETCHMODE" as sMode |
|
Back to top |
|
|
|