object -> XML
Ok, i made this and figured it would be useful for others. It takes any object and converts it to xml.
It uses getStaticVarNames() because any vars in getVarNames() that aren't in getStaticVarNames() don't seem to work (such as clientr and client). I don't know why. Anyway, the code: PHP Code:
PHP Code:
PHP Code:
|
Pretty nice!
|
Looks very good. Don't see any purposes though, if you can't load it.
|
I don't even know what the point of XML is, nice work though.
|
Quote:
And there is functions for xml released in the engine.. or check out PFA's XML Parser :o |
I suppose you could do this to load + save player atts every 30 minutes or whatever, and then you could look through an accounts file, and then look through the times, and see if they did something. Could be used to check for glitch abuse or so.
|
actually I'm using it to back up my DB NPCs, otherwise if they get reset, all the objects created on them are lost.
I'm still working on the XML import, i have it reading the simple data types. I just need to get the recursive part done so it recreates the arrays and objects :) |
Quote:
Waiting on XML import :D |
That seems like an awfully large format to use. When you have to write down the name of the variable twice and use index for each member of an array.
|
Amazing! Rep++
|
Quote:
Of course It is possible using a custom format but XML offers the ability of easily transporting the data and put it somewhere else like a website because there are plenty of parsers available. As for "index", it could be replaced with CSV so it's just array = {"a","b","c","d"); is represented as a,b,c,d but that wouldn't account for objects stored in arrays or multi dimensional arrays. |
It's a shame this doesn't save flags into it as well =[
|
what do you mean by 'flags'? like clientr?
|
Nooo, I think he means flags like the american flag
just kidding <3 |
Quote:
PHP Code:
|
All times are GMT +2. The time now is 09:54 AM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.