예제 #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);
        }