Jump to content

bypassing internal.db


Xabache

Recommended Posts

When a user logs into my server those user names and passwords are stored in a file called server\mods\deathmatchinternal.db which i suspect is a stock mta function.

server-side getAccount(user,pass) retrieves my information with their user pass data?

server-side logIn (source, account, password) matches their data to mine in internal.db and lets them login?

I want to bypass this entirely and record their user name and password/password to my own xml system which once matched will log them in

This is the server side handler which i believe serves both functions of recording and retrieval, can I, how do i store their user and pass data to my own xml system?

-- Login handling 
function loginPlayer(username,password,enableKickPlayer,attemptedLogins,maxLoginAttempts) 
    if not (username == "") then 
        if not (password == "") then 
            local account = getAccount ( username, password ) 
            if ( account ~= false ) then 
                logIn (source, account, password) 
                outputChatBox ("#0000FF* #FFFFFFYou have sucessfully logged in!",source,255,255,255,true) 
                setTimer(outputChatBox,700,1,"#0000FF* #FFFFFFTo enable auto-login, use #ABCDEF/enableauto#FFFFFF!",source,255,255,255,true) 
                triggerClientEvent (source,"hideLoginWindow",getRootElement()) 
            else 
                if enableKickPlayer == true then 
                    if (attemptedLogins >= maxLoginAttempts-1) then 
                        outputChatBox ("#0000FF* #FFFFFFError! Wrong username and/or password!",source,255,255,255,true) 
                        setTimer(outputChatBox,500,1,"#0000FF* #FFFFFFWarning! Maximum login attempts reached! [#008AFF"..attemptedLogins+1 .."/"..maxLoginAttempts.."#FFFFFF]",source,255,255,255,true) 
                        setTimer(outputChatBox,1000,1,"#0000FF* #FFFFFFYou will be kicked in #008AFF5 seconds#FFFFFF!",source,255,255,255,true) 
                        setTimer(kickPlayer,5000,1,source,"Failed to login") 
                    else 
                        outputChatBox ("#0000FF* #FFFFFFError! Wrong username and/or password!",source,255,255,255,true) 
                        setTimer(outputChatBox,500,1,"#0000FF* #FFFFFFLogin attempts: [#008AFF"..attemptedLogins+1 .."/"..maxLoginAttempts.."#FFFFFF]",source,255,255,255,true) 
                        triggerClientEvent(source,"onRequestIncreaseAttempts",source) 
                    end 
                else 
                    outputChatBox ("#0000FF* #FFFFFFError! Wrong username and/or password!",source,255,255,255,true) 
                end 
            end 
        else 
            outputChatBox ("#0000FF* #FFFFFFError! Please enter your password!",source,255,255,255,true) 
        end 
    else 
        outputChatBox ("#0000FF* #FFFFFFError! Please enter your username!",source,255,255,255,true) 
    end 
end 

Link to comment

Hy Xabache,

i did it this way:

The login function checks for username and password in my own database and on success I create a new account for the internal (addAccount) and log him in (logIn).

If the player quits, I always delete the account (removeAccount). So the Account is just temporary for the active session.

All based on his Playername.

Same to the register function. I don't create any account, until he logs in.

Additionally you can put the player in the right ACL Group, if you have different ones.

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...