Ejemplo n.º 1
0
        private void CollectBoltData()
        {
            ServerStats stats = new ServerStats();

            stats.Fps       = (short)(1.0f / Time.deltaTime);
            stats.Timestamp = Time.time;
            foreach (BoltConnection conn in BoltNetwork.clients)
            {
                ClientStats c = new ClientStats();
                c.IpAddress = conn.RemoteEndPoint.Address.ToString();
                c.Port      = conn.RemoteEndPoint.Port;
                stats.Clients.Add(c);
            }
            this.stats = stats;
        }
 private void receiveCallback(IAsyncResult res)
 {
     byte[] receivedData = client.EndReceive(res, ref server);
     stats = Serializer.Deserialize <ServerStats>(new MemoryStream(receivedData));
 }