Commit 4d20985b by xuzhenhao

增加了返回个人排行信息的时候可以看到前后玩家信息的功能

1 parent 6037c7bc
Showing with 12 additions and 7 deletions
...@@ -447,13 +447,18 @@ func IceGameTopRedisGetSingleUserRangeRankInfo(uid string, gtid string, gid stri ...@@ -447,13 +447,18 @@ func IceGameTopRedisGetSingleUserRangeRankInfo(uid string, gtid string, gid stri
// startIndex := strings.Index(strList[i], "uid:") + 4 // startIndex := strings.Index(strList[i], "uid:") + 4
// endIndex := strings.Index(strList[i], ":gtid") // endIndex := strings.Index(strList[i], ":gtid")
// currUID := common.Substr2(strList[i], startIndex, endIndex) // currUID := common.Substr2(strList[i], startIndex, endIndex)
var s int
igt[i/2].UID = uid if i == 0 {
igt[i/2].RankIndex = index s = 0
igt[i/2].MyKey = strList[i+1] } else {
s = i / 2
}
igt[s].UID = uid
igt[s].RankIndex = index
igt[s].MyKey = strList[i+1]
//查询储存昵称以及头像url的redis //查询储存昵称以及头像url的redis
var err error var err error
resultstr, err = RedisGetKV(redisConn, "GUID:"+igt[i/2].UID) resultstr, err = RedisGetKV(redisConn, "GUID:"+igt[s].UID)
if err != nil { if err != nil {
log.Println("get redis err:", err) log.Println("get redis err:", err)
} }
...@@ -472,8 +477,8 @@ func IceGameTopRedisGetSingleUserRangeRankInfo(uid string, gtid string, gid stri ...@@ -472,8 +477,8 @@ func IceGameTopRedisGetSingleUserRangeRankInfo(uid string, gtid string, gid stri
result[key] = value result[key] = value
} }
//result 为切片,储存了所有匹配到的特定值 //result 为切片,储存了所有匹配到的特定值
igt[i/2].NickName = result[0] //第一个为昵称 igt[s].NickName = result[0] //第一个为昵称
igt[i/2].HeadPortraitURL = result[1] //第二个为头像url igt[s].HeadPortraitURL = result[1] //第二个为头像url
} }
index++ index++
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!