MetaGamer Posted November 15, 2011 Share Posted November 15, 2011 Right now I am using the default mta sqlite database. Is it good to switch to XML? Is there any pros or cons? Link to comment
Castillo Posted November 15, 2011 Share Posted November 15, 2011 Well, if you are willing to save a lot of information, then it can be a problem in future, as the file will be too big, and may take a some time to read it when needed. Why not use SQLITE functions? or mysql. Link to comment
MetaGamer Posted November 15, 2011 Author Share Posted November 15, 2011 well I need to get information of the players to the website which can't be done on SQLite(Is there any remote method?) And in mysql there is many security issues. Link to comment
AGENT_STEELMEAT Posted November 15, 2011 Share Posted November 15, 2011 There aren't any security issues, unless you cause them. MySQL is the only good solution. Link to comment
MetaGamer Posted November 15, 2011 Author Share Posted November 15, 2011 There aren't any security issues, unless you cause them. MySQL is the only good solution. how is the speed compared to the default mta sa saving system? (BTW I am using Premium Web Hosting) Link to comment
AGENT_STEELMEAT Posted November 15, 2011 Share Posted November 15, 2011 Depends on your script's efficiency and the latency between the mta server and the mysql server, among other things. For smaller server it may not be as fast, but for larger scale servers it almost a necessity. Link to comment
MetaGamer Posted November 15, 2011 Author Share Posted November 15, 2011 OK Thanks for your opinion! Link to comment
MetaGamer Posted November 15, 2011 Author Share Posted November 15, 2011 I am always getting this error whenever I try to run my server ERROR: Unable to connect to mysql: (2013) Lost connection to MySQL server at 'waiting for initial communication packet', system error: 0 Link to comment
AGENT_STEELMEAT Posted November 15, 2011 Share Posted November 15, 2011 What code are you using to connect to the server? Link to comment
MetaGamer Posted November 15, 2011 Author Share Posted November 15, 2011 function MysqlInit() handler = mysql_connect("", "", "", "", "") -- Establish the connection if ( not handler ) then -- The connection failed outputDebugString("Unable to connect to the MySQL server") else mysql_close(handler) -- Close the connection end end addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), MysqlInit) Link to comment
AGENT_STEELMEAT Posted November 15, 2011 Share Posted November 15, 2011 Wrong functions - use the new dbConnnect, dbQuery, dbExec, dbPoll, and dbFree functions, not the old mysql module. Link to comment
MetaGamer Posted November 15, 2011 Author Share Posted November 15, 2011 Now another error Not starting resource freemind as section in the meta.xml is incorrect or missing (expected at least server 1.1.1-9.03328 because of 'dbConnect') Link to comment
MetaGamer Posted November 15, 2011 Author Share Posted November 15, 2011 So anyone have any idea about ^that error? Link to comment
booma Posted November 15, 2011 Share Posted November 15, 2011 Add it like this to meta.xml: Link to comment
eAi Posted November 15, 2011 Share Posted November 15, 2011 Just for the record, XML will almost always be worse for anything that isn't configuration information - if you expect the information you want to save to change often (e.g. new players joining, etc), then it's a bad choice. If you want to quickly find an item, then it's a bad choice. If you just want to load something up on server start up, then it's fine. Every time you save an XML file you rewrite the entire file, which takes quite some time. 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