Author Topic: UI Starter Kit: Starlink (NGUI + TNet)  (Read 105212 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 #75 on: November 04, 2013, 12:52:22 PM »
Remove the second parameter from TNServerInstance.Start. Leave it at zero. Other than that what you are doing is fine. Make sure you have "run in background" set on your application.

aidji

  • Guest
Re: UI Starter Kit: Starlink (NGUI + TNet)
« Reply #76 on: November 04, 2013, 09:06:21 PM »
I changed the script and it still same: timed out disconnected and no servers in the list
here is the script changed
for create server:
  1. using UnityEngine;
  2.  
  3. public class UICreateServer : MonoBehaviour
  4. {
  5.         public UIButton button;
  6.         public UILabel buttonText;
  7.         public UIInput serverName;
  8.         public bool internet = false;
  9.         public string lobbyServ;
  10.        
  11.         void Start ()
  12.         {
  13.                 UIEventListener.Get(button.gameObject).onClick = OnButtonClick;
  14.                 EventDelegate.Set(serverName.onSubmit, OnNameChange);
  15.         }
  16.  
  17.         void OnEnable ()
  18.         {
  19.                 UpdateButtonText();
  20.         }
  21.  
  22. void OnButtonClick (GameObject go)
  23.     {
  24.         if (!TNServerInstance.isActive)
  25.         {
  26.             TNServerInstance.serverName = string.IsNullOrEmpty(serverName.value) ? "LAN Server" : serverName.value;
  27.             if(!internet)
  28.             {
  29.             TNServerInstance.Start(5127, 0, null, 5129);
  30.                         UpdateButtonText();
  31.             }
  32.             else
  33.                         {
  34.                  TNServerInstance.Start (5127,0,null,TNServerInstance.Type.Tcp,TNet.Tools.ResolveEndPoint (lobbyServ,5129));
  35.                         UpdateButtonText();
  36.             }
  37.            
  38.                 }
  39.                 else
  40.         {
  41.             TNServerInstance.Stop();
  42.             UpdateButtonText();
  43.         }
  44.         }
  45.  
  46.         void OnNameChange ()
  47.         {
  48.                 TNServerInstance.serverName = string.IsNullOrEmpty(UIInput.current.value) ? "LAN Server" : UIInput.current.value;
  49.         }
  50.  
  51.         void UpdateButtonText ()
  52.         {
  53.                 buttonText.text = Localization.Localize(TNServerInstance.isActive ? "Stop" : "Start");
  54.         }
  55. }
  56.  

then on the gameobjects _NectworkManagers>Tcp Lobby Remote Port set to 5127 instead of 5129 ( right? it doesnt connect if i dont do so)
run in background ticked
I am out of options to make the lobby server work, someone tried and succeeded?

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 #77 on: November 05, 2013, 02:41:00 PM »
I will see about changing the built-in example to use a remote server and package it up sometime tomorrow.

aidji

  • Guest
Re: UI Starter Kit: Starlink (NGUI + TNet)
« Reply #78 on: November 05, 2013, 08:21:19 PM »
ah you are awesome, you will probably save months of hard testing for lot of novice devs like me in one hour ;D

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 #79 on: November 06, 2013, 10:29:18 AM »
So here's the most basic example.

1. Start the TNServer as a lobby server on a remote PC. Note that it has to be a remote PC as this is a lobby server, not a game server. I started it on my Amazon EC2 micro instance, for example.
  1. tnserver.exe -name "Remote Lobby" -tcpLobby 5129
2. Create a new scene, add a game object, add a new script to this game object:
  1. using UnityEngine;
  2. using TNet;
  3.  
  4. public class Test : TNBehaviour
  5. {
  6.         void Start ()
  7.         {
  8.                 TNServerInstance.serverName = "My Server";
  9.                 TNServerInstance.Start(5127, 0, null, TNServerInstance.Type.Tcp, Tools.ResolveEndPoint("your.lobbyServer.com:5129"));
  10.         }
  11. }
3. Assuming you changed "your.lobbyServer.com" to be your remote server's address, hit Play. You should now see the game server get added to your lobby server and stay on the list.

aidji

  • Guest
Re: UI Starter Kit: Starlink (NGUI + TNet)
« Reply #80 on: November 06, 2013, 09:56:30 PM »
oh thank you so much, it was the server on amazon that didnt had the good config i did this :

start> run> browse to the server exe and add this after in the field "-name "Remote Lobby" -tcpLobby 5129"
then in the unity editor changed back tcp port to 5129 and it worked perfectly
thank you one million time

DonChipriani

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 8
  • I'm a dreamer ...
    • View Profile
Re: UI Starter Kit: Starlink (NGUI + TNet)
« Reply #81 on: November 11, 2013, 10:14:08 PM »
Hi. I stumbled upon this issue while trying to build Starlink UI Starter Kit for IOS.

UIOptionWifi.cs needs updated to NGUI v3

the code between #if UNITY_ANDROID || UNITY_IPHONE #
bellow is the changed code with the original code commented out:

  1. using UnityEngine;
  2.  
  3. /// <summary>
  4. /// Checkbox controller for the "wifi" state in options.
  5. /// </summary>
  6.  
  7. [RequireComponent(typeof(UIToggle))]
  8. public class UIOptionWifi : MonoBehaviour
  9. {
  10.         public UILabel info;
  11.         void OnClick () { info.text = Localization.Localize("Carrier Info"); }
  12.  
  13. #if UNITY_ANDROID || UNITY_IPHONE
  14.         UIToggle mCheck;
  15.  
  16.         void Awake ()
  17.         {
  18.                 mCheck = GetComponent<UIToggle>();
  19. //              mCheck.onStateChange = SaveState;
  20.                 EventDelegate.Set(mCheck.onChange, SaveState);         
  21.         }
  22.  
  23.         void OnDestroy () {
  24. //              mCheck.onStateChange -= SaveState;
  25.                 EventDelegate.Remove(mCheck.onChange, SaveState);      
  26.         }
  27. //      void OnEnable () { mCheck.isChecked = PlayerProfile.allow3G; }
  28.         void OnEnable () { mCheck.value = PlayerProfile.allow3G; }     
  29. //      void SaveState (bool state) { PlayerProfile.allow3G = state; } 
  30.         void SaveState () { PlayerProfile.allow3G = mCheck.value; }
  31. #else
  32.         void Awake () { NGUITools.SetActive(gameObject, false); }
  33. #endif
  34. }
  35.  
  36.  
« Last Edit: November 11, 2013, 11:11:34 PM by DonChipriani »
I'm a dreamer ... dreaming of making games

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 #82 on: November 13, 2013, 03:09:34 PM »
I guess I missed that one, thanks!

TriplePAF

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 8
    • View Profile
Re: UI Starter Kit: Starlink (NGUI + TNet)
« Reply #83 on: November 15, 2013, 10:48:54 AM »
Hello,

Is it allowed to use the artwork from this package in a commercial product. In my case I wan't to use the background pictures (Nebula with the big S inside).

Kind regards,


Peter Fonk.

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 #84 on: November 15, 2013, 11:42:34 AM »
Yup, go for it. :)

DonChipriani

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 8
  • I'm a dreamer ...
    • View Profile
Re: UI Starter Kit: Starlink (NGUI + TNet)
« Reply #85 on: November 30, 2013, 08:00:31 PM »
Why does this asset require Unity 4.3 after the last update(s)?
I'm a dreamer ... dreaming of making games

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 #86 on: November 30, 2013, 08:47:23 PM »
It's just the version I used to upload it. I only have 3.5.7, 4.3.1, and 4.5 installed.

DonChipriani

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 8
  • I'm a dreamer ...
    • View Profile
Re: UI Starter Kit: Starlink (NGUI + TNet)
« Reply #87 on: December 04, 2013, 11:13:16 PM »
How is v4.5 working out for you?
I'm a dreamer ... dreaming of making games

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 #88 on: December 05, 2013, 03:55:46 PM »
It's perfect, and no bugs whatsoever!  ::)

bjornrun

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 1
    • View Profile
Re: UI Starter Kit: Starlink (NGUI + TNet)
« Reply #89 on: December 25, 2013, 05:29:59 AM »
When using the input areas in Main Menu, how can you get them scroll horizontal when entering more text than can be shown at one time?