# Konfiguracja options: prefix: &a[&3&lzetLogin&a] &e>> permissionMessage: &cBrak dostępu. registerUsage: &cPoprawne użycie: /register registerAlreadyRegistered: &cJesteś już zarejestrowany. registerDifferentPasswords: &cHasła nie są takie same! registerNoNumbers: &cHasło musi zawierać co najmniej jedną cyfrę! registerNoSpecials: &cHasło musi zawierać co najmniej jeden znak specjalny! registerNoCapitals: &cHasło musi zawierać co najmniej jedną wielką literę! registerTooShort: &cHasło jest za krótkie! registerTooLong: &cHasło jest za krótkie! registerSuccess: &aPomyślnie się zarejestrowałeś. registerMessage: &cZarejestruj się, używając /register registerTimePassed: &cCzas na rejestracje upłynął! loginUsage: &cPoprawne użycie: /login loginNotRegistered: &cNie jesteś jeszcze zarejestrowany. loginAlreadyLogged: &cJesteś już zalogowany! loginIncorrectPassword: &cNiepoprawne hasło! loginSuccess: &aPomyślnie się zalogowałeś. loginManyAttempts: &cWprowadzone hasło jest po raz kolejny nieprawidłowe. loginTimeBlock: 10 minutes loginTooManyAttempts: &cTwoje hasło jest ponownie nieprawidłowe. Zostajesz tymczasowo zbanowany z serwera. Ban jest aktywny do &4{0}&c. loginTooManyAttemptsFaul: &cJesteś tymczasowo zbanowany za zbyt dużą liczbę niepoprawnie wprowadzonych haseł. Ban jest aktywny do &4{0}&c. loginMessage: &cZaloguj się, używając /login loginTimePassed: &cCzas na zalogowanie upłynął! changepassUsage: &cPoprawne użycie: /changepassword changepassSamePasswords: &cNowe hasło nie może być takie samo jak stare! changepassSuccess: &aPomyślnie ustawiłeś nowe hasło. Wejdź ponownie na serwer. forgotpassUsage: &cPoprawne użycie: /forgotpassword forgotpassMessage: &cJeśli zapomniałeś hasła, skontaktuj się z administratorem na PV, lub napisz wiadomość na naszym Discordzie. Nick właściciela: tezet unregisterUsage: &cPoprawne użycie: /unregister unregisterPermission: zetlogin.unregister unregisterSuccess: &aPomyślnie odrejestrowałeś gracza &2{0}&a. unregisterKick: &aAdministrator &2{0}&a zresetował Twoje hasło. Wejdź ponownie na serwer! unregisterNotRegistered: &cTen gracz nie jest zarejestrowany! hashedpassUsage: &cPoprawne użycie: /hashedpassword hashedpassPermission: zetlogin.hashedpassword hashedpassMessage: &aZaszyfrowane hasło gracza &2{0}&a to &2{1}&a # Skrypt. Jeśli nie wiesz co robisz, nic nie zmieniaj. # Włączanie, wyłączanie. on load: set yaml value "log" from file "spigot.yml" to false send "[zetLogin] Pomyślnie załadowano skrypt!" to the console on unload: set yaml value "log" from file "spigot.yml" to false send "[zetLogin] Pomyślnie wyłączono skrypt." to the console # /register command /register : usage: {@prefix} {@registerUsage} trigger: set yaml value "log" from file "spigot.yml" to false if file "plugins/Skript/scripts/players/%the sender%.yml" exists: send "{@prefix} {@registerAlreadyRegistered}" to the sender stop if arg-1 is not arg-2: send "{@prefix} {@registerDifferentPasswords}" to the sender stop if length of arg-1 is less than 6: send "{@prefix} {@registerTooShort}" to the sender stop if length of arg-1 is greater than 24: send "{@prefix} {@registerTooLong}" to the sender stop if arg-1 doesn't partially match "\d": send "{@prefix} {@registerNoNumbers}" to the sender stop if arg-1 doesn't match ".*[^A-Za-z0-9].*": send "{@prefix} {@registerNoSpecials}" to the sender stop if arg-1 doesn't partially match "[A-Z]": send "{@prefix} {@registerNoCapitals}" to the sender stop create file "plugins/Skript/scripts/players/%the sender%.yml" set {logged::%the sender%} to true set {_arg1} to arg-1 + "xyz01" set yaml value "Password" from file "plugins/Skript/scripts/players/%the sender%.yml" to {_arg1} hashed with SHA-256 send "{@prefix} {@registerSuccess}" to the sender stop # /login command /login : usage: {@prefix} {@loginUsage} trigger: set yaml value "log" from file "spigot.yml" to false if file "plugins/Skript/scripts/players/%the sender%.yml" doesn't exist: send "{@prefix} {@loginNotRegistered}" to the sender stop if {logged::%the sender%} is true: send "{@prefix} {@loginAlreadyLogged}" to the sender stop set {_arg1} to arg-1 + "xyz01" if yaml value "Password" from file "plugins/Skript/scripts/players/%the sender%.yml" is {_arg1} hashed with SHA-256: set {logged::%the sender%} to true clear {attempts::%the sender%} send "{@prefix} {@loginSuccess}" to the sender stop add 1 to {attempts::%the sender%} if {attempts::%the sender%} is greater than 5: blockAccount(the sender) set {attempts::%the sender%} to 0 stop if {attempts::%the sender%} is greater than 3: kick the sender due to "{@loginManyAttempts}" stop send "{@prefix} {@loginIncorrectPassword}" to the sender stop # /changepassword command /changepassword : usage: {@prefix} {@changepassUsage} trigger: set yaml value "log" from file "spigot.yml" to false if file "plugins/Skript/scripts/players/%the sender%.yml" doesn't exist: send "{@prefix} {@loginNotRegistered}" to the sender stop if arg-1 is arg-2: send "{@prefix} {@changepassSamePasswords}" to the sender stop set {_arg1} to arg-1 + "xyz01" if yaml value "Password" from file "plugins/Skript/scripts/players/%the sender%.yml" is not {_arg1} hashed with SHA-256: send "{@prefix} {@loginIncorrectPassword}" stop if length of arg-2 is less than 6: send "{@prefix} {@registerTooShort}" to the sender stop if length of arg-2 is greater than 24: send "{@prefix} {@registerTooLong}" to the sender stop if arg-2 doesn't partially match "\d": send "{@prefix} {@registerNoNumbers}" to the sender stop if arg-2 doesn't match ".*[^A-Za-z0-9].*": send "{@prefix} {@registerNoSpecials}" to the sender stop if arg-2 doesn't partially match "[A-Z]": send "{@prefix} {@registerNoCapitals}" to the sender stop delete file "plugins/Skript/scripts/players/%the sender%.yml" create file "plugins/Skript/scripts/players/%the sender%.yml" set {_arg2} to arg-2 + "xyz01" set yaml value "Password" from file "plugins/Skript/scripts/players/%the sender%.yml" to {_arg2} hashed with SHA-256 kick the sender due to "{@changepassSuccess}" stop # /forgotpassword command /forgotpassword: usage: {@prefix} {@forgotpassUsage} trigger: if file "plugins/Skript/scripts/players/%the sender%.yml" doesn't exist: send "{@prefix} {@loginNotRegistered}" to the sender stop send "{@prefix} {@forgotpassMessage}" to the sender # /unregister command /unregister : usage: {@prefix} {@unregisterUsage} permission: {@unregisterPermission} permission message: {@permissionMessage} trigger: if file "plugins/Skript/scripts/players/%the sender%.yml" doesn't exist: send "{@prefix} {@unregisterNotRegistered}" to the sender stop delete file "plugins/Skript/scripts/players/%the argument 1%.yml" set {_unregisterSuccess} to "{@unregisterSuccess}" replace all "{0}" in {_unregisterSuccess} with "%the argument 1%" send "{@prefix} %{_unregisterSuccess}%" to the sender set {_unregisterKick} to "{@unregisterKick}" replace all "{0}" in {_unregisterKick} with "%the sender%" kick argument 1 due to {_unregisterKick} stop # /hashedpassword command /hashedpassword : usage: {@prefix} {@hashedpassUsage} permission: {@hashedpassPermission} permission message: {@permissionMessage} trigger: set yaml value "log" from file "spigot.yml" to false if file "plugins/Skript/scripts/players/%the argument 1%.yml" doesn't exist: send "{@prefix} {@unregisterNotRegistered}" to the sender stop set {_hashedpassMessage} to "{@hashedpassMessage}" replace all "{0}" in {_hashedpassMessage} with "%the argument 1%" replace all "{1}" in {_hashedpassMessage} with yaml value "Password" from file "plugins/Skript/scripts/players/%the argument 1%.yml" send "{@prefix} %{_hashedpassMessage}%" to the sender stop # Funkcja blokowania local function blockAccount(p: player): set {blockzl::%{_p}%} to true set {_t} to now + {@loginTimeBlock} set {_rwo} to "{@loginTooManyAttempts}" replace all "{0}" in {_rwo} with "%{_t}%" set {_r} to {_rwo} set {timezl::%{_p}%} to {_t} kick {_p} due to {_r} send "[zetLogin] Gracz %{_p}% został tymczasowo zbanowany za zbyt dużą liczbę błędnie wprowadzonych haseł." to the console stop # Wyrzucanie podczas blokady on connect: {blockzl::%the player%} is true if now is less than {timezl::%the player%}: set {_x} to "{@loginTooManyAttemptsFaul}" replace all "{0}" in {_x} with "%{timezl::%the player%}%" kick the player due to {_x} stop set {blockzl::%the player%} to false clear {timezl::%the player%} stop # Resetowanie stanu logowania przy wyjściu on quit: set {logged::%the sender%} to false # Wysyłanie wiadomości o prośbie zalogowania/rejestracji on join: if file "plugins/Skript/scripts/players/%the sender%.yml" exists: send "{@prefix} {@loginMessage}" to the player loop 5 times: {logged::%the sender%} is true: stop send "{@prefix} {@loginMessage}" to the player wait 8 seconds {logged::%the player%} is not true kick the player due to "{@loginTimePassed}" stop else: send "{@prefix} {@loginMessage}" to the player loop 5 times: if file "plugins/Skript/scripts/players/%the sender%.yml" exists: stop send "{@prefix} {@registerMessage}" to the player wait 8 seconds file "plugins/Skript/scripts/players/%the sender%.yml" doesn't exist kick the player due to "{@registerTimePassed}" stop # Blokowanie działań bez rejestracji/logowania on break: {logged::%the player%} is not true cancel event on player move: {logged::%the player%} is not true cancel event on pickup: {logged::%the player%} is not true cancel event on drop: {logged::%the player%} is not true cancel event on command: command is not "register" or "login" or "changepassword" or "forgotpassword" {logged::%the player%} is not true set {_p} to the player {_p} is set cancel event on chat: {logged::%the player%} is not true cancel event on damage: {logged::%the victim%} is not true: cancel event {logged::%the attacker%} is not true: cancel event # Wyłączanie logów w konsoli on command: set yaml value "log" from file "spigot.yml" to false command does not contain "register" or "login" or "hashedpassword" or "changepassword" send "[zetLogin] %the player% wykonał komendę: %full command%" to the console