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

Pages: [1]
1
TNet 3 Support / object[] support missing in TNet 3.1.0
« on: November 22, 2017, 11:14:41 PM »
Our project uses a lot of object[] arrays to hold a variety of different data. We just finished our upgrade from 3.0.9 to 3.1.0 and along the way we ran into a slight problem. The new "UnityTools.GetType" method doesn't detect object arrays like the old "UnityTools.FindType" method did in the previous version.

In our case we simply added :

  1. else if (name == "System.Object[]") type = typeof(object[]);

On line 256 in TNSerializer.cs

Aren, just wanted to give you a heads up for a future fix and in case anyone else runs into this problem.

Cheers!

2
TNet 3 Support / [SOLVED] Strange tno.Send behaviour
« on: May 08, 2016, 08:23:42 PM »
I'm running into a bit of an issue with a new project using TNet 3. Here's my code, and I'll explain what I'm trying to do ..

  1. using UnityEngine;
  2. using System.Collections;
  3. using TNet;
  4.  
  5. public class TNetInGameManager : TNBehaviour {
  6.  
  7.         public static TNetInGameManager Instance;
  8.  
  9.         int masterIndex = 0;
  10.  
  11.         void Start()
  12.         {
  13.                 Instance = this;
  14.         }
  15.  
  16.         public void AskForIndex()
  17.         {
  18.                 Debug.Log("Asking for index from host : " + TNManager.GetHost(TNManager.lastChannelID).id);
  19.                 Debug.Log("My Player ID: " + TNManager.playerID);
  20.                 tno.Send("AskForPlayerIndex", TNManager.GetHost(TNManager.lastChannelID).id, TNManager.playerID);
  21.  
  22.                 // This causes even weirder behaviour.
  23.                 //tno.Send("AskForPlayerIndex", Target.Host, TNManager.playerID);
  24.         }
  25.  
  26.         [RFC]
  27.         void AskForPlayerIndex(int id)
  28.         {
  29.                 Debug.Log("My Player ID: " + TNManager.playerID);
  30.                 Debug.Log("Received index request from client " + id);
  31.  
  32.                 tno.Send("SendPlayerIndex", id, masterIndex);
  33.  
  34.                 masterIndex++;
  35.         }
  36.  
  37.         [RFC]
  38.         void SendPlayerIndex(int ind)
  39.         {
  40.                 Debug.Log("Received Index from Master!");
  41.                 GameManager.instance.i = ind;
  42.         }
  43.        
  44. }
  45.  

So when a client enters the channel, the player needs a 'slot' for the game (from 0 to 3). So when I join the channel, I call AskForIndex. This then should then send a simple request to the host of the channel to the method "AskForPlayerIndex". From there the host should then send a simple integer back to the requesting client via "SendPlayerIndex".

So it should send a request from Client -> Host -> Client. But what's actually happening is Client -> Client -> Client.

My Debug line logs out the correct Host ID ( TNManager.GetHost(TNManager.lastChannelID).id ), but for whatever reason on line 20, it's sending it to the local player instead. Any thoughts?

EDIT : Ugh time for me to take a break. Turns out all my weird TNet issues were being caused by an outdated dedicated TNet server. As soon as I used the TNServer.exe file in the TNet package, everything works as intended.

3
TNet 3 Support / TNet Server (3.0.0) Compiler Errors
« on: February 25, 2016, 11:48:59 PM »
Hi there! I just upgraded to TNet 3 last night. I finished upgrading the Unity portion last night and now I'm about to start with the dedicated server. It doesn't compile even after moving the TNet assets over (Common, LZMA and Server).

The solution is looking for "TNProperty.cs" under the Common folder, which doesn't appear to exist anywhere. I removed this and replaced it with "TNFieldOrProperty.cs" and that seems to initially work.

Also, in the TNFieldOrProperty.cs" class, line 348 throws an error that GetProperty doesn't exist. Changing this to GetFieldOrProperty seems to work initially as well.

Aren, just wanted to give you a heads up and ask if this is a correct fix? Thanks!

4
TNet 3 Support / Unable To Connect
« on: October 01, 2015, 01:29:56 PM »
I'm running into a bit of a strange issue with TNet. When I try to join a game server I get an error that states "Unable to connect : The object was used after being disposed".

This is happening on a console platform, so I can't divulge too much information. TNet works flawlessly on PC and the other consoles I'm targeting. Does anyone have any tips or ideas as to why this is happening?

5
TNet 3 Support / Change dedicated server name (while ingame)
« on: May 07, 2015, 08:47:51 PM »
Hi everyone!

I recently switched my games networking backend over from Photon to TNet and so far everything is working perfectly!

I am wondering if it's possible for the host of a session to change the server name? I know if your hosting a local instance, you can do this by going "TNServerInstance.serverName = "blablabla", but is there a nice way to change a dedicated servers name while your in-game? I know you can set the server name when you launch the dedicated server, but that's not what I need in this case.

If not that's totally fine as I will tweak the source code so this is possible, but I wanted to ask here first in case I'm missing anything.

Thanks in advance for your help!

Pages: [1]