[mod] 拔掉別名

This commit is contained in:
建喵 2024-08-26 17:17:41 +08:00
parent 1d0ad3fd99
commit a22640bd2b
8 changed files with 32 additions and 56 deletions

View File

@ -1,7 +1,7 @@
import { INetRequest } from "@/script/Engine/CatanEngine/NetManagerV2/Core/INetRequest";
import { INetResponse } from "@/script/Engine/CatanEngine/NetManagerV2/Core/INetResponse";
import { RpcAccountLoginRequest, RpcAccountLoginResponse } from "@/shared/protocols/AccountRequest";
import { ClientData } from "@/shared/protocols/define/interface";
import { INetRequest } from "../../script/Engine/CatanEngine/NetManagerV2/Core/INetRequest";
import { INetResponse } from "../../script/Engine/CatanEngine/NetManagerV2/Core/INetResponse";
import { RpcAccountLoginRequest, RpcAccountLoginResponse } from "../../shared/protocols/AccountRequest";
import { ClientData } from "../../shared/protocols/define/interface";
export default function* (clientData: ClientData, req: INetRequest<RpcAccountLoginRequest>): IterableIterator<any> {
const data: RpcAccountLoginRequest = req.Data

View File

@ -1,5 +1,5 @@
import { INetRequest } from "@/script/Engine/CatanEngine/NetManagerV2/Core/INetRequest";
import { ClientData } from "@/shared/protocols/define/interface";
import { INetRequest } from "../../script/Engine/CatanEngine/NetManagerV2/Core/INetRequest";
import { ClientData } from "../../shared/protocols/define/interface";
export default function* (clientData: ClientData, req: INetRequest<any>): IterableIterator<any> {
const data = req.Data

View File

@ -1,7 +1,7 @@
import { INetRequest } from "@/script/Engine/CatanEngine/NetManagerV2/Core/INetRequest";
import { INetResponse } from "@/script/Engine/CatanEngine/NetManagerV2/Core/INetResponse";
import { ClientData } from "@/shared/protocols/define/interface";
import { RpcSlotInRequest, RpcSlotInResponse } from "@/shared/protocols/SlotRequest";
import { INetRequest } from "../../script/Engine/CatanEngine/NetManagerV2/Core/INetRequest";
import { INetResponse } from "../../script/Engine/CatanEngine/NetManagerV2/Core/INetResponse";
import { ClientData } from "../../shared/protocols/define/interface";
import { RpcSlotInRequest, RpcSlotInResponse } from "../../shared/protocols/SlotRequest";
export default function* (clientData: ClientData, req: INetRequest<RpcSlotInRequest>): IterableIterator<any> {
const data: RpcSlotInRequest = req.Data

View File

@ -1,8 +1,8 @@
import { INetRequest } from "@/script/Engine/CatanEngine/NetManagerV2/Core/INetRequest";
import { INetResponse } from "@/script/Engine/CatanEngine/NetManagerV2/Core/INetResponse";
import { ClientData } from "@/shared/protocols/define/interface";
import { RpcSlot1SpinRequest, RpcSlot1SpinResponse } from "@/shared/protocols/Slot1Request";
import { RandomEx } from "@/Utils/Number/RandomEx";
import { INetRequest } from "../../script/Engine/CatanEngine/NetManagerV2/Core/INetRequest";
import { INetResponse } from "../../script/Engine/CatanEngine/NetManagerV2/Core/INetResponse";
import { ClientData } from "../../shared/protocols/define/interface";
import { RpcSlot1SpinRequest, RpcSlot1SpinResponse } from "../../shared/protocols/Slot1Request";
import { RandomEx } from "../../Utils/Number/RandomEx";
export default function* (clientData: ClientData, req: INetRequest<RpcSlot1SpinRequest>): IterableIterator<any> {
const data: RpcSlot1SpinRequest = req.Data

View File

@ -1,8 +1,8 @@
import { INetRequest } from "@/script/Engine/CatanEngine/NetManagerV2/Core/INetRequest";
import { INetResponse } from "@/script/Engine/CatanEngine/NetManagerV2/Core/INetResponse";
import { ClientData } from "@/shared/protocols/define/interface";
import { RpcSlot1SpinRequest, RpcSlot1SpinResponse } from "@/shared/protocols/Slot1Request";
import { RandomEx } from "@/Utils/Number/RandomEx";
import { INetRequest } from "../../script/Engine/CatanEngine/NetManagerV2/Core/INetRequest";
import { INetResponse } from "../../script/Engine/CatanEngine/NetManagerV2/Core/INetResponse";
import { ClientData } from "../../shared/protocols/define/interface";
import { RpcSlot1SpinRequest, RpcSlot1SpinResponse } from "../../shared/protocols/Slot1Request";
import { RandomEx } from "../../Utils/Number/RandomEx";
export default function* (clientData: ClientData, req: INetRequest<RpcSlot1SpinRequest>): IterableIterator<any> {
const data: RpcSlot1SpinRequest = req.Data

View File

@ -5,12 +5,12 @@ import "module-alias/register";
// // 必載入
// import "../Utils/catan.ts";
import { BaseEnumerator } from "@/CatanEngine/CoroutineV2/Core/BaseEnumerator";
import { NetConnector } from "@/script/Engine/CatanEngine/NetManagerV2/NetConnector";
import dotenv from 'dotenv';
import { app, BrowserWindow, ipcMain } from 'electron';
import * as path from 'path';
import { WebSocketServer } from 'ws';
import { BaseEnumerator } from "../CatanEngine/CoroutineV2/Core/BaseEnumerator";
import { NetConnector } from "../script/Engine/CatanEngine/NetManagerV2/NetConnector";
onload();

View File

@ -1,9 +1,9 @@
import { CoroutineV2 } from "@/CatanEngine/CoroutineV2/CoroutineV2";
import { Encoding } from "@/CatanEngine/CSharp/System/Text/Encoding";
import { ClientData } from "@/shared/protocols/define/interface";
import { IncomingMessage } from "http";
import { WebSocket } from "ws";
import { CoroutineV2 } from "../../../../CatanEngine/CoroutineV2/CoroutineV2";
import { Action } from "../../../../CatanEngine/CSharp/System/Action";
import { Encoding } from "../../../../CatanEngine/CSharp/System/Text/Encoding";
import { ClientData } from "../../../../shared/protocols/define/interface";
import { INetRequest } from "./Core/INetRequest";
import { INetResponse } from "./Core/INetResponse";
@ -57,7 +57,7 @@ export class NetConnector {
// 动态导入处理函数
try {
// 动态导入文件
const module = await import(`@/api/${req.Method.replace(".", "/")}`);
const module = await import(`../../../../api/${req.Method.replace(".", "/")}`);
// 调用导入模块中的处理函数
if (module.default) {
@ -82,28 +82,6 @@ export class NetConnector {
};
NetConnector.Send(socket, response);
}
// const module = await import(`@/api/${req.Method.replace(".", "/")}`);
// if (module) {
// let AsyncFunction: () => IterableIterator<any> = function* (): IterableIterator<any> {
// const response: INetResponse<any> = yield* module.default(req);
// NetConnector.Send(socket, response);
// };
// CoroutineV2.Single(AsyncFunction()).Start();
// } else {
// const response: INetResponse<any> = {
// Status: -1,
// Method: req.Method,
// Data: null,
// IsValid: false
// };
// NetConnector.Send(socket, response);
// }
// } catch (e) {
// console.error(e);
// throw new Error(`[RPC] 無法解析Server回應: ${str}`);
// }
}
}

View File

@ -1,25 +1,23 @@
{
"compilerOptions": {
"module": "commonjs", // 使 CommonJS
"target": "es2015", // ES2015
"module": "commonjs", // 使 CommonJS
"moduleResolution": "node",
"sourceMap": true,
"strict": false, //
"esModuleInterop": true, // ES
"skipLibCheck": true, //
"forceConsistentCasingInFileNames": true,
"baseUrl": ".",
"paths": {
"@/*": ["src/*"]
},
// "baseUrl": ".",
// "paths": {
// "@/*": ["src/*"]
// },
"outDir": "./dist",
"rootDir": "./src",
},
"include": [
"src/**/*.ts"
],
"exclude": [
"node_modules" // node_modules
]
"exclude": ["node_modules", "dist"]
}