コード例 #1
0
        public static void SendToAllClients(NecrotisPlayer myplayer)
        {
            if (Main.netMode != NetmodeID.Server)
            {
                throw new ModLibsException("Not a server.");
            }

            var protocol = new PlayerAnimaSyncProtocol(myplayer.player, myplayer.AnimaPercent);

            SimplePacket.SendToClient(protocol, -1, myplayer.player.whoAmI);
        }
コード例 #2
0
        public static void Broadcast(NecrotisPlayer myplayer)
        {
            if (Main.netMode != NetmodeID.MultiplayerClient)
            {
                throw new ModLibsException("Not a client.");
            }

            var payload = new PlayerAnimaSyncProtocol(myplayer.player, myplayer.AnimaPercent);

            SimplePacket.SendToServer(payload);
        }