Esempio n. 1
0
        public void ClearSlot(MultiplayerSlot slot)
        {
            slot.UserId = -1;
            slot.Status = MultiSlotStatus.Open;
            slot.Team   = MultiSlotTeam.NoTeam;
            slot.Mods   = Mod.None;

            Update();
        }
Esempio n. 2
0
        public void SetSlot(MultiplayerSlot firstslot, MultiplayerSlot secondslot)
        {
            firstslot.UserId = secondslot.UserId;
            firstslot.Status = secondslot.Status;
            firstslot.Team   = secondslot.Team;
            firstslot.Mods   = secondslot.Mods;

            Update();
        }
Esempio n. 3
0
        public void LockSlot(MultiplayerSlot slot)
        {
            if (slot.UserId != -1)
            {
                Leave(slot.UserId);
            }
            slot.Mods = Mod.None;

            slot.Status = slot.Status != MultiSlotStatus.Locked
                ? MultiSlotStatus.Locked
                : MultiSlotStatus.Open;

            slot.Team = MultiSlotTeam.NoTeam;

            Update();
        }
Esempio n. 4
0
        public void SetSlot(int slotId, MultiplayerSlot slot)
        {
            if (slotId > MaxPlayers)
            {
                throw new ArgumentOutOfRangeException();
            }

            var firstslot = Slots[slotId];

            firstslot.UserId = slot.UserId;
            firstslot.Status = slot.Status;
            firstslot.Team   = slot.Team;
            firstslot.Mods   = slot.Mods;

            Update();
        }
Esempio n. 5
0
 public MultiplayerRoom()
 {
     stream  = new PacketStream("multiplayer");
     Channel = new Channel("#multiplayer", "Even more osu! default channels!", stream);
     for (var i = 0; i < MaxPlayers; i++)
     {
         Slots[i] = new MultiplayerSlot
         {
             // ReSharper disable once ConditionalTernaryEqualBranch
             Status = i > 6 ? MultiSlotStatus.Locked : MultiSlotStatus.Locked,
             Mods   = 0,
             Team   = MultiSlotTeam.NoTeam,
             UserId = -1
         }
     }
     ;
 }
Esempio n. 6
0
        public void SetMods(Mod mods, MultiplayerSlot slot)
        {
            if (slot.IsHost(this) && SpecialModes == MatchSpecialModes.Freemods)
            {
                slot.Mods = FixMods(mods);
            }
            else if (SpecialModes == MatchSpecialModes.Freemods)
            {
                slot.Mods = mods;
            }
            else if (slot.IsHost(this) && SpecialModes == MatchSpecialModes.Normal)
            {
                foreach (var s in Slots)
                {
                    slot.Mods = Mod.None;
                }

                ActiveMods = mods;
            }

            Update();
        }