Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
H
hilo-common
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-common
Commits
f3f88e2e
Commit
f3f88e2e
authored
Aug 07, 2023
by
hujiebin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
游戏大厅匹配成功
parent
bb7f7b99
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
41 additions
and
0 deletions
+41
-0
userProxy.proto
protocol/userProxy.proto
+9
-0
user_center_coder.go
rpc/user_center_coder.go
+1
-0
user_center_func.go
rpc/user_center_func.go
+31
-0
No files found.
protocol/userProxy.proto
View file @
f3f88e2e
...
@@ -464,3 +464,12 @@ message MicUserData {
...
@@ -464,3 +464,12 @@ message MicUserData {
string
headwearIcon
=
15
;
string
headwearIcon
=
15
;
Svip
svip
=
16
;
Svip
svip
=
16
;
}
}
/* id == 157 游戏大厅匹配成功 */
message
LobbyMatchSuccess
{
uint64
game_id
=
1
;
uint64
mode
=
2
;
string
group_id
=
3
;
User
user
=
4
;
User
otherUser
=
5
;
}
\ No newline at end of file
rpc/user_center_coder.go
View file @
f3f88e2e
...
@@ -67,6 +67,7 @@ const (
...
@@ -67,6 +67,7 @@ const (
MsgTypeCpUpgrade
=
150
// cp升级
MsgTypeCpUpgrade
=
150
// cp升级
MsgTypeSvipUpgrade
=
151
// svip升级
MsgTypeSvipUpgrade
=
151
// svip升级
MsgTypeGroupMicChange
=
155
// 麦位变化
MsgTypeGroupMicChange
=
155
// 麦位变化
MsgTypeLobbyMatchSuccess
=
157
// 羊羊匹配成功
)
)
const
(
const
(
...
...
rpc/user_center_func.go
View file @
f3f88e2e
...
@@ -444,3 +444,34 @@ func SendSocketMicChange(seqId string, userId uint64, micUserExternalId, txGroup
...
@@ -444,3 +444,34 @@ func SendSocketMicChange(seqId string, userId uint64, micUserExternalId, txGroup
}
}
return
nil
return
nil
}
}
// 游戏大厅匹配成功
func
SendLobbyMatchSuccess
(
myUserId
,
otherUserId
uint64
,
nick1
,
nick2
,
avatar1
,
avatar2
string
,
gameId
uint64
,
txGroupId
string
,
mode
int
)
error
{
msg
:=
&
userProxy
.
LobbyMatchSuccess
{
GameId
:
gameId
,
GroupId
:
txGroupId
,
Mode
:
uint64
(
mode
),
User
:
&
userProxy
.
User
{
Id
:
myUserId
,
Nick
:
nick1
,
Avatar
:
avatar1
},
OtherUser
:
&
userProxy
.
User
{
Id
:
otherUserId
,
Nick
:
nick2
,
Avatar
:
avatar2
},
}
if
buffer
,
err
:=
proto
.
Marshal
(
msg
);
err
==
nil
{
userIds
:=
[]
uint64
{
myUserId
}
rspUids
,
err
:=
multicast
(
userIds
,
MsgTypeLobbyMatchSuccess
,
buffer
)
//记录socket,注意闭包问题
go
func
(
userIds
[]
uint64
,
msg
*
userProxy
.
LobbyMatchSuccess
,
rspUids
[]
uint64
,
err
error
)
{
buf
,
_
:=
json
.
Marshal
(
msg
)
AddRpcLogs
(
MsgTypeLobbyMatchSuccess
,
userIds
,
string
(
buf
[
:
]),
rspUids
,
err
)
}(
userIds
,
msg
,
rspUids
,
err
)
if
err
!=
nil
{
mylogrus
.
MyLog
.
Errorf
(
"grpc LobbyMatchSuccess send fail"
)
return
err
}
else
{
mylogrus
.
MyLog
.
Info
(
"grpc LobbyMatchSuccess send success"
)
}
}
else
{
return
err
}
return
nil
}
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