Author Topic: TNet: Tasharen Networking Framework  (Read 323888 times)

Yarashiel

  • Guest
Re: TNet: Tasharen Networking Framework
« Reply #105 on: January 16, 2013, 10:51:33 AM »
Aren : Yes, I specify the IP Address in which the TNetServer.exe is running.

I've tried with the Example Unity Client you provide too, works half on a computer (connect and disconnect immediately), and I tried the apk Example you provide on my android ... doesn't work.

one thing : I don't understand the network broadcasting feature actually, how can the client find a server running on a computer if it's not specified before building it ?

I don't wanna bother you with annoying questions ... Sorry ...
« Last Edit: January 16, 2013, 10:56:40 AM by Yarashiel »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: TNet: Tasharen Networking Framework
« Reply #106 on: January 16, 2013, 11:11:31 AM »
Examples on the website are not compatible with TNetServer.exe that's in the package. The examples are older version, and use an older protocol. You need to build your own examples.

Broadcast feature works by notifying everyone on the same network, so no IP is necessary.

Yarashiel

  • Guest
Re: TNet: Tasharen Networking Framework
« Reply #107 on: January 16, 2013, 11:24:04 AM »
As I've said earlier, I've also built a simple scene connecting to the TNetServer.exe. It works when I play the scene on the same computer as this .exe is running, it is responding.
However, when I play the scene from an Android, it doesn't work...

Let me specify what i'm doing :
TNetServer.exe is running on my computer.

My scene has gameobject with a TNManager script, land my LogMenu script :
"using UnityEngine;
using System.Collections;

public class LogMenu : MonoBehaviour {

public string mTestAddress = "IP Address of computer";
   
   void OnGUI(){
               if(GUI.Button(new Rect(40, 120, 120, 40), "Join")){
         TNManager.Connect(mTestAddress);
               }"
Of course, IP Address of computer IS the IP Address of the computer running the TNetServer.exe (just don't communicate it here ^^' )
And that's it! I build this on my Android device, and when I click the Join button, nothing happens (whereas the TNetServer.exe is responding when I play the scene in the Unity Editor).

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: TNet: Tasharen Networking Framework
« Reply #108 on: January 16, 2013, 06:54:58 PM »
Make sure the android device is connected wirelessly to the same network -- that's pretty much all I can suggest. There is no difference between android and other platforms, they all operate the same. To get the examples in the video to work, all I did was just build the default example that comes with TNet with Unity, and it worked as-is. If the TNet's examples work for you, but your own app does not, I'd suggest looking at what's different -- such as trying to print the android device's IP address.

Yarashiel

  • Guest
Re: TNet: Tasharen Networking Framework
« Reply #109 on: January 18, 2013, 04:21:33 AM »
Hi Aren.

Sorry, maybe I wasn't clear enough in my earlier posts.
The fact is that I don't want it to be on the same network. I would like to make it work globally and not locally.

I thought this was possible by reading this thread, and Devfo also said that it worked because it's what he's doing.

So I apologize if I wasn't clear enough at first. Could you give me some further explanations about setting up a global network with TNet ?

Thank you very much, and cheers !

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: TNet: Tasharen Networking Framework
« Reply #110 on: January 18, 2013, 04:26:44 AM »
If the android device is able to browse the internet, then it will be able to connect to a remote TNet server.

You said yourself your server .exe is running on a local computer. That's not global. That's local. By default Windows will actively block all attempts to connect to your computer, unless you allow it to get through your firewall (or unless you are attempting to do it from the same exact computer -- which is why the Editor works). Try connecting to your server from a remote computer -- one that's not running the TNetServer.exe.

Yarashiel

  • Guest
Re: TNet: Tasharen Networking Framework
« Reply #111 on: January 18, 2013, 04:41:53 AM »
Thank you very much for replying so quickly Aren !

I've allowed the TNetServer.exe to get it through the Windows firewall.
I also tried to connect to the TNetServer.exe from a remote computer, it didn't work.
Or I'm doing something wrong, nor my university is blocking any access to the computers remotely...

Tell me if i'm not correct : the only thing I should do is to run the TNetServer.exe on a computer. Then try connecting by using the Tnet Example Unity build you provide, by entering the IP Address of the computer running the TNetServer.exe and click connect , right ?

If it comes from my University network, I'll try to do it from home with my android...

Thanks again for your time Aren !

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: TNet: Tasharen Networking Framework
« Reply #112 on: January 18, 2013, 04:47:32 AM »
University network... that sounds like a red flag right there.

Yes, that's all you have to do (in addition to checking the "allow public network access" dialog when running TNetServer.exe for the first time).

Yarashiel

  • Guest
Re: TNet: Tasharen Networking Framework
« Reply #113 on: January 18, 2013, 04:58:48 AM »
Okay Aren, thanks again.

Then i'll try it at home and inform the tech guys from my University.
However, I've never had the "allow public network access" dialog when running the TNetServer.exe, even the first time ! O_O
But nevermind... I'll keep you updated once I'd try it at home.
Enjoy your day/night ? ^^

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: TNet: Tasharen Networking Framework
« Reply #114 on: January 18, 2013, 05:02:05 AM »

Yarashiel

  • Guest
Re: TNet: Tasharen Networking Framework
« Reply #115 on: January 18, 2013, 05:04:20 AM »
Haha ! Thank you Aren !
But... never had this pop up !

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: TNet: Tasharen Networking Framework
« Reply #116 on: January 18, 2013, 05:05:13 AM »
Then your Windows always blocks it, and doesn't even ask you.

Yarashiel

  • Guest
Re: TNet: Tasharen Networking Framework
« Reply #117 on: January 18, 2013, 05:07:13 AM »
Nice to know x)
Okay okay, we're getting close to the solution !

ahgElliot

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 5
    • View Profile
Re: TNet: Tasharen Networking Framework
« Reply #118 on: January 20, 2013, 01:12:49 AM »
Hi there,
I've been working on a game and I would like to use TNet for it.  I've already purchased the package and have some of my basics working.  I am running into one issue where I need to get the item that was just instantiated by the network.  It seems this functionality is missing.  I would like to be able to get a NetworkObjectID or a GO from the TNet.Create or TNet.Instantiate methods.

Why would I want to do this?

I've made a game database system and pick up system loosely based off your example from NGUI and the orc inventory/item database.  I have a GamePickup script that I put on a GO and turned into a prefab that has a "SetItem" method on it that I turned into an RFC in preparation for this functionality.  I've added that prefab to the TNManager and it creates the item correctly, but I can't call the RFC because (unless I'm missing something) there is no way for me to get the object out of the TNManager when you instantiate or create an item. 

Is there a way to do this?  Is this something you think I could easily add in?  Would it make sense to have hundreds or potentially thousands of unique object ids in the TNManager considering each item in the game that gets dropped will generate a unique ID?

What approach would you take to accomplish this?  I'm not sure if my current implementation is going to work or if TNet is the best solution for this.

Thanks,
Elliot
« Last Edit: January 20, 2013, 01:15:08 AM by ahgElliot »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: TNet: Tasharen Networking Framework
« Reply #119 on: January 20, 2013, 05:29:52 AM »
Have a script attached to your instantiated object. Inside its Awake() function, check TNManager.isThisMyObject -- this will only be 'true' if you are the one who instantiated this object. All other clients will see this as 'false'.