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 - 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 / Re: TNet 3 Right for me? (Looking for answers)
« on: June 01, 2017, 09:19:11 PM »
I've personally used TNet for all my multiplayer projects and it's been the best multiplayer package to work with. I can answer some of your questions ...

  • Would TNet work fine for a fast paced shooter based game?
I don't see why not - I've used it for a top down shoot em up multiplayer game and it's been perfect.
  • My game has Online / Local Multiplayer, can TNet handle this without me having to write separate code for Online / Local Multiplayer?
Yep, like devomage said, as long as you code it right it should be seamless.
  • Does TNet have a Master Server? Or is it able to work with the Master Server Framework found on the asset store?
Yes the master server is built in.
  • Is TNet able to work on other platforms besides Windows such as Xbox One, PS4, Nintendo Switch?
Yes, though not out of the box. I can't get into specifics, but TNet supplies the source code. So with some minor adjustments porting to consoles isn't a huge undertaking.

Hope that helps!

3
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.

4
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!

5
TNet 3 Support / Re: Where I am taking TNet
« on: October 12, 2015, 02:36:51 AM »
I agree with devomage, I'm excited as well to see what your planning with TNet. I also agree that TNet is the best Unity networking package by a mile. It's so much more flexible and powerful than any other package I've tried. So as long as the networking aspect of the package continues to be supported, then I totally support the change.

6
TNet 3 Support / Re: Unable To Connect
« on: October 12, 2015, 02:29:59 AM »
Yeah I suspect that it's not a TNet issue directly and might be a socket bug for this particular platform. I'll continue digging and if I notice it's a TNet bug I'll update this thread. Thanks again!

7
TNet 3 Support / Re: Unable To Connect
« on: October 01, 2015, 10:04:52 PM »
Yes that's what I initially thought as well, but I have my game running on a variety of platforms without any problems at all. Every platform can connect to my standalone development server immediately. (I can connect via web browser and regular standalone builds without a problem).

And the reason I think something else might be up is that when you fail to connect to a server on Windows (or any platform for that matter) - you get the error message "Unable to connect". That's it. However on the platform in question, the error is "The object was used after being disposed". So I'm scratching my head  ??? , I'm not quite sure where to start looking.

8
TNet 3 Support / Re: Unable To Connect
« on: October 01, 2015, 01:48:45 PM »
Sorry I'll try to explain a bit more. So the game immediately connects to a UDP lobby server when it starts up(which works fine on this particular platform). When I select a server the following gets called ..

TNManager.Connect(someserveraddress);

Then after about 5 seconds or so the OnNetworkConnect event fires, the success boolean is false and the error message is what I mentioned above.

So pretty straight forward. I'll try commenting out the #define you mentioned later. Will that make a difference though if it's in TNGameServer.cs? (At the moment I'm simply joining a standalone server). I don't have access to my project right now so I'm just thinking out loud.

9
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?

10
TNet 3 Support / Re: TNet on Digital Ocean Server
« on: July 21, 2015, 12:06:24 PM »
It's just saying that UPnP is failing which makes sense in a data center situation (stricter firewalls). As long as you open the right ports you can ignore that error. I run a number of TNServer's in Azure and see the same error, but it works fine.

11
I am also running into a similar issue. Destroying a gameobject via "TNManager.Destroy()" results in the object being destroyed on the host, but none of the clients.

My code looks like this - a host or client calls this ..

tno.Send("BuildDock", TNet.Target.Host);

Then this is fired.

[TNet.RFC]
void BuildDock()
{
   TNManager.Create("WoodenDock", transform.position, transform.rotation, true);
   TNManager.Destroy(gameObject);
}

Pretty simple and straight forward. Yet the TNManager.Destroy(gameObject) call doesn't destroy the object over the network. I should note, the gameObject in question has a "TNObject" component.

EDIT : So it appears calling "tno.DestroySelf()" instead solves my issue. So what exactly is the purpose of TNManager.Destroy then?

12
TNet 3 Support / Re: Change dedicated server name (while ingame)
« on: May 07, 2015, 11:34:55 PM »
Okay good to know, thanks!

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