示例#1
0
        public static void GridOfferBought(MarketListing NewOffer, ulong Buyer)
        {
            if (!NexusSupport.RunningNexus)
            {
                return;
            }

            string Title = "Hangar Market - Offer Purchased";



            if (!MySession.Static.Players.TryGetIdentityFromSteamID(NewOffer.SteamID, out MyIdentity Seller))
            {
                return;
            }


            if (!MySession.Static.Players.TryGetIdentityFromSteamID(NewOffer.SteamID, out MyIdentity BuyerIdentity))
            {
                return;
            }



            var    Fac      = MySession.Static.Factions.GetPlayerFaction(Seller.IdentityId);
            var    BuyerFac = MySession.Static.Factions.GetPlayerFaction(BuyerIdentity.IdentityId);
            string Footer;

            if (Fac != null)
            {
                Footer = $"Seller: [{Fac.Tag}] {Seller.DisplayName}";
            }
            else
            {
                Footer = $"Seller: {Seller.DisplayName}";
            }



            StringBuilder Msg = new StringBuilder();

            if (BuyerFac != null)
            {
                Msg.AppendLine($"Grid {NewOffer.Name} was purchased by [{BuyerFac.Tag}] {BuyerIdentity.DisplayName} for {NewOffer.Price}sc!");
            }
            else
            {
                Msg.AppendLine($"Grid {NewOffer.Name} was purchased by {BuyerIdentity.DisplayName} for {NewOffer.Price}sc!");
            }


            NexusAPI.SendEmbedMessageToDiscord(Hangar.Config.MarketUpdateChannel, Title, Msg.ToString(), Footer, "#FFFF00");
        }
示例#2
0
        /* Following are for discord status messages */
        public static void NewGridOfferListed(MarketListing NewOffer)
        {
            if (!NexusSupport.RunningNexus)
            {
                return;
            }


            string Title = "Hangar Market - New Offer";


            StringBuilder Msg = new StringBuilder();

            Msg.AppendLine($"GridName: {NewOffer.Name}");
            Msg.AppendLine($"Price: {NewOffer.Price}sc");
            Msg.AppendLine($"PCU: {NewOffer.PCU}");
            Msg.AppendLine($"Mass: {NewOffer.GridMass}kg");
            Msg.AppendLine($"Jump Distance: {NewOffer.JumpDistance}m");
            Msg.AppendLine($"Number Of Blocks: {NewOffer.NumberofBlocks}");
            Msg.AppendLine($"PowerOutput: {NewOffer.MaxPowerOutput / 1000}kW");
            Msg.AppendLine($"Built-Percent: {NewOffer.GridBuiltPercent * 100}%");
            Msg.AppendLine($"Total Grids: {NewOffer.NumberOfGrids}");
            Msg.AppendLine($"Static Grids: {NewOffer.StaticGrids}");
            Msg.AppendLine($"Large Grids: {NewOffer.LargeGrids}");
            Msg.AppendLine($"Small Grids: {NewOffer.SmallGrids}");


            Msg.AppendLine();
            Msg.AppendLine($"Description: {NewOffer.Description}");

            if (!MySession.Static.Players.TryGetIdentityFromSteamID(NewOffer.SteamID, out MyIdentity Player))
            {
                return;
            }

            var Fac = MySession.Static.Factions.GetPlayerFaction(Player.IdentityId);

            string Footer;

            if (Fac != null)
            {
                Footer = $"Seller: [{Fac.Tag}] {Player.DisplayName}";
            }
            else
            {
                Footer = $"Seller: {Player.DisplayName}";
            }


            NexusAPI.SendEmbedMessageToDiscord(Hangar.Config.MarketUpdateChannel, Title, Msg.ToString(), Footer, "#FFFF00");
        }
示例#3
0
        public static void GirdOfferRemoved(MarketListing NewOffer)
        {
            if (!NexusSupport.RunningNexus)
            {
                return;
            }

            string Title = "Hangar Market - Offer Removed";


            if (!MySession.Static.Players.TryGetIdentityFromSteamID(NewOffer.SteamID, out MyIdentity Player))
            {
                return;
            }

            StringBuilder Msg = new StringBuilder();

            Msg.AppendLine($"Grid {NewOffer.Name} is no longer for sale!");


            var Fac = MySession.Static.Factions.GetPlayerFaction(Player.IdentityId);

            string Footer;

            if (Fac != null)
            {
                Footer = $"Seller: [{Fac.Tag}] {Player.DisplayName}";
            }
            else
            {
                Footer = $"Seller: {Player.DisplayName}";
            }


            NexusAPI.SendEmbedMessageToDiscord(Hangar.Config.MarketUpdateChannel, Title, Msg.ToString(), Footer, "#FFFF00");
        }