Storing some info...
Yo,
Ok I'm not too sure how to do this. I'm creating a plugin for The Specialists Role Play and I'm creating a 'passport'. So this item would store the users name, date of birth and a few other things. (Bear with me here since this is my first proper plugin project and I may get the wording wrong or something) How can I store this information to the passport? I could use SQL I guess but that would be harder, wasteful and require the owner to do more work setting it up. I wanna try and keep it as simple and streamlined as possible :P So, e.g. Bob has this passport item. His name is Bob Bobbson and his date of birth is 1st March 1990. When Bob receives the item, he will register his information with something like /pportreg "Bob Bobbson" "1st March 1990" and the plugin will get that and go store it somewhere. It will use his SteamID to identify him. So if I use SQL, it will create two more columns to store his DOB and name in. (I think) So should I store this in a file on the server or in the SQL database along with the rest of the settings? I don't think they're are any other ways (Correct me if I'm wrong) I gotta remember though that obviously almost every user of the server will use a passport. Thanks for any help -JFeldon |
Re: Storing some info...
Look at some logging and stats plugins, that should give you a headstart.
|
Re: Storing some info...
You can use vault or binary vault to store data. SQL is an elegant solution (especially with SQLx module), but makes server dependent on external source.
I would create my own vault using fread_raw, fwrite_raw. It would consist of 2 files: 1st one with all steam id recods and indices. This one would be sorted every time you add record - like an index file. Second file would store all other information. If I'd like to look up a record, I'll search by steam id. I would use binary search to make things fast - get the index of specific steam id from the first file, seek the position according to the index inside second file and read the data. Sounds as a lot of work but it's real. |
Re: Storing some info...
Sounds like a good idea. I understood parts of it, but have never used/seen the fread_raw and fwrite_raw before. I looked 'em up in the FuncWiki thing but don't really understand it. Can you explain more please?
Thanks for the help though :) |
| All times are GMT -4. The time now is 11:05. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.