コード例 #1
0
ファイル: PlatformGuildAPI.cs プロジェクト: ratiel/Vindictus
        public bool AcceptJoin(GuildEntity guild, GuildMemberRank operatorRank, GuildMember targetMember, bool accept)
        {
            Log <GuildAPI> .Logger.InfoFormat("AcceptJoin: GuildMemberRank[{0}]", operatorRank);

            if (!operatorRank.HasAcceptJoinPermission(targetMember.Rank))
            {
                return(false);
            }
            if (accept)
            {
                Log <GuildAPI> .Logger.InfoFormat("UserJoinApply: GuildSN[{0}], NexonSN[{1}], CharacterSN[{2}], CharacterName[{3}]", new object[]
                {
                    guild.GuildSN,
                    targetMember.Key.NexonSN,
                    targetMember.Key.CharacterSN,
                    targetMember.Key.CharacterName
                });

                HeroesGuild.UserJoinApply(GuildAPI.ServerCode, guild.GuildSN, targetMember.Key.NexonSN, targetMember.Key.CharacterSN, targetMember.Key.CharacterName);
                return(true);
            }
            Log <GuildAPI> .Logger.InfoFormat("UserJoinReject: GuildSN[{0}], NexonSN[{1}], CharacterSN[{2}], CharacterName[{3}]", new object[]
            {
                guild.GuildSN,
                targetMember.Key.NexonSN,
                targetMember.Key.CharacterSN,
                targetMember.Key.CharacterName
            });

            HeroesGuild.UserJoinReject(GuildAPI.ServerCode, guild.GuildSN, targetMember.Key.NexonSN, targetMember.Key.CharacterSN, targetMember.Key.CharacterName);
            return(true);
        }
コード例 #2
0
        public bool AcceptJoin(GuildEntity guild, GuildMemberRank operatorRank, GuildMember targetMember, bool accept)
        {
            int num = -1;

            try
            {
                if (operatorRank.HasAcceptJoinPermission(targetMember.Rank))
                {
                    HeroesGuildDBDataContext heroesGuildDBDataContext = new HeroesGuildDBDataContext();
                    if (accept)
                    {
                        num = heroesGuildDBDataContext.GuildUserJoinApply(new int?(GuildAPI.ServerCode), new int?(guild.GuildSN), new int?(targetMember.Key.NexonSN), new long?((long)targetMember.Key.CharacterSN), targetMember.Key.CharacterName);
                    }
                    else
                    {
                        num = heroesGuildDBDataContext.GuildUserJoinReject(new int?(GuildAPI.ServerCode), new int?(guild.GuildSN), new int?(targetMember.Key.NexonSN), new long?((long)targetMember.Key.CharacterSN), targetMember.Key.CharacterName);
                    }
                }
            }
            catch (Exception ex)
            {
                Log <HeroesGuildAPI> .Logger.Error("Error in AcceptJoin(GuildEntity guild, GuildMemberRank operatorRank, GuildMember targetMember, bool accept)", ex);
            }
            GuildLedgerEventType eventType;

            if (num == 0)
            {
                eventType = GuildLedgerEventType.Success;
            }
            else
            {
                eventType = GuildLedgerEventType.DatabaseFail;
            }
            GuildLog.AddGuildLedger(new LogData((long)guild.GuildSN, targetMember.Key.CID, OperationType.HeroesCore_ResponseJoin, eventType, string.Format("GuildSn: {0}, isAccept: {1}", guild.GuildSN, accept.ToString()), targetMember.Key.ToString()));
            return(num == 0);
        }