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
3
Merge Requests
3
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
01450b66
Commit
01450b66
authored
Nov 06, 2022
by
Chunchi Che
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
0d4a92c5
Pipeline
#17772
passed with stages
in 3 minutes and 16 seconds
Changes
19
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
48 additions
and
48 deletions
+48
-48
src/api/ocgcore/ocgAdapter/adapter.ts
src/api/ocgcore/ocgAdapter/adapter.ts
+2
-2
src/api/ocgcore/ocgAdapter/ctos/ctosHandResult.ts
src/api/ocgcore/ocgAdapter/ctos/ctosHandResult.ts
+2
-2
src/api/ocgcore/ocgAdapter/ctos/ctosHsReady.ts
src/api/ocgcore/ocgAdapter/ctos/ctosHsReady.ts
+2
-2
src/api/ocgcore/ocgAdapter/ctos/ctosHsStart.ts
src/api/ocgcore/ocgAdapter/ctos/ctosHsStart.ts
+2
-2
src/api/ocgcore/ocgAdapter/ctos/ctosJoinGame.ts
src/api/ocgcore/ocgAdapter/ctos/ctosJoinGame.ts
+2
-2
src/api/ocgcore/ocgAdapter/ctos/ctosPlayerInfo.ts
src/api/ocgcore/ocgAdapter/ctos/ctosPlayerInfo.ts
+2
-2
src/api/ocgcore/ocgAdapter/ctos/ctosTpResult.ts
src/api/ocgcore/ocgAdapter/ctos/ctosTpResult.ts
+2
-2
src/api/ocgcore/ocgAdapter/ctos/ctosUpdateDeck.ts
src/api/ocgcore/ocgAdapter/ctos/ctosUpdateDeck.ts
+2
-2
src/api/ocgcore/ocgAdapter/stoc/stocChat.ts
src/api/ocgcore/ocgAdapter/stoc/stocChat.ts
+3
-3
src/api/ocgcore/ocgAdapter/stoc/stocDeckCount.ts
src/api/ocgcore/ocgAdapter/stoc/stocDeckCount.ts
+3
-3
src/api/ocgcore/ocgAdapter/stoc/stocGameMsg/mod.ts
src/api/ocgcore/ocgAdapter/stoc/stocGameMsg/mod.ts
+3
-3
src/api/ocgcore/ocgAdapter/stoc/stocHsPlayerChange.ts
src/api/ocgcore/ocgAdapter/stoc/stocHsPlayerChange.ts
+3
-3
src/api/ocgcore/ocgAdapter/stoc/stocHsPlayerEnter.ts
src/api/ocgcore/ocgAdapter/stoc/stocHsPlayerEnter.ts
+3
-3
src/api/ocgcore/ocgAdapter/stoc/stocHsWatchChange.ts
src/api/ocgcore/ocgAdapter/stoc/stocHsWatchChange.ts
+3
-3
src/api/ocgcore/ocgAdapter/stoc/stocJoinGame.ts
src/api/ocgcore/ocgAdapter/stoc/stocJoinGame.ts
+3
-3
src/api/ocgcore/ocgAdapter/stoc/stocSelectHand.ts
src/api/ocgcore/ocgAdapter/stoc/stocSelectHand.ts
+3
-3
src/api/ocgcore/ocgAdapter/stoc/stocSelectTp.ts
src/api/ocgcore/ocgAdapter/stoc/stocSelectTp.ts
+3
-3
src/api/ocgcore/ocgAdapter/stoc/stocTypeChange.ts
src/api/ocgcore/ocgAdapter/stoc/stocTypeChange.ts
+3
-3
src/service/onSocketMessage.ts
src/service/onSocketMessage.ts
+2
-2
No files found.
src/api/ocgcore/ocgAdapter/adapter.ts
View file @
01450b66
import
{
y
goProPacket
}
from
"
./packet
"
;
import
{
Y
goProPacket
}
from
"
./packet
"
;
import
{
ygopro
}
from
"
../idl/ocgcore
"
;
import
{
ygopro
}
from
"
../idl/ocgcore
"
;
import
{
import
{
STOC_CHAT
,
STOC_CHAT
,
...
@@ -30,7 +30,7 @@ import StocDeckCount from "./stoc/stocDeckCount";
...
@@ -30,7 +30,7 @@ import StocDeckCount from "./stoc/stocDeckCount";
* @returns The ygopro.YgoStocMsg object
* @returns The ygopro.YgoStocMsg object
*
*
* */
* */
export
function
adaptStoc
(
packet
:
y
goProPacket
):
ygopro
.
YgoStocMsg
{
export
function
adaptStoc
(
packet
:
Y
goProPacket
):
ygopro
.
YgoStocMsg
{
let
pb
=
new
ygopro
.
YgoStocMsg
({});
let
pb
=
new
ygopro
.
YgoStocMsg
({});
switch
(
packet
.
proto
)
{
switch
(
packet
.
proto
)
{
case
STOC_JOIN_GAME
:
{
case
STOC_JOIN_GAME
:
{
...
...
src/api/ocgcore/ocgAdapter/ctos/ctosHandResult.ts
View file @
01450b66
import
{
ygopro
}
from
"
../../idl/ocgcore
"
;
import
{
ygopro
}
from
"
../../idl/ocgcore
"
;
import
{
y
goProPacket
}
from
"
../packet
"
;
import
{
Y
goProPacket
}
from
"
../packet
"
;
import
{
CTOS_HAND_RESULT
}
from
"
../protoDecl
"
;
import
{
CTOS_HAND_RESULT
}
from
"
../protoDecl
"
;
/*
/*
...
@@ -9,7 +9,7 @@ import { CTOS_HAND_RESULT } from "../protoDecl";
...
@@ -9,7 +9,7 @@ import { CTOS_HAND_RESULT } from "../protoDecl";
*
*
* @usage - 告知服务端当前玩家的猜拳选择
* @usage - 告知服务端当前玩家的猜拳选择
* */
* */
export
default
class
CtosHandResultPacket
extends
y
goProPacket
{
export
default
class
CtosHandResultPacket
extends
Y
goProPacket
{
constructor
(
pb
:
ygopro
.
YgoCtosMsg
)
{
constructor
(
pb
:
ygopro
.
YgoCtosMsg
)
{
const
handResult
=
pb
.
ctos_hand_result
;
const
handResult
=
pb
.
ctos_hand_result
;
...
...
src/api/ocgcore/ocgAdapter/ctos/ctosHsReady.ts
View file @
01450b66
import
{
ygopro
}
from
"
../../idl/ocgcore
"
;
import
{
ygopro
}
from
"
../../idl/ocgcore
"
;
import
{
y
goProPacket
}
from
"
../packet
"
;
import
{
Y
goProPacket
}
from
"
../packet
"
;
import
{
CTOS_HS_READY
}
from
"
../protoDecl
"
;
import
{
CTOS_HS_READY
}
from
"
../protoDecl
"
;
/*
/*
...
@@ -7,7 +7,7 @@ import { CTOS_HS_READY } from "../protoDecl";
...
@@ -7,7 +7,7 @@ import { CTOS_HS_READY } from "../protoDecl";
*
*
* @usage - 告诉ygopro服务端当前玩家准备完毕
* @usage - 告诉ygopro服务端当前玩家准备完毕
* */
* */
export
default
class
CtosHsReady
extends
y
goProPacket
{
export
default
class
CtosHsReady
extends
Y
goProPacket
{
constructor
(
_
:
ygopro
.
YgoCtosMsg
)
{
constructor
(
_
:
ygopro
.
YgoCtosMsg
)
{
super
(
1
,
CTOS_HS_READY
,
new
Uint8Array
(
0
));
super
(
1
,
CTOS_HS_READY
,
new
Uint8Array
(
0
));
}
}
...
...
src/api/ocgcore/ocgAdapter/ctos/ctosHsStart.ts
View file @
01450b66
import
{
ygopro
}
from
"
../../idl/ocgcore
"
;
import
{
ygopro
}
from
"
../../idl/ocgcore
"
;
import
{
y
goProPacket
}
from
"
../packet
"
;
import
{
Y
goProPacket
}
from
"
../packet
"
;
import
{
CTOS_HS_START
}
from
"
../protoDecl
"
;
import
{
CTOS_HS_START
}
from
"
../protoDecl
"
;
/*
/*
...
@@ -7,7 +7,7 @@ import { CTOS_HS_START } from "../protoDecl";
...
@@ -7,7 +7,7 @@ import { CTOS_HS_START } from "../protoDecl";
*
*
* @usage - 开始游戏对局
* @usage - 开始游戏对局
* */
* */
export
default
class
CtosHsStartPacket
extends
y
goProPacket
{
export
default
class
CtosHsStartPacket
extends
Y
goProPacket
{
constructor
(
_
:
ygopro
.
YgoCtosMsg
)
{
constructor
(
_
:
ygopro
.
YgoCtosMsg
)
{
super
(
1
,
CTOS_HS_START
,
new
Uint8Array
(
0
));
super
(
1
,
CTOS_HS_START
,
new
Uint8Array
(
0
));
}
}
...
...
src/api/ocgcore/ocgAdapter/ctos/ctosJoinGame.ts
View file @
01450b66
import
{
ygopro
}
from
"
../../idl/ocgcore
"
;
import
{
ygopro
}
from
"
../../idl/ocgcore
"
;
import
{
y
goProPacket
}
from
"
../packet
"
;
import
{
Y
goProPacket
}
from
"
../packet
"
;
import
{
CTOS_JOIN_GAME
}
from
"
../protoDecl
"
;
import
{
CTOS_JOIN_GAME
}
from
"
../protoDecl
"
;
import
{
strEncodeUTF16
}
from
"
../util
"
;
import
{
strEncodeUTF16
}
from
"
../util
"
;
...
@@ -13,7 +13,7 @@ import { strEncodeUTF16 } from "../util";
...
@@ -13,7 +13,7 @@ import { strEncodeUTF16 } from "../util";
*
*
* @usage - 加入房间
* @usage - 加入房间
* */
* */
export
default
class
CtosJoinGamePacket
extends
y
goProPacket
{
export
default
class
CtosJoinGamePacket
extends
Y
goProPacket
{
constructor
(
pb
:
ygopro
.
YgoCtosMsg
)
{
constructor
(
pb
:
ygopro
.
YgoCtosMsg
)
{
const
joinGame
=
pb
.
ctos_join_game
;
const
joinGame
=
pb
.
ctos_join_game
;
...
...
src/api/ocgcore/ocgAdapter/ctos/ctosPlayerInfo.ts
View file @
01450b66
import
{
ygopro
}
from
"
../../idl/ocgcore
"
;
import
{
ygopro
}
from
"
../../idl/ocgcore
"
;
import
{
y
goProPacket
}
from
"
../packet
"
;
import
{
Y
goProPacket
}
from
"
../packet
"
;
import
{
CTOS_PLAYER_INFO
}
from
"
../protoDecl
"
;
import
{
CTOS_PLAYER_INFO
}
from
"
../protoDecl
"
;
import
{
strEncodeUTF16
}
from
"
../util
"
;
import
{
strEncodeUTF16
}
from
"
../util
"
;
...
@@ -10,7 +10,7 @@ import { strEncodeUTF16 } from "../util";
...
@@ -10,7 +10,7 @@ import { strEncodeUTF16 } from "../util";
*
*
* @usage - 告诉ygopro服务端当前玩家的昵称
* @usage - 告诉ygopro服务端当前玩家的昵称
* */
* */
export
default
class
CtosPlayerInfoPacket
extends
y
goProPacket
{
export
default
class
CtosPlayerInfoPacket
extends
Y
goProPacket
{
constructor
(
pb
:
ygopro
.
YgoCtosMsg
)
{
constructor
(
pb
:
ygopro
.
YgoCtosMsg
)
{
const
player
=
pb
.
ctos_player_info
.
name
;
const
player
=
pb
.
ctos_player_info
.
name
;
const
exData
=
strEncodeUTF16
(
player
);
const
exData
=
strEncodeUTF16
(
player
);
...
...
src/api/ocgcore/ocgAdapter/ctos/ctosTpResult.ts
View file @
01450b66
import
{
ygopro
}
from
"
../../idl/ocgcore
"
;
import
{
ygopro
}
from
"
../../idl/ocgcore
"
;
import
{
y
goProPacket
}
from
"
../packet
"
;
import
{
Y
goProPacket
}
from
"
../packet
"
;
import
{
CTOS_TP_RESULT
}
from
"
../protoDecl
"
;
import
{
CTOS_TP_RESULT
}
from
"
../protoDecl
"
;
/*
/*
...
@@ -10,7 +10,7 @@ import { CTOS_TP_RESULT } from "../protoDecl";
...
@@ -10,7 +10,7 @@ import { CTOS_TP_RESULT } from "../protoDecl";
* @usage - 告知服务端当前玩家的先后攻选择
* @usage - 告知服务端当前玩家的先后攻选择
*
*
* */
* */
export
default
class
CtosTpResultPacket
extends
y
goProPacket
{
export
default
class
CtosTpResultPacket
extends
Y
goProPacket
{
constructor
(
pb
:
ygopro
.
YgoCtosMsg
)
{
constructor
(
pb
:
ygopro
.
YgoCtosMsg
)
{
const
tpResult
=
pb
.
ctos_tp_result
;
const
tpResult
=
pb
.
ctos_tp_result
;
...
...
src/api/ocgcore/ocgAdapter/ctos/ctosUpdateDeck.ts
View file @
01450b66
import
{
ygopro
}
from
"
../../idl/ocgcore
"
;
import
{
ygopro
}
from
"
../../idl/ocgcore
"
;
import
{
y
goProPacket
}
from
"
../packet
"
;
import
{
Y
goProPacket
}
from
"
../packet
"
;
import
{
CTOS_UPDATE_DECK
}
from
"
../protoDecl
"
;
import
{
CTOS_UPDATE_DECK
}
from
"
../protoDecl
"
;
const
BYTES_PER_U32
=
4
;
const
BYTES_PER_U32
=
4
;
...
@@ -16,7 +16,7 @@ const BYTES_PER_U32 = 4;
...
@@ -16,7 +16,7 @@ const BYTES_PER_U32 = 4;
*
*
* @usage - 更新对局的卡组信息
* @usage - 更新对局的卡组信息
* */
* */
export
default
class
CtosUpdateDeck
extends
y
goProPacket
{
export
default
class
CtosUpdateDeck
extends
Y
goProPacket
{
constructor
(
pb
:
ygopro
.
YgoCtosMsg
)
{
constructor
(
pb
:
ygopro
.
YgoCtosMsg
)
{
const
updateDeck
=
pb
.
ctos_update_deck
;
const
updateDeck
=
pb
.
ctos_update_deck
;
const
main
=
updateDeck
.
main
;
const
main
=
updateDeck
.
main
;
...
...
src/api/ocgcore/ocgAdapter/stoc/stocChat.ts
View file @
01450b66
import
{
ygopro
}
from
"
../../idl/ocgcore
"
;
import
{
ygopro
}
from
"
../../idl/ocgcore
"
;
import
{
y
goProPacket
,
StocAdapter
}
from
"
../packet
"
;
import
{
Y
goProPacket
,
StocAdapter
}
from
"
../packet
"
;
/*
/*
* STOC Chat
* STOC Chat
...
@@ -10,9 +10,9 @@ import { ygoProPacket, StocAdapter } from "../packet";
...
@@ -10,9 +10,9 @@ import { ygoProPacket, StocAdapter } from "../packet";
* @usage - 更新聊天消息
* @usage - 更新聊天消息
* */
* */
export
default
class
ChatAdapter
implements
StocAdapter
{
export
default
class
ChatAdapter
implements
StocAdapter
{
packet
:
y
goProPacket
;
packet
:
Y
goProPacket
;
constructor
(
packet
:
y
goProPacket
)
{
constructor
(
packet
:
Y
goProPacket
)
{
this
.
packet
=
packet
;
this
.
packet
=
packet
;
}
}
...
...
src/api/ocgcore/ocgAdapter/stoc/stocDeckCount.ts
View file @
01450b66
import
{
ygopro
}
from
"
../../idl/ocgcore
"
;
import
{
ygopro
}
from
"
../../idl/ocgcore
"
;
import
{
y
goProPacket
,
StocAdapter
}
from
"
../packet
"
;
import
{
Y
goProPacket
,
StocAdapter
}
from
"
../packet
"
;
const
LITTLE_ENDIAN
=
true
;
const
LITTLE_ENDIAN
=
true
;
const
INT16_BYTE_OFFSET
=
2
;
const
INT16_BYTE_OFFSET
=
2
;
...
@@ -13,9 +13,9 @@ const INT16_BYTE_OFFSET = 2;
...
@@ -13,9 +13,9 @@ const INT16_BYTE_OFFSET = 2;
* */
* */
export
default
class
DeckCountAdapter
implements
StocAdapter
{
export
default
class
DeckCountAdapter
implements
StocAdapter
{
packet
:
y
goProPacket
;
packet
:
Y
goProPacket
;
constructor
(
packet
:
y
goProPacket
)
{
constructor
(
packet
:
Y
goProPacket
)
{
this
.
packet
=
packet
;
this
.
packet
=
packet
;
}
}
...
...
src/api/ocgcore/ocgAdapter/stoc/stocGameMsg/mod.ts
View file @
01450b66
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
* */
* */
import
{
ygopro
}
from
"
../../../idl/ocgcore
"
;
import
{
ygopro
}
from
"
../../../idl/ocgcore
"
;
import
{
y
goProPacket
,
StocAdapter
}
from
"
../../packet
"
;
import
{
Y
goProPacket
,
StocAdapter
}
from
"
../../packet
"
;
/*
/*
* STOC GameMsg
* STOC GameMsg
...
@@ -15,9 +15,9 @@ import { ygoProPacket, StocAdapter } from "../../packet";
...
@@ -15,9 +15,9 @@ import { ygoProPacket, StocAdapter } from "../../packet";
* @usage - 服务端告诉前端/客户端决斗对局中的UI展示逻辑
* @usage - 服务端告诉前端/客户端决斗对局中的UI展示逻辑
* */
* */
export
default
class
GameMsgAdapter
implements
StocAdapter
{
export
default
class
GameMsgAdapter
implements
StocAdapter
{
packet
:
y
goProPacket
;
packet
:
Y
goProPacket
;
constructor
(
packet
:
y
goProPacket
)
{
constructor
(
packet
:
Y
goProPacket
)
{
this
.
packet
=
packet
;
this
.
packet
=
packet
;
}
}
...
...
src/api/ocgcore/ocgAdapter/stoc/stocHsPlayerChange.ts
View file @
01450b66
import
{
ygopro
}
from
"
../../idl/ocgcore
"
;
import
{
ygopro
}
from
"
../../idl/ocgcore
"
;
import
{
y
goProPacket
,
StocAdapter
}
from
"
../packet
"
;
import
{
Y
goProPacket
,
StocAdapter
}
from
"
../packet
"
;
/*
/*
* STOC HsPlayerChange
* STOC HsPlayerChange
...
@@ -9,9 +9,9 @@ import { ygoProPacket, StocAdapter } from "../packet";
...
@@ -9,9 +9,9 @@ import { ygoProPacket, StocAdapter } from "../packet";
* @usage - 更新玩家状态
* @usage - 更新玩家状态
* */
* */
export
default
class
HsPlayerChangeAdapter
implements
StocAdapter
{
export
default
class
HsPlayerChangeAdapter
implements
StocAdapter
{
packet
:
y
goProPacket
;
packet
:
Y
goProPacket
;
constructor
(
packet
:
y
goProPacket
)
{
constructor
(
packet
:
Y
goProPacket
)
{
this
.
packet
=
packet
;
this
.
packet
=
packet
;
}
}
...
...
src/api/ocgcore/ocgAdapter/stoc/stocHsPlayerEnter.ts
View file @
01450b66
import
{
ygopro
}
from
"
../../idl/ocgcore
"
;
import
{
ygopro
}
from
"
../../idl/ocgcore
"
;
import
{
y
goProPacket
,
StocAdapter
}
from
"
../packet
"
;
import
{
Y
goProPacket
,
StocAdapter
}
from
"
../packet
"
;
import
{
UTF16_BUFFER_MAX_LEN
}
from
"
../util
"
;
import
{
UTF16_BUFFER_MAX_LEN
}
from
"
../util
"
;
const
UINT8_PER_UINT16
=
2
;
const
UINT8_PER_UINT16
=
2
;
...
@@ -13,9 +13,9 @@ const UINT8_PER_UINT16 = 2;
...
@@ -13,9 +13,9 @@ const UINT8_PER_UINT16 = 2;
* @usage - 有新玩家进入房间,更新状态
* @usage - 有新玩家进入房间,更新状态
* */
* */
export
default
class
HsPlayerEnterAdapter
implements
StocAdapter
{
export
default
class
HsPlayerEnterAdapter
implements
StocAdapter
{
packet
:
y
goProPacket
;
packet
:
Y
goProPacket
;
constructor
(
packet
:
y
goProPacket
)
{
constructor
(
packet
:
Y
goProPacket
)
{
this
.
packet
=
packet
;
this
.
packet
=
packet
;
}
}
...
...
src/api/ocgcore/ocgAdapter/stoc/stocHsWatchChange.ts
View file @
01450b66
import
{
ygopro
}
from
"
../../idl/ocgcore
"
;
import
{
ygopro
}
from
"
../../idl/ocgcore
"
;
import
{
y
goProPacket
,
StocAdapter
}
from
"
../packet
"
;
import
{
Y
goProPacket
,
StocAdapter
}
from
"
../packet
"
;
/*
/*
* STOC HsWatchChange
* STOC HsWatchChange
...
@@ -9,9 +9,9 @@ import { ygoProPacket, StocAdapter } from "../packet";
...
@@ -9,9 +9,9 @@ import { ygoProPacket, StocAdapter } from "../packet";
* @usage - 更新观战者数量
* @usage - 更新观战者数量
* */
* */
export
default
class
HsWatchChangeAdapter
implements
StocAdapter
{
export
default
class
HsWatchChangeAdapter
implements
StocAdapter
{
packet
:
y
goProPacket
;
packet
:
Y
goProPacket
;
constructor
(
packet
:
y
goProPacket
)
{
constructor
(
packet
:
Y
goProPacket
)
{
this
.
packet
=
packet
;
this
.
packet
=
packet
;
}
}
...
...
src/api/ocgcore/ocgAdapter/stoc/stocJoinGame.ts
View file @
01450b66
import
{
ygopro
}
from
"
../../idl/ocgcore
"
;
import
{
ygopro
}
from
"
../../idl/ocgcore
"
;
import
{
y
goProPacket
,
StocAdapter
}
from
"
../packet
"
;
import
{
Y
goProPacket
,
StocAdapter
}
from
"
../packet
"
;
/*
/*
* STOC JoinGame
* STOC JoinGame
...
@@ -7,9 +7,9 @@ import { ygoProPacket, StocAdapter } from "../packet";
...
@@ -7,9 +7,9 @@ import { ygoProPacket, StocAdapter } from "../packet";
* @usage - 告知客户端/前端已成功加入房间
* @usage - 告知客户端/前端已成功加入房间
* */
* */
export
default
class
JoinGameAdapter
implements
StocAdapter
{
export
default
class
JoinGameAdapter
implements
StocAdapter
{
packet
:
y
goProPacket
;
packet
:
Y
goProPacket
;
constructor
(
packet
:
y
goProPacket
)
{
constructor
(
packet
:
Y
goProPacket
)
{
this
.
packet
=
packet
;
this
.
packet
=
packet
;
}
}
...
...
src/api/ocgcore/ocgAdapter/stoc/stocSelectHand.ts
View file @
01450b66
import
{
ygopro
}
from
"
../../idl/ocgcore
"
;
import
{
ygopro
}
from
"
../../idl/ocgcore
"
;
import
{
y
goProPacket
,
StocAdapter
}
from
"
../packet
"
;
import
{
Y
goProPacket
,
StocAdapter
}
from
"
../packet
"
;
/*
/*
* STOC SelectHand
* STOC SelectHand
...
@@ -7,9 +7,9 @@ import { ygoProPacket, StocAdapter } from "../packet";
...
@@ -7,9 +7,9 @@ import { ygoProPacket, StocAdapter } from "../packet";
* @usage - 通知客户端/前端提醒用户进行猜拳选择
* @usage - 通知客户端/前端提醒用户进行猜拳选择
* */
* */
export
default
class
SelectHand
implements
StocAdapter
{
export
default
class
SelectHand
implements
StocAdapter
{
packet
:
y
goProPacket
;
packet
:
Y
goProPacket
;
constructor
(
packet
:
y
goProPacket
)
{
constructor
(
packet
:
Y
goProPacket
)
{
this
.
packet
=
packet
;
this
.
packet
=
packet
;
}
}
...
...
src/api/ocgcore/ocgAdapter/stoc/stocSelectTp.ts
View file @
01450b66
import
{
ygopro
}
from
"
../../idl/ocgcore
"
;
import
{
ygopro
}
from
"
../../idl/ocgcore
"
;
import
{
y
goProPacket
,
StocAdapter
}
from
"
../packet
"
;
import
{
Y
goProPacket
,
StocAdapter
}
from
"
../packet
"
;
/*
/*
* STOC SelectTp
* STOC SelectTp
...
@@ -7,9 +7,9 @@ import { ygoProPacket, StocAdapter } from "../packet";
...
@@ -7,9 +7,9 @@ import { ygoProPacket, StocAdapter } from "../packet";
* @usage - 通知客户端/前端提醒用户进行选先后攻
* @usage - 通知客户端/前端提醒用户进行选先后攻
* */
* */
export
default
class
SelectTp
implements
StocAdapter
{
export
default
class
SelectTp
implements
StocAdapter
{
packet
:
y
goProPacket
;
packet
:
Y
goProPacket
;
constructor
(
packet
:
y
goProPacket
)
{
constructor
(
packet
:
Y
goProPacket
)
{
this
.
packet
=
packet
;
this
.
packet
=
packet
;
}
}
...
...
src/api/ocgcore/ocgAdapter/stoc/stocTypeChange.ts
View file @
01450b66
import
{
ygopro
}
from
"
../../idl/ocgcore
"
;
import
{
ygopro
}
from
"
../../idl/ocgcore
"
;
import
{
y
goProPacket
,
StocAdapter
}
from
"
../packet
"
;
import
{
Y
goProPacket
,
StocAdapter
}
from
"
../packet
"
;
/*
/*
* STOC TypeChange
* STOC TypeChange
...
@@ -9,9 +9,9 @@ import { ygoProPacket, StocAdapter } from "../packet";
...
@@ -9,9 +9,9 @@ import { ygoProPacket, StocAdapter } from "../packet";
* @usage - 更新玩家状态
* @usage - 更新玩家状态
* */
* */
export
default
class
TypeChangeAdapter
implements
StocAdapter
{
export
default
class
TypeChangeAdapter
implements
StocAdapter
{
packet
:
y
goProPacket
;
packet
:
Y
goProPacket
;
constructor
(
packet
:
y
goProPacket
)
{
constructor
(
packet
:
Y
goProPacket
)
{
this
.
packet
=
packet
;
this
.
packet
=
packet
;
}
}
...
...
src/service/onSocketMessage.ts
View file @
01450b66
...
@@ -8,7 +8,7 @@ import handleHsPlayerEnter from "./room/hsPlayerEnter";
...
@@ -8,7 +8,7 @@ import handleHsPlayerEnter from "./room/hsPlayerEnter";
import
handleJoinGame
from
"
./room/joinGame
"
;
import
handleJoinGame
from
"
./room/joinGame
"
;
import
handleChat
from
"
./room/chat
"
;
import
handleChat
from
"
./room/chat
"
;
import
handleHsWatchChange
from
"
./room/hsWatchChange
"
;
import
handleHsWatchChange
from
"
./room/hsWatchChange
"
;
import
{
y
goProPacket
}
from
"
../api/ocgcore/ocgAdapter/packet
"
;
import
{
Y
goProPacket
}
from
"
../api/ocgcore/ocgAdapter/packet
"
;
import
{
adaptStoc
}
from
"
../api/ocgcore/ocgAdapter/adapter
"
;
import
{
adaptStoc
}
from
"
../api/ocgcore/ocgAdapter/adapter
"
;
import
handleSelectHand
from
"
./mora/selectHand
"
;
import
handleSelectHand
from
"
./mora/selectHand
"
;
import
handleSelectTp
from
"
./mora/selectTp
"
;
import
handleSelectTp
from
"
./mora/selectTp
"
;
...
@@ -20,7 +20,7 @@ import handleDeckCount from "./mora/deckCount";
...
@@ -20,7 +20,7 @@ import handleDeckCount from "./mora/deckCount";
*
*
* */
* */
export
default
function
handleSocketMessage
(
e
:
MessageEvent
)
{
export
default
function
handleSocketMessage
(
e
:
MessageEvent
)
{
const
packet
=
y
goProPacket
.
deserialize
(
e
.
data
);
const
packet
=
Y
goProPacket
.
deserialize
(
e
.
data
);
const
pb
=
adaptStoc
(
packet
);
const
pb
=
adaptStoc
(
packet
);
switch
(
pb
.
msg
)
{
switch
(
pb
.
msg
)
{
...
...
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