public static void SendLockAquireMessage(LockDefinition lockDefinition, bool force) { var lockResult = LockSystem.AcquireLock(lockDefinition, force); var newMessageData = new LockAcquireMsgData { Lock = lockDefinition, LockResult = lockResult, Force = force }; MessageQueuer.SendToAllClients <LockSrvMsg>(newMessageData); LunaLog.Debug(lockResult ? $"{lockDefinition.PlayerName} acquired lock {lockDefinition}" : $"{lockDefinition.PlayerName} failed to acquire lock {lockDefinition}"); }
public static void SendLockAquireMessage(string lockName, string playerName, bool force) { var lockResult = LockSystem.AcquireLock(lockName, playerName, force); var newMessageData = new LockAcquireMsgData { PlayerName = playerName, LockName = lockName, LockResult = lockResult, Force = force }; MessageQueuer.SendToAllClients <LockSrvMsg>(newMessageData); LunaLog.Debug(lockResult ? $"{playerName} acquired lock {lockName}" : $"{playerName} failed to acquire lock {lockName}"); }
public static void ReleaseAndSendLockReleaseMessage(LockDefinition lockDefinition) { var lockResult = LockSystem.ReleaseLock(lockDefinition); if (lockResult) { var newMessageData = new LockReleaseMsgData { Lock = lockDefinition, LockResult = true }; MessageQueuer.SendToAllClients <LockSrvMsg>(newMessageData); LunaLog.Debug($"{lockDefinition.PlayerName} released lock {lockDefinition}"); } else { LunaLog.Debug($"{lockDefinition.PlayerName} failed to release lock {lockDefinition}"); } }
public static void SendLockReleaseMessage(string lockName, string playerName) { var lockResult = LockSystem.ReleaseLock(lockName, playerName); if (lockResult) { var newMessageData = new LockReleaseMsgData { PlayerName = playerName, LockName = lockName, LockResult = true }; MessageQueuer.SendToAllClients <LockSrvMsg>(newMessageData); LunaLog.Debug(playerName + " released lock " + lockName); } else { LunaLog.Debug(playerName + " failed to release lock " + lockName); } }
public static void SendAllLocks(ClientStructure client) { MessageQueuer.SendToClient <LockSrvMsg>(client, new LockListReplyMsgData { Locks = LockSystem.GetLockList().ToArray() }); }