Packets crashing players

Discussion in 'Plugin Development' started by MCCoding, Sep 30, 2014.

Thread Status:
Not open for further replies.
  1. Offline

    MCCoding

    I have coded a Disguises but at times players crash when another player disguises saying "Internal Exception: java.io,IOExeception: an existing connecting was forcefully closed by the remote host" and at times "Internal Exception: net.minecraft.util.io.handler.codec.EncoderException: NullPointerException" anyone know of anything that may cause this?
     
  2. Offline

    FabeGabeMC

  3. Offline

    fireblast709

    MCCoding are you trying to send custom packets?
     
  4. Offline

    MCCoding

    fireblast709 FabeGabeMC I'm using 1.7.9 and for the packets I'm sending are

    • PacketPlayOutSpawnEntityLiving
    • PacketPlayOutEntityLook
    • PacketPlayOutEntityEquipment
    • PacketPlayOutEntityDestroy
     
  5. Offline

    fireblast709

    MCCoding when are you sending these?
     
  6. Offline

    FabeGabeMC

  7. Offline

    MCCoding

    FabeGabeMC It's a mob disguise not a player disguise, so shouldn't need to use that packet.

    fireblast709 I'm sending PacketPlayOutSpawnEntityLiving as soon as a player Disguises to everyone on the server and PacketPlayOutEntityLook, PacketPlayOutEntityEquipment every tick to update the players movement etc and as for PacketPlayOutEntityDestroy is when someone becomes undisguised
     
  8. Offline

    fireblast709

    MCCoding do you happen to have more stacktrace? And check if you got crash logs (and paste them if you have any related to the crash)
     
  9. Offline

    MCCoding

    fireblast709
    The server will only spit out the logs i posted in the OP and here is what the client says

    Code:
    ---- Minecraft Crash Report ----
    // This doesn't make any sense!
     
    Time: 10/1/14 11:16 AM
    Description: Unexpected error
     
    java.lang.NullPointerException: Unexpected error
        at net.minecraft.network.play.server.S0FPacketSpawnMob.func_149027_c(SourceFile:102)
        at net.minecraft.client.network.NetHandlerPlayClient.func_147281_a(NetHandlerPlayClient.java:766)
        at net.minecraft.network.play.server.S0FPacketSpawnMob.func_148833_a(SourceFile:97)
        at net.minecraft.network.play.server.S0FPacketSpawnMob.func_148833_a(SourceFile:15)
        at net.minecraft.network.NetworkManager.func_74428_b(NetworkManager.java:212)
        at net.minecraft.client.multiplayer.PlayerControllerMP.func_78765_e(PlayerControllerMP.java:273)
        at net.minecraft.client.Minecraft.func_71407_l(Minecraft.java:1590)
        at net.minecraft.client.Minecraft.func_71411_J(Minecraft.java:961)
        at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:887)
        at net.minecraft.client.main.Main.main(SourceFile:148)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at net.minecraft.launchwrapper.Launch.launch(Launch.java:134)
        at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
     
     
    A detailed walkthrough of the error, its code path and all known details is as follows:
    ---------------------------------------------------------------------------------------
     
    -- Head --
    Stacktrace:
        at net.minecraft.network.play.server.S0FPacketSpawnMob.func_149027_c(SourceFile:102)
        at net.minecraft.client.network.NetHandlerPlayClient.func_147281_a(NetHandlerPlayClient.java:766)
        at net.minecraft.network.play.server.S0FPacketSpawnMob.func_148833_a(SourceFile:97)
        at net.minecraft.network.play.server.S0FPacketSpawnMob.func_148833_a(SourceFile:15)
        at net.minecraft.network.NetworkManager.func_74428_b(NetworkManager.java:212)
        at net.minecraft.client.multiplayer.PlayerControllerMP.func_78765_e(PlayerControllerMP.java:273)
     
    -- Affected level --
    Details:
        Level name: MpServer
        All players: 1 total; [EntityClientPlayerMP['PHILLIPS_71'/97, l='MpServer', x=216.83, y=23.62, z=352.09]]
        Chunk stats: MultiplayerChunkCache: 441, 441
        Level seed: 0
        Level generator: ID 02 - largeBiomes, ver 0. Features enabled: false
        Level generator options:
        Level spawn location: World: (-4871,56,-3792), Chunk: (at 9,3,0 in -305,-237; contains blocks -4880,0,-3792 to -4865,255,-3777), Region: (-10,-8; contains chunks -320,-256 to -289,-225, blocks -5120,0,-4096 to -4609,255,-3585)
        Level time: 23001127 game time, 43417811 day time
        Level dimension: 0
        Level storage version: 0x00000 - Unknown?
        Level weather: Rain time: 0 (now: false), thunder time: 0 (now: false)
        Level game mode: Game mode: creative (ID 1). Hardcore: false. Cheats: false
        Forced entities: 3 total; [EntitySheep['Sheep'/129, l='MpServer', x=219.75, y=22.00, z=356.50], EntityOtherPlayerMP['CantonG'/129, l='MpServer', x=212.38, y=22.00, z=357.16], EntityClientPlayerMP['PHILLIPS_71'/97, l='MpServer', x=216.83, y=23.62, z=352.09]]
        Retry entities: 0 total; []
        Server brand: CraftBukkit
        Server type: Non-integrated multiplayer server
    Stacktrace:
        at net.minecraft.client.multiplayer.WorldClient.func_72914_a(WorldClient.java:373)
        at net.minecraft.client.Minecraft.func_71396_d(Minecraft.java:2432)
        at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:916)
        at net.minecraft.client.main.Main.main(SourceFile:148)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at net.minecraft.launchwrapper.Launch.launch(Launch.java:134)
        at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
     
    -- System Details --
    Details:
        Minecraft Version: 1.7.10
        Operating System: Windows 8 (amd64) version 6.2
        Java Version: 1.8.0_11, Oracle Corporation
        Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
        Memory: 200240136 bytes (190 MB) / 553017344 bytes (527 MB) up to 1060372480 bytes (1011 MB)
        JVM Flags: 6 total; -XX:HeapDumpPath=MojangTricksIntelDriversForPerformance_javaw.exe_minecraft.exe.heapdump -Xmx1G -XX:+UseConcMarkSweepGC -XX:+CMSIncrementalMode -XX:-UseAdaptiveSizePolicy -Xmn128M
        AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used
        IntCache: cache: 0, tcache: 0, allocated: 13, tallocated: 103
        FML: MCP v9.05 FML v7.10.25.1189 Minecraft Forge 10.13.0.1189 3 mods loaded, 3 mods active
        mcp{9.05} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available
        FML{7.10.25.1189} [Forge Mod Loader] (forge-1.7.10-10.13.0.1189.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available
        Forge{10.13.0.1189} [Minecraft Forge] (forge-1.7.10-10.13.0.1189.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available
        Launched Version: 1.7.10-Forge10.13.0.1189
        LWJGL: 2.9.1
        OpenGL: AMD Radeon HD 7900 Series GL version 4.2.11931 Compatibility Profile Context, ATI Technologies Inc.
        GL Caps: Using GL 1.3 multitexturing.
    Using framebuffer objects because OpenGL 3.0 is supported and separate blending is supported.
    Anisotropic filtering is supported and maximum anisotropy is 16.
    Shaders are available because OpenGL 2.1 is supported.
     
        Is Modded: Definitely; Client brand changed to 'fml,forge'
        Type: Client (map_client.txt)
        Resource Packs: [faithful32pack.zip]
        Current Language: English (US)
        Profiler Position: N/A (disabled)
        Vec3 Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used
        Anisotropic Filtering: Off (1)
     
  10. Offline

    fireblast709

    MCCoding the only thing that could possibly be the cause, is that you forget to add a List of watchable objects to the packets. If that's not it then I blame Forge and move on.
     
  11. Offline

    MCCoding

    That could be it fireblast709 because I know I have been playing around with data watchers, how do I get data watchers for the specific entity I need to sdd
     
  12. Offline

    fireblast709

    MCCoding there is a getDataWatcher() method in the NMS Entity class.
     
  13. Offline

    MCCoding

  14. Offline

    xTrollxDudex

    MCCoding
    Are you sending PacketPlayOutEntityDestroy to the player being destroyed?
     
  15. Offline

    MCCoding

    xTrollxDudex
    I'm yet to actually test the undisguise method so I have never sent the packet before but I have coded the method and it sends it to everyone on the server but the player being disguised

    bump

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 14, 2016
  16. Offline

    MCCoding

  17. Offline

    MCCoding

    Anyone have an idea? Maybe xTrollxDudex? could it be me trying to watch the name tag of the disguise? here is the data watcher


    Code:java
    1. this.dataWatcher.a(11, (byte) 0);
    2. this.dataWatcher.a(10, "");
    3.  
    4. public void setCustomNameVisible(boolean visible) {
    5. getDataWatcher().watch(11, (byte) (visible ? 1 : 0));
    6. }
    7.  
    8. public boolean getCustomNameVisible() {
    9. return getDataWatcher().getByte(11) == 1;
    10. }
    11.  
     
Thread Status:
Not open for further replies.

Share This Page