hugeblank / allium-peripherals

Yet another peripheral mod for ComputerCraft: Tweaked for Fabric
MIT License
7 stars 4 forks source link

Chat modem unbinds from the player #9

Open object-Object opened 2 years ago

object-Object commented 2 years ago

I'm seeing the chat modem unbind from me when I terminate programs with ctrl+t (but not when I press the terminate button in the UI, for some reason) and when the server restarts. When this happens, the icon is black and it doesn't capture my messages.

hugeblank commented 2 years ago

No issue if you can't, but I'm curious if you can reproduce this in the 1.17 version as well. I figured that it would be a problem in both versions of the mod/game. This is the case for #8 as well, so I thought I'd kill 2 birds with one stone. As it turns out though, I'm not able to reproduce on neither a client only setup, nor a client and server setup.

TL;DR could you reproduce this on the 1.17 version?

object-Object commented 2 years ago

Okay, so I also can't seem to make this happen in a controlled setup, but it's still constantly happening on the server I'm playing on. I think maybe it only happens when the server crashes? The ctrl+t thing also isn't happening anymore and I'm not sure why.

object-Object commented 2 years ago

Not sure if it's related to this issue, but we got this message in the logs at one point while the server was starting up - class_746 is ClientPlayerEntity, which is why we thought it might be related to this mod:

Error generating @LuaFunctions
java.lang.NoClassDefFoundError: net/minecraft/class_746                                                                         
        at Not Enough Crashes deobfuscated stack trace.(1.18.2+build.3) ~[?:?]               
        at java.lang.Class.getDeclaredMethods0(Native Method) ~[?:?]                           
        at java.lang.Class.privateGetDeclaredMethods(Class.java:3402) ~[?:?]                   
        at java.lang.Class.privateGetPublicMethods(Class.java:3427) ~[?:?]                                                                                                                                                                                      
        at java.lang.Class.getMethods(Class.java:2019) ~[?:?]                                                                   
        at dan200.computercraft.core.asm.Generator.build(Generator.java:97) ~[cc-restitched-1.100.8.jar:?]
        at dan200.computercraft.core.asm.Generator.lambda$catching$0(Generator.java:376) ~[cc-restitched-1.100.8.jar:?]  
        at com.google.common.cache.CacheLoader$FunctionToCacheLoader.load(CacheLoader.java:169) ~[guava-31.0.1-jre.jar:?]
        at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3533) ~[guava-31.0.1-jre.jar:?]
        at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2282) ~[guava-31.0.1-jre.jar:?]
        at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2159) ~[guava-31.0.1-jre.jar:?]
        at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2049) ~[guava-31.0.1-jre.jar:?]
        at com.google.common.cache.LocalCache.get(LocalCache.java:3966) ~[guava-31.0.1-jre.jar:?]
        at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:3989) ~[guava-31.0.1-jre.jar:?]
        at com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:4950) ~[guava-31.0.1-jre.jar:?]
        at dan200.computercraft.core.asm.Generator.getMethods(Generator.java:84) ~[cc-restitched-1.100.8.jar:?]
        at dan200.computercraft.shared.peripheral.generic.GenericPeripheralProvider.getPeripheral(GenericPeripheralProvider.java:31) ~[cc-restitched-1.100.8.jar:?]
        at dan200.computercraft.shared.Peripherals.getPeripheralAt(Peripherals.java:57) ~[cc-restitched-1.100.8.jar:?]                                                                                                                                          
        at dan200.computercraft.shared.Peripherals.getPeripheral(Peripherals.java:37) ~[cc-restitched-1.100.8.jar:?]                                                                                                                                                    at dan200.computercraft.shared.computer.blocks.TileComputerBase.refreshPeripheral(TileComputerBase.java:263) ~[cc-restitched-1.100.8.jar:?]                                                                                                                     at dan200.computercraft.shared.computer.blocks.TileComputerBase.updateInputsImmediately(TileComputerBase.java:288) ~[cc-restitched-1.100.8.jar:?]                                                                                                               at dan200.computercraft.shared.computer.blocks.TileComputerBase.createServerComputer(TileComputerBase.java:390) ~[cc-restitched-1.100.8.jar:?]
        at dan200.computercraft.shared.computer.blocks.TileComputerBase.serverTick(TileComputerBase.java:161) ~[cc-restitched-1.100.8.jar:?]
        at dan200.computercraft.shared.computer.blocks.BlockComputerBase.lambda$new$0(BlockComputerBase.java:44) ~[cc-restitched-1.100.8.jar:?]
        at net.minecraft.world.chunk.WorldChunk$DirectBlockEntityTickInvoker.redirect$bap000$checkProcessTEs(WorldChunk:783) ~[?:?]
        at net.minecraft.world.chunk.WorldChunk$DirectBlockEntityTickInvoker.tick(WorldChunk:659) ~[?:?]
        at net.minecraft.world.chunk.WorldChunk$WrappedBlockEntityTickInvoker.tick(WorldChunk:713) ~[?:?]
        at net.minecraft.world.World.tickBlockEntities(World:475) ~[?:?]                                   
        at net.minecraft.server.world.ServerWorld.tick(ServerWorld:368) ~[?:?]           
        at net.minecraft.server.MinecraftServer.redirect$bia000$fixUpdateSuppressionCrashTick(MinecraftServer:5790) ~[server-intermediary.jar:?]
        at net.minecraft.server.MinecraftServer.tickWorlds(MinecraftServer:907) ~[server-intermediary.jar:?]
        at net.minecraft.server.dedicated.MinecraftDedicatedServer.tickWorlds(MinecraftDedicatedServer:322) ~[?:?]
        at net.minecraft.server.MinecraftServer.tick(MinecraftServer:851) ~[server-intermediary.jar:?]
        at net.minecraft.server.MinecraftServer.handler$bam000$modifiedRunLoop(MinecraftServer:4896) ~[server-intermediary.jar:?]                         
        at net.minecraft.server.MinecraftServer.runServer(MinecraftServer:676) ~[server-intermediary.jar:?]
        at net.minecraft.server.MinecraftServer.method_29739(MinecraftServer:273) ~[server-intermediary.jar:?]
        at java.lang.Thread.run(Thread.java:833) [?:?]                                                                          
Caused by: java.lang.ClassNotFoundException: net.minecraft.class_746                                                
hugeblank commented 2 years ago

hm. What other mods do you have besides CC and AP?

object-Object commented 2 years ago

Sorry, it's quite a few

advancementfix-0.1.0
allium-0.2.2+1.18.2
appleskin-fabric-mc1.18.2-2.4.0
architectury-4.5.76-fabric
artifacts-7.0.3+fabric
badpackets-fabric-0.1.2
bclib-1.4.7
borderless-mining-1.1.2+1.18.2
Botania-1.18.2-434-FABRIC
can-i-mine-this-block-1.2.0
cardinal-components-api-4.2.0
carpet-extra-1.18.2-1.4.72
cc-restitched-1.100.8
chalk-2.0.1+1.18.2
chipped-1.2
ChiselsBits-fabric-1.18.2-1.2.113
CleanView-1.18.2-v1-fabric
cloth-api-3.2.64
cloth-config-6.2.62-fabric
completeconfig-lib-1.4.1
ContentCreatorIntegration-1.18.2-Fabric-1.10.0
Controlling-fabric-1.18.2-9.0+21
CraftingPad-1.18.2-1.0.8
crawl-0.10.6
create-mc1.18.2_v0.4.1+637
DarkPaintings-Fabric-1.18.2-10.0.3
ears-fabric-1.17-1.4.5_01
eden-ring-0.5.2
EditSign-1.18.2-2.3.1
emi-0.3.0+1.18.2
expanded-trident-enchanting-1.0.3
ExtendedDrawers-1.3.1+mc.1.18.2
extremesoundmuffler-3.27_fabric-1.18.x
fabric-api-0.57.0+1.18.2
fabric-carpet-1.18.2-1.4.69+v220331
Fabric-Discord-Link-0.10.8
fabric-language-kotlin-1.8.1+kotlin.1.7.0
farmers-delight-fabric-0.2.1c
feature_nbt_deadlock_be_gone_fabric-2.0.0+1.18.2-rc1
ferritecore-4.2.1-fabric
glassential-fabric-1.3.0
graphlib-0.2.4+1.18.2
GravityChanger-0.7.10a-1.18.2
half-doors-1.18.2-fabric-1.3.7
hexcasting-fabric-1.18.2-0.9.2-requiem-alpha-g
illuminations-1.10.4
Incorporeal-3-fabric-1.18.2-4
indium-1.0.6+mc1.18.2
InventorySorter-1.8.8-1.18
iris-mc1.18.2-1.2.5
itemscroller-fabric-1.18.2-0.16.1
journeymap-1.18.2-5.8.5-fabric
kubejs-fabric-1802.5.4-build.516
lanterns-belong-on-walls-1.3.0-1.18.x
lazydfu-0.1.2
litematica-fabric-1.18.2-0.11.3
lithium-fabric-mc1.18.2-0.7.10
lootr-1.18.2-0.3.22.59
malilib-fabric-1.18.2-0.12.1
minihud-fabric-1.18.2-0.22.0
mnemonics-1.2.0
modmenu-3.2.3
MouseTweaks-fabric-mc1.18-2.22
notenoughcrashes-4.1.6+1.18.2-fabric
packages-1.4
Patchouli-1.18.2-71.1-FABRIC
paucal-fabric-1.18.2-0.4.7
Paxi-1.18.2-Fabric-2.0
Pehkui-3.3.3+1.14.4-1.19.1
phosphor-fabric-mc1.18.x-0.8.1
quickshulker-1.3.6-1.18
reeses_sodium_options-1.4.4+mc1.18.2-build.46
repurposed_structures_fabric-4.1.14+1.18.2
requiem-2.0.0-beta.9
retrocandles-fabric-1.18.2-0.2.0
rhino-fabric-1802.1.13-build.179
simple-cobblestone-generator-1.1.8
skiptransitions-1.3.2+1.18.x
sodium-extra-0.4.6+mc1.18.2-build.46
sodium-fabric-mc1.18.2-0.4.1+build.15
spark-1.9.11-fabric
textile_backup-2.4.0-1.18
tooltipfix-1.0.4-1.18
travelers-backpack-1.18.2-7.1.3
traverse-5.1.0
trinkets-3.3.1
tweakeroo-fabric-1.18.2-0.13.3
twigs-fabric-1.1.3-patch2+1.18.2
veinmining-fabric-0.0.13-1.18.2
voicechat-fabric-1.18.2-2.2.52
whereisit-1.18.2-1.14.10
wraith-harvestscythes-2.5.1
wthit-fabric-4.11.0
youre-in-grave-danger-1.3.7
YungsApi-1.18.2-Fabric-2.0.8
YungsBetterDesertTemples-1.18.2-Fabric-1.2
YungsBetterDungeons-1.18.2-Fabric-2.1.0
YungsBetterMineshafts-1.18.2-Fabric-2.2
YungsExtras-1.18.2-Fabric-2.1.0
Zoomify-1.6.0
hugeblank commented 2 years ago

hm. hm. That might just be CC erroring on it's own, unrelated to this issue. I don't think there's any part of AP that uses ClientPlayerEntity.

object-Object commented 2 years ago

Hm alright. Sorry for the red herring then. I assumed it was from AP because googling class_746 led me to this SO page talking about using it for chat messages.

hugeblank commented 2 years ago

If you can reproduce it on server restart/crash again, send me the crash log. Leaving this open for now.

object-Object commented 2 years ago

After a modpack update, it's no longer disconnecting randomly (possibly because the server is crashing much less frequently). Now, the computer occasionally gets into a state where the chat modem unpairs when os.pullEvent is called. I don't have a way to reproduce this consistently, but I have three computers that are doing this, if you want me to get the block data or something. The following script causes the modem to unpair on these computers:

local chat = peripheral.wrap("right")
chat.capture("foo")
os.pullEvent("chat_capture")
hugeblank commented 2 years ago

Something I noticed in testing was that the modem would appear to unpair in its block state, to the client, but not actually be unpaired on the server. Could that be the case here, or is it genuinely after some time, all of the sudden letting messages, "foo" in this case, pass through? If it's just a client desync thing then I am aware and have addressed it in the next version.

You're probably picking up on this now, but a lot of the logic mod was written back when I was a lot less experienced in modding, and Java. It's been in desperate need of attention for some time now, and I'm just now picking up the slack and rewriting the whole thing.

object-Object commented 2 years ago

Yeah it's actually letting "foo" pass through. Also, once a computer starts doing this, it seems to be permanently bugged. That's why I have three of them.

hugeblank commented 2 years ago

Permanently bugged in what way? Like unable to be terminated or turned off? Is it something that's being logged to the console?

object-Object commented 2 years ago

It always unpairs when os.pullEvent is called once it starts doing that.

hugeblank commented 2 years ago

hm. I have no idea how just pulling the event would trigger it to change its state. I'll look into it though.

object-Object commented 2 years ago

I can probably get you the world file and a copy of the modpack (or just the computercraft folder in the world?) if that would help debug this.

hugeblank commented 2 years ago

ahhh... maybe? Like I've said before I've pretty much entirely rewritten the mod, so it wouldn't necessarily be worth it if its already been fixed. Maybe you'd be interested in testing out a pre-release of the rewrite?

object-Object commented 2 years ago

Yeah I could do that.

hugeblank commented 2 years ago

Perfect. I'll drop a link here to a github release when I get around to it.

hugeblank commented 2 years ago

v0.4.0-rc.1+mc1.18.2 Here it is! Let me know if any issues arise, specifically with the Chat Modem as that's my priority right now.