Beispiel #1
0
        ////////////////

        protected override void ReceiveWithServer(int from_who)
        {
            var mymod   = WormholesMod.Instance;
            var myworld = mymod.GetModWorld <WormholesWorld>();
            var mngr    = myworld.Wormholes;

            var link = mngr.GetLinkById(this.Id);

            mngr.Reroll(link);

            WormholeUpdateProtocol.BroadcastToClients(this.Id);
        }
        protected override void ReceiveOnServer(int fromWho)
        {
            var mymod   = WormholesMod.Instance;
            var myworld = ModContent.GetInstance <WormholesWorld>();
            var mngr    = myworld.Wormholes;

            var link = mngr.GetLinkById(this.ID);

            mngr.Reroll(link);

            WormholeUpdateProtocol.BroadcastToClients(this.ID);
        }
Beispiel #3
0
        public static void BroadcastToClients(string id)
        {
            var mymod   = WormholesMod.Instance;
            var myworld = mymod.GetModWorld <WormholesWorld>();

            WormholeLink link = myworld.Wormholes.GetLinkById(id);

            if (link == null)
            {
                LogHelpers.Log("WormholeUpdateProtocol.BroadcastToClients - Invalid wormhole link id " + id);
                return;
            }

            var protocol = new WormholeUpdateProtocol(id, link.RightPortal.Pos.X, link.RightPortal.Pos.Y, link.LeftPortal.Pos.X, link.LeftPortal.Pos.Y);

            protocol.SendToClient(-1, -1);
        }