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); }
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); }