Set Max Players in Groups in Configuration (was hardcoded)
This commit is contained in:
parent
ed050b17fe
commit
a0cf7989b4
2 changed files with 6 additions and 1 deletions
|
@ -33,6 +33,7 @@ public class Configuration {
|
||||||
|
|
||||||
private int groupJoinMinutes;
|
private int groupJoinMinutes;
|
||||||
private String groupQuitMinutes;
|
private String groupQuitMinutes;
|
||||||
|
private int groupMaxPlayers;
|
||||||
|
|
||||||
private String mailUsername;
|
private String mailUsername;
|
||||||
private String mailPassword;
|
private String mailPassword;
|
||||||
|
@ -197,6 +198,10 @@ public class Configuration {
|
||||||
return this.groupQuitMinutes;
|
return this.groupQuitMinutes;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getGroupMaxPlayers(){
|
||||||
|
return this.groupMaxPlayers;
|
||||||
|
}
|
||||||
|
|
||||||
public Mail getMail(){
|
public Mail getMail(){
|
||||||
return new Mail(
|
return new Mail(
|
||||||
this.mailUsername,
|
this.mailUsername,
|
||||||
|
|
|
@ -732,7 +732,7 @@ public class DatabaseRepository {
|
||||||
if(id != null){
|
if(id != null){
|
||||||
int howmany = numberInGroup(id);
|
int howmany = numberInGroup(id);
|
||||||
System.out.println("join group, already have "+howmany);
|
System.out.println("join group, already have "+howmany);
|
||||||
if(howmany > 3) return false;
|
if(howmany > config.getGroupMaxPlayers()) return false;
|
||||||
}
|
}
|
||||||
Group alreadyInGroup = getPlayerGroup(user.getId(), group.getLinkToChapter());
|
Group alreadyInGroup = getPlayerGroup(user.getId(), group.getLinkToChapter());
|
||||||
if (id != null && alreadyInGroup == null) {
|
if (id != null && alreadyInGroup == null) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue