Exemplo n.º 1
0
        private static void CreateListInfoForGrid(MyCubeGrid grid, out MyEntityListInfoItem item)
        {
            long   owner     = 0L;
            string ownerName = string.Empty;

            if (grid.BigOwners.Count > 0)
            {
                MyIdentity identity = MySession.Static.Players.TryGetIdentity(grid.BigOwners[0]);
                if (identity != null)
                {
                    ownerName = identity.DisplayName;
                    owner     = grid.BigOwners[0];
                }
            }
            item = new MyEntityListInfoItem(grid.DisplayName, grid.EntityId, grid.BlocksCount, grid.BlocksPCU, grid.Physics.Mass, grid.PositionComp.GetPosition(), grid.Physics.LinearVelocity.Length(), MySession.GetPlayerDistance(grid, MySession.Static.Players.GetOnlinePlayers()), ownerName, owner, MySession.GetOwnerLoginTimeSeconds(grid), MySession.GetOwnerLogoutTimeSeconds(grid));
        }