From 3828311520278f4a4df4d35539e37ecc0bb4afef Mon Sep 17 00:00:00 2001 From: sk <123456@qq.com> Date: Thu, 16 May 2024 15:22:26 +0800 Subject: [PATCH] =?UTF-8?q?=E9=82=80=E8=AF=B7=E5=88=86=E4=BA=AB=E9=93=BE?= =?UTF-8?q?=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- worldsrv/action_welfare.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/worldsrv/action_welfare.go b/worldsrv/action_welfare.go index 7cf4f63..765dc2c 100644 --- a/worldsrv/action_welfare.go +++ b/worldsrv/action_welfare.go @@ -1,6 +1,9 @@ package main import ( + "encoding/base64" + "fmt" + "mongo.games.com/goserver/core/basic" "mongo.games.com/goserver/core/logger" "mongo.games.com/goserver/core/netlib" @@ -302,6 +305,10 @@ func CSInviteInfo(s *netlib.Session, packetid int, data interface{}, sid int64) if p == nil { return nil } + link := model.GameParamData.InviteUrl + f := func() string { + return fmt.Sprintf("%s?user=%s", link, base64.StdEncoding.EncodeToString([]byte(fmt.Sprintf("%s|%d", p.Platform, p.SnId)))) + } var res []byte var err error @@ -314,7 +321,6 @@ func CSInviteInfo(s *netlib.Session, packetid int, data interface{}, sid int64) return nil }), task.CompleteNotifyWrapper(func(i interface{}, t task.Task) { info := webapi_proto.SAPlayerInviteLink{} - link := "" if err != nil || res == nil { logger.Logger.Errorf("ApiGetInviteLink err %v or not return", err) } else { @@ -326,7 +332,7 @@ func CSInviteInfo(s *netlib.Session, packetid int, data interface{}, sid int64) ret := &welfare.SCInviteInfo{ Num: p.InviteNum, Code: p.InviteCode, - InviteUrl: link, + InviteUrl: f(), Score: p.InviteScore, OtherCode: p.OtherCode, }