Fix AddTeam message serialization
authoralfadur
Wed, 04 Jul 2018 12:57:05 +0300
changeset 13440 30ee161d85d0
parent 13439 c4f917c6be51
child 13441 d47514fd6c6a
Fix AddTeam message serialization
gameServer2/src/protocol/messages.rs
--- a/gameServer2/src/protocol/messages.rs	Wed Jul 04 04:42:16 2018 +0300
+++ b/gameServer2/src/protocol/messages.rs	Wed Jul 04 12:57:05 2018 +0300
@@ -201,10 +201,11 @@
                 msg!["CFG", name, args.join("\n")]
             },
             AddTeam(info) =>
-                msg![info.name, info.color, info.grave, info.fort,
+                msg!["ADD_TEAM", info.name, info.color, info.grave, info.fort,
                      info.voice_pack, info.flag, info.difficulty,
-                     info.hedgehogs.iter().flat_map(|h|
-                        several![&h.name[..], "\n", &h.hat[..]]).collect::<String>()],
+                     info.hedgehogs.iter()
+                        .flat_map(|h| several![&h.name[..], &h.hat[..]])
+                        .collect::<Vec<_>>().join("\n")],
             RemoveTeam(name) => msg!["REMOVE_TEAM", name],
             SetHedgehogsNumber(team, number) => msg!["HH_NUM", team, number],
             SetTeamColor(team, color) => msg!["TEAM_COLOR", team, color],