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.


Topics - Elmo loves cookies

Pages: [1] 2 3
1
Misc Archive / logic of Lobby System
« on: February 02, 2018, 04:49:23 AM »
I create channel like this:

  1. TNManager.JoinChannel(Random.Range(10000, 99999), "", false, 8, "", false);

after connect to channel create lobbyPlayer by this:

  1. TNManager.Instantiate(mChannelID, "CreateLobbyPlayer", "LobbyPlayer", false, TNManager.player.id, TNManager.player.name, myPers);
  2.  
  3. [RCC]
  4.     static GameObject CreateLobbyPlayer(GameObject prefab, int id, string pName, int pers)
  5.     {
  6.         GameObject go = prefab.Instantiate();
  7.         LobbyPlayer obj = go.GetComponent<LobbyPlayer>();
  8.         obj.Set(pName, pers);
  9.         if (id == TNManager.player.id)
  10.         {
  11.             localLobbyPlayer = obj;
  12.         }
  13.         return go;
  14.     }
  15.  

and then everyBody go to game by this(send from tno on localLobbyPlayer):

  1. TNManager.LoadLevel("GameScene");
  2.  

by LoadLevel - TNet clearUp every network objects(witch we created before - like LobbyPlayer)
but I need this objects after Round again, - I go create it for everyBody after End round, but there I have many problem for sync parameters(just everyBody had this values on network object before - witch destroyed by "TNManager.LoadLevel")

TNManager.LoadLevel - is helpfull for Destroy network GameObjects(like Players) on the scene(because there automaticaly maked DontDestroyable by "TNManager.Instantiate")

it is possible Don't Destroy some network objects on "TNManager.LoadLevel" ?
or my way for making lobbySystem is wrong? what the best logic then?(everyBody go to lobby then start Round and after that back to lobby for nextRound again)

why needed destroy network objects from previous Scene? it is possible work with network object from previous Scene - like lobbyManager with own TNobject for sync parameters?

2
Misc Archive / lobbyPlayer(just UI) and gamePlayer
« on: February 01, 2018, 01:30:10 AM »
I create channel by this: TNManager.JoinChannel(Random.Range(10000, 99999), "", false, 8, "", false);
other connect here through channelList;

afterConnect to channel everybody create his lobbyPlayer(just UI with TNobject for sync RFC):

  1. TNManager.Instantiate(mChannelID, "CreateLobbyPlayer", "LobbyPlayer", false, TNManager.player.id, TNManager.player.name);
  2.  
  3. [RCC]
  4.     static GameObject CreateLobbyPlayer(GameObject prefab, int id, string pName)
  5.     {
  6.         GameObject go = prefab.Instantiate();
  7.         LobbyPlayer obj = go.GetComponent<LobbyPlayer>();
  8.         obj.Set(pName);
  9.         if (id == TNManager.player.id)
  10.         {
  11.             localLobbyPlayer = obj;
  12.         }
  13.         return go;
  14.     }
  15.  

and then playerHost start round for everyOne, by send RFC from "localLobbyPlayer.TNobject"

  1. TNManager.LoadLevel("sceneOne");

on loaded new scene everyody spawn his own gamePlayers:

  1. TNManager.Instantiate("CreatePlayer", "playerPrefabObject", false, spawn.position, spawn.rotation, TNManager.player.id);
  2.  
  3. [RCC]
  4.     static GameObject CreatePlayer(GameObject go, Vector3 pos, Quaternion rot, int id)
  5.     {
  6.         go = Instantiate(go, pos, rot) as GameObject;
  7.         if (TNManager.player.id == id)
  8.         {
  9.             localPlayer = go.GetComponent<PlayerController>();
  10.         }
  11.         AllPlayers.Add(go.GetComponent<TNObject>().ownerID, go.GetComponent<PlayerController>());
  12.         return go;
  13.     }
  14.  

well, after round I goOut in new scene "LobbyScene" by this:
  1. TNManager.LoadLevel("LobbyScene");
  2.  
all network objects have destoyed - we dont have lobbyPlayer(because "LoadLevel") go again create it for everybody,

thats correctly? my way is wrong for making lobby system?

3
TNet 3 Support / how to know PlayersCount?
« on: January 09, 2018, 11:58:03 PM »
how to know PlayerCount on remote server(wich you connected)? (not in the channel, I need all players in server wich I connected)

by the way, I can take it from "TNLobbyClient.knownServers.list" - but it's not cool, because I need take all of them

On local server it is: TNServerInstance.playerCount;
but it's work only for localServer

4
TNet 3 Support / start localServer
« on: January 07, 2018, 03:10:55 AM »
when I try to start local server by this:

  1. int udpPort = Random.Range(10000, 40000);
  2. if (TNServerInstance.Start(udpPort-1, udpPort, null, TNServerInstance.Type.Udp, Tools.ResolveEndPoint(RemoteLobbyServerIPEP)))
  3. {
  4.     TNManager.Connect();
  5. }

I receive thats error in concole:

Quote
UPnP: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.
UnityEngine.Debug:LogError(Object)
TNet.UPnP:ThreadDiscover(Object) (at Assets/TNet/Common/TNUPnP.cs:193)

and

Quote
UPnP Gateway: Not found
UnityEngine.Debug:Log(Object)
TNet.Tools:Print(String, Boolean) (at Assets/TNet/Common/TNTools.cs:1044)
TNet.UPnP:ThreadDiscover(Object) (at Assets/TNet/Common/TNUPnP.cs:201)

does anyone know what this means?

5
TNet 3 Support / flag of country for server
« on: January 05, 2018, 09:35:21 PM »
How receive location for make country flag? - it's better take location from IP address (with Google service Geolocation API)?


6
TNet 3 Support / lobby server
« on: January 04, 2018, 05:52:49 AM »
whenever Clients create their own server - how automatically registrate it on lobby Server? (for other players can find it later)

I finded info about taking list of Servers:
  1. ServerList sList = TNLobbyClient.knownServers;

registrate in lobbyServer:
  1. TNServerInstance.Start(5127, 5128, null, TNServerInstance.Type.Tcp, Tools.ResolveEndPoint(lobbyServerIPport))

but,
how connect to lobbyServer and take knowsServerList?
how run lobbyServer?
it is possible to check NAT posibility connection before registrate it on lobby Server?

7
TNet 3 Support / logic GameManager through network
« on: December 13, 2017, 12:05:59 AM »
I try to make lobby - there clients connect and waiting for start by host,
every client instancing with his TNobject in UI panel(and RFC work as well there, because TNObject creating and generate ID after joined in channel),

but problem send RFC command from GameManager(host), because if I add TNObject to GameManager with some channelID(like = 1), then try send from this to others in tha same channel(example: tno.Send("LoadLevel", Target.Others)) - its dont work :(

How can I use TNObject in manager class for sending RFC commands?


8
Misc Archive / Re: Create localPlayerPrefab and remotePlayerPrefab
« on: September 22, 2017, 12:30:33 AM »
ok, finded info - it is impossible

9
TNet 3 Support / Create localPlayerPrefab and remotePlayerPrefab
« on: September 20, 2017, 03:40:10 AM »
If I use [RCC] - I can create one example of gameObject, but I need create localPlayerPrefab and remotePlayerPrefab - it is possible?

10
TNet 3 Support / DataNode vs .txt
« on: August 22, 2017, 05:06:00 PM »
I use in my backEnd simple writing in text format(.txt), but tNet using DataNode, its have difference in performance and I should use dataNode class or I can use simple text format?

11
TNet 3 Support / for separate games on one server
« on: April 02, 2017, 08:48:38 AM »
I want to add separator on server for different games(two or more games on one server)
In what part of Tnet server - it is easy to add?
what I need: on connect players says own version of his game and he can communicate only the same version of the game of other players

12
TNet 3 Support / Separate channelList
« on: March 08, 2017, 01:30:43 PM »
for 2 different games on one server,

TNManager.GetChannelList(***) - I should receive all channels and then separate then by: channel.level = "game1" and channel.level = "game2" ?

it ok, or I doing some wrong?
it is impossible to receive channels only from one specific game?

13
TNet 3 Support / How get GameObject on TNManager.Instantiate
« on: March 08, 2017, 01:21:31 PM »
when I create Player - I need write him in variable "private PlayerController localPlayer;"

  1. GameObject pers = TNManager.Instantiate("CreatePlayer", "Player", false, spawn.position, spawn.rotation);
  2.        
  3.         localPlayer = pers.GetComponent<PlayerController>();

but it is impossible because: void != GameObject

so, How I can put creation object in some variable?:)

14
TNet 3 Support / Sync customProperties
« on: March 08, 2017, 01:06:06 PM »
needed take some customProperties from Tnet.Player

if we can get player, by: Tnet.Player owner = TNManager.GetPlayer(int ID);
how I can get some specific value from player "owner" ?

15
TNet 3 Support / CloseChannel and need open for next match
« on: March 08, 2017, 03:56:00 AM »
When start round - I close channel.
After round I need open this channel for other players, what the best way for this?

I should use ChannelData for this?

p.s.: I need closing the channel only when game in fight round, and then I need open for expectations of new players for next fight round

Pages: [1] 2 3