rust/hedgewars-server/src/server/handlers/inroom.rs
changeset 14785 a1077e8d26f4
parent 14784 8390d5e4e39c
child 14788 6dea1ca64992
--- a/rust/hedgewars-server/src/server/handlers/inroom.rs	Wed Apr 10 19:30:08 2019 +0300
+++ b/rust/hedgewars-server/src/server/handlers/inroom.rs	Wed Apr 10 23:56:53 2019 +0300
@@ -191,7 +191,7 @@
                 super::common::start_game(server, room_id, response);
             }
         }
-        AddTeam(info) => {
+        AddTeam(mut info) => {
             if room.teams.len() >= room.team_limit as usize {
                 response.add(Warning("Too many teams!".to_string()).send_self());
             } else if room.addable_hedgehogs() == 0 {
@@ -211,12 +211,13 @@
                         .send_self(),
                 );
             } else {
+                info.owner = client.nick.clone();
                 let team = room.add_team(client.id, *info, client.protocol_number < 42);
                 client.teams_in_game += 1;
                 client.clan = Some(team.color);
                 response.add(TeamAccepted(team.name.clone()).send_self());
                 response.add(
-                    TeamAdd(HWRoom::team_info(&client, team))
+                    TeamAdd(team.to_protocol())
                         .send_all()
                         .in_room(room_id)
                         .but_self(),
@@ -337,6 +338,7 @@
             );
             room.save_config(name, location);
         }
+        #[cfg(feature = "official-server")]
         SaveRoom(filename) => {
             if client.is_admin() {
                 match room.get_saves() {
@@ -355,6 +357,7 @@
                 }
             }
         }
+        #[cfg(feature = "official-server")]
         LoadRoom(filename) => {
             if client.is_admin() {
                 response.request_io(super::IoTask::LoadRoom { room_id, filename });