public IEnumerable <PlaneMutableInformation> GetPlanesInfo(Guid playerGuid) { #if DETAILED_LOG LogMessage(string.Format("Planes infos for player with GUID={0}", playerGuid)); #endif //Plane playerPlane = m_playerToPlaneMapping[playerGuid]; List <PlaneMutableInformation> infos = new List <PlaneMutableInformation>(); using (var handle = World.GameObjectsSafeReadHandle) { foreach (Plane plane in handle.Items.Where(o => o is Plane)) { //if (plane != playerPlane) { PlaneMutableInformation planeInfo = new PlaneMutableInformation(plane); infos.Add(planeInfo); #if DETAILED_LOG LogMessage(planeInfo.ToString()); #endif } } } return(infos); }
//public GetNewObjectsResult GetNewObjects(Guid playerGuid, int minId) //{ // GetNewObjectsResult newObjectsResult = new GetNewObjectsResult(); // using (var handle = World.GameObjectsSafeReadHandle) // { // newObjectsResult.Objects = handle.Items.Where(o => o.Id.Value >= minId && !o.IsGarbage).ToList(); // } // if (newObjectsResult.Objects.Count > 0) // LogMessage(string.Format("{0} objects has been sent to player with id={1} (last ID={2})", newObjectsResult.Objects.Count, playerGuid, minId)); // return newObjectsResult; //} public void UpdatePlane(Guid playerGuid, PlaneMutableInformation info) { Plane playerPlane = m_playerToPlaneMapping[playerGuid]; info.ApplyToPlayerPlaneOnServer(playerPlane); }