Ejemplo n.º 1
0
        public static void SendChatToUniverse(Player.Player from, string chat)
        {
            var rdl = new Rdl();

            rdl.AddTRA(0xFFFFFF00, 0xFFFFFFFF);
            rdl.AddText(from.Name + ": ");
            rdl.AddTRA(0x7C7C7C00, 0xFFFFFFFF);
            rdl.AddText(chat);
            foreach (var play in from.Runner.Playerlist)
            {
                SendChatToPlayer(play.Value.Player, rdl);
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Sends text to everyone in system.
        /// </summary>
        /// <param name="from"></param>
        /// <param name="chat"></param>
        public static void SendChatToSystem(Player.Player from, string chat)
        {
            var rdl = new Rdl();

            rdl.AddTRA(0xFFFFFF00, 0xFFFFFFFF);
            rdl.AddText(from.Name + ": ");
            rdl.AddTRA(0xFFE95700, 0xFFFFFFFF);
            rdl.AddText(chat);
            foreach (var play in @from.Runner.Players.Where(play => play.Value.Ship.System == @from.Ship.System))
            {
                SendChatToPlayer(play.Value, rdl);
            }
        }
Ejemplo n.º 3
0
        private static void SendChatToPrivate(Player.Player from, uint to, string chat)
        {
            if (from.Runner.Playerlist.ContainsKey(to))
            {
                Player.Player toplayer = from.Runner.Playerlist[to].Player;

                var rdl = new Rdl();
                rdl.AddTRA(0xFFFFFF00, 0xFFFFFFFF);
                rdl.AddText(from.Name + ": ");
                rdl.AddTRA(0x19BD3A00, 0xFFFFFFFF);
                rdl.AddText(chat);
                SendChatToPlayer(from, rdl);
                SendChatToPlayer(toplayer, rdl);
            }
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Sends text to everyone in scanrange.
        /// </summary>
        /// <param name="from"></param>
        /// <param name="chat"></param>
        public static void SendChatToLocal(Player.Player from, string chat)
        {
            var rdl = new Rdl();

            rdl.AddTRA(0xFFFFFF00, 0xFFFFFFFF);
            rdl.AddText(from.Name + ": ");
            rdl.AddTRA(0xFF8F4000, 0xFFFFFFFF);
            rdl.AddText(chat);
            var bu = new List <SimObject>(from.Ship.ScanBucket);

            foreach (var ship in @bu.OfType <Ship.Ship>().Where(ship => ship.player != null && ship.player != from))
            {
                SendChatToPlayer(ship.player, rdl);
            }
            SendChatToPlayer(from, rdl);
        }
Ejemplo n.º 5
0
        public static void SendDeathMessage(Player.Player from, DeathCause cause)
        {
            if (!from.Ship.IsDestroyed)
            {
                //universe
                var rdl = new Rdl();
                rdl.AddTRA(0x19198C00, 0xFFFFFFFF);
                rdl.AddText(from.Name + " died. Type: " + cause);

                var rdlSystem = new Rdl();
                rdlSystem.AddTRA(0x0062FF01, 0xFFFFFFFF);
                rdlSystem.AddText(from.Name + " died. Type: " + cause);

                foreach (var player in from.Runner.Playerlist)
                {
                    if (player.Value.Player.Settings[@"senddeath"] && player.Value.System != from.Ship.System)
                    {
                        SendChatToPlayer(player.Value.Player, rdl);
                    }

                    if (player.Value.Player.Settings[@"sendsystemdeath"] && player.Value.System == from.Ship.System)
                    {
                        SendChatToPlayer(player.Value.Player, rdlSystem);
                    }
                }
            }
        }
Ejemplo n.º 6
0
        public static void SendEcho(Player.Player player, string chat)
        {
            var rdl = new Rdl();

            rdl.AddTRA(0x05FF3802, 0xFFFFFFFF);
            rdl.AddText(chat);
            SendChatToPlayer(player, rdl);
        }
Ejemplo n.º 7
0
        public static void SendChatToGroup(Player.Player from, string chat)
        {
            if (from.Group == null)
            {
                return;
            }

            var rdl = new Rdl();

            rdl.AddTRA(0xFFFFFF00, 0xFFFFFFFF);
            rdl.AddText(from.Name + ": ");
            rdl.AddTRA(0xFF7BFF00, 0xFFFFFFFF);
            rdl.AddText(chat);

            foreach (Player.Player toplayer in from.Group.Members)
            {
                SendChatToPlayer(toplayer, rdl);
            }
        }