Пример #1
0
        public void ChangeSettings(MultiplayerRoom room)
        {
            MatchType    = room.MatchType;
            ActiveMods   = room.ActiveMods;
            Name         = room.Name;
            BeatmapName  = room.BeatmapName;
            BeatmapId    = room.BeatmapId;
            BeatmapMd5   = room.BeatmapMd5;
            HostId       = room.HostId;
            PlayMode     = room.PlayMode;
            ScoringType  = room.ScoringType;
            TeamType     = room.TeamType;
            SpecialModes = room.SpecialModes;
            Seed         = room.Seed;

            SetMods(ActiveMods, GetSlotByUserId(HostId));
            Update();
        }
Пример #2
0
        public void ReadFromStream(MStreamReader sr)
        {
            MatchId     = sr.ReadInt16();
            InProgress  = sr.ReadBoolean();
            MatchType   = (MatchType)sr.ReadByte();
            ActiveMods  = (Mod)sr.ReadUInt32();
            Name        = sr.ReadString();
            Password    = sr.ReadString();
            BeatmapName = sr.ReadString();
            BeatmapId   = sr.ReadInt32();
            BeatmapMd5  = sr.ReadString();

            for (var i = 0; i < MaxPlayers; i++)
            {
                Slots[i].Status = (MultiSlotStatus)sr.ReadByte();
            }

            for (var i = 0; i < MaxPlayers; i++)
            {
                Slots[i].Team = (MultiSlotTeam)sr.ReadByte();
            }

            for (var i = 0; i < MaxPlayers; i++)
            {
                Slots[i].UserId = (Slots[i].Status & (MultiSlotStatus)124) > 0 ? sr.ReadInt32() : -1;
            }

            HostId       = sr.ReadInt32();
            PlayMode     = (PlayMode)sr.ReadByte();
            ScoringType  = (ScoringType)sr.ReadByte();
            TeamType     = (TeamType)sr.ReadByte();
            SpecialModes = (MatchSpecialModes)sr.ReadByte();

            if (SpecialModes == MatchSpecialModes.Freemods)
            {
                for (var i = 0; i < MaxPlayers; i++)
                {
                    Slots[i].Mods = (Mod)sr.ReadUInt32();
                }
            }

            Seed = sr.ReadInt32();
        }
Пример #3
0
        public void ChangeSettings(Match room)
        {
            MatchType    = room.MatchType;
            Name         = room.Name;
            BeatmapName  = room.BeatmapName;
            BeatmapId    = room.BeatmapId;
            BeatmapMd5   = room.BeatmapMd5;
            HostId       = room.HostId;
            PlayMode     = room.PlayMode;
            ScoringType  = room.ScoringType;
            TeamType     = room.TeamType;
            Seed         = room.Seed;
            SpecialModes = room.SpecialModes;
            ActiveMods   = room.ActiveMods;

            if (SpecialModes == MatchSpecialModes.Normal)
            {
                SetMods(ActiveMods, GetSlotByUserId(HostId));
            }
        }