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 
 
iExpiration: How does it work?

 
Post new topic   Reply to topic    nwnx.org Forum Index -> Scripts and Modules
View previous topic :: View next topic  
Author Message
The Bus Driver



Joined: 26 Mar 2005
Posts: 3

PostPosted: Sat Mar 26, 2005 19:35    Post subject: iExpiration: How does it work? Reply with quote

I've tried searching for this answer on the boards, in documentation, and in the actual scripts. What does iExpiration do, exactly? I know the include says it sets the number of days this variable is to last, but does SQL use this? For example, if I give iExpiration as 1, will it automatically be deleted from the DB by SQL? If not, how could I use this ingame to check if it's expired and remove it from the DB?
Back to top
View user's profile Send private message
NoMercy



Joined: 03 Jan 2005
Posts: 123
Location: UK

PostPosted: Sat Mar 26, 2005 19:38    Post subject: Reply with quote

I think for the most part it makes it compatable with someone elses system which came before NWNX, this was likely done as they may have used that system on the specific server the original version of NWNX was developed for. For most people it's not used, and if you write your own version of the aps_incldue file, you can ommit the exparation from the database and your own functions.
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
The Bus Driver



Joined: 26 Mar 2005
Posts: 3

PostPosted: Sat Mar 26, 2005 23:39    Post subject: Reply with quote

Ah, ok, that makes sense. I'm trying to figure out how to place a real life time/date in the DB using the aps_include that can then be retrieved and compared to the current real life time/date. Thus, I want a specific database entry to expire in RL day. If some one can help me on how to do thus, I would appreciate it. I'm kind of stuck on how to do that. I know how to retreive a row and then choose the timestamp column, but I'm not sure how to compare that to the current time/date in SQL.
Back to top
View user's profile Send private message
JeroenB



Joined: 31 Dec 2004
Posts: 228
Location: Netherlands

PostPosted: Sun Mar 27, 2005 8:58    Post subject: Reply with quote

if you use a database system that support triggers and/or stored procedures, you could write a little program that checks if the exporation time was oveer and if that is the case, you could remove it.
Back to top
View user's profile Send private message Visit poster's website
Papillon
x-man


Joined: 28 Dec 2004
Posts: 1060
Location: Germany

PostPosted: Fri Apr 01, 2005 23:16    Post subject: Reply with quote

Shame on me, I have neglected documentation on this since the very first release of nwnx.

The idea was to have an external process do the database pruning. On Avlis, I had set up a sql script that that was run every night and get rid of the unused data.

Quote:
delete from pwdata
where expire <> 0 AND
UNIX_TIMESTAMP(last)+(expire*24*60*60) < UNIX_TIMESTAMP(now())

_________________
Papillon
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    nwnx.org Forum Index -> Scripts and Modules 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