public void OnBanchoMatchChangeSlot(BanchoMatchChangeSlotArgs args)
        {
            if (args.pr.JoinedRoom == null)
            {
                return;
            }
            if (args.SlotId > 16)
            {
                return;
            }
            var newSlot = args.pr.JoinedRoom.Slots[args.SlotId];

            if (newSlot.UserId != -1)
            {
                return;
            }

            var oldSlot = args.pr.JoinedRoom.GetSlotByUserId(args.pr.User.Id);

            args.pr.JoinedRoom.SetSlot(newSlot, oldSlot);
            args.pr.JoinedRoom.ClearSlot(oldSlot);
        }
Example #2
0
        public void OnBanchoMatchChangeSlot(BanchoMatchChangeSlotArgs args)
        {
            var match = args.Pr.ActiveMatch;

            if (match == null ||
                args.SlotId > 16)
            {
                return;
            }

            var newSlot = match.Slots[args.SlotId];

            if (newSlot.UserId != -1)
            {
                return;
            }

            var oldSlot = match.GetSlotByUserId(args.Pr.User.Id);

            match.SetSlot(newSlot, oldSlot);
            match.ClearSlot(oldSlot);
            match.Update();
        }