Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

<groupId>com.tugos.dst</groupId>
<artifactId>dst-admin</artifactId>
<version>1.5.0</version>
<version>1.5.1</version>
<name>dst-admin</name>
<description>饥荒管理后台</description>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,14 @@ public ResultVO<String> updateGame() {
return homeService.updateGame();
}

@GetMapping("/updateGameMods")
@RequiresAuthentication
@ResponseBody
public ResultVO<String> updateGameMods() {
log.info("更新游戏Mods");
return homeService.updateGameMods();
}


@GetMapping("/backup")
@RequiresAuthentication
Expand Down
12 changes: 12 additions & 0 deletions src/main/java/com/tugos/dst/admin/service/HomeService.java
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,18 @@ public ResultVO<String> updateGame() {
return ResultVO.success();
}

/**
* 更新游戏Mods 需要停止地面和洞穴进程
*/
public ResultVO<String> updateGameMods() {
if (!this.checkIsInstallDst()) {
//未安装dst
return ResultVO.fail(I18nResourcesConfig.getMessage("tip.home.start.error"));
}
shellService.updateGameMods();
return ResultVO.success();
}

/**
* 备份游戏存档
*
Expand Down
12 changes: 12 additions & 0 deletions src/main/java/com/tugos/dst/admin/service/ShellService.java
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,18 @@ public List<String> updateGame() {
return ShellUtil.runShell(DstConstant.UPDATE_GAME_CMD);
}

/**
* 更新游戏Mods 需要停止地面和洞穴进程
*
* @return 执行信息
*/
public List<String> updateGameMods() {
//优雅关闭
this.elegantShutdownMaster();
this.elegantShutdownCaves();
return ShellUtil.runShell(DstConstant.UPDATE_GAME_MOD_CMD);
}

/**
* 睡眠
* @param seconds 秒
Expand Down
5 changes: 5 additions & 0 deletions src/main/java/com/tugos/dst/admin/utils/DstConstant.java
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,11 @@ public final class DstConstant {
*/
public static final String UPDATE_GAME_CMD = "cd ~/steamcmd ; ./steamcmd.sh +login anonymous +force_install_dir ~/dst +app_update 343050 validate +quit";

/**
* 更新游戏MOD
*/
public static final String UPDATE_GAME_MOD_CMD = "cd ~/dst/bin/ ; ./dontstarve_dedicated_server_nullrenderer -only_update_server_mods -console -cluster MyDediServer";

/**
* 删除地面游戏记录
*/
Expand Down
20 changes: 10 additions & 10 deletions src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,33 @@
server.port=8080
dst.username=admin
dst.password=123456
#\u4E0A\u4F20\u6587\u4EF6\u9650\u5236300MB
#上传文件限制300MB
spring.servlet.multipart.max-file-size=300MB
spring.servlet.multipart.max-request-size=300MB
logging.level.org.apache.shiro.session.mgt=warn

#\u56FD\u9645\u5316\u8D44\u6E90\u914D\u7F6E
#国际化资源配置
spring.messages.basename=i18n/messages
spring.messages.encoding=UTF-8

server.tomcat.min-spare-threads=3

#\u9650\u5236\u4E00\u4E9B\u9519\u8BEF\u65E5\u5FD7
#限制一些错误日志
logging.level.org.apache.coyote.http11.Http11AprProtocol=warn
logging.level.org.apache.tomcat.util.http.parser.Cookie=warn
logging.level.org.apache.coyote.http11.Http11Processor=warn

#\u5FEB\u7167\u5929\u6570
#快照天数
#dst.max.snapshots=6
##\u6E38\u620F\u4E3B\u7AEF\u53E3
##游戏主端口
#dst.master.port=10888
##\u5730\u9762\u7A0B\u5E8F\u7AEF\u53E3
##地面程序端口
#dst.ground.port=10999
##\u6D1E\u7A74\u7A0B\u5E8F\u7AEF\u53E3
##洞穴程序端口
#dst.caves.port=10998
#\u6700\u5927\u5B58\u6863\u5907\u4EFD\u5355\u4F4DMB
#最大存档备份单位MB
#dst.max.backup.size=4096
#\u654F\u611F\u8BCD\u8FC7\u6EE4
#敏感词过滤
#dst.filter.sensitive=true
#\u5F00\u542FGZIP\u538B\u7F29
#开启GZIP压缩
server.compression.enabled=true
502 changes: 252 additions & 250 deletions src/main/resources/i18n/messages.properties

Large diffs are not rendered by default.

10 changes: 6 additions & 4 deletions src/main/resources/i18n/messages_en_US.properties
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ tip.game.Archive.unknown.season=unknown_season
tip.game.Archive.unknown.playDay=unknown_days
tip.game.Archive.days=days

#\u72B6\u6001\u679A\u4E3E\u4E2D\u7684\u63D0\u793A\u8BED
#状态枚举中的提示语
tip.code.message.0=success
tip.code.message.50000=System Error
tip.code.message.500=Server Error
Expand Down Expand Up @@ -63,7 +63,7 @@ main.menu4.name=Backup Settings
main.menu5.name=Help
main.menu6.name=System Settings

#home\u9875\u9762
#home页面
home.title=Home
home.loading-text=loading
home.tab-pane1=Server Panel
Expand All @@ -83,10 +83,12 @@ home.pane1.card1.save.restart=Save and Restart
#Magic Start
main.lang=English
home.pane1.card1.dst.quickOperation=Quick Operation
home.pane1.card1.dst.search.suggestions=You can try to update the game when you can\u2019t find the server\uFF0CThe server will be stopped when updating.
home.pane1.card1.dst.search.suggestions=You can try to update the game when you can’t find the server,The server will be stopped when updating.
home.pane1.card1.dst.cancel=Cancel
home.pane1.card1.dst.confirm=Confirm
home.pane1.card1.dst.updateGame=Update Game
home.pane1.card1.dst.updateGameMods=Update Game Mod
home.pane1.card1.dst.updateGameMods.suggestions=The game mod will be updated soon, and the ongoing game will be disconnected. Do you want to continue?
home.pane1.card1.dst.createBackup=Create Backup
home.pane1.card1.dst.cleanGameArchive=Clean Game
home.pane1.card1.dst.clean.suggestions=Are you sure to clean up? After cleaning, the server will be stopped and the game progress will be deleted.
Expand Down Expand Up @@ -195,7 +197,7 @@ setting.player.title=Dst-admin platform game log view
setting.player.admin=Admin settings
setting.player.admin.desc=Game manager (can manage players and reset the world in the game)
setting.player.admin.add=Add
setting.player.admin.tips=Player list\uFF0CKU_*** is Player ID
setting.player.admin.tips=Player list,KU_*** is Player ID
setting.player.admin.input.id=Enter the player
setting.player.admin.delete=Delete
setting.player.admin.blacklist=Blacklist settings
Expand Down
Loading