Commit d6111209 authored by Chunchi Che's avatar Chunchi Che

Merge branch 'feat/callstack' into 'main'

Feat/callstack

See merge request mycard/Neos!146
parents e9d1b91f 2ba135b6
neos-protobuf @ 91892bf3
Subproject commit 3973685c657030b845ef385e8a0610971c8c60b9
Subproject commit 91892bf33e2359f6617c82b0f5f3617ed36f3540
{
"version": 4948,
"servers": [
{
"ip": "koishi-r.momobako.com",
"port": "7211"
}
],
"assetsPath": "/neos-assets",
"cardImgUrl": "https://cdn02.moecube.com:444/images/ygopro-images-zh-CN",
"cardsDbUrl": "https://cdn02.moecube.com:444/ygopro-database/zh-CN/cards.cdb",
"stringsUrl": "https://cdn02.moecube.com:444/ygopro-database/zh-CN/strings.conf",
"ui": {
"ground": {
"width": 9.9,
"height": 8
},
"card": {
"transform": {
"x": 0.8,
"y": 1,
"z": 0.05
},
"rotation": {
"x": 1.55,
"y": 0,
"z": 0
},
"reverseRotation": {
"x": 1.55,
"y": 3.1,
"z": 0
},
"defenceRotation": {
"x": 1.55,
"y": 1.55,
"z": 0
},
"handRotation": {
"x": 1,
"y": 0,
"z": 0
},
"handHoverScaling": {
"x": 1.2,
"y": 1.2,
"z": 1
"version":4948,
"servers":[
{
"ip":"koishi-r.momobako.com",
"port":"7211"
}
],
"assetsPath":"/neos-assets",
"cardImgUrl":"https://cdn02.moecube.com:444/images/ygopro-images-zh-CN",
"cardsDbUrl":"https://cdn02.moecube.com:444/ygopro-database/zh-CN/cards.cdb",
"stringsUrl":"https://cdn02.moecube.com:444/ygopro-database/zh-CN/strings.conf",
"ui":{
"ground":{
"width":9.9,
"height":8
},
"floating": 0.02
},
"layout": {
"header": {
"height": 80
"card":{
"transform":{
"x":0.8,
"y":1,
"z":0.05
},
"rotation":{
"x":1.55,
"y":0,
"z":0
},
"reverseRotation":{
"x":1.55,
"y":3.1,
"z":0
},
"defenceRotation":{
"x":1.55,
"y":1.55,
"z":0
},
"handRotation":{
"x":1,
"y":0,
"z":0
},
"handHoverScaling":{
"x":1.2,
"y":1.2,
"z":1
},
"floating":0.02
},
"content": {
"height": 800
"layout":{
"header":{
"height":80
},
"content":{
"height":800
},
"sider":{
"width":300
},
"footer":{
"height":80
}
},
"sider": {
"width": 300
"status":{
"avatarSize":40,
"meAvatarColor":"#0e63e1",
"opAvatarColor":"#e10e68"
},
"footer": {
"height": 80
"hint":{
"waitingDuration":1.5
}
},
"status": {
"avatarSize": 40,
"meAvatarColor": "#0e63e1",
"opAvatarColor": "#e10e68"
},
"hint": {
"waitingDuration": 1.5
}
}
},
"unimplementedWhiteList":[
1,
6,
7,
30,
31,
32,
34,
54,
55,
56,
60,
61,
62,
63,
64,
65,
70,
71,
72,
73,
74,
75,
76,
80,
81,
83,
93,
95,
96,
97,
101,
102,
110,
111,
112,
113,
114,
120,
121,
122,
123,
130,
131,
132,
133,
160,
161,
163,
164,
165,
170,
180
]
}
{
"version": 4948,
"servers": [
{
"ip": "koishi-r.momobako.com",
"port": "7211"
}
],
"assetsPath": "https://cdn02.moecube.com:444/neos/neos-assets",
"cardImgUrl": "https://cdn02.moecube.com:444/images/ygopro-images-zh-CN",
"cardsDbUrl": "https://cdn02.moecube.com:444/ygopro-database/zh-CN/cards.cdb",
"stringsUrl": "https://cdn02.moecube.com:444/ygopro-database/zh-CN/strings.conf",
"ui": {
"ground": {
"width": 9.9,
"height": 8
},
"card": {
"transform": {
"x": 0.8,
"y": 1,
"z": 0.05
},
"rotation": {
"x": 1.55,
"y": 0,
"z": 0
},
"reverseRotation": {
"x": 1.55,
"y": 3.1,
"z": 0
},
"defenceRotation": {
"x": 1.55,
"y": 1.55,
"z": 0
},
"handRotation": {
"x": 1,
"y": 0,
"z": 0
},
"handHoverScaling": {
"x": 1.2,
"y": 1.2,
"z": 1
"version":4948,
"servers":[
{
"ip":"koishi-r.momobako.com",
"port":"7211"
}
],
"assetsPath":"/neos-assets",
"cardImgUrl":"https://cdn02.moecube.com:444/images/ygopro-images-zh-CN",
"cardsDbUrl":"https://cdn02.moecube.com:444/ygopro-database/zh-CN/cards.cdb",
"stringsUrl":"https://cdn02.moecube.com:444/ygopro-database/zh-CN/strings.conf",
"ui":{
"ground":{
"width":9.9,
"height":8
},
"floating": 0.02
},
"layout": {
"header": {
"height": 80
"card":{
"transform":{
"x":0.8,
"y":1,
"z":0.05
},
"rotation":{
"x":1.55,
"y":0,
"z":0
},
"reverseRotation":{
"x":1.55,
"y":3.1,
"z":0
},
"defenceRotation":{
"x":1.55,
"y":1.55,
"z":0
},
"handRotation":{
"x":1,
"y":0,
"z":0
},
"handHoverScaling":{
"x":1.2,
"y":1.2,
"z":1
},
"floating":0.02
},
"content": {
"height": 800
"layout":{
"header":{
"height":80
},
"content":{
"height":800
},
"sider":{
"width":300
},
"footer":{
"height":80
}
},
"sider": {
"width": 300
"status":{
"avatarSize":40,
"meAvatarColor":"#0e63e1",
"opAvatarColor":"#e10e68"
},
"footer": {
"height": 80
"hint":{
"waitingDuration":1.5
}
},
"status": {
"avatarSize": 40,
"meAvatarColor": "#0e63e1",
"opAvatarColor": "#e10e68"
},
"hint": {
"waitingDuration": 1.5
}
}
},
"unimplementedWhiteList":[
1,
6,
7,
30,
31,
32,
34,
54,
55,
56,
60,
61,
62,
63,
64,
65,
70,
71,
72,
73,
74,
75,
76,
80,
81,
83,
93,
95,
96,
97,
101,
102,
110,
111,
112,
113,
114,
120,
121,
122,
123,
130,
131,
132,
133,
160,
161,
163,
164,
165,
170,
180
]
}
This diff is collapsed.
......@@ -149,7 +149,9 @@ export default class GameMsgAdapter implements StocAdapter {
break;
}
default: {
console.log("Unhandled GameMessage function=", func);
gameMsg.unimplemented = new ygopro.StocGameMessage.MsgUnimplemented({
command: func,
});
break;
}
......
......@@ -144,6 +144,8 @@ export interface DuelState {
waiting?: boolean;
unimplemented?: number; // 未处理的`Message`
// UI相关
modalState: ModalState;
}
......@@ -264,6 +266,11 @@ const duelSlice = createSlice({
setWaiting: (state, action: PayloadAction<boolean>) => {
state.waiting = action.payload;
},
// 未处理状态`Reducer`
setUnimplemented: (state, action: PayloadAction<number>) => {
state.unimplemented = action.payload;
},
},
extraReducers(builder) {
handsCase(builder);
......@@ -344,6 +351,7 @@ export const {
clearAllPlaceInteractivities,
setResult,
setWaiting,
setUnimplemented,
} = duelSlice.actions;
export const selectDuelHsStart = (state: RootState) => {
return state.duel.meInitInfo != null;
......@@ -354,4 +362,7 @@ export const selectDuelResult = (state: RootState) => {
export const selectWaiting = (state: RootState) => {
return state.duel.waiting;
};
export const selectUnimplemented = (state: RootState) => {
return state.duel.unimplemented;
};
export default duelSlice.reducer;
......@@ -21,6 +21,7 @@ import onMsgSelectYesNo from "./selectYesNo";
import onMsgUpdateHp from "./updateHp";
import onMsgWin from "./win";
import onMsgWait from "./wait";
import onUnimplemented from "./unimplemented";
import { setWaiting } from "../../reducers/duel/mod";
const ActiveList = [
......@@ -150,6 +151,11 @@ export default function handleGameMsg(pb: ygopro.YgoStocMsg) {
break;
}
case "unimplemented": {
onUnimplemented(msg.unimplemented, dispatch);
break;
}
default: {
break;
}
......
import { ygopro } from "../../api/ocgcore/idl/ocgcore";
import { setUnimplemented } from "../../reducers/duel/mod";
import { AppDispatch } from "../../store";
import NeosConfig from "../../../neos.config.json";
export default (
unimplemented: ygopro.StocGameMessage.MsgUnimplemented,
dispatch: AppDispatch
) => {
if (!NeosConfig.unimplementedWhiteList.includes(unimplemented.command)) {
dispatch(setUnimplemented(unimplemented.command));
}
};
import React from "react";
export const Button2D = (props: {
text: string;
left: number;
enable: boolean;
onClick: () => void;
}) => (
<adtFullscreenUi name="ui">
<rectangle
name="rect"
height="20px"
width="60px"
isEnabled={props.enable}
left={props.left}
>
<rectangle>
<babylon-button
name="close-icon"
onPointerDownObservable={props.onClick}
>
<textBlock
text={props.text}
fontFamily="FontAwesome"
fontStyle="bold"
fontSize={15}
color={props.enable ? "yellow" : "white"}
/>
</babylon-button>
</rectangle>
</rectangle>
</adtFullscreenUi>
);
import React from "react";
import { useNavigate } from "react-router-dom";
import { sendSurrender } from "../../api/ocgcore/ocgHelper";
import { useAppSelector } from "../../hook";
import { selectUnimplemented } from "../../reducers/duel/mod";
import { Alert } from "antd";
const NeosAlert = () => {
const unimplemented = useAppSelector(selectUnimplemented);
const navigate = useNavigate();
return (
<>
{unimplemented ? (
<Alert
message={`Unimplemented message with code=${unimplemented}`}
description="It seems that there's something unimplemented by Neos. Sincerely apologize for that. Contact use to fix this issue: <linuxgnulover@gmail.com>"
showIcon
type="error"
closable
banner
afterClose={() => {
// 发送投降信号
sendSurrender();
navigate("/");
}}
/>
) : (
<></>
)}
</>
);
};
export default NeosAlert;
......@@ -25,11 +25,13 @@ import DuelTimeLine from "./timeLine";
import { Row } from "antd";
import SendBox from "./sendBox";
import PlayerStatus from "./status";
import Alert from "./alert";
// Ref: https://github.com/brianzinn/react-babylonjs/issues/126
const NeosDuel = () => {
return (
<>
<Alert />
<NeosLayout
sider={<NeosSider />}
header={<PlayerStatus />}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment