diff --git a/.eslintignore b/.eslintignore
index 13b0ba2..6cb8fe8 100644
--- a/.eslintignore
+++ b/.eslintignore
@@ -1,2 +1,3 @@
src/FormTable
-src/FormTableExt
\ No newline at end of file
+src/FormTableExt
+src/FormTableSD
\ No newline at end of file
diff --git a/.gitignore b/.gitignore
index f3611f6..e861e2f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -27,4 +27,6 @@ dist-ssr
/src/FormTable
/src/FormTable/*
/src/FormTableExt
-/src/FormTableExt/*
\ No newline at end of file
+/src/FormTableExt/*
+/src/FormTableSD
+/src/FormTableSD/*
\ No newline at end of file
diff --git a/build-templates/shared/jsons/slotset.json b/build-templates/shared/jsons/slotset.json
new file mode 100644
index 0000000..6d4e2b3
--- /dev/null
+++ b/build-templates/shared/jsons/slotset.json
@@ -0,0 +1,7 @@
+{
+ "#slotset" :
+ {
+ "cols" : ["Id","Pl","NameTw","NameCn","NameEn","NameSetting","FormName","Roll","Version","Web"],
+ "rows" : [[1,1,"福氣財神","福气财神","Fortune God of Wealth","Slot001",["line","slot_001"],1,202306061,null],[2,1,"火焰巨輪","火焰巨轮","Fire Wheel","Slot002",["line","slot_002"],1,202306061,null],[5,1,"雷電","雷电","Lightning Wild","Slot005",["line","slot_005"],null,202306061,null],[7,1,"惡魔與天使","恶魔与天使","Devil and Angel","Slot007",["line","slot_007"],null,202306061,null],[8,1,"拿摩多鯊魚","拿摩多鲨鱼","SHARK RAMPAGE","Slot008",["line","slot_008"],null,202306061,null],[9,1,"美女與野獸","美女与野兽","Beauty and the Beast","Slot009",["line","slot_009"],null,202306061,null],[10,1,"紅利金貓","红利金猫","Bonus Golden Cat","Slot010",["line","slot_010"],1,202306061,null],[12,1,"魔法少女","魔法少女","Little Witch","Slot012",["slot_012"],null,202306061,null],[15,1,"神鬼戰士","神鬼战士","Gladiator","Slot015",["line","slot_015"],null,202306061,null],[16,1,"風暴女王","风暴女王","Storm Queen","Slot016",["line","slot_016"],1,202306061,null],[18,1,"搖錢樹","摇钱树","Money Tree","Slot018",["line","slot_018"],1,202306061,null],[23,1,"888巨輪","888巨轮","888 Wheel","Slot023",["line","slot_023"],1,202306061,null],[24,1,"多發多財","多发多财","FaFa Fortunes","Slot024",["slot_024"],1,202306061,null],[25,1,"鑽石之都","钻石之都","Diamond City","Slot025",["line","slot_025"],1,202306061,null],[26,1,"紅利金鑽","红利金钻","VIP GOLD","Slot026",["line","slot_026"],1,202306061,null],[27,1,"富貴神龍","富贵神龙","Fortune Dragon","Slot027",["line","slot_027"],1,202306061,null],[28,1,"龍宮金輪","龙宫金轮","Dragon Palace","Slot028",["slot_028"],null,202306061,null],[29,1,"10倍經典","10倍经典","10X Classic","Slot029",["line","slot_029"],1,202306061,null],[30,1,"龍鳳呈祥","龙凤呈祥","Dragon & Phoenix","Slot030",["slot_030"],null,202306061,null],[31,1,"水滸群英傳","水浒群英传","WaterMargin","Slot031",["line","slot_031"],null,202306061,null],[32,1,"埃及豔后","埃及艳后","Cleopatra","Slot032",["line","slot_032"],null,202306061,null],[33,1,"香水玫瑰","香水玫瑰","Perfume rose","Slot033",["line","slot_033"],1,202306061,null],[34,1,"招財金貓","招财金猫","Fortune Kitty","Slot034",["line","slot_034"],1,202306061,null],[35,1,"多金多銀","多金多银","Gold & Silver","Slot035",["slot_035"],null,202306061,null],[36,1,"驚奇之星","惊奇之星","Fantastic Stars","Slot036",["line","slot_036"],null,202306061,null],[37,1,"幸運七","幸运七","Lucky 7","Slot037",["line","slot_037"],null,202306061,null],[39,1,"閃電倒轉","闪电倒转","Lightning Rewind","Slot039",["line","slot_039"],null,202306061,null],[40,1,"海之姬","海之姬","Queen of Ocean","Slot040",["slot_040"],1,202306061,null],[44,1,"五龍稱霸","五龙称霸","Dragon 5","Slot044",["line","slot_044"],null,202306061,null],[47,1,"財神降臨","财神降临","God of wealth","Slot047",["line","slot_047"],null,202306061,null],[48,1,"福星88","福星88","Fortune 88","Slot048",["slot_048"],1,202306061,null],[49,1,"幸運熊貓","幸运熊猫","Lucky Panda","Slot049",["line","slot_049"],1,202306061,null],[50,1,"吉鼓發財","吉鼓发财","Dancing drums","Slot050",["slot_050"],1,202306061,null],[51,1,"皇帝 88","皇帝 88","Emperor 88","Slot051",["line","slot_051"],1,202306061,null],[56,1,"彩色筆","彩色笔","Color Spin","Slot056",["line","slot_056"],1,202306061,null],[58,1,"鳳凰之怒","凤凰之怒","Phoenix Fury","Slot058",["line","slot_058"],null,202306061,null],[59,1,"多發多財單機版","多发多财单机版","FaFa Fortunes","Slot059",["line","slot_059"],null,202306061,null],[60,1,"無限連段","無限連段","Combo","Slot060",["slot_060"],null,202306061,null],[62,1,"常勝將軍","常勝將軍","All Win Man","Slot062",["line","slot_062"],null,202306061,null],[64,1,"小姐姐釣大魚","小姐姐釣大魚","Miss Fish","Slot064",["slot_064"],null,202306061,null],[65,1,"天妃娘娘","天妃娘娘","Mrs Sky","Slot065",["line","slot_065"],null,202306061,null],[66,1,"拔劍稱王","拔劍稱王","King","Slot066",["line","slot_066"],null,202306061,null],[67,1,"快上車","快上車","Car","Slot067",["line","slot_067"],null,202306061,null],[68,1,"阿拉丁","阿拉丁","Magic","Slot068",["line","slot_068"],null,202306061,null],[1101,1,"百搭八星彩","百搭八星彩","8 Bingo Stars","Bingo8stars",["bingo_8stars"],null,202306061,null],[1102,1,"連環九星彩","连环九星彩","9 Bingo Stars","Bingo9stars",["bingo_9stars"],null,202306061,null],[1201,1,"賞金勇者傳說EX","賞金勇者傳說EX","BOUNTY HUNTER EX","Slot1201",["slot_1201"],null,202306061,null],[1202,1,"壽司轉轉樂","壽司轉轉樂","Sushi","Slot1202",["slot_1202"],null,202306061,null],[1301,1,"夢幻餐廳","梦幻餐厅","Dream Restaurant","Cluster1301",["cluster_1301"],null,202306061,null],[1302,1,"莎菈的鍊金工房","莎菈的鍊金工房","Atelier Sarah:The Midas touch","Cluster1302",["cluster_1302"],null,202306061,null],[1303,1,"逗陣甜星3+1","逗陣甜星3+1","Candy Explosion","Cluster1303",["cluster_1303"],null,202306061,null],[1304,1,"逗陣寶貝龍","逗陣寶貝龍","Cluster1304","Cluster1304",["cluster_1304"],null,202306061,null],[1305,1,"紅心國王","紅心國王","Cluster1305","Cluster1305",["cluster_1305"],null,202306061,null],[1401,1,"哈辣瑪莉","哈辣玛莉","Other1401","Bar1401",["bar_1401"],null,202306061,null],[1501,1,"招財貓小鋼珠","招財貓小鋼珠","Pachinko1501","Slot1501",["slot_1501"],null,202306061,null],[1701,1,"一錘千金","一錘千金","Slot1701","Slot1701",["slot_1701"],1,202306061,null],[2001,1,"西遊塔防捕魚機","西游塔防捕鱼机","Journey to the West Tower Defense","Monkeytower",["monkeytower"],null,202306061,null],[2003,null,"大佬捕魚","大佬捕魚","Fish2003","Fish2003",["fish2003"],null,202306061,null],[2004,0,"海豹捕魚機","海豹捕魚機","Fish2004","Fish2004",["fish2004"],null,202306061,null],[3002,1,"雙星骰寶","双星骰宝","Double Star SicBo","TwoSicbo",["two_sicbo"],null,202306061,null],[3003,1,"九龍骰寶","九龙骰宝","Nine Dragon SicBo","NineSicbo",["nine_sicbo"],null,202306061,null],[3012,1,"三寶百家樂","三宝百家乐","San Bo Baccarat","TripleBaccarat",["triple_baccarat"],null,202306061,1],[3031,1,"色碟","色碟","色碟","Table3031",["table3031"],null,202306061,null]]
+ }
+}
\ No newline at end of file
diff --git a/index.html b/index.html
index 5529195..63b1b57 100644
--- a/index.html
+++ b/index.html
@@ -12,7 +12,7 @@
history.go(1);
};
-
來博娛樂城
+ LP_Bot
diff --git a/src/Common/DataReceived/MainControlData.ts b/src/Common/DataReceived/MainControlData.ts
index 04b26ce..253ae49 100644
--- a/src/Common/DataReceived/MainControlData.ts
+++ b/src/Common/DataReceived/MainControlData.ts
@@ -1,6 +1,6 @@
import { CoroutineV2 } from "@/Engine/CatanEngine/CoroutineV2/CoroutineV2";
import { INetResponse } from "@/Engine/CatanEngine/NetManagerV2/Core/INetResponse";
-import CSSettingsV3 from "@/FormTable/CSSettingsV3";
+import CSSettingsSDV3 from "@/FormTable/CSSettingsV3";
import { gameSync } from "@/utils/setRPCData";
import MainControl from "../MainControl/MainControl";
import CSMessage from "../Message/CSMessage";
@@ -76,9 +76,9 @@ export default class MainControlData {
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);
+ str = CSSettingsSDV3.prototype.CommonString(55 + this._disconnectErrorType);
} else if (this._disconnectErrorType > 100 && this._disconnectErrorType < 110) {
- str = CSSettingsV3.prototype.CommonString(65 + this._disconnectErrorType - 101);
+ str = CSSettingsSDV3.prototype.CommonString(65 + this._disconnectErrorType - 101);
} else {
str = "Server Disconnected";
}
diff --git a/src/Common/MainControl/MainControl.ts b/src/Common/MainControl/MainControl.ts
index b31450f..0bcdb1d 100644
--- a/src/Common/MainControl/MainControl.ts
+++ b/src/Common/MainControl/MainControl.ts
@@ -2,8 +2,10 @@ 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() {
/** 每次啟動APP */
@@ -55,6 +57,60 @@ export class MainControl extends BaseSingleton() {
MainControl.DataReceivedEvent.DispatchCallback([MainControl.DataType.ServerData, resp]);
}
+
+ //#region DownloadForm Function
+
+ /**
+ * 載入外載表設定檔
+ * @param formType FormType
+ */
+ public static async DownloadForm(formType: DownloadForm.FormType): Promise {
+ 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[] = [];
+ 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 {
+ // http://patch-dev.online-bj.com/shared/jsons/slot_050.json
+ let fileUrl: string = `${formname}.json`;
+ // fileUrl = "https://sd2-dev-patch.sdegaming.com/_Debug/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;
+ 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
}
@@ -66,4 +122,23 @@ export module MainControl {
}
}
-export default MainControl;
\ No newline at end of file
+export default MainControl;
+
+//#region DownloadForm
+
+export module DownloadForm {
+ export enum FormType {
+ Formread = "formread",
+ }
+
+ export class DownloadFormData {
+
+ /** 已下載的表 */
+ public static DownloadSuccess: Map = new Map();
+
+ /** Bag需要的表(xxxx.json) */
+ public static formreadForm: string[] = ["slotset"];
+ }
+}
+
+//#endregion
\ No newline at end of file
diff --git a/src/Common/ResourceItem/Items/CardCouponItem.ts b/src/Common/ResourceItem/Items/CardCouponItem.ts
index e875afe..097918e 100644
--- a/src/Common/ResourceItem/Items/CardCouponItem.ts
+++ b/src/Common/ResourceItem/Items/CardCouponItem.ts
@@ -1,4 +1,4 @@
-import CSSettingsV3 from "@/FormTable/CSSettingsV3";
+import CSSettingsSDV3 from "@/FormTable/CSSettingsV3";
import { LanguageManager } from "@/FormTableExt/Manage/Language/LanguageManager";
import { ResourceInfo } from "@/define/resource";
import { backpackInfo } from "@/utils/setRPCData";
@@ -7,7 +7,7 @@ import IResourceItem from "../IResourceItem";
import { ResourceItemType } from "../ResourceItemType";
export default class CardCouponItem implements IResourceItem {
- public get Name(): string { return CSSettingsV3.ItemSetting.StringDetail[+CSSettingsV3.ItemSetting.CouponSetting[this.ID].CardName][LanguageManager.GetMsgId()]; }
+ public get Name(): string { return CSSettingsSDV3.ItemSetting.StringDetail[+CSSettingsSDV3.ItemSetting.CouponSetting[this.ID].CardName][LanguageManager.GetMsgId()]; }
public get ResourceType(): ResourceItemType { return ResourceItemType.Card_Coupon; }
public ID: number;
public Count: number;
diff --git a/src/Common/ResourceItem/Items/LpPointItem.ts b/src/Common/ResourceItem/Items/LpPointItem.ts
index bec0d89..203f142 100644
--- a/src/Common/ResourceItem/Items/LpPointItem.ts
+++ b/src/Common/ResourceItem/Items/LpPointItem.ts
@@ -1,4 +1,4 @@
-import CSSettingsV3 from "@/FormTable/CSSettingsV3";
+import CSSettingsSDV3 from "@/FormTable/CSSettingsV3";
import { Shop } from "@/define/formkey";
import { ResourceInfo } from "@/define/resource";
import Player from "@/modules/player";
@@ -9,7 +9,7 @@ import IResourceItem from "../IResourceItem";
import { ResourceItemType } from "../ResourceItemType";
export default class LpPointItem implements IResourceItem {
- public get Name(): string { return CSSettingsV3.prototype.ShopString(Shop.String.LpPoint); }
+ public get Name(): string { return CSSettingsSDV3.prototype.ShopString(Shop.String.LpPoint); }
public get ResourceType(): ResourceItemType { return ResourceItemType.LpPoint; }
public ID: number;
public Count: number;
diff --git a/src/Common/ResourceItem/Items/MoneyItem.ts b/src/Common/ResourceItem/Items/MoneyItem.ts
index 0a1dcd7..b8b3684 100644
--- a/src/Common/ResourceItem/Items/MoneyItem.ts
+++ b/src/Common/ResourceItem/Items/MoneyItem.ts
@@ -1,4 +1,4 @@
-import CSSettingsV3 from "@/FormTable/CSSettingsV3";
+import CSSettingsSDV3 from "@/FormTable/CSSettingsV3";
import Config from "@/define/Config";
import { Shop } from "@/define/formkey";
import { ResourceInfo } from "@/define/resource";
@@ -9,7 +9,7 @@ import IResourceItem from "../IResourceItem";
import { ResourceItemType } from "../ResourceItemType";
export default class MoneyItem implements IResourceItem {
- public get Name(): string { return CSSettingsV3.prototype.ShopString(Shop.String.Money); }
+ public get Name(): string { return CSSettingsSDV3.prototype.ShopString(Shop.String.Money); }
public get ResourceType(): ResourceItemType { return ResourceItemType.Money; }
public ID: number;
public Count: number;
diff --git a/src/Engine/CatanEngine/TableV3/TableManager.ts b/src/Engine/CatanEngine/TableV3/TableManager.ts
index b7ebfd8..d7e2c31 100644
--- a/src/Engine/CatanEngine/TableV3/TableManager.ts
+++ b/src/Engine/CatanEngine/TableV3/TableManager.ts
@@ -12,13 +12,13 @@ export class TableManager {
}
}
- public static AddJsonAsset(jsonAsset: JSON) {
+ public static AddJsonAsset(jsonAsset: any) {
if (!jsonAsset) {
return;
}
- for (const tableName in jsonAsset) {
- console.debug(`TableV3 [${ tableName }] json loaded`);
- this._tableJsons[tableName] = jsonAsset[tableName];
+ for (let tableName in jsonAsset.json) {
+ console.log(`TableV3 [${tableName}] json loaded`);
+ this._tableJsons[tableName] = jsonAsset.json[tableName];
}
}
diff --git a/src/UI/Lobby/SDGame.tsx b/src/UI/Lobby/SDGame.tsx
index 5052e0c..3ff93ad 100644
--- a/src/UI/Lobby/SDGame.tsx
+++ b/src/UI/Lobby/SDGame.tsx
@@ -3,20 +3,31 @@ import { CoroutineV2 } from "@/Engine/CatanEngine/CoroutineV2/CoroutineV2";
import { INetResponse } from "@/Engine/CatanEngine/NetManagerV2/Core/INetResponse";
import { NetConnector } from "@/Engine/CatanEngine/NetManagerV2/NetConnector";
import { NetManagerSD } from "@/Engine/CatanEngine/NetManagerV2/NetManagerSD";
+import A from "@/components/CustomA";
import { useGameItems } from "@/context/GameItemsContext";
-import SlotBase from "@/define/Game/Base/SlotBase";
import { SDAccountLoginRequest } from "@/define/Request/AccountRequest";
import { SlotInRequest } from "@/define/Request/SlotRequest";
-import { Button, Flex } from "antd";
-import { useEffect, useState } from "react";
+import GameManager from "@/modules/GameManager";
+import { Button, Checkbox, Dropdown, Flex, Input, MenuProps } from "antd";
+import { CheckboxChangeEvent } from "antd/es/checkbox";
+import { ChangeEvent, useEffect, useState } from "react";
const SDGame = (props: ISDGame) => {
const { gameUrl, onClickSlotOut } = props;
const { player, setPlayer } = useGameItems();
const { gameData } = useGameItems();
const { nowSlotId } = gameData;
- const [slotId, setSlotId] = useState(undefined);
+ const [isOK, setIsOK] = useState(false);
+ const [isSpin, setIsSpin] = useState(false);
const [slotData, setSlotData] = useState