mirror of
https://github.com/DieReicheErethons/Brewery.git
synced 2024-11-22 11:35:16 +01:00
Decrease amount of denied Drunk-Logins
Deny passed-out-Logins for only about 10 min
This commit is contained in:
parent
353501bd84
commit
3a790c29f1
@ -159,7 +159,7 @@ public class BPlayer {
|
||||
|
||||
// can the player login or is he too drunk
|
||||
public int canJoin() {
|
||||
if (drunkeness <= 30) {
|
||||
if (drunkeness <= 70) {
|
||||
return 0;
|
||||
}
|
||||
if (P.p.getConfig().getBoolean("enableLoginDisallow", false) == false) {
|
||||
@ -169,25 +169,20 @@ public class BPlayer {
|
||||
return 3;
|
||||
}
|
||||
}
|
||||
if (drunkeness <= 50) {
|
||||
if ((Math.random() > 0.3 && !passedOut) || Math.random() > 0.5) {
|
||||
if (drunkeness <= 80) {
|
||||
if (passedOut) {
|
||||
// he has suffered enough. Let him through
|
||||
return 0;
|
||||
}
|
||||
if (Math.random() > 0.4) {
|
||||
return 0;
|
||||
} else {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
if (drunkeness <= 70) {
|
||||
if(!passedOut) {
|
||||
if (Math.random() > 0.5) {
|
||||
return 0;
|
||||
} else {
|
||||
return 1;
|
||||
}
|
||||
return 2;
|
||||
}
|
||||
}
|
||||
if (drunkeness <= 100) {
|
||||
if (!passedOut) {
|
||||
if (Math.random() > 0.8) {
|
||||
if (Math.random() > 0.6) {
|
||||
return 0;
|
||||
} else {
|
||||
return 2;
|
||||
@ -223,10 +218,11 @@ public class BPlayer {
|
||||
players.remove(player.getName());
|
||||
|
||||
} else if (offlineDrunk - drunkeness >= 20) {
|
||||
// do some random teleport later
|
||||
// TODO some random teleport later
|
||||
}
|
||||
|
||||
offlineDrunk = 0;
|
||||
passedOut = false;
|
||||
}
|
||||
|
||||
public void goHome(final Player player) {
|
||||
|
@ -130,14 +130,11 @@ public class PlayerListener implements Listener {
|
||||
case 0:
|
||||
bplayer.join(player);
|
||||
return;
|
||||
case 1:
|
||||
event.disallow(PlayerLoginEvent.Result.KICK_OTHER, "Dein Charakter ist angetrunken und reagiert nicht. Versuch es noch einmal!");
|
||||
return;
|
||||
case 2:
|
||||
event.disallow(PlayerLoginEvent.Result.KICK_OTHER, "Dein Charakter ist betrunken und reagiert nicht. Versuch es in ein paar Minuten noch einmal!");
|
||||
event.disallow(PlayerLoginEvent.Result.KICK_OTHER, "Dein Charakter ist betrunken und reagiert nicht. Versuch es noch einmal!");
|
||||
return;
|
||||
case 3:
|
||||
event.disallow(PlayerLoginEvent.Result.KICK_OTHER, "Dein Charakter ist sturzbesoffen und ohne Besinnung. Versuch es morgen noch einmal!");
|
||||
event.disallow(PlayerLoginEvent.Result.KICK_OTHER, "Dein Charakter ist sturzbesoffen und ohne Besinnung. Versuch es in 10 Minuten noch einmal!");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user