Question by
awaken1988 · Jul 12, 2016 at 11:47 AM ·
networkingchat
Reusing existing NetworkClient for NetworkMessage
Hello Dudes,
I want to use the NetworkMessage in the HLAPI for sending messges to Server. Under the following link there a a nice example of using it: https://docs.unity3d.com/Manual/UNetMessages.html
In the first example a NetworkClient object is used to send a msg from client to server. My question is how do I get such a NetworkClient object. The second example shows how to create a new NetworkClient but I want to reuse the existing Connections.
As far I have seen there is a NetworkClient.allClients which list 2 connection on my client. But why they are 2 connections on the client? Are there better methods to get the current connection?
The following example is working (without the GUI part): PlayerScript.cs
playerscriptcs.txt
(1.5 kB)
Comment