Commit dbc42578 authored by Chunchi Che's avatar Chunchi Che

Merge branch 'fix/version' into 'main'

Fix/version

See merge request mycard/Neos!115
parents 5c785489 db40a6a8
Pipeline #20463 failed with stages
in 1 minute and 9 seconds
{
"version": 4948,
"servers": [{
"ip": "koishi-r.momobako.com",
"port": "7211"
}],
"assetsPath": "/neos-assets",
"cardImgUrl": "https://cdn02.moecube.com:444/images/ygopro-images-zh-CN",
"ui": {
......
......@@ -3,6 +3,7 @@
*
* */
import { sendJoinGame, sendPlayerInfo } from "../api/ocgcore/ocgHelper";
import NeosConfig from "../../neos.config.json";
/*
* 长连接建立后,需要马上发送PlayerInfo和JoinGame两个数据包,
......@@ -11,7 +12,7 @@ import { sendJoinGame, sendPlayerInfo } from "../api/ocgcore/ocgHelper";
* */
export default function handleSocketOpen(
ws: WebSocket | null,
ip: string,
_ip: string,
player: string,
passWd: string
) {
......@@ -21,6 +22,6 @@ export default function handleSocketOpen(
ws.binaryType = "arraybuffer";
sendPlayerInfo(ws, player);
sendJoinGame(ws, 4947, passWd); // todo: version use config
sendJoinGame(ws, NeosConfig.version, passWd); // todo: version use config
}
}
......@@ -12,10 +12,12 @@ import { useNavigate } from "react-router-dom";
import "../styles/core.scss";
import NeosConfig from "../../neos.config.json";
const serverConfig = NeosConfig.servers;
export default function Login() {
const [player, setPlayer] = useState("");
const [passWd, setPasswd] = useState("");
const [ip, setIp] = useState("");
const [ip, setIp] = useState(`${serverConfig[0].ip}:${serverConfig[0].port}`);
const navigate = useNavigate();
let handlePlayerChange = (event: ChangeEvent<HTMLInputElement>) => {
......
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