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 adc0901c
authored
Dec 12, 2017
by
xuzhenhao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加了相应的错误返回
1 parent
e298655b
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
1 deletions
sdkredis/ice_gametopREDIS.go
sdkredis/ice_gametopREDIS.go
View file @
adc0901
...
@@ -390,6 +390,7 @@ func IceGameTopRedisGetSingleUserRangeRankInfo(uid string, gtid string, gid stri
...
@@ -390,6 +390,7 @@ func IceGameTopRedisGetSingleUserRangeRankInfo(uid string, gtid string, gid stri
err
=
errors
.
New
(
"用户未提交分数"
)
err
=
errors
.
New
(
"用户未提交分数"
)
return
nil
,
"105201"
,
err
return
nil
,
"105201"
,
err
}
}
log
.
Println
(
"rank:"
,
rank
)
rankIndex
:=
int
(
rank
.
(
int64
))
rankIndex
:=
int
(
rank
.
(
int64
))
// 获取当前用户前x位和后x位的排名数据
// 获取当前用户前x位和后x位的排名数据
...
@@ -434,6 +435,7 @@ func IceGameTopRedisGetSingleUserRangeRankInfo(uid string, gtid string, gid stri
...
@@ -434,6 +435,7 @@ func IceGameTopRedisGetSingleUserRangeRankInfo(uid string, gtid string, gid stri
}
else
if
len
(
strList
)
==
0
{
}
else
if
len
(
strList
)
==
0
{
err
=
errors
.
New
(
"rank has no data"
)
err
=
errors
.
New
(
"rank has no data"
)
resIndex
=
"105204"
resIndex
=
"105204"
return
}
}
igt
:=
make
([]
IGT
,
len
(
strList
)
/
2
)
igt
:=
make
([]
IGT
,
len
(
strList
)
/
2
)
...
@@ -446,6 +448,7 @@ func IceGameTopRedisGetSingleUserRangeRankInfo(uid string, gtid string, gid stri
...
@@ -446,6 +448,7 @@ func IceGameTopRedisGetSingleUserRangeRankInfo(uid string, gtid string, gid stri
if
err
!=
nil
{
if
err
!=
nil
{
resIndex
=
"105205"
resIndex
=
"105205"
log
.
Printf
(
"select db err"
)
log
.
Printf
(
"select db err"
)
return
}
}
for
i
:=
0
;
i
<
len
(
strList
);
i
+=
2
{
for
i
:=
0
;
i
<
len
(
strList
);
i
+=
2
{
startIndex
:=
strings
.
Index
(
strList
[
i
],
"uid:"
)
+
4
startIndex
:=
strings
.
Index
(
strList
[
i
],
"uid:"
)
+
4
...
@@ -467,10 +470,12 @@ func IceGameTopRedisGetSingleUserRangeRankInfo(uid string, gtid string, gid stri
...
@@ -467,10 +470,12 @@ func IceGameTopRedisGetSingleUserRangeRankInfo(uid string, gtid string, gid stri
resultstr
,
err
=
RedisGetKV
(
redisConn
,
"GUID:"
+
igt
[
s
]
.
UID
)
resultstr
,
err
=
RedisGetKV
(
redisConn
,
"GUID:"
+
igt
[
s
]
.
UID
)
if
err
!=
nil
{
if
err
!=
nil
{
resIndex
=
"105206"
resIndex
=
"105206"
return
}
}
r
,
err
:=
regexp
.
Compile
(
`\|([^\|])*\|`
)
r
,
err
:=
regexp
.
Compile
(
`\|([^\|])*\|`
)
if
err
!=
nil
{
if
err
!=
nil
{
resIndex
=
"105200"
resIndex
=
"105200"
return
}
}
// 使用正则匹配需要的值
// 使用正则匹配需要的值
result
:=
r
.
FindAllString
(
resultstr
,
valuecount
)
result
:=
r
.
FindAllString
(
resultstr
,
valuecount
)
...
@@ -491,7 +496,9 @@ func IceGameTopRedisGetSingleUserRangeRankInfo(uid string, gtid string, gid stri
...
@@ -491,7 +496,9 @@ func IceGameTopRedisGetSingleUserRangeRankInfo(uid string, gtid string, gid stri
}
}
_
,
err
=
RedisDBSelect
(
redisConn
,
2
)
_
,
err
=
RedisDBSelect
(
redisConn
,
2
)
if
err
!=
nil
{
if
err
!=
nil
{
log
.
Printf
(
"select db err:"
,
err
)
resIndex
=
"105205"
log
.
Printf
(
"select db err:"
)
return
}
}
return
&
igt
,
resIndex
,
nil
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