2022-03-24 04:10:50 +00:00
|
|
|
package moe.oko.Kiafumi.model;
|
|
|
|
|
2022-03-26 05:04:24 +00:00
|
|
|
import javax.annotation.Nullable;
|
|
|
|
|
2022-03-24 04:28:51 +00:00
|
|
|
/**
|
|
|
|
* Server Class
|
|
|
|
* Used for in-memory data storage. Loaded from Database later.
|
|
|
|
*/
|
2022-03-24 04:10:50 +00:00
|
|
|
public class Server {
|
|
|
|
private String id;
|
|
|
|
private boolean welcomeEnabled;
|
|
|
|
private String welcomeChannel;
|
2022-03-26 05:04:24 +00:00
|
|
|
private String joinRole;
|
|
|
|
private boolean serverProtected;
|
|
|
|
|
|
|
|
public Server(String id) {
|
|
|
|
this.id = id;
|
|
|
|
this.welcomeEnabled = false;
|
|
|
|
this.welcomeChannel = null;
|
|
|
|
this.joinRole = null;
|
|
|
|
this.serverProtected = false;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Database Constructor
|
|
|
|
* @param id - id of the server
|
|
|
|
* @param welcomeEnabled - is welcome enabled for the server
|
|
|
|
* @param welcomeChannel - channel for welcome messages, if enabled
|
|
|
|
* @param serverProtected - is the server under protection rules. (/archive, /stop, etc.)
|
|
|
|
*/
|
|
|
|
public Server(String id, boolean welcomeEnabled, @Nullable String welcomeChannel, @Nullable String joinRole, boolean serverProtected) {
|
|
|
|
this.id = id;
|
|
|
|
this.welcomeEnabled = welcomeEnabled;
|
|
|
|
this.welcomeChannel = welcomeChannel;
|
|
|
|
this.joinRole = joinRole;
|
|
|
|
this.serverProtected = serverProtected;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public String toString() {
|
|
|
|
return "Server{id=" + this.id + ",welcomeEnabled=" + welcomeEnabled + ",welcomeChannel="+welcomeChannel+
|
|
|
|
",joinrole=" + joinRole +",serverProtected="+serverProtected+"}";
|
|
|
|
}
|
2022-03-24 04:10:50 +00:00
|
|
|
}
|