Surrender() public method

public Surrender ( Player player, int reason, bool force = false ) : void
player Player
reason int
force bool
return void
コード例 #1
0
        public void Parse(BinaryReader packet)
        {
            CtosMessage msg = (CtosMessage)packet.ReadByte();

            switch (msg)
            {
            case CtosMessage.PlayerInfo:
                OnPlayerInfo(packet);
                break;

            case CtosMessage.JoinGame:
                OnJoinGame(packet);
                break;

            case CtosMessage.CreateGame:
                OnCreateGame(packet);
                break;
            }
            if (!IsAuthentified)
            {
                return;
            }
            switch (msg)
            {
            case CtosMessage.Chat:
                OnChat(packet);
                break;

            case CtosMessage.HsToDuelist:
                Game.MoveToDuelist(this);
                break;

            case CtosMessage.HsToObserver:
                Game.MoveToObserver(this);
                break;

            case CtosMessage.LeaveGame:
                Game.RemovePlayer(this);
                break;

            case CtosMessage.HsReady:
                Game.SetReady(this, true);
                break;

            case CtosMessage.HsNotReady:
                Game.SetReady(this, false);
                break;

            case CtosMessage.HsKick:
                OnKick(packet);
                break;

            case CtosMessage.HsStart:
                Game.StartDuel(this);
                break;

            case CtosMessage.HandResult:
                OnHandResult(packet);
                break;

            case CtosMessage.TpResult:
                OnTpResult(packet);
                break;

            case CtosMessage.UpdateDeck:
                OnUpdateDeck(packet);
                break;

            case CtosMessage.Response:
                OnResponse(packet);
                break;

            case CtosMessage.Surrender:
                Game.Surrender(this, 0);
                break;
            }
        }