Esempio n. 1
0
        public void SendErrorMessage(string message)
        {
            _isError = true;

            GamePacketWriter join = new GamePacketWriter(StocMessage.JoinGame);
            join.Write(0U);
            join.Write((byte)0);
            join.Write((byte)0);
            join.Write(false);
            join.Write(false);
            join.Write(false);
            // C++ padding: 5 bytes + 3 bytes = 8 bytes
            for (int i = 0; i < 3; i++)
                join.Write((byte)0);
            join.Write(8000);
            join.Write(5);
            join.Write(1);
            join.Write(0);
            Send(join);

            GamePacketWriter packet = new GamePacketWriter(StocMessage.TypeChange);
            packet.Write((byte)(0));
            Send(packet);

            GamePacketWriter enter = new GamePacketWriter(StocMessage.HsPlayerEnter);
            enter.Write("[Error occurred]:", 20);
            enter.Write((byte)0);
            Send(enter);

            enter = new GamePacketWriter(StocMessage.HsPlayerEnter);
            enter.Write(message, 20);
            enter.Write((byte)1);
            Send(enter);
        }
Esempio n. 2
0
 public void Chat(string message)
 {
     byte[] content = Encoding.Unicode.GetBytes(message + "\0");
     GamePacketWriter chat = new GamePacketWriter(CtosMessage.Chat);
     chat.Write(content);
     Connection.Send(chat);
 }
Esempio n. 3
0
        public void Start()
        {
            Connection = new CoreClient(_serverHost, _serverPort);
            Connection.MessageReceived += OnMessageReceived;

            _behavior = new GameBehavior(this);

            GamePacketWriter packet = new GamePacketWriter(CtosMessage.PlayerInfo);
            packet.Write(Username, 20);
            Connection.Send(packet);

            byte[] junk = { 0xCC, 0xCC, 0x00, 0x00, 0x00, 0x00 };
            packet = new GamePacketWriter(CtosMessage.JoinGame);
            packet.Write(Program.ProVersion);
            packet.Write(junk);
            packet.Write(_roomInfos, 30);
            Connection.Send(packet);
        }
Esempio n. 4
0
        private void OnSelectPlace(GamePacketReader packet)
        {
            packet.ReadByte(); // player
            packet.ReadByte(); // min
            int field = ~packet.ReadInt32();

            byte[] resp = new byte[3];

            bool pendulumZone = false;

            int filter;
            if ((field & 0x1f) != 0)
            {
                resp[0] = (byte)GetLocalPlayer(0);
                resp[1] = 0x4;
                filter = field & 0x1f;
            }
            else if ((field & 0x1f00) != 0)
            {
                resp[0] = (byte)GetLocalPlayer(0);
                resp[1] = 0x8;
                filter = (field >> 8) & 0x1f;
            }
            else if ((field & 0xc000) != 0)
            {
                resp[0] = (byte)GetLocalPlayer(0);
                resp[1] = 0x8;
                filter = (field >> 14) & 0x3;
                pendulumZone = true;
            }
            else if ((field & 0x1f0000) != 0)
            {
                resp[0] = (byte)GetLocalPlayer(1);
                resp[1] = 0x4;
                filter = (field >> 16) & 0x1f;
            }
            else if ((field & 0x1f000000) != 0)
            {
                resp[0] = (byte) GetLocalPlayer(1);
                resp[1] = 0x8;
                filter = (field >> 24) & 0x1f;
            }
            else
            {
                resp[0] = (byte) GetLocalPlayer(1);
                resp[1] = 0x8;
                filter = (field >> 30) & 0x3;
                pendulumZone = true;
            }

            if (!pendulumZone)
            {
                if ((filter & 0x4) != 0) resp[2] = 2;
                else if ((filter & 0x2) != 0) resp[2] = 1;
                else if ((filter & 0x8) != 0) resp[2] = 3;
                else if ((filter & 0x1) != 0) resp[2] = 0;
                else if ((filter & 0x10) != 0) resp[2] = 4;
            }
            else
            {
                if ((filter & 0x1) != 0) resp[2] = 6;
                if ((filter & 0x2) != 0) resp[2] = 7;
            }

            GamePacketWriter reply = new GamePacketWriter(CtosMessage.Response);
            reply.Write(resp);
            Connection.Send(reply);
        }
Esempio n. 5
0
        private void InternalOnSelectCard(GamePacketReader packet, Func<IList<ClientCard>, int, int, bool, IList<ClientCard>> func)
        {
            packet.ReadByte(); // player
            bool cancelable = packet.ReadByte() != 0;
            int min = packet.ReadByte();
            int max = packet.ReadByte();

            IList<ClientCard> cards = new List<ClientCard>();
            int count = packet.ReadByte();
            for (int i = 0; i < count; ++i)
            {
                int id = packet.ReadInt32();
                int player = GetLocalPlayer(packet.ReadByte());
                CardLocation loc = (CardLocation)packet.ReadByte();
                int seq = packet.ReadByte();
                packet.ReadByte(); // pos
                ClientCard card;
                if (((int)loc & (int)CardLocation.Overlay) != 0)
                    card = new ClientCard(id, CardLocation.Overlay);
                else
                    card = _duel.GetCard(player, loc, seq);
                if (card == null) continue;
                if (card.Id == 0)
                    card.SetId(id);
                cards.Add(card);
            }

            IList<ClientCard> selected = func(cards, min, max, cancelable);

            if (selected.Count == 0 && cancelable)
            {
                Connection.Send(CtosMessage.Response, -1);
                return;
            }

            byte[] result = new byte[selected.Count + 1];
            result[0] = (byte)selected.Count;
            for (int i = 0; i < selected.Count; ++i)
            {
                int id = 0;
                for (int j = 0; j < count; ++j)
                {
                    if (cards[j] == null) continue;
                    if (cards[j].Equals(selected[i]))
                    {
                        id = j;
                        break;
                    }
                }
                result[i + 1] = (byte)id;
            }

            GamePacketWriter reply = new GamePacketWriter(CtosMessage.Response);
            reply.Write(result);
            Connection.Send(reply);
        }
Esempio n. 6
0
 private void OnJoinGame(GamePacketReader packet)
 {
     GamePacketWriter deck = new GamePacketWriter(CtosMessage.UpdateDeck);
     deck.Write(Deck.Cards.Count + Deck.ExtraCards.Count);
     deck.Write(Deck.SideCards.Count);
     foreach (NamedCard card in Deck.Cards)
         deck.Write(card.Id);
     foreach (NamedCard card in Deck.ExtraCards)
         deck.Write(card.Id);
     foreach (NamedCard card in Deck.SideCards)
         deck.Write(card.Id);
     Connection.Send(deck);
 }
Esempio n. 7
0
 public void WaitForResponse(int player)
 {
     _lastresponse = player;
     CurPlayers[player].State = PlayerState.Response;
     SendToAllBut(GamePacketFactory.Create(GameMessage.Waiting), player);
     TimeStart();
     GamePacketWriter packet = new GamePacketWriter(StocMessage.TimeLimit);
     packet.Write((byte)player);
     packet.Write((byte)0); // C++ padding
     packet.Write((short)_timelimit[player]);
     SendToPlayers(packet);
 }
Esempio n. 8
0
        public void SetReady(Player player, bool ready)
        {
            if (State != GameState.Lobby)
                return;
            if (player.Type == (int)PlayerType.Observer)
                return;
            if (IsReady[player.Type] == ready)
                return;

            if (ready)
            {
                int rule = Config.GetInt("Rule");
                bool ocg = rule == 0 || rule == 2;
                bool tcg = rule == 1 || rule == 2;
                int result = 1;
                if (player.Deck != null)
                {
                    result = Config.GetBool("NoCheckDeck") ? 0 : player.Deck.Check(Banlist, ocg, tcg);
                }
                if (result != 0)
                {
                    GamePacketWriter rechange = new GamePacketWriter(StocMessage.HsPlayerChange);
                    rechange.Write((byte)((player.Type << 4) + (int)(PlayerChange.NotReady)));
                    player.Send(rechange);
                    GamePacketWriter error = new GamePacketWriter(StocMessage.ErrorMsg);
                    error.Write((byte)2); // ErrorMsg.DeckError
                    // C++ padding: 1 byte + 3 bytes = 4 bytes
                    for (int i = 0; i < 3; i++)
                        error.Write((byte)0);
                    error.Write(result);
                    player.Send(error);
                    return;
                }
            }

            IsReady[player.Type] = ready;

            GamePacketWriter change = new GamePacketWriter(StocMessage.HsPlayerChange);
            change.Write((byte)((player.Type << 4) + (int)(ready ? PlayerChange.Ready : PlayerChange.NotReady)));
            SendToAll(change);

            if (OnPlayerReady != null)
            {
                OnPlayerReady(this, new PlayerEventArgs(player));
            }
        }
Esempio n. 9
0
 public void Chat(Player player, string msg)
 {
     GamePacketWriter packet = new GamePacketWriter(StocMessage.Chat);
     packet.Write((short)player.Type);
     if (player.Type == (int)PlayerType.Observer)
     {
         string fullmsg = "[" + player.Name + "]: " + msg;
         CustomMessage(player, fullmsg);
     }
     else
     {
         packet.Write(msg, msg.Length + 1);
         SendToAllBut(packet, player);
     }
     if (OnPlayerChat != null)
     {
         OnPlayerChat(this, new PlayerChatEventArgs(player, msg));
     }
 }
Esempio n. 10
0
 private void SendDuelingPlayers(Player player)
 {
     for (int i = 0; i < Players.Length; i++)
     {
         GamePacketWriter enter = new GamePacketWriter(StocMessage.HsPlayerEnter);
         int id = i;
         if (_swapped)
         {
             if (IsTag)
             {
                 if (i == 0 || id == 1)
                     id = i + 2;
                 else
                     id = i - 2;
             }
             else
                 id = 1 - i;
         }
         enter.Write(Players[id].Name, 20);
         enter.Write((byte)i);
         //padding
         enter.Write((byte)0);
         player.Send(enter);
     }
 }
Esempio n. 11
0
        private void SendJoinGame(Player player)
        {
            GamePacketWriter join = new GamePacketWriter(StocMessage.JoinGame);
            join.Write(Banlist == null ? 0U : Banlist.Hash);
            join.Write((byte)Config.GetInt("Rule"));
            join.Write((byte)Config.GetInt("Mode"));
            join.Write(Config.GetBool("EnablePriority"));
            join.Write(Config.GetBool("NoCheckDeck"));
            join.Write(Config.GetBool("NoShuffleDeck"));
            // C++ padding: 5 bytes + 3 bytes = 8 bytes
            for (int i = 0; i < 3; i++)
                join.Write((byte)0);
            join.Write(Config.GetInt("StartLp", DEFAULT_LIFEPOINTS));
            join.Write((byte)Config.GetInt("StartHand", DEFAULT_START_HAND));
            join.Write((byte)Config.GetInt("DrawCount", DEFAULT_DRAW_COUNT));
            join.Write((short)Config.GetInt("GameTimer", DEFAULT_TIMER));
            player.Send(join);

            if (State != GameState.Lobby)
                SendDuelingPlayers(player);
        }
Esempio n. 12
0
 private void SendHand()
 {
     RpsTimer = DateTime.UtcNow;
     GamePacketWriter hand = new GamePacketWriter(StocMessage.SelectHand);
     if (IsTag)
     {
         Players[0].Send(hand);
         Players[2].Send(hand);
     }
     else
         SendToPlayers(hand);
 }
Esempio n. 13
0
 public void SendToAllBut(GamePacketWriter packet, Player except)
 {
     foreach (Player player in Players)
         if (player != null && !player.Equals(except))
             player.Send(packet);
     foreach (Player player in Observers)
         if (!player.Equals(except))
             player.Send(packet);
 }
Esempio n. 14
0
 public void SendToAll(GamePacketWriter packet)
 {
     SendToPlayers(packet);
     SendToObservers(packet);
 }
Esempio n. 15
0
        public void MoveToDuelist(Player player)
        {
            if (State != GameState.Lobby)
                return;
            int pos = GetAvailablePlayerPos();
            if (pos == -1)
                return;

            int oldType = player.Type;

            if (player.Type != (int)PlayerType.Observer)
            {
                if (!IsTag || IsReady[player.Type])
                    return;

                pos = (player.Type + 1) % 4;
                while (Players[pos] != null)
                    pos = (pos + 1) % 4;

                GamePacketWriter change = new GamePacketWriter(StocMessage.HsPlayerChange);
                change.Write((byte)((player.Type << 4) + pos));
                SendToAll(change);

                Players[player.Type] = null;
                Players[pos] = player;
                player.Type = pos;
                player.SendTypeChange();
            }
            else
            {
                Observers.Remove(player);
                Players[pos] = player;
                player.Type = pos;

                GamePacketWriter enter = new GamePacketWriter(StocMessage.HsPlayerEnter);
                enter.Write(player.Name, 20);
                enter.Write((byte)pos);
                //padding
                enter.Write((byte)0);
                SendToAll(enter);

                GamePacketWriter nwatch = new GamePacketWriter(StocMessage.HsWatchChange);
                nwatch.Write((short)Observers.Count);
                SendToAll(nwatch);

                player.SendTypeChange();
            }
            if (OnPlayerMove != null)
            {
                OnPlayerMove(this, new PlayerMoveEventArgs(player, oldType));
            }
        }
Esempio n. 16
0
 public void SendToAllBut(GamePacketWriter packet, int except)
 {
     if(except < CurPlayers.Length)
         SendToAllBut(packet, CurPlayers[except]);
     else
         SendToAll(packet);
 }
Esempio n. 17
0
        public void MoveToObserver(Player player)
        {
            if (State != GameState.Lobby)
                return;
            if (player.Type == (int)PlayerType.Observer)
                return;
            if (IsReady[player.Type])
                return;

            int oldType = player.Type;

            Players[player.Type] = null;
            IsReady[player.Type] = false;
            Observers.Add(player);

            GamePacketWriter change = new GamePacketWriter(StocMessage.HsPlayerChange);
            change.Write((byte)((player.Type << 4) + (int)PlayerChange.Observe));
            SendToAll(change);

            player.Type = (int)PlayerType.Observer;
            player.SendTypeChange();

            if (OnPlayerMove != null)
            {
                OnPlayerMove(this, new PlayerMoveEventArgs(player, oldType));
            }
        }
Esempio n. 18
0
        private void HandleError(string error)
        {
            GamePacketWriter packet = new GamePacketWriter(StocMessage.Chat);
            packet.Write((short)PlayerType.Observer);
            packet.Write(error, error.Length + 1);
            SendToAll(packet);

            File.WriteAllText("lua_" + DateTime.UtcNow.ToString("yyyy-MM-dd_HH-mm-ss") + ".txt", error);
        }
Esempio n. 19
0
 public void CustomMessage(Player player, string msg)
 {
     string finalmsg = msg;
     GamePacketWriter packet = new GamePacketWriter(StocMessage.Chat);
     packet.Write((short)PlayerType.Yellow);
     packet.Write(finalmsg, finalmsg.Length + 1);
     SendToAllBut(packet, player);
 }
Esempio n. 20
0
 public void SendToPlayers(GamePacketWriter packet)
 {
     foreach (Player player in Players)
         if (player != null)
             player.Send(packet);
 }
Esempio n. 21
0
        public void HandResult(Player player, int result)
        {
            if (State != GameState.Hand)
                return;
            if (player.Type == (int)PlayerType.Observer)
                return;
            if (result < 1 || result > 3)
                return;
            if (IsTag && player.Type != 0 && player.Type != 2)
                return;
            int type = player.Type;
            if (IsTag && player.Type == 2)
                type = 1;
            if (_handResult[type] != 0)
                return;
            _handResult[type] = result;
            if (_handResult[0] != 0 && _handResult[1] != 0)
            {
                GamePacketWriter packet = new GamePacketWriter(StocMessage.HandResult);
                packet.Write((byte)_handResult[0]);
                packet.Write((byte)_handResult[1]);
                SendToTeam(packet, 0);
                SendToObservers(packet);

                packet = new GamePacketWriter(StocMessage.HandResult);
                packet.Write((byte)_handResult[1]);
                packet.Write((byte)_handResult[0]);
                SendToTeam(packet, 1);

                if (_handResult[0] == _handResult[1])
                {
                    _handResult[0] = 0;
                    _handResult[1] = 0;
                    SendHand();
                    return;
                }
                if ((_handResult[0] == 1 && _handResult[1] == 2) ||
                    (_handResult[0] == 2 && _handResult[1] == 3) ||
                    (_handResult[0] == 3 && _handResult[1] == 1))
                    _startplayer = IsTag ? 2 : 1;
                else
                    _startplayer = 0;
                State = GameState.Starting;
                Players[_startplayer].Send(new GamePacketWriter(StocMessage.SelectTp));
                TpTimer = DateTime.UtcNow;
            }
        }
Esempio n. 22
0
 public void SendToObservers(GamePacketWriter packet)
 {
     foreach (Player player in Observers)
         player.Send(packet);
 }
Esempio n. 23
0
        public void EndDuel(bool force)
        {
            if (State == GameState.End)
            {
                return;
            }

            if (State == GameState.Duel)
            {
                if (!Replay.Disabled)
                {
                    Replay.End();
                    byte[] replayData = Replay.GetContent();
                    GamePacketWriter packet = new GamePacketWriter(StocMessage.Replay);
                    packet.Write(replayData);
                    SendToAll(packet);
                }

                _duel.End();
            }

            if (_swapped)
            {
                _swapped = false;
                if (IsTag)
                {
                    Player temp = Players[0];
                    Players[0] = Players[2];
                    Players[2] = temp;

                    temp = Players[1];
                    Players[1] = Players[3];
                    Players[3] = temp;

                    Players[0].Type = 0;
                    Players[1].Type = 1;
                    Players[2].Type = 2;
                    Players[3].Type = 3;
                }
                else
                {
                    Player temp = Players[0];
                    Players[0] = Players[1];
                    Players[1] = temp;
                    Players[0].Type = 0;
                    Players[1].Type = 1;
                }
            }

            if (IsMatch && !force && !MatchIsEnd())
            {
                IsReady[0] = false;
                IsReady[1] = false;
                State = GameState.Side;
                SideTimer = DateTime.UtcNow;
                SendToPlayers(new GamePacketWriter(StocMessage.ChangeSide));
                SendToObservers(new GamePacketWriter(StocMessage.WaitingSide));
            }
            else
            {
                CalculateWinner();
                End();
            }
        }
Esempio n. 24
0
 public void SendToTeam(GamePacketWriter packet, int team)
 {
     if (!IsTag)
         Players[team].Send(packet);
     else if (team == 0)
     {
         Players[0].Send(packet);
         Players[1].Send(packet);
     }
     else
     {
         Players[2].Send(packet);
         Players[3].Send(packet);
     }
 }
Esempio n. 25
0
 private void OnChainSorting(GamePacketReader packet)
 {
     GamePacketWriter writer = new GamePacketWriter(CtosMessage.Response);
     Connection.Send(CtosMessage.Response, -1);
 }
Esempio n. 26
0
        public void AddPlayer(Player player)
        {
            if (State != GameState.Lobby)
            {
                player.Type = (int)PlayerType.Observer;
                if (State != GameState.End)
                {
                    SendJoinGame(player);
                    player.SendTypeChange();
                    player.Send(new GamePacketWriter(StocMessage.DuelStart));
                    Observers.Add(player);
                    if (State == GameState.Duel)
                        InitNewSpectator(player);
                }
                if (OnPlayerJoin != null)
                {
                    OnPlayerJoin(this, new PlayerEventArgs(player));
                }
                return;
            }

            if (HostPlayer == null)
                HostPlayer = player;

            int pos = GetAvailablePlayerPos();
            if (pos != -1)
            {
                GamePacketWriter enter = new GamePacketWriter(StocMessage.HsPlayerEnter);
                enter.Write(player.Name, 20);
                enter.Write((byte)pos);
                //padding
                enter.Write((byte)0);
                SendToAll(enter);

                Players[pos] = player;
                IsReady[pos] = false;
                player.Type = pos;
            }
            else
            {
                GamePacketWriter watch = new GamePacketWriter(StocMessage.HsWatchChange);
                watch.Write((short)(Observers.Count + 1));
                SendToAll(watch);

                player.Type = (int)PlayerType.Observer;
                Observers.Add(player);
            }

            SendJoinGame(player);
            player.SendTypeChange();

            for (int i = 0; i < Players.Length; i++)
            {
                if (Players[i] != null)
                {
                    GamePacketWriter enter = new GamePacketWriter(StocMessage.HsPlayerEnter);
                    enter.Write(Players[i].Name, 20);
                    enter.Write((byte)i);
                    //padding
                    enter.Write((byte)0);
                    player.Send(enter);

                    if (IsReady[i])
                    {
                        GamePacketWriter change = new GamePacketWriter(StocMessage.HsPlayerChange);
                        change.Write((byte)((i << 4) + (int)PlayerChange.Ready));
                        player.Send(change);
                    }
                }
            }

            if (Observers.Count > 0)
            {
                GamePacketWriter nwatch = new GamePacketWriter(StocMessage.HsWatchChange);
                nwatch.Write((short)Observers.Count);
                player.Send(nwatch);
            }

            if (OnPlayerJoin != null)
            {
                OnPlayerJoin(this, new PlayerEventArgs(player));
            }
        }
Esempio n. 27
0
        private void OnSelectCounter(GamePacketReader packet)
        {
            packet.ReadByte(); // player
            int type = packet.ReadInt16();
            int quantity = packet.ReadByte();

            IList<ClientCard> cards = new List<ClientCard>();
            IList<int> counters = new List<int>();
            int count = packet.ReadByte();
            for (int i = 0; i < count; ++i)
            {
                packet.ReadInt32(); // card id
                int player = GetLocalPlayer(packet.ReadByte());
                CardLocation loc = (CardLocation) packet.ReadByte();
                int seq = packet.ReadByte();
                int num = packet.ReadByte();
                cards.Add(_duel.GetCard(player, loc, seq));
                counters.Add(num);
            }

            IList<int> used = _ai.OnSelectCounter(type, quantity, cards, counters);
            byte[] result = new byte[used.Count];
            for (int i = 0; i < quantity; ++i)
                result[i] = (byte) used[i];
            GamePacketWriter reply = new GamePacketWriter(CtosMessage.Response);
            reply.Write(result);
            Connection.Send(reply);
        }
Esempio n. 28
0
        public void RemovePlayer(Player player)
        {
            if (player.Equals(HostPlayer) && State == GameState.Lobby)
            {
                _server.Stop();
                return;
            }

            if (player.Type == (int)PlayerType.Observer)
            {
                Observers.Remove(player);
                if (State == GameState.Lobby)
                {
                    GamePacketWriter nwatch = new GamePacketWriter(StocMessage.HsWatchChange);
                    nwatch.Write((short) Observers.Count);
                    SendToAll(nwatch);
                }
                player.Disconnect();
            }
            else if (State == GameState.Lobby)
            {
                Players[player.Type] = null;
                IsReady[player.Type] = false;
                GamePacketWriter change = new GamePacketWriter(StocMessage.HsPlayerChange);
                change.Write((byte)((player.Type << 4) + (int) PlayerChange.Leave));
                SendToAll(change);
                player.Disconnect();
            }
            else
                Surrender(player, 4, true);

            if (OnPlayerLeave != null)
            {
                OnPlayerLeave(this, new PlayerEventArgs(player));
            }
        }
Esempio n. 29
0
        private void OnSelectSum(GamePacketReader packet)
        {
            packet.ReadByte(); // mode
            packet.ReadByte(); // player
            int sumval = packet.ReadInt32();
            int min = packet.ReadByte();
            int max = packet.ReadByte();

            // TODO mandatory cards
            int count = packet.ReadByte();
            packet.ReadBytes(count * 11);

            IList<ClientCard> cards = new List<ClientCard>();
            count = packet.ReadByte();
            for (int i = 0; i < count; ++i)
            {
                int cardId = packet.ReadInt32();
                int player = GetLocalPlayer(packet.ReadByte());
                CardLocation loc = (CardLocation)packet.ReadByte();
                int seq = packet.ReadByte();
                ClientCard card = _duel.GetCard(player, loc, seq);
                if (card != null)
                {
                    if (cardId != 0 && card.Id != cardId)
                        card.SetId(cardId);
                    cards.Add(card);
                }
                packet.ReadInt32();
            }

            IList<ClientCard> selected = _ai.OnSelectSum(cards, sumval, min, max);

            byte[] result = new byte[selected.Count + 1];
            result[0] = (byte)selected.Count;
            for (int i = 0; i < selected.Count; ++i)
            {
                int id = 0;
                for (int j = 0; j < count; ++j)
                {
                    if (cards[j] == null) continue;
                    if (cards[j].Equals(selected[i]))
                    {
                        id = j;
                        break;
                    }
                }
                result[i + 1] = (byte)id;
            }

            GamePacketWriter reply = new GamePacketWriter(CtosMessage.Response);
            reply.Write(result);
            Connection.Send(reply);
        }
Esempio n. 30
0
 public void SendTypeChange()
 {
     GamePacketWriter packet = new GamePacketWriter(StocMessage.TypeChange);
     packet.Write((byte)(Type + (Game.HostPlayer.Equals(this) ? (int)PlayerType.Host : 0)));
     Send(packet);
 }