Compare commits
No commits in common. "23b44237d868035e2c242ed3621c470dd9a472d1" and "83f571b5438344dd24c91ac2fe20f1389de89c59" have entirely different histories.
23b44237d8
...
83f571b543
|
@ -7,7 +7,6 @@ import (
|
|||
"fmt"
|
||||
"io"
|
||||
"net/rpc"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/globalsign/mgo"
|
||||
|
@ -109,27 +108,10 @@ func (svc *AccountSvc) AccountIsExist(args *model.AccIsExistArg, ret *model.AccR
|
|||
err := caccounts.Find(bson.M{"tel": args.Tel, "tagkey": args.TagKey}).One(acc)
|
||||
if err != nil {
|
||||
if errors.Is(err, mgo.ErrNotFound) {
|
||||
// 兼容8550开头的手机号,8550和855算同一个区号
|
||||
if strings.HasPrefix(args.Tel, "855") {
|
||||
tel := make([]byte, len(args.Tel)+1)
|
||||
copy(tel, "8550")
|
||||
copy(tel[4:], args.Tel[3:])
|
||||
err = caccounts.Find(bson.M{"tel": string(tel), "tagkey": args.TagKey}).One(acc)
|
||||
if err != nil {
|
||||
if errors.Is(err, mgo.ErrNotFound) {
|
||||
ret.Tag = common.LoginNew
|
||||
return nil
|
||||
} else {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
acc.Tel = args.Tel
|
||||
caccounts.Update(bson.M{"_id": acc.AccountId}, bson.D{{"$set", bson.D{{"tel", args.Tel}}}})
|
||||
}
|
||||
}
|
||||
} else {
|
||||
return err
|
||||
ret.Tag = common.LoginNew
|
||||
return nil
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
if args.CodeValid {
|
||||
|
|
|
@ -777,7 +777,6 @@ func NewPlayerData(acc string, name string, id int32, channel, platform string,
|
|||
UnMaxPower: 10, //初始化炮倍最小倍数
|
||||
WeekCardTime: make(map[int32]int64),
|
||||
WeekCardAward: make(map[int32]bool),
|
||||
WelfData: NewWelfareData(),
|
||||
}
|
||||
|
||||
if tel != "" {
|
||||
|
|
|
@ -15,10 +15,9 @@ import (
|
|||
"time"
|
||||
|
||||
"google.golang.org/protobuf/proto"
|
||||
"mongo.games.com/goserver/core/logger"
|
||||
)
|
||||
|
||||
const DEFAULT_TIMEOUT = time.Second * 30
|
||||
const DEFAULT_TIMEOUT = time.Duration(time.Second * 30)
|
||||
|
||||
var WebApiStats = new(sync.Map)
|
||||
|
||||
|
@ -82,7 +81,7 @@ func getRequest(appId, action string, params map[string]string, body proto.Messa
|
|||
}
|
||||
|
||||
callUrl := MakeURL(appId, action, params, data)
|
||||
logger.Logger.Tracef("getRequest url: %v params: %v request body: %v", callUrl, params, body)
|
||||
//println("callurl=", callUrl)
|
||||
req, err := http.NewRequest("GET", callUrl, nil)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
@ -130,7 +129,7 @@ func getRequest(appId, action string, params map[string]string, body proto.Messa
|
|||
}
|
||||
return body, err
|
||||
}
|
||||
logger.Logger.Errorf("getRequest url:%v params:%v request body:%v code:%v", callUrl, params, body, resp.StatusCode)
|
||||
println("callurl=", callUrl, "code=", resp.StatusCode)
|
||||
return nil, fmt.Errorf("StatusCode:%d", resp.StatusCode)
|
||||
}
|
||||
|
||||
|
@ -153,7 +152,7 @@ func postRequest(appId, action string, params map[string]string, body proto.Mess
|
|||
}
|
||||
|
||||
callUrl := MakeURL(appId, action, params, data)
|
||||
logger.Logger.Tracef("postRequest url: %v request body: %v", callUrl, body)
|
||||
//println("callurl=", callUrl)
|
||||
req, err := http.NewRequest("POST", callUrl, bytes.NewBuffer(data))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
@ -201,7 +200,7 @@ func postRequest(appId, action string, params map[string]string, body proto.Mess
|
|||
}
|
||||
return body, err
|
||||
}
|
||||
logger.Logger.Errorf("postRequest url:%v request body: %v code: %v", callUrl, body, resp.StatusCode)
|
||||
println("callurl=", callUrl, "code=", resp.StatusCode)
|
||||
return nil, fmt.Errorf("StatusCode:%d", resp.StatusCode)
|
||||
}
|
||||
|
||||
|
|
|
@ -11,7 +11,6 @@ import (
|
|||
"net/url"
|
||||
"regexp"
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
"unicode/utf8"
|
||||
|
||||
|
@ -2707,8 +2706,6 @@ func CSPlayerSMSCode(s *netlib.Session, packetId int, data interface{}, sid int6
|
|||
return nil
|
||||
}
|
||||
|
||||
msg.Tel = strings.TrimPrefix(msg.GetTel(), "0")
|
||||
|
||||
tel := fmt.Sprint(msg.GetAreaCode(), msg.GetTel())
|
||||
// tel
|
||||
if !telRule.MatchString(tel) {
|
||||
|
@ -2860,8 +2857,6 @@ func CSBindTel(s *netlib.Session, packetId int, data interface{}, sid int64) err
|
|||
// return nil
|
||||
//}
|
||||
|
||||
msg.Tel = strings.TrimPrefix(msg.GetTel(), "0")
|
||||
|
||||
tel := fmt.Sprint(msg.GetAreaCode(), msg.GetTel())
|
||||
telKey := common.GetBindTelCodeKey(p.Platform, tel)
|
||||
|
||||
|
|
|
@ -357,7 +357,7 @@ func CSBindInvite(s *netlib.Session, packetid int, data interface{}, sid int64)
|
|||
return nil
|
||||
}), task.CompleteNotifyWrapper(func(i interface{}, t task.Task) {
|
||||
if err != nil || inviteSnId == 0 {
|
||||
logger.Logger.Tracef("GetSnIdByCode not found %v %v", err, msg.GetCode())
|
||||
logger.Logger.Errorf("GetSnIdByCode err %v %v", err, inviteSnId)
|
||||
ret.OpRetCode = welfare.OpResultCode_OPRC_NotExist
|
||||
send()
|
||||
return
|
||||
|
|
|
@ -2,8 +2,9 @@ package main
|
|||
|
||||
import (
|
||||
"encoding/gob"
|
||||
"time"
|
||||
|
||||
"mongo.games.com/game/common"
|
||||
"mongo.games.com/game/model"
|
||||
"mongo.games.com/game/webapi"
|
||||
"mongo.games.com/goserver/core"
|
||||
"mongo.games.com/goserver/core/basic"
|
||||
"mongo.games.com/goserver/core/module"
|
||||
|
@ -13,10 +14,7 @@ import (
|
|||
"mongo.games.com/goserver/core/task"
|
||||
"mongo.games.com/goserver/core/transact"
|
||||
"mongo.games.com/goserver/core/utils"
|
||||
|
||||
"mongo.games.com/game/common"
|
||||
"mongo.games.com/game/model"
|
||||
"mongo.games.com/game/webapi"
|
||||
"time"
|
||||
)
|
||||
|
||||
var MonitorMgrSington = &MonitorMgr{}
|
||||
|
@ -166,4 +164,5 @@ func init() {
|
|||
//gob registe
|
||||
|
||||
module.RegisteModule(MonitorMgrSington, time.Minute*5, 0)
|
||||
|
||||
}
|
||||
|
|
|
@ -1,11 +1,8 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"mongo.games.com/goserver/core/module"
|
||||
|
||||
"mongo.games.com/game/model"
|
||||
"time"
|
||||
)
|
||||
|
||||
var PlayerOnlineSington = &PlayerOnlineEvent{
|
||||
|
@ -58,7 +55,7 @@ func (p *PlayerOnlineEvent) Update() {
|
|||
|
||||
here:
|
||||
p.OnlineCh = onlineCh
|
||||
LogChannelSingleton.WriteMQData(model.GenerateOnline(p.OnlineCh))
|
||||
//LogChannelSingleton.WriteMQData(model.GenerateOnline(p.OnlineCh))
|
||||
}
|
||||
|
||||
func (p *PlayerOnlineEvent) Shutdown() {
|
||||
|
|
Loading…
Reference in New Issue