Tasharen Entertainment Forum

Support => TNet 3 Support => Topic started by: xandeck on May 03, 2016, 05:34:48 PM

Title: TNet 3 - RFC Message error
Post by: xandeck on May 03, 2016, 05:34:48 PM
Hello Aren,

I am having another error now.
I am trying to send a message like this:

- Client sends message to host (Target.Host). Arrives ok.
- Host handles it and send the message below, directly to playerId (client)
  1. tno.Send("_Receive_FromMS_LoginCheck", playerId, TNManager.player);
  2.  

- I am using same PC for testing 2 different builds... do you think this is a problem? I always tested like this with TNet2 anyway.
- When clients receive, I got 3 errors, in this order:
  1. Method not found: 'Default constructor not found...ctor() of System.Net.IPEndPoint'.
  2. UnityEngine.Debug:LogError(Object)
  3. TNet.Tools:LogError(String, String, Boolean) (at Assets/TNet/Common/TNTools.cs:1001)
  4. TNet.TypeExtensions:Create(Type) (at Assets/TNet/Common/TypeExtensions.cs:61)
  5. TNet.Serialization:ReadObject(BinaryReader, Object, Int32, Type, Boolean) (at Assets/TNet/Common/TNSerializer.cs:2683)
  6. TNet.Serialization:ReadObject(BinaryReader) (at Assets/TNet/Common/TNSerializer.cs:2360)
  7. TNet.Serialization:ReadObject(BinaryReader, Object, Int32, Type, Boolean) (at Assets/TNet/Common/TNSerializer.cs:2704)
  8. TNet.Serialization:ReadObject(BinaryReader) (at Assets/TNet/Common/TNSerializer.cs:2360)
  9. TNet.BinaryExtensions:ReadArray(BinaryReader) (at Assets/TNet/Client/BinaryExtensions.cs:60)
  10. TNet.TNManager:OnForwardedPacket(Int32, BinaryReader) (at Assets/TNet/Client/TNManager.cs:1756)
  11. TNet.GameClient:ProcessPacket(Buffer, IPEndPoint) (at Assets/TNet/Client/TNGameClient.cs:967)
  12. TNet.GameClient:ProcessPackets() (at Assets/TNet/Client/TNGameClient.cs:895)
  13. TNet.TNManager:<ProcessPackets>m__1F() (at Assets/TNet/Client/TNManager.cs:514)
  14. TNet.TNManager:Update() (at Assets/TNet/Client/TNManager.cs:1770)
  15.  
  16.  

  1. Unable to create an instance of System.Net.IPEndPoint
  2. UnityEngine.Debug:LogError(Object)
  3. TNet.Tools:LogError(String, String, Boolean) (at Assets/TNet/Common/TNTools.cs:1001)
  4. TNet.Serialization:ReadObject(BinaryReader, Object, Int32, Type, Boolean) (at Assets/TNet/Common/TNSerializer.cs:2684)
  5. TNet.Serialization:ReadObject(BinaryReader) (at Assets/TNet/Common/TNSerializer.cs:2360)
  6. TNet.Serialization:ReadObject(BinaryReader, Object, Int32, Type, Boolean) (at Assets/TNet/Common/TNSerializer.cs:2704)
  7. TNet.Serialization:ReadObject(BinaryReader) (at Assets/TNet/Common/TNSerializer.cs:2360)
  8. TNet.BinaryExtensions:ReadArray(BinaryReader) (at Assets/TNet/Client/BinaryExtensions.cs:60)
  9. TNet.TNManager:OnForwardedPacket(Int32, BinaryReader) (at Assets/TNet/Client/TNManager.cs:1756)
  10. TNet.GameClient:ProcessPacket(Buffer, IPEndPoint) (at Assets/TNet/Client/TNGameClient.cs:967)
  11. TNet.GameClient:ProcessPackets() (at Assets/TNet/Client/TNGameClient.cs:895)
  12. TNet.TNManager:<ProcessPackets>m__1F() (at Assets/TNet/Client/TNManager.cs:514)
  13. TNet.TNManager:Update() (at Assets/TNet/Client/TNManager.cs:1770)
  14.  
  15.  

  1. Null field specified when serializing TNet.TcpProtocol
  2. UnityEngine.Debug:LogError(Object)
  3. TNet.Tools:LogError(String, String, Boolean) (at Assets/TNet/Common/TNTools.cs:1001)
  4. TNet.Serialization:ReadObject(BinaryReader, Object, Int32, Type, Boolean) (at Assets/TNet/Common/TNSerializer.cs:2699)
  5. TNet.Serialization:ReadObject(BinaryReader) (at Assets/TNet/Common/TNSerializer.cs:2360)
  6. TNet.BinaryExtensions:ReadArray(BinaryReader) (at Assets/TNet/Client/BinaryExtensions.cs:60)
  7. TNet.TNManager:OnForwardedPacket(Int32, BinaryReader) (at Assets/TNet/Client/TNManager.cs:1756)
  8. TNet.GameClient:ProcessPacket(Buffer, IPEndPoint) (at Assets/TNet/Client/TNGameClient.cs:967)
  9. TNet.GameClient:ProcessPackets() (at Assets/TNet/Client/TNGameClient.cs:895)
  10. TNet.TNManager:<ProcessPackets>m__1F() (at Assets/TNet/Client/TNManager.cs:514)
  11. TNet.TNManager:Update() (at Assets/TNet/Client/TNManager.cs:1770)
  12.  
  13.  

I don't know what could be. If I send a normal
  1. tno.Send("_Receive_ChatMessage", Target.All, msg);
  2.  
It works... =/
By the way, if I send an integer as another parameter (in "_Receive_FromMS_LoginCheck"), it arrives totally different (I've sent 2 and it arrived 1701667182)

EDIT: Confirming error: the problem is if I send back the TNManager.player as a parameter... is this not possible?
Or it is because I am using 2 Apps in same PC?
Title: Re: TNet 3 - RFC Message error
Post by: ArenMook on May 04, 2016, 07:36:30 AM
I think you should be sending the TNManager.player.id, not TNManager.player.

The RFC signatures need to match what you're sending. Check your RFC's function definition.
Title: Re: TNet 3 - RFC Message error
Post by: xandeck on May 04, 2016, 08:34:28 AM
Yes, it should match, I really thought we could send the TNManager.player... looks like I can't, thanks.