mirror of
https://github.com/mamoe/mirai.git
synced 2025-03-03 15:10:14 +08:00
Server
This commit is contained in:
parent
f6c489f929
commit
9a877b2b11
@ -16,13 +16,18 @@ public class MiraiServer {
|
||||
|
||||
protected MiraiServer(){
|
||||
instance = this;
|
||||
|
||||
this.onLoad();
|
||||
|
||||
Thread.yield();
|
||||
|
||||
this.onEnable();
|
||||
}
|
||||
|
||||
boolean isEnabled;
|
||||
private boolean enabled;
|
||||
|
||||
protected void shutdown(){
|
||||
if(this.isEnabled) {
|
||||
if(this.enabled) {
|
||||
this.getEventManager().boardcastEvent(new ServerDisableEvent());
|
||||
}
|
||||
}
|
||||
@ -46,8 +51,12 @@ public class MiraiServer {
|
||||
this.shutdown();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void onEnable(){
|
||||
this.eventManager.boardcastEvent(new ServerEnableEvent());
|
||||
this.isEnabled = true;
|
||||
this.enabled = true;
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user