private bool HandleClientEventLobbyEquipmentUpdated(
            NetworkCommunicator peer,
            RequestTroopIndexChange message)
        {
            MissionPeer component = peer.GetComponent <MissionPeer>();

            if (component == null)
            {
                return(false);
            }
            SpawnComponent missionBehaviour = this.Mission.GetMissionBehaviour <SpawnComponent>();

            if (missionBehaviour == null)
            {
                return(false);
            }
            if (missionBehaviour.AreAgentsSpawning() && component.SelectedTroopIndex != message.SelectedTroopIndex)
            {
                component.SelectedTroopIndex = message.SelectedTroopIndex;
                GameNetwork.BeginBroadcastModuleEvent();
                GameNetwork.WriteMessage((GameNetworkMessage) new UpdateSelectedTroopIndex(peer, message.SelectedTroopIndex));
                GameNetwork.EndBroadcastModuleEvent(GameNetwork.EventBroadcastFlags.ExcludeOtherTeamPlayers, peer);
                if (this.OnEquipmentRefreshed != null)
                {
                    this.OnEquipmentRefreshed(component);
                }
            }
            return(true);
        }
        private bool HandleClientEventRequestPerkChange(
            NetworkCommunicator peer,
            RequestPerkChange message)
        {
            MissionPeer component = peer.GetComponent <MissionPeer>();

            if (component == null)
            {
                return(false);
            }
            SpawnComponent missionBehaviour = this.Mission.GetMissionBehaviour <SpawnComponent>();

            if (missionBehaviour == null)
            {
                return(false);
            }
            if (component.SelectPerk(message.PerkListIndex, message.PerkIndex) && missionBehaviour.AreAgentsSpawning() && this.OnEquipmentRefreshed != null)
            {
                this.OnEquipmentRefreshed(component);
            }
            return(true);
        }