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
2f3874ad
Commit
2f3874ad
authored
Jul 10, 2023
by
hujiebin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
匹配成功
parent
0726a0cb
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
2 deletions
+14
-2
userProxy.proto
protocol/userProxy.proto
+2
-0
user_center_func.go
rpc/user_center_func.go
+12
-2
No files found.
protocol/userProxy.proto
View file @
2f3874ad
...
...
@@ -376,6 +376,7 @@ message SheepMatchSuccess {
uint64
match_id
=
1
;
User
user
=
2
;
User
otherUser
=
3
;
uint64
game_id
=
4
;
}
message
SheepGamePlayer
{
...
...
@@ -388,6 +389,7 @@ message SheepGamePlayer {
message
SheepGameResult
{
uint64
match_id
=
1
;
repeated
SheepGamePlayer
players
=
2
;
uint64
game_id
=
3
;
}
/* id == 149 cp邀请 */
...
...
rpc/user_center_func.go
View file @
2f3874ad
...
...
@@ -224,11 +224,16 @@ func SendGroupChatNotice(fromUserId uint64, userIds []uint64, senderExtId string
}
// 羊羊匹配成功
func
SendSheepMatchSuccess
(
matchId
,
myUserId
,
otherUserId
uint64
,
nick1
,
nick2
,
avatar1
,
avatar2
string
)
error
{
func
SendSheepMatchSuccess
(
matchId
,
myUserId
,
otherUserId
uint64
,
nick1
,
nick2
,
avatar1
,
avatar2
string
,
gameIds
...
uint64
)
error
{
gameId
:=
uint64
(
0
)
if
len
(
gameIds
)
>
0
{
gameId
=
gameIds
[
0
]
}
msg
:=
&
userProxy
.
SheepMatchSuccess
{
MatchId
:
matchId
,
User
:
&
userProxy
.
User
{
Id
:
myUserId
,
Nick
:
nick1
,
Avatar
:
avatar1
},
OtherUser
:
&
userProxy
.
User
{
Id
:
otherUserId
,
Nick
:
nick2
,
Avatar
:
avatar2
},
GameId
:
gameId
,
}
if
buffer
,
err
:=
proto
.
Marshal
(
msg
);
err
==
nil
{
userIds
:=
[]
uint64
{
myUserId
}
...
...
@@ -253,7 +258,7 @@ func SendSheepMatchSuccess(matchId, myUserId, otherUserId uint64, nick1, nick2,
}
// 羊羊游戏结果
func
SendSheepGameResult
(
matchId
,
winId
,
userId1
,
userId2
uint64
,
nick1
,
nick2
,
avatar1
,
avatar2
string
,
isAiMap
map
[
uint64
]
bool
)
error
{
func
SendSheepGameResult
(
matchId
,
winId
,
userId1
,
userId2
uint64
,
nick1
,
nick2
,
avatar1
,
avatar2
string
,
isAiMap
map
[
uint64
]
bool
,
gameIds
...
uint64
)
error
{
if
isAiMap
==
nil
{
isAiMap
=
make
(
map
[
uint64
]
bool
)
}
...
...
@@ -270,9 +275,14 @@ func SendSheepGameResult(matchId, winId, userId1, userId2 uint64, nick1, nick2,
for
i
:=
range
players
{
players
[
i
]
.
Rank
=
int32
(
i
)
+
1
}
gameId
:=
uint64
(
0
)
if
len
(
gameIds
)
>
0
{
gameId
=
gameIds
[
0
]
}
msg
:=
&
userProxy
.
SheepGameResult
{
MatchId
:
matchId
,
Players
:
players
,
GameId
:
gameId
,
}
if
buffer
,
err
:=
proto
.
Marshal
(
msg
);
err
==
nil
{
var
userIds
[]
uint64
...
...
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