View previous topic :: View next topic |
Author |
Message |
The Bus Driver
Joined: 26 Mar 2005 Posts: 3
|
Posted: Sat Mar 26, 2005 19:35 Post subject: iExpiration: How does it work? |
|
|
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 |
|
|
NoMercy
Joined: 03 Jan 2005 Posts: 123 Location: UK
|
Posted: Sat Mar 26, 2005 19:38 Post subject: |
|
|
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 |
|
|
The Bus Driver
Joined: 26 Mar 2005 Posts: 3
|
Posted: Sat Mar 26, 2005 23:39 Post subject: |
|
|
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 |
|
|
JeroenB
Joined: 31 Dec 2004 Posts: 228 Location: Netherlands
|
Posted: Sun Mar 27, 2005 8:58 Post subject: |
|
|
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 |
|
|
Papillon x-man
Joined: 28 Dec 2004 Posts: 1060 Location: Germany
|
Posted: Fri Apr 01, 2005 23:16 Post subject: |
|
|
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 |
|
|
|