1
This commit is contained in:
parent
00e655d501
commit
abaf9a92f5
@ -128,9 +128,11 @@ type CacheMgr interface {
|
||||
}
|
||||
|
||||
type DbLogMgr interface {
|
||||
FriendApply(string, string)
|
||||
FriendAdd(string, string)
|
||||
FriendDel(string, string)
|
||||
|
||||
GuildApply(string, string)
|
||||
GuildClearEmptyStart(string, string)
|
||||
GuildClearEmptyEnd(string, string)
|
||||
GuildCreateConsumeBegin(string, string, string)
|
||||
|
@ -11,16 +11,19 @@ type dbLogMgr struct {
|
||||
}
|
||||
|
||||
const (
|
||||
LOG_TYPE_FRIEND_APPLY = "friend.apply"
|
||||
LOG_TYPE_FRIEND_ADD = "friend.add"
|
||||
LOG_TYPE_FRIEND_DEL = "friend.del"
|
||||
|
||||
LOG_TYPE_GUILD_APPLY = "guild.apply"
|
||||
|
||||
LOG_TYPE_GUILD_CLEAR_EMPTY_START = "guild.clear_empty.start"
|
||||
LOG_TYPE_GUILD_CLEAR_EMPTY_END = "guild.clear_empty.end"
|
||||
|
||||
LOG_TYPE_GUILD_CREATE_CONSUME_BEGIN = "guild.create_consume.begin"
|
||||
LOG_TYPE_GUILD_CREATE_CONSUME_END = "guild.create_consume.end"
|
||||
|
||||
LOG_TYPE_GUILD_ACCEPT_APPLY = "guild.apply.accept"
|
||||
LOG_TYPE_GUILD_ACCEPT_APPLY = "guild.accept"
|
||||
|
||||
LOG_TYPE_GUILD_LEAVE = "guild.leave"
|
||||
LOG_TYPE_GUILD_KICKOUT = "guild.kickout"
|
||||
@ -53,6 +56,14 @@ func (this *dbLogMgr) addLog(fields [][]string) {
|
||||
})
|
||||
}
|
||||
|
||||
func (this *dbLogMgr) FriendApply(senderId string, targetId string) {
|
||||
this.addLog([][]string{
|
||||
{"log_type", LOG_TYPE_FRIEND_APPLY},
|
||||
{"param1", senderId},
|
||||
{"param2", targetId},
|
||||
})
|
||||
}
|
||||
|
||||
func (this *dbLogMgr) FriendAdd(senderId string, targetId string) {
|
||||
this.addLog([][]string{
|
||||
{"log_type", LOG_TYPE_FRIEND_ADD},
|
||||
@ -69,6 +80,14 @@ func (this *dbLogMgr) FriendDel(senderId string, targetId string) {
|
||||
})
|
||||
}
|
||||
|
||||
func (this *dbLogMgr) GuildApply(senderId string, guildId string) {
|
||||
this.addLog([][]string{
|
||||
{"log_type", LOG_TYPE_GUILD_APPLY},
|
||||
{"param1", senderId},
|
||||
{"param2", guildId},
|
||||
})
|
||||
}
|
||||
|
||||
func (this *dbLogMgr) GuildClearEmptyStart(guildId string, guildName string) {
|
||||
this.addLog([][]string{
|
||||
{"log_type", LOG_TYPE_GUILD_CLEAR_EMPTY_START},
|
||||
|
@ -163,6 +163,9 @@ func (this *player) CMAddFriendRequest(hdr *f5.MsgHdr, msg *cs.CMAddFriendReques
|
||||
this.GetAccountId(),
|
||||
msg.GetTargetAccountId(),
|
||||
func (errCode int32, errMsg string) {
|
||||
if errCode == 0 {
|
||||
GetDbLogMgr().FriendApply(this.GetAccountId(), msg.GetTargetAccountId())
|
||||
}
|
||||
this.SendMsg(rspMsg.Err(errCode, errMsg))
|
||||
return
|
||||
})
|
||||
@ -518,6 +521,7 @@ func (this *player) CMApplyToGuild(hdr *f5.MsgHdr, msg *cs.CMApplyToGuild) {
|
||||
this.SendMsg(rspMsg.Err(errCode, errMsg))
|
||||
return
|
||||
}
|
||||
GetDbLogMgr().GuildApply(this.GetAccountId(), q5.ToString(msg.GetGuildId()))
|
||||
this.SendMsg(rspMsg)
|
||||
if okGuild != nil {
|
||||
pbGuilds := []*cs.MFGuildMember{}
|
||||
|
Loading…
x
Reference in New Issue
Block a user