ProjectE icon indicating copy to clipboard operation
ProjectE copied to clipboard

[1.12.2 - 1.4.1] SimpleChannelHandlerWrapper exception of Fake Player left clicks on Dedicated servers

Open TigerWalts opened this issue 5 years ago • 1 comments

Exact ProjectE version (do not say "latest", "latest on Curse", or similar): 1.12.2-PE1.4.1

Exact Forge version: forge-14.23.5.2838

Link to crash log (please use a paste site, do not attach the .txt or paste the log inline):

  • https://pastebin.com/wTcqnyZa
19.11 21:39:01 [Server] Server thread/ERROR SimpleChannelHandlerWrapper exception
19.11 21:39:01 [Server] INFO java.lang.RuntimeException: Missing
19.11 21:39:01 [Server] INFO at net.minecraftforge.fml.server.FMLServerHandler.getClientToServerNetworkManager(FMLServerHandler.java:299) ~[FMLServerHandler.class:?]
19.11 21:39:01 [Server] INFO at net.minecraftforge.fml.common.FMLCommonHandler.getClientToServerNetworkManager(FMLCommonHandler.java:555) ~[FMLCommonHandler.class:?]
...
19.11 21:39:01 [Server] INFO at net.minecraftforge.fml.common.network.simpleimpl.SimpleNetworkWrapper.sendToServer(SimpleNetworkWrapper.java:321) [SimpleNetworkWrapper.class:?]
19.11 21:39:01 [Server] INFO at moze_intel.projecte.network.PacketHandler.sendToServer(PacketHandler.java:106) [PacketHandler.class:?]
19.11 21:39:01 [Server] INFO at moze_intel.projecte.gameObjs.items.rings.ArchangelSmite.emptyLeftClick(ArchangelSmite.java:64) [ArchangelSmite.class:?]
19.11 21:39:01 [Server] INFO at net.minecraftforge.fml.common.eventhandler.ASMEventHandler_1005_ArchangelSmite_emptyLeftClick_LeftClickEmpty.invoke(.dynamic) [?:?]
19.11 21:39:01 [Server] INFO at net.minecraftforge.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:90) [ASMEventHandler.class:?]
19.11 21:39:01 [Server] INFO at net.minecraftforge.fml.common.eventhandler.EventBus.post(EventBus.java:182) [EventBus.class:?]
19.11 21:39:01 [Server] INFO at net.minecraftforge.common.ForgeHooks.onEmptyLeftClick(ForgeHooks.java:1148) [ForgeHooks.class:?]
19.11 21:39:01 [Server] INFO at shadows.click.util.FakePlayerUtil.leftClickInDirection(FakePlayerUtil.java:230) [FakePlayerUtil.class:?]
19.11 21:39:01 [Server] INFO at shadows.click.block.TileAutoClick.func_73660_a(TileAutoClick.java:65) [TileAutoClick.class:?]

Steps to reproduce:

  1. You'll need to run both a dedicated server and a client
  2. Add the Click Machine (1.12.2-1.2.0) mod
  3. Run the server and client and connect to the server
  4. Place a Click Machine block
  5. Right-click the Click Machine and click L to set it to left-click mode

What I expected to happen:

N/A

What happened instead:

The server log will show the above error every time the Click Machine is triggered.


Every time a FakePlayer on a dedicated server performs an emptyLeftClick an event handler added by ProjectE calls PacketHandler/sendToServer() with a message class of LeftClickArchangelPKT.

If you have multiple TileEntities performing left clicks at regular intervals, then this will spam the log.

One possible fix is to have the PlayerInteractEvent.LeftClickEmpty event handler check evt.getWorld().isRemote before calling PacketHandler.sendToServer

  • https://github.com/sinkillerj/ProjectE/blob/8d947b93a61bb7e219aed9e6d24c1699f24d87aa/src/main/java/moze_intel/projecte/gameObjs/items/rings/ArchangelSmite.java#L64

TigerWalts avatar Nov 19 '19 22:11 TigerWalts

Fun fact. Just had a customer's server with over 80GB of log files due to this bug.

I came to make a bug report and found this one. :)

I've tested a patched version with the following change:

	@SubscribeEvent
	public void emptyLeftClick(PlayerInteractEvent.LeftClickEmpty evt)
	{
		if (evt.getWorld().isRemote)
		{
			PacketHandler.sendToServer(new LeftClickArchangelPKT());
		}
	}

~~This problem appears to be present in all later versions too.~~ Fixed in the 1.14 branch.

TigerWalts avatar Oct 01 '20 14:10 TigerWalts