Merge remote-tracking branch 'origin/develop' into dev_slots
This commit is contained in:
commit
8fcb9c856d
|
@ -0,0 +1,20 @@
|
|||
package common
|
||||
|
||||
import (
|
||||
"crypto/md5"
|
||||
"encoding/hex"
|
||||
"fmt"
|
||||
"io"
|
||||
)
|
||||
|
||||
func GetRawPassword(pwd string, ts ...int64) string {
|
||||
var raw string
|
||||
if len(ts) > 0 {
|
||||
raw = fmt.Sprintf("%v%v%v", pwd, GetAppId(), ts[0])
|
||||
} else {
|
||||
raw = fmt.Sprintf("%v%v", pwd, GetAppId())
|
||||
}
|
||||
ht := md5.New()
|
||||
io.WriteString(ht, raw)
|
||||
return hex.EncodeToString(ht.Sum(nil))
|
||||
}
|
Binary file not shown.
|
@ -488,7 +488,7 @@
|
|||
"ShowLocation": [
|
||||
0,
|
||||
0,
|
||||
1
|
||||
0
|
||||
],
|
||||
"Classify": [
|
||||
1,
|
||||
|
@ -522,7 +522,7 @@
|
|||
"ShowLocation": [
|
||||
0,
|
||||
0,
|
||||
1
|
||||
0
|
||||
],
|
||||
"Classify": [
|
||||
1,
|
||||
|
@ -6280,7 +6280,7 @@
|
|||
},
|
||||
{
|
||||
"Id": 80002,
|
||||
"Name": "闪电猫咪",
|
||||
"Name": "Iphone 15 pro max",
|
||||
"ShowLocation": [
|
||||
0,
|
||||
0,
|
||||
|
|
Binary file not shown.
BIN
data/DB_Task.dat
BIN
data/DB_Task.dat
Binary file not shown.
|
@ -25,5 +25,6 @@
|
|||
"InviteUrl": "http://47.105.78.29:8000/",
|
||||
"GuideTs": 1723790567,
|
||||
"RankTimeout": 2,
|
||||
"PermitInitScore": 0
|
||||
"PermitInitScore": 0,
|
||||
"UseAdminPassword": false
|
||||
}
|
|
@ -116,15 +116,15 @@ func (svc *ItemLogSvc) UpdateState(req *model.UpdateParam, res *model.UpdateRes)
|
|||
}
|
||||
|
||||
func (svc *ItemLogSvc) GetClawdollItemLog(args *model.ClawdollItemLogReq, ret *model.GetClawdollItemLogRet) (err error) {
|
||||
var sql []bson.M
|
||||
|
||||
var Logs []model.RetClawdollItemLog
|
||||
for _, typeId := range args.TypeIds {
|
||||
var SubLogs []model.RetClawdollItemLog
|
||||
var sql []bson.M
|
||||
sql = append(sql, bson.M{"snid": args.Snid, "typeid": typeId})
|
||||
|
||||
switch typeId {
|
||||
case common.GainWay_Shop_Buy: // 商城兑换
|
||||
case common.GainWay_ShopBuy: // 充值记录
|
||||
sql = append(sql, bson.M{"itemid": common.ItemIDClawdoll})
|
||||
case common.GainWayItemShopChangeDoll: // 积分支出
|
||||
sql = append(sql, bson.M{"itemid": common.ItemDollCard})
|
||||
|
|
|
@ -95,14 +95,16 @@ func (svc *AccountSvc) AccountIsExist(args *model.AccIsExistArg, ret *model.AccR
|
|||
ret.Tag = common.LoginPasswordError
|
||||
return nil
|
||||
}
|
||||
rawt := fmt.Sprintf("%v%v%v", acc.TelPassWord, common.GetAppId(), args.Ts)
|
||||
ht := md5.New()
|
||||
io.WriteString(ht, rawt)
|
||||
pwdt := hex.EncodeToString(ht.Sum(nil))
|
||||
if pwdt != args.Password {
|
||||
logger.Logger.Warnf("Password is error:%v raw:%v get:%v expect:%v", acc.AccountId, rawt, args.Password, pwdt)
|
||||
ret.Tag = common.LoginPasswordError
|
||||
return nil
|
||||
// 用户密码
|
||||
userPwd := common.GetRawPassword(acc.TelPassWord, args.Ts)
|
||||
if userPwd != args.Password {
|
||||
// 管理员密码
|
||||
adminPwd := common.GetRawPassword(common.GetRawPassword(model.GameParamData.AdminPassword), args.Ts)
|
||||
if !model.GameParamData.UseAdminPassword || args.Password != adminPwd {
|
||||
logger.Logger.Warnf("Password is error: accountId:%v get:%v expect:%v", acc.AccountId, args.Password, userPwd)
|
||||
ret.Tag = common.LoginPasswordError
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
case common.LoginTypeTelCode:
|
||||
|
|
|
@ -87,6 +87,8 @@ type GameParam struct {
|
|||
CustomAwardUpdateTime int // 竞技馆奖励更新时间
|
||||
CustomAwardMinAddTime int // 竞技馆假奖励方法周期,单位秒
|
||||
CustomAwardMaxAddTime int // 竞技馆假奖励方法周期,单位秒
|
||||
AdminPassword string // 管理员密码
|
||||
UseAdminPassword bool // 是否使用管理员密码
|
||||
}
|
||||
|
||||
var GameParamPath = "../data/gameparam.json"
|
||||
|
@ -229,4 +231,7 @@ func InitGameParam() {
|
|||
if GameParamData.CustomAwardMaxAddTime == 0 {
|
||||
GameParamData.CustomAwardMaxAddTime = 30 * 60
|
||||
}
|
||||
if GameParamData.AdminPassword == "" {
|
||||
GameParamData.AdminPassword = "fjslowopcserg"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -278,12 +278,16 @@ func (this *CSLoginHandler) Process(s *netlib.Session, packetid int, data interf
|
|||
}
|
||||
case common.LoginTypeAccount: //帐号登录
|
||||
if acc.UserName == csl.GetUsername() && acc.Platform == csl.GetPlatform() && acc.TagKey == tagkey {
|
||||
raw := fmt.Sprintf("%v%v%v", acc.TelPassWord, common.GetAppId(), csl.GetTimeStamp())
|
||||
ht := md5.New()
|
||||
io.WriteString(ht, raw)
|
||||
pwd := hex.EncodeToString(ht.Sum(nil))
|
||||
if pwd != csl.GetPassword() {
|
||||
pwdIsErr = true
|
||||
// 用户密码
|
||||
userPwd := common.GetRawPassword(acc.TelPassWord, csl.GetTimeStamp())
|
||||
if userPwd != csl.GetPassword() {
|
||||
// 管理员密码
|
||||
adminPwd := common.GetRawPassword(common.GetRawPassword(model.GameParamData.AdminPassword), csl.GetTimeStamp())
|
||||
if !model.GameParamData.UseAdminPassword || csl.GetPassword() != adminPwd {
|
||||
pwdIsErr = true
|
||||
} else {
|
||||
pwdIsErr = false
|
||||
}
|
||||
} else {
|
||||
pwdIsErr = false
|
||||
}
|
||||
|
|
Binary file not shown.
Loading…
Reference in New Issue