Commit 543de2ec28d6fcc61c344654ac9162f98fcd4b78

Authored by 陆恒
1 parent 074f1074
Exists in ver2.3.6

提交

src/HttpServer/logic/logic.go
... ... @@ -1195,7 +1195,6 @@ func HandlerLogin(w http.ResponseWriter, data string, uuid int) {
1195 1195 //不存在
1196 1196 //属于新登录的玩家数据
1197 1197 //需要判断是否存在mysql中
1198   - logger.Info("GetUserInfo from mysql")
1199 1198 //return nil, err
1200 1199 //从mysql读取
1201 1200 err,info,task,ach,isfind := mysql.GetFromBackUp(uniqueuuid)
... ... @@ -1209,6 +1208,7 @@ func HandlerLogin(w http.ResponseWriter, data string, uuid int) {
1209 1208 }
1210 1209  
1211 1210 if isfind {
  1211 + logger.Info("GetUserInfo from mysql uid=%v",uniqueuuid)
1212 1212 //先保存数据
1213 1213 err = redishandler.GetRedisClient().HSet(redis.USER_DATA_KEY, uniqueuuid,info)
1214 1214 err = redishandler.GetRedisClient().HSet(redis.USER_TASKINFO_LIST, uniqueuuid,task)
... ...
src/mysql/dbmysql.go
... ... @@ -48,7 +48,7 @@ func ExcuteCmd(cmd string) error {
48 48  
49 49 func GetFromBackUp(uniqueid string) (error,string,string,string,bool) {
50 50 isfind := false
51   - cmd := "select info,task,achieve from hedaoshi where uid = " + uniqueid
  51 + cmd := "select info,task,achieve from hedaoshi where uid = '" + uniqueid + "'"
52 52 rows, err := m_game_db.Query(cmd)
53 53 if rows != nil {
54 54 defer rows.Close()
... ...