Recommended Posts

This is my problem

ERROR: dayzmode/lib/team/s_team.lua:1: call: failed to call 'dayzconnect:MySQL'
ERROR: dayzmode/lib/system/player.lua:1: call: failed to call 'dayzconnect:players'

Im using this

call ( getResourceFromName ( "dayzconnect" ), "MySQL", 1, "2", "three" )
<export function="MySQL"/>

	<include resource="dayzmap"/>
	<include resource="dayzmode"/>
	<include resource="dayzbase"/>
	<include resource="dayzcache"/>
	<include resource="object_preview"/> 

I do not know what to do anymore

Share this post

Link to post

Mostre o resource dayzconnect

Share this post

Link to post
Posted (edited)
1 hora atrás, Tommy. disse:

Mostre o recurso  dayzconnect

Um recurso é uma pasta, o arquivo nela é o class.lua

local XML = xmlLoadFile('connect.xml')
local SET = xmlNodeGetChildren(XML)[1]
local GET = xmlNodeGetAttribute
local name,host,user,pass = GET(SET,'name'),GET(SET,'host'),GET(SET,'user'),GET(SET,'pass')
local Connect = Connection('mysql',('dbname=%s;host=%s'):format(name,host),user,pass)

if Connect then

	outputServerLog('Successfully connect to MySQL server!')

	local mysql = {}
	mysql.connect = Connect

	function mysql.query(query,...)
		local qhandle = Connect:query(query,...)
		local r1,r2,r3 = qhandle:poll(-1)
		if not r1 then
			outputServerLog(('Query failed: errCode: %d - errMsg: %s'):format(r2,r3))
			return false
		return r1,r2,r3

	function mysql.exec(query,...)
		return Connect:exec(query,...)

	local admin = {

	function mysql.server()
		local query = mysql.query('SELECT * FROM `central` WHERE `name` = ?',getServerName())
		if query then
			if query[1] then
				return query[1]
				mysql.exec('INSERT INTO `central` (`name`,`admin`) VALUES (?,?)',getServerName(),toJSON(admin))
				return mysql.server()
	mysql.server = mysql.server()

	function MySQL()
		return mysql


	outputServerLog('Couldnt connect to MySQL server!')


e o connect.xml que ele conecta é este

    <set name='dayz' host='' user='root' pass=''/>

	<set name='name' host='' user='root' pass=''/>

Obviamente eu mudei os nomes da db e a senha pra nao correr risco, mas garanto que está tudo correto no arquivo original.

Edited by br99pedro

Share this post

Link to post

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.