This commit is contained in:
aozhiwei 2024-04-20 18:13:57 +08:00
parent 5aba988da6
commit b893eaed16
3 changed files with 29 additions and 0 deletions

View File

@ -138,4 +138,6 @@ type DbLogMgr interface {
GuildKickout(string, string, string)
GuildSetJob(string, string, string, int32)
GuildDisband(string, string, int32)
GuildRenameConsumeBegin(string, string, string)
GuildRenameConsumeEnd(string, string, string, int32)
}

View File

@ -26,6 +26,10 @@ const (
LOG_TYPE_GUILD_KICKOUT = "guild.kickout"
LOG_TYPE_GUILD_SETJOB = "guild.setjob"
LOG_TYPE_GUILD_DISBAND = "guild.disband"
LOG_TYPE_GUILD_RENAME_CONSUME_BEGIN = "guild.rename_consume.begin"
LOG_TYPE_GUILD_RENAME_CONSUME_END = "guild.rename_consume.end"
)
func (this* dbLogMgr) Init() {
@ -144,3 +148,23 @@ func (this *dbLogMgr) GuildDisband(guildId string, sender string, reason int32)
{"param3", q5.ToString(reason)},
})
}
func (this *dbLogMgr) GuildRenameConsumeBegin(accountId string, guildId string, newGuildName string) {
this.addLog([][]string{
{"log_type", LOG_TYPE_GUILD_RENAME_CONSUME_BEGIN},
{"param1", accountId},
{"param2", guildId},
{"param3", newGuildName},
})
}
func (this *dbLogMgr) GuildRenameConsumeEnd(accountId string, guildId string, newGuildName string, errCode int32) {
this.addLog([][]string{
{"log_type", LOG_TYPE_GUILD_RENAME_CONSUME_END},
{"param1", accountId},
{"param2", guildId},
{"param3", newGuildName},
{"param4", q5.ToString(errCode)},
})
}

View File

@ -745,6 +745,7 @@ func (this *guildMgr) AsyncUpdateGuild(accountId string, sessionId string, kv ma
})
}
if _, ok := kv[constant.GUILD_UPDATE_FIELD_NAME]; ok {
GetDbLogMgr().GuildRenameConsumeBegin(accountId, guild.guildId, guildName)
params := map[string]string{
"c": "Bag",
"a": "useItem",
@ -762,7 +763,9 @@ func (this *guildMgr) AsyncUpdateGuild(accountId string, sessionId string, kv ma
func(rsp f5.HttpCliResponse) {
if rsp.GetErr() == nil && rsp.JsonParseOk() {
doFunc()
GetDbLogMgr().GuildRenameConsumeEnd(accountId, guild.guildId, guildName, 0)
} else {
GetDbLogMgr().GuildRenameConsumeEnd(accountId, guild.guildId, guildName, 1)
cb(4, "cube rename card not enough")
return
}