|
@@ -36,14 +36,6 @@ remote func RegisterPlayer(username, password, password2, email, salt, requester
|
|
|
var message = 'registering...'
|
|
|
if password != password2:
|
|
|
message = 'passwords are not equal'
|
|
|
-# if username.length() > 3:
|
|
|
-# message = 'username must be at least three letters'
|
|
|
-# if email.find('@') == -1 or email.find('@') == 0:
|
|
|
-# message = 'email is invalid'
|
|
|
-# if email.find('gmail') == -1 and email.find('outlook') == -1 and email.find('yahoo') == -1:
|
|
|
-# message = 'not a supported email provider'
|
|
|
-# if email.find('.com') == -1:
|
|
|
-# message = 'email is invalid'
|
|
|
var email_check = db.Read('login_database','email',"'"+email+"'")
|
|
|
var username_check = db.Read('login_database','username',"'"+username+"'")
|
|
|
if email_check != []: message = 'this email is already registered'
|
|
@@ -73,6 +65,9 @@ remote func password_confirmation(username,password, salt):
|
|
|
if password != password_db: message = 'password or username is wrong'
|
|
|
rpc_id(api.get_rpc_sender_id(), 'update_status', message)
|
|
|
if message != 'login...': return
|
|
|
+ var ip = api.get_peer_address(api.get_rpc_sender_id())
|
|
|
+ print(ip)
|
|
|
+ var token = ( username+ip+str(OS.get_unix_time())).sha256_text()
|
|
|
+ db.Create('validtokens_database',['username','token','ip','creation_date'],[username, token, ip, str(OS.get_unix_time())])
|
|
|
+ rpc_id(api.get_rpc_sender_id(), '_on_servertoken', token)
|
|
|
print(message)
|
|
|
-
|
|
|
-
|