public static bool ReleaseLock(LockDefinition lockDef) { if (LockQuery.LockExists(lockDef) && LockQuery.GetLock(lockDef.Type, lockDef.PlayerName, lockDef.VesselId) .PlayerName == lockDef.PlayerName) { LockStore.RemoveLock(lockDef); return(true); } return(false); }
public static bool ReleaseLock(LockDefinition lockDef) { if (LockQuery.LockBelongsToPlayer(lockDef.Type, lockDef.VesselId, lockDef.KerbalName, lockDef.PlayerName)) { LockStore.RemoveLock(lockDef); return(true); } return(false); }
/// <summary> /// Release the specified lock by sending a message to the server. /// </summary> /// <param name="lockDefinition">The definition of the lock to release</param> private void ReleaseLock(LockDefinition lockDefinition) { var msgData = NetworkMain.CliMsgFactory.CreateNewMessageData <LockReleaseMsgData>(); msgData.Lock.CopyFrom(lockDefinition); LockStore.RemoveLock(lockDefinition); LockEvent.onLockRelease.Fire(lockDefinition); MessageSender.SendMessage(msgData); }