Example #1
0
        public void LeaveGuild(GuildEntity guild, GuildMemberKey key)
        {
            int num = -1;

            try
            {
                HeroesGuildDBDataContext heroesGuildDBDataContext = new HeroesGuildDBDataContext();
                num = heroesGuildDBDataContext.GuildUserSecede(new int?(GuildAPI.ServerCode), new int?(guild.GuildSN), new int?(key.NexonSN), new long?((long)key.CharacterSN), key.CharacterName);
            }
            catch (Exception ex)
            {
                Log <HeroesGuildAPI> .Logger.Error("Error in LeaveGuild(GuildEntity guild, GuildMemberKey key)", ex);
            }
            if (num == 0)
            {
                GuildLog.AddGuildLedger(new LogData((long)guild.GuildSN, key.CID, OperationType.HeroesCore_LeaveGuild, GuildLedgerEventType.Success, string.Format("GuildSn: {0}, GuildToString: {1}", guild.GuildSN, guild.ToString(), key.ToString())));
                return;
            }
            GuildLog.AddGuildLedger(new LogData((long)guild.GuildSN, key.CID, OperationType.HeroesCore_LeaveGuild, GuildLedgerEventType.DatabaseFail, string.Format("GuildSn: {0}, GuildToString: {1}", guild.GuildSN, guild.ToString(), key.ToString())));
        }
Example #2
0
        public void UserNameModify(GuildMemberKey key, string newName)
        {
            int num = -1;

            try
            {
                HeroesGuildDBDataContext heroesGuildDBDataContext = new HeroesGuildDBDataContext();
                num = heroesGuildDBDataContext.GuildUserNameModify(new int?(GuildAPI.ServerCode), new int?(key.NexonSN), new long?((long)key.CharacterSN), newName);
            }
            catch (Exception ex)
            {
                Log <HeroesGuildAPI> .Logger.Error("Error in UserNameModify(GuildMemberKey key, string newName)", ex);
            }
            if (num == 0)
            {
                GuildLog.AddGuildLedger(new LogData(0L, key.CID, OperationType.HeroesCore_UserNameModify, GuildLedgerEventType.Success, string.Format("Prev: {0}", key.ToString()), string.Format("New: {0}", newName)));
            }
            else
            {
                Log <HeroesGuildAPI> .Logger.ErrorFormat("ErrorCode return in UserNameModify(GuildMemberKey key, string newName): {0}", num);

                GuildLog.AddGuildLedger(new LogData(0L, key.CID, OperationType.HeroesCore_UserNameModify, GuildLedgerEventType.DatabaseFail, string.Format("Prev: {0}", key.ToString()), string.Format("New: {0}", newName)));
            }
        }
Example #3
0
        public bool ChangeMaster(GuildEntity guild, GuildMember newMaster, GuildMember oldMaster)
        {
            if (!FeatureMatrix.IsEnable("EnableChangeGuildMaster"))
            {
                return(false);
            }
            GuildMemberKey key = newMaster.Key;

            Log <GuildAPI> .Logger.InfoFormat("ChangeMaster: Guild[{0}], newMasterKey[{1}], oldMasterKey[{2}]", guild.ToString(), key.ToString(), oldMaster.Key.ToString());

            Log <GuildAPI> .Logger.InfoFormat("ChangeMaster: serverCode[{0}] guildSn[{1}] NexonSN[{2}] C_SN[{3}] Name[{4}] Rank[{5}]", new object[]
            {
                GuildAPI.ServerCode,
                guild.GuildSN,
                key.NexonSN,
                key.CharacterSN,
                key.CharacterName,
                GuildMemberRank.Operator.ToGroupUserType()
            });

            HeroesGuildUserType type = GuildMemberRank.Operator.ToGroupUserType();

            return(HeroesGuild.GroupChangeMaster(GuildAPI.ServerCode, guild.GuildSN, key.NexonSN, (long)key.CharacterSN, key.CharacterName, this.ConvertToGroupUserType(type)));
        }