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

zipper

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 14
    • View Profile
Re: TNet: Tasharen Networking Framework
« Reply #135 on: January 22, 2013, 10:38:55 PM »
Hi ArenMook,
Happy NGUI user here :)

I have a Flash socket server (TCP) i need to connect to on a local network. I know this much about networking ><. Can i use your networking framework to talk to it? Basically, i just need to read and write strings to the host - port, non-blocking if possible.

Best,
zipper


ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: TNet: Tasharen Networking Framework
« Reply #136 on: January 22, 2013, 11:03:39 PM »
TNet clients are designed to connect only to a TNet server, and TNet doesn't support Flash because Unity's Flash export doesn't support Reflection. I don't think TNet is going to be helpful in your case.

xfinitystudios

  • Guest
Re: TNet: Tasharen Networking Framework
« Reply #137 on: January 23, 2013, 08:21:07 AM »
I'm experiencing a bug with the latest version... it's a bit strange.

When I open two windows on my machine and start clicking around... changes only happen on one window until I bring another window into focus. Only then will the changes sync for the other window. And the server keeps disconnecting me automatically. (I'm using the demo scenes with the latest version).

I know it's not my system because I ran the version 1 server and downloaded the client from this web site.. and all windows synced instantly. Even the ones in the background. Also no forced disconnects.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: TNet: Tasharen Networking Framework
« Reply #138 on: January 23, 2013, 08:35:58 AM »
You need to check the "Application runs in background" checkbox.

Unity automatically puts the app to sleep when it loses focus.

xfinitystudios

  • Guest
Re: TNet: Tasharen Networking Framework
« Reply #139 on: January 23, 2013, 10:41:58 AM »
You need to check the "Application runs in background" checkbox.

Unity automatically puts the app to sleep when it loses focus.

*face palm* .... thanks Aren, that solved it.  :-X

byerdelen

  • Guest
Re: TNet: Tasharen Networking Framework
« Reply #140 on: January 23, 2013, 01:46:08 PM »
Hi ArenMook,
I am experienced programmer but I have very little experience with networking. I watched video, checked documentation, checked forums and it seems this package can do the hardest part well. Before buying I would just have 2-3 small questions, I do not want to waste your time so I would appreciate if you would answer with yes or no even
-I am planning to develop a small social game and the network necessities are very close to a poker game although the game is very different, I will need to create rooms, an authoritative server, 10-20 thousand people max playing simultaneously (as four people groups). The game will randomly put people to four people's group and get and respond messages in every 3-5 seconds. Just to be sure before giving lots of effort, do you think this framework is capable to do those fully and efficient?
-Will there be any huge effort to setup the server running except Unity and your framework?
-(You can ignore this question if you find it irrevelant) What kind of bandwidth do you think for that kind of game?

Thanks a lot and congratulations on all your wonderful frameworks

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: TNet: Tasharen Networking Framework
« Reply #141 on: January 23, 2013, 01:51:15 PM »
1. Yes, this is easy, but 10-20k people on the same server? You may need multiple servers due to how sockets are handled by the operating system (so it also depends on the operating system).

2. You can set up a server by running the TNetServer executable on the computer of your choice. Now the question is how much modification will you need to do to the server itself? Anti-hacking measures and such will imply modifying the server code.

3. I really can't estimate on the bandwidth as I don't know what you will be sending. My guess -- very little, since you're only sending data every few seconds.

byerdelen

  • Guest
Re: TNet: Tasharen Networking Framework
« Reply #142 on: January 23, 2013, 01:58:13 PM »
Ok, those clarified my mind if I will need some other network solutions or not. It seems it is capable to do my needs. Thanks a lot

xfinitystudios

  • Guest
Re: TNet: Tasharen Networking Framework
« Reply #143 on: January 23, 2013, 02:01:36 PM »
So, everything is working now with updated TNet assets.. connection works as expected however when I view "Example 3"... The blocks don't move in realtime on the different clients. The blocks on other clients only update when I release the mouse.

If I recall, in the previous version of TNet, whenever I dragged a block, it would move the blocks on other clients in realtime.

PS: I'm running the server from a Rackspace hosted box. I opened up the TCP ports for 5127-5130. Is there something else I need to do for that example to work?

PSS: It works perfectly on local host servers.
« Last Edit: January 23, 2013, 03:20:52 PM by xfinitystudios »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: TNet: Tasharen Networking Framework
« Reply #144 on: January 23, 2013, 03:25:05 PM »
Those position updates are sent via UDP, not TCP. Sounds like your UDP packets are getting lost.

xfinitystudios

  • Guest
Re: TNet: Tasharen Networking Framework
« Reply #145 on: January 23, 2013, 06:46:41 PM »
Those position updates are sent via UDP, not TCP. Sounds like your UDP packets are getting lost.

Yup! so when I got home I tested the same code and the UDP packets were sent with no problem, which means some networks may not be able to do UDP. Is there a way we can get a "isUDPSupported" flag so we can fall back to TCP if needed?

Pretty PLeeeeeaaseee!!

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: TNet: Tasharen Networking Framework
« Reply #146 on: January 23, 2013, 06:47:55 PM »
It should do that by default, actually. When you connect to the server in the example, you should see what type of a connection you have in the top left corner.

xfinitystudios

  • Guest
Re: TNet: Tasharen Networking Framework
« Reply #147 on: January 23, 2013, 06:55:21 PM »
Yea, it showed (TCP + UDP) ... but no UDP stuff was working on that network (it was my job's network). If I knew how to turn off UDP on my Mac I'd try to replicate it here at home.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: TNet: Tasharen Networking Framework
« Reply #148 on: January 23, 2013, 06:58:38 PM »
Curious. TNet doesn't enable UDP unless it has been confirmed to work (a packet arrived successfully). You might have to debug that one.

enzi

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 21
    • View Profile
Re: TNet: Tasharen Networking Framework
« Reply #149 on: January 23, 2013, 07:12:52 PM »
Hi!

I need to synchronize the server/client time but it's getting inaccurate because I don't know how long a packet needed to be received. In unity networking there's NetworkMessageInfo.timestamp" with which I can calculate the travel time via "Network.Time - NetworkMessageInfo.timestamp".

Is their a equivalent in your framework or do you know a way to do this in C#? Google didn't help me :(

Thanks!