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)
tno.Send("_Receive_FromMS_LoginCheck", playerId, TNManager.player);
- 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:
Method not found: 'Default constructor not found...ctor() of System.Net.IPEndPoint'.
UnityEngine.Debug:LogError(Object)
TNet.Tools:LogError(String, String, Boolean) (at Assets/TNet/Common/TNTools.cs:1001)
TNet.TypeExtensions:Create(Type) (at Assets/TNet/Common/TypeExtensions.cs:61)
TNet.Serialization:ReadObject(BinaryReader, Object, Int32, Type, Boolean) (at Assets/TNet/Common/TNSerializer.cs:2683)
TNet.Serialization:ReadObject(BinaryReader) (at Assets/TNet/Common/TNSerializer.cs:2360)
TNet.Serialization:ReadObject(BinaryReader, Object, Int32, Type, Boolean) (at Assets/TNet/Common/TNSerializer.cs:2704)
TNet.Serialization:ReadObject(BinaryReader) (at Assets/TNet/Common/TNSerializer.cs:2360)
TNet.BinaryExtensions:ReadArray(BinaryReader) (at Assets/TNet/Client/BinaryExtensions.cs:60)
TNet.TNManager:OnForwardedPacket(Int32, BinaryReader) (at Assets/TNet/Client/TNManager.cs:1756)
TNet.GameClient:ProcessPacket(Buffer, IPEndPoint) (at Assets/TNet/Client/TNGameClient.cs:967)
TNet.GameClient:ProcessPackets() (at Assets/TNet/Client/TNGameClient.cs:895)
TNet.TNManager:<ProcessPackets>m__1F() (at Assets/TNet/Client/TNManager.cs:514)
TNet.TNManager:Update() (at Assets/TNet/Client/TNManager.cs:1770)
Unable to create an instance of System.Net.IPEndPoint
UnityEngine.Debug:LogError(Object)
TNet.Tools:LogError(String, String, Boolean) (at Assets/TNet/Common/TNTools.cs:1001)
TNet.Serialization:ReadObject(BinaryReader, Object, Int32, Type, Boolean) (at Assets/TNet/Common/TNSerializer.cs:2684)
TNet.Serialization:ReadObject(BinaryReader) (at Assets/TNet/Common/TNSerializer.cs:2360)
TNet.Serialization:ReadObject(BinaryReader, Object, Int32, Type, Boolean) (at Assets/TNet/Common/TNSerializer.cs:2704)
TNet.Serialization:ReadObject(BinaryReader) (at Assets/TNet/Common/TNSerializer.cs:2360)
TNet.BinaryExtensions:ReadArray(BinaryReader) (at Assets/TNet/Client/BinaryExtensions.cs:60)
TNet.TNManager:OnForwardedPacket(Int32, BinaryReader) (at Assets/TNet/Client/TNManager.cs:1756)
TNet.GameClient:ProcessPacket(Buffer, IPEndPoint) (at Assets/TNet/Client/TNGameClient.cs:967)
TNet.GameClient:ProcessPackets() (at Assets/TNet/Client/TNGameClient.cs:895)
TNet.TNManager:<ProcessPackets>m__1F() (at Assets/TNet/Client/TNManager.cs:514)
TNet.TNManager:Update() (at Assets/TNet/Client/TNManager.cs:1770)
Null field specified when serializing TNet.TcpProtocol
UnityEngine.Debug:LogError(Object)
TNet.Tools:LogError(String, String, Boolean) (at Assets/TNet/Common/TNTools.cs:1001)
TNet.Serialization:ReadObject(BinaryReader, Object, Int32, Type, Boolean) (at Assets/TNet/Common/TNSerializer.cs:2699)
TNet.Serialization:ReadObject(BinaryReader) (at Assets/TNet/Common/TNSerializer.cs:2360)
TNet.BinaryExtensions:ReadArray(BinaryReader) (at Assets/TNet/Client/BinaryExtensions.cs:60)
TNet.TNManager:OnForwardedPacket(Int32, BinaryReader) (at Assets/TNet/Client/TNManager.cs:1756)
TNet.GameClient:ProcessPacket(Buffer, IPEndPoint) (at Assets/TNet/Client/TNGameClient.cs:967)
TNet.GameClient:ProcessPackets() (at Assets/TNet/Client/TNGameClient.cs:895)
TNet.TNManager:<ProcessPackets>m__1F() (at Assets/TNet/Client/TNManager.cs:514)
TNet.TNManager:Update() (at Assets/TNet/Client/TNManager.cs:1770)
I don't know what could be. If I send a normal
tno.Send("_Receive_ChatMessage", Target.All, msg);
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?