Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
N
Neos
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MyCard
Neos
Commits
5a76679d
Commit
5a76679d
authored
Mar 07, 2023
by
Chunchi Che
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add ctosChat
parent
f3294270
Pipeline
#20506
passed with stages
in 6 minutes and 42 seconds
Changes
3
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
0 deletions
+30
-0
src/api/ocgcore/ocgAdapter/ctos/ctosChat.ts
src/api/ocgcore/ocgAdapter/ctos/ctosChat.ts
+19
-0
src/api/ocgcore/ocgAdapter/protoDecl.ts
src/api/ocgcore/ocgAdapter/protoDecl.ts
+1
-0
src/api/ocgcore/ocgHelper.ts
src/api/ocgcore/ocgHelper.ts
+10
-0
No files found.
src/api/ocgcore/ocgAdapter/ctos/ctosChat.ts
0 → 100644
View file @
5a76679d
import
{
ygopro
}
from
"
../../idl/ocgcore
"
;
import
{
YgoProPacket
}
from
"
../packet
"
;
import
{
CTOS_CHAT
}
from
"
../protoDecl
"
;
import
{
strEncodeUTF16
}
from
"
../util
"
;
/*
* CTOS Chat
*
* @param message - 玩家发送的消息
*
* @usage - TODO*/
export
default
class
CtosChat
extends
YgoProPacket
{
constructor
(
pb
:
ygopro
.
YgoCtosMsg
)
{
const
message
=
pb
.
ctos_chat
.
message
;
const
exData
=
strEncodeUTF16
(
message
);
super
(
exData
.
length
+
1
,
CTOS_CHAT
,
exData
);
}
}
src/api/ocgcore/ocgAdapter/protoDecl.ts
View file @
5a76679d
...
...
@@ -11,6 +11,7 @@ export const CTOS_HAND_RESULT = 3;
export
const
CTOS_TP_RESULT
=
4
;
export
const
CTOS_TIME_CONFIRM
=
21
;
export
const
CTOS_RESPONSE
=
1
;
export
const
CTOS_CHAT
=
22
;
export
const
STOC_JOIN_GAME
=
18
;
export
const
STOC_CHAT
=
25
;
...
...
src/api/ocgcore/ocgHelper.ts
View file @
5a76679d
...
...
@@ -14,6 +14,7 @@ import HandResult from "./ocgAdapter/ctos/ctosHandResult";
import
TpResult
from
"
./ocgAdapter/ctos/ctosTpResult
"
;
import
TimeConfirm
from
"
./ocgAdapter/ctos/ctosTimeConfirm
"
;
import
GameMsgResponse
from
"
./ocgAdapter/ctos/ctosGameMsgResponse/mod
"
;
import
Chat
from
"
./ocgAdapter/ctos/ctosChat
"
;
export
function
sendUpdateDeck
(
deck
:
IDeck
)
{
const
updateDeck
=
new
ygopro
.
YgoCtosMsg
({
...
...
@@ -119,6 +120,15 @@ export function sendTimeConfirm() {
socketMiddleWare
({
cmd
:
socketCmd
.
SEND
,
payload
});
}
export
function
sendChat
(
message
:
string
)
{
const
chat
=
new
ygopro
.
YgoCtosMsg
({
ctos_chat
:
new
ygopro
.
CtosChat
({
message
}),
});
const
payload
=
new
Chat
(
chat
).
serialize
();
socketMiddleWare
({
cmd
:
socketCmd
.
SEND
,
payload
});
}
export
function
sendSelectIdleCmdResponse
(
value
:
number
)
{
const
response
=
new
ygopro
.
YgoCtosMsg
({
ctos_response
:
new
ygopro
.
CtosGameMsgResponse
({
...
...
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