private void SendPacketToRoom(SendPacket packet, List <Account> players)
 {
     byte[] data = packet.GetCompleteBytes();
     foreach (Account pR in players)
     {
         pR.SendCompletePacket(data);
     }
 }
Example #2
0
 private void SendPacketToRoom(SendPacket packet, List <Account> players)
 {
     byte[] completeBytes = packet.GetCompleteBytes("ROOM_REQUEST_HOST_REC");
     foreach (Account player in players)
     {
         player.SendCompletePacket(completeBytes);
     }
 }
Example #3
0
 public static void SendPacket(SendPacket packet, List <Account> players)
 {
     if (players.Count == 0)
     {
         return;
     }
     byte[] completeBytes = packet.GetCompleteBytes("ClanManager.SendPacket");
     for (int index = 0; index < players.Count; ++index)
     {
         players[index].SendCompletePacket(completeBytes, false);
     }
 }
        public static void SendPacket(SendPacket packet, List <Account> players)
        {
            if (players.Count == 0)
            {
                return;
            }

            byte[] code = packet.GetCompleteBytes();
            for (int i = 0; i < players.Count; i++)
            {
                players[i].SendCompletePacket(code, false);
            }
        }
Example #5
0
        public void SendPacketToWaitPlayers(SendPacket packet)
        {
            List <Account> players = getWaitPlayers();

            if (players.Count == 0)
            {
                return;
            }
            byte[] data = packet.GetCompleteBytes();
            for (int i = 0; i < players.Count; i++)
            {
                players[i].SendCompletePacket(data);
            }
        }
Example #6
0
        public void SendPacketToPlayers(SendPacket packet, int exception)
        {
            List <Account> allPlayers = this.getAllPlayers(exception);

            if (allPlayers.Count == 0)
            {
                return;
            }
            byte[] completeBytes = packet.GetCompleteBytes("Match.SendPacketToPlayers(SendPacket,int)");
            foreach (Account account in allPlayers)
            {
                account.SendCompletePacket(completeBytes);
            }
        }
Example #7
0
        public void SendPacketToWaitPlayers(SendPacket packet)
        {
            List <Account> waitPlayers = this.getWaitPlayers();

            if (waitPlayers.Count == 0)
            {
                return;
            }
            byte[] completeBytes = packet.GetCompleteBytes("Channel.SendPacketToWaitPlayers");
            for (int index = 0; index < waitPlayers.Count; ++index)
            {
                waitPlayers[index].SendCompletePacket(completeBytes);
            }
        }
Example #8
0
        public void SendPacketToPlayers(SendPacket packet, int exception)
        {
            List <Account> players = getAllPlayers(exception);

            if (players.Count == 0)
            {
                return;
            }

            byte[] data = packet.GetCompleteBytes();
            foreach (Account pR in players)
            {
                pR.SendCompletePacket(data);
            }
        }
        public static void SendPacket(SendPacket packet, List <Account> players, long exception)
        {
            if (players.Count == 0)
            {
                return;
            }

            byte[] code = packet.GetCompleteBytes();
            for (int i = 0; i < players.Count; i++)
            {
                Account mb = players[i];
                if (mb.player_id != exception)
                {
                    mb.SendCompletePacket(code, false);
                }
            }
        }
Example #10
0
        public static int SendPacketToAllClients(SendPacket packet)
        {
            int num = 0;

            if (LoginManager._socketList.Count > 0)
            {
                byte[] completeBytes = packet.GetCompleteBytes("GameManager.SendPacketToAllClients");
                foreach (LoginClient loginClient in (IEnumerable <LoginClient>)LoginManager._socketList.Values)
                {
                    Account player = loginClient._player;
                    if (player != null && player._isOnline)
                    {
                        player.SendCompletePacket(completeBytes);
                        ++num;
                    }
                }
            }
            return(num);
        }
        public static int SendPacketToAllClients(SendPacket packet)
        {
            int count = 0;

            if (_socketList.Count == 0)
            {
                return(count);
            }

            byte[] code = packet.GetCompleteBytes();
            foreach (GameClient client in _socketList.Values)
            {
                Account player = client._player;
                if (player != null && player._isOnline)
                {
                    player.SendCompletePacket(code);
                    count++;
                }
            }
            return(count);
        }