bytzo / sessility

AFK utilities for the server: Keeps track of sessile creatures, more often known as "AFK players".
https://modrinth.com/mod/sessility
MIT License
4 stars 4 forks source link

UTF-8 characters not supported in Sessility's configuration file #1

Closed FudgeDumbo closed 2 years ago

FudgeDumbo commented 2 years ago

what encoding(?) does it use? it seems other languages and special characters are not supported at all it auto fixes(?) the text in the file into some weird codes can you make it compatible with korean? does not really care about special characters but would be awesome to support korean btw love the mod~

bytzo commented 2 years ago

It looks like this issue is caused by the vanilla bug MC-2215. Because Sessility extends the vanilla server properties system, it inherits all of its bugs.

However, since this MC-2215 has been open since 2012 and it doesn't look like it will be fixed soon, it would make sense to create a separate mod to fix the underlying issue. This would fix UTF-8 encoding in both the server.properties file and Sessility's own sessility.properties.

Unfortunately, I don't think I have the time right now to create such a mod. For now, you should be able to manually substitute the misbehaving characters with their Unicode code (for example, \u0000). However, I'll see if I can fix this issue in the coming days during my free time.

bytzo commented 2 years ago

https://github.com/bytzo/mc-2215

Enjoy! The linked mod forces server properties to use UTF-8 encoding. You can find the download for the mod here.

FudgeDumbo commented 2 years ago

awesome! but sessility is not compatible with the fix mod xD

main/ERROR Mixin apply for mod sessility failed sessility.mixins.json:SettingsMixin from mod sessility -> net.minecraft.class_3808: org.spongepowered.asm.mixin.injection.throwables.InvalidInjectionException Specified index 1 for @ModifyArg is invalid for args (Ljava/util/Properties;Ljava/io/OutputStream;Ljava/lang/String;), expected Ljava/lang/String; on net/minecraft/class_3808::modifyPropertiesComments [INJECT Applicator Phase -> sessility.mixins.json:SettingsMixin from mod sessility -> Apply Injections -> -> Inject -> sessility.mixins.json:SettingsMixin from mod sessility->@ModifyArg::modifyPropertiesComments(Ljava/lang/String;)Ljava/lang/String;] 26.06 04:59:48 [Server] INFO org.spongepowered.asm.mixin.injection.throwables.InvalidInjectionException: Specified index 1 for @ModifyArg is invalid for args (Ljava/util/Properties;Ljava/io/OutputStream;Ljava/lang/String;), expected Ljava/lang/String; on net/minecraft/class_3808::modifyPropertiesComments [INJECT Applicator Phase -> sessility.mixins.json:SettingsMixin from mod sessility -> Apply Injections -> -> Inject -> sessility.mixins.json:SettingsMixin from mod sessility->@ModifyArg::modifyPropertiesComments(Ljava/lang/String;)Ljava/lang/String;] 26.06 04:59:48 [Server] INFO at org.spongepowered.asm.mixin.injection.invoke.ModifyArgInjector.findArgIndex(ModifyArgInjector.java:158) ~[sponge-mixin-0.11.4+mixin.0.8.5.jar:0.11.4+mixin.0.8.5] 26.06 04:59:48 [Server] INFO at org.spongepowered.asm.mixin.injection.invoke.ModifyArgInjector.injectAtInvoke(ModifyArgInjector.java:113) ~[sponge-mixin-0.11.4+mixin.0.8.5.jar:0.11.4+mixin.0.8.5] 26.06 04:59:48 [Server] INFO at org.spongepowered.asm.mixin.injection.invoke.InvokeInjector.inject(InvokeInjector.java:82) ~[sponge-mixin-0.11.4+mixin.0.8.5.jar:0.11.4+mixin.0.8.5] 26.06 04:59:48 [Server] INFO at org.spongepowered.asm.mixin.injection.invoke.ModifyArgInjector.inject(ModifyArgInjector.java:103) ~[sponge-mixin-0.11.4+mixin.0.8.5.jar:0.11.4+mixin.0.8.5] 26.06 04:59:48 [Server] INFO at org.spongepowered.asm.mixin.injection.code.Injector.inject(Injector.java:276) ~[sponge-mixin-0.11.4+mixin.0.8.5.jar:0.11.4+mixin.0.8.5] 26.06 04:59:48 [Server] INFO at org.spongepowered.asm.mixin.injection.struct.InjectionInfo.inject(InjectionInfo.java:445) ~[sponge-mixin-0.11.4+mixin.0.8.5.jar:0.11.4+mixin.0.8.5] 26.06 04:59:48 [Server] INFO at org.spongepowered.asm.mixin.transformer.MixinTargetContext.applyInjections(MixinTargetContext.java:1378) ~[sponge-mixin-0.11.4+mixin.0.8.5.jar:0.11.4+mixin.0.8.5] 26.06 04:59:48 [Server] INFO at org.spongepowered.asm.mixin.transformer.MixinApplicatorStandard.applyInjections(MixinApplicatorStandard.java:1052) ~[sponge-mixin-0.11.4+mixin.0.8.5.jar:0.11.4+mixin.0.8.5] 26.06 04:59:48 [Server] INFO at org.spongepowered.asm.mixin.transformer.MixinApplicatorStandard.applyMixin(MixinApplicatorStandard.java:400) ~[sponge-mixin-0.11.4+mixin.0.8.5.jar:0.11.4+mixin.0.8.5] 26.06 04:59:48 [Server] INFO at org.spongepowered.asm.mixin.transformer.MixinApplicatorStandard.apply(MixinApplicatorStandard.java:325) ~[sponge-mixin-0.11.4+mixin.0.8.5.jar:0.11.4+mixin.0.8.5] 26.06 04:59:48 [Server] INFO at org.spongepowered.asm.mixin.transformer.TargetClassContext.apply(TargetClassContext.java:421) ~[sponge-mixin-0.11.4+mixin.0.8.5.jar:0.11.4+mixin.0.8.5] 26.06 04:59:48 [Server] INFO at org.spongepowered.asm.mixin.transformer.TargetClassContext.applyMixins(TargetClassContext.java:403) ~[sponge-mixin-0.11.4+mixin.0.8.5.jar:0.11.4+mixin.0.8.5] 26.06 04:59:48 [Server] INFO at org.spongepowered.asm.mixin.transformer.MixinProcessor.applyMixins(MixinProcessor.java:363) ~[sponge-mixin-0.11.4+mixin.0.8.5.jar:0.11.4+mixin.0.8.5] 26.06 04:59:48 [Server] INFO at org.spongepowered.asm.mixin.transformer.MixinTransformer.transformClass(MixinTransformer.java:234) ~[sponge-mixin-0.11.4+mixin.0.8.5.jar:0.11.4+mixin.0.8.5] 26.06 04:59:48 [Server] INFO at org.spongepowered.asm.mixin.transformer.MixinTransformer.transformClassBytes(MixinTransformer.java:202) ~[sponge-mixin-0.11.4+mixin.0.8.5.jar:0.11.4+mixin.0.8.5] 26.06 04:59:48 [Server] INFO at net.fabricmc.loader.impl.launch.knot.KnotClassDelegate.getPostMixinClassByteArray(KnotClassDelegate.java:414) ~[fabric-loader-0.14.8.jar:?] 26.06 04:59:48 [Server] INFO at net.fabricmc.loader.impl.launch.knot.KnotClassDelegate.tryLoadClass(KnotClassDelegate.java:323) ~[fabric-loader-0.14.8.jar:?] 26.06 04:59:48 [Server] INFO at net.fabricmc.loader.impl.launch.knot.KnotClassDelegate.loadClass(KnotClassDelegate.java:218) ~[fabric-loader-0.14.8.jar:?] 26.06 04:59:48 [Server] INFO at net.fabricmc.loader.impl.launch.knot.KnotClassLoader.loadClass(KnotClassLoader.java:145) ~[fabric-loader-0.14.8.jar:?] 26.06 04:59:48 [Server] INFO at java.lang.ClassLoader.loadClass(ClassLoader.java:520) ~[?:?] 26.06 04:59:48 [Server] INFO at java.lang.ClassLoader.defineClass1(Native Method) ~[?:?] 26.06 04:59:48 [Server] INFO at java.lang.ClassLoader.defineClass(ClassLoader.java:1012) ~[?:?] 26.06 04:59:48 [Server] INFO at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:150) ~[?:?] 26.06 04:59:48 [Server] INFO at net.fabricmc.loader.impl.launch.knot.KnotClassLoader.defineClassFwd(KnotClassLoader.java:186) ~[fabric-loader-0.14.8.jar:?] 26.06 04:59:48 [Server] INFO at net.fabricmc.loader.impl.launch.knot.KnotClassDelegate.tryLoadClass(KnotClassDelegate.java:347) ~[fabric-loader-0.14.8.jar:?] 26.06 04:59:48 [Server] INFO at net.fabricmc.loader.impl.launch.knot.KnotClassDelegate.loadClass(KnotClassDelegate.java:218) ~[fabric-loader-0.14.8.jar:?] 26.06 04:59:48 [Server] INFO at net.fabricmc.loader.impl.launch.knot.KnotClassLoader.loadClass(KnotClassLoader.java:145) ~[fabric-loader-0.14.8.jar:?] 26.06 04:59:48 [Server] INFO at java.lang.ClassLoader.loadClass(ClassLoader.java:520) ~[?:?] 26.06 04:59:48 [Server] INFO at net.bytzo.sessility.SessilitySettings.(SessilitySettings.java:19) ~[sessility-0.2.jar:?] 26.06 04:59:48 [Server] INFO at net.bytzo.sessility.Sessility.onInitializeServer(Sessility.java:10) ~[sessility-0.2.jar:?] 26.06 04:59:48 [Server] INFO at net.fabricmc.loader.impl.entrypoint.EntrypointUtils.invoke0(EntrypointUtils.java:47) [fabric-loader-0.14.8.jar:?] 26.06 04:59:48 [Server] INFO at net.fabricmc.loader.impl.entrypoint.EntrypointUtils.invoke(EntrypointUtils.java:35) [fabric-loader-0.14.8.jar:?] 26.06 04:59:48 [Server] INFO at net.fabricmc.loader.impl.game.minecraft.Hooks.startServer(Hooks.java:63) [fabric-loader-0.14.8.jar:?] 26.06 04:59:48 [Server] INFO at net.minecraft.server.Main.main(Main.java:101) [server-intermediary.jar:?] 26.06 04:59:48 [Server] INFO at net.fabricmc.loader.impl.game.minecraft.MinecraftGameProvider.launch(MinecraftGameProvider.java:461) [fabric-loader-0.14.8.jar:?] 26.06 04:59:48 [Server] INFO at net.fabricmc.loader.impl.launch.knot.Knot.launch(Knot.java:74) [fabric-loader-0.14.8.jar:?] 26.06 04:59:48 [Server] INFO at net.fabricmc.loader.impl.launch.knot.KnotServer.main(KnotServer.java:23) [fabric-loader-0.14.8.jar:?] 26.06 04:59:48 [Server] INFO at net.fabricmc.loader.impl.launch.server.FabricServerLauncher.main(FabricServerLauncher.java:69) [fabric-loader-0.14.8.jar:?] main/ERROR Failed to start the minecraft server 26.06 04:59:48 [Server] INFO java.lang.RuntimeException: Could not execute entrypoint stage 'server' due to errors, provided by 'sessility'! 26.06 04:59:48 [Server] INFO at net.fabricmc.loader.impl.entrypoint.EntrypointUtils.lambda$invoke0$0(EntrypointUtils.java:51) ~[fabric-loader-0.14.8.jar:?] 26.06 04:59:48 [Server] INFO at net.fabricmc.loader.impl.util.ExceptionUtil.gatherExceptions(ExceptionUtil.java:33) ~[fabric-loader-0.14.8.jar:?] 26.06 04:59:48 [Server] INFO at net.fabricmc.loader.impl.entrypoint.EntrypointUtils.invoke0(EntrypointUtils.java:49) ~[fabric-loader-0.14.8.jar:?] 26.06 04:59:48 [Server] INFO at net.fabricmc.loader.impl.entrypoint.EntrypointUtils.invoke(EntrypointUtils.java:35) ~[fabric-loader-0.14.8.jar:?] 26.06 04:59:48 [Server] INFO at net.fabricmc.loader.impl.game.minecraft.Hooks.startServer(Hooks.java:63) ~[fabric-loader-0.14.8.jar:?] 26.06 04:59:48 [Server] INFO at net.minecraft.server.Main.main(Main.java:101) [server-intermediary.jar:?] 26.06 04:59:48 [Server] INFO at net.fabricmc.loader.impl.game.minecraft.MinecraftGameProvider.launch(MinecraftGameProvider.java:461) [fabric-loader-0.14.8.jar:?] 26.06 04:59:48 [Server] INFO at net.fabricmc.loader.impl.launch.knot.Knot.launch(Knot.java:74) [fabric-loader-0.14.8.jar:?] 26.06 04:59:48 [Server] INFO at net.fabricmc.loader.impl.launch.knot.KnotServer.main(KnotServer.java:23) [fabric-loader-0.14.8.jar:?] 26.06 04:59:48 [Server] INFO at net.fabricmc.loader.impl.launch.server.FabricServerLauncher.main(FabricServerLauncher.java:69) [fabric-loader-0.14.8.jar:?] 26.06 04:59:48 [Server] INFO Caused by: java.lang.RuntimeException: Mixin transformation of net.minecraft.class_3808 failed 26.06 04:59:48 [Server] INFO at net.fabricmc.loader.impl.launch.knot.KnotClassDelegate.getPostMixinClassByteArray(KnotClassDelegate.java:419) ~[fabric-loader-0.14.8.jar:?] 26.06 04:59:48 [Server] INFO at net.fabricmc.loader.impl.launch.knot.KnotClassDelegate.tryLoadClass(KnotClassDelegate.java:323) ~[fabric-loader-0.14.8.jar:?] 26.06 04:59:48 [Server] INFO at net.fabricmc.loader.impl.launch.knot.KnotClassDelegate.loadClass(KnotClassDelegate.java:218) ~[fabric-loader-0.14.8.jar:?] 26.06 04:59:48 [Server] INFO at net.fabricmc.loader.impl.launch.knot.KnotClassLoader.loadClass(KnotClassLoader.java:145) ~[fabric-loader-0.14.8.jar:?] 26.06 04:59:48 [Server] INFO at java.lang.ClassLoader.loadClass(ClassLoader.java:520) ~[?:?] 26.06 04:59:48 [Server] INFO at java.lang.ClassLoader.defineClass1(Native Method) ~[?:?] 26.06 04:59:48 [Server] INFO at java.lang.ClassLoader.defineClass(ClassLoader.java:1012) ~[?:?] 26.06 04:59:48 [Server] INFO at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:150) ~[?:?] 26.06 04:59:48 [Server] INFO at net.fabricmc.loader.impl.launch.knot.KnotClassLoader.defineClassFwd(KnotClassLoader.java:186) ~[fabric-loader-0.14.8.jar:?] 26.06 04:59:48 [Server] INFO at net.fabricmc.loader.impl.launch.knot.KnotClassDelegate.tryLoadClass(KnotClassDelegate.java:347) ~[fabric-loader-0.14.8.jar:?] 26.06 04:59:48 [Server] INFO at net.fabricmc.loader.impl.launch.knot.KnotClassDelegate.loadClass(KnotClassDelegate.java:218) ~[fabric-loader-0.14.8.jar:?] 26.06 04:59:48 [Server] INFO at net.fabricmc.loader.impl.launch.knot.KnotClassLoader.loadClass(KnotClassLoader.java:145) ~[fabric-loader-0.14.8.jar:?] 26.06 04:59:48 [Server] INFO at java.lang.ClassLoader.loadClass(ClassLoader.java:520) ~[?:?] 26.06 04:59:48 [Server] INFO at net.bytzo.sessility.SessilitySettings.(SessilitySettings.java:19) ~[sessility-0.2.jar:?] 26.06 04:59:48 [Server] INFO at net.bytzo.sessility.Sessility.onInitializeServer(Sessility.java:10) ~[sessility-0.2.jar:?] 26.06 04:59:48 [Server] INFO at net.fabricmc.loader.impl.entrypoint.EntrypointUtils.invoke0(EntrypointUtils.java:47) ~[fabric-loader-0.14.8.jar:?]

bytzo commented 2 years ago

Oh no! I should have properly tested the mods together :P

Let me see what I can do to fix the issue.

FudgeDumbo commented 2 years ago

like i mentioned its just nice to have function to be in different language :p but not a problem at all to keep it in english hehe the mod is a great addition to my server to announce someone being afk :)

thank you~

bytzo commented 2 years ago

Sorry for the inconvenience! The conflict should now be fixed in MC-2215 0.1.1. While both mods seem to work together in my testing, would you mind testing them and letting me know if they work for you?

FudgeDumbo commented 2 years ago

oh my god! you are the best. it is working perfect! thank you very much!

bytzo commented 2 years ago

That's great to hear! Thanks for taking the time to help test the mods together, I really appreciate it :D

I'll close this issue for now, but I'll pin it so other people can find it if they have the same issue.

bytzo commented 1 year ago

It looks like Mojang fixed this bug in 1.20! The MC-2215 bugfix mod is no longer needed to make UTF-8 characters save properly in Sessility's configuration file.