79 #ifdef CODELOCKCOMPONENT_LOG
98 int pinLength = pin.
Length();
105 #ifdef CODELOCKCOMPONENT_LOG
117 int pinLength = pin.
Length();
125 #ifdef CODELOCKCOMPONENT_LOG
137 #ifdef CODELOCKCOMPONENT_LOG
195 parentIB.StartItemSoundServer(SoundConstants.ITEM_DIGITAL_LOCK_LOCK);
199 parentIB.StartItemSoundServer(SoundConstants.ITEM_DIGITAL_LOCK_UNLOCK);
207 #ifdef CODELOCKCOMPONENT_LOG
216 #ifdef CODELOCKCOMPONENT_LOG
223 if (!building || !building.CanUseConstruction())
225 #ifdef CODELOCKCOMPONENT_LOG
233 #ifdef CODELOCKCOMPONENT_LOG
243 #ifdef CODELOCKCOMPONENT_LOG
251 #ifdef CODELOCKCOMPONENT_LOG
279 #ifdef CODELOCKCOMPONENT_LOG
289 #ifdef CODELOCKCOMPONENT_LOG
303 #ifdef CODELOCKCOMPONENT_LOG
322 #ifdef CODELOCKCOMPONENT_LOG
329 case CodeLockUIAction.CLEAR_INPUT:
331 parentIB.StartItemSoundClient(SoundConstants.ITEM_DIGITAL_LOCK_CLEAR_INPUT);
334 case CodeLockUIAction.CONFIRM_INPUT:
336 parentIB.StartItemSoundClient(SoundConstants.ITEM_DIGITAL_LOCK_CONFIRM_INPUT);
339 case CodeLockUIAction.DIGIT_INPUT:
341 parentIB.StartItemSoundClient(SoundConstants.ITEM_DIGITAL_LOCK_DIGIT_INPUT);
364 #ifdef CODELOCKCOMPONENT_LOG
381 parentIB.StartItemSoundServer(SoundConstants.ITEM_DIGITAL_LOCK_ERROR);
395 if (
g_Game.IsDedicatedServer())
407 Param1<bool> response =
new Param1<bool>(success);
449 if (
g_Game.IsDedicatedServer())
560 case ERPCs.RPC_CODE_LOCK_REQUEST:
562 Param1<string> code =
new Param1<string>(
"");
566 string dialedCode = code.param1;
571 case ERPCs.RPC_CODE_LOCK_RESPONSE:
573 Param1<bool> response =
new Param1<bool>(
false);
574 if (!ctx.
Read(response))
580 bool codeResponse = response.param1;
586 case ERPCs.RPC_CODE_LOCK_UI_ACTION:
588 Param1<int> action =
new Param1<int>(CodeLockUIAction.NONE);
589 if (!ctx.
Read(action))
592 CodeLockUIAction uiAction = action.param1;
593 if (uiAction != CodeLockUIAction.NONE)
618 if (
g_Game.IsDedicatedServer())
void OnRPC(PlayerIdentity sender, int rpcType, ParamsReadContext ctx)
void CheckBruteForceReset()
void CheckCodeRequest(string pin, PlayerIdentity identity)
float m_BruteForceResetTime
void ResetUIActionServer()
CodeLockUIAction m_UIAction
void SetStage(CodeLockStage stage)
void CheckUIActionClient()
void CheckUIActionServer(CodeLockUIAction uiAction)
bool ValidatePIN(string pin)
float m_BruteForceProtectionTime
bool m_HasBruteForceProtection
enum CodeLockStage CONFIRM_INPUT
ref Timer m_BruteForceUpdateTimer
void ActivateBruteForceProtection(float protectionTime, float protectionResetTime)
bool ShouldTriggerProtectionStage()
bool SetInputCode(string pin, bool force=true)
void HandleHierarchyRootLock(bool state)
void SetMinimalPinCodeLength(int length)
void OnParentDetached(bool sync=true)
bool SetLockCode(string pin, bool sync=true)
void HandleBruteForceProtectionServer()
void CodeLockComponent(notnull EntityAI parent, int minLockPinLength=MIN_LOCK_PIN_LENGTH)
ref Timer m_BruteForceResetTimer
bool HasBruteForceProtection()
void OnParentReset(bool sync=true)
enum CodeLockStage CLEAR_INPUT
enum CodeLockStage MIN_LOCK_PIN_LENGTH
bool OnStoreLoad(ParamsReadContext ctx, int version)
void SetLockState(bool state, bool sync=true)
bool ShouldHandleBruteForce()
CodeLockUIAction GetUIAction()
void SetDoorIndex(int index)
void OnStoreSave(ParamsWriteContext ctx)
int GetMinLockPINLength()
const float DEFAULT_BRUTEFORCE_RESET_TIME
const float DEFAULT_BRUTEFORCE_TIME
void CheckBruteForceState()
const int MAX_LOCK_PIN_LENGTH
void UpdateParentVisuals()
bool m_HandleBruteForceProtection
proto native void LockDoor(int index, bool force=false)
Locks the door if not already locked, resets the door health. 'force = true' will close the door if o...
proto native int GetDoorCount()
Returns the number of the doors in the building.
proto native void UnlockDoor(int index, bool animate=true)
Unlocks the door if locked, AJAR animation optional.
static float GetExternalLockProtectionResetTime()
static float GetExternalLockProtectionCountStageTwo()
static float GetExternalLockProtectionTime()
static float GetExternalLockProtectionCountStageOne()
Super root of all classes in Enforce script.
const string SELECTION_INTERACT
override vector GetPosition()
used on static objects
CodeLockVisualManager GetVisualManager()
void CodeResponse(bool response)
The class that will be instanced (moddable)
proto bool Write(void value_out)
proto bool Read(void value_in)
Serializer ParamsReadContext
Serializer ParamsWriteContext
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.
@ NONE
body is not in simulation, nor in collision world
vector GetPosition()
Get the world position of the Effect.
proto native int Length()
Returns length of string.