ソースを参照

邀请关系验证

zhengtao 8 ヶ月 前
コミット
7387c36af7
1 ファイル変更5 行追加3 行削除
  1. 5 3
      game/game_cluster/nodes/game/module/player/invite.go

+ 5 - 3
game/game_cluster/nodes/game/module/player/invite.go

@@ -13,13 +13,15 @@ import (
 )
 
 func (p *actorPlayer) invite() {
-
 	pid := mdb.RDB.Get(context.Background(), fmt.Sprintf("%v:1:%v", constant.InviteKey, p.Player.OpenId)).Val()
-
+	//如果邀请是自己不处理
+	if p.Player.UserName == pid {
+		return
+	}
 	p.Player.Pid = pid
 	p.Player.SetInvite(pid)
 	//添加日志
-	clog.Infof("player inviteplayerName:%v, inviteName:%v", p.Player.UserName, pid)
+	clog.Infof("player invite,playerName:%v, inviteName:%v", p.Player.UserName, pid)
 }
 
 func (p *actorPlayer) inviteRecord() (*param.WeeklyRankConfigResp, int32) {