MetaGamer Posted November 15, 2011 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?
Castillo Posted November 15, 2011 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.
MetaGamer Posted November 15, 2011 Author 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.
AGENT_STEELMEAT Posted November 15, 2011 Posted November 15, 2011 There aren't any security issues, unless you cause them. MySQL is the only good solution.
MetaGamer Posted November 15, 2011 Author 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)
AGENT_STEELMEAT Posted November 15, 2011 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.
MetaGamer Posted November 15, 2011 Author 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
AGENT_STEELMEAT Posted November 15, 2011 Posted November 15, 2011 What code are you using to connect to the server?
MetaGamer Posted November 15, 2011 Author 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)
AGENT_STEELMEAT Posted November 15, 2011 Posted November 15, 2011 Wrong functions - use the new dbConnnect, dbQuery, dbExec, dbPoll, and dbFree functions, not the old mysql module.
MetaGamer Posted November 15, 2011 Author 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')
MetaGamer Posted November 15, 2011 Author Posted November 15, 2011 So anyone have any idea about ^that error?
eAi Posted November 15, 2011 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.
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