예제 #1
0
        public static bool Handle(Models.Entities.Player player, Models.Packets.Message.MessagePacket packet)
        {
            if (player.Guild != null)
            {
                player.Guild.BroadcastMessage(packet);
            }

            return(true);
        }
예제 #2
0
 /// <summary>
 /// Broadcasts a message packet.
 /// </summary>
 /// <param name="message">The message packet.</param>
 public void BroadcastMessage(Models.Packets.Message.MessagePacket message)
 {
     foreach (var member in GetMembers())
     {
         if (member.Online)
         {
             member.Player.ClientSocket.Send(message);
         }
     }
 }
예제 #3
0
        public static bool Handle(Models.Entities.Player player, Models.Packets.Message.MessagePacket packet)
        {
            if (player.TournamentTeam != null)
            {
                foreach (var member in player.TournamentTeam.Members.Values)
                {
                    if (member.ClientId != player.ClientId)
                    {
                        member.ClientSocket.Send(packet);
                    }
                }
            }
            else if (player.Team != null)
            {
                foreach (var teamMember in player.Team.GetMembers())
                {
                    teamMember.ClientSocket.Send(packet);
                }
            }

            return(true);
        }
예제 #4
0
        public static bool Handle(Models.Entities.Player player, Models.Packets.Message.MessagePacket packet)
        {
            if (packet.To == player.Name)
            {
                return(true);
            }

            var whisperPlayer = Collections.PlayerCollection.GetPlayerByName(packet.To);

            if (whisperPlayer != null)
            {
                packet.FromMesh = player.Mesh;
                packet.ToMesh   = whisperPlayer.Mesh;

                whisperPlayer.ClientSocket.Send(packet);
            }
            else
            {
                player.SendFormattedSystemMessage("PLAYER_NOT_FOUND_WHISPER", false, packet.To);

                if (Database.Dal.Players.GetPlayerByName(packet.To, Drivers.Settings.WorldSettings.Server) != null)
                {
                    var dbWhisper = (new Database.Models.DbWhisper
                    {
                        From = player.Name,
                        To = packet.To,
                        Message = packet.Message,
                        Mesh = player.Mesh,
                        Server = Drivers.Settings.WorldSettings.Server
                    })
                                    .Create();
                }
            }

            return(true);
        }
예제 #5
0
 public static bool Handle(Models.Entities.Player player, Models.Packets.Message.MessagePacket packet)
 {
     player.UpdateScreen(false, packet);
     return(true);
 }