Example #1
0
        public void OnBanchoRequest(ref List <BanchoPacket> plist)
        {
            for (var i = 0; i < plist.Count; i++)
            {
                BanchoPacket packet = plist[i];
                switch (packet.Type)
                {
                case PacketType.ClientChatMessagePublic:
                case PacketType.ClientChatMessagePrivate:
                    BanchoChatMessage msg = new BanchoChatMessage();
                    msg.Populate(packet.Data);
                    if (msg.Message.StartsWith(CommandPrefix)) //check if this message is a command for us
                    {
                        plist.RemoveAt(i);                     //remove this packet from packet list
                        HandleCommand(msg);                    //do stuff w/ it
                    }
                    break;

                case PacketType.ClientMultiScoreUpdate:
                    if (_mpScoreSpam)
                    {
                        var score = new BanchoScoreFrame();
                        score.Populate(packet.Data);
                        _mss.ModifyScorePacket(ref score);
                        plist[i].Data = score.Serialize();
                    }
                    break;

                case PacketType.ClientUserStatus:
                    if (_customAction)
                    {
                        var status = new BanchoUserStatus();
                        status.Populate(packet.Data);
                        status.Action     = BanchoAction.Submitting;
                        status.ActionText = "totally legit scores";
                        plist[i].Data     = status.Serialize();
                    }
                    break;

                case PacketType.ClientSpectateData:
                    if (_spectateCorrupt)
                    {
                        var frames = new BanchoReplayFrameBundle();
                        frames.Populate(packet.Data);
                        SpectatorCorrupter.ModifySpectatePacket(ref frames);
                        plist[i].Data = frames.Serialize();
                    }
                    break;
                }
            }

            while (_packetQueueSend.Count != 0)
            {
                plist.Add(_packetQueueSend.Dequeue());
            }
        }
Example #2
0
        public void ModifyScorePacket(ref BanchoScoreFrame s)
        {
            s.Count300  = (ushort)(_high ? 10000 : 0);
            s.CountMiss = (ushort)(_high ? 0 : 10000);
            s.Count100  = 0;
            s.Count50   = 0;

            s.CurrentHp    = _high ? 200 : 0;
            s.CurrentCombo = (ushort)(_high ? 1337 : 0);
            s.TotalScore   = _high ? Int32.MaxValue : -1;

            s.CountGeki = ushort.MaxValue;
            s.CountKatu = ushort.MaxValue;

            s.Id++;

            _high = !_high;
        }