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 a4204365
authored
Dec 12, 2017
by
xuzhenhao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加了相应的错误返回
1 parent
adc0901c
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
10 deletions
sdkredis/ice_gametopREDIS.go
sdkredis/ice_gametopREDIS.go
View file @
a420436
...
...
@@ -378,13 +378,13 @@ func IceGameTopRedisGetSingleUserRangeRankInfo(uid string, gtid string, gid stri
}
}
else
{
resIndex
=
"105207"
return
return
nil
,
resIndex
,
err
}
// 获取当前用户排名
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
{
resIndex
=
"105202"
return
return
nil
,
resIndex
,
err
}
if
rank
==
nil
{
err
=
errors
.
New
(
"用户未提交分数"
)
...
...
@@ -402,7 +402,7 @@ func IceGameTopRedisGetSingleUserRangeRankInfo(uid string, gtid string, gid stri
prerankIndex
,
err
=
strconv
.
Atoi
(
prerank
)
if
err
!=
nil
{
resIndex
=
"105200"
return
return
nil
,
resIndex
,
err
}
}
if
nextrank
==
""
{
...
...
@@ -411,7 +411,7 @@ func IceGameTopRedisGetSingleUserRangeRankInfo(uid string, gtid string, gid stri
nextrankIndex
,
err
=
strconv
.
Atoi
(
nextrank
)
if
err
!=
nil
{
resIndex
=
"105200"
return
return
nil
,
resIndex
,
err
}
}
if
rankIndex
-
prerankIndex
<
0
{
...
...
@@ -431,11 +431,11 @@ func IceGameTopRedisGetSingleUserRangeRankInfo(uid string, gtid string, gid stri
if
err
!=
nil
{
resIndex
=
"105203"
log
.
Println
(
"RedisSort err"
)
return
return
nil
,
resIndex
,
err
}
else
if
len
(
strList
)
==
0
{
err
=
errors
.
New
(
"rank has no data"
)
resIndex
=
"105204"
return
return
nil
,
resIndex
,
err
}
igt
:=
make
([]
IGT
,
len
(
strList
)
/
2
)
...
...
@@ -448,7 +448,7 @@ func IceGameTopRedisGetSingleUserRangeRankInfo(uid string, gtid string, gid stri
if
err
!=
nil
{
resIndex
=
"105205"
log
.
Printf
(
"select db err"
)
return
return
nil
,
resIndex
,
err
}
for
i
:=
0
;
i
<
len
(
strList
);
i
+=
2
{
startIndex
:=
strings
.
Index
(
strList
[
i
],
"uid:"
)
+
4
...
...
@@ -470,12 +470,12 @@ func IceGameTopRedisGetSingleUserRangeRankInfo(uid string, gtid string, gid stri
resultstr
,
err
=
RedisGetKV
(
redisConn
,
"GUID:"
+
igt
[
s
]
.
UID
)
if
err
!=
nil
{
resIndex
=
"105206"
return
return
nil
,
resIndex
,
err
}
r
,
err
:=
regexp
.
Compile
(
`\|([^\|])*\|`
)
if
err
!=
nil
{
resIndex
=
"105200"
return
return
nil
,
resIndex
,
err
}
// 使用正则匹配需要的值
result
:=
r
.
FindAllString
(
resultstr
,
valuecount
)
...
...
@@ -498,7 +498,7 @@ func IceGameTopRedisGetSingleUserRangeRankInfo(uid string, gtid string, gid stri
if
err
!=
nil
{
resIndex
=
"105205"
log
.
Printf
(
"select db err:"
)
return
return
nil
,
resIndex
,
err
}
return
&
igt
,
resIndex
,
nil
}
...
...
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