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.

Topics - xandeck

Pages: [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

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];

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

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

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);

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);
- 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?

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 =)

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);
  4. string name = TNManager.GetChannelData<string>("_name");
  5. int number = TNManager.GetChannelData<int>("_maxPlayers");

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);
  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. }

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.

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);

- 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)

  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)

  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)

I don't know what could be. If I send a normal
  1. 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?

TNet 3 Support / TNet 3 - Send RFC messages
« on: April 30, 2016, 07:41:41 PM »

I upgraded to TNet3 and now working on a new prototype.
Looks better and more stable in comparison to version 2.

I could manage to: host a main server (TNServerInstance), make a lobby myself and many other things.
Here is how it works:
- Dedicated server is created. Working good (different EXE file). I have a user, who is ADMIN, who runs inside dedicated server.
- Clients can connect to it. After connecting, I made a custom login process and saving player data. All good.
- The server them returns good or bad player login
- If it is good, join lobby ID 1 (my lobby), bad, just disconnect
- Create a new room (channel), ok

Here is where the problem starts.
- I do this with a new client (new player) or any other new players
- Player connects to the room
- Everyone receives the ChannelData update good (if there are more players)
- But when I try to send a simple chat message, noone receives (using Target.All or Target.Others)
- Even myself (the one who sent the message), do not receive the message (a simple string message)
- If I send a global message from server to all (I mean the server user, the Admin), it works (Target.Broadcast)
- Also, my channels ID usually has big numbers (2435643)... is this normal?

Facts: the players are in the same channelId. Even my own player does not receive the message using Target.All
I had this exact same problem in TNet 2, discovered (at least I suppose) that when I am creating a new channel with "TNManager.CreateChannel", I cannot pass first parameter (levelName) to null, or messages stops going from each other.... I need to pass always a new level scene (this in TNet2). I am suspecting that this same problem is happening, but this time I cannot change the level to solve it cause of my game design.
Is there anything specific I need to know to check what am I doing wrong? Or I really cannot pass as null the levelname?
Thank you.

- Tried with the TNet bat server that comes with the pack, no success
- Tried disabling firewall, anti-virus, everything, no success
I cannot just find out why a simple RFC message does not work if I use Target.All or Target.Others (using Saved or not)
I have no clue what is going on, the Example menu works (even the chat scene), but if I even copy and paste the code of example menu and chat into my own scene (empty one), it just does not work... help?

TNet 3 Support / TNManager.CreateEx doubts
« on: November 24, 2015, 10:36:25 PM »

Please, can anyone answer me a few questions =)
- Is there a way to know when CreateEx ends creating and loading everything?
- Right now, I create some characters on scene using "CreateEx", but sometimes it takes longer than I expected and then screws up

Thank you in advance.

TNet 3 Support / Channel and host data
« on: November 06, 2015, 11:54:34 AM »
Hello everyone,

I have a doubt regarding channel and server creation.
Right now, what I am doing:
- I have a main server hosted in Amazon
- All players will connect there to handle channel creation, hosting and playing (I think it is the same way as the Aren game works)
- How can I setup the name of the channel (in channel parameters, there is only level name, no channel name... is custom data the only way?)
- How can I ping each channel when getting channel list? Right now I can only ping the server I am in... is this the only way? With this, I suppose, all players will have the same ping because they are all in the same main server?

I think I misunderstood the way channels in TNet works.
I still have my old way, which is all players creates their own server instance, so I save their server data in a private database (mySQL) and get info from there to generate my own channel list. I thought having some kind of master server and using hosting channels to provide players host and client will be easier to keep everyone playing without port forwarding.

If anyone can help me, I appreciate it.
Thanks in advance.

TNet 3 Support / Hosting bandwidth and server
« on: October 25, 2015, 07:35:45 AM »
Hello Aren,

Please, since someone can create a Server Instance and someone can be a host (been the same host and owner, or not), does the host always controls about sending the data between host and clients? I mean, let's say I have the following picture:
- I have a server instance, hosted on Amazon or any other full time 24 hours PC
- I have players A, B, C
- Player A connects and creates a channel (a room, for him to player with friends)
- Player B and C connects to this channel
- Is it the player A who keeps consuming his own bandwidth or is it the server instance?

This can change how I am implementing the game.
Thanks in advance.

TNet 3 Support / Hosting your own server and be a client same time
« on: September 29, 2015, 08:43:40 PM »
Hello again Aren,

I almost finshed the logic for connection and player database in my game.
But there is something I cannot think right now:
- After creating my server (TNServerInstance.Start(port, udpPort);) anyone can just join it
- Is there any way to put a password even on the server instance? I want players to host their own server in their own PC and invite other players (right now through IP direct connection, later on I will make a good lobby or something like that in SQL maybe)
- If I keep this way, the only way to make a "room" with password is creating a channel with such (which works fine), but I don't want this, I want a password right after connection and not while entering a channel
- An example for this is to avoid new players to enter if there is already a game going on (a shooter mission, in example)

What is the best way to do this, in your opinion?
What I have now is this:
- player A creates a server with TNServerInstance.Start(port, udpPort);
- I join a simple channel, called "MainMenu", where I apply some game logic and then I load to another scene (using LoadScene from TNet, all working good)
- In the new scene, is some kind of building base, I start another channel (with password, so new players will not get here without it... it works)
- But in this logic, all new players connected needs to pass through the first channel
- I know I could leave the channel open with the password, even if noone is there, but it must has a better way, dont you think?

Let me know if possible.
Thank you.

EDIT: also, there is a problem if I use password in these rooms (empty or not), the auto load scene from the joinchannel call is called even if I use the "null" as parameter. Do you know if this is on purpose?
EDIT 2: I made more tests, I am not sure if it is because I am leaving the "persistent" parameter as true is causing the issue, but looks like it is. It is trying to load a scene, even if I set as "null", so it is causing logic problems in my game.

TNet 3 Support / Steam API / Steamworks
« on: September 15, 2015, 02:52:11 PM »
Hello everyone,

Please, anybody has a way of integrating Steam API with TNet?
Aren, do you have? We also are interested buying a solution. Just example scripts to get a game list and/or friends connect, will be enough.
Thank you in advance.

TNet 3 Support / iOS / Android Tablets as Server
« on: February 19, 2014, 05:12:49 PM »

Sorry to be direct, but I need a quick answer :(
And I did not find anything in this forum...

Is it possible to start a server from a tablet with Android? I mean, make my Android tablet as server?
Thanks in advance.

Pages: [1]