예제 #1
0
        public bool ChangeRank(GuildEntity guild, GuildMemberRank operatorRank, GuildMember targetMember, GuildMemberRank toRank)
        {
            Log <GuildAPI> .Logger.InfoFormat("ChangeRank: MemberRank[{0}], MemberSN[{1}], ToRank[{2}]", operatorRank, targetMember.Key.NexonSN, toRank);

            if (toRank == GuildMemberRank.Unknown)
            {
                if (operatorRank.HasSecedePermission(targetMember.Rank, toRank))
                {
                    Log <GuildAPI> .Logger.InfoFormat("UserSecede: ServiceCode[{0}], GuildSN[{1}], MemberNexonSN[{2}]", GuildAPI.ServerCode, guild.GuildSN, targetMember.Key.NexonSN);

                    HeroesGuild.UserSecede(GuildAPI.ServerCode, guild.GuildSN, targetMember.Key.NexonSN, targetMember.Key.CharacterSN, targetMember.Key.CharacterName);
                    using (HeroesDataContext heroesDataContext = new HeroesDataContext())
                    {
                        heroesDataContext.UpdateGuildCharacterInfo(new long?(targetMember.Key.CID), new long?(0L));
                        GuildLog.AddGuildLedger(new LogData((long)guild.GuildSN, targetMember.Key.CID, OperationType.GainGuildPoint, GuildLedgerEventType.UpdateGuildUserPoint, "0", "Secede"));
                    }
                    return(true);
                }
            }
            else if (operatorRank.HasRankChangePermission(targetMember.Rank, toRank))
            {
                Log <GuildAPI> .Logger.InfoFormat("UserTypeModify: ServiceCode[{0}], GuildSN[{1}], MemberNexonSN[{2}]", GuildAPI.ServerCode, guild.GuildSN, targetMember.Key.NexonSN);

                HeroesGuild.UserTypeModify(GuildAPI.ServerCode, guild.GuildSN, targetMember.Key.NexonSN, targetMember.Key.CharacterSN, targetMember.Key.CharacterName, this.ConvertToGroupUserType(toRank.ToGroupUserType()));
                return(true);
            }
            return(false);
        }
예제 #2
0
        public void LeaveGuild(GuildEntity guild, GuildMemberKey key)
        {
            Log <GuildAPI> .Logger.InfoFormat("UserSecede: GuildMemberKey[{0}]", key);

            HeroesGuild.UserSecede(GuildAPI.ServerCode, guild.GuildSN, key.NexonSN, key.CharacterSN, key.CharacterName);
        }