Author Topic: UI Starter Kit: Starlink (NGUI + TNet)  (Read 82471 times)

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UI Starter Kit: Starlink (NGUI + TNet)
« Reply #60 on: September 10, 2013, 09:07:12 AM »
Direct connect goes by IP, so yes -- assuming the remote person's port is open. TNet opens it if UPnP is supported. Use the external IP. If they both match, that generally means that TNet wasn't able to figure out what your external IP is. You can figure it out by navigating to http://www.whatsmyip.org/

Nevulus

  • Guest
Re: UI Starter Kit: Starlink (NGUI + TNet)
« Reply #61 on: September 26, 2013, 02:56:52 AM »
post edited - No longer relevant, ArenMook took care of it.
« Last Edit: September 30, 2013, 11:39:34 PM by Nevulus »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UI Starter Kit: Starlink (NGUI + TNet)
« Reply #62 on: September 26, 2013, 01:43:44 PM »
There is no UIInputSaved anymore because the functionality is inside UIInput itself. I thought I upgraded all UIInputSaved fields to UIInput fields? Did I miss one?

Nevulus

  • Guest
Re: UI Starter Kit: Starlink (NGUI + TNet)
« Reply #63 on: September 26, 2013, 01:56:57 PM »
post edited - No longer relevant, ArenMook took care of it.
« Last Edit: September 30, 2013, 11:39:46 PM by Nevulus »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UI Starter Kit: Starlink (NGUI + TNet)
« Reply #64 on: September 26, 2013, 04:24:00 PM »
No it doesn't. o_O
  1. public class UIResetInput : MonoBehaviour
  2. {
  3.         public UIInput input;
  4.  
  5.         void OnClick ()
  6.         {
  7.                 input.value = "";
  8.         }
  9. }

Nevulus

  • Guest
Re: UI Starter Kit: Starlink (NGUI + TNet)
« Reply #65 on: September 28, 2013, 10:43:30 PM »
post edited - No longer relevant, ArenMook took care of it.
« Last Edit: October 01, 2013, 04:18:47 PM by Nevulus »

aidji

  • Guest
Re: UI Starter Kit: Starlink (NGUI + TNet)
« Reply #66 on: September 29, 2013, 04:48:25 AM »
Same problem here I have the 3 package all in the last version

i instal ngui: no problem
i install Starlink package: no problem
i install TNET: 18 errors

i load the Starlink Tnet package and have this error
Assets/StarlinkUI/Scripts/Generic/UI/UIResetInput.cs(9,16): error CS0246: The type or namespace name `UIInputSaved' could not be found. Are you missing a using directive or an assembly reference?

aidji

  • Guest
Re: UI Starter Kit: Starlink (NGUI + TNet)
« Reply #67 on: September 29, 2013, 05:05:35 AM »
well i founded the way to dont have errors:
import ngui
import tnet
import starlink
then in starlink folder import tnet integration but disable the importation of UIRESETImput

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UI Starter Kit: Starlink (NGUI + TNet)
« Reply #68 on: September 29, 2013, 09:23:00 PM »
Curious. I may have forgotten to update that one in the integration package then. Well, I've re-uploaded the update with it there.

Nevulus

  • Guest
Re: UI Starter Kit: Starlink (NGUI + TNet)
« Reply #69 on: September 30, 2013, 09:48:19 PM »
Just imported UI Starter Kit v1.1.1, running with Tnet v1.8.2 and NGUI v3.0.1, & Tnet integration package:

I noticed the chatroom in the Game scene was not re-sizing height for ChatEntry gameobjects, and the chat input label itself was set to re-size height instead of clamp.

So I changed chat input label's overflow method to "Clamp Content"

and in UIChat.cs I added a new line of code so that Chat Entry's label will be set to "Resize Height" during InternalAdd function.

  1. void InternalAdd (string text, Color color) {
  2. ...
  3. ent.label.overflowMethod = UILabel.Overflow.ResizeHeight;
  4. ...
  5. }
  6.  
I will verify tomorrow with another clean install of the asset packages to see if the labels came like that. Hope this helps others.

Now my question is how can I increase the spacing between Chat entry game objects and have background adjust to new heights accordingly? I figure I'd squeeze in a question on this same thread before experimenting. I can affect line height by adding to the font.size, but the background stays misaligned.  :)

« Last Edit: September 30, 2013, 10:41:56 PM by Nevulus »

jwb21

  • Guest
Re: UI Starter Kit: Starlink (NGUI + TNet)
« Reply #70 on: October 27, 2013, 10:37:41 AM »
hi,
I just purchased the Starlink kit, and imported it into its own project, and then imported the latest TNET and NGUI 3.x.
I'm getting the following three errors in the console:


Assets/StarlinkUI/Scripts/Generic/UI/UIChat.cs(129,42): error CS0117: `NGUITools' does not contain a definition for `StripSymbols'

Assets/StarlinkUI/Scripts/Generic/UI/UIChat.cs(176,69): error CS1061: Type `UIFont' does not contain a definition for `size' and no extension method `size' of type `UIFont' could be found (are you missing a using directive or an assembly reference?)

Assets/StarlinkUI/Scripts/Generic/UI/UIChat.cs(274,71): error CS1061: Type `UIFont' does not contain a definition for `size' and no extension method `size' of type `UIFont' could be found (are you missing a using directive or an assembly reference?)

thanks,
Jon

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UI Starter Kit: Starlink (NGUI + TNet)
« Reply #71 on: October 27, 2013, 10:27:28 PM »
The kit has been updated, but unfortunately it hasn't been added to the "trusted" list by Unity yet, which means that there is a delay between the submission time and the time when the update becomes available. It should become available soon.

aidji

  • Guest
Re: UI Starter Kit: Starlink (NGUI + TNet)
« Reply #72 on: November 02, 2013, 12:42:56 PM »
[modified post to make it more clear]

If you Want to use the Starlink Kit with an Amazon Lobby Server:
1: register here, it is free http://aws.amazon.com/fr/free/
2: open the port for tnet in the amazon server management section
3: send your tnet server to the amazon server( I did it using dropbox, and disabling all security)
4: run it it should display an external IP for the lobby



In the scene:

5: add your amazon server IP
_Network Manager
            TCP Lobby : changed the ip to my amazon server ( I am correct its not the UDP one ? udp shoud be left blank for lan ?)
then I click on internet: Server list: Searching... not yet finished

it seems that the internet panel is not finished in the kit.
@ ArenMook, is it possible to make an update to the package and add the possibility to do same  like in the LAN section:
Create a chanel( add our channel to the internet lobby server ) or click on a chanel to join( request chanel list on our internet lobby server ip)


so we just have to put the IP of our server and ..activate the internet collider.

it would be awesome if you could use the same menu from the LAN window to select internet lobby channel or create game here


maybe this could work:
On "Window Internet" add the component "UICreateServer" to make it behave like the "Window LAN" component
then we need to duplicate the component required from "Window LAN":
-Button - Start
-the label inside the button that will change start/stop value
-the server name UIImput

just do control + D, move them into "Window Internet" panel and assign the public field variable with them.
then It almost work ! the server register in the Lan lobby.

But i believe there is something to change here:

UICreateServer.cs
  1. void OnButtonClick (GameObject go)
  2.         {
  3.                 if (!TNServerInstance.isActive)
  4.                 {
  5.                         TNServerInstance.serverName = string.IsNullOrEmpty(serverName.value) ? "LAN Server" : serverName.value;
  6.                         TNServerInstance.Start(5127, 0, null, 5129);
  7.                         UpdateButtonText();
  8.                 }
  9.                 else
  10.                 {
  11.                         TNServerInstance.Stop();
  12.                         UpdateButtonText();
  13.                 }
  14.         }
  15.  
  16.         void OnNameChange ()
  17.         {
  18.                 TNServerInstance.serverName = string.IsNullOrEmpty(UIInput.current.value) ? "LAN Server" : UIInput.current.value;
  19.         }
  20.  
  21.         void UpdateButtonText ()
  22.         {
  23.                 buttonText.text = Localization.Localize(TNServerInstance.isActive ? "Stop" : "Start");
  24.         }
  25. }
this currently only work for LAN

now i changed it to
  1. void OnButtonClick (GameObject go)
  2.         {
  3.                 if (!TNServerInstance.isActive)
  4.                 {
  5.                         TNServerInstance.serverName = string.IsNullOrEmpty(serverName.value) ? "LAN Server" : serverName.value;
  6.                         if(!internet)
  7.                         {
  8.                         TNServerInstance.Start(5127, 0, null, 5129);
  9.                         }
  10.                         else{
  11.                         TNServerInstance.Start (5129,5129,null,TNServerInstance.Type.Tcp,TNet.Tools.ResolveEndPoint (lobbyServ,5129));
  12.                         }
  13.                         UpdateButtonText();
then my amazon lobby server flood this line when i create a server every 7 seconds:
  1. <ip>:<some port> has connected
  2. <ip>:<some port>has timed out
  3. <ip>:<some port> has disconnected
« Last Edit: November 03, 2013, 06:10:13 AM by deldama »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UI Starter Kit: Starlink (NGUI + TNet)
« Reply #73 on: November 03, 2013, 09:18:38 AM »
You specified port 5129 twice. Check the signature of TNServerInstance.Start:
  1. static public bool Start (int tcpPort, int udpPort, string fileName, Type type, IPEndPoint remoteLobby)
First parameter is TCP, second parameter is UDP. You can't specify the same value.

aidji

  • Guest
Re: UI Starter Kit: Starlink (NGUI + TNet)
« Reply #74 on: November 03, 2013, 08:26:33 PM »
I am a bit confused now if I check in the menu scene in the _network manager, by default all port are 5129
I changed it:
  1. void OnButtonClick (GameObject go)
  2.     {
  3.         if (!TNServerInstance.isActive)
  4.         {
  5.             TNServerInstance.serverName = string.IsNullOrEmpty(serverName.value) ? "LAN Server" : serverName.value;
  6.             if(!internet)
  7.             {
  8.             TNServerInstance.Start(5127, 0, null, 5129);
  9.                         UpdateButtonText();
  10.             }
  11.             else
  12.                         {
  13.                  TNServerInstance.Start (5127,5129,null,TNServerInstance.Type.Tcp,TNet.Tools.ResolveEndPoint (lobbyServ,5129));
  14.                         UpdateButtonText();
  15.             }
  16.            
  17.                 }
  18.                 else
  19.         {
  20.             TNServerInstance.Stop();
  21.             UpdateButtonText();
  22.         }
  23.         }
my tcp lobby gameobject with the TNTcpLobbyClient have my amazon serv adress and my port 5127
it still flood the errors:
  1. <ip>:<some port> has connected
  2. <ip>:<some port>has timed out
  3. <ip>:<some port> has disconnected
and after a minute my editor in unity return a warning
  1. Unable to connect
  2. UnityEngine.Debug:LogWarning(Object)
  3. TNTcpLobbyClient:Update() (at Assets/TNet/Client/TNTcpLobbyClient.cs:115)
  4.  

Would really appreciate an update to finish the Internet lobby part of the kit
« Last Edit: November 03, 2013, 10:46:44 PM by deldama »