/// <summary> /// Requests client permission level /// </summary> /// <param name="key"></param> /// <param name="callback"></param> /// <param name="connection"></param> public void RequestPermissionLevel(string key, PermissionLevelCallback callback, IClientSocket connection) { connection.SendMessage((short)MstMessageCodes.PermissionLevelRequest, key, (status, response) => { if (status != ResponseStatus.Success) { callback.Invoke(null, response.AsString("Unknown error")); } CurrentPermissionLevel = response.AsInt(); OnPermissionsLevelChangedEvent?.Invoke(); callback.Invoke(CurrentPermissionLevel, null); }); }
public void RequestPermissionLevel(string key, PermissionLevelCallback callback, ErrorCallback errorCallback) { Client.SendMessage((ushort)OpCodes.RequestPermissionLevel, key, (status, response) => { if (status != ResponseStatus.Success) { errorCallback.Invoke(response.AsString("Unknown error")); } CurrentPermissionLevel = response.AsInt(); PermissionsLevelChanged?.Invoke(); callback.Invoke(CurrentPermissionLevel); }); }
public void RequestPermissionLevel(string key, PermissionLevelCallback callback) { RequestPermissionLevel(key, callback, Connection); }