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 - GantZ_Yaka

Pages: [1] 2
1
Please help advice. How to prohibit the input of non-Latin characters?

2
TNet 3 Support / Block the Channel for new Players
« on: July 09, 2014, 02:57:34 AM »
How to block the channel for new players after a lot of players have already acceded to it. For example, if I open the game and during the game players can join the channel, during the fight with the boss - new players should not be able to join the channel. How to do it?

3
TNet 3 Support / Re: Channel data at creation
« on: March 06, 2014, 12:28:54 AM »
I decided the same problem using Coroutine. Something like this:
  1. void JoinClient()
  2. {
  3. TNManager.JoinChannel(myChid, null);                             StartCoroutine(Coroutine());                                            
  4. }      
  5.        
  6. public IEnumerator Coroutine()
  7. {
  8.         if(!TNManager.isInChannel)
  9.         {
  10.                 yield return new WaitForSeconds(0.5f);
  11.                 StartCoroutine(Coroutine());
  12.         }
  13.         else
  14.         {                                      
  15.              tno.Send(....);                                                                                   
  16.         }
  17. }

4
Because that's what I'm working - not really a game, it's a multiplayer simulator training for miners, where they control their characters in a virtual mine with tablet PCs, and the game is projected onto the wall using a 3D projector :D
There are two types of clients here. Client 1 - the character in the game scene, client 2 - remote control character (Tablet PC). When connected to a channel, the player must first choose his tablet from the list of connected clients - tablets. So first host creates a channel, then chooses his remote control.
At this time the first game scene can run another players. and the host does not see the first players in the scene. I need to implement the ability to connect new players during the game.
Now im trying to the player, who loads the first scene, automatically became the host channel ... do not know, will it work well.

5
TNet 3 Support / Host cant see players, who loads the scene earlier.
« on: March 04, 2014, 10:59:41 PM »
In the following steps, I find a mistake and can not find ways to fix it.

1)The player opens a channel, but does not load the scene.
2)Other players join his channel and load their scenes.
3)The first player who is the host load his scene.

as a result:
1)All players, except the host, see each other, including the host.
2)Host does not see anyone.
3)If we now join the channel a new player, the new player will see all the players (and the host sees new player too). Host can not only see those players in the channel who have downloaded their scenes before it.

In all downloadable scenes I have a script that is in the void "Start()" spawns  player prefab by "TNManager.Create(playerPrefab, pos, rot)".

Tell me why I get such a result? Is there a way to open a channel by host without downloading scene, download it after many other players do it, and see all the players who went into the game scene earlier than the host?

6
TNet 3 Support / Re: iOS / Android Tablets as Server
« on: February 19, 2014, 10:01:17 PM »
I know about android. I tested it. Server runs on android and other computers on the network connected to it successfully.
You can test the demo scenes of TNet-package on iOS by yourself.

7
I myself have found a solution to the problem.
If you want to get id of all players on the server without joining the channel you have to add your own package to TNPacket.cs and TNGameServer.cs.

I add to TNPacket.cs :
  1. public enum Packet
  2. {
  3.    Empty,
  4.    ......,
  5.    RequestClients,    //my new packet
  6.    .....,
  7. }
And add to TNGameServer.cs:
find case Packet.RequestChannelList: and place here new case

  1. case Packet.RequestClients:
  2. {
  3.         BinaryWriter writer = BeginSend(Packet.RequestClients);
  4.         int count = mPlayers.size;                             
  5.         writer.Write(count);                           
  6.         for (int i=0; i < mPlayers.size; ++i)
  7.         {
  8.                 writer.Write(mPlayers[i].id);
  9.         }
  10.         EndSend(true, player);
  11.         break;
  12. }


after all, in the script where you want to get the players's id, add these:
  1. float RefreshOffserRate =2.5f;  //delay not to send requests all the time
  2. float NextRefreshUpdate = 0.0f;
  3. public System.Collections.Generic.List<int> clients = new System.Collections.Generic.List<int>();
  4.  
  5. void Update () {
  6.                 if (Time.time > NextRefreshUpdate) {   
  7.                                 TNManager.client.BeginSend(Packet.RequestClients);
  8.                                 TNManager.client.EndSend();
  9.                         NextRefreshUpdate = Time.time + RefreshOffserRate;
  10.                 }
  11.         }
  12.  
  13. void OnNetworkConnect (bool success, string message) {
  14.    if (success){
  15.       TNManager.client.packetHandlers[(byte)Packet.RequestClients] = OnClientsList;
  16. }
  17.  
  18.  
  19. void OnClientsList(Packet response, BinaryReader reader, IPEndPoint source)
  20.         {              
  21.                 int count = reader.ReadInt32();        
  22.                 clients.Clear();               
  23.                 for (int i = 0; i < count; ++i)
  24.                 {
  25.                         clients.Add(reader.ReadInt32());                       
  26.                 }                      
  27.         }

that's all, I hope someone helped  :)

8
Is there a command to get from the server once all clients IDs,  without being connected to the channels, without requesting a list of active channels, and not going through a cycle of players in each channel?

9
TNet 3 Support / unstable connection
« on: February 13, 2014, 01:40:42 AM »
I use a WiFi router for LAN between players, and sometimes the connection is unstable. I have a network involved only one TCP-server, and when the connection is lost, computers automatically reconnect to it. At this point, every client will receive a new TNManager.playerID.
have any idea how to fix it?

10
TNet 3 Support / Re: Set channel data at channel creation ?
« on: February 11, 2014, 10:07:36 PM »
thanks a lot! now everything works fine  ;D

11
TNet 3 Support / Re: Set channel data at channel creation ?
« on: February 11, 2014, 08:36:53 AM »
please help me understand with TNManager.channelData
I knew how to get the list of channels and how to retrieve data from there.
But I did not get to put custom string in the channel data :(
Immediately after the start channel by TNManager.JoinChannel(channel, null, false, 4, null);
I try to assign a string: TNManager.channelData = "my string";
but it does not work: (
looks as though it will take time after I created a channel, so that he could appoint himself my string.
eventually channel is created without a name, only with ID. But this is not enough! This is insufficient to show the other players immediately started rooms to choose from. how to be?

12
NGUI 3 Support / Re: *BUG* UIInput Input Type Password
« on: February 09, 2014, 08:03:45 AM »
Hi, My game has a system login, before the new version of Ngui worked great, now with the latest version my system login to dead, I discovered that the problem is with the input type, if I have selected "input type = password" it is impossible to login, however if I select "input type= Standard" I can make login perfectly, to now if there is a problem with the asterisks?
I found the problem and fixed it in the following way.
UILabel.text.ToString() now it returns ****
UIInput.value.ToString() returns correct password

13
TNet 3 Support / Re: "Start Local Server" custom IP
« on: February 06, 2014, 10:45:18 PM »
thanks for the answer, please answer another question.  When I start on different computers, a lot of servers, why TNLobbyClient.knownServers.list.size variable always returns 1, instead of the actual number of servers. What should I change in the TN's scripts to fix it? help me pls.

14
TNet 3 Support / Re: "Start Local Server" custom IP
« on: February 03, 2014, 03:24:08 AM »
TNet automatically sends the internal and external IPs to the lobby server. External IP can sometimes not be detected as it's done by accessing a remote website, which is public and used by everyone, and as such may not always respond. I've posted the PHP script for it in the past -- it's a good idea to put it up on your own web server so it's more reliable.

http://www.tasharen.com/forum/index.php?topic=7081.msg33577#msg33577
Help me pls,  how to use your  PHP script in Unity?
  1. <?php
  2. echo 'Current IP Address: ' . $_SERVER['REMOTE_ADDR'];
  3. ?>

15
TNet 3 Support / Re: "Start Local Server" custom IP
« on: January 31, 2014, 04:23:18 AM »
Sometimes  loopback address itself turns something like 192.168.134.1 (while his real local address on the network is quite different, for example 192.168.1.34)

Help me pls sample code, how do I get the program to automatically take the correct local IP of the computer on which the program is running - and send it to the lobby-list of servers to be able to join him on the other clients without resorting to manual input IP addresses. I need everything to be automatic, and the players did not need to drive hands - just pushing the buttons: make game, join game, etc. is it real?

Pages: [1] 2