private void ReceiveObservingEntitiesResponse(byte[] body) { Log.Trace("Receiving Observing Entities Response", "ReceiveObservingEntitiesResponse"); Log.Trace("body size is " + body.Count(), "ReceiveObservingEntitiesResponse"); ObservingEntitiesResponse response = ObservingEntitiesResponse.FromBytes(body); Session.ObservingEntities = response.ObservingEntities; String result = Session.ObservingEntities.Count + " Observing Entities:\n\n"; int i = 1; foreach (ObservingEntity e in Session.ObservingEntities) { // Ids result += i + ": \"" + e.ObservationDetails() + "\n"; i++; } Notification notice = new WindowNotification() { Text = result, BigLabel = "Garden Performance", SmallLabel = "Observing Entities" }; notice.Raise(); }
private void ReceiveObservingEntitiesRequest(byte[] body, ulong senderId) { Log.Trace("Receiving Observing Entities Request", "ReceiveObservingEntitiesRequest"); // nothing to read, but doing this anyway to test ObservingEntitiesRequest request = ObservingEntitiesRequest.FromBytes(body); // Convert them to just observing form ObservingEntitiesResponse response = new ObservingEntitiesResponse() { ObservingEntities = Session.Manager.Revealed.ObservingEntitiesList() }; response.SendToPlayer(senderId); }