Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
H
hilo-group
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hujiebin
hilo-group
Commits
c5bc5ecd
Commit
c5bc5ecd
authored
Aug 08, 2023
by
chenweijian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
游戏
parent
62d93839
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
9 deletions
+12
-9
game.go
domain/cache/game_c/game.go
+9
-8
group_op.go
route/group_r/group_op.go
+3
-1
No files found.
domain/cache/game_c/game.go
View file @
c5bc5ecd
...
@@ -15,11 +15,12 @@ type gameAutoJoinMsg struct {
...
@@ -15,11 +15,12 @@ type gameAutoJoinMsg struct {
GameCode
string
GameCode
string
Is1V1
string
Is1V1
string
GameMode
string
GameMode
string
Is1V1Robot
string
}
}
func
SetAutoMathEnterRoom
(
userId
uint64
,
imGroupId
,
traceId
,
token
,
enterType
,
gameCode
,
is1V1
,
gameMode
string
)
error
{
func
SetAutoMathEnterRoom
(
userId
uint64
,
imGroupId
,
traceId
,
token
,
enterType
,
gameCode
,
is1V1
,
gameMode
,
is1V1Robot
string
)
error
{
key
:=
game_e
.
GetAutoMathEnterRoom
(
userId
,
imGroupId
)
key
:=
game_e
.
GetAutoMathEnterRoom
(
userId
,
imGroupId
)
info
:=
gameAutoJoinMsg
{
traceId
,
token
,
enterType
,
gameCode
,
is1V1
,
gameMode
}
info
:=
gameAutoJoinMsg
{
traceId
,
token
,
enterType
,
gameCode
,
is1V1
,
gameMode
,
is1V1Robot
}
data
,
err
:=
json
.
Marshal
(
info
)
data
,
err
:=
json
.
Marshal
(
info
)
if
err
!=
nil
{
if
err
!=
nil
{
return
err
return
err
...
...
route/group_r/group_op.go
View file @
c5bc5ecd
...
@@ -1734,6 +1734,7 @@ func downgradeRoom(myContext *mycontext.MyContext, gi *group_m.GroupInfo) error
...
@@ -1734,6 +1734,7 @@ func downgradeRoom(myContext *mycontext.MyContext, gi *group_m.GroupInfo) error
// @Param gameCode formData string false "gameCode"
// @Param gameCode formData string false "gameCode"
// @Param is1V1 formData int false "是否1v1,0否1是"
// @Param is1V1 formData int false "是否1v1,0否1是"
// @Param gameMode formData int false "游戏模式0.快速1.经典"
// @Param gameMode formData int false "游戏模式0.快速1.经典"
// @Param is1V1Robot formData int false "是否游戏机器人,0否1是"
// @Success 200 {object} group_cv.GroupChannelId
// @Success 200 {object} group_cv.GroupChannelId
// @Router /v1/imGroup/in [put]
// @Router /v1/imGroup/in [put]
func
GroupIn
(
c
*
gin
.
Context
)
(
*
mycontext
.
MyContext
,
error
)
{
func
GroupIn
(
c
*
gin
.
Context
)
(
*
mycontext
.
MyContext
,
error
)
{
...
@@ -1748,6 +1749,7 @@ func GroupIn(c *gin.Context) (*mycontext.MyContext, error) {
...
@@ -1748,6 +1749,7 @@ func GroupIn(c *gin.Context) (*mycontext.MyContext, error) {
gameCode
:=
c
.
PostForm
(
"gameCode"
)
gameCode
:=
c
.
PostForm
(
"gameCode"
)
is1V1
:=
c
.
PostForm
(
"is1V1"
)
is1V1
:=
c
.
PostForm
(
"is1V1"
)
gameMode
:=
c
.
PostForm
(
"gameMode"
)
gameMode
:=
c
.
PostForm
(
"gameMode"
)
is1V1Robot
:=
c
.
PostForm
(
"is1V1Robot"
)
// 把id:9 添加进房间:5030的黑名单
// 把id:9 添加进房间:5030的黑名单
if
(
userId
==
2087771
||
userId
==
1763211
)
&&
groupId
==
"HTGS#a46766257"
{
if
(
userId
==
2087771
||
userId
==
1763211
)
&&
groupId
==
"HTGS#a46766257"
{
return
myContext
,
bizerr
.
NoPrivileges
return
myContext
,
bizerr
.
NoPrivileges
...
@@ -1894,7 +1896,7 @@ func GroupIn(c *gin.Context) (*mycontext.MyContext, error) {
...
@@ -1894,7 +1896,7 @@ func GroupIn(c *gin.Context) (*mycontext.MyContext, error) {
if
enterType
!=
""
&&
gameCode
!=
""
{
if
enterType
!=
""
&&
gameCode
!=
""
{
traceId
,
_
:=
c
.
Get
(
mycontext
.
TRACEID
)
traceId
,
_
:=
c
.
Get
(
mycontext
.
TRACEID
)
token
:=
c
.
Writer
.
Header
()
.
Get
(
mycontext
.
TOKEN
)
token
:=
c
.
Writer
.
Header
()
.
Get
(
mycontext
.
TOKEN
)
err
:=
game_c
.
SetAutoMathEnterRoom
(
userId
,
gi
.
ImGroupId
,
cast
.
ToString
(
traceId
),
token
,
enterType
,
gameCode
,
is1V1
,
gameMode
)
err
:=
game_c
.
SetAutoMathEnterRoom
(
userId
,
gi
.
ImGroupId
,
cast
.
ToString
(
traceId
),
token
,
enterType
,
gameCode
,
is1V1
,
gameMode
,
is1V1Robot
)
if
err
!=
nil
{
if
err
!=
nil
{
model
.
Log
.
Errorf
(
"GroupIn cache.SetAutoMathEnterRoom userId:%v, imGroupId:%v, err:%v"
,
userId
,
gi
.
ImGroupId
,
err
)
model
.
Log
.
Errorf
(
"GroupIn cache.SetAutoMathEnterRoom userId:%v, imGroupId:%v, err:%v"
,
userId
,
gi
.
ImGroupId
,
err
)
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment