Ejemplo n.º 1
0
        public static void sendHatAssignments()
        {
            // Send hat assignments for each player
            foreach (PlayerControl player in PlayerControl.AllPlayerControls)
            {
                uint hatId = hatAssignments[player.PlayerId];

                // Set for host
                if (player.PlayerId == PlayerControl.LocalPlayer.PlayerId)
                {
                    AlternativeRpcSender.RpcSetHat(hatId);
                }

                // Send to other players
                CustomRpcSender.RpcHostSetHat(player.PlayerId, hatId);
            }
        }
Ejemplo n.º 2
0
        // Handling of mod activation / deactivation
        private static void ModActiveValueChanged(object sender, OptionValueChangedEventArgs e)
        {
            // Communicate change to other players
            if (AmongUsClient.Instance.AmHost)
            {
                CustomRpcSender.RpcSetModActive(ModActive.GetValue());
            }

            // Handle it ourselfes
            if (ModActive.GetValue())
            {
                modActivated();
            }
            else
            {
                modDeactivated();
            }
        }
Ejemplo n.º 3
0
        // Handling of skin activation / deactivation
        private static void SkinsAllowed_ValueChanged(object sender, OptionValueChangedEventArgs e)
        {
            // Communicate change to other players
            if (AmongUsClient.Instance.AmHost)
            {
                CustomRpcSender.RpcSetSkinsAllowed(SkinsAllowed.GetValue());
            }

            // Handle it ourselfes
            if (SkinsAllowed.GetValue())
            {
                skinsActivated();
            }
            else
            {
                skinsDeactivated();
            }
        }