Exemple #1
0
        public void LoadUserGroups()
        {
            if (!IPCAccessor.Instance.IsConnected)
            {
                throw new Exception("IPC not connected");
            }

            var ev = new ManualResetEvent(false);
            IList <UserGroupData> groups   = null;
            IIPCErrorMessage      errorMsg = null;

            IPCAccessor.Instance.SendRequest <GroupsListMessage>(new GroupsRequestMessage(), reply =>
            {
                groups = reply.Groups;
                ev.Set();
            }, error =>
            {
                errorMsg = error;
                ev.Set();
            });
            ev.WaitOne();

            if (groups == null)
            {
                throw new Exception(string.Format("Cannot load groups : {0}", errorMsg.Message));
            }

            m_userGroups = groups.Select(x => new UserGroup(x)).ToDictionary(x => x.Id, x => x);
        }
Exemple #2
0
        private void DefaultRequestErrorCallback(IIPCErrorMessage errorMessage)
        {
            var request = TryGetRequest(errorMessage.RequestGuid);

            logger.Error("Error received of type {0}. Request {1} Message : {2} StackTrace : {3}",
                         errorMessage.GetType(), request.RequestMessage.GetType(), errorMessage.Message, errorMessage.StackTrace);
        }
Exemple #3
0
        private void OnAccessDenied(IIPCErrorMessage error)
        {
            m_requestingAccess = false;

            AccessGranted = false;
            logger.Error("Access to auth. server denied ! Reason : {0}", error.Message);
            WorldServer.Instance.Shutdown();
        }
Exemple #4
0
 private static void HandleError(IIPCErrorMessage error)
 {
     logger.Error("Error received of type {0}. Message : {1} StackTrace : {2}",
                  error.GetType(), error.Message, error.StackTrace);
 }