Jump to content

Woltlab-Connector


Karuzo

Recommended Posts

Hey Guys.

So i have a little problem,

i want to connect my wbb forum with my server.

Code :

exports.woltlab:woltlab_connect ( "*****", "****", "****", "****" ) 
  
function CheckUsernameS() 
    local login = exports.woltlab:woltlab_userExists (triggerClientEvent("SendUsername, client")) 
     
    if login == true then 
        exports.woltlab:woltlab_checkPassword(login, triggerClientEvent(SendPassword)) 
    outputChatBox("Name is right") 
    else 
    outputChatBox("Name is wrong.") 
    end 
end 

Link to comment
  • MTA Team

Don't know why you are triggering a client event. This is the example from the wiki:

exports.woltlab:woltlab_connect ( "127.0.0.1", "root", "", "wcf" ) 
local login = exports.woltlab:woltlab_checkPassword ( "xthepr0mise", "test" ) 
if login == true then 
    outputChatBox("Your password is right!") 
else 
    outputChatBox("Your password is wrong!") 
end 
exports.woltlab:woltlab_disconnect() 

Remeber:

It uses the MySQL-Plugin to connect to the database
Link to comment

Chances are your dbConnect might be setup wrong.. This is what I use to connect my database:

local dbData = { 
    db = "db_name", 
    host="localhost", 
    port=3306, 
    user="root", 
    pass="" 
} 
  
db = dbConnect( "mysql", "dbname="..dbData.db..";host="..dbData.host..";port="..dbData.port, dbData.user, dbData.pass, "share=1;autoreconnect=1;" ); 

Link to comment

This is the exported connect function :

function woltlab_connect ( dbHost, dbUsername, dbPasswort, dbName ) 
    executer = mysql_connect ( dbHost, dbUsername, dbPasswort, dbName ) 
    if not executer then 
        outputDebugString ( "Fehler[100]: Konnte keine Verbindung zur Datenbank aufbauen!" ) 
        fileAppend ( "c", getLogTime(), "Fehler[100]: Konnte keine Verbindung zur Datenbank aufbauen!" ) 
        return false 
    else 
        fileAppend ( "d", getLogTime()," Mit Datenbank verbunden!" ) 
        return true 
    end  
end 
  

Link to comment

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.
×
×
  • Create New...