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

Pages: [1] 2
1
TNet 3 Support / Make a dedicated authoritative unity Server?
« on: August 16, 2017, 07:34:45 PM »
Hey,

i plan to make Transport tycoon and i can't let the player be host and send all vehicles to the gameserver and the gameserver relays it to other players.

I need to make a authoritative unity server, where the unity instance is the server and hoster.
So if I want to create a vehicle, the server is creating it and send every data to other players.

I made an quick test with 5000 Objects that are created on my pc and I had an outbound at 1Mbit to the gameserver(From the zip)(hosted on my datacenter with 1Gbs Up and Down).

So I would be Hard limited, if other players who host a game on their pc with a lower bandwidth.
So I decided to make an authoritative gameserver with unity logic.

And here is the question, how can I make in unity, that the gameserver is also the Hoster?

2
TNet 3 Support / Is TNet using something like Protobuf?
« on: August 16, 2017, 05:10:50 AM »
Hi,

is TNet using something like Protobuf or Messagepack?
Or is it possible to extend TNet with one of them?

3
TNet 3 Support / RFC got fired only at the third try
« on: November 04, 2016, 09:54:34 AM »
This happens on my vehicle.
When i try to enter it, i need to press it a few times and than i can get into it. (Im asking the hoster, if i can access this vehicle)

Error Message:
  1. NullReferenceException: Object reference not set to an instance of an object
  2. TNet.TNObject.RebuildMethodList () (at Assets/ThirdParty/TNet/Client/TNObject.cs:637)
  3. TNet.TNObject.Execute (System.String funcName, System.Object[] parameters) (at Assets/ThirdParty/TNet/Client/TNObject.cs:541)
  4. TNet.TNObject.SendRFC (Byte rfcID, System.String rfcName, Target target, Boolean reliable, System.Object[] objs) (at Assets/ThirdParty/TNet/Client/TNObject.cs:882)
  5. TNet.TNObject.Send (System.String rfcName, Target target, System.Object[] objs) (at Assets/ThirdParty/TNet/Client/TNObject.cs:685)
  6. NetworkTransform.SetLocalWantControl (Boolean _set) (at Assets/GameAssets/Scripts/Network/NetworkTransform.cs:216)
  7. VehicleSeats.EnterVehicleLocal (Boolean _enter, UnityEngine.GameObject _player) (at Assets/GameAssets/Scripts/Vehicle/VehicleSeats.cs:74)
  8. VehicleController.OnTriggerStay (UnityEngine.Collider other) (at Assets/GameAssets/Scripts/Vehicle/VehicleController.cs:107)

VehicleController.cs:107
  1. m_vehicleSeats.EnterVehicleLocal(true, m_player);

VehicleSeats.cs:74 (m_networkVehicle is a Child Class from NetworkTransform)
  1. m_networkVehicle.SetLocalWantControl(true);

NetworkTransform.cs:216
  1. public void SetLocalWantControl(bool _set)
  2.     {
  3.         tno.Send("OnPlayerWantControls", Target.Host, TNManager.playerID, _set);
  4.     }
  5.  
  6.     [RFC]
  7.     void OnPlayerWantControls(int _playerID, bool _set)
  8.     {
  9.         if (_set) //PLAYER WANT CONTROL
  10.         {
  11.             if (IsOwnerOfThisObject) //HOSTER CONTROLS THIS OBJ
  12.             {
  13.                 OwnerOfThisObject = _playerID;
  14.             }
  15.         }
  16.         else //PLAYER DONT WANT CONTROL - LET HOSTER CONTROL
  17.         {
  18.             OwnerOfThisObject = TNManager.playerID;
  19.         }
  20.  
  21.         tno.Send("OnPlayerGetControls", Target.Others, m_currentOwner);
  22.     }
  23.  
  24.     [RFC]
  25.     void OnPlayerGetControls(int _newOwner)
  26.     {
  27.         OwnerOfThisObject = _newOwner;
  28.     }
  29.  
  30.     public bool IsOwnerOfThisObject
  31.     {
  32.         get
  33.         {
  34.             return OwnerOfThisObject == TNManager.playerID;
  35.         }
  36.     }
  37.  
  38.     public bool HostOwnsThisObject
  39.     {
  40.         get
  41.         {
  42.             return IsOwnerOfThisObject && TNManager.isHosting;
  43.         }
  44.     }
  45.  
  46.     public int OwnerOfThisObject
  47.     {
  48.         get
  49.         {
  50.             return m_currentOwner;
  51.         }
  52.         set
  53.         {
  54.             m_currentOwner = value;
  55.         }
  56.     }

4
I have currently a huge problem. I dont know what i did, but my game worked a few days ago, and now when a second player trys to join the game, it's freeze and than i got disconnected.
My first player is my builded .exe and my second player is my Unity Editor.

And during the freeze time i got the "[TNet] Trying to execute a function xy before it has been created." logs and about 250 times per gameobject..

Here is an screenshot of my editor


When i disable the synchronizing function, it works. But i didn't changed them.

5
TNet 3 Support / How to simulate latency and packet loss?
« on: October 21, 2016, 06:49:14 AM »
How can i simulate latency and packet loss in TNet, like in UNet?

6
TNet 3 Support / How to see stats like incoming and outgoing bytes?
« on: October 21, 2016, 03:01:57 AM »
Is it possible to display in TNet my incoming and outgoing bytes and messages(rfc's)?
To see how much bandwith are used on Client and Server side?

7
TNet 3 Support / Set Player Limit doenst work?
« on: October 18, 2016, 06:51:47 AM »
After i created the channel, i set the Player limit.
And in the update Method i have this
  1. TNManager.GetChannel(GameManager.Instance.m_worldChannel).playerLimit) //m_worldChannel is my current channelID

And its always 65535, does it not work??

8
TNet 3 Support / Send RFC Error on manuel added TNObject
« on: October 16, 2016, 10:07:09 AM »
I have one gameobject which has an manuel added TNObject.
And when i send a RFC the first RFC give's me an Exception.
Every other RFC works perfectly without Errors.

Here is the Error Code:

  1. 1 0 SendChat
  2. Object reference not set to an instance of an object
  3.   at TNet.TNObject.RebuildMethodList () [0x00034] in D:\Unity\CartoonTown\CartoonTown_source\Assets\Extras\TNet\Client\TNObject.cs:637
  4.   at TNet.TNObject.Execute (System.String funcName, System.Object[] parameters) [0x0002a] in D:\Unity\CartoonTown\CartoonTown_source\Assets\Extras\TNet\Client\TNObject.cs:541
  5.   at TNet.TNObject.FindAndExecute (Int32 channelID, UInt32 objID, System.String funcName, System.Object[] parameters) [0x00014] in D:\Unity\CartoonTown\CartoonTown_source\Assets\Extras\TNet\Client\TNObject.cs:603
  6.   at TNet.TNManager.OnForwardedPacket (Int32 channelID, System.IO.BinaryReader reader) [0x00022] in D:\Unity\CartoonTown\CartoonTown_source\Assets\Extras\TNet\Client\TNManager.cs:1809
  7. UnityEngine.Debug:LogError(Object)
  8. TNet.TNManager:OnForwardedPacket(Int32, BinaryReader) (at Assets/Extras/TNet/Client/TNManager.cs:1813)
  9. TNet.GameClient:ProcessPacket(Buffer, IPEndPoint) (at Assets/Extras/TNet/Client/TNGameClient.cs:984)
  10. TNet.GameClient:ProcessPackets() (at Assets/Extras/TNet/Client/TNGameClient.cs:918)
  11. TNet.TNManager:<ProcessPackets>m__9() (at Assets/Extras/TNet/Client/TNManager.cs:528)
  12. TNet.TNManager:Update() (at Assets/Extras/TNet/Client/TNManager.cs:1823)

9
TNet 3 Support / Add to externalAddress the UDP Port to Ping Gameserver?
« on: September 18, 2016, 12:24:35 PM »
Hi,

i just had an problem to ping Gameserver.
So, i took a deeper look, and the externalAddress has the TCP Port. Take a look on my example below.

Is it possible to add an variable more with the UDP port?
For example
  1. ent.externalAddress.UDPPort

  1. TNet.List<ServerList.Entry> list = TNLobbyClient.knownServers.list;
  2.  
  3.         for (int i = 0; i < list.size; ++i)
  4.         {
  5.             ServerList.Entry ent = list[i];
  6.  
  7.             Debug.Log(ent.externalAddress); // IP:TCP PORT
  8.  
  9.             TNManager.Ping(Tools.ResolveEndPoint(ent.externalAddress.Address.ToString(), ent.externalAddress.Port+1), OnPing);
  10.         }
  11.  

The Ping works now, but if you could add this little thing, this would be very helpfull.

10
TNet 3 Support / What do you guys think about a Chat like Slack, Jabbr?
« on: September 07, 2016, 03:12:41 PM »
Hey guys,

i started with TNet on January 2014, and after some time i missed some features and went to Bolt Networking.
After the lack of development, i thought to switch to UNet. But this seems to be buggy as hell...
I tried Forge Networking aswell, but seriously, i could took my money and through it into a fire, would be better invested...
So, now im back to TNet and i think i will stay here!

Both(Bolt, Forge) have a Support Chat, they use Slack and its really nice.
It's very usefull, you can support live, and experienced user can help each other.

Should we try it?

11
TNet 3 Support / Ping a Game Server doesnt work?!
« on: September 07, 2016, 03:02:33 PM »
Hey,

i just upgraded to 3.0 and im happy to see what you have done so far, really nice.

But i have a question.
My Game Servers are registered to one Lobby Server.
The Client connects to the Lobby Server to retrieve all registered Game Servers.
And my plan is now, to connect to one server with the lowest latency.

But i cannot use TNManager.Ping(ip, callback) to check the latency of every server.
The error was something like, i need to be connected to one Game Server to make a Ping...

Im using now the build in Ping Command of Unity.

  1. Ping p = new Ping(ent.externalAddress.Address.ToString());
  2. while (!p.isDone) { }
  3. Debug.Log("tome: " + p.time);

12
TNet 3 Support / Old TNet 2.0 Customer question about 3.0
« on: September 06, 2016, 09:49:27 AM »
Hi,

i have only one question at the moment.

Is TNet 3.0 still p2p?

Last time i used TNet 2.0, i made an Unity Scene for the "Dedicated server" and an another Client (Menu) Scene.
On the "Dedicated server" i startup an Gameserver and instantly let an dummy player join to it, to become the host.

Reason:
I plan to make a game with a huge number of players(MMO) with multiple channels.
There will be a huge city, with maybe up to 50-100 players.
The players are able to go to several checkpoints in the city and start their own matches.

13
TNet 3 Support / Gameserver Ping doesnt work?
« on: January 05, 2015, 06:13:21 AM »
Hi Aren,

i tried to get an Ping from the Gameserver, but i get no one?

This is my test script:

  1. using UnityEngine;
  2. using System.IO;
  3. using TNet;
  4. using System.Net;
  5.  
  6. public class Test : MonoBehaviour
  7. {
  8.     void Update()
  9.     {
  10.         if (Input.GetKeyDown(KeyCode.P))
  11.         {
  12.             TNManager.Ping(Tools.ResolveEndPoint("127.0.0.1", 6192), OnPing);
  13.         }
  14.     }
  15.  
  16.     void OnPing(IPEndPoint ip, int ms)
  17.     {
  18.         Debug.Log(ms);
  19.     }
  20. }

TCP: 6192
UDP: 6193

I tried both, but with no effect.

14
TNet 3 Support / Gameserver doesnt connect to Lobby Server
« on: January 03, 2015, 06:23:44 PM »
Hi,

i have a problem with the newest version.

My Gameserver doesnt connect to the lobby server.
This is my code: http://i.imgur.com/STOsjCe.png

I create a new gameserver, connect to masterserver, start the gameserver and create an channel.

In the old version 1.9.5c, but not now, what should i do, to get it working?

15
TNet 3 Support / Possible to make an Instance with TNet?
« on: August 25, 2014, 02:20:25 AM »
Hi Guys,

i wanted to make a Game with Dungeon Instances.
Now my Question is, can i archieve Instances with T-net?
Should i do it channels?

If yes, i want to make an dedicated Server with Unity Logic.
How can i build in every custom generated channel a player with the hosting tag, automatically?

Edit: I figured out, how to create a Player when a Channel will be created, but now i need to combine this with an Prefab to put some scripts on it.
On the CreateChannel() function in the GameServer.cs just put this line SendJoinChannel(new TcpPlayer(), channel); after channel is created, correct?

Edit2: Ok, if i create as an Player an Channel, im not host anymore, but my autom. generated player doesnt send data.

I put this on my player prefab:
  1.         void Update () {
  2.         if (TNManager.isHosting)
  3.         {
  4.             tno.SendQuickly(22, Target.All);
  5.         }
  6.         }
  7.  
  8.     [RFC(22)]
  9.     void test()
  10.     {
  11.         Debug.Log("Test");
  12.     }

And normaly it should work, but i doenst.

Do you can tell me, how to generate an automatic "Player" to make the channel authoritative?

Pages: [1] 2