Home Forums Support custom object and 0 value issue

  • This topic has 8 replies, 2 voices, and was last updated 11 years ago by Anonymous.
Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #1198
    Anonymous
    Inactive

    Using a custom object, when returning both values 0 the message is not received, and an error file is created, specified below

    SendReceiveOptions nullCompressionSRO = new SendReceiveOptions(DPSManager.GetDataSerializer<ProtobufSerializer>(),null,null);
    NetworkComms.DefaultSendReceiveOptions = nullCompressionSRO;

    NetworkComms.AppendGlobalIncomingPacketHandler<PingRequestDC>( “pingRequest” ), PingRequestReturn );

    using ProtoBuf;
    [ProtoContract]
    public class PingRequestDC
    {
    [ProtoMember(1)]
    public short ClientID { get; set; }
    [ProtoMember(2)]
    public byte PingID { get; set; }
    }

    private void PingRequestReturn( PacketHeader header, Connection connection, PingRequestDC data )
    {
    lock( objectThreadLock )
    {
    short idx = data.ClientID;
    byte pingidx = data.PingID;
    }
    }

    Base Exception Type: System.NullReferenceException: Object reference not set to an instance of an object
    at Server.PingRequestReturn (NetworkCommsDotNet.PacketHeader header, NetworkCommsDotNet.Connection connection, .PingRequestDC data) [0x0000d] in D:\!unityProjects\FPS_SRV\Assets\Scripts\Server.cs:388
    at NetworkCommsDotNet.PacketTypeHandlerDelegateWrapper`1[PingRequestDC].Process (NetworkCommsDotNet.PacketHeader packetHeader, NetworkCommsDotNet.Connection connection, System.Object obj) [0x00000] in <filename unknown>:0
    at NetworkCommsDotNet.NetworkComms.TriggerGlobalPacketHandlers (NetworkCommsDotNet.PacketHeader packetHeader, NetworkCommsDotNet.Connection connection, System.IO.MemoryStream incomingDataStream, NetworkCommsDotNet.SendReceiveOptions options, Boolean ignoreUnknownPacketTypeOverride) [0x00000] in <filename unknown>:0

    Stack Trace: at Server.PingRequestReturn (NetworkCommsDotNet.PacketHeader header, NetworkCommsDotNet.Connection connection, .PingRequestDC data) [0x0000d] in D:\!unityProjects\FPS_SRV\Assets\Scripts\Server.cs:388
    at NetworkCommsDotNet.PacketTypeHandlerDelegateWrapper`1[PingRequestDC].Process (NetworkCommsDotNet.PacketHeader packetHeader, NetworkCommsDotNet.Connection connection, System.Object obj) [0x00000] in <filename unknown>:0
    at NetworkCommsDotNet.NetworkComms.TriggerGlobalPacketHandlers (NetworkCommsDotNet.PacketHeader packetHeader, NetworkCommsDotNet.Connection connection, System.IO.MemoryStream incomingDataStream, NetworkCommsDotNet.SendReceiveOptions options, Boolean ignoreUnknownPacketTypeOverride) [0x00000] in <filename unknown>:0

    #1199
    Anonymous
    Inactive

    Ah, the problem only occurs when you remove the compression stages. You have two options moving forward:

    1. Leave compression enabled by default.
    2. Download the most recent source commit from our repository (see download page) where I have fixed the bug.

    If you go with option 2 please let us know if the problem is fixed for you.

    Kind regards,
    Marc

    #1201
    Anonymous
    Inactive

    This is indeed the troublemaker… turning it back to default enabled solves the issue however compression enabled is way to heavy CPU-wise and therefore creates a to big latency…

    I was already using your 2.3.0

    #1207
    Anonymous
    Inactive

    Heya Rob,

    You misunderstood my last post. You need to download the tip from our source repository. If you do not have mercurial installed you can use the following link instead, here. This version contains the fix for this bug.

    Regards,
    Marc

    #1208
    Anonymous
    Inactive

    ive tried to build it, but all i get is unknown path or file not found.. its probably me… so… ill just wait for your next update…

    #1209
    Anonymous
    Inactive

    which DLL are you using and I will create a build for you.

    #1210
    Anonymous
    Inactive

    i am currently using 2.3.0 Net3.5

    #1211
    Anonymous
    Inactive

    The following link is for the current 2.3.1 beta, here. Although it fixes the above discussed bug there is a small chance that other issues are present. Once you have tried it please let me know if it is ok.

    Kind regards,
    Marc

    #1212
    Anonymous
    Inactive

    initial test worked!! 😀

    much appreciated!

    ( I wonder what I did wrong fail building the source myself )

Viewing 9 posts - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.