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

Pages: [1]
1
TNet 3 Support / Network ID Assignment Problem
« on: October 03, 2017, 04:40:29 PM »
Hello everyone,

I am having a strange issue with Network ID assignment on prefabs that are instantiated multiple times.

I have an object in my scene with a TN Object component attached that has the ID 42 (I have changed it to see if that would fix the problem and it didn't).
When I instantiate the prefab while the same prefab exists in that scene, I get this in my console [Gyazo Link & attached]: https://gyazo.com/b5a626dcaf1970e974068ad0438dcb3c 

Not sure what I am doing wrong. It doesn't seem to be affecting anything yet, however I fear that it will cause problems in the future. Not really sure if that is the case as I am still quite new to TNet.

Thanks,
Gabe

2
TNet 3 Support / WAN/LAN Lobby Server Connection Question
« on: September 08, 2017, 07:24:08 PM »
Hello,
Sorry for posting another thread so soon after my last, I really am a newbie with TNet.

I am having this strange problem with connecting to my server lobby. I can connect perfectly fine when I use the local IP to connect to it, however if I use the public IP to connect to it (and from the same machine) it says "Unable to Connect" in the console for me.

I forwarded TCP Ports as the Server Lobby is TCP, and I have tried both UDP and TCP/UDP as well to see if that would make a difference.

This is the command that I have to run the lobby server:
  1. @echo off
  2. start "TNet 3 Lobby Server Test" "TNServer.exe" -name "TNet_TestLobbySrv" -tcpLobby 5129

This is what I have in my script where I try to connect to the lobby server after hosting a new server:
  1.         TNServerInstance.serverName = serverName;
  2.         TNServerInstance.Start(5127, 5128, null, TNServerInstance.Type.Tcp, Tools.ResolveEndPoint("192.168.1.2", 5129));

I am also trying to connect to it through the TN Tcp Lobby Client script (gyazo link): https://gyazo.com/7058620018844d4aa0f8cf3498e414dc?token=63bcb47e34a3ab81912d1034b779a8e4

Thanks,
Gabe

3
TNet 3 Support / 'isMine' always false when connected to server
« on: September 07, 2017, 07:01:38 PM »
Hello,

I have been trying to solve this issue now for a couple of hours, and I can't seem to find out what is causing it. My code looks exactly like it does in the "Example Creation" scene, and my TNObjects isMine is always false when I am connected to a server. However, if I am NOT connected to a server, they seem to be working.

Here is what the TNObject looks like in the inspector when I am connected to a server (gyazo link): https://gyazo.com/d74f3d8b16cdc31f4b1f97fcdddf70f8

Here is my code:

*Network Manager*
  1.     private void OnConnect(bool success, string message)
  2.     {
  3.         //Debug.Log("OnJoinedRoom: " + PhotonNetwork.room.Name + " | Players: " + PhotonNetwork.room.PlayerCount + "/" + PhotonNetwork.room.MaxPlayers);
  4.         Debug.Log("OnConnect Message: " + message);
  5.  
  6.         if(success == true)
  7.         {
  8.  
  9.             // Set "inRoom" to true
  10.             inRoom = true;
  11.  
  12.             // Instantiate LobbyController when joined room
  13.             //PhotonNetwork.Instantiate("LobbyController", Vector3.zero, Quaternion.identity, 0);
  14.             TNManager.Instantiate(0, "RCCLobbyController", "LobbyController", false, Vector3.zero, Quaternion.identity);
  15.         }
  16.  
  17.     [RCC]
  18.     static GameObject RCCLobbyController(GameObject prefab, Vector3 pos, Quaternion rot)
  19.     {
  20.         GameObject go = prefab.Instantiate();
  21.  
  22.         // Set the position and rotation based on the passed values
  23.         Transform t = go.transform;
  24.         t.position = pos;
  25.         t.rotation = rot;
  26.  
  27.         return go;
  28.     }
  29.  
  30.  

Here is the script for the lobby controller that is attached to the instantiated object:

  1.     private void Start()
  2.     {
  3.         if(tnObject.isMine == true)
  4.         {
  5.             Debug.Log("isMine");
  6.  
  7.             tnObject.Send("RPCMakePlayerCard", Target.AllSaved, playerName);
  8.  
  9.             networkLobby.readyToggle.onValueChanged.AddListener(SetReady); // Add Toggle onValueChanged() Listener for Ready
  10.             networkLobby.launchButton.onClick.AddListener(PhotonLoadLevel); // Add Button onClick() Listener for launching game
  11.         }
  12.         else
  13.         {
  14.             Debug.Log("Not mine");
  15.         }
  16.     }

As you can see, the "isMine" check is happening in the Start method of the Instantiated Object, so to my understanding, the TNObject has already been initialized and everything should be working. I feel like I am missing something so obvious.

Thanks,
Gabe

4
TNet 3 Support / Server Browser Question (For user self-hosted servers)
« on: August 17, 2017, 05:33:01 PM »
Hello everyone,

My name is Gabe and I recently purchased TNet 3. I am getting ready to switch over my game's network system to TNet, and I have a question in regards to server discovery for user self-hosted servers.

I am interested in having the players host their own servers rather than me host my own. I wanted to know if it is possible to somehow discover the servers that are running for the game without having everyone connect to some sort of "master server" like you would if you hosted your own server and had people create their own rooms/channels instead of hosting their own.
I hope that makes sense.

Is this possible, or would everyone have to connect to the servers remotely?

Thank you,
Gabe

Pages: [1]