コード例 #1
0
            public static bool RPC_ToggleEnabled(long uid, long playerID, PrivateArea __instance)
            {
                // if using the original interaction behavior then just return true and run the original code
                if (Settings.WardInteractBehavior.Value == Plugin.WardInteractBehavior.Original)
                {
                    return(true);
                }

                ZLog.Log((object)("Toggle enabled from " + playerID + "  creator is " + __instance.m_piece.GetCreator()));
                if (__instance.m_nview.IsOwner() && ((__instance.IsPermitted(playerID) && Settings.WardInteractBehavior.Value == Plugin.WardInteractBehavior.OwnerAndPermitted) || (Settings.WardInteractBehavior.Value == Plugin.WardInteractBehavior.All)))
                {
                    __instance.SetEnabled(!__instance.IsEnabled());
                }

                return(false);
            }