コード例 #1
0
        public void LoadUserGroups()
        {
            if (!IPCAccessor.Instance.IsConnected)
            {
                throw new System.Exception("IPC not connected");
            }
            System.Threading.ManualResetEvent ev = new System.Threading.ManualResetEvent(false);
            System.Collections.Generic.IList <UserGroupData> groups = null;
            IPCErrorMessage errorMsg = null;

            IPCAccessor.Instance.SendRequest <GroupsListMessage>(new GroupsRequestMessage(), delegate(GroupsListMessage reply)
            {
                groups = reply.Groups;
                ev.Set();
            }, delegate(IPCErrorMessage error)
            {
                errorMsg = error;
                ev.Set();
            });
            ev.WaitOne();
            if (groups == null)
            {
                throw new System.Exception(string.Format("Cannot load groups : {0}", errorMsg.Message));
            }
            this.m_userGroups = (
                from x in groups
                select new UserGroup(x, base.Database.Query <UserGroupCommand>(string.Format(UserGroupCommandRelator.FetchById, x.Id), new object[0]).ToArray <UserGroupCommand>())).ToDictionary((UserGroup x) => x.Id, (UserGroup x) => x);
        }
コード例 #2
0
 private void OnAccessDenied(IPCErrorMessage error)
 {
     this.m_requestingAccess = false;
     if (!(error is IPCErrorTimeoutMessage))
     {
         this.AccessGranted = false;
         IPCAccessor.logger.Error("Access to auth. server denied ! Reason : {0}", error.Message);
         ServerBase <WorldServer> .Instance.Shutdown();
     }
 }
コード例 #3
0
 private void HandleError(IPCErrorMessage error)
 {
     IPCAccessor.logger.Error <System.Type, string, string>("Error received of type {0}. Message : {1} StackTrace : {2}", error.GetType(), error.Message, error.StackTrace);
 }