DragonPrime - LoGD Resource Community
Welcome Guest
  • Good morning, Guest.
    Please log in, or register.
  • December 12, 2017, 02:22:23 AM
Home Forums News Downloads Login Register Advanced Search
* * *
DragonPrime Menu
Login
 
 
Resource Pages
Search

Pages: [1]   Go Down
  Print  
Author Topic: Questions about module storage  (Read 3338 times)
0 Members and 1 Guest are viewing this topic.
Kermit
Guest
« on: August 29, 2004, 08:14:36 PM »

I've got an idea for a module but it would require the ability to hold a particular piece of information between user logins.  I know it can be done in SQL by adding a table and then tracking everything but I'm just curious if their is another way?  Wish the hooks and calls were documented some place Smiley.
Logged
Talisman
Administrator
Mod God
*****
Offline Offline

Posts: 5477



View Profile WWW
« Reply #1 on: August 29, 2004, 08:48:38 PM »

Perhaps you should be a bit more specific about what you want to do.  If you mean something along the lines of keeping track that someone has used a feature that day, take a look at something like Saucywench's kitchen.php to see how that's done.

Any piece of information created by a module can be placed in one of the module arrays - just take a look at the assorted options available to you and use the one most appropriate to your needs.

Hooks and calls are documented in the code  Wink
Logged

Play the latest beta version here on DragonPrime
Kermit
Guest
« Reply #2 on: August 30, 2004, 07:07:26 AM »

I was looking at building a blacksmith shop where you could take a weapon, ask for a modification (at a price).  The blacksmith would take your existing weapon and tell you to come back in x days.  At the end you could pickup your weapons if he didn't forget it (% chance setup my admin) or maby would tell you he needed more suplies and have you go buy something else that he would then take and "use" also.


Since their really isn't an inventory and radom drop I planned on using the existing items rather then try to figure out how to make nugets and such drop upon kills.  But that would be a better idea Smiley.
Logged
Kendaer
Guest
« Reply #3 on: August 30, 2004, 07:58:29 AM »

Check out the battle-victory hook.
Logged
Kermit
Guest
« Reply #4 on: August 30, 2004, 09:58:46 AM »

Ok I'm guessing that the session variable is searilized for storage between actuall user sessions, so if I store my info in it I shouldn't have to put it in the Database right?  It always bothers me to create tables if I don't have to Smiley.  Considering I run MySQL 4 to 5 the code doesn't always translate between them (5 has support for triggers and StoredProcedures thus allows some scripting that 4 freaks about).
Logged
Kendaer
Guest
« Reply #5 on: August 30, 2004, 02:42:40 PM »

Sessions expire after a time.. it is not universally persistant.
You cannot rely on the session except for short stretches.

You should be using
set_module_pref for most things and in fact for the things you are contemplating here it is the right solution.
Logged
Kermit
Guest
« Reply #6 on: August 30, 2004, 03:07:38 PM »

Thanks Kendaer got that just before I read your post Smiley.  Tried the session thing first and found the problem then noticed that in crazyaudrey that was the storage medium used Smiley.
Logged
Pages: [1]   Go Up
  Print  
 
Jump to:  


*
DragonPrime Notices
Version 1.1.2 is the current supported version and is available for download.

Support Us
No funds raised yet this year
Your help is greatly appreciated!
Recent Topics
DragonPrime LoGD
Who's Online
21 Guests, 0 Users
Home Forums News Downloads Login Register Advanced Search