private void OnGuildAdmin(NetConnection <NetSession> sender, GuildAdminRequest request)
        {
            Character character = sender.Session.Character;

            Log.InfoFormat("OnGuildAdmin:TragetID[{0}]", request.Target);
            sender.Session.Response.guildAdmin = new GuildAdminResponse();
            //权限检验 是否有公会 可以多加几个检验
            if (character.Guild == null)
            {
                sender.Session.Response.guildAdmin          = new GuildAdminResponse();
                sender.Session.Response.guildAdmin.Result   = Result.Failed;
                sender.Session.Response.guildAdmin.Errormsg = "你没公会不要乱来";
                sender.SendResponse();
                return;
            }

            character.Guild.ExecuteAdmin(request.Command, request.Target, character.Id);

            var target = SessionManager.Instance.GetSession(request.Target);

            if (target != null)
            {
                target.Session.Response.guildAdmin         = new GuildAdminResponse();
                target.Session.Response.guildAdmin.Result  = Result.Success;
                target.Session.Response.guildAdmin.Command = request;
                target.SendResponse();
            }
            sender.Session.Response.guildAdmin.Result  = Result.Success;
            sender.Session.Response.guildAdmin.Command = request;
            sender.SendResponse();
        }
Пример #2
0
        private void OnGuildAdmin(NetConnection <NetSession> sender, GuildAdminRequest message)
        {
            Character character = sender.Session.Character;

            Log.InfoFormat("OnGuildAdmin:: character:{0}", character.Id);

            sender.Session.Response.guildAdmin = new GuildAdminResponse();
            if (character.Guild == null)
            {
                sender.Session.Response.guildAdmin.Result   = Result.Failed;
                sender.Session.Response.guildAdmin.Errormsg = "你没有工会不要乱来";
                sender.SendResponse();
            }
            character.Guild.ExecuteAdmin(message.Command, message.Target, character.Id);
            var target = SessionManager.Instance.GetSession(message.Target);

            if (target != null)
            {
                target.Session.Response.guildAdmin         = new GuildAdminResponse();
                target.Session.Response.guildAdmin.Result  = Result.Success;
                target.Session.Response.guildAdmin.Command = message;
                target.SendResponse();
            }
            sender.Session.Response.guildAdmin.Result  = Result.Success;
            sender.Session.Response.guildAdmin.Command = message;
            sender.SendResponse();
        }