初始化 Line_Project_Bot:LP_Bot 重構版(介面重設計+平台環境改讀試算表)

根本原因:
LP_Bot 介面老舊且環境設定寫死在程式內,新增平台或環境都要改碼重建。

影響:
全新深色控制台介面;首頁改為「平台+環境+Token」,平台清單與連線設定
即時讀取 Google 試算表(quickopen 同款資料來源),選擇與 Token 會記憶於
localStorage;支援「開遊戲」直開跳過維護網址;SD 機台自製 Spin 面板
(押注/延遲/倍率停/轉數停+Log 終端)。

修法:
- 底層引擎(Engine/Common/define/FormTable*)自 LP_Bot 原封搬移
- UI 層全部重寫(Login/Lobby/SlotList/SDGame),antd 深色主題
- 新增 GoogleSheetService:service account 簽 JWT 讀 Sheets API,
  非安全來源 fallback jsrsasign
- 移除 React.StrictMode(雙重掛載會讓 NetManagerSD 單例連線互蓋)
- SD socket 依 gameUrl 協定強制 wss
- 機台 1310/1311/1801/1803/1804/1805 Spin 帶 mode:0 特例
  (依 SD3 客戶端 MainState 原始碼)
- credentials.json 不進版控,附 credentials.example.json 範本

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
2026-08-03 11:04:49 +08:00
co-authored by Claude Fable 5
commit ebe8c3caca
445 changed files with 42552 additions and 0 deletions
+100
View File
@@ -0,0 +1,100 @@
import { CoroutineV2 } from "@/Engine/CatanEngine/CoroutineV2/CoroutineV2";
import { INetResponse } from "@/Engine/CatanEngine/NetManagerV2/Core/INetResponse";
import { gameSync } from "@/utils/setRPCData";
import MainControl from "../MainControl/MainControl";
import CSMessage from "../Message/CSMessage";
export default class MainControlData {
/**
Normal = 0, //一般斷線or登出
RpcError = 1, //RPC錯誤
SystemError = 2, //系統錯誤
UserError = 3, //使用者造成的錯誤
DbaError = 4, //query時回傳錯誤
SendBufferError = 5, //儲存傳送資料的buff錯誤
Kick = 6, //指定踢除
ConnectLimit = 7, //連線限制
RequireHardLimit = 8, //機台請求逾時
SignalWallet = 9,
RepeatLogin = 101, //重覆登入
LoginFailed = 102, //登入失敗
AppVerError = 103, //Client版本過舊
Maintain = 104, //維護中
Ban = 105, //帳號鎖定
SlotClose = 106, //機台關閉
ResourceWait = 107, //使用者資料尚未寫入
IsDelete = 108, // 被刪除的帳號
Delete = 109, // 刪除主動斷線
SafeDisconnect = 201, // 安全離線
*/
private _disconnectErrorType: number = null;
constructor() {
MainControl.DataReceivedEvent.AddCallback(this._dataReceivedEvent, this);
}
private _dataReceivedEvent(param: any[] = null): void {
let type: MainControl.DataType = param[0];
let data: any = param[1];
switch (type) {
case MainControl.DataType.ServerData:
this._serverData(data);
break;
case MainControl.DataType.NetDisconnected:
this._netDisconnected();
break;
default:
break;
}
}
// =======================================================================================
/** SERVER主動通知 */
private _serverData(resp: INetResponse<any>): void {
if (resp.IsValid) {
switch (resp.Method) {
case "game.sync": {
CoroutineV2.Single(gameSync()).Start();
break;
}
case "system.disconnect": {
this._disconnectErrorType = +resp.Data["c"];
break;
}
default:
break;
}
} else {
switch (resp.Method) {
// case "": {
// break;
// }
default:
break;
}
}
}
// =======================================================================================
/** SOCKET斷線 */
private _netDisconnected(): void {
console.debug("Disconnected Error Type : " + this._disconnectErrorType);
let str: string = null;
// if (this._disconnectErrorType < 10 && this._disconnectErrorType >= 0) {
// str = CSSettingsV3.prototype.CommonString(55 + this._disconnectErrorType);
// } else if (this._disconnectErrorType > 100 && this._disconnectErrorType < 110) {
// str = CSSettingsV3.prototype.CommonString(65 + this._disconnectErrorType - 101);
// } else {
// str = "Server Disconnected";
// }
str = "Server Disconnected";
CSMessage.CreateYesMsg(
str,
this._disconnectedReload
);
}
private _disconnectedReload(): void {
window.location.reload();
}
// =======================================================================================
}
+149
View File
@@ -0,0 +1,149 @@
import { Action } from "@/Engine/CatanEngine/CSharp/System/Action";
import { INetResponse } from "@/Engine/CatanEngine/NetManagerV2/Core/INetResponse";
import { NetConnector } from "@/Engine/CatanEngine/NetManagerV2/NetConnector";
import { NetManager } from "@/Engine/CatanEngine/NetManagerV2/NetManager";
import { TableManager } from "@/Engine/CatanEngine/TableV3/TableManager";
import BaseSingleton from "@/Engine/Utils/Singleton/BaseSingleton";
import BusinessTypeSetting from "@/_BusinessTypeSetting/BusinessTypeSetting";
import { Tools } from "@/utils/Tools";
export class MainControl extends BaseSingleton<MainControl>() {
/** 每次啟動APP */
public IsFirstEnteringLobby: boolean = true;
// /** 登入成功判斷 */
// public IsLogin: boolean = false;
// /** 選桌頁內的機台號碼 */
// public TableID: number = 0;
/** 最後遊玩的一個廠商 */
public LastPlayComponyID: number = 0;
/** 最後遊玩的一個遊戲 */
public LastPlayGameID: number = 0;
// /** 主動斷線=字串.被動斷線=null(因為SERVER有時候會先主動斷線所以有的要預先設定字串)*/
// public IsLogoutStr: string = null;
public IsInGame: boolean = false;
/** 現在時間 */
public get NowTime(): number { return Date.now(); }
public static readonly DataReceivedEvent: Action<any[]> = new Action<any[]>();
/** 連線控制 */
private _conn: NetConnector = null;
//#region 網路相關
/**連線(目前沒有重連機制) */
public * ConnectAsync() {
if (NetManager.IsConnected) {
return;
}
this._conn = new NetConnector(BusinessTypeSetting.UseHost, BusinessTypeSetting.UsePort);
this._conn.OnDataReceived.AddCallback(this._onNetDataReceived, this);
this._conn.OnDisconnected.AddCallback(this._onNetDisconnected, this);
NetManager.Initialize(this._conn);
console.log("[socket] connecting...");
// 同個connector要再次連線, 可以不用叫CasinoNetManager.Initialize(), 但要先叫CasinoNetManager.Disconnect()
yield NetManager.ConnectAsync();
}
/**只要連線中斷不管主被動都會走到這裡 */
private _onNetDisconnected() {
console.warn("[socket] Disconnected");
this._conn.OnDataReceived.RemoveAllCallbacks();
MainControl.DataReceivedEvent.DispatchCallback([MainControl.DataType.NetDisconnected]);
}
/**RPC回傳.若協定錯誤斷線.原因也會在這裡收到 */
private _onNetDataReceived(resp: INetResponse<any>) {
MainControl.DataReceivedEvent.DispatchCallback([MainControl.DataType.ServerData, resp]);
}
//#region DownloadForm Function
/**
* 載入外載表設定檔
* @param formType FormType
*/
public static async DownloadForm(formType: DownloadForm.FormType): Promise<void> {
if (DownloadForm.DownloadFormData.DownloadSuccess.has(formType)) {
console.warn(`CSSettingsV3 ${formType} 已經載過`);
return;
}
DownloadForm.DownloadFormData.DownloadSuccess.set(formType, true);
let needForm: string[] = DownloadForm.DownloadFormData[`${formType}Form`];
let parallel: Promise<void>[] = [];
for (let i: number = 0; i < needForm.length; i++) {
parallel.push(this.DownloadFormSetting(needForm[i]));
}
// set Form
await Promise.all(parallel);
}
/**
* 載入外載表設定檔
* @param formname 設定檔名稱
*/
public static async DownloadFormSetting(formname: string): Promise<void> {
// http://patch-dev.online-bj.com/shared/jsons/slot_050.json
let fileUrl: string = `${formname}.json`;
if (import.meta.env.PROD) {
// fileUrl = "https://patch.sdegaming.com/slot2/patch/_Release/shared/jsons/" + fileUrl;
// fileUrl = "https://sd2-dev-patch.sdegaming.com/_Debug/shared/jsons/" + fileUrl;
fileUrl = "http://192.168.5.45:5001/shared/jsons/" + fileUrl;
// fileUrl = "https://patch.sdegaming.com/slot2/patch/_Release/shared/jsons/" + fileUrl;
// fileUrl = "http://patch-dev.online-bj.com/shared/jsons/" + fileUrl;
// fileUrl = "http://jianmiau.tk/_BJ_Source/BJ-Internal-Dev/shared/jsons/" + fileUrl;
} else {
fileUrl = "./shared/jsons/" + fileUrl;
}
fileUrl = fileUrl + "?v=" + Date.now();
let isDownloading: boolean = true;
let xhr: XMLHttpRequest = new XMLHttpRequest();
// xhr.withCredentials = true;
xhr.onreadystatechange = function (): void {
if (xhr.readyState === 4 && (xhr.status >= 200 && xhr.status < 400)) {
let res: any = {};
res.json = JSON.parse(xhr.responseText);
res.name = formname;
TableManager.AddJsonAsset(res);
isDownloading = false;
}
};
xhr.open("GET", fileUrl);
xhr.send();
while (isDownloading) {
await Tools.Sleep(100);
}
}
//#endregion
}
export module MainControl {
export enum DataType {
ServerData,
ChangeDire,
NetDisconnected,
}
}
export default MainControl;
//#region DownloadForm
export module DownloadForm {
export enum FormType {
Formread = "formread",
}
export class DownloadFormData {
/** 已下載的表 */
public static DownloadSuccess: Map<string, boolean> = new Map<string, boolean>();
/** Bag需要的表(xxxx.json) */
public static formreadForm: string[] = ["slotset"];
}
}
//#endregion
+45
View File
@@ -0,0 +1,45 @@
import { IConfirmMessageData, modalObj } from "@/UIControl/ModalContext";
/** 訊息框相關 */
export default class CSMessage {
public static Record: IConfirmMessageData[] = [];
/** 一個按鈕的訊息框 */
public static CreateYesMsg(content: string, yesCallback: () => void = null, enterStr: string = null, title: string = null, textAlign: "center" | "left" | "right" = null) {
enterStr = enterStr ? enterStr : "確認";
let data: IConfirmMessageData = {
title: title,
content: content,
isShowCancel: false,
handleConfirm: yesCallback,
enterStr: enterStr,
textAlign: textAlign
};
const { handleOpen } = modalObj;
handleOpen(data);
}
/** 兩個按鈕的訊息框 */
public static CreateYesNoMsg(content: string, yesCallback: () => void = null, noCallback: () => void = null, enterStr: string = null, title: string = null, cancelStr: string = null, textAlign: "center" | "left" | "right" = null) {
enterStr = enterStr ? enterStr : "確認";
cancelStr = cancelStr ? cancelStr : "取消";
let data: IConfirmMessageData = {
title: title,
content: content,
isShowCancel: true,
handleConfirm: yesCallback,
handleCancel: noCallback,
enterStr: enterStr,
cancelStr: cancelStr,
textAlign: textAlign
};
const { handleOpen } = modalObj;
handleOpen(data);
}
/** 網路錯誤訊息 */
public static NetError(method: string, state: number, str: string = ""): void {
let error = String.Format("[{0}] state:{1} {2}", method, state, str);
console.debug("網路錯誤訊息: ", error);
}
}
+22
View File
@@ -0,0 +1,22 @@
import SystemEventManager from "./SystemEventManager";
/** 系統事件底層 */
export default class SystemEventBase {
constructor() {
SystemEventManager.AddSystem(this);
}
public get name(): string { return this.constructor.name; }
/** 首次進入大廳 */
public ImplementFirstEnteringLobby(): void { }
/** 進入大廳 */
public ImplementEnteringLobby(): void { }
/** 關閉商城頁 */
public ImplementCloseMall(): void { }
/** 離開機台 */
public ImplementLeaveSlot(slotID: number): void { }
}
+34
View File
@@ -0,0 +1,34 @@
import SystemEventBase from "./SystemEventBase";
/** 系統事件管理 */
export default class SystemEventManager {
private static systems: Map<string, SystemEventBase> = new Map();
public static AddSystem(system: SystemEventBase): void {
this.systems.set(system.name, system);
}
public static DestroySystem(system: SystemEventBase): void {
this.systems.delete(system.name);
}
/** 首次進入大廳 */
public static FirstEnteringLobby(): void {
SystemEventManager.systems.forEach(system => system.ImplementFirstEnteringLobby());
}
/** 進入大廳 */
public static EnteringLobby(): void {
SystemEventManager.systems.forEach(system => system.ImplementEnteringLobby());
}
/** 關閉商城頁 */
public static CloseMall(): void {
SystemEventManager.systems.forEach(system => system.ImplementCloseMall());
}
/** 離開機台 */
public static LeaveSlot(slotID: number): void {
SystemEventManager.systems.forEach(system => system.ImplementLeaveSlot(slotID));
}
}
@@ -0,0 +1,125 @@
/**
* 回呼函數: fnname (arg: TArg): void
*/
interface ActionCallback<TArg> {
(arg: TArg): void;
}
interface Struct<TArg> {
callback: ActionCallback<TArg>;
target: any;
once?: boolean;
}
export class Action<TArg> {
private _queue: Struct<TArg>[] = [];
/**
* 監聽事件
* @param callback 回呼函數: fnname (arg: TArg): void
* @param bindTarget 回呼時this綁定的對象
*/
AddCallback(callback: ActionCallback<TArg>, bindTarget?: any) {
let q = <Struct<TArg>>{
callback: callback,
target: bindTarget
};
this._queue.push(q);
}
/**
* 監聽事件 (一次性)
* @param callback 回呼函數: fnname (arg: TArg): void
* @param bindTarget 回呼時this綁定的對象
*/
AddCallbackOnce(callback: ActionCallback<TArg>, bindTarget?: any) {
let q = <Struct<TArg>>{
callback: callback,
target: bindTarget,
once: true
};
this._queue.push(q);
}
/**
* 移除事件
* @param callback
*/
RemoveByCallback(callback: ActionCallback<TArg>) {
let index = this._queue.length;
if (index > 0) {
while (index--) {
let q = this._queue[index];
if (!q.callback || q.callback === callback) {
q.callback = undefined;
this._queue.splice(index, 1);
}
}
}
}
/**
* 移除事件
* @param bindTarget 回呼時this綁定的對象
*/
RemoveByBindTarget(bindTarget: any) {
let index = this._queue.length;
if (index > 0) {
while (index--) {
let q = this._queue[index];
if (!q.callback || q.target === bindTarget) {
q.callback = undefined;
this._queue.splice(index, 1);
}
}
}
}
/**
* 移除全部事件
*/
RemoveAllCallbacks() {
this._queue.forEach(q => q.callback = undefined);
this._queue.length = 0;
}
/**
* 發送事件
* @param arg 參數
*/
DispatchCallback(arg: TArg) {
let index = this._queue.length;
if (index > 0) {
let cleanRemoved = false;
this._queue.slice().forEach(q => {
if (!q.callback) {
cleanRemoved = true;
return;
}
if (q.target) {
q.callback.call(q.target, arg);
} else {
q.callback(arg);
}
if (q.once) {
q.callback = undefined;
cleanRemoved = true;
}
});
if (cleanRemoved) {
index = this._queue.length;
if (index > 0) {
while (index--) {
let q = this._queue[index];
if (!q.callback) {
this._queue.splice(index, 1);
}
}
}
}
}
}
}
@@ -0,0 +1,165 @@
/**
* 回呼函數: fnname (arg: TArg): void
*/
interface ActionCallback<TArg> {
(arg: TArg): void;
}
interface Struct<TType, TArg> {
callback: ActionCallback<TArg>;
target: any;
type: TType;
once?: boolean;
}
export class ActionWithType<TType, TArg> {
private _queue: Struct<TType, TArg>[] = [];
/**
* 監聽事件
* @param callback 回呼函數: fnname (arg: TArg): void
* @param bindTarget 回呼時this綁定的對象
*/
AddCallback(type: TType, callback: ActionCallback<TArg>, bindTarget?: any) {
let q = <Struct<TType, TArg>>{
callback: callback,
target: bindTarget,
type: type
};
this._queue.push(q);
}
/**
* 監聽事件 (一次性)
* @param callback 回呼函數: fnname (arg: TArg): void
* @param bindTarget 回呼時this綁定的對象
*/
AddCallbackOnce(type: TType, callback: ActionCallback<TArg>, bindTarget?: any) {
let q = <Struct<TType, TArg>>{
callback: callback,
target: bindTarget,
type: type,
once: true
};
this._queue.push(q);
}
/**
* 移除事件
* @param callback
*/
RemoveByCallback(callback: ActionCallback<TArg>) {
let index = this._queue.length;
if (index > 0) {
while (index--) {
let q = this._queue[index];
if (!q.callback || q.callback === callback) {
q.callback = undefined;
this._queue.splice(index, 1);
}
}
}
}
/**
* 移除事件
* @param bindTarget 回呼時this綁定的對象
*/
RemoveByBindTarget(bindTarget: any) {
let index = this._queue.length;
if (index > 0) {
while (index--) {
let q = this._queue[index];
if (!q.callback || q.target === bindTarget) {
q.callback = undefined;
this._queue.splice(index, 1);
}
}
}
}
/**
* 移除事件
* @param type 事件類型
*/
RemoveByType(type: TType) {
let index = this._queue.length;
if (index > 0) {
while (index--) {
let q = this._queue[index];
if (!q.callback || q.type === type) {
q.callback = undefined;
this._queue.splice(index, 1);
}
}
}
}
/**
* 移除事件
* @param type 事件類型
* @param callback
*/
RemoveCallback(type: TType, callback: ActionCallback<TArg>) {
let index = this._queue.length;
if (index > 0) {
while (index--) {
let q = this._queue[index];
if (!q.callback || (q.type === type && q.callback === callback)) {
q.callback = undefined;
this._queue.splice(index, 1);
}
}
}
}
/**
* 移除全部事件
*/
RemoveAllCallbacks() {
this._queue.forEach(q => q.callback = undefined);
this._queue.length = 0;
}
/**
* 發送事件
* @param type 事件類型
* @param arg 參數
*/
DispatchCallback(type: TType, arg: TArg) {
let index = this._queue.length;
if (index > 0) {
let cleanRemoved = false;
this._queue.slice().forEach(q => {
if (!q.callback) {
cleanRemoved = true;
return;
}
if (q.type !== type) return;
if (q.target) {
q.callback.call(q.target, arg);
} else {
q.callback(arg);
}
if (q.once) {
q.callback = undefined;
cleanRemoved = true;
}
});
if (cleanRemoved) {
index = this._queue.length;
if (index > 0) {
while (index--) {
let q = this._queue[index];
if (!q.callback) {
this._queue.splice(index, 1);
}
}
}
}
}
}
}
@@ -0,0 +1,165 @@
/**
* 回呼函數: fnname (type: TType, arg: TArg): void
*/
interface ActionCallback<TType, TArg> {
(type: TType, arg: TArg): void;
}
interface Struct<TType, TArg> {
callback: ActionCallback<TType, TArg>;
target: any;
type: TType;
once?: boolean;
}
export class ActionWithType2<TType, TArg> {
private _queue: Struct<TType, TArg>[] = [];
/**
* 監聽事件
* @param callback 回呼函數: fnname (type: TType, arg: TArg): void
* @param bindTarget 回呼時this綁定的對象
*/
AddCallback(type: TType, callback: ActionCallback<TType, TArg>, bindTarget?: any) {
let q = <Struct<TType, TArg>>{
callback: callback,
target: bindTarget,
type: type
};
this._queue.push(q);
}
/**
* 監聽事件 (一次性)
* @param callback 回呼函數: fnname (type: TType, arg: TArg): void
* @param bindTarget 回呼時this綁定的對象
*/
AddCallbackOnce(type: TType, callback: ActionCallback<TType, TArg>, bindTarget?: any) {
let q = <Struct<TType, TArg>>{
callback: callback,
target: bindTarget,
type: type,
once: true
};
this._queue.push(q);
}
/**
* 移除事件
* @param callback
*/
RemoveByCallback(callback: ActionCallback<TType, TArg>) {
let index = this._queue.length;
if (index > 0) {
while (index--) {
let q = this._queue[index];
if (!q.callback || q.callback === callback) {
q.callback = undefined;
this._queue.splice(index, 1);
}
}
}
}
/**
* 移除事件
* @param bindTarget 回呼時this綁定的對象
*/
RemoveByBindTarget(bindTarget: any) {
let index = this._queue.length;
if (index > 0) {
while (index--) {
let q = this._queue[index];
if (!q.callback || q.target === bindTarget) {
q.callback = undefined;
this._queue.splice(index, 1);
}
}
}
}
/**
* 移除事件
* @param type 事件類型
*/
RemoveByType(type: TType) {
let index = this._queue.length;
if (index > 0) {
while (index--) {
let q = this._queue[index];
if (!q.callback || q.type === type) {
q.callback = undefined;
this._queue.splice(index, 1);
}
}
}
}
/**
* 移除事件
* @param type 事件類型
* @param callback
*/
RemoveCallback(type: TType, callback: ActionCallback<TType, TArg>) {
let index = this._queue.length;
if (index > 0) {
while (index--) {
let q = this._queue[index];
if (!q.callback || (q.type === type && q.callback === callback)) {
q.callback = undefined;
this._queue.splice(index, 1);
}
}
}
}
/**
* 移除全部事件
*/
RemoveAllCallbacks() {
this._queue.forEach(q => q.callback = undefined);
this._queue.length = 0;
}
/**
* 發送事件
* @param type 事件類型
* @param arg 參數
*/
DispatchCallback(type: TType, arg: TArg) {
let index = this._queue.length;
if (index > 0) {
let cleanRemoved = false;
this._queue.slice().forEach(q => {
if (!q.callback) {
cleanRemoved = true;
return;
}
if (q.type !== type) return;
if (q.target) {
q.callback.call(q.target, type, arg);
} else {
q.callback(type, arg);
}
if (q.once) {
q.callback = undefined;
cleanRemoved = true;
}
});
if (cleanRemoved) {
index = this._queue.length;
if (index > 0) {
while (index--) {
let q = this._queue[index];
if (!q.callback) {
this._queue.splice(index, 1);
}
}
}
}
}
}
}
@@ -0,0 +1,75 @@
export module Encoding.UTF8 {
export function GetBytes(str: string) {
let len = str.length, resPos = -1;
let resArr = new Uint8Array(len * 3);
for (let point = 0, nextcode = 0, i = 0; i !== len;) {
point = str.charCodeAt(i), i += 1;
if (point >= 0xD800 && point <= 0xDBFF) {
if (i === len) {
resArr[resPos += 1] = 0xef;
resArr[resPos += 1] = 0xbf;
resArr[resPos += 1] = 0xbd;
break;
}
nextcode = str.charCodeAt(i);
if (nextcode >= 0xDC00 && nextcode <= 0xDFFF) {
point = (point - 0xD800) * 0x400 + nextcode - 0xDC00 + 0x10000;
i += 1;
if (point > 0xffff) {
resArr[resPos += 1] = (0x1e << 3) | (point >>> 18);
resArr[resPos += 1] = (0x2 << 6) | ((point >>> 12) & 0x3f);
resArr[resPos += 1] = (0x2 << 6) | ((point >>> 6) & 0x3f);
resArr[resPos += 1] = (0x2 << 6) | (point & 0x3f);
continue;
}
} else {
resArr[resPos += 1] = 0xef;
resArr[resPos += 1] = 0xbf;
resArr[resPos += 1] = 0xbd;
continue;
}
}
if (point <= 0x007f) {
resArr[resPos += 1] = (0x0 << 7) | point;
} else if (point <= 0x07ff) {
resArr[resPos += 1] = (0x6 << 5) | (point >>> 6);
resArr[resPos += 1] = (0x2 << 6) | (point & 0x3f);
} else {
resArr[resPos += 1] = (0xe << 4) | (point >>> 12);
resArr[resPos += 1] = (0x2 << 6) | ((point >>> 6) & 0x3f);
resArr[resPos += 1] = (0x2 << 6) | (point & 0x3f);
}
}
return resArr.subarray(0, resPos + 1);
}
export function GetString(array: Uint8Array) {
let str = "";
let i = 0, len = array.length;
while (i < len) {
let c = array[i++];
switch (c >> 4) {
case 0:
case 1:
case 2:
case 3:
case 4:
case 5:
case 6:
case 7:
str += String.fromCharCode(c);
break;
case 12:
case 13:
str += String.fromCharCode(((c & 0x1F) << 6) | (array[i++] & 0x3F));
break;
case 14:
str += String.fromCharCode(((c & 0x0F) << 12) | ((array[i++] & 0x3F) << 6) | ((array[i++] & 0x3F) << 0));
break;
}
}
return str;
}
}
@@ -0,0 +1,10 @@
{
"ver": "1.1.0",
"uuid": "43bf5724-e939-4189-b981-c32ef694e5a5",
"importer": "typescript",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
@@ -0,0 +1,44 @@
const CANCEL = Symbol();
export interface CancellationToken {
readonly IsCancellationRequested: boolean;
ThrowIfCancellationRequested(): void;
}
export class CancellationTokenSource {
readonly Token: CancellationToken;
constructor() {
this.Token = new CancellationTokenImpl();
}
Cancel() {
this.Token[CANCEL]();
}
}
export class TaskCancelledException extends Error {
constructor() {
super("Task Cancelled");
Reflect.setPrototypeOf(this, TaskCancelledException.prototype);
}
}
class CancellationTokenImpl implements CancellationToken {
IsCancellationRequested: boolean;
constructor() {
this.IsCancellationRequested = false;
}
ThrowIfCancellationRequested() {
if (this.IsCancellationRequested) {
throw new TaskCancelledException();
}
}
[CANCEL]() {
this.IsCancellationRequested = true;
}
}
@@ -0,0 +1,17 @@
import { BaseEnumerator } from "./BaseEnumerator";
export class ActionEnumerator extends BaseEnumerator {
private _action: Function;
constructor(action: Function) {
super();
this._action = action;
}
next(value?: any): IteratorResult<any> {
if (this._action) {
this._action();
}
return { done: true, value: undefined };
}
}
@@ -0,0 +1,137 @@
import { IEnumeratorV2, IEnumeratorV2Started } from "../IEnumeratorV2";
import { CoroutineExecutor } from "./CoroutineExecutor";
let EnumeratorExecutorClass: typeof import("./EnumeratorExecutor").EnumeratorExecutor = null;
let SingleEnumeratorClass: typeof import("./SingleEnumerator").SingleEnumerator = null;
let ParallelEnumeratorClass: typeof import("./ParallelEnumerator").ParallelEnumerator = null;
let WaitTimeEnumeratorClass: typeof import("./WaitTimeEnumerator").WaitTimeEnumerator = null;
let ActionEnumeratorClass: typeof import("./ActionEnumerator").ActionEnumerator = null;
/**
* 使用前初始場景第一個事件一定要先Init過
* @example
* 而且不能同時間有其他onLoad在跑,放start可以
* @example
* protected async onLoad(): Promise<void> {
* await BaseEnumerator.Init();
* }
*/
export abstract class BaseEnumerator implements IEnumeratorV2 {
public nextEnumerator: BaseEnumerator;
abstract next(value?: any): IteratorResult<any>;
public static isInit: boolean = false;
public static async Init(): Promise<any> {
await Promise.all([
(async () => {
EnumeratorExecutorClass = (await import("./EnumeratorExecutor")).EnumeratorExecutor;
})(),
(async () => {
SingleEnumeratorClass = (await import("./SingleEnumerator")).SingleEnumerator;
})(),
(async () => {
ParallelEnumeratorClass = (await import("./ParallelEnumerator")).ParallelEnumerator;
})(),
(async () => {
WaitTimeEnumeratorClass = (await import("./WaitTimeEnumerator")).WaitTimeEnumerator;
})(),
(async () => {
ActionEnumeratorClass = (await import("./ActionEnumerator")).ActionEnumerator;
})(),
]);
BaseEnumerator.isInit = true;
}
Start(target?: any): IEnumeratorV2Started {
let executor = LazyLoad.EnumeratorExecutor(this, target);
CoroutineExecutor.instance.StartCoroutine(executor);
return executor;
}
Then(iterator: Iterator<any>): IEnumeratorV2 {
if (!iterator) {
return this;
}
if (iterator instanceof BaseEnumerator) {
BaseEnumerator.getLastEnumerator(this).nextEnumerator = iterator;
return this;
} else {
let enumerator = LazyLoad.SingleEnumerator(iterator);
BaseEnumerator.getLastEnumerator(this).nextEnumerator = enumerator;
return this;
}
}
ThenSerial(...iterators: Iterator<any>[]): IEnumeratorV2 {
let last = BaseEnumerator.getLastEnumerator(this);
for (let iterator of iterators) {
if (iterator instanceof BaseEnumerator) {
last.nextEnumerator = iterator;
} else {
let enumerator = LazyLoad.SingleEnumerator(iterator);
last.nextEnumerator = enumerator;
}
last = last.nextEnumerator;
}
return this;
}
ThenParallel(...iterators: Iterator<any>[]): IEnumeratorV2 {
return this.Then(LazyLoad.ParallelEnumerator(...iterators));
}
ThenAction(action: Function, delaySeconds?: number): IEnumeratorV2 {
if (delaySeconds > 0) {
return this.ThenSerial(LazyLoad.WaitTimeEnumerator(delaySeconds), LazyLoad.ActionEnumerator(action));
} else {
return this.Then(LazyLoad.ActionEnumerator(action));
}
}
ThenWaitTime(seconds: number): IEnumeratorV2 {
return this.Then(LazyLoad.WaitTimeEnumerator(seconds));
}
static getLastEnumerator(enumerator: BaseEnumerator): BaseEnumerator {
let next = enumerator;
while (next.nextEnumerator) {
next = next.nextEnumerator;
}
return next;
}
}
module LazyLoad {
export function EnumeratorExecutor(enumerator: BaseEnumerator, target: any) {
let newclass = new EnumeratorExecutorClass(enumerator, target);
return newclass;
// return new (require("./EnumeratorExecutor") as typeof import("./EnumeratorExecutor")).EnumeratorExecutor(enumerator, target);
}
export function SingleEnumerator(iterator: Iterator<any>) {
let newclass: any = new SingleEnumeratorClass(iterator);
return newclass;
// return new (require("./SingleEnumerator") as typeof import("./SingleEnumerator")).SingleEnumerator(iterator);
}
export function ParallelEnumerator(...iterators: Iterator<any>[]) {
let newclass: any = new ParallelEnumeratorClass(iterators);
return newclass;
// return new (require("./ParallelEnumerator") as typeof import("./ParallelEnumerator")).ParallelEnumerator(iterators);
}
export function WaitTimeEnumerator(seconds: number) {
let newclass: any = new WaitTimeEnumeratorClass(seconds);
return newclass;
// return new (require("./WaitTimeEnumerator") as typeof import("./WaitTimeEnumerator")).WaitTimeEnumerator(seconds);
}
export function ActionEnumerator(action: Function) {
let newclass: any = new ActionEnumeratorClass(action);
return newclass;
// return new (require("./ActionEnumerator") as typeof import("./ActionEnumerator")).ActionEnumerator(action);
}
}
@@ -0,0 +1,103 @@
import { EnumeratorExecutor } from "./EnumeratorExecutor";
export class CoroutineExecutor {
private static _instance: CoroutineExecutor;
static get instance() {
return CoroutineExecutor._instance = CoroutineExecutor._instance || new CoroutineExecutor();
}
private _executors: EnumeratorExecutor[] = [];
private _nextExecutors: EnumeratorExecutor[] = [];
private _isRunning: boolean = false;
private _cleanRemoved: boolean = false;
private _scheduler: NodeJS.Timeout = null;
private _time: number = 0;
constructor() {
this._time = new Date().getTime();
console.debug("[CoroutineV2] Coroutines Start");
this._scheduler = setInterval(this.update.bind(this), 1 / 60);
}
StartCoroutine(executor: EnumeratorExecutor) {
executor.next(0);
// TODO: 這邊要考量next後馬上接BaseEnumerator/Iterator的情形
if (!this._isRunning) {
this._executors.push(executor);
if (!this._scheduler) {
console.debug("[CoroutineV2] Coroutines Start");
this._time = new Date().getTime();
this._scheduler = setInterval(this.update.bind(this), 1 / 60);
} else {
// console.debug(`[CoroutineV2] Coroutines add now: ${this._executors.length}`);
}
} else {
this._nextExecutors.push(executor);
}
}
StopCoroutineBy(target: any) {
if (!target) return;
for (let r of this._executors) {
if (target === r.target) {
r.Stop();
}
}
for (let r of this._nextExecutors) {
if (target === r.target) {
r.Stop();
}
}
}
update() {
const time: number = new Date().getTime();
const delta: number = (time - this._time) / 1000;
this._time = time;
if (this._nextExecutors.length) {
this._executors.push(...this._nextExecutors);
// console.debug(`[CoroutineV2] Coroutines addNext now: ${this._executors.length}, next: ${this._nextExecutors.length}`);
this._nextExecutors.length = 0;
}
if (this._cleanRemoved) {
// 移除[doneFlag=true]的協程
let index = this._executors.length;
while (index--) {
let r = this._executors[index];
if (r.doneFlag) {
this._executors.splice(index, 1);
// console.debug(`[CoroutineV2] Coroutines sub now: ${this._executors.length}`);
}
}
this._cleanRemoved = false;
}
if (this._executors.length == 0) {
console.debug("[CoroutineV2] All Coroutines Done");
clearInterval(this._scheduler);
this._scheduler = null;
return;
}
this._isRunning = true;
// 執行協程
for (let r of this._executors) {
if (r.doneFlag || r.pauseFlag || r.childFlag) {
if (r.doneFlag) {
this._cleanRemoved = true;
}
continue;
}
r.next(delta);
}
this._isRunning = false;
}
}
@@ -0,0 +1,167 @@
import { IEnumeratorV2Started } from "../IEnumeratorV2";
import { BaseEnumerator } from "./BaseEnumerator";
import { SingleEnumerator } from "./SingleEnumerator";
export class EnumeratorExecutor implements IEnumeratorV2Started {
public Current: any;
public target: any;
public pauseFlag: boolean;
public doneFlag: boolean;
public childFlag: boolean;
public asyncFlag: boolean;
public error: any;
private _executor: EnumeratorExecutor;
private _enumerator: BaseEnumerator;
constructor(enumerator: BaseEnumerator, target: any) {
this.target = target;
this._enumerator = enumerator;
}
next(delta?: any): IteratorResult<any> {
if (this._executor && this._executor.doneFlag) {
this._executor = null;
}
if (this.doneFlag || (!this._enumerator && !this._executor)) {
this.doneFlag = true;
return { done: true, value: undefined };
}
if (this.asyncFlag || this.pauseFlag) return { done: false, value: undefined };
let result: IteratorResult<any>;
if (this._executor) {
result = this._executor.next(delta);
this.Current = this._executor.Current;
if (this._executor.doneFlag) {
this._executor = null;
} else {
result.done = false;
return result;
}
}
if (!this._enumerator) {
this.doneFlag = true;
return { done: true, value: undefined };
}
try {
result = this._enumerator.next(delta);
let value = result.value;
let done = result.done;
if (value) {
// Iterator
if (typeof value[Symbol.iterator] === "function") {
value = new SingleEnumerator(<Iterator<any>>value);
}
if (value instanceof BaseEnumerator) {
if (!done) {
BaseEnumerator.getLastEnumerator(value).nextEnumerator = this._enumerator;
}
this._enumerator = value;
result = this._enumerator.next(delta);
value = result.value;
done = result.done;
if (value) {
// Iterator again
if (typeof value[Symbol.iterator] === "function") {
value = new SingleEnumerator(<Iterator<any>>value);
}
if (value instanceof BaseEnumerator) {
if (!done) {
BaseEnumerator.getLastEnumerator(value).nextEnumerator = this._enumerator;
}
this._enumerator = value;
result.done = false;
done = false;
}
}
}
if (value instanceof EnumeratorExecutor) {
if (done) {
this._enumerator = this._enumerator.nextEnumerator;
}
value.childFlag = true;
result.done = false;
done = false;
this._executor = value;
} else if (Promise.resolve(value) === value) {
this.asyncFlag = true;
result.done = false;
done = false;
(<Promise<any>>value)
.then(v => {
this.asyncFlag = false;
this.Current = v;
if (done) {
this._enumerator = this._enumerator.nextEnumerator;
}
})
.catch(e => {
this.asyncFlag = false;
this.doneFlag = true;
this._enumerator = null;
this.error = e;
if (e instanceof Error) {
console.error(e.stack);
} else {
console.error(`Error: ${ JSON.stringify(e) }`);
}
});
}
this.Current = value;
}
if (done) {
this._enumerator = this._enumerator.nextEnumerator;
if (this._enumerator) {
result.done = false;
}
}
} catch (e) {
this.doneFlag = true;
this.error = e;
if (e instanceof Error) {
console.error(e.stack);
} else {
console.error(`Error: ${ JSON.stringify(e) }`);
}
result = { done: true, value: e };
}
return result;
}
Stop(): void {
this.doneFlag = true;
if (this._executor) {
this._executor.Stop();
}
}
Pause(): void {
this.pauseFlag = true;
if (this._executor) {
this._executor.Pause();
}
}
Resume(): void {
this.pauseFlag = false;
if (this._executor) {
this._executor.Resume();
}
}
}
@@ -0,0 +1,46 @@
import { BaseEnumerator } from "./BaseEnumerator";
import { EnumeratorExecutor } from "./EnumeratorExecutor";
import { SingleEnumerator } from "./SingleEnumerator";
export class ParallelEnumerator extends BaseEnumerator {
private _executors: EnumeratorExecutor[] = [];
constructor(iterators: Iterator<any>[]) {
super();
if (iterators && iterators.length) {
for (let iterator of iterators) {
if (iterator instanceof BaseEnumerator) {
this._executors.push(new EnumeratorExecutor(iterator, null));
} else {
this._executors.push(new EnumeratorExecutor(new SingleEnumerator(iterator), null));
}
}
}
}
next(value?: any): IteratorResult<any> {
if (this._executors.length) {
// 先移除[doneFlag=true]協程
let index = this._executors.length;
while (index--) {
let r = this._executors[index];
if (r.doneFlag) {
this._executors.splice(index, 1);
}
}
if (this._executors.length == 0) {
return { done: true, value: undefined };
}
// 執行協程
for (let r of this._executors) {
r.next(value);
}
return { done: false, value: undefined };
}
return { done: true, value: undefined };
}
}
@@ -0,0 +1,18 @@
import { BaseEnumerator } from "./BaseEnumerator";
export class SingleEnumerator extends BaseEnumerator {
private _iterator: Iterator<any>;
constructor(iterator: Iterator<any>) {
super();
this._iterator = iterator;
}
next(value?: any): IteratorResult<any> {
if (!this._iterator) {
return { done: true, value: undefined };
}
return this._iterator.next(value);
}
}
@@ -0,0 +1,21 @@
import { BaseEnumerator } from "./BaseEnumerator";
export class WaitTimeEnumerator extends BaseEnumerator {
private _seconds: number;
constructor(seconds: number) {
super();
this._seconds = seconds;
}
next(value?: any): IteratorResult<any> {
let delta = value as number;
this._seconds -= delta;
if (this._seconds <= 0) {
return { done: true, value: 0 };
} else {
return { done: false, value: this._seconds };
}
}
}
@@ -0,0 +1,133 @@
import { CoroutineV2 } from "./CoroutineV2";
export default class CoroutineExample {
private _obj: Object = { "a": true };
private _obj2: Object = { "b": true };
private _num: number = 3;
/**
*
*/
constructor() {
CoroutineV2.Single(this.Test1_1()).Start();
}
*Test1_1() {
yield null;
yield* this.Test1_2();
// CoroutineV2.Single(this.Test1_3()).Start(this);
yield this.Test1_3();
}
*Test1_2() {
yield null;
}
*Test1_3() {
yield this.Test1_3_1();
yield CoroutineV2.Single(this.Test1_4()).Start(this._obj);
// yield CoroutineV2.Single(this.Test1_4()); //.Start(this);
// yield *this.Test1_4();
console.log("main wait 3");
yield CoroutineV2.WaitTime(2);
console.log("done");
}
*Test1_3_1() {
yield this.Test1_3_2();
yield CoroutineV2.WaitTime(1);
console.log("Test1_3_1.1");
yield CoroutineV2.WaitTime(1);
console.log("Test1_3_1.2");
}
*Test1_3_2() {
yield this.Test1_3_3();
yield CoroutineV2.WaitTime(1);
console.log("Test1_3_2.1");
yield CoroutineV2.WaitTime(1);
console.log("Test1_3_2.2");
yield CoroutineV2.WaitTime(1);
console.log("Test1_3_2.3");
}
*Test1_3_3() {
yield CoroutineV2.WaitTime(1);
console.log("Test1_3_3.1");
yield CoroutineV2.WaitTime(1);
console.log("Test1_3_3.2");
yield CoroutineV2.WaitTime(1);
console.log("Test1_3_3.3");
}
*Test1_4() {
this._num++;
console.log(`WaitTime2 ${this._num}`);
yield CoroutineV2.WaitTime(2).Start(this._obj2);
this._num++;
console.log(`WaitTime2 ${this._num}`);
yield CoroutineV2.WaitTime(2).Start(this._obj2);
this._num++;
console.log(`WaitTime2 ${this._num}`);
}
*Test2_1() {
console.log("111");
CoroutineV2.Single(this.Test2_2()).Start(this);
console.log("333");
}
*Test2_2() {
console.log("222");
return;
}
*Coroutine1(start: number, end: number) {
for (let i = start; i <= end; i++) {
// yield CoroutineV2.WaitTime(1).Start(); // Start()可以省略, 會由外層啟動
// yield CoroutineV2.WaitTime(1).Start(this); // target也可以省略, 由外層的target控制
yield CoroutineV2.WaitTime(1).Start();
console.log(`C1 => ${i}`);
// 嵌套
yield CoroutineV2
.WaitTime(1)
.ThenParallel(
// 再嵌套
CoroutineV2.Action(() => console.log("start parallel")),
this.Coroutine2(10, 2),
this.Coroutine2(20, 2),
)
.ThenAction(() => console.log("end parallel"))
.Start();
// Promise
yield this.loadItemAsync("settings.json");
}
}
*Coroutine2(num: number, repeat: number) {
for (let i = 0; i < repeat; i++) {
//yield CoroutineV2.WaitTime(2);
yield 0;
console.log(`C2: ${num}`);
// yield CoroutineV2.WaitTime(1);
}
}
actionCallback() {
console.log("action callback 2");
}
loadItemAsync(id: string): Promise<{ id: string }> {
return new Promise((resolve) => {
console.log("loading item start:", id);
setTimeout(() => {
resolve({ id: id });
console.log("loading item done:", id);
}, 3000);
});
}
}
@@ -0,0 +1,75 @@
import { ActionEnumerator } from "./Core/ActionEnumerator";
import { BaseEnumerator } from "./Core/BaseEnumerator";
import { CoroutineExecutor } from "./Core/CoroutineExecutor";
import { ParallelEnumerator } from "./Core/ParallelEnumerator";
import { SingleEnumerator } from "./Core/SingleEnumerator";
import { WaitTimeEnumerator } from "./Core/WaitTimeEnumerator";
import { IEnumeratorV2, IEnumeratorV2Started } from "./IEnumeratorV2";
export module CoroutineV2 {
/**
* 啟動一般協程
*/
export function StartCoroutine(iterator: Iterator<any>, target?: any): IEnumeratorV2Started {
return Single(iterator).Start(target);
}
/**
* 依據IEnumeratorV2.Start(target)綁定的目標, 來停止協程
* @param target
*/
export function StopCoroutinesBy(target: any) {
CoroutineExecutor.instance.StopCoroutineBy(target);
}
/**
* 單一協程
*/
export function Single(iterator: Iterator<any>): IEnumeratorV2 {
if (iterator instanceof BaseEnumerator) {
return iterator;
} else {
return new SingleEnumerator(iterator);
}
}
/**
* 平行協程
*/
export function Parallel(...iterators: Iterator<any>[]): IEnumeratorV2 {
return new ParallelEnumerator(iterators);
}
/**
* 序列協程
*/
export function Serial(...iterators: Iterator<any>[]): IEnumeratorV2 {
let [iterator, ...others] = iterators;
if (iterator instanceof BaseEnumerator) {
return iterator.ThenSerial(...others);
} else {
return new SingleEnumerator(iterator).ThenSerial(...others);
}
}
/**
* 執行方法協程
* @param action 方法
* @param delaySeconds 延遲秒數
*/
export function Action(action: Function, delaySeconds?: number): IEnumeratorV2 {
if (delaySeconds > 0) {
return new WaitTimeEnumerator(delaySeconds).Then(new ActionEnumerator(action));
} else {
return new ActionEnumerator(action);
}
}
/**
* 等待時間協程
* @param seconds 秒數
*/
export function WaitTime(seconds: number): IEnumeratorV2 {
return new WaitTimeEnumerator(seconds);
}
}
@@ -0,0 +1,23 @@
export interface IEnumeratorV2 extends Iterator<any> {
Start(target?: any): IEnumeratorV2Started;
Then(iterator: Iterator<any>): IEnumeratorV2;
ThenSerial(...iterators: Iterator<any>[]): IEnumeratorV2;
ThenParallel(...iterators: Iterator<any>[]): IEnumeratorV2;
ThenAction(action: Function, delaySeconds?: number): IEnumeratorV2;
ThenWaitTime(seconds: number): IEnumeratorV2;
}
export interface IEnumeratorV2Started {
readonly Current: any;
Pause(): void;
Resume(): void;
Stop(): void;
}
@@ -0,0 +1,15 @@
import { Action } from "../../CSharp/System/Action";
import { INetRequest } from "./INetRequest";
import { INetResponse } from "./INetResponse";
export interface INetConnector {
readonly OnDataReceived: Action<INetResponse<any>>;
readonly OnDisconnected: Action<void>;
readonly IsConnected: boolean;
SendAsync<TRequest, TResponse>(req: INetRequest<TRequest, TResponse>): Iterator<any>;
Send<TRequest, TResponse>(req: INetRequest<TRequest, TResponse>);
Logout();
}
@@ -0,0 +1,13 @@
import { INetResponse } from "./INetResponse";
export interface INetRequest<TRequest, TResponse> {
readonly Method: string;
readonly MethodBack: string;
Data: TRequest;
Result: INetResponse<TResponse>;
SendAsync(): Iterator<any>;
Send();
}
@@ -0,0 +1,6 @@
export interface INetResponse<TResponse> {
readonly Method: string;
readonly Status: number;
readonly Data: TResponse;
readonly IsValid: boolean;
}
@@ -0,0 +1,4 @@
export default class NetConfig {
/** 是否顯示RPC接送JSON的LOG */
public static ShowServerLog: boolean = true;
}
@@ -0,0 +1,272 @@
import { Action } from "../CSharp/System/Action";
import { Encoding } from "../CSharp/System/Text/Encoding";
import { BaseEnumerator } from "../CoroutineV2/Core/BaseEnumerator";
import { INetRequest } from "./Core/INetRequest";
import { INetResponse } from "./Core/INetResponse";
import NetConfig from "./NetConfig";
export namespace Socket {
export const Connect = Symbol("socket.connect");
export const Message = Symbol("socket.message");
export const Disconnect = Symbol("socket.disconnect");
export const Error = Symbol("socket.error");
}
export interface Func {
[Socket.Connect]: () => void,
[Socket.Message]: (e) => void,
[Socket.Disconnect]: () => void,
[Socket.Error]: () => void,
}
export class NetConnector {
readonly OnDataReceived: Action<INetResponse<any>> = new Action<INetResponse<any>>();
readonly OnDisconnected: Action<void> = new Action<void>();
readonly OnLoadUIMask: Action<boolean> = new Action<boolean>();
get IsConnected() {
return this._ws && this._ws.readyState === WebSocket.OPEN;
}
public get ws(): WebSocket {
return this._ws;
}
private _host: string;
private _ws: WebSocket;
private _waitings: WsRequestEnumerator[] = [];
constructor(host: string, port: number) {
let checkHttp: string = "";
let index: number = host.indexOf("https://");
if (index != -1) {
checkHttp = "https";
host = host.replace("https://", "");
} else {
checkHttp = window.location.href.substring(0, 5);
host = host.replace("http://", "");
}
// if (CC_DEBUG) {
console.debug("[事件]checkHttp=", checkHttp, host, port);
// }
if (checkHttp != "https") {
this._host = `ws://${host}:${port}`;
} else {
this._host = `wss://${host}:${port}`;
}
}
ConnectAsync() {
if (this._ws) {
throw new Error("請先執行CasinoNetManager.Disconnect()中斷連線");
}
this._ws = new WebSocket(this._host);
this._ws.binaryType = "arraybuffer";
this._ws.onopen = this.OnWebSocketOpen.bind(this);
this._ws.onmessage = this.OnWebSocketMessage.bind(this);
this._ws.onclose = this.OnWebSocketClose.bind(this);
this._ws.onerror = this.OnWebSocketError.bind(this);
return new WsConnectEnumerator(this._ws);
}
Send(req: INetRequest<any, any>) {
if (!this.IsConnected) return;
let json = [req.Method];
if (req.Data != null && req.Data != undefined && !Number.isNaN(req.Data)) {
json[1] = req.Data;
}
// if (CC_DEBUG && NetConfig.ShowServerLog) {
if (NetConfig.ShowServerLog) {
if (req.Data != null && req.Data != undefined && !Number.isNaN(req.Data)) {
console.log(`[RPC] 傳送server資料: ${req.Method}(${JSON.stringify(req.Data)})`);
} else {
console.log(`[RPC] 傳送server資料: ${req.Method}()`);
}
}
let str = JSON.stringify(json);
if (str.length > 65535) {
throw new Error("要傳的資料太大囉");
}
let strary = Encoding.UTF8.GetBytes(str);
let buffer = new Uint8Array(4 + strary.byteLength);
let u16ary = new Uint16Array(buffer.buffer, 0, 3);
u16ary[0] = strary.byteLength;
buffer[3] = 0x01;
buffer.set(strary, 4);
this._ws.send(buffer);
}
SendAsync(req: INetRequest<any, any>, mask: boolean) {
let iterator = new WsRequestEnumerator(req);
if (!this.IsConnected) {
iterator.SetResponse(ErrorResponse);
} else {
this._waitings.push(iterator);
if (mask) {
this.OnLoadUIMask.DispatchCallback(true);
}
this.Send(req);
}
return iterator;
}
Disconnect() {
this.WebSocketEnded();
}
private WebSocketEnded() {
if (!this._ws) return;
this._ws.close();
this._ws.onopen = null;
this._ws.onmessage = null;
this._ws.onclose = () => {
};
this._ws = null;
this.CleanWaitings();
this.OnDisconnected.DispatchCallback();
}
private CleanWaitings() {
for (let w of this._waitings) {
w.SetResponse(ErrorResponse);
this.OnLoadUIMask.DispatchCallback(false);
}
this._waitings.length = 0;
}
private OnWebSocketOpen(e: Event) {
console.debug(`[RPC] ${this._host} Connected.`);
}
private OnWebSocketMessage(e: MessageEvent) {
if (e.data instanceof ArrayBuffer) {
this.ParseRpcMessage(e.data, e);
} else if (e.data instanceof Blob) {
let reader = new FileReader();
reader.onload = (e) => {
this.ParseRpcMessage(<ArrayBuffer>reader.result, e);
reader.onload = null;
};
reader.readAsArrayBuffer(e.data);
} else {
throw new Error(`未知的OnWebSocketMessage(e.data)類型: ${e.data}`);
}
}
private ParseRpcMessage(buffer: ArrayBuffer, e: any) {
let startIndex = 0, byteLength = buffer.byteLength;
while (startIndex + 4 < byteLength) {
let strlen = new DataView(buffer, startIndex, 3).getUint16(0, true);
let str = Encoding.UTF8.GetString(new Uint8Array(buffer, startIndex + 4, strlen));
startIndex += strlen + 4;
try {
let json = JSON.parse(str);
let method = <string>json[0];
let status = <number>json[1][0];
let data = json[1][1];
let resp = <INetResponse<any>>{
Method: method,
Status: status,
Data: data,
IsValid: method && status === 0
};
// if (CC_DEBUG && NetConfig.ShowServerLog) {
if (NetConfig.ShowServerLog) {
if (data) {
console.log(`[RPC] 收到server呼叫:(${resp.Status}): ${resp.Method}(${JSON.stringify(resp.Data)})`);
} else {
console.log(`[RPC] 收到server呼叫:(${resp.Status}): ${resp.Method}()`);
}
}
let dispatch = true;
let isCocos = false;
for (let i = 0, len = this._waitings.length; i < len; i++) {
let w = this._waitings[i];
if (w.MethodBack === resp.Method) {
dispatch = false;
this._waitings.splice(i, 1);
w.SetResponse(resp);
this.OnLoadUIMask.DispatchCallback(false);
break;
}
}
if (dispatch) {
this.OnDataReceived.DispatchCallback(resp);
}
} catch {
throw new Error(`[RPC] 無法解析Server回應: ${str}`);
}
}
}
private OnWebSocketClose(e: CloseEvent) {
this.WebSocketEnded();
}
private OnWebSocketError(e: CloseEvent) {
}
}
const ErrorResponse: INetResponse<any> = {
Status: -1,
Method: "",
Data: {},
IsValid: false,
};
class WsConnectEnumerator extends BaseEnumerator {
private _ws: WebSocket;
constructor(ws: WebSocket) {
super();
this._ws = ws;
}
next(value?: any): IteratorResult<any> {
return {
done: this._ws.readyState === WebSocket.OPEN || this._ws.readyState === WebSocket.CLOSED,
value: undefined
};
}
}
class WsRequestEnumerator extends BaseEnumerator {
readonly MethodBack: string;
private _req: INetRequest<any, any>;
private _done: boolean = false;
constructor(req: INetRequest<any, any>) {
super();
this._req = req;
this.MethodBack = req.MethodBack;
}
SetResponse(resp: INetResponse<any>) {
this._req.Result = resp;
this._done = true;
}
next(value?: any): IteratorResult<any> {
return {
done: this._done,
value: undefined
};
}
}
@@ -0,0 +1,54 @@
import { INetRequest } from "./Core/INetRequest";
import { NetConnector } from "./NetConnector";
export class NetManager {
static get IsConnected() {
return this._connector && this._connector.IsConnected;
}
static get HasInit() {
return this._connector != null;
}
private static _connector: NetConnector;
static Initialize(connector: NetConnector) {
this._connector = connector;
}
static ConnectAsync() {
this.CheckConnector();
return this._connector.ConnectAsync();
}
/**
* 斷線
*/
static Disconnect() {
this.CheckConnector();
this._connector.Disconnect();
}
/**
* 傳送資料給Server, 不等待回應
* @param req
*/
static Send(req: INetRequest<any, any>) {
this.CheckConnector();
this._connector.Send(req);
}
/**
* 傳送資料給Server, 並等待回應
* @param req
*/
static SendAsync(req: INetRequest<any, any>, mask: boolean) {
this.CheckConnector();
return this._connector.SendAsync(req, mask);
}
private static CheckConnector() {
if (!this._connector) throw new Error("請先呼叫CasinoNetManager.Initialize()初始化connector");
}
}
@@ -0,0 +1,54 @@
import { INetRequest } from "./Core/INetRequest";
import { NetConnector } from "./NetConnector";
export class NetManagerSD {
static get IsConnected() {
return this._connector && this._connector.IsConnected;
}
static get HasInit() {
return this._connector != null;
}
private static _connector: NetConnector;
static Initialize(connector: NetConnector) {
this._connector = connector;
}
static ConnectAsync() {
this.CheckConnector();
return this._connector.ConnectAsync();
}
/**
* 斷線
*/
static Disconnect() {
this.CheckConnector();
this._connector.Disconnect();
}
/**
* 傳送資料給Server, 不等待回應
* @param req
*/
static Send(req: INetRequest<any, any>) {
this.CheckConnector();
this._connector.Send(req);
}
/**
* 傳送資料給Server, 並等待回應
* @param req
*/
static SendAsync(req: INetRequest<any, any>, mask: boolean) {
this.CheckConnector();
return this._connector.SendAsync(req, mask);
}
private static CheckConnector() {
if (!this._connector) throw new Error("請先呼叫CasinoNetManager.Initialize()初始化connector");
}
}
@@ -0,0 +1,21 @@
import { INetRequest } from "./Core/INetRequest";
import { NetManager } from "./NetManager";
export abstract class NetRequest<TResquest, TResponse> implements INetRequest<TResquest, TResponse> {
abstract get Method(): string;
get MethodBack(): string {
return this.Method;
}
Data: TResquest;
Result: import("./Core/INetResponse").INetResponse<TResponse>;
SendAsync(mask: boolean = false): Iterator<any> {
return NetManager.SendAsync(this, mask);
}
Send() {
NetManager.Send(this);
}
}
@@ -0,0 +1,21 @@
import { INetRequest } from "./Core/INetRequest";
import { NetManagerSD } from "./NetManagerSD";
export abstract class NetRequestSD<TResquest, TResponse> implements INetRequest<TResquest, TResponse> {
abstract get Method(): string;
get MethodBack(): string {
return this.Method;
}
Data: TResquest;
Result: import("./Core/INetResponse").INetResponse<TResponse>;
SendAsync(mask: boolean = false): Iterator<any> {
return NetManagerSD.SendAsync(this, mask);
}
Send() {
NetManagerSD.Send(this);
}
}
@@ -0,0 +1,4 @@
export interface ITableJson {
cols: string[],
rows: any[],
}
@@ -0,0 +1,10 @@
export interface ITableRow {
Id: number;
}
/**
* 表沒有欄位
*/
export class WithoutRow implements ITableRow {
Id: number;
}
@@ -0,0 +1,30 @@
import { ITableRow } from "./ITableRow";
export abstract class TableBase<TRow extends ITableRow> extends Array<TRow> {
constructor() {
super();
Object.setPrototypeOf(this, new.target.prototype);
}
/** 欄位數量 */
public get Count(): number {
return this.length;
}
/** 取得全部鍵值 */
public get Keys(): string[] {
return Object.keys(this);
}
/** 取得全部欄位值 */
public get Rows(): Array<TRow> {
return Object["values"](this);
}
// public get Rows(): Array<TRow> { return this; }
/** 是否包含該Id值的欄位 */
public ContainsRow(id: number): boolean {
return id in this;
}
}
@@ -0,0 +1,13 @@
import { TableManager } from "../TableManager";
import { StringExampleTableRow, StringTableExample } from "./Tables/StringTableExample";
export default class CSSettingsV3Example {
private static _stringExample: StringTableExample;
/** 共用_字串表#string.xlsx */
public static get StringExample(): StringTableExample {
return this._stringExample = this._stringExample || TableManager.InitTable("#string", StringTableExample, StringExampleTableRow);
}
}
@@ -0,0 +1,78 @@
import CSSettingsV3Example from "./CSSettingsV3Example";
import { StringExampleTable } from "./Tables/StringTableExample";
export default class TableUseExample {
start() {
// #region StringExample表
console.log("----------------#stringExample");
console.log(CSSettingsV3Example.StringExample instanceof StringExampleTable); // true
console.log(Array.isArray(CSSettingsV3Example.StringExample)); // true, 所以Array相關的方法都可以拿來操作
console.log(CSSettingsV3Example.StringExample.length);
console.log(CSSettingsV3Example.StringExample.Count); // 跟length一樣
console.log(CSSettingsV3Example.StringExample.ContainsRow(11)); // 是否包含id=11的Row
console.log(11 in CSSettingsV3Example.StringExample); // 同上
console.log(CSSettingsV3Example.StringExample[1].MsgZnCh);
console.log(CSSettingsV3Example.StringExample[1]["MsgZnCh"]); // 同上
console.log(CSSettingsV3Example["StringExample"][1]["MsgZnCh"]); // 同上
console.log("----------------");
for (let row of CSSettingsV3Example.StringExample) {
if (row) { // 如果Row沒有連號, 那有可能取到undefined值, 要先判斷, 不想判斷就用 CSSettings.StringExample.Rows
console.log(row.Id, row.MsgZnCh);
}
}
console.log("----------------");
for (let id of CSSettingsV3Example.StringExample.Keys) {
console.log(id); // 只會列出有值的id, undefined會跳過
}
console.log("----------------");
for (let row of CSSettingsV3Example.StringExample.Rows) {
console.log(row.Id, row.MsgZnCh); // 只會列出有值的Row, undefined會跳過
}
// #endregion
// #region StringExample表 #StringFilter表
console.log("----------------#stringExample#string_filter");
// console.log(CSSettings.StringExample.StringFilter instanceof StringFilterTable); // true
console.log(Array.isArray(CSSettingsV3Example.StringExample.StringFilter)); // true, 所以Array相關的方法都可以拿來操作
console.log(CSSettingsV3Example.StringExample.StringFilter.length);
console.log(CSSettingsV3Example.StringExample.StringFilter.Count); // 跟length一樣
console.log(CSSettingsV3Example.StringExample.StringFilter.ContainsRow(11)); // 是否包含id=11的Row
console.log(11 in CSSettingsV3Example.StringExample.StringFilter); // 同上
console.log(CSSettingsV3Example.StringExample.StringFilter[1].FilterWord);
console.log(CSSettingsV3Example.StringExample.StringFilter[1]["FilterWord"]); // 同上
console.log(CSSettingsV3Example["StringExample"]["StringFilter"][1]["FilterWord"]); // 同上
console.log("----------------");
for (let row of CSSettingsV3Example.StringExample.StringFilter) {
if (row) { // 如果Row沒有連號, 那有可能取到undefined值, 要先判斷, 不想判斷就用 CSSettings.StringExample.StringFilter.Rows
console.log(row.Id, row.FilterWord);
}
}
console.log("----------------");
for (let id of CSSettingsV3Example.StringExample.StringFilter.Keys) {
console.log(id); // 只會列出有值的id, undefined會跳過
}
console.log("----------------");
for (let row of CSSettingsV3Example.StringExample.StringFilter.Rows) {
console.log(row.Id, row.FilterWord); // 只會列出有值的Row, undefined會跳過
}
// #endregion
console.log("----------------");
// CSSettingsV3.ResetTables(); // 重置表
}
}
@@ -0,0 +1,50 @@
import { ITableRow } from "../../Core/ITableRow";
import { TableBase } from "../../Core/TableBase";
import { TableManager } from "../../TableManager";
/**
* 共用_字串表#string.xlsx
* ##程式碼由工具產生, 在此做的修改都將被覆蓋##
*/
export class StringTableExample extends TableBase<StringExampleTableRow> {
private _stringFilter: StringFilterTable;
/** 共用_字串表#string.xlsx > #string_filter */
public get StringFilter(): StringFilterTable {
return this._stringFilter = this._stringFilter || TableManager.InitTable("#string#string_filter", StringFilterTable, StringFilterTableRow);
}
}
/**
* #string
*/
export class StringExampleTable extends TableBase<StringExampleTableRow> {
}
export class StringExampleTableRow implements ITableRow {
/** 編號 */
Id: number;
/** 英文訊息 */
MsgEn: string;
/** 繁體中文訊息 */
MsgZnTw: string;
/** 簡體中文讯息 */
MsgZnCh: string;
/** 越南文讯息 */
MsgVi: string;
/** 泰文讯息 */
MsgTh: string;
}
/**
* #string_filter
*/
export class StringFilterTable extends TableBase<StringFilterTableRow> {
}
export class StringFilterTableRow implements ITableRow {
/** 編號 */
Id: number;
/** 過濾字串 */
FilterWord: string;
}
@@ -0,0 +1,53 @@
import { ITableJson } from "./Core/ITableJson";
import { ITableRow } from "./Core/ITableRow";
export class TableManager {
private static _tableJsons: { [key: string]: ITableJson } = {};
public static AddJsonAssets(jsonAssets: JSON[]) {
if (!jsonAssets) return;
const newAssets: JSON[] = jsonAssets.concat();
for (const jsonAsset of newAssets) {
this.AddJsonAsset(jsonAsset);
}
}
public static AddJsonAsset(jsonAsset: any) {
if (!jsonAsset) {
return;
}
for (let tableName in jsonAsset.json) {
console.log(`TableV3 [${tableName}] json loaded`);
this._tableJsons[tableName] = jsonAsset.json[tableName];
}
}
public static GetTable(name: string): ITableJson {
return this._tableJsons[name];
}
public static InitTable<T extends Array<ITableRow>>(
name: string,
tableType: { new(): T },
rowType: { new(): ITableRow },
): T {
const json = this._tableJsons[name];
if (!json) {
return null;
// throw new Error(`TableV3 [${name}] 尚未載入json檔`);
}
const table = new tableType();
const cols = json.cols;
const colLength = cols.length;
const rows = json.rows;
for (const r of rows) {
const trow = new rowType();
for (let i = 0; i < colLength; i++) {
trow[cols[i]] = r[i];
}
table[trow.Id] = trow;
}
// console.log(`TableV3 [${name}] init done`);
return table;
}
}
+57
View File
@@ -0,0 +1,57 @@
/**
* 本機系統記錄(切換帳號也不可刪除EX記錄音效開關)
*/
export default class LocalStorageData {
private static _instance: LocalStorageData = null;
public static get Instance(): LocalStorageData {
return LocalStorageData._instance;
}
constructor() {
LocalStorageData._instance = this;
}
// =======================================================================================
//
public get CompileVersion(): string { return cc.sys.localStorage.getItem("CompileVersion"); }
public set CompileVersion(value: string) { cc.sys.localStorage.setItem("CompileVersion", value.toString()); }
//
public get RemoteVerList(): string { return cc.sys.localStorage.getItem("RemoteVerList"); }
public set RemoteVerList(value: string) { cc.sys.localStorage.setItem("RemoteVerList", value); }
//
public get LocalVerList(): string { return cc.sys.localStorage.getItem("LocalVerList"); }
public set LocalVerList(value: string) { cc.sys.localStorage.setItem("LocalVerList", value); }
//
public get ComboDeviceID(): string { return cc.sys.localStorage.getItem("ComboDeviceID") || ""; }
public set ComboDeviceID(value: string) { cc.sys.localStorage.setItem("ComboDeviceID", value); }
//
public get BundleUrl(): string { return cc.sys.localStorage.getItem("BundleUrl"); }
public set BundleUrl(value: string) { cc.sys.localStorage.setItem("BundleUrl", value); }
//
public get Language(): string { return cc.sys.localStorage.getItem("language"); }
public set Language(value: string) { cc.sys.localStorage.setItem("language", value); }
//
public get MusicType(): string { return cc.sys.localStorage.getItem("MusicType"); }
public set MusicType(value: string) { cc.sys.localStorage.setItem("MusicType", value); }
//
public get SoundType(): string { return cc.sys.localStorage.getItem("SoundType"); }
public set SoundType(value: string) { cc.sys.localStorage.setItem("SoundType", value); }
//
public get LvUpNotifyType(): boolean { return JSON.parse(cc.sys.localStorage.getItem("LvUpNotifyType")); }
public set LvUpNotifyType(value: boolean) { cc.sys.localStorage.setItem("LvUpNotifyType", JSON.stringify(value)); }
//
public get WinNotifyType(): boolean { return JSON.parse(cc.sys.localStorage.getItem("WinNotifyType")); }
public set WinNotifyType(value: boolean) { cc.sys.localStorage.setItem("WinNotifyType", JSON.stringify(value)); }
//
public get DownloadList_Preview(): string { return cc.sys.localStorage.getItem("DownloadList_Preview"); }
public set DownloadList_Preview(value: string) { cc.sys.localStorage.setItem("DownloadList_Preview", value); }
//
public get AutoLogin(): number { return Number.parseInt(cc.sys.localStorage.getItem("AutoLogin")); }
public set AutoLogin(value: number) { cc.sys.localStorage.setItem("AutoLogin", value); }
//
public get GameInfoData(): string[] { return JSON.parse(cc.sys.localStorage.getItem("GameInfoData")); }
public set GameInfoData(value: string[]) { cc.sys.localStorage.setItem("GameInfoData", JSON.stringify(value)); }
//
public get LoginDays(): string[] { return JSON.parse(cc.sys.localStorage.getItem("LoginDays")); }
public set LoginDays(value: string[]) { cc.sys.localStorage.setItem("LoginDays", JSON.stringify(value)); }
}
+192
View File
@@ -0,0 +1,192 @@
import { NumberEx } from "@/utils/Number/NumberEx";
import { CoroutineV2 } from "../CatanEngine/CoroutineV2/CoroutineV2";
import { ActionWithType } from "../CatanEngine/CSharp/System/ActionWithType";
class TimerEvent extends ActionWithType<number, any> { }
/**
* 計時器(使用CoroutineV2)
*/
export class Timer {
//#region private
/** 訊息資料 */
private static Group: Map<any, TimerDataClass> = new Map<any, TimerDataClass>();
//#endregion
//#region static
/**
* 啟動計時
* @param {number} time 計時(seconds)
* @param {Function} callback Function
* @param {any} type (選填) 可以識別的東西
* @param {any} bindTarget (選填) 回呼時this綁定的對象
* @example
* Timer.Start(1, () => { console.log(`example`); });
* Timer.Start(1, () => { console.log(`example`); }, "example");
* Timer.Start(1, () => { console.log(`example`); }, "example", this);
*/
public static Start(time: number, callback: Function, bindTarget?: any, type?: any): void {
let self: typeof Timer = this;
let thisType: any = type;
if (!type) {
thisType = callback;
}
if (Timer.Group.has(thisType)) {
console.error(`Timer Start Error Timer.Group.has(${thisType})`);
return;
}
let timerData: TimerDataClass = new TimerDataClass(thisType, time, callback, bindTarget);
Timer.Group.set(thisType, timerData);
let CoroutineFN: () => IterableIterator<any> = function* (): IterableIterator<any> {
yield CoroutineV2.WaitTime(time).Start(bindTarget);
if (Timer.Group.has(thisType)) {
self._callback(timerData.Type, timerData.Callback, timerData.BindTarget);
}
};
CoroutineV2.Single(CoroutineFN()).Start(bindTarget);
}
/**
* 刪除計時 By Target
* @param {any} target target
* @example
* Timer.ClearByTarget(this);
*/
public static ClearByTarget(target: any): void {
let timerDataGroup: TimerDataClass[] = [];
Timer.Group.forEach(timerData => {
if (timerData.BindTarget === target) {
timerDataGroup.push(timerData);
}
});
if (timerDataGroup.length === 0) {
console.warn(`Timer Clear Error Timer.Group.has not target`);
return;
}
for (let i: number = 0; i < timerDataGroup.length; i++) {
let timerData: TimerDataClass = timerDataGroup[i];
let type: any = timerData.Type;
Timer.Group.delete(type);
timerData = null;
}
CoroutineV2.StopCoroutinesBy(target);
}
/**
* 刪除計時 By Type
* @param PS 還是會吃效能在倒數 只是時間到不會執行
* @param {any} type type
* @example
* Timer.ClearByType("example");
*/
public static ClearByType(type: any): void {
let timerDataGroup: TimerDataClass[] = [];
Timer.Group.forEach(timerData => {
if (timerData.Type === type) {
timerDataGroup.push(timerData);
}
});
if (timerDataGroup.length === 0) {
console.warn(`Timer Clear Error Timer.Group.has not type`);
return;
}
for (let i: number = 0; i < timerDataGroup.length; i++) {
let timerData: TimerDataClass = timerDataGroup[i];
let type: any = timerData.Type;
Timer.Group.delete(type);
}
}
/**
* 結束計時時callback
* @param {Function} callback Function
*/
private static _callback(type: any, callback: Function, bindTarget: any): void {
if (Timer.Group.has(type)) {
Timer.Group.delete(type);
}
if (bindTarget) {
callback.bind(bindTarget)();
} else {
callback();
}
}
/**
* 定時事件(時間用 updateTime秒跑一次fn)
* @param startNum 起始index
* @param endNum 結束index
* @param updateTime 事件刷新間隔
* @param callbackfn 事件
* @example
* let startNum: number = 10;
* let endNum: number = 0;
* let updateTime: number = 1;
* yield CoroutineV2.Single(Timer.Timing(
* startNum,
* endNum,
* updateTime,
* (x: number) => {
* console.log(`x: ${x}`);
* }
* )).Start(this);
*/
public static *Timing(startNum: number, endNum: number, updateTime: number, callbackfn: Function): IterableIterator<any> {
let isIncrease: boolean = endNum >= startNum;
let totalCount: number = Math.abs(endNum - startNum) + 1;
let nowCount: number = NumberEx.divide(totalCount, updateTime);
let diff: number = NumberEx.divide(totalCount, nowCount) * (isIncrease ? 1 : -1);
let tempScore: number = startNum;
callbackfn(startNum);
while (true) {
if (endNum !== tempScore) {
yield CoroutineV2.WaitTime(updateTime);
tempScore += diff;
// 遞增
if (isIncrease && tempScore > endNum) {
tempScore = endNum;
}
// 遞減
if (!isIncrease && tempScore < endNum) {
tempScore = endNum;
}
callbackfn(Math.floor(tempScore));
} else {
break;
}
}
}
//#endregion
}
//#region Class
/** Timer資料 */
export class TimerDataClass {
/** Type */
public Type: any = null;
/** Time */
public Time: number = null;
/** Callback */
public Callback: Function = null;
/** BindTarget */
public BindTarget?: any = null;
constructor(type: any, time: number, callback: Function, bindTarget?: any) {
this.Type = type;
this.Time = time;
this.Callback = callback;
this.BindTarget = bindTarget;
}
}
// //#endregion
+5
View File
@@ -0,0 +1,5 @@
export default class CSAudio {
private static _instance: CSAudio = null;
public static get Instance(): CSAudio { return this._instance; }
public AddClipsInfo(clips: Map<number, cc.AudioClip>, pathes: Map<number, string>): void { }
}
+120
View File
@@ -0,0 +1,120 @@
//#region Class
import { CoroutineV2 } from "../../Engine/CatanEngine/CoroutineV2/CoroutineV2";
/** 表演節目序列處理系統(playShow Sequence Processing System) */
export default class PSPS {
//#region public
public ShowData: ShowDataClass[] = [];
public IsRun: boolean = false;
// /** 可以插隊時間 */
// public CanCutInLineTime: number = null;
//#endregion
//#region private
private _playShowFunction: (data: any) => IterableIterator<any> = null;
//#endregion
//#region Lifecycle
/**
* 表演節目序列處理系統(PlayShow Sequence Processing System)
* @param playShowFunction 要表演的函式
* @example
* let CoroutineFunction: (data: any) => IterableIterator<any> = function* (data: any): IterableIterator<any> {}
* new PSPS(this.CoroutineFunction.bind(this));
*/
constructor(playShowFunction: (data: any) => IterableIterator<any>) {
this.SetPlayShowFunction(playShowFunction);
}
public SetPlayShowFunction(playShowFunction: (data: any) => IterableIterator<any>): void {
this._playShowFunction = playShowFunction;
}
//#endregion
//#region playShow
/** 增加表演資料 */
public PushPlayShowData(data: any, priority: number = 0): void {
const playShowData: ShowDataClass = new ShowDataClass(data, priority);
this.ShowData.push(playShowData);
this.ShowData.ObjectSort([true], ["Priority"]);
if (!this.IsRun) {
CoroutineV2.Single(this._performanceShowData()).Start(this);
}
}
/** 表演 */
private *_performanceShowData(): IterableIterator<any> {
this.IsRun = true;
if (this._playShowFunction) {
const showData: ShowDataClass = this.ShowData.shift();
const data: any = showData.Data;
yield* this._playShowFunction(data);
}
if (this.ShowData.length > 0) {
CoroutineV2.Single(this._performanceShowData()).Start(this);
return;
}
this.StopPerformance();
}
/** 停止表演 */
public StopPerformance(): void {
this.IsRun = false;
CoroutineV2.StopCoroutinesBy(this);
}
public ClearFromPriority(priority: any): void {
let deleteDatas: ShowDataClass[] = [];
for (let i: number = 0; i < this.ShowData.length; i++) {
const showData: ShowDataClass = this.ShowData[i];
if (showData.Priority === priority) {
deleteDatas.push(showData);
}
}
for (let i: number = 0; i < deleteDatas.length; i++) {
const deleteData: ShowDataClass = deleteDatas[i];
for (let j: number = 0; j < this.ShowData.length; j++) {
const showData: ShowDataClass = this.ShowData[j];
if (showData.Priority === deleteData.Priority) {
this.ShowData.splice(j, 1);
break;
}
}
}
}
/** 清除所有表演 */
public ClearPerformance(): void {
this.IsRun = false;
this.ShowData = [];
CoroutineV2.StopCoroutinesBy(this);
}
//#endregion
}
/** ShowDataClass */
export class ShowDataClass {
/** 優先度(越低越前面) */
public Priority: number = 0;
/** Data */
public Data: any = null;
constructor(data: any, priority: number) {
this.Data = data;
this.Priority = priority;
}
}
//#endregion
@@ -0,0 +1,27 @@
/**
* 單例基類(要先new在使用)
* @example
* export default class Test extends BaseSingleton<Test>() { ...... }
* new Test();
* Test.Instance.Init();
*/
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
export default function BaseSingleton<T>() {
class BaseSingleton {
public constructor() {
if ((<any>this)._instance == null) {
BaseSingleton._instance = <any>this;
}
}
private static _instance: BaseSingleton = null;
public static get Instance(): T {
return (<any>this)._instance;
}
/** 銷毀 */
public Destroy(): void {
(<any>this)._instance = null;
}
}
return BaseSingleton;
}
+1
View File
@@ -0,0 +1 @@
View File
+144
View File
@@ -0,0 +1,144 @@
import { TableBase } from "../Engine/CatanEngine/TableV3/Core/TableBase";
import { TableManager } from "../Engine/CatanEngine/TableV3/TableManager";
//#region AutoMappingImport
import { ChatTable } from "./Tables/ChatTable";
import { CommunityTable } from "./Tables/CommunityTable";
import { CurrencyTable, CurrencyTableRow } from "./Tables/CurrencyTable";
import { EventTable } from "./Tables/EventTable";
import { FixedTable, FixedTableRow } from "./Tables/FixedTable";
import { FormreadTable } from "./Tables/FormreadTable";
import { GiftTable } from "./Tables/GiftTable";
import { HonorTable } from "./Tables/HonorTable";
import { ItemSettingTable } from "./Tables/ItemSettingTable";
import { LanguageTable } from "./Tables/LanguageTable";
import { LobbyTable } from "./Tables/LobbyTable";
import { LppointTable } from "./Tables/LppointTable";
import { MailTable } from "./Tables/MailTable";
import { NameTable } from "./Tables/NameTable";
import { NetworkTable } from "./Tables/NetworkTable";
import { PacketTable } from "./Tables/PacketTable";
import { RankTable, RankTableRow } from "./Tables/RankTable";
import { SettingTable } from "./Tables/SettingTable";
import { ShopTable } from "./Tables/ShopTable";
import { SoundTable, SoundTableRow } from "./Tables/SoundTable";
import { StringTable, StringTableRow } from "./Tables/StringTable";
import { TaskTable } from "./Tables/TaskTable";
import { VipTable } from "./Tables/VipTable";
//#endregion AutoMappingImport
export default class CSSettingsV3 {
public static ResetTables() {
for (let prop in this) {
if (prop.charAt(0) === '_' && this[prop] && this[prop] instanceof TableBase) {
let table = this[prop];
let tableName = prop.replace("_", "#");
for (let p in table) {
if (p.charAt(0) === '_' && table[p] && table[p] instanceof TableBase) {
cc.log(`TableV3 [${tableName}${p.replace("_", "#")}] cleared`);
table[p] = undefined;
}
}
cc.log(`TableV3 [${tableName}] cleared`);
this[prop] = undefined;
}
}
//TODO: 尚未實作TableManager的清除動作
}
//#region AutoMappingClass
private static _gift: GiftTable;
/** 系統_贈禮#gift.xlsx */
public static get Gift(): GiftTable { return this._gift = this._gift || new GiftTable(); }
private static _string: StringTable;
/** 共用_字串表#string.xlsx */
public static get String(): StringTable { return this._string = this._string || TableManager.InitTable("#string", StringTable, StringTableRow); }
private static _shop: ShopTable;
/** 共用_商城#shop.xlsx */
public static get Shop(): ShopTable { return this._shop = this._shop || new ShopTable(); }
private static _currency: CurrencyTable;
/** 共用_幣別表#currency.xlsx */
public static get Currency(): CurrencyTable { return this._currency = this._currency || TableManager.InitTable("#currency", CurrencyTable, CurrencyTableRow); }
private static _language: LanguageTable;
/** 共用_語系表#language.xlsx */
public static get Language(): LanguageTable { return this._language = this._language || new LanguageTable(); }
private static _fixed: FixedTable;
/** 共用_數值表#fixed.xlsx */
public static get Fixed(): FixedTable { return this._fixed = this._fixed || TableManager.InitTable("#fixed", FixedTable, FixedTableRow); }
private static _vip: VipTable;
/** 系統_VIP#vip.xlsx */
public static get Vip(): VipTable { return this._vip = this._vip || new VipTable(); }
private static _formread: FormreadTable;
/** 系統_表單讀取#formread.xlsx */
public static get Formread(): FormreadTable { return this._formread = this._formread || new FormreadTable(); }
private static _mail: MailTable;
/** 系統_信件#mail.xlsx */
public static get Mail(): MailTable { return this._mail = this._mail || new MailTable(); }
private static _sound: SoundTable;
/** 系統_音效表#sound.xlsx */
public static get Sound(): SoundTable { return this._sound = this._sound || TableManager.InitTable("#sound", SoundTable, SoundTableRow); }
private static _rank: RankTable;
/** 系統_排行榜#rank.xlsx */
public static get Rank(): RankTable { return this._rank = this._rank || TableManager.InitTable("#rank", RankTable, RankTableRow); }
private static _chat: ChatTable;
/** 系統_聊天室#chat.xlsx */
public static get Chat(): ChatTable { return this._chat = this._chat || new ChatTable(); }
private static _network: NetworkTable;
/** 系統_跑馬燈#network.xlsx */
public static get Network(): NetworkTable { return this._network = this._network || new NetworkTable(); }
private static _name: NameTable;
/** 系統_暱稱#name.xlsx */
public static get Name(): NameTable { return this._name = this._name || new NameTable(); }
private static _lobby: LobbyTable;
/** 系統_機台分桌#lobby.xlsx */
public static get Lobby(): LobbyTable { return this._lobby = this._lobby || new LobbyTable(); }
private static _itemSetting: ItemSettingTable;
/** 系統_道具設定#item_setting.xlsx */
public static get ItemSetting(): ItemSettingTable { return this._itemSetting = this._itemSetting || new ItemSettingTable(); }
private static _packet: PacketTable;
/** 系統_背包#packet.xlsx */
public static get Packet(): PacketTable { return this._packet = this._packet || new PacketTable(); }
private static _setting: SettingTable;
/** 共用_設定表#setting.xlsx */
public static get Setting(): SettingTable { return this._setting = this._setting || new SettingTable(); }
private static _task: TaskTable;
/** 系統_任務#task.xlsx */
public static get Task(): TaskTable { return this._task = this._task || new TaskTable(); }
private static _lppoint: LppointTable;
/** 共用_兌禮商城#lppoint.xlsx */
public static get Lppoint(): LppointTable { return this._lppoint = this._lppoint || new LppointTable(); }
private static _event: EventTable;
/** 系統_活動#event.xlsx */
public static get Event(): EventTable { return this._event = this._event || new EventTable(); }
private static _community: CommunityTable;
/** 共用_社群#community.xlsx */
public static get Community(): CommunityTable { return this._community = this._community || new CommunityTable(); }
private static _honor: HonorTable;
/** 系統_榮譽#honor.xlsx */
public static get Honor(): HonorTable { return this._honor = this._honor || new HonorTable(); }
//#endregion AutoMappingClass
}
+10
View File
@@ -0,0 +1,10 @@
{
"ver": "1.1.0",
"uuid": "8a32bcb2-52ef-48ef-8dce-0bf356641322",
"importer": "typescript",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
+114
View File
@@ -0,0 +1,114 @@
import LocalStorageData from "../Engine/Data/LocalStorageData";
import { LanguageManager } from "../FormTableExt/Manage/Language/LanguageManager";
import { ClipsHandleBySoundTable } from "../FormTableExt/TableExt/ClipsHandleBySoundTable";
import BusinessTypeSetting from "../_BusinessTypeSetting/BusinessTypeSetting";
import CSSettingsSDV3 from "./CSSettingsV3";
const { ccclass } = cc._decorator;
@ccclass
export default class LoadingInit {
private static _instance: LoadingInit = null;
public static get Instance(): LoadingInit { return this._instance; }
//#region private
private _mp3Length: number = 0;
private _mp3LoadedCount: number = 0;
private _handlerClips: ClipsHandleBySoundTable = null;
private _audioClips: cc.AudioClip[] = [];
//#endregion
constructor() {
LoadingInit._instance = this;
let language: string = LocalStorageData.Instance.Language;
cc.log("1.language=" + language);
LanguageManager.UseLanguageUrlStr = language ? language : LanguageManager.UseLanguageUrlStr;
LanguageManager.UseLanguageUrlStr = LanguageManager.UseLanguageUrlStr ? LanguageManager.UseLanguageUrlStr : CSSettingsSDV3.Language.Lanuage[LanguageManager.DefaultLanguageFormId].Type;
LocalStorageData.Instance.Language = LanguageManager.UseLanguageUrlStr;
cc.log("2.language=" + LanguageManager.UseLanguageUrlStr, LocalStorageData.Instance.Language);
LanguageManager.Init();
}
public *LoadMp3AndLanguageInit(_onProgress: Function, _showProgress: Function): IterableIterator<any> {
this._handlerClips = new ClipsHandleBySoundTable(0);
if (!this._handlerClips.SoundTable) {
if (_onProgress) {
_onProgress();
}
return;
}
// 配合語系找語音(找不到載英語再找不到用預設語系語音)
let checkSoundPath: number[] = LanguageManager.SourceIndex != LanguageManager.Type.En ?
[LanguageManager.SourceIndex, LanguageManager.Type.En, LanguageManager.Type.ZnTw] : [LanguageManager.SourceIndex, LanguageManager.Type.ZnTw];
let cloumTagString: string = "";
for (let num of checkSoundPath) {
cloumTagString = CSSettingsSDV3.Language.Lanuage[num + 1].SoundPath;
cloumTagString = this._getCloumTag(cloumTagString);
let checkUrl: string = this._handlerClips.SoundTable.Rows[0][cloumTagString];
if (checkUrl) {
this._handlerClips.UseCloumStr = cloumTagString;
break;
}
}
this._mp3Length = this._handlerClips.SoundTable.Rows.length;
this._mp3LoadedCount = 0;
if (_showProgress) {
_showProgress(this._mp3LoadedCount, this._mp3Length);
}
cc.log("使用語音:" + cloumTagString);
for (let row of this._handlerClips.SoundTable.Rows) {
let fileUrl: string = row[cloumTagString];
if (!fileUrl) {
continue;
}
let name: string = fileUrl.substr(fileUrl.lastIndexOf("/") + 1, fileUrl.length);
fileUrl = BusinessTypeSetting.UsePatch + BusinessTypeSetting.FolderUrlMp3 + fileUrl + ".mp3";
fileUrl = fileUrl + this._getParam(row.Id);
cc.assetManager.loadRemote(fileUrl, (err, audioClip) => this._loadMp3Process(err, audioClip, name, _showProgress));
}
while (this._mp3LoadedCount !== this._mp3Length) {
yield null;
}
yield* this._checkLoadMp3End();
}
private _loadMp3Process(err: Error, res: cc.Asset, name: string, _showProgress: Function): void {
if (err == null) {
cc.log("[事件]mp3載入成功:" + name);
res.name = name;
this._audioClips.push(<cc.AudioClip>res);
this._mp3LoadedCount++;
if (_showProgress) {
_showProgress(this._mp3LoadedCount, this._mp3Length);
}
} else {
cc.warn("[Error]mp3載入失敗:" + name);
}
}
private *_checkLoadMp3End(): IterableIterator<string> {
if (this._handlerClips.SoundTable) {
cc.log("[事件] 取得Common Mp3");
} else {
cc.log("[事件] 沒有SoundTable");
}
this._handlerClips.HandlerClips(this._audioClips);
this._audioClips = null;
}
private _getCloumTag(cloumStr: string): string {
let strs: string[] = cloumStr.split("_");
let newStr: string = "";
for (let str of strs) {
newStr += str.substring(0, 1).toUpperCase().concat(str.substring(1).toLowerCase());
}
return newStr;
}
private _getParam(id: number): string {
let str: string;
if (CC_PREVIEW) {
str = "?v=" + Date.now();
} else {
str = "?v=" + CSSettingsSDV3.Sound[id].Version + "";
}
return str;
}
}
+10
View File
@@ -0,0 +1,10 @@
{
"ver": "1.1.0",
"uuid": "f7307d1a-b9c4-449d-a8ef-62f91a20420f",
"importer": "typescript",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
+13
View File
@@ -0,0 +1,13 @@
{
"ver": "1.1.3",
"uuid": "01d137bf-c85d-4083-9639-9706c93a5711",
"importer": "folder",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {},
"subMetas": {}
}
+83
View File
@@ -0,0 +1,83 @@
import { ITableRow, WithoutRow } from "../../Engine/CatanEngine/TableV3/Core/ITableRow";
import { TableBase } from "../../Engine/CatanEngine/TableV3/Core/TableBase";
import { TableManager } from "../../Engine/CatanEngine/TableV3/TableManager";
/**
* 系統_聊天室#chat.xlsx
* ##程式碼由工具產生, 在此做的修改都將被覆蓋##
*/
export class ChatTable extends TableBase<WithoutRow> {
private _channel: ChannelTable;
/** 系統_聊天室#chat.xlsx > #channel */
public get Channel(): ChannelTable { return this._channel = this._channel || TableManager.InitTable("#chat#channel", ChannelTable, ChannelTableRow); }
private _fixed: FixedTable;
/** 系統_聊天室#chat.xlsx > #fixed */
public get Fixed(): FixedTable { return this._fixed = this._fixed || TableManager.InitTable("#chat#fixed", FixedTable, FixedTableRow); }
private _banstring: BanstringTable;
/** 系統_聊天室#chat.xlsx > #banstring */
public get Banstring(): BanstringTable { return this._banstring = this._banstring || TableManager.InitTable("#chat#banstring", BanstringTable, BanstringTableRow); }
private _string: StringTable;
/** 系統_聊天室#chat.xlsx > #string */
public get String(): StringTable { return this._string = this._string || TableManager.InitTable("#chat#string", StringTable, StringTableRow); }
}
/**
* #channel
*/
export class ChannelTable extends TableBase<ChannelTableRow> {}
export class ChannelTableRow implements ITableRow {
/** 編號 */
Id: number;
/** 名稱 */
Name: string;
}
/**
* #fixed
*/
export class FixedTable extends TableBase<FixedTableRow> {}
export class FixedTableRow implements ITableRow {
/** 編號 */
Id: number;
/** 參數 */
ValueC: number;
}
/**
* #banstring
*/
export class BanstringTable extends TableBase<BanstringTableRow> {}
export class BanstringTableRow implements ITableRow {
/** 編號 */
Id: number;
/** 禁字 */
Word: string;
}
/**
* #string
*/
export class StringTable extends TableBase<StringTableRow> {}
export class StringTableRow implements ITableRow {
/** 編號 */
Id: number;
/** 简体中文讯息 */
MsgZnCh: string;
/** 繁體中文訊息 */
MsgZnTw: string;
/** 英文訊息 */
MsgEn: string;
/** 越南文讯息 */
MsgVi: string;
/** 泰文讯息 */
MsgTh: string;
/** 日文訊息 */
MsgJa: string;
}
+10
View File
@@ -0,0 +1,10 @@
{
"ver": "1.1.0",
"uuid": "e9c3eb88-feb2-4672-9683-bdcd29f6fba9",
"importer": "typescript",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
+25
View File
@@ -0,0 +1,25 @@
import { ITableRow, WithoutRow } from "../../Engine/CatanEngine/TableV3/Core/ITableRow";
import { TableBase } from "../../Engine/CatanEngine/TableV3/Core/TableBase";
import { TableManager } from "../../Engine/CatanEngine/TableV3/TableManager";
/**
* 共用_社群#community.xlsx
* ##程式碼由工具產生, 在此做的修改都將被覆蓋##
*/
export class CommunityTable extends TableBase<WithoutRow> {
private _string: StringTable;
/** 共用_社群#community.xlsx > #string */
public get String(): StringTable { return this._string = this._string || TableManager.InitTable("#community#string", StringTable, StringTableRow); }
}
/**
* #string
*/
export class StringTable extends TableBase<StringTableRow> {}
export class StringTableRow implements ITableRow {
/** 編號 */
Id: number;
/** 繁體中文訊息 */
MsgZnTw: string;
}
@@ -0,0 +1,10 @@
{
"ver": "1.1.0",
"uuid": "fe729976-cd68-4b50-b3ba-c61c7dc116e2",
"importer": "typescript",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
+18
View File
@@ -0,0 +1,18 @@
import { ITableRow, WithoutRow } from "../../Engine/CatanEngine/TableV3/Core/ITableRow";
import { TableBase } from "../../Engine/CatanEngine/TableV3/Core/TableBase";
import { TableManager } from "../../Engine/CatanEngine/TableV3/TableManager";
/**
* 共用_幣別表#currency.xlsx
* ##程式碼由工具產生, 在此做的修改都將被覆蓋##
*/
export class CurrencyTable extends TableBase<CurrencyTableRow> {}
export class CurrencyTableRow implements ITableRow {
/** 編號 */
Id: number;
/** 名稱 */
Name: string;
/** 代碼 */
Type: string;
}
@@ -0,0 +1,10 @@
{
"ver": "1.1.0",
"uuid": "752ceec4-fe80-4bac-8cd2-2716de7dea38",
"importer": "typescript",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
+59
View File
@@ -0,0 +1,59 @@
import { ITableRow, WithoutRow } from "../../Engine/CatanEngine/TableV3/Core/ITableRow";
import { TableBase } from "../../Engine/CatanEngine/TableV3/Core/TableBase";
import { TableManager } from "../../Engine/CatanEngine/TableV3/TableManager";
/**
* 系統_活動#event.xlsx
* ##程式碼由工具產生, 在此做的修改都將被覆蓋##
*/
export class EventTable extends TableBase<WithoutRow> {
private _string: StringTable;
/** 系統_活動#event.xlsx > #string */
public get String(): StringTable { return this._string = this._string || TableManager.InitTable("#event#string", StringTable, StringTableRow); }
private _team: TeamTable;
/** 系統_活動#event.xlsx > #team */
public get Team(): TeamTable { return this._team = this._team || TableManager.InitTable("#event#team", TeamTable, TeamTableRow); }
private _fixed: FixedTable;
/** 系統_活動#event.xlsx > #fixed */
public get Fixed(): FixedTable { return this._fixed = this._fixed || TableManager.InitTable("#event#fixed", FixedTable, FixedTableRow); }
}
/**
* #string
*/
export class StringTable extends TableBase<StringTableRow> {}
export class StringTableRow implements ITableRow {
/** 編號 */
Id: number;
/** 繁體中文訊息 */
MsgZnTw: string;
}
/**
* #team
*/
export class TeamTable extends TableBase<TeamTableRow> {}
export class TeamTableRow implements ITableRow {
/** 編號 */
Id: number;
/** 指定字串 */
String: number;
/** 指定字串2 */
String2: number;
}
/**
* #fixed
*/
export class FixedTable extends TableBase<FixedTableRow> {}
export class FixedTableRow implements ITableRow {
/** 編號 */
Id: number;
/** 前端用 */
Value: number;
}
+10
View File
@@ -0,0 +1,10 @@
{
"ver": "1.1.0",
"uuid": "c167b98f-cf57-4bc6-89c6-2c205046b094",
"importer": "typescript",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
+16
View File
@@ -0,0 +1,16 @@
import { ITableRow, WithoutRow } from "../../Engine/CatanEngine/TableV3/Core/ITableRow";
import { TableBase } from "../../Engine/CatanEngine/TableV3/Core/TableBase";
import { TableManager } from "../../Engine/CatanEngine/TableV3/TableManager";
/**
* 共用_數值表#fixed.xlsx
* ##程式碼由工具產生, 在此做的修改都將被覆蓋##
*/
export class FixedTable extends TableBase<FixedTableRow> {}
export class FixedTableRow implements ITableRow {
/** 編號 */
Id: number;
/** 值 */
Value: number;
}
+10
View File
@@ -0,0 +1,10 @@
{
"ver": "1.1.0",
"uuid": "828c2820-8277-46f3-b4d9-c1b0304c5ff4",
"importer": "typescript",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
+27
View File
@@ -0,0 +1,27 @@
import { ITableRow, WithoutRow } from "../../Engine/CatanEngine/TableV3/Core/ITableRow";
import { TableBase } from "../../Engine/CatanEngine/TableV3/Core/TableBase";
import { TableManager } from "../../Engine/CatanEngine/TableV3/TableManager";
/**
* 系統_表單讀取#formread.xlsx
* ##程式碼由工具產生, 在此做的修改都將被覆蓋##
*/
export class FormreadTable extends TableBase<WithoutRow> {
private _txt: TxtTable;
/** 系統_表單讀取#formread.xlsx > #txt */
public get Txt(): TxtTable { return this._txt = this._txt || TableManager.InitTable("#formread#txt", TxtTable, TxtTableRow); }
}
/**
* #txt
*/
export class TxtTable extends TableBase<TxtTableRow> {}
export class TxtTableRow implements ITableRow {
/** 編號 */
Id: number;
/** 表單名稱 */
Form: string;
/** 版號 */
Version: number;
}
@@ -0,0 +1,10 @@
{
"ver": "1.1.0",
"uuid": "9cfe8460-3b5b-423d-9c80-f18a487cb75c",
"importer": "typescript",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
+69
View File
@@ -0,0 +1,69 @@
import { ITableRow, WithoutRow } from "../../Engine/CatanEngine/TableV3/Core/ITableRow";
import { TableBase } from "../../Engine/CatanEngine/TableV3/Core/TableBase";
import { TableManager } from "../../Engine/CatanEngine/TableV3/TableManager";
/**
* 系統_贈禮#gift.xlsx
* ##程式碼由工具產生, 在此做的修改都將被覆蓋##
*/
export class GiftTable extends TableBase<WithoutRow> {
private _fixed: FixedTable;
/** 系統_贈禮#gift.xlsx > #fixed */
public get Fixed(): FixedTable { return this._fixed = this._fixed || TableManager.InitTable("#gift#fixed", FixedTable, FixedTableRow); }
private _quantity: QuantityTable;
/** 系統_贈禮#gift.xlsx > #quantity */
public get Quantity(): QuantityTable { return this._quantity = this._quantity || TableManager.InitTable("#gift#quantity", QuantityTable, QuantityTableRow); }
private _string: StringTable;
/** 系統_贈禮#gift.xlsx > #string */
public get String(): StringTable { return this._string = this._string || TableManager.InitTable("#gift#string", StringTable, StringTableRow); }
}
/**
* #fixed
*/
export class FixedTable extends TableBase<FixedTableRow> {}
export class FixedTableRow implements ITableRow {
/** 編號 */
Id: number;
/** 參數 */
Value: number;
}
/**
* #quantity
*/
export class QuantityTable extends TableBase<QuantityTableRow> {}
export class QuantityTableRow implements ITableRow {
/** 編號 */
Id: number;
/** 活躍度 */
Activity: number;
/** 單日送禮次數限制 */
Limit: number;
}
/**
* #string
*/
export class StringTable extends TableBase<StringTableRow> {}
export class StringTableRow implements ITableRow {
/** 編號 */
Id: number;
/** 簡體中文讯息 */
MsgZnCh: string;
/** 繁體中文訊息 */
MsgZnTw: string;
/** 英文訊息 */
MsgEn: string;
/** 越南文讯息 */
MsgVi: string;
/** 泰文讯息 */
MsgTh: string;
/** 日文訊息 */
MsgJa: string;
}
+10
View File
@@ -0,0 +1,10 @@
{
"ver": "1.1.0",
"uuid": "5176a734-96ff-4d71-bb91-4395b7e8689c",
"importer": "typescript",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
+91
View File
@@ -0,0 +1,91 @@
import { ITableRow, WithoutRow } from "../../Engine/CatanEngine/TableV3/Core/ITableRow";
import { TableBase } from "../../Engine/CatanEngine/TableV3/Core/TableBase";
import { TableManager } from "../../Engine/CatanEngine/TableV3/TableManager";
/**
* 系統_榮譽#honor.xlsx
* ##程式碼由工具產生, 在此做的修改都將被覆蓋##
*/
export class HonorTable extends TableBase<WithoutRow> {
private _avatar: AvatarTable;
/** 系統_榮譽#honor.xlsx > #avatar */
public get Avatar(): AvatarTable { return this._avatar = this._avatar || TableManager.InitTable("#honor#avatar", AvatarTable, AvatarTableRow); }
private _stringAvatar: StringAvatarTable;
/** 系統_榮譽#honor.xlsx > #string_avatar */
public get StringAvatar(): StringAvatarTable { return this._stringAvatar = this._stringAvatar || TableManager.InitTable("#honor#string_avatar", StringAvatarTable, StringAvatarTableRow); }
private _frame: FrameTable;
/** 系統_榮譽#honor.xlsx > #frame */
public get Frame(): FrameTable { return this._frame = this._frame || TableManager.InitTable("#honor#frame", FrameTable, FrameTableRow); }
private _stringFrame: StringFrameTable;
/** 系統_榮譽#honor.xlsx > #string_frame */
public get StringFrame(): StringFrameTable { return this._stringFrame = this._stringFrame || TableManager.InitTable("#honor#string_frame", StringFrameTable, StringFrameTableRow); }
}
/**
* #avatar
*/
export class AvatarTable extends TableBase<AvatarTableRow> {}
export class AvatarTableRow implements ITableRow {
/** 編號 */
Id: number;
/** 類別 */
Category: number;
/** 名稱 */
AvatarName: number;
/** 說明 */
AvatarDetail: number;
/** 獲得條件 */
Condition: any;
/** 販售金額 */
Money: number;
/** 使用期限 */
Day: string;
}
/**
* #string_avatar
*/
export class StringAvatarTable extends TableBase<StringAvatarTableRow> {}
export class StringAvatarTableRow implements ITableRow {
/** 編號 */
Id: number;
/** 繁體中文訊息 */
MsgZnTw: string;
}
/**
* #frame
*/
export class FrameTable extends TableBase<FrameTableRow> {}
export class FrameTableRow implements ITableRow {
/** 編號 */
Id: number;
/** 類別 */
Category: number;
/** 名稱 */
AvatarName: number;
/** 說明 */
AvatarDetail: number;
/** 販售金額 */
Money: number;
/** 使用期限 */
Day: string;
}
/**
* #string_frame
*/
export class StringFrameTable extends TableBase<StringFrameTableRow> {}
export class StringFrameTableRow implements ITableRow {
/** 編號 */
Id: number;
/** 頭像框名稱 */
MsgZnTw: string;
}
+10
View File
@@ -0,0 +1,10 @@
{
"ver": "1.1.0",
"uuid": "31fd73ce-8847-40fe-8c37-9a19da1c1c12",
"importer": "typescript",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
+97
View File
@@ -0,0 +1,97 @@
import { ITableRow, WithoutRow } from "../../Engine/CatanEngine/TableV3/Core/ITableRow";
import { TableBase } from "../../Engine/CatanEngine/TableV3/Core/TableBase";
import { TableManager } from "../../Engine/CatanEngine/TableV3/TableManager";
/**
* 系統_道具設定#item_setting.xlsx
* ##程式碼由工具產生, 在此做的修改都將被覆蓋##
*/
export class ItemSettingTable extends TableBase<WithoutRow> {
private _stringDetail: StringDetailTable;
/** 系統_道具設定#item_setting.xlsx > #string_detail */
public get StringDetail(): StringDetailTable { return this._stringDetail = this._stringDetail || TableManager.InitTable("#item_setting#string_detail", StringDetailTable, StringDetailTableRow); }
private _stringName: StringNameTable;
/** 系統_道具設定#item_setting.xlsx > #string_name */
public get StringName(): StringNameTable { return this._stringName = this._stringName || TableManager.InitTable("#item_setting#string_name", StringNameTable, StringNameTableRow); }
private _couponSetting: CouponSettingTable;
/** 系統_道具設定#item_setting.xlsx > #coupon_setting */
public get CouponSetting(): CouponSettingTable { return this._couponSetting = this._couponSetting || TableManager.InitTable("#item_setting#coupon_setting", CouponSettingTable, CouponSettingTableRow); }
private _card1Setting: Card1SettingTable;
/** 系統_道具設定#item_setting.xlsx > #card1_setting */
public get Card1Setting(): Card1SettingTable { return this._card1Setting = this._card1Setting || TableManager.InitTable("#item_setting#card1_setting", Card1SettingTable, Card1SettingTableRow); }
}
/**
* #string_detail
*/
export class StringDetailTable extends TableBase<StringDetailTableRow> {}
export class StringDetailTableRow implements ITableRow {
/** 編號 */
Id: number;
/** 繁體中文訊息 */
MsgZnTw: string;
/** 英文訊息 */
MsgEn: string;
}
/**
* #string_name
*/
export class StringNameTable extends TableBase<StringNameTableRow> {}
export class StringNameTableRow implements ITableRow {
/** 編號 */
Id: number;
/** 繁體中文訊息 */
MsgZnTw: string;
/** 英文訊息 */
MsgEn: string;
}
/**
* #coupon_setting
*/
export class CouponSettingTable extends TableBase<CouponSettingTableRow> {}
export class CouponSettingTableRow implements ITableRow {
/** 編號 */
Id: number;
/** 顏色 */
Rank: number;
/** 星數 */
Star: number;
/** 卡片名稱 */
CardName: string;
/** 卡片說明 */
CardDetail: number;
}
/**
* #card1_setting
*/
export class Card1SettingTable extends TableBase<Card1SettingTableRow> {}
export class Card1SettingTableRow implements ITableRow {
/** 編號 */
Id: number;
/** 機台 */
Slot: number;
/** 顏色 */
Rank: number;
/** 星數 */
Star: number;
/** 押注 */
Bet: number;
/** 押注 */
Betrank: number;
/** 卡片說明 */
CardDetail: number;
/** 卡片名稱 */
CardName: number;
/** 獲得金額 */
Obtain: number;
}
@@ -0,0 +1,10 @@
{
"ver": "1.1.0",
"uuid": "b330a6ae-7a22-4109-b21e-8d682ef4370c",
"importer": "typescript",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
+35
View File
@@ -0,0 +1,35 @@
import { ITableRow, WithoutRow } from "../../Engine/CatanEngine/TableV3/Core/ITableRow";
import { TableBase } from "../../Engine/CatanEngine/TableV3/Core/TableBase";
import { TableManager } from "../../Engine/CatanEngine/TableV3/TableManager";
/**
* 共用_語系表#language.xlsx
* ##程式碼由工具產生, 在此做的修改都將被覆蓋##
*/
export class LanguageTable extends TableBase<WithoutRow> {
private _lanuage: LanuageTable;
/** 共用_語系表#language.xlsx > #lanuage */
public get Lanuage(): LanuageTable { return this._lanuage = this._lanuage || TableManager.InitTable("#language#lanuage", LanuageTable, LanuageTableRow); }
}
/**
* #lanuage
*/
export class LanuageTable extends TableBase<LanuageTableRow> {}
export class LanuageTableRow implements ITableRow {
/** 編號 */
Id: number;
/** 名稱 */
Name: string;
/** 代碼 */
Type: string;
/** 對應字串表欄位 */
Msg: string;
/** 對應語言包檔名 */
Path: string;
/** 對應音效欄位 */
SoundPath: string;
/** 是否顯示在設定 */
App: number;
}
@@ -0,0 +1,10 @@
{
"ver": "1.1.0",
"uuid": "b6505d34-f547-4298-929b-4aaef05b5d2c",
"importer": "typescript",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
+87
View File
@@ -0,0 +1,87 @@
import { ITableRow, WithoutRow } from "../../Engine/CatanEngine/TableV3/Core/ITableRow";
import { TableBase } from "../../Engine/CatanEngine/TableV3/Core/TableBase";
import { TableManager } from "../../Engine/CatanEngine/TableV3/TableManager";
/**
* 系統_機台分桌#lobby.xlsx
* ##程式碼由工具產生, 在此做的修改都將被覆蓋##
*/
export class LobbyTable extends TableBase<WithoutRow> {
private _fixed: FixedTable;
/** 系統_機台分桌#lobby.xlsx > #fixed */
public get Fixed(): FixedTable { return this._fixed = this._fixed || TableManager.InitTable("#lobby#fixed", FixedTable, FixedTableRow); }
private _slot: SlotTable;
/** 系統_機台分桌#lobby.xlsx > #slot */
public get Slot(): SlotTable { return this._slot = this._slot || TableManager.InitTable("#lobby#slot", SlotTable, SlotTableRow); }
private _string: StringTable;
/** 系統_機台分桌#lobby.xlsx > #string */
public get String(): StringTable { return this._string = this._string || TableManager.InitTable("#lobby#string", StringTable, StringTableRow); }
}
/**
* #fixed
*/
export class FixedTable extends TableBase<FixedTableRow> {}
export class FixedTableRow implements ITableRow {
/** 編號 */
Id: number;
/** 比值 */
Money: number;
/** 桌 */
Table: number;
/** 大獎1 */
Bigwin1: number;
/** 大獎2 */
Bigwin2: number;
/** 大獎3 */
Bigwin3: number;
/** 大獎4 */
Bigwin4: number;
}
/**
* #slot
*/
export class SlotTable extends TableBase<SlotTableRow> {}
export class SlotTableRow implements ITableRow {
/** 編號 */
Id: number;
/** 分廳 */
Lobby: number;
/** 分桌 */
Table: number;
/** 類型 */
Type: number;
/** 免費遊戲 */
Freegame: number;
/** 指定特性 */
Properties: any;
/** 免費遊戲 */
Free: string;
}
/**
* #string
*/
export class StringTable extends TableBase<StringTableRow> {}
export class StringTableRow implements ITableRow {
/** 編號 */
Id: number;
/** 简体中文讯息 */
MsgZnCh: string;
/** 繁體中文訊息 */
MsgZnTw: string;
/** 英文訊息 */
MsgEn: string;
/** 越南文讯息 */
MsgVi: string;
/** 泰文讯息 */
MsgTh: string;
/** 日文訊息 */
MsgJa: string;
}
+10
View File
@@ -0,0 +1,10 @@
{
"ver": "1.1.0",
"uuid": "22a1d9ad-94c0-4cb7-9ca8-8debd1c6855f",
"importer": "typescript",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
+69
View File
@@ -0,0 +1,69 @@
import { ITableRow, WithoutRow } from "../../Engine/CatanEngine/TableV3/Core/ITableRow";
import { TableBase } from "../../Engine/CatanEngine/TableV3/Core/TableBase";
import { TableManager } from "../../Engine/CatanEngine/TableV3/TableManager";
/**
* 共用_兌禮商城#lppoint.xlsx
* ##程式碼由工具產生, 在此做的修改都將被覆蓋##
*/
export class LppointTable extends TableBase<WithoutRow> {
private _string: StringTable;
/** 共用_兌禮商城#lppoint.xlsx > #string */
public get String(): StringTable { return this._string = this._string || TableManager.InitTable("#lppoint#string", StringTable, StringTableRow); }
private _lppointInter: LppointInterTable;
/** 共用_兌禮商城#lppoint.xlsx > #lppoint_inter */
public get LppointInter(): LppointInterTable { return this._lppointInter = this._lppointInter || TableManager.InitTable("#lppoint#lppoint_inter", LppointInterTable, LppointInterTableRow); }
private _lppointCoin: LppointCoinTable;
/** 共用_兌禮商城#lppoint.xlsx > #lppoint_coin */
public get LppointCoin(): LppointCoinTable { return this._lppointCoin = this._lppointCoin || TableManager.InitTable("#lppoint#lppoint_coin", LppointCoinTable, LppointCoinTableRow); }
}
/**
* #string
*/
export class StringTable extends TableBase<StringTableRow> {}
export class StringTableRow implements ITableRow {
/** 編號 */
Id: number;
/** 英文訊息 */
MsgEn: string;
/** 繁中訊息 */
MsgZnTw: string;
/** 簡中 */
MsgZnCh: string;
/** 越 */
MsgVi: string;
/** 泰 */
MsgTh: string;
/** 日 */
MsgJp: string;
}
/**
* #lppoint_inter
*/
export class LppointInterTable extends TableBase<LppointInterTableRow> {}
export class LppointInterTableRow implements ITableRow {
/** 編號 */
Id: number;
/** 字串編號 */
NameId: string;
}
/**
* #lppoint_coin
*/
export class LppointCoinTable extends TableBase<LppointCoinTableRow> {}
export class LppointCoinTableRow implements ITableRow {
/** 編號 */
Id: number;
/** 來享券 */
Lppoint: number;
/** 金幣 */
Coin: number;
}
+10
View File
@@ -0,0 +1,10 @@
{
"ver": "1.1.0",
"uuid": "1012aa48-7ad0-49ce-a0db-e8334f36ca34",
"importer": "typescript",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
+53
View File
@@ -0,0 +1,53 @@
import { ITableRow, WithoutRow } from "../../Engine/CatanEngine/TableV3/Core/ITableRow";
import { TableBase } from "../../Engine/CatanEngine/TableV3/Core/TableBase";
import { TableManager } from "../../Engine/CatanEngine/TableV3/TableManager";
/**
* 系統_信件#mail.xlsx
* ##程式碼由工具產生, 在此做的修改都將被覆蓋##
*/
export class MailTable extends TableBase<WithoutRow> {
private _stringMail: StringMailTable;
/** 系統_信件#mail.xlsx > #string_mail */
public get StringMail(): StringMailTable { return this._stringMail = this._stringMail || TableManager.InitTable("#mail#string_mail", StringMailTable, StringMailTableRow); }
private _string: StringTable;
/** 系統_信件#mail.xlsx > #string */
public get String(): StringTable { return this._string = this._string || TableManager.InitTable("#mail#string", StringTable, StringTableRow); }
}
/**
* #string_mail
*/
export class StringMailTable extends TableBase<StringMailTableRow> {}
export class StringMailTableRow implements ITableRow {
/** 編號 */
Id: number;
/** 繁體中文訊息 */
MsgZnTw: string;
/** 簡體中文讯息 */
MsgZnCh: string;
/** 英文訊息 */
MsgEn: string;
}
/**
* #string
*/
export class StringTable extends TableBase<StringTableRow> {}
export class StringTableRow implements ITableRow {
/** 編號 */
Id: number;
/** 英文訊息 */
MsgEn: string;
/** 繁體中文訊息 */
MsgZnTw: string;
/** 簡體中文讯息 */
MsgZnCh: string;
/** 越南文讯息 */
MsgVi: string;
/** 泰文讯息 */
MsgTh: string;
}
+10
View File
@@ -0,0 +1,10 @@
{
"ver": "1.1.0",
"uuid": "9b1b254f-e46c-4314-85d9-c5db3de98ebd",
"importer": "typescript",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
+25
View File
@@ -0,0 +1,25 @@
import { ITableRow, WithoutRow } from "../../Engine/CatanEngine/TableV3/Core/ITableRow";
import { TableBase } from "../../Engine/CatanEngine/TableV3/Core/TableBase";
import { TableManager } from "../../Engine/CatanEngine/TableV3/TableManager";
/**
* 系統_暱稱#name.xlsx
* ##程式碼由工具產生, 在此做的修改都將被覆蓋##
*/
export class NameTable extends TableBase<WithoutRow> {
private _banstring: BanstringTable;
/** 系統_暱稱#name.xlsx > #banstring */
public get Banstring(): BanstringTable { return this._banstring = this._banstring || TableManager.InitTable("#name#banstring", BanstringTable, BanstringTableRow); }
}
/**
* #banstring
*/
export class BanstringTable extends TableBase<BanstringTableRow> {}
export class BanstringTableRow implements ITableRow {
/** 編號 */
Id: number;
/** 禁字 */
Word: string;
}
+10
View File
@@ -0,0 +1,10 @@
{
"ver": "1.1.0",
"uuid": "75668b95-a85c-4fde-984c-fae6611f0f6c",
"importer": "typescript",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
+51
View File
@@ -0,0 +1,51 @@
import { ITableRow, WithoutRow } from "../../Engine/CatanEngine/TableV3/Core/ITableRow";
import { TableBase } from "../../Engine/CatanEngine/TableV3/Core/TableBase";
import { TableManager } from "../../Engine/CatanEngine/TableV3/TableManager";
/**
* 系統_跑馬燈#network.xlsx
* ##程式碼由工具產生, 在此做的修改都將被覆蓋##
*/
export class NetworkTable extends TableBase<WithoutRow> {
private _fixed: FixedTable;
/** 系統_跑馬燈#network.xlsx > #fixed */
public get Fixed(): FixedTable { return this._fixed = this._fixed || TableManager.InitTable("#network#fixed", FixedTable, FixedTableRow); }
private _string: StringTable;
/** 系統_跑馬燈#network.xlsx > #string */
public get String(): StringTable { return this._string = this._string || TableManager.InitTable("#network#string", StringTable, StringTableRow); }
}
/**
* #fixed
*/
export class FixedTable extends TableBase<FixedTableRow> {}
export class FixedTableRow implements ITableRow {
/** 編號 */
Id: number;
/** 值 */
CValue: number;
}
/**
* #string
*/
export class StringTable extends TableBase<StringTableRow> {}
export class StringTableRow implements ITableRow {
/** 編號 */
Id: number;
/** 简体中文讯息 */
MsgZnCh: string;
/** 繁體中文訊息 */
MsgZnTw: string;
/** 英文訊息 */
MsgEn: string;
/** 越南文讯息 */
MsgVi: string;
/** 泰文讯息 */
MsgTh: string;
/** 日文訊息 */
MsgJa: string;
}
+10
View File
@@ -0,0 +1,10 @@
{
"ver": "1.1.0",
"uuid": "e04c56a6-ed23-4d26-917f-0971236d285e",
"importer": "typescript",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
+25
View File
@@ -0,0 +1,25 @@
import { ITableRow, WithoutRow } from "../../Engine/CatanEngine/TableV3/Core/ITableRow";
import { TableBase } from "../../Engine/CatanEngine/TableV3/Core/TableBase";
import { TableManager } from "../../Engine/CatanEngine/TableV3/TableManager";
/**
* 系統_背包#packet.xlsx
* ##程式碼由工具產生, 在此做的修改都將被覆蓋##
*/
export class PacketTable extends TableBase<WithoutRow> {
private _string: StringTable;
/** 系統_背包#packet.xlsx > #string */
public get String(): StringTable { return this._string = this._string || TableManager.InitTable("#packet#string", StringTable, StringTableRow); }
}
/**
* #string
*/
export class StringTable extends TableBase<StringTableRow> {}
export class StringTableRow implements ITableRow {
/** 編號 */
Id: number;
/** 繁體中文訊息 */
MsgZnTw: string;
}
+10
View File
@@ -0,0 +1,10 @@
{
"ver": "1.1.0",
"uuid": "51f02045-a9ea-4548-b823-e4a575bb9a66",
"importer": "typescript",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
+42
View File
@@ -0,0 +1,42 @@
import { ITableRow, WithoutRow } from "../../Engine/CatanEngine/TableV3/Core/ITableRow";
import { TableBase } from "../../Engine/CatanEngine/TableV3/Core/TableBase";
import { TableManager } from "../../Engine/CatanEngine/TableV3/TableManager";
/**
* 系統_排行榜#rank.xlsx
* ##程式碼由工具產生, 在此做的修改都將被覆蓋##
*/
export class RankTable extends TableBase<RankTableRow> {
private _string: StringTable;
/** 系統_排行榜#rank.xlsx > #string */
public get String(): StringTable { return this._string = this._string || TableManager.InitTable("#rank#string", StringTable, StringTableRow); }
}
export class RankTableRow implements ITableRow {
/** 編號 */
Id: number;
/** 值 */
Rank1: number;
}
/**
* #string
*/
export class StringTable extends TableBase<StringTableRow> {}
export class StringTableRow implements ITableRow {
/** 編號 */
Id: number;
/** 简体中文讯息 */
MsgZnCh: string;
/** 繁體中文訊息 */
MsgZnTw: string;
/** 英文訊息 */
MsgEn: string;
/** 越南文讯息 */
MsgVi: string;
/** 泰文讯息 */
MsgTh: string;
/** 日文讯息 */
MsgJa: string;
}
+10
View File
@@ -0,0 +1,10 @@
{
"ver": "1.1.0",
"uuid": "fb57889f-455c-49dd-accb-6c3bf9d1efd1",
"importer": "typescript",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
+35
View File
@@ -0,0 +1,35 @@
import { ITableRow, WithoutRow } from "../../Engine/CatanEngine/TableV3/Core/ITableRow";
import { TableBase } from "../../Engine/CatanEngine/TableV3/Core/TableBase";
import { TableManager } from "../../Engine/CatanEngine/TableV3/TableManager";
/**
* 共用_設定表#setting.xlsx
* ##程式碼由工具產生, 在此做的修改都將被覆蓋##
*/
export class SettingTable extends TableBase<WithoutRow> {
private _string: StringTable;
/** 共用_設定表#setting.xlsx > #string */
public get String(): StringTable { return this._string = this._string || TableManager.InitTable("#setting#string", StringTable, StringTableRow); }
}
/**
* #string
*/
export class StringTable extends TableBase<StringTableRow> {}
export class StringTableRow implements ITableRow {
/** 編號 */
Id: number;
/** 简体中文讯息 */
MsgZnCh: string;
/** 繁體中文訊息 */
MsgZnTw: string;
/** 英文訊息 */
MsgEn: string;
/** 越南文讯息 */
MsgVi: string;
/** 泰文讯息 */
MsgTh: string;
/** 日文訊息 */
MsgJa: string;
}
+10
View File
@@ -0,0 +1,10 @@
{
"ver": "1.1.0",
"uuid": "8d4bd91a-fc99-4a89-8a92-f974fa794dd3",
"importer": "typescript",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
+513
View File
@@ -0,0 +1,513 @@
import { ITableRow, WithoutRow } from "../../Engine/CatanEngine/TableV3/Core/ITableRow";
import { TableBase } from "../../Engine/CatanEngine/TableV3/Core/TableBase";
import { TableManager } from "../../Engine/CatanEngine/TableV3/TableManager";
/**
* 共用_商城#shop.xlsx
* ##程式碼由工具產生, 在此做的修改都將被覆蓋##
*/
export class ShopTable extends TableBase<WithoutRow> {
private _shopMycard: ShopMycardTable;
/** 共用_商城#shop.xlsx > #shop_mycard */
public get ShopMycard(): ShopMycardTable { return this._shopMycard = this._shopMycard || TableManager.InitTable("#shop#shop_mycard", ShopMycardTable, ShopMycardTableRow); }
private _dayPackage: DayPackageTable;
/** 共用_商城#shop.xlsx > #day_package */
public get DayPackage(): DayPackageTable { return this._dayPackage = this._dayPackage || TableManager.InitTable("#shop#day_package", DayPackageTable, DayPackageTableRow); }
private _onlyPackage: OnlyPackageTable;
/** 共用_商城#shop.xlsx > #only_package */
public get OnlyPackage(): OnlyPackageTable { return this._onlyPackage = this._onlyPackage || TableManager.InitTable("#shop#only_package", OnlyPackageTable, OnlyPackageTableRow); }
private _timePackage: TimePackageTable;
/** 共用_商城#shop.xlsx > #time_package */
public get TimePackage(): TimePackageTable { return this._timePackage = this._timePackage || TableManager.InitTable("#shop#time_package", TimePackageTable, TimePackageTableRow); }
private _string: StringTable;
/** 共用_商城#shop.xlsx > #string */
public get String(): StringTable { return this._string = this._string || TableManager.InitTable("#shop#string", StringTable, StringTableRow); }
private _fastList: FastListTable;
/** 共用_商城#shop.xlsx > #fast_list */
public get FastList(): FastListTable { return this._fastList = this._fastList || TableManager.InitTable("#shop#fast_list", FastListTable, FastListTableRow); }
private _normalList: NormalListTable;
/** 共用_商城#shop.xlsx > #normal_list */
public get NormalList(): NormalListTable { return this._normalList = this._normalList || TableManager.InitTable("#shop#normal_list", NormalListTable, NormalListTableRow); }
private _fastShop2: FastShop2Table;
/** 共用_商城#shop.xlsx > #fast_shop2 */
public get FastShop2(): FastShop2Table { return this._fastShop2 = this._fastShop2 || TableManager.InitTable("#shop#fast_shop2", FastShop2Table, FastShop2TableRow); }
private _shopShow2: ShopShow2Table;
/** 共用_商城#shop.xlsx > #shop_show2 */
public get ShopShow2(): ShopShow2Table { return this._shopShow2 = this._shopShow2 || TableManager.InitTable("#shop#shop_show2", ShopShow2Table, ShopShow2TableRow); }
private _shopString: ShopStringTable;
/** 共用_商城#shop.xlsx > #shop_string */
public get ShopString(): ShopStringTable { return this._shopString = this._shopString || TableManager.InitTable("#shop#shop_string", ShopStringTable, ShopStringTableRow); }
private _mycardNumber: MycardNumberTable;
/** 共用_商城#shop.xlsx > #mycard_number */
public get MycardNumber(): MycardNumberTable { return this._mycardNumber = this._mycardNumber || TableManager.InitTable("#shop#mycard_number", MycardNumberTable, MycardNumberTableRow); }
private _mycardConvert: MycardConvertTable;
/** 共用_商城#shop.xlsx > #mycard_convert */
public get MycardConvert(): MycardConvertTable { return this._mycardConvert = this._mycardConvert || TableManager.InitTable("#shop#mycard_convert", MycardConvertTable, MycardConvertTableRow); }
private _mycardFree: MycardFreeTable;
/** 共用_商城#shop.xlsx > #mycard_free */
public get MycardFree(): MycardFreeTable { return this._mycardFree = this._mycardFree || TableManager.InitTable("#shop#mycard_free", MycardFreeTable, MycardFreeTableRow); }
private _mycardMobile: MycardMobileTable;
/** 共用_商城#shop.xlsx > #mycard_mobile */
public get MycardMobile(): MycardMobileTable { return this._mycardMobile = this._mycardMobile || TableManager.InitTable("#shop#mycard_mobile", MycardMobileTable, MycardMobileTableRow); }
private _mycardBank: MycardBankTable;
/** 共用_商城#shop.xlsx > #mycard_bank */
public get MycardBank(): MycardBankTable { return this._mycardBank = this._mycardBank || TableManager.InitTable("#shop#mycard_bank", MycardBankTable, MycardBankTableRow); }
private _mycardCredit: MycardCreditTable;
/** 共用_商城#shop.xlsx > #mycard_credit */
public get MycardCredit(): MycardCreditTable { return this._mycardCredit = this._mycardCredit || TableManager.InitTable("#shop#mycard_credit", MycardCreditTable, MycardCreditTableRow); }
private _mycardTelecom: MycardTelecomTable;
/** 共用_商城#shop.xlsx > #mycard_telecom */
public get MycardTelecom(): MycardTelecomTable { return this._mycardTelecom = this._mycardTelecom || TableManager.InitTable("#shop#mycard_telecom", MycardTelecomTable, MycardTelecomTableRow); }
private _shopEasy: ShopEasyTable;
/** 共用_商城#shop.xlsx > #shop_easy */
public get ShopEasy(): ShopEasyTable { return this._shopEasy = this._shopEasy || TableManager.InitTable("#shop#shop_easy", ShopEasyTable, ShopEasyTableRow); }
private _shopFirst: ShopFirstTable;
/** 共用_商城#shop.xlsx > #shop_first */
public get ShopFirst(): ShopFirstTable { return this._shopFirst = this._shopFirst || TableManager.InitTable("#shop#shop_first", ShopFirstTable, ShopFirstTableRow); }
private _fastShop: FastShopTable;
/** 共用_商城#shop.xlsx > #fast_shop */
public get FastShop(): FastShopTable { return this._fastShop = this._fastShop || TableManager.InitTable("#shop#fast_shop", FastShopTable, FastShopTableRow); }
}
/**
* #shop_mycard
*/
export class ShopMycardTable extends TableBase<ShopMycardTableRow> {}
export class ShopMycardTableRow implements ITableRow {
/** 編號 */
Id: number;
/** 商品品項 */
Product: string;
/** 金幣顯示 */
ShowMoney: number;
/** 道具顯示 */
ShowItem: string;
/** 價格 */
Price: number;
/** 悠遊付 */
EasyWallet: number;
}
/**
* #day_package
*/
export class DayPackageTable extends TableBase<DayPackageTableRow> {}
export class DayPackageTableRow implements ITableRow {
/** 編號 */
Id: number;
/** 商品品項 */
ProductId: number;
/** 總共給幾天 */
Day: number;
/** 補簽代價 */
Resign: any;
/** 每日獎勵 */
GiftDay: any;
/** 最後一天輪盤_獎勵固定6個 */
GiftFinalday: any;
}
/**
* #only_package
*/
export class OnlyPackageTable extends TableBase<OnlyPackageTableRow> {}
export class OnlyPackageTableRow implements ITableRow {
/** 編號 */
Id: number;
/** 商品品項 */
ProductId: number;
/** 獎勵 */
Gift: any;
}
/**
* #time_package
*/
export class TimePackageTable extends TableBase<TimePackageTableRow> {}
export class TimePackageTableRow implements ITableRow {
/** 編號 */
Id: number;
/** 商品品項 */
ProductId: number;
/** 獎勵 */
Gift: any;
}
/**
* #string
*/
export class StringTable extends TableBase<StringTableRow> {}
export class StringTableRow implements ITableRow {
/** 編號 */
Id: number;
/** 简体中文讯息 */
MsgZnCh: string;
/** 繁體中文訊息 */
MsgZnTw: string;
/** 英文訊息 */
MsgEn: string;
/** 越南文讯息 */
MsgVi: string;
/** 泰文讯息 */
MsgTh: string;
/** 日文讯息 */
MsgJa: string;
}
/**
* #fast_list
*/
export class FastListTable extends TableBase<FastListTableRow> {}
export class FastListTableRow implements ITableRow {
/** 編號 */
Id: number;
/** 上次儲值金額 */
Record: number;
/** VIP等級 */
Vip: number;
/** 品項1 */
FastShop1: number;
/** 品項2 */
FastShop2: number;
/** 品項3 */
FastShop3: number;
/** 品項4 */
FastShop4: number;
/** 品項5 */
FastShop5: number;
/** 品項6 */
FastShop6: number;
}
/**
* #normal_list
*/
export class NormalListTable extends TableBase<NormalListTableRow> {}
export class NormalListTableRow implements ITableRow {
/** 編號 */
Id: number;
/** 定義 */
Type: number;
/** 商品名稱 */
Name: number;
/** 順序 */
Sort: number;
/** 顯示 */
Show: number;
/** 圖片路徑 */
Img: string;
}
/**
* #fast_shop2
*/
export class FastShop2Table extends TableBase<FastShop2TableRow> {}
export class FastShop2TableRow implements ITableRow {
/** 編號 */
Id: number;
/** show2的ID */
Show2Id: number;
/** 個別表選項編號 */
Id2: number;
}
/**
* #shop_show2
*/
export class ShopShow2Table extends TableBase<ShopShow2TableRow> {}
export class ShopShow2TableRow implements ITableRow {
/** 編號 */
Id: number;
/** 定義 */
Type: number;
/** 商品ID */
Key: string;
/** 商品名稱 */
Name: number;
/** 順序 */
Sort: number;
/** 顯示 */
Show: number;
/** 顯示 */
Maxshow: number;
/** 圖片路徑 */
Img: string;
}
/**
* #shop_string
*/
export class ShopStringTable extends TableBase<ShopStringTableRow> {}
export class ShopStringTableRow implements ITableRow {
/** 編號 */
Id: number;
/** 英文訊息 */
MsgEn: string;
/** 繁中訊息 */
MsgZnTw: string;
/** 簡中 */
MsgZnCh: string;
/** 越 */
MsgVi: string;
/** 泰 */
MsgTh: string;
/** 日文訊息 */
MsgJa: string;
}
/**
* #mycard_number
*/
export class MycardNumberTable extends TableBase<MycardNumberTableRow> {}
export class MycardNumberTableRow implements ITableRow {
/** 編號 */
Id: number;
/** 商品品項 */
ProductId: number;
/** 常駐金幣 */
GoldNormal: number;
/** 首儲金幣 */
GoldFirst: number;
/** 5%金幣 */
Gold5: number;
/** 10%金幣 */
Gold10: number;
/** 20%金幣 */
Gold20: number;
/** 加贈道具 */
AddItem: any;
/** 加贈金幣顯示 */
ShowBonus: number;
}
/**
* #mycard_convert
*/
export class MycardConvertTable extends TableBase<MycardConvertTableRow> {}
export class MycardConvertTableRow implements ITableRow {
/** 編號 */
Id: number;
/** 商品品項 */
ProductId: number;
/** 常駐金幣 */
GoldNormal: number;
/** 首儲金幣 */
GoldFirst: number;
/** 5%金幣 */
Gold5: number;
/** 10%金幣 */
Gold10: number;
/** 20%金幣 */
Gold20: number;
/** 加贈道具 */
AddItem: any;
/** 加贈金幣顯示 */
ShowBonus: number;
}
/**
* #mycard_free
*/
export class MycardFreeTable extends TableBase<MycardFreeTableRow> {}
export class MycardFreeTableRow implements ITableRow {
/** 編號 */
Id: number;
/** 商品品項 */
ProductId: number;
/** 常駐金幣 */
GoldNormal: number;
/** 首儲金幣 */
GoldFirst: number;
/** 5%金幣 */
Gold5: number;
/** 10%金幣 */
Gold10: number;
/** 20%金幣 */
Gold20: number;
/** 加贈道具 */
AddItem: any;
/** 加贈金幣顯示 */
ShowBonus: number;
}
/**
* #mycard_mobile
*/
export class MycardMobileTable extends TableBase<MycardMobileTableRow> {}
export class MycardMobileTableRow implements ITableRow {
/** 編號 */
Id: number;
/** 商品品項 */
ProductId: number;
/** 常駐金幣 */
GoldNormal: number;
/** 首儲金幣 */
GoldFirst: number;
/** 5%金幣 */
Gold5: number;
/** 10%金幣 */
Gold10: number;
/** 20%金幣 */
Gold20: number;
/** 加贈道具 */
AddItem: any;
/** 加贈金幣顯示 */
ShowBonus: number;
}
/**
* #mycard_bank
*/
export class MycardBankTable extends TableBase<MycardBankTableRow> {}
export class MycardBankTableRow implements ITableRow {
/** 編號 */
Id: number;
/** 商品品項 */
ProductId: number;
/** 常駐金幣 */
GoldNormal: number;
/** 首儲金幣 */
GoldFirst: number;
/** 5%金幣 */
Gold5: number;
/** 10%金幣 */
Gold10: number;
/** 20%金幣 */
Gold20: number;
/** 加贈道具 */
AddItem: any;
/** 加贈金幣顯示 */
ShowBonus: number;
}
/**
* #mycard_credit
*/
export class MycardCreditTable extends TableBase<MycardCreditTableRow> {}
export class MycardCreditTableRow implements ITableRow {
/** 編號 */
Id: number;
/** 商品品項 */
ProductId: number;
/** 常駐金幣 */
GoldNormal: number;
/** 首儲金幣 */
GoldFirst: number;
/** 5%金幣 */
Gold5: number;
/** 10%金幣 */
Gold10: number;
/** 20%金幣 */
Gold20: number;
/** 加贈道具 */
AddItem: any;
/** 加贈金幣顯示 */
ShowBonus: number;
}
/**
* #mycard_telecom
*/
export class MycardTelecomTable extends TableBase<MycardTelecomTableRow> {}
export class MycardTelecomTableRow implements ITableRow {
/** 編號 */
Id: number;
/** 商品品項 */
ProductId: number;
/** 常駐金幣 */
GoldNormal: number;
/** 首儲金幣 */
GoldFirst: number;
/** 5%金幣 */
Gold5: number;
/** 10%金幣 */
Gold10: number;
/** 20%金幣 */
Gold20: number;
/** 加贈道具 */
AddItem: any;
/** 加贈金幣顯示 */
ShowBonus: number;
}
/**
* #shop_easy
*/
export class ShopEasyTable extends TableBase<ShopEasyTableRow> {}
export class ShopEasyTableRow implements ITableRow {
/** 編號 */
Id: number;
/** 儲值管道 */
Type: string;
/** 商品ID */
TypeId: number;
}
/**
* #shop_first
*/
export class ShopFirstTable extends TableBase<ShopFirstTableRow> {}
export class ShopFirstTableRow implements ITableRow {
/** 編號 */
Id: number;
/** 儲值管道 */
Type: string;
/** 商品ID */
TypeId: number;
}
/**
* #fast_shop
*/
export class FastShopTable extends TableBase<FastShopTableRow> {}
export class FastShopTableRow implements ITableRow {
/** 編號 */
Id: number;
/** 定義 */
Type: number;
/** 商品ID */
Key: string;
/** 商品ID */
Name: string;
/** 個別表選項編號 */
Id2: number;
}
+10
View File
@@ -0,0 +1,10 @@
{
"ver": "1.1.0",
"uuid": "19f7af79-ff68-41f6-bb7a-82dd50d85f39",
"importer": "typescript",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
+22
View File
@@ -0,0 +1,22 @@
import { ITableRow, WithoutRow } from "../../Engine/CatanEngine/TableV3/Core/ITableRow";
import { TableBase } from "../../Engine/CatanEngine/TableV3/Core/TableBase";
import { TableManager } from "../../Engine/CatanEngine/TableV3/TableManager";
/**
* 系統_音效表#sound.xlsx
* ##程式碼由工具產生, 在此做的修改都將被覆蓋##
*/
export class SoundTable extends TableBase<SoundTableRow> {}
export class SoundTableRow implements ITableRow {
/** 編號 */
Id: number;
/** 音效=1, 音樂 = 2 */
Type: number;
/** 繁體中文音檔位置 */
PathZnTw: string;
/** 英文音檔位置(預設音檔位置) */
PathEn: string;
/** 版號 */
Version: string;
}
+10
View File
@@ -0,0 +1,10 @@
{
"ver": "1.1.0",
"uuid": "02bead76-a7c7-4a8e-9bae-ff0abba97b14",
"importer": "typescript",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
+42
View File
@@ -0,0 +1,42 @@
import { ITableRow, WithoutRow } from "../../Engine/CatanEngine/TableV3/Core/ITableRow";
import { TableBase } from "../../Engine/CatanEngine/TableV3/Core/TableBase";
import { TableManager } from "../../Engine/CatanEngine/TableV3/TableManager";
/**
* 共用_字串表#string.xlsx
* ##程式碼由工具產生, 在此做的修改都將被覆蓋##
*/
export class StringTable extends TableBase<StringTableRow> {
private _stringFilter: StringFilterTable;
/** 共用_字串表#string.xlsx > #string_filter */
public get StringFilter(): StringFilterTable { return this._stringFilter = this._stringFilter || TableManager.InitTable("#string#string_filter", StringFilterTable, StringFilterTableRow); }
}
export class StringTableRow implements ITableRow {
/** 編號 */
Id: number;
/** 简体中文讯息 */
MsgZnCh: string;
/** 繁體中文訊息 */
MsgZnTw: string;
/** 英文訊息 */
MsgEn: string;
/** 越南文讯息 */
MsgVi: string;
/** 泰文讯息 */
MsgTh: string;
/** 日文訊息 */
MsgJa: string;
}
/**
* #string_filter
*/
export class StringFilterTable extends TableBase<StringFilterTableRow> {}
export class StringFilterTableRow implements ITableRow {
/** 編號 */
Id: number;
/** 過濾字串 */
FilterWord: string;
}
+10
View File
@@ -0,0 +1,10 @@
{
"ver": "1.1.0",
"uuid": "71483148-1fd4-4019-8f50-322ee2856c25",
"importer": "typescript",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
+97
View File
@@ -0,0 +1,97 @@
import { ITableRow, WithoutRow } from "../../Engine/CatanEngine/TableV3/Core/ITableRow";
import { TableBase } from "../../Engine/CatanEngine/TableV3/Core/TableBase";
import { TableManager } from "../../Engine/CatanEngine/TableV3/TableManager";
/**
* 系統_任務#task.xlsx
* ##程式碼由工具產生, 在此做的修改都將被覆蓋##
*/
export class TaskTable extends TableBase<WithoutRow> {
private _list: ListTable;
/** 系統_任務#task.xlsx > #list */
public get List(): ListTable { return this._list = this._list || TableManager.InitTable("#task#list", ListTable, ListTableRow); }
private _taskSetting: TaskSettingTable;
/** 系統_任務#task.xlsx > #task_setting */
public get TaskSetting(): TaskSettingTable { return this._taskSetting = this._taskSetting || TableManager.InitTable("#task#task_setting", TaskSettingTable, TaskSettingTableRow); }
private _tiroTask: TiroTaskTable;
/** 系統_任務#task.xlsx > #tiro_task */
public get TiroTask(): TiroTaskTable { return this._tiroTask = this._tiroTask || TableManager.InitTable("#task#tiro_task", TiroTaskTable, TiroTaskTableRow); }
private _string: StringTable;
/** 系統_任務#task.xlsx > #string */
public get String(): StringTable { return this._string = this._string || TableManager.InitTable("#task#string", StringTable, StringTableRow); }
}
/**
* #list
*/
export class ListTable extends TableBase<ListTableRow> {}
export class ListTableRow implements ITableRow {
/** 編號 */
Id: number;
/** 一般任務 */
Normal: number;
/** 進階任務 */
Advanced: number;
}
/**
* #task_setting
*/
export class TaskSettingTable extends TableBase<TaskSettingTableRow> {}
export class TaskSettingTableRow implements ITableRow {
/** 編號 */
Id: number;
/** VIP限制 */
Vip: number;
/** 天數 */
Day: number;
/** 機台 */
Game: any;
/** 類型 */
Type: number;
/** 顯示 */
ShowZnTw: string;
/** 押分 */
Bet: number;
/** 獎勵類型 */
AwardType: number;
/** 獎勵參數 */
AwardValue: number;
}
/**
* #tiro_task
*/
export class TiroTaskTable extends TableBase<TiroTaskTableRow> {}
export class TiroTaskTableRow implements ITableRow {
/** 編號 */
Id: number;
/** 類型 */
Type: number;
/** 參數 */
Value: any;
/** 顯示 */
ShowZnTw: string;
/** 獎勵 */
Award: any;
/** 前置條件 */
Condition: number;
}
/**
* #string
*/
export class StringTable extends TableBase<StringTableRow> {}
export class StringTableRow implements ITableRow {
/** 編號 */
Id: number;
/** 繁體中文訊息 */
MsgZnTw: string;
}
+10
View File
@@ -0,0 +1,10 @@
{
"ver": "1.1.0",
"uuid": "112c0705-4baf-4713-9992-34a646e334f1",
"importer": "typescript",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
+303
View File
@@ -0,0 +1,303 @@
import { ITableRow, WithoutRow } from "../../Engine/CatanEngine/TableV3/Core/ITableRow";
import { TableBase } from "../../Engine/CatanEngine/TableV3/Core/TableBase";
import { TableManager } from "../../Engine/CatanEngine/TableV3/TableManager";
/**
* 系統_VIP#vip.xlsx
* ##程式碼由工具產生, 在此做的修改都將被覆蓋##
*/
export class VipTable extends TableBase<WithoutRow> {
private _vipSet: VipSetTable;
/** 系統_VIP#vip.xlsx > #vip_set */
public get VipSet(): VipSetTable { return this._vipSet = this._vipSet || TableManager.InitTable("#vip#vip_set", VipSetTable, VipSetTableRow); }
private _fixed: FixedTable;
/** 系統_VIP#vip.xlsx > #fixed */
public get Fixed(): FixedTable { return this._fixed = this._fixed || TableManager.InitTable("#vip#fixed", FixedTable, FixedTableRow); }
private _string: StringTable;
/** 系統_VIP#vip.xlsx > #string */
public get String(): StringTable { return this._string = this._string || TableManager.InitTable("#vip#string", StringTable, StringTableRow); }
private _vipShow: VipShowTable;
/** 系統_VIP#vip.xlsx > #vip_show */
public get VipShow(): VipShowTable { return this._vipShow = this._vipShow || TableManager.InitTable("#vip#vip_show", VipShowTable, VipShowTableRow); }
private _ruleMsgZnTw: RuleMsgZnTwTable;
/** 系統_VIP#vip.xlsx > #rule_msg_zn_tw */
public get RuleMsgZnTw(): RuleMsgZnTwTable { return this._ruleMsgZnTw = this._ruleMsgZnTw || TableManager.InitTable("#vip#rule_msg_zn_tw", RuleMsgZnTwTable, RuleMsgZnTwTableRow); }
private _ruleMsgZnCh: RuleMsgZnChTable;
/** 系統_VIP#vip.xlsx > #rule_msg_zn_ch */
public get RuleMsgZnCh(): RuleMsgZnChTable { return this._ruleMsgZnCh = this._ruleMsgZnCh || TableManager.InitTable("#vip#rule_msg_zn_ch", RuleMsgZnChTable, RuleMsgZnChTableRow); }
private _ruleMsgEn: RuleMsgEnTable;
/** 系統_VIP#vip.xlsx > #rule_msg_en */
public get RuleMsgEn(): RuleMsgEnTable { return this._ruleMsgEn = this._ruleMsgEn || TableManager.InitTable("#vip#rule_msg_en", RuleMsgEnTable, RuleMsgEnTableRow); }
private _ruleMsgVi: RuleMsgViTable;
/** 系統_VIP#vip.xlsx > #rule_msg_vi */
public get RuleMsgVi(): RuleMsgViTable { return this._ruleMsgVi = this._ruleMsgVi || TableManager.InitTable("#vip#rule_msg_vi", RuleMsgViTable, RuleMsgViTableRow); }
private _ruleMsgTh: RuleMsgThTable;
/** 系統_VIP#vip.xlsx > #rule_msg_th */
public get RuleMsgTh(): RuleMsgThTable { return this._ruleMsgTh = this._ruleMsgTh || TableManager.InitTable("#vip#rule_msg_th", RuleMsgThTable, RuleMsgThTableRow); }
private _ruleMsgJa: RuleMsgJaTable;
/** 系統_VIP#vip.xlsx > #rule_msg_ja */
public get RuleMsgJa(): RuleMsgJaTable { return this._ruleMsgJa = this._ruleMsgJa || TableManager.InitTable("#vip#rule_msg_ja", RuleMsgJaTable, RuleMsgJaTableRow); }
}
/**
* #vip_set
*/
export class VipSetTable extends TableBase<VipSetTableRow> {}
export class VipSetTableRow implements ITableRow {
/** 編號 */
Id: number;
/** 一個月內累積儲值 */
Money: number;
/** 一個月內累積押注 */
Bet: number;
/** 每日送禮額度 */
GiftLimit: number;
/** 每日送禮次數 */
GiftNum: number;
/** 接受贈禮 */
GiftOn: number;
/** 會員期限 */
Time: number;
/** 發財金 */
Gold: any;
/** 好友名單 */
Friendlist: number;
/** 私聊 */
Talk: number;
}
/**
* #fixed
*/
export class FixedTable extends TableBase<FixedTableRow> {}
export class FixedTableRow implements ITableRow {
/** 編號 */
Id: number;
/** 參數 */
Value: number;
}
/**
* #string
*/
export class StringTable extends TableBase<StringTableRow> {}
export class StringTableRow implements ITableRow {
/** 編號 */
Id: number;
/** 簡體中文讯息 */
MsgZnCh: string;
/** 繁體中文訊息 */
MsgZnTw: string;
/** 英文訊息 */
MsgEn: string;
/** 越南文讯息 */
MsgVi: string;
/** 泰文讯息 */
MsgTh: string;
/** 日文讯息 */
MsgJa: string;
}
/**
* #vip_show
*/
export class VipShowTable extends TableBase<VipShowTableRow> {}
export class VipShowTableRow implements ITableRow {
/** 編號 */
Id: number;
/** 顯示 */
Name: string;
}
/**
* #rule_msg_zn_tw
*/
export class RuleMsgZnTwTable extends TableBase<RuleMsgZnTwTableRow> {}
export class RuleMsgZnTwTableRow implements ITableRow {
/** 編號 */
Id: number;
/** 一個月內累積儲值 */
Money: string;
/** 一個月內累積押注 */
Bet: string;
/** 單日送禮額度 */
GiftLimit: string;
/** 每日送禮次數 */
GiftNum: string;
/** 接受贈禮 */
GiftOn: string;
/** 常用名單 */
Friendlist: string;
/** 會員期限 */
Time: string;
/** 發財金 */
Gold: string;
/** 私聊 */
Talk: string;
/** 公共頻道 */
Channel: string;
}
/**
* #rule_msg_zn_ch
*/
export class RuleMsgZnChTable extends TableBase<RuleMsgZnChTableRow> {}
export class RuleMsgZnChTableRow implements ITableRow {
/** 編號 */
Id: number;
/** 一個月內累積儲值 */
Money: string;
/** 一個月內累積押注 */
Bet: string;
/** 單日送禮額度 */
GiftLimit: string;
/** 每日送禮次數 */
GiftNum: string;
/** 接受贈禮 */
GiftOn: string;
/** 常用名單 */
Friendlist: string;
/** 會員期限 */
Time: string;
/** 發財金 */
Gold: string;
/** 私聊 */
Talk: string;
/** 公共頻道 */
Channel: string;
}
/**
* #rule_msg_en
*/
export class RuleMsgEnTable extends TableBase<RuleMsgEnTableRow> {}
export class RuleMsgEnTableRow implements ITableRow {
/** 編號 */
Id: number;
/** 一個月內累積儲值 */
Money: string;
/** 一個月內累積押注 */
Bet: string;
/** 單日送禮額度 */
GiftLimit: string;
/** 每日送禮次數 */
GiftNum: string;
/** 接受贈禮 */
GiftOn: string;
/** 常用名單 */
Friendlist: string;
/** 會員期限 */
Time: string;
/** 發財金 */
Gold: string;
/** 私聊 */
Talk: string;
/** 公共頻道 */
Channel: string;
}
/**
* #rule_msg_vi
*/
export class RuleMsgViTable extends TableBase<RuleMsgViTableRow> {}
export class RuleMsgViTableRow implements ITableRow {
/** 編號 */
Id: number;
/** 一個月內累積儲值 */
Money: string;
/** 一個月內累積押注 */
Bet: string;
/** 單日送禮額度 */
GiftLimit: string;
/** 每日送禮次數 */
GiftNum: string;
/** 接受贈禮 */
GiftOn: string;
/** 常用名單 */
Friendlist: string;
/** 會員期限 */
Time: string;
/** 發財金 */
Gold: string;
/** 私聊 */
Talk: string;
/** 公共頻道 */
Channel: string;
}
/**
* #rule_msg_th
*/
export class RuleMsgThTable extends TableBase<RuleMsgThTableRow> {}
export class RuleMsgThTableRow implements ITableRow {
/** 編號 */
Id: number;
/** 一個月內累積儲值 */
Money: string;
/** 一個月內累積押注 */
Bet: string;
/** 單日送禮額度 */
GiftLimit: string;
/** 每日送禮次數 */
GiftNum: string;
/** 接受贈禮 */
GiftOn: string;
/** 常用名單 */
Friendlist: string;
/** 會員期限 */
Time: string;
/** 發財金 */
Gold: string;
/** 私聊 */
Talk: string;
/** 公共頻道 */
Channel: string;
}
/**
* #rule_msg_ja
*/
export class RuleMsgJaTable extends TableBase<RuleMsgJaTableRow> {}
export class RuleMsgJaTableRow implements ITableRow {
/** 編號 */
Id: number;
/** 一個月內累積儲值 */
Money: string;
/** 一個月內累積押注 */
Bet: string;
/** 單日送禮額度 */
GiftLimit: string;
/** 每日送禮次數 */
GiftNum: string;
/** 接受贈禮 */
GiftOn: string;
/** 常用名單 */
Friendlist: string;
/** 會員期限 */
Time: string;
/** 發財金 */
Gold: string;
/** 私聊 */
Talk: string;
/** 公共頻道 */
Channel: string;
}
+10
View File
@@ -0,0 +1,10 @@
{
"ver": "1.1.0",
"uuid": "9805edc4-aa81-43dc-8112-0ce45686e237",
"importer": "typescript",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
+1
View File
@@ -0,0 +1 @@
/.gitkeep
+13
View File
@@ -0,0 +1,13 @@
{
"ver": "1.1.3",
"uuid": "b24841c4-a077-4df3-956d-336daa691c69",
"importer": "folder",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {},
"subMetas": {}
}
+13
View File
@@ -0,0 +1,13 @@
{
"ver": "1.1.3",
"uuid": "16e39135-7136-4d81-afd3-da8998dfa1de",
"importer": "folder",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {},
"subMetas": {}
}
@@ -0,0 +1,42 @@
import CSSettingsSDV3 from "../../../FormTable/CSSettingsV3";
export class CurrencyManager {
public static get DefaultCurrencyId(): number { return 1; }
public static get Currency(): number { return this._useFormId; }
private static _currencyStr: string = null;
private static _useFormId: number = null;
private static _numberWithComma: number = 2;
public static get NumberWithComma(): number { return this._numberWithComma };
public static SetCurrency(data: JSON) {
if (!data) {
this._numberWithComma = 2;
this._currencyStr = "TWD";
} else {
this._numberWithComma = data["pr"] ?? 2;
this._currencyStr = data["cu"] ?? "APP";
for (let i: number = 1; i < CSSettingsSDV3.Currency.Count; i++) {
let check: string = CSSettingsSDV3.Currency[i].Type;
if (check == this._currencyStr) {
this._useFormId = i;
return;
}
}
}
if (!this._useFormId) {
this._useFormId = this.DefaultCurrencyId;
}
}
public static GetNumberWithComma(num: number, isPadZero: boolean = false): string {
// 20220719企劃要求不要補0改的地方太多直接寫死
// isPadZero = false;
// 20230606企劃又要補.前端規則換成預設都不補零.文件需要補零再帶參數
// 並把以前設定過的參數都拔掉.下次誰又要改零並且跟上面規則不一樣叫他付一千撫慰金
return num.ExFormatNumberWithComma(this._numberWithComma, isPadZero);
}
public static GetNumberTransferToBMK(num: number, offset: number = 0): string {
return num.ExTransferToBMK(this._numberWithComma, offset);
}
}
@@ -0,0 +1,10 @@
{
"ver": "1.1.0",
"uuid": "75f707da-06f3-41e8-9126-86eb1b8a6fd7",
"importer": "typescript",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}

Some files were not shown because too many files have changed in this diff Show More