Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- talan ez function encryptSerial(str)
- local hash = md5(str)
- local rhash = "VGRP" .. string.sub(hash, 17, 20) .. string.sub(hash, 1, 2) .. string.sub(hash, 25, 26) .. string.sub(hash, 21, 2)
- return rhash
- end
- talan ez
- function calculateAutoLoginHash(username)
- local hash = md5(salt .. username .. math.random(1,1000000) .. salt .. "b" .. math.random(10,99) .."ring-fuckyoudaniels")
- local hash2 = md5( math.random(1,1000000).. math.random(1,1000000).. math.random(1,1000000).. math.random(1,1000000).. math.random(1,1000000).. "vG")
- local finalhash = hash .. hash2
- mysql:query_free("UPDATE `accounts` SET `loginhash`='".. finalhash .."' WHERE `username`='".. mysql:escape_string(username) .."'")
- return finalhash
- end
- function loginPlayer(username, password, operatingsystem, hashPlease)
- local autologin = false
- local loginErrorCode = 1
- if (string.len(password)~=64) then
- password = md5(salt .. password)
- else
- autologin = true
- loginErrorCode = 6
- end
- local safeusername = mysql:escape_string(username)
- local safepassword = mysql:escape_string(password)
- local query
- if (autologin) then
- query = "SELECT * FROM `accounts` WHERE `username`='" .. safeusername .. "' AND `loginhash`='" .. safepassword .. "'"
- else
- query = "SELECT * FROM `accounts` WHERE `username`='" .. safeusername .. "' AND `password`='" .. safepassword .. "'"
- end
- local result = mysql:query(query)
- source = client
- if (mysql:num_rows(result)>0) then
- local data = mysql:fetch_assoc(result)
- triggerEvent("onPlayerLogin", source, username, password)
- for key, value in ipairs(getElementsByType("player")) do
- if ( getElementData(value, "loggedin") == 1 and value ~= source and hasBeta[value] ) then
- triggerClientEvent(value, "onPlayerAccountLogin", source, username)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement