修复机器人标记
This commit is contained in:
parent
a61fdc3a7f
commit
5ee2dd9eac
|
@ -2,7 +2,9 @@ package model
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
|
"crypto/md5"
|
||||||
"encoding/gob"
|
"encoding/gob"
|
||||||
|
"encoding/hex"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
@ -909,7 +911,13 @@ func NewPlayerData(acc string, name, headUrl string, id int32, channel, platform
|
||||||
logger.Logger.Trace("New player name is empty.")
|
logger.Logger.Trace("New player name is empty.")
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
raw := fmt.Sprintf("%v%v", DEFAULT_PLAYER_SAFEBOX_PWD, common.GetAppId())
|
||||||
|
h := md5.New()
|
||||||
|
io.WriteString(h, raw)
|
||||||
|
pwd := hex.EncodeToString(h.Sum(nil))
|
||||||
tNow := time.Now()
|
tNow := time.Now()
|
||||||
|
isRobot := channel == common.Channel_Rob
|
||||||
|
|
||||||
pd := &PlayerData{
|
pd := &PlayerData{
|
||||||
Id: bson.NewObjectId(),
|
Id: bson.NewObjectId(),
|
||||||
AccountId: acc,
|
AccountId: acc,
|
||||||
|
@ -920,6 +928,7 @@ func NewPlayerData(acc string, name, headUrl string, id int32, channel, platform
|
||||||
SnId: id,
|
SnId: id,
|
||||||
Head: rand.Int31n(common.HeadRange),
|
Head: rand.Int31n(common.HeadRange),
|
||||||
HeadUrl: headUrl,
|
HeadUrl: headUrl,
|
||||||
|
SafeBoxPassword: pwd,
|
||||||
Ip: ip,
|
Ip: ip,
|
||||||
RegIp: ip,
|
RegIp: ip,
|
||||||
Params: params,
|
Params: params,
|
||||||
|
@ -929,7 +938,7 @@ func NewPlayerData(acc string, name, headUrl string, id int32, channel, platform
|
||||||
CreateTime: tNow.Local(),
|
CreateTime: tNow.Local(),
|
||||||
Ver: VER_PLAYER_MAX - 1,
|
Ver: VER_PLAYER_MAX - 1,
|
||||||
HeadOutLine: 1,
|
HeadOutLine: 1,
|
||||||
IsRob: false,
|
IsRob: isRobot,
|
||||||
PackageID: packTag,
|
PackageID: packTag,
|
||||||
YesterdayGameData: NewPlayerGameCtrlData(),
|
YesterdayGameData: NewPlayerGameCtrlData(),
|
||||||
TodayGameData: NewPlayerGameCtrlData(),
|
TodayGameData: NewPlayerGameCtrlData(),
|
||||||
|
|
Loading…
Reference in New Issue