-
Notifications
You must be signed in to change notification settings - Fork 4.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
List game & server version when starting server #1181
Conversation
…oo dumb to not hardcode it - sorry!
@@ -52,7 +52,8 @@ | |||
"run_mode_help": "Server run mode must be 'HYBRID', 'DISPATCH_ONLY', or 'GAME_ONLY'. Unable to start Grasscutter...", | |||
"create_resources": "Creating resources folder...", | |||
"resources_error": "Place a copy of 'BinOutput' and 'ExcelBinOutput' in the resources folder.", | |||
"version": "Grasscutter version: %s-%s" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't change this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's wrong?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changing the substitution parameter count would normally be a problem but I'm not getting any hits for existing usage of this so it might be fine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've traced it back to edc75b2 but it looks like the code that was referencing this translation string has since been replaced with https://github.com/mingjun97/Grasscutter/blob/2dc0120c81ff0c47af3f1e30069027d0622ea5c5/src/main/java/emu/grasscutter/Grasscutter.java#L84 so it's probably fine to repurpose this so long as the new version string is appropriate (I haven't checked that)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new version string is 1.1.2-dev
so it wouldn't even be correct to use %s-%s.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new version string is
1.1.2-dev
so it wouldn't even be correct to use %s-%s.
The second %s is for the git hash so we can easily identify someone’s build (primarily for development but also useful in stable)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new version string is
1.1.2-dev
so it wouldn't even be correct to use %s-%s.The second %s is for the git hash so we can easily identify someone’s build (primarily for development but also useful in stable)
Ohhhh sorry about that, I'll make sure to re-implement that as soon as I can.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup, it works for me now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new version string is
1.1.2-dev
so it wouldn't even be correct to use %s-%s.The second %s is for the git hash so we can easily identify someone’s build (primarily for development but also useful in stable)
AFAICT it's only used to construct the version string, we may as well just have a single string for version and change the gradle script from git rev-parse --verify --short HEAD
to git describe --tags --dirty
@@ -269,6 +269,8 @@ public void run() { | |||
@Override | |||
public void onStartFinish() { | |||
Grasscutter.getLogger().info(translate("messages.status.free_software")); | |||
Grasscutter.getLogger().info(translate("messages.status.game_version")); | |||
Grasscutter.getLogger().info(translate("messages.status.version")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do something like this but edit it to use the new translation system.
https://github.com/mingjun97/Grasscutter/blob/5aefad61eacfad17c46a4f139b5d5c8f56c0aff7/src/main/java/emu/grasscutter/Grasscutter.java#L84
(Originally from an old PR which was merged but was accidently removed)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the help, I've fiddled around with the code a little more and everything works perfectly on my side!
@@ -52,7 +52,8 @@ | |||
"run_mode_help": "服务器运行模式必须为 'HYBRID'(混合)、'DISPATCH_ONLY'(仅 Dispatch) 或 'GAME_ONLY'(仅游戏)。Grasscutter 启动失败...", | |||
"create_resources": "正在创建 resources 目录...", | |||
"resources_error": "请将 BinOutput 和 ExcelBinOutput 复制到 resources 目录。", | |||
"version": "Grasscutter 版本:%s-%s" | |||
"version": "Grasscutter 版本:%s", | |||
"game_version": "游戏版本: 2.7.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
incorrect punctuation
"游戏版本:%s"
update other language files too
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry about that, I just used a translator because I didn't want to leave the other languages throwing errors constantly.
* When the server starts, it now outputs the game and server version. Too dumb to not hardcode it - sorry! * ... * sorry i dropped my spaghetti, I'll help clean that * Doing simple stuff: now without hardcoding! * Restored Git hash functionality * Fixed other languages and made the output more useful. * Forgot this file lol
Description
Please carefully read the Contributing note and Code of conduct before making any pull requests.
And, Do not make a pull request to merge into stable unless it is a hotfix. Use the development branch instead.
Issues fixed by this PR
Outputs game and server version on startup. Currently hardcoded in the language files unfortunately. If anyone wants to fix my idiocy, I'd be pleased to accept it.
Type of changes
Checklist: