rust/hedgewars-server/src/core/server.rs
changeset 15527 428a0e7da27b
parent 15526 24f692e791d3
child 15529 cc774c6e933e
--- a/rust/hedgewars-server/src/core/server.rs	Tue Dec 24 21:45:26 2019 +0300
+++ b/rust/hedgewars-server/src/core/server.rs	Tue Dec 24 21:57:55 2019 +0300
@@ -1032,6 +1032,17 @@
             None
         }
     }
+
+    pub fn log_engine_msg(&mut self, log_msg: String, sync_msg: Option<Option<String>>) {
+        if let Some(ref mut info) = self.room_mut().game_info {
+            if !log_msg.is_empty() {
+                info.msg_log.push(log_msg);
+            }
+            if let Some(msg) = sync_msg {
+                info.sync_msg = msg;
+            }
+        }
+    }
 }
 
 fn allocate_room(rooms: &mut Slab<HwRoom>) -> &mut HwRoom {