| zokemon |
07-12-2008 06:39 PM |
Quote:
Originally Posted by Skyld
(Post 1402401)
In this instance, loading things from text files is more CPU cycles and memory overhead than is required than directly accessing a flag would produce.
|
Item archetype data on a normal day should only be read from, not written to unless there is an update to the server (which should be in the form of server updating, patching, etc; not this mess of small updates every 5 minutes like most Graal servers do).
As for the item data of a player inventory:
It's not exactly black and white, only the inexperienced scripters see it that way. There are many ways which you can make a hybrid system that both uses text files optimally as well as built-in features for speed and performance.
You may not see any advantages to text files but I have already seen a ton named in this thread so let me spell them out to you (plus a few more): - 255 Character Bug - I'll start with this one since it seems to be the most commonly named here. RC messes up client., clientr. and other player. strings that are saved to the player. Now this isn't really a viable reason as it isn't that hard to create a player editor in-which you can edit players and avoid having to modify them while they are playing (causes them to "jump back in time", unprofessional, etc).
- Organization - You can't expect to be the scripter on a server forever. When I first took a look at Maloria's player attributes and then a few years later, Zodiacs, I was searching for a needle in a haystack. Not the mention the amount of time it took to load an experienced player's attributes. To put it simply, text files allow you to place the data in what ever form you see fit. Again though, you can always build an editor that can interpret the player attributes and organize it for you, but you still are just leaving a robot to search through your messy room, that's all.
- Security - Probably one of the most important reasons; by saving data to a text file, you are increasing security both with the leaking of information and the modifying of information. Any kid and his dog knows how to /open a given player, and either find out everything about that player or make some kind of modification that will be forever lost in the mess that is rclog.txt. Yes, text files are logged even worse but if no one has rights to those text files, the only modification possible would be through scripts; this can't be used as a counter arguement though as a scripter could much more easily modify a variable on a player then loadlines, modify, savelines, etc. By separating data into text files, you can allocate who can read and modify what.
- Stability - Also could be classified under security, file data stability. Data stored in player attributes isn't really safe data. Anyone who works on a classic server for just a little while know how much your player data just sits on a thin thread. Some idiot with /reset rights could "accidentally" reset a player and all the data that could have taken months to acquire goes down the drain.
On Zodiac, some scripter was making something inside a database npc and forgot some syntax in his with () block. You know what happened? The whole database was deleted along with a few others. I know that was an error on his part but it doesn't change the fact that it was so easy to do (by accident as well). Text files can't be "destroy()ed".
I know that Graal will automatically sync client. and clientr. variables but if you don't have any client. or clientr. variables, it doesn't matter now does it?
Anyways, I didn't put to much effort into that list but there are a few clear cut reasons why text files can be useful. Again, text files can be more performance intensive that's why in most cases, hybrid systems are best.
|