Commit f582b69d authored by Atsukio's avatar Atsukio 🐬

Login - updated code for hashing, walk speed added for temporary ExtrasSK fix,...

Login - updated code for hashing, walk speed added for temporary ExtrasSK fix, clearip command added, changed on join messages to appear as newest, added an additional message when logging in
parent 8be5c1bb
......@@ -26,13 +26,14 @@ command /register <text> <text>:
if {language.%player%} is "chinese":
message "{@Prefix} 您的网际协定已被其他账号使用。 请联络管理员如果这是过失。"
stop
set {password.%player%} to hashed arg 1
set {password.%player%} to arg 1 hashed with MD5
if {language.%player%} is "english":
message "{@Prefix} &eYou have successfully registered!"
if {language.%player%} is "chinese":
message "{@Prefix} &e注册成功!"
set {auth.%player%} to 1
set freeze state of player to false # SkExtras
set walk speed of player to 0.2
clear {registered.%player%}
log "%player% successfully registered. IP: %IP of player%. Password: %arg 1%" to "auth/register.log"
add IP of player to {authip::*}
......@@ -55,12 +56,13 @@ command /login <text>:
if {auth.%player%} is 1:
message "{@Prefix} &cYou are already logged in!"
stop
if hashed arg 1 is {password.%player%}:
if arg 1 hashed with MD5 is {password.%player%}:
if {language.%player%} is "english":
message "{@Prefix} &eYou have logged in successfully!"
if {language.%player%} is "chinese":
message "{@Prefix} &e登录成功!"
set freeze state of player to false
set walk speed of player to 0.2
set {auth.%player%} to 1
teleport player to {preauth.loc.%player%}
clear {preauth.loc.%player%}
......@@ -90,14 +92,14 @@ command /changepassword <text> <text> <text>:
trigger:
if {registered.%player%} is set:
message "{@Prefix} &cYou are not even registered!"
if hashed arg 1 is {password.%player%}:
if arg 1 hashed with MD5 is {password.%player%}:
if arg 2 is not equal to arg 3:
if {language.%player%} is "english":
message "{@Prefix} &cNew password doesn't match"
if {language.%player%} is "chinese":
message "{@Prefix} &c新密码不相似"
if arg 2 is equal to arg 3:
set {password.%player%} to hashed arg 2
set {password.%player%} to arg 2 hashed with MD5
if {language.%player%} is "english":
message "{@Prefix} &ePassword changed"
if {language.%player%} is "chinese":
......@@ -116,9 +118,14 @@ command /pauth <text> <offlineplayer> <text>:
permission message: "No :("
trigger:
if arg 1 is "register":
set {password.%arg 2%} to hashed arg 3
set {password.%arg 2%} to arg 3 hashed with MD5
message "Password of %arg 2% has been set to '%arg 3%'"
clear {registered.%arg 2%}
command /clearip:
permission: pauth.admin
trigger:
clear {authip::*}
on drop:
if {auth.%player%} is not set:
......@@ -180,9 +187,10 @@ on join:
on join:
set the freeze state of player to true #SkExtras
#set walk speed of player to 0
if {password.%player%} is not set:
#if {registered.%player%} is 0:
wait 1 second
wait 1.5 second
if {languagefirstset.%player%} is not set:
message "{@Prefix} Please register with &b/register <password> <confirmpassword>"
stop
......@@ -196,9 +204,9 @@ on join:
deop player
set {auth.opcheck.%player%} to 1
message "[&6PAuth&f] &eYou are detected as an Operator. Therefore, you are deopped until you are logged in."
wait 1 second
wait 0.5 second
wait 1.5 second
message "{@Prefix} &ePlease login to continue"
message "{@Prefix} &b/login <password>"
on quit:
if {auth.opcheck.%player%} is 1:
......@@ -212,7 +220,8 @@ on join:
if player is online:
wait 1 second
add 1 to {auth.timeoutcheck.%player%}
set action bar of player to "&eLogin TimeOut - &c%{auth.timeoutcheck.%player%}%/60"
#set action bar of player to "&eLogin TimeOut - &c%{auth.timeoutcheck.%player%}%/60"
show an action bar from "&eLogin TimeOut - &c%{auth.timeoutcheck.%player%}%/60" to player
if {auth.timeoutcheck.%player%} is more than or equal to 60:
kick player due to "Timed out"
clear {auth.timeoutcheck.%player%}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment