Player Disconnects from the server

Options
Hello!

Love Bolt, but i have a slight problem. Sometimes user is disconnected from the game and i get this error in the outputlog.


NullReferenceException
at (wrapper managed-to-native) UnityEngine.Component:get_gameObject ()
at BoltCore.DestroyForce (Bolt.Entity entity) [0x00000] in :0
at EntityChannel.DestroyIncommingProxy (.EntityProxy proxy, IProtocolToken token) [0x00000] in :0
at EntityChannel.ReadUpdate (Bolt.Packet packet) [0x00000] in :0
at EntityChannel.Read (Bolt.Packet packet) [0x00000] in :0
at BoltConnection.PacketReceived (UdpKit.UdpPacket udpPacket) [0x00000] in :0
UnityEngine.DebugLogHandler:Internal_LogException(Exception, Object)
UnityEngine.DebugLogHandler:LogException(Exception, Object)
UnityEngine.Logger:LogException(Exception, Object)
UnityEngine.Debug:LogException(Exception)
BoltLog:Exception(Exception)
BoltConnection:PacketReceived(UdpPacket)
BoltCore:Udp_PacketReceived(UdpEvent)
BoltCore:PollNetwork()
BoltCore:Poll()
BoltPoll:FixedUpdate()

(Filename: Line: -1)

UdpKit.UdpSocket


Anyone can help me with this?

Comments

  • Solidust
    Options
    Some more info, i am using authorative server model where server decided about everything. 1 Time it happened when my user was shooting ak47 and it randomly disconnected
  • Yukichu
    Options
    I had a random disconnect problem for a LONG time and it was completely my fault. If at any point there is a null reference exception, Bolt just disconnects you. Probably a good thing. I was using a temporary save-file class and didn't initialize it to null, and well... when it hit that part, if anything was funky, bam disconnect problem.

    It took a lot of debug statements, following through the code, etc. I kept thinking it was something on the client the whole time, but it was the server.

    I wish there was better debugging for this sort of thing; alas, just have to work with what is going on. Use the new Unity assertions, those are awesome.
  • Solidust
    Options
    NullReferenceException
    at (wrapper managed-to-native) UnityEngine.Component:get_transform ()
    at Bolt.EntityBehaviour.get_entity () [0x00000] in :0
    at Bolt.Entity.Detach () [0x00000] in :0
    UnityEngine.DebugLogHandler:Internal_LogException(Exception, Object)
    UnityEngine.DebugLogHandler:LogException(Exception, Object) (at C:\buildslave\unity\build\Runtime\Export\Logger\DebugLogHandler.cs:15)
    UnityEngine.Logger:LogException(Exception, Object) (at C:\buildslave\unity\build\Runtime\Export\Logger\Logger.cs:126)
    UnityEngine.Debug:LogException(Exception)
    BoltLog:Exception(Exception)
    Bolt.Entity:Detach()
    BoltCore:DestroyForce(Entity)
    EntityChannel:DestroyIncommingProxy(EntityProxy, IProtocolToken)
    EntityChannel:ReadUpdate(Packet)
    EntityChannel:Read(Packet)
    BoltConnection:PacketReceived(UdpPacket)
    BoltCore:Udp_PacketReceived(UdpEvent)
    BoltCore:PollNetwork()
    BoltCore:Poll()
    BoltPoll:FixedUpdate()



    This happens when i put server fps to 1 or to something very low.

    i dont think this is my problem, i think there is somewhere in the bold just a missing null check.
  • Yukichu
    Options
    Err... why are you trying to simulate a working connection at 1 fps? I've found that when I run a server that is outputting a @&*#-ton of debugging, everything falls to pieces as the server is running too slowly... so... maybe it's not supposed to work at 1 fps.

    Then again, maybe there is a check missing. Just seems like there needs to be a better reproduction method for an actual issue than making the server run 1 fps.
  • Solidust
    Options
    I Solved this. Let me explain. I want to squeze all performance i can get and i tried to get the performance low as possible. Say server is empty and thus i can set the fps to 1.

    As to why this error was happening. If you are doing scope controlling or something else and delete script from the client and is not needed on the client, say for example a server script that is bound to some entity and you have lag or something it will crash the client and thus disconnect. To workaround this is just disable the script instead of destroying.

    Thanks yuki tho for trying to help!