Author Topic: TNet 3 - RFC Message error  (Read 2124 times)

xandeck

  • Jr. Member
  • **
  • Thank You
  • -Given: 1
  • -Receive: 3
  • Posts: 54
    • View Profile
TNet 3 - RFC Message error
« 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?
« Last Edit: May 03, 2016, 05:55:13 PM by xandeck »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: TNet 3 - RFC Message error
« Reply #1 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.

xandeck

  • Jr. Member
  • **
  • Thank You
  • -Given: 1
  • -Receive: 3
  • Posts: 54
    • View Profile
Re: TNet 3 - RFC Message error
« Reply #2 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.