增加了使用设别号登录
This commit is contained in:
parent
97350e8bde
commit
72b4d08d93
@ -9,6 +9,7 @@ const (
|
||||
Protocol_Error_Account_Fail int32 = 103
|
||||
Protocol_Error_Account_NoExsit int32 = 104
|
||||
Protocol_Error_Account_Code_Error int32 = 105
|
||||
Protocol_Error_Account_Device_Error int32 = 106
|
||||
Protocol_Res_Buy_Cnt_Limit int32 = 110
|
||||
Protocol_Res_Buy_CD int32 = 111
|
||||
Protocol_Email_Find_Fail int32 = 120
|
||||
|
||||
@ -248,6 +248,11 @@ func UpdateAccountInfoToDb(account *Db_Account) (err error) {
|
||||
return
|
||||
}
|
||||
|
||||
func UpdateAccountInfoDeviceToDb(account *Db_Account) (err error) {
|
||||
_, err = SqlDb.Exec("UPDATE t_account SET device_id = ? WHERE user_name = ?", account.DeviceId, account.UserName)
|
||||
return
|
||||
}
|
||||
|
||||
func FormatAllMemLoadDb(u interface{}, tableName string, Exclude string) (err error) {
|
||||
t := reflect.TypeOf(u)
|
||||
len := t.Elem().NumField()
|
||||
|
||||
@ -60,7 +60,7 @@ func VerifyUser(accountInfo *db.Db_Account, detail *msg.ReqLogin) (ResLogin *msg
|
||||
return
|
||||
}
|
||||
|
||||
if accountInfo.UserPassword != "" && accountInfo.UserPassword != detail.UserPwd {
|
||||
if detail.Type == msg.LOGIN_TYPE_ACCOUNT_LOGIN {
|
||||
ResLogin = &msg.ResLogin{
|
||||
ResultCode: MergeConst.Protocol_Error_Account_OR_PWD_ERROR,
|
||||
DwUin: 0,
|
||||
@ -68,7 +68,7 @@ func VerifyUser(accountInfo *db.Db_Account, detail *msg.ReqLogin) (ResLogin *msg
|
||||
return
|
||||
}
|
||||
|
||||
if detail.Code != "" {
|
||||
if detail.Type == msg.LOGIN_TYPE_ACCOUNT_LOGIN {
|
||||
err := VerifyUserCode(detail.UserName, detail.Code)
|
||||
if err != nil {
|
||||
ResLogin = &msg.ResLogin{
|
||||
@ -78,6 +78,15 @@ func VerifyUser(accountInfo *db.Db_Account, detail *msg.ReqLogin) (ResLogin *msg
|
||||
return
|
||||
}
|
||||
}
|
||||
if detail.Type == msg.LOGIN_TYPE_DEVICE_LOGIN {
|
||||
if detail.Device != accountInfo.DeviceId {
|
||||
ResLogin = &msg.ResLogin{
|
||||
ResultCode: MergeConst.Protocol_Error_Account_Device_Error,
|
||||
DwUin: 0,
|
||||
}
|
||||
return
|
||||
}
|
||||
}
|
||||
playerbaseinfo := db.GetPlayerBaseInfoFromDbByName(detail.UserName)
|
||||
if playerbaseinfo == nil {
|
||||
ResLogin = &msg.ResLogin{
|
||||
|
||||
@ -172,6 +172,8 @@ func HandleClientReq(args []interface{}) {
|
||||
G_GameLogicPtr.CreateNewPlayer(a, detail.UserName)
|
||||
}
|
||||
}
|
||||
accountInfo.DeviceId = detail.Device
|
||||
db.UpdateAccountInfoDeviceToDb(accountInfo)
|
||||
p, _ := internal.Agents.Load(a)
|
||||
if p != nil {
|
||||
p.(*Player).PushClientRes(ResLogin)
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user