Sex* Posted April 26, 2013 Share Posted April 26, 2013 So i have a XML saving system but its very laggy. How to make it non-XML? Im using also savePlayerData and loadPlayerData, i know that these are laggy but im gonna replace them later. Right now i just want to overmake it to non-XML. function loadPlayerData (player,datatype) local playerIP = getPlayerSerial (player) if (playerIP) then local root = xmlLoadFile ("users.xml") if (root) then local usersNode = xmlFindChild (root,"user",0) if (usersNode) then local playerRootNode = xmlFindChild (usersNode,"SERIAL_" .. getPlayerSerial(player),0) if not (playerRootNode == false) then local playerData = xmlNodeGetAttribute (playerRootNode,datatype) if (playerData) then xmlUnloadFile (root) return playerData else xmlNodeSetAttribute (playerRootNode,datatype,0) xmlSaveFile (root) xmlUnloadFile (root) return 0 end else local playerRootNode = xmlCreateChild (usersNode,"SERIAL_" .. getPlayerSerial(player)) xmlNodeSetAttribute (playerRootNode,datatype,0) xmlSaveFile (root) xmlUnloadFile (root) return 0 end end end end end function savePlayerData (player,datatype,newvalue) local playerIP = getPlayerSerial (player) if (playerIP) then local root = xmlLoadFile ("users.xml") if (root) then local usersNode = xmlFindChild (root,"user",0) if (usersNode) then local playerRootNode = xmlFindChild (usersNode,"SERIAL_" .. getPlayerSerial(player),0) if not (playerRootNode == false) then local newNodeValue = xmlNodeSetAttribute (playerRootNode,datatype,newvalue) xmlSaveFile (root) xmlUnloadFile (root) return newNodeValue else local playerRootNode = xmlCreateChild (usersNode,"SERIAL_" .. getPlayerSerial(player)) local newNodeValue = xmlNodeSetAttribute (playerRootNode,datatype,newvalue) xmlSaveFile (root) xmlUnloadFile (root) return newNodeValue end end end end end Link to comment
PaiN^ Posted April 26, 2013 Share Posted April 26, 2013 Why don't you use SQLite ? It's much lighter .. Link to comment
Sex* Posted April 26, 2013 Author Share Posted April 26, 2013 i doesnt like sql but how to make it non-xml? Link to comment
denny199 Posted April 26, 2013 Share Posted April 26, 2013 This is from the XXS panel, we don't help people with leaked resources / scripts. Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now