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.


Messages - nidhi_singh

Pages: [1] 2
1
Yup, I tried Both UdpProtocol.useMulticasting true and false. I am getting same result, server gets discovered but after some delay.

2
TNet 3 Support / Re: Profile Name Display or User Name Display
« on: May 29, 2015, 01:47:38 AM »
sorry, which example I didn't find it in any.
what I tried is this. Still its not working, maybe I am still missing something. When Other player searches for server he's able to see his TNmanager.playerName.

UdpProtocol Listener;
void Start()
{
   Listener = new UdpProtocol ();
   Listener.Start ();
}
public void OnHost()
{
   TNManager.playerName = PlayerPrefs.GetString ("PlayerName");
   tno.BroadcastToLAN(Listener.listeningPort,94,TNManager.playerName);
}
[RFC(94)]
public void SendName(string NameToSend)
{
   TNManager.playerName = NameToSend;
}


void OnFindServer()
{
   Button.transform.Find("LabelIP").GetComponent<UILabel>().text = ent.internalAddress.ToString();
   Button.transform.Find("LabelProfileName").GetComponent<UILabel>().text =TNManager.playerName;
}

3
after setting UdpProtocol.useMulticasting to false its detecting server while Internet connection is not present. but there is huge delay before server shows up 3-5 mins is there any way to reduce that time. form your example menu whenever WAN is resolving user is unable to find server even though they are connected to same network.  is this problem because server is tcp+udp ??

If I host using Mobile hotspot, other player is still unable to detect it.

4
TNet 3 Support / Re: Profile Name Display or User Name Display
« on: May 25, 2015, 03:18:18 AM »
Alright I found out BroadcastToLAN so I am able to send user name to other player even if he's not connected to server but is on same network.

tno.BroadcastToLAN(GameConnectScript.udpPort,94,TNManager.playerName);

But now how will other player will receive it. is there any other function for that.
I want set Button's label to the name he received from broadcast message.

Button.transform.Find("LabelProfileName").GetComponent<UILabel>().text =TNManager.playerName;

5
TNet 3 Support / Re: Profile Name Display or User Name Display
« on: May 24, 2015, 11:52:29 PM »
Thanks for the reply, 2nd part of post I solved, still I'm not getting how to display user name of host instead of his IP when player searches for the server. I am able to store the user name but how to send it if the other player is not connected to the server only.

6
TNet 3 Support / Sending Texture or Material values With RFC
« on: May 20, 2015, 11:59:29 PM »
In my Game there is a option for user to select the colour of his character in the beginning of the game. I am sending that material value via RFC on receiving the material is getting lost from the character.

I am attaching script with this post.

7
TNet 3 Support / Profile Name Display or User Name Display
« on: May 18, 2015, 01:04:00 AM »
From Example Menu instead of displaying IP to other user I want to display user name which player sets in beginning of the game. is there anyway to do this or how to send a RFC if a user hasn't connected to server.
 
I will be displaying that user name with player's character, here hosts name is overriding other users name. I'm storing user name in TNManager.playerName and sending it via RFC.

I am using NGUI for game UI.

8
Is it possible to host a game server using mobile hotspot? if so can someone please tell me how to do that AND
I am able to host a lobby without internet connection but another device is unable to find it though both are connected to same router. I want host a lobby which works with or without internet connection and players are able to play on that. I am using server based on TNet Example Menu.

9
Thanks for the reply, after working for hours I finally found out problem  :). I'm using NGUI buttons for my game UI. After I go back to main menu create  server function is getting removed from UIButton OnClick. If I manually attach it then its working fine. Still I have to figure out why its happening.

10
This Is Function for Hosting Server Its Called On Button Press The Script Is Attached To Empty Game Object With TN Manager, TN Object and TN UDPLobbyClient Script Attached.

public void OnCreateServer()
   {
      //Stating Ports For tcp Upd and LAN

         int udpPort = Random.Range(10000, 40000);
         TNLobbyClient lobby = GetComponent<TNLobbyClient>();
         
         if (lobby == null)
         {
            //TNServerInstance.Start(tcpPort,udpPort,lobbyPort,"server.dat");
            TNServerInstance.Start(serverTcpPort, udpPort, "server.dat");   
         }
         else
         {
            //Hosting Server
            mMessage = "Server started";
            TNServerInstance.Type type = (lobby is TNUdpLobbyClient) ? TNServerInstance.Type.Udp : TNServerInstance.Type.Tcp;
            TNServerInstance.Start(serverTcpPort, udpPort, lobby.remotePort, "server.dat", type);

         }
         
         TNManager.Connect (Tools.localAddress.ToString());      
   }

This Function is Called On a  In Game Button

public void OnResetTap()
   {
      BackToMenu = true;
      TNManager.Disconnect();

   }

   void OnNetworkLeaveChannel ()
   {
      TNManager.LoadLevel("GameMenu");
   }
This is Called On GameMenu
void Start()
   {
      if(MultiplayerResetScript.BackToMenu == true)
      {
         TNServerInstance.Stop("server.dat");
         MultiplayerResetScript.BackToMenu = false;
      }
   }

After This if I Try Re-Hosting Server or Try To Join to Already Hosted Server I'm unable to do so. Sorry for Long Post.


11
NGUI 3 Support / Re: UI Pop Up List
« on: May 08, 2015, 02:46:33 AM »
Version 3.6.7

12
NGUI 3 Support / Re: UI Pop Up List
« on: May 06, 2015, 02:41:27 AM »
There is no function for UIPopupList.Show()

13
For say you are playing game and went to main menu and the server is stopped, if you try to start the server again its not happening.

14
I'M using server model based on Example Menu, Once game is finished I am sending player back to Main Menu and calling TNServerInstance.Stop("server.dat");  If I try to re-host or reconnect to already hosted server I'm unable to so.

15
NGUI 3 Support / UI Pop Up List
« on: May 05, 2015, 08:26:40 AM »
is there any way I can leave pop up list open by default or open on game start ?? For now I have to click it then it opens. I found out there was a method for closing it and checking its current state but none for opening.

Pages: [1] 2