logo logo

 Back to main page

The NWNX Community Forum

 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
XP MySQL 0.0.9 with SCO/RCO
Goto page Previous  1, 2
 
Post new topic   Reply to topic    nwnx.org Forum Index -> Development
View previous topic :: View next topic  
Author Message
PNJ



Joined: 30 Jun 2007
Posts: 67

PostPosted: Mon Jun 02, 2008 14:06    Post subject: Reply with quote

I saw that SCO & RCO are using the storecampaigneobject and retrievecampaignobject function.

Are they used to hook the object data ?
Back to top
View user's profile Send private message
virusman



Joined: 30 Jan 2005
Posts: 1020
Location: Russia

PostPosted: Mon Jun 02, 2008 14:35    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website Yahoo Messenger
PNJ



Joined: 30 Jun 2007
Posts: 67

PostPosted: Mon Jun 02, 2008 17:10    Post subject: Reply with quote

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
View user's profile Send private message
PNJ



Joined: 30 Jun 2007
Posts: 67

PostPosted: Sat Jun 07, 2008 1:42    Post subject: Reply with quote

Seem not to be compatible with DCarter Craft plugin Sad

Using both make the server crash
Back to top
View user's profile Send private message
Saulus



Joined: 24 Mar 2008
Posts: 7

PostPosted: Wed Jun 18, 2008 23:24    Post subject: Reply with quote

Is this confirmed? I've had problems with the new version as well, I had some crashing.
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
virusman



Joined: 30 Jan 2005
Posts: 1020
Location: Russia

PostPosted: Sun Jun 29, 2008 14:33    Post subject: Reply with quote

Thanks for the reports; the bug has been fixed, an updated version will be released with NWNX4 0.0.9 final.
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
virusman



Joined: 30 Jan 2005
Posts: 1020
Location: Russia

PostPosted: Thu Jul 17, 2008 21:50    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website Yahoo Messenger
TroveLord



Joined: 22 Nov 2006
Posts: 136
Location: Italy

PostPosted: Wed Oct 08, 2008 12:42    Post subject: Reply with quote

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
View user's profile Send private message
virusman



Joined: 30 Jan 2005
Posts: 1020
Location: Russia

PostPosted: Wed Oct 08, 2008 12:53    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website Yahoo Messenger
TroveLord



Joined: 22 Nov 2006
Posts: 136
Location: Italy

PostPosted: Wed Oct 08, 2008 13:19    Post subject: Reply with quote

Awesome, thanks a bunch
Back to top
View user's profile Send private message
TroveLord



Joined: 22 Nov 2006
Posts: 136
Location: Italy

PostPosted: Wed Oct 08, 2008 19:27    Post subject: Reply with quote

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
View user's profile Send private message
Gryphyn



Joined: 20 Jan 2005
Posts: 431

PostPosted: Thu Oct 09, 2008 0:26    Post subject: Reply with quote

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
View user's profile Send private message
TroveLord



Joined: 22 Nov 2006
Posts: 136
Location: Italy

PostPosted: Thu Oct 09, 2008 21:37    Post subject: Reply with quote

Neither FETCHNEXT and NEXT didn't work.
Back to top
View user's profile Send private message
virusman



Joined: 30 Jan 2005
Posts: 1020
Location: Russia

PostPosted: Thu Oct 09, 2008 23:25    Post subject: Reply with quote

Regular query (not SQLSCORCOExec) with a result loop and "FETCHMODE" as sMode
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
Display posts from previous:   
Post new topic   Reply to topic    nwnx.org Forum Index -> Development All times are GMT + 2 Hours
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group