Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - xandeck

Pages: [1] 2 3 4
1
TNet 3 Support / TNet 3 - Host change bug?
« on: May 18, 2016, 10:22:04 PM »
Hello Aren,

After instantiating an object via "TNManager.Instantiate", and set persistent to true, as soon as my host leaves the room, the "tno.isMine" is not changing to another player.
This is supposed to happen, right? I mean, change who owns the object...
Or am I doing anything wrong? Also, what is the real difference between isMine and ownerId?

Thank you

2
TNet 3 Support / TNet 3 - Suggestion or Explanation
« on: May 18, 2016, 09:30:55 AM »
Hello Aren,

From time to time I have some problems in my code (which is really normal for programmers).
But using TNet, strangely, the Unity debug returns me errors as it were in your TNet (but it is not).
In example: I have an array like

  1. int[] myArray = new int[3];
  2.  

If I send a tno.Send to someone that still has not this array initiated, instead of Unity showing a problem in my code, it shows as TNet error, like the one below:

  1. [TNet] Failed to call TNO #16777190 function _SoldierPlayerController._NetReceive_ConfigCharacter
  2.  

But it is actually not a problem related to TNet itself. It was something that I forgot to initiate in one of my arrays (a line that came right next to receive the RFC command, in same function).
Is there any way that we can improve this or anything I can do on my side?
Thank you

3
Thanks, I will change that.

4
Hello Aren,

I was testing the new server now and it looks like everytime someone join the channel, it replaces the last max player limit in the room.
This code:
  1. TNManager.JoinChannel(channelId, null, false, 0, "123", false);
  2.  

Replaces the original max player that a host created first.
What I should place in there to leave "max players" as before?

- I am creating a room normally
  1. TNManager.CreateChannel(null, false, 10, "123", false);
  2.  
- A player join the room using that Join code above
- No matter if I put, as parameter, max player to 0, 10, 99... it replaces what the host created

What should I use there?
Thanks

EDIT: I made it work because I know how many players the host had before, and before connecting, the new player uses the same max player limit to Join (which is actually not a solution I believe). So, if there is any other way, please let me know =)

5
TNet 3 Support / Re: [SOLVED] Strange tno.Send behaviour
« on: May 09, 2016, 03:42:39 PM »
I was having a similar problem.
Check if your gameObject with "tno" is dynamically instantiated. If not, it will be better if you do (Aren can correct me).
I was trying to send a simple message and nothing was happening. Since now TNet 3 supports multiple channels, I had some confusion too.

EDIT: Ugh, just saw that is already solved =P

6
TNet 3 Support / Re: TNet 3 - Send DataNode to ChannelData
« on: May 05, 2016, 09:21:55 PM »
I got used to it, lol, now I kinda like it (it is good with Monodevelop)

About the channel, it works, thanks.

7
TNet 3 Support / Re: TNet 3 - Send DataNode to ChannelData
« on: May 05, 2016, 09:07:56 PM »
That was really nice, thanks. My RoomData is already serializable =)
I did not know TNet could just send classes serialized (it will really make my life easier).
Thank you for this.

About the underscores, I got used to it when working in another company when I was just a programmer (it was easier to see what were my own vars, functions, etc, if I just typed "_" before anything).. lol ...

8
TNet 3 Support / Re: TNet 3 - Send DataNode to ChannelData
« on: May 05, 2016, 08:45:47 PM »
It did not work, I must be doing something wrong.

This is what I am doing to send:
  1. // ################################################################################################
  2.         /// <summary>
  3.         /// Sends channel update
  4.         /// </summary>
  5.         void _Room_UpdateChannel_SendToAll ()
  6.         {
  7.                 DataNode node = new DataNode();
  8.                 node.SetChild("_name", _roomChoosenData._name);
  9.                 node.SetChild("_mapChoosen", _roomChoosenData._mapChoosen);
  10.                 TNManager.SetChannelData("_node", node);
  11.         }
  12.  

And to receive:

  1. // ################################################################################################
  2.         /// <summary>
  3.         /// Called when channel data change
  4.         /// </summary>
  5.         void _CallOnChannelDataChange(Channel ch, string path, DataNode dataNode)
  6.         {
  7.                 _roomChoosenData = new _RoomData();
  8.                 _roomChoosenData._channelId = ch.id;
  9.  
  10.                 DataNode tempNode = TNManager.GetChannel(TNManager.lastChannelID).dataNode;
  11.                 _roomChoosenData._name = tempNode.GetChild<string>("_name", _roomChoosenData._name);
  12.                 _roomChoosenData._mapChoosen = tempNode.GetChild<string>("_mapChoosen", _roomChoosenData._mapChoosen);
  13.         }
  14.  

It just comes as blank, nothing inside those vars (and I know it is not blank).
By the way, its there a better way to get from Channel when its data changes? I tried with the parameter dataNode, no luck.
Thanks

9
TNet 3 Support / Re: TNet 3 - Send message to one single channel
« on: May 05, 2016, 08:41:16 PM »
Nice, thank you for letting me know.
In any case, I already changed the way I did.

10
TNet 3 Support / Re: TNet 3 - Send message to one single channel
« on: May 05, 2016, 07:15:13 PM »
I did, I checked if there was a channel, but it was not specified (using version 3.0.1).
Or does the "byte rfcID" is the parameter? Target I think it is either the Target.something or the player...?

11
TNet 3 Support / TNet 3 - Send DataNode to ChannelData
« on: May 05, 2016, 08:56:52 AM »
Hello Aren,

I am trying to get a DataNote through SetChannelData... is it not possible?

This works good:
  1. TNManager.SetChannelData("_name", "my name");
  2. TNManager.SetChannelData("_maxPlayers", 3);
  3.  
  4. string name = TNManager.GetChannelData<string>("_name");
  5. int number = TNManager.GetChannelData<int>("_maxPlayers");
  6.  

But this dont work:

  1. DataNode node = new DataNode();
  2. node.SetChild("_name", "my name");
  3. node.SetChild("_maxPlayers", 3);
  4. TNManager.SetChannelData("_node", node);
  5.  
  6. void GetDataTest()
  7. {
  8.         DataNode node = TNManager.GetChannelData<DataNode>("_node");
  9.         string name = "";
  10.         int number = -1;
  11.         name = tempNode.GetChild<string>("_name", name);
  12.         number = tempNode.GetChild<int>("_maxPlayers", number);
  13. }
  14.  

12
TNet 3 Support / Re: TNet 3 - Send message to one single channel
« on: May 04, 2016, 10:20:24 PM »
I was doing something wrong, nevermind.
But it could be good to know if this is true or not =)

13
TNet 3 Support / TNet 3 - Send message to one single channel
« on: May 04, 2016, 07:27:23 PM »
Hello Aren,

Is there any way to send a message to a single channel/room?
Currently, I have a TNManager player who is inside at 3 channels at the same time. How can I send a message with "tno.Send" just to a specific channel?
If I send
  1. tno.Send("SomeMessage", Target.All, "my message");

Everyone that is in at least one of the channels/rooms will receive the message.
Thanks

14
TNet 3 Support / Re: TNet 3 - RFC Message error
« 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.

15
TNet 3 Support / 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?

Pages: [1] 2 3 4