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 
 
1K string limit and SQLInit()

 
Post new topic   Reply to topic    nwnx.org Forum Index -> General Discussion
View previous topic :: View next topic  
Author Message
dguntner



Joined: 31 Dec 2004
Posts: 116

PostPosted: Tue Feb 22, 2005 0:44    Post subject: 1K string limit and SQLInit() Reply with quote

I've seen discussions here that NWNX supports strings limited to 1K in size. This is apparently due to:

Code:

void SQLInit()
{
    int i;
    object oMod = GetModule();

    // Placeholder for ODBC persistence
    string sMemory;

    for (i = 0; i < 8; i++) // reserve 8*128 bytes
        sMemory += "..............[lots of .'s]..........................";

    SetLocalString(oMod, "NWNX!INIT", "1");
    SetLocalString(oMod, "NWNX!ODBC!SPACER", sMemory);
}


Question: Can that limit be raised by simply increasing the "8" to a higher number? I.E, if I were to change it to "16", would it then support up to 2K? And "32" would give 4K? I have some fields set in my MySQL database as LONGTEXT since I need to be able to accommodate a lot of text. So far, I guess I've been lucky and haven't had anything that big, because I haven't seen any truncaction happening. But I'd like to head that off at the pass, so to speak. I'm thinking that increasing that value would do it, but I'd like to get some other opinions first.

--Dave


Last edited by dguntner on Tue Feb 22, 2005 9:13; edited 3 times in total
Back to top
View user's profile Send private message
Lokey



Joined: 02 Jan 2005
Posts: 158

PostPosted: Tue Feb 22, 2005 4:23    Post subject: Reply with quote

Yes, that's the way to do it.

Depends on what you need it for though. I.e. if you're passing in a lot of seperate data at once, you may want to look at the HashSet plugin.
_________________
Neversummer PW NWNx powered mayhem Wink
Back to top
View user's profile Send private message
dguntner



Joined: 31 Dec 2004
Posts: 116

PostPosted: Tue Feb 22, 2005 5:52    Post subject: Reply with quote

Ok, cool. Glad it's that simple. Smile

I've seen the hash plugin, but I haven't got a *clue* what it is, what it's for, what it does, or how to use it. Any tutorials around for it?

But basically, I'm just storing information about items that are being stored in persistent chests. Since the odbc2 plugin hasn't been ported to Linux yet, I have no way of storing objects. People using the HotU/CEP crafting system to customize their stuff sometimes want to store that stuff in a chest somewhere, to avoid having to lug it around everywhere they go. Very Happy Since the "regular" odbc plugin only handles string data, I need to store a really long string that contains the crafted customizations about the item being stored so that the item can be recreated when they open the chest. I was concerned about the possibility that string could potentially go over 1K; thus my wanting to know how to expand that storage area.

--Dave
Back to top
View user's profile Send private message
Erik O'Siodhachain



Joined: 25 Jan 2005
Posts: 3

PostPosted: Fri Feb 25, 2005 22:05    Post subject: Reply with quote

dguntner wrote:
...But basically, I'm just storing information about items that are being stored in persistent chests. Since the odbc2 plugin hasn't been ported to Linux yet, I have no way of storing objects...


I hope to get back to working this port this weekend. I got very busy at work just after I assembled the tools and began to dive in... now to figure out where I left off. Hopefully I can find the function hooks rather quickly.
_________________
Smith & Wesson — the original point and click interface.

-- Unknown
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    nwnx.org Forum Index -> General Discussion All times are GMT + 2 Hours
Page 1 of 1

 
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