Skip to content

Commit

Permalink
代码优化,修复bug
Browse files Browse the repository at this point in the history
  • Loading branch information
qinming99 committed Jan 15, 2021
1 parent 5105f9e commit 9839302
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,9 @@ public void smartUpdateGame() {
String steamVersion = DstVersionUtils.getSteamVersion();
String localVersion = DstVersionUtils.getLocalVersion();
Boolean smartUpdate = DstConfigData.smartUpdate;
log.info("智能更新启动:steamVersion={},localVersion={},smartUpdate={}", steamVersion, localVersion, smartUpdate);
if (log.isDebugEnabled()){
log.debug("智能更新启动:steamVersion={},localVersion={},smartUpdate={}", steamVersion, localVersion, smartUpdate);
}
if (StringUtils.isNoneBlank(steamVersion, localVersion) && smartUpdate) {
long sv = Long.parseLong(steamVersion);
long lv = Long.parseLong(localVersion);
Expand Down Expand Up @@ -128,7 +130,7 @@ private void onlyUpdateGame(){
shellService.sendBroadcast("服务器将马上进行更新,你将与服务器断开连接");
shellService.sendBroadcast("请稍后再进入房间");
try {
TimeUnit.SECONDS.sleep(10);
TimeUnit.SECONDS.sleep(20);
} catch (InterruptedException e) {
e.printStackTrace();
}
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/tugos/dst/admin/service/ShellService.java
Original file line number Diff line number Diff line change
Expand Up @@ -282,12 +282,12 @@ public void sendBroadcast(String message) {
masterBroadcast.append("\\\")\\n\"");
//发送地面广播
ShellUtil.execShellBin(masterBroadcast.toString());
StringBuilder CavesBroadcast = new StringBuilder();
/* StringBuilder CavesBroadcast = new StringBuilder();
CavesBroadcast.append("screen -S \"DST_CAVES\" -p 0 -X stuff \"c_announce(\\\"");
CavesBroadcast.append(message);
CavesBroadcast.append("\\\")\\n\"");
//发送洞穴广播
ShellUtil.execShellBin(CavesBroadcast.toString());
ShellUtil.execShellBin(CavesBroadcast.toString());*/
}

/**
Expand Down
9 changes: 6 additions & 3 deletions src/main/resources/templates/home/index.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@
<el-col :span="10">
<el-input type="textarea" :rows="3" maxlength="50" placeholder="请输入内容" show-word-limit v-model="broadcastContent"></el-input>
</el-col>
<el-col :span="5"> <el-button @click="sendBroadcast()" style="margin-left: 10px" >发送</el-button></el-col>
<el-col :span="5"> <el-button @click="sendBroadcast()" style="margin-left: 10px" icon="el-icon-s-comment" >发送</el-button></el-col>
</el-row>
</el-form-item>

Expand All @@ -155,7 +155,7 @@
<el-button size="mini" type="text" @click="visible3 = false">取消</el-button>
<el-button type="primary" size="mini" @click="kickPlayer()">确定</el-button>
</div>
<el-button slot="reference" style="margin-left: 10px" icon="el-icon-refresh-left">踢出</el-button>
<el-button slot="reference" style="margin-left: 10px" icon="el-icon-position">踢出</el-button>
</el-popover>
</el-row>
</el-form-item>
Expand Down Expand Up @@ -187,7 +187,7 @@
<el-button size="mini" type="text" @click="visible5 = false">取消</el-button>
<el-button type="primary" size="mini" @click="regenerate()">确定</el-button>
</div>
<el-button slot="reference" icon="el-icon-refresh-left">重置</el-button>
<el-button slot="reference" icon="el-icon-refresh">重置</el-button>
</el-popover>
</el-col>
</el-row>
Expand Down Expand Up @@ -349,6 +349,7 @@
}
},
kickPlayer(){
this.visible3 = false;
if (this.kickUserId) {
get("/home/kickPlayer", {userId: this.kickUserId}).then((data) => {
if (data) {
Expand All @@ -365,6 +366,7 @@
},
//重置世界
regenerate(){
this.visible5 = false;
get("/home/regenerate").then((data) => {
if (data) {
this.warningMessage(data.message);
Expand All @@ -374,6 +376,7 @@
},
//回滚世界
rollback(){
this.visible4 = false;
if (this.dayNum) {
get("/home/rollback", {dayNum: this.dayNum}).then((data) => {
if (data) {
Expand Down

0 comments on commit 9839302

Please sign in to comment.