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 
 
Field lengths for Player Account and Character Name?

 
Post new topic   Reply to topic    nwnx.org Forum Index -> Database related
View previous topic :: View next topic  
Author Message
Grim



Joined: 04 Jan 2005
Posts: 12

PostPosted: Tue Jan 11, 2005 18:57    Post subject: Field lengths for Player Account and Character Name? Reply with quote

I've been working on modifying Knat's Persistent Quests & Journals to use NWNX and a MySQL table I've defined. I've got all the code working and basically preserved the basic design but rewrote the functions to use NWNX. As I finalize and begin heavier testing of my code, I wanted to find out what the appropriate field lengths should be for storing the player account and the character name. Here is what I have so far:

Code:
CREATE TABLE tbl_questdata(
   ID                   int auto_increment,
   player_acct          varchar(64) NOT NULL DEFAULT '',
   player_character     varchar(200) NOT NULL DEFAULT '',
   szPlotID             varchar(32) NOT NULL DEFAULT '',
   szPlotState          varchar(4) NOT NULL DEFAULT ''
)
GO


Here is how I am reading the values for the account and character names:
Code:
  if(GetIsPC(oCreature))
  {

    string  sPlayerAcct = SQLEncodeSpecialChars(GetPCPlayerName(oCreature));
    string  sPlayerChar = SQLEncodeSpecialChars(GetName(oCreature));


So my question is, what should I use for field lengths of the Player Account and Character Name?

Any comments on any of this would be most welcomed.
_________________
Grim Havoc
Systems guy for Mists of the Mordri
(now private)
Back to top
View user's profile Send private message Yahoo Messenger
JeroenB



Joined: 31 Dec 2004
Posts: 228
Location: Netherlands

PostPosted: Wed Jan 12, 2005 10:06    Post subject: Reply with quote

I would say that 200 for a character name is pretty much. I would make that also 64 or if you want to be save around 128 (which is I think to much already). You could have a look in your servervault and see what the most lengthy name is. Probably a lengthy name is 40 characters, but I don't think people want to type in more.

If you are using numerical plot ID's then you could drop the 32 also a bit. A number of 32 digit's is very very large and I think you will not reach such a big number Wink

Hope this helps you a bit!
Back to top
View user's profile Send private message Visit poster's website
Grim



Joined: 04 Jan 2005
Posts: 12

PostPosted: Wed Jan 12, 2005 19:02    Post subject: Reply with quote

JeroenB wrote:
I would say that 200 for a character name is pretty much. I would make that also 64 or if you want to be save around 128 (which is I think to much already). You could have a look in your servervault and see what the most lengthy name is. Probably a lengthy name is 40 characters, but I don't think people want to type in more.

If you are using numerical plot ID's then you could drop the 32 also a bit. A number of 32 digit's is very very large and I think you will not reach such a big number Wink

Hope this helps you a bit!


I think I may go with 128 and then monitor that length. Down the road I can do a table alter to reduce that based on what we see. Since we're trying to be as descriptive as we can in our tags I think I may keep the 32 since it's the maximum length allowed in the dialog box. Thanks for taking the time to respond. Appreciate the suggestions.
_________________
Grim Havoc
Systems guy for Mists of the Mordri
(now private)
Back to top
View user's profile Send private message Yahoo Messenger
Lokey



Joined: 02 Jan 2005
Posts: 158

PostPosted: Wed Jan 12, 2005 21:45    Post subject: Reply with quote

We limit player names and accounts to 32 characters each because of crash bugs, run like 40 character fields for these data in the db.
_________________
Neversummer PW NWNx powered mayhem Wink
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    nwnx.org Forum Index -> Database related 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