示例#1
0
    private void UpdateClientWithOtherObjectState(TcpClient client)
    {
        try
        {
            if (client.Connected)
            {
                var gameObjectsInView = sim.GetObjectsInViewOfTank(GetTokenFromEndpoint(client));

                foreach (GameObjectState s in gameObjectsInView)
                {
                    SendMessage(client, MessageFactory.CreateObjectUpdateMessage(JsonUtility.ToJson(s)));
                }
            }
        }
        catch (Exception ex)
        {
            Debug.LogException(ex);
        }
    }