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 - Elmo loves cookies

Pages: [1] 2 3 ... 5
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 / Re: how to know PlayersCount?
« on: January 11, 2018, 09:49:09 AM »
just uncomment in TNGameClient line 1067 (its income with ResponsePing)

4
TNet 3 Support / Re: how to know PlayersCount?
« on: January 10, 2018, 01:22:22 AM »
just need to know about server populations in lobby(before connect to some channel) - if there online are not to much -> player can change the server

ok, thanks, I'll go to try CustomPacket for this
or I can connect by default all in one channel for use TNManager.GetPlayers(channelID);

5
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

6
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?

7
TNet 3 Support / Re: lobby server
« on: January 06, 2018, 03:10:47 AM »
I found the answer, just set udpLobby(there I can receive this server itself in TNLobbyClient.knownServers - but tcpLobby is not), like:

  1. -name "Europe" -tcp 5127 -udp 5128 -udpLobby 5129 -http

8
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)?


9
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?

10
TNet 3 Support / Re: logic GameManager through network
« on: December 16, 2017, 01:55:07 AM »
yep, that best logic with tno on LobbyManage, thanks so much!!! I thought what it is possible to have tno on GameManager(with inherit TNEventReceiver)

11
TNet 3 Support / Re: logic GameManager through network
« on: December 14, 2017, 10:54:33 AM »
Just example of photon network logic:

GameManager+tno(photonView) - thats manager class - we can send RFC when we connect in the channel,
on TNet - when I connect to channel - I can't send RFC from tno attached to GameManager since start the game(because it is not created by TNManager.Instantiate or TNManager.JoinChannel)


Well: I try to make - all player connect in lobby(one channel), and Host can send there RFC(setUp additional game options) - and after that send for everyBody start the Round.
 - but I can't send because GameManager don't have tno for this(because GameManager is class from start the game - where we were offline(before connect))

12
TNet 3 Support / Re: logic GameManager through network
« on: December 13, 2017, 08:54:09 PM »
ohh No, I still have this problem, I don't understand - How send RFC from GameManager(canvas UI - starter object) to other players? I added TNObject with specific ID on Canvas UI(starter GameManager which I load on start game(before connect)) -> connect to some server -> connect to some channel = and can't send RFC to other player in this channel from TNObject (which I came with) - thats should not work?

13
TNet 3 Support / Re: logic GameManager through network
« on: December 13, 2017, 04:18:02 AM »
oh, Thanks so much!!! TNObject work only after TNManager.JoinChannel and TNManager.Instantiate.

14
TNet 3 Support / Re: logic GameManager through network
« on: December 13, 2017, 03:31:34 AM »
Yep, TNManager.LoadLevel - work is fine, but I try to send RFC - and its dont work for me, how its is possible to have only one Canvas in start scene(with GameManager class for manipulation all states of the game and sync network values - like: time, mode etc before start GameLevel)?

then players connect to lobby - they dont load new scene - they are stay in the first scene - and there need some network sync(sync work between created UI prefab with TNObject[with dynamically ID]): how there host with TNObject on gameManager class can send RFC to others?

by the way - if I load GameLevel by TNManager.JoinChannel - where LevelManager have TNobject - there RFC work is perfect. - just its is imposible send in the first scene on GameManager with static ID:(
there TNObject on GameManager on Start scene(before I connect to server and some channel)

15
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?


Pages: [1] 2 3 ... 5