Skip to content

Commit

Permalink
Change to be generic permission check
Browse files Browse the repository at this point in the history
  • Loading branch information
Hazado committed Aug 10, 2023
1 parent 471494a commit c27cd77
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions Scripts/Python/xSimpleImager.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
ImagerClueObject = ptAttribSceneobject(11, "Imager Object (for puzzle clue)")
ImagerClueTime = ptAttribInt(12, "Number of seconds until clue image shows",default=870)
ImagerRandomTime = ptAttribInt(13, "Random number added to make timer more variable",default=0)
ImagerPelletCheckVariable = ptAttribString(14,"Pellet upload SDL variable (optional)")
ImagerPermissionCheck = ptAttribString(14,"Imager upload SDL variable (optional)")
#----------
# globals
#----------
Expand Down Expand Up @@ -299,7 +299,7 @@ def OnNotify(self,state,id,events):
for event in events:
if event[0] == kCollisionEvent:
kiLevel = PtDetermineKILevel()
if (kiLevel < kNormalKI or not self.PelletUploadCheck()):
if (kiLevel < kNormalKI or not self.PermissionCheck()):
return
if ImagerPelletUpload.value:
messagetoki = str(ImagerName.value) + "<p>"
Expand Down Expand Up @@ -523,17 +523,17 @@ def OnSDLNotify(self,VARname,SDLname,playerID,tag):
else:
ageVault.setDeviceInbox(ImagerName.value, ageSDL[ImagerInboxVariable.value][0], self, kSettingDeviceInbox)

def PelletUploadCheck(self):
"""Age SDL Check to prevent unwanted pellet drops"""
def PermissionCheck(self):
"""Age SDL Check to prevent unwanted access to imager"""
ageSDL = PtGetAgeSDL()
pelletCheck = 0
if ImagerPelletCheckVariable.value:
pelletCheck = ageSDL[ImagerPelletCheckVariable.value][0]
if pelletCheck >= 2: # Locked for everyone
permissionCheck = 0
if ImagerPermissionCheck.value:
permissionCheck = ageSDL[ImagerPermissionCheck.value][0]
if permissionCheck >= 2: # Locked for everyone
return False
elif pelletCheck == 1 and ptVault().amOwnerOfCurrentAge(): #Hood members only
elif permissionCheck == 1 and ptVault().amOwnerOfCurrentAge(): #Hood members only
return True
elif pelletCheck <= 0: # Anyone
elif permissionCheck <= 0: # Anyone
return True

def OnBackdoorMsg(self, target, param):
Expand Down

0 comments on commit c27cd77

Please sign in to comment.