Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
xuzhenhao
/
rlw-dev
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit bd88237c
authored
Dec 13, 2017
by
xuzhenhao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复了返回索引错误的问题
1 parent
56f9c46d
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
0 deletions
sdkredis/ice_gametopREDIS.go
sdkredis/ice_gametopREDIS.go
View file @
bd88237
...
@@ -385,6 +385,7 @@ func IceGameTopRedisGetSingleUserRangeRankInfo(uid string, gtid string, gid stri
...
@@ -385,6 +385,7 @@ func IceGameTopRedisGetSingleUserRangeRankInfo(uid string, gtid string, gid stri
// 获取当前用户排名
// 获取当前用户排名
rank
,
err
:=
RedisZRank
(
redisConn
,
"sortset:gtid:"
+
gtid
+
":gid:"
+
gid
+
":toptype:"
+
toptype
,
"ice_gametop:uid:"
+
uid
+
":gtid:"
+
gtid
+
":gid:"
+
gid
+
":toptype:"
+
toptype
+
":mykey"
)
rank
,
err
:=
RedisZRank
(
redisConn
,
"sortset:gtid:"
+
gtid
+
":gid:"
+
gid
+
":toptype:"
+
toptype
,
"ice_gametop:uid:"
+
uid
+
":gtid:"
+
gtid
+
":gid:"
+
gid
+
":toptype:"
+
toptype
+
":mykey"
)
if
err
!=
nil
{
if
err
!=
nil
{
k
resIndex
=
"105202"
resIndex
=
"105202"
return
nil
,
resIndex
,
err
return
nil
,
resIndex
,
err
}
}
...
@@ -418,7 +419,9 @@ func IceGameTopRedisGetSingleUserRangeRankInfo(uid string, gtid string, gid stri
...
@@ -418,7 +419,9 @@ func IceGameTopRedisGetSingleUserRangeRankInfo(uid string, gtid string, gid stri
}
}
if
rankIndex
-
prerankIndex
<
0
{
if
rankIndex
-
prerankIndex
<
0
{
prerankIndex
=
0
prerankIndex
=
0
resIndex
=
rankIndex
+
1
}
else
{
}
else
{
resIndex
=
prerankIndex
+
1
prerankIndex
=
rankIndex
-
prerankIndex
prerankIndex
=
rankIndex
-
prerankIndex
}
}
nextrankIndex
=
rankIndex
+
nextrankIndex
nextrankIndex
=
rankIndex
+
nextrankIndex
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment