[fix] fixbug
This commit is contained in:
parent
a8b6946ecf
commit
d093c5d533
@ -1,40 +1,38 @@
|
||||
<script setup lang="ts">
|
||||
import { BJ_Casino_Bot } from "../script/BJ_Casino_Bot";
|
||||
import { BJ_Casino_BotController } from "../script/BJ_Casino_BotController";
|
||||
import BJ_Casino_Bot_Info from './BJ_Casino_Bot_Info.vue';
|
||||
import BJ_Casino_Bot_Lobby from './BJ_Casino_Bot_Lobby.vue';
|
||||
import BJ_Casino_Bot_Login from "./BJ_Casino_Bot_Login.vue";
|
||||
import BJ_Casino_Bot_Slot from './BJ_Casino_Bot_Slot.vue';
|
||||
|
||||
const props = defineProps<{ BJ_Casino: any }>()
|
||||
const props = defineProps<{ BJ_Casino_BotController: BJ_Casino_BotController }>()
|
||||
|
||||
const self = {
|
||||
BJ_Casino: props.BJ_Casino,
|
||||
}
|
||||
const Script = new BJ_Casino_Bot(self);
|
||||
const disabled = false;
|
||||
const Script = new BJ_Casino_Bot();
|
||||
Script.BotController = props.BJ_Casino_BotController;
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<!-- Info -->
|
||||
<!-- Login -->
|
||||
<div class="BJ_Casino_Bot" style="float: left;text-align: left;width:10%;" v-show="!Script.IsLogin.value">
|
||||
<BJ_Casino_Bot_Login :Client="self" :Script="Script" />
|
||||
<BJ_Casino_Bot_Login :Script="Script" />
|
||||
</div>
|
||||
|
||||
<!-- Info -->
|
||||
<div class="BJ_Casino_Bot" style="float: left;text-align: left;width:10%;" v-show="Script.IsLogin.value">
|
||||
<BJ_Casino_Bot_Info :Client="self" :Script="Script" />
|
||||
<BJ_Casino_Bot_Info :Script="Script" />
|
||||
</div>
|
||||
|
||||
<!-- Game -->
|
||||
<div class="BJ_Casino_Bot" style="float: left;text-align: left;width:40%;">
|
||||
<!-- Lobby -->
|
||||
<div style="float: left;width:40%;" v-show="Script.LobbyShow.value">
|
||||
<BJ_Casino_Bot_Lobby :Client="self" :Script="Script" />
|
||||
<BJ_Casino_Bot_Lobby :Script="Script" />
|
||||
</div>
|
||||
|
||||
<!-- Slot -->
|
||||
<div v-show="Script.SlotShow.value">
|
||||
<BJ_Casino_Bot_Slot :Client="self" :Script="Script" />
|
||||
<BJ_Casino_Bot_Slot :Script="Script" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -1,22 +1,20 @@
|
||||
<script setup lang="ts">
|
||||
import { ref } from "vue";
|
||||
import { BJ_Casino_BotController } from "../script/BJ_Casino_BotController";
|
||||
import BJ_Casino_Bot from './BJ_Casino_Bot.vue';
|
||||
|
||||
let Title = ref("");
|
||||
const self = {
|
||||
Title: Title,
|
||||
}
|
||||
const aaa = null;
|
||||
const Script = new BJ_Casino_BotController(self);
|
||||
const Script = new BJ_Casino_BotController();
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="BJ_Casino_BotController">
|
||||
<BJ_Casino_Bot :BJ_Casino="aaa" />
|
||||
hostport:
|
||||
<el-select v-model="Script.ServerDefault.value" filterable
|
||||
@change="(data: any) => { Script.SelectServer(data) }">
|
||||
<el-option v-for="(item, index) in Script.Hostport" :key="item" :label="item" :value="index" />
|
||||
</el-select>
|
||||
</div>
|
||||
<div class="BJ_Casino_BotController">
|
||||
<BJ_Casino_Bot :BJ_Casino_BotController="Script" />
|
||||
</div>
|
||||
<!-- <div class="BJ_Casino_BotController">
|
||||
<BJ_Casino_Bot :BJ_Casino="aaa" />
|
||||
</div> -->
|
||||
</template>
|
@ -1,7 +1,7 @@
|
||||
<script setup lang="ts">import { BJ_Casino_Bot } from '../script/BJ_Casino_Bot';
|
||||
|
||||
|
||||
const props = defineProps<{ Client: any, Script: BJ_Casino_Bot }>()
|
||||
const props = defineProps<{ Script: BJ_Casino_Bot }>()
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
@ -2,7 +2,7 @@
|
||||
import { BJ_Casino_Bot_Lobby } from '../script/BJ_Casino_Bot_Lobby';
|
||||
|
||||
|
||||
const props = defineProps<{ Client: any, Script: BJ_Casino_Bot }>()
|
||||
const props = defineProps<{ Script: BJ_Casino_Bot }>()
|
||||
const LobbyScript = new BJ_Casino_Bot_Lobby(props.Script);
|
||||
props.Script.LobbyScript = LobbyScript;
|
||||
</script>
|
||||
@ -13,7 +13,7 @@ props.Script.LobbyScript = LobbyScript;
|
||||
<el-select v-model="LobbyScript.LobbyDefault.value" filterable
|
||||
@change="(data: any) => { LobbyScript.SelectLobby(data) }">
|
||||
<el-option v-for="(item, index) in LobbyScript.GetLobby()" :key="item.value" :label="item.label"
|
||||
:value="item.value" />
|
||||
:value="item.value + 1" />
|
||||
</el-select>
|
||||
</div>
|
||||
<div>
|
||||
|
@ -3,7 +3,7 @@ import { BJ_Casino_Bot } from '../script/BJ_Casino_Bot';
|
||||
import { BJ_Casino_Bot_Login } from '../script/BJ_Casino_Bot_Login';
|
||||
|
||||
|
||||
const props = defineProps<{ Client: any, Script: BJ_Casino_Bot }>()
|
||||
const props = defineProps<{ Script: BJ_Casino_Bot }>()
|
||||
const LoginScript = new BJ_Casino_Bot_Login(props.Script);
|
||||
props.Script.LoginScript = LoginScript;
|
||||
</script>
|
||||
|
@ -3,7 +3,7 @@ import { BJ_Casino_Bot } from '../script/BJ_Casino_Bot';
|
||||
import { BJ_Casino_Bot_Slot } from '../script/BJ_Casino_Bot_Slot';
|
||||
|
||||
|
||||
const props = defineProps<{ Client: any, Script: BJ_Casino_Bot }>()
|
||||
const props = defineProps<{ Script: BJ_Casino_Bot }>()
|
||||
const SlotScript = new BJ_Casino_Bot_Slot(props.Script);
|
||||
props.Script.SlotScript = SlotScript;
|
||||
</script>
|
||||
@ -11,7 +11,7 @@ props.Script.SlotScript = SlotScript;
|
||||
<template>
|
||||
<div>
|
||||
押注:
|
||||
<el-select v-model="SlotScript.BetDefault.value" filterable
|
||||
<el-select v-model="SlotScript.BetIndex.value" filterable
|
||||
@change="(data: any) => { SlotScript.SelectBet(data) }">
|
||||
<el-option v-for="(item, index) in SlotScript.BetGroup" :key="item" :label="item" :value="index" />
|
||||
</el-select>
|
||||
|
@ -2,6 +2,7 @@ import dayjs from "dayjs";
|
||||
import { Ref, ref } from "vue";
|
||||
import CSMessage from "./Base/CSMessage";
|
||||
import { AccountLoginRequest, CustomLoginRequest } from "./Base/Request/AccountRequest";
|
||||
import { BJ_Casino_BotController } from "./BJ_Casino_BotController";
|
||||
import { BJ_Casino_Bot_Lobby } from "./BJ_Casino_Bot_Lobby";
|
||||
import { BJ_Casino_Bot_Login } from "./BJ_Casino_Bot_Login";
|
||||
import { BJ_Casino_Bot_Slot } from "./BJ_Casino_Bot_Slot";
|
||||
@ -16,6 +17,8 @@ export class BJ_Casino_Bot {
|
||||
|
||||
public UserData: BJ_Casino_UserData = null;
|
||||
|
||||
public BotController: BJ_Casino_BotController = null;
|
||||
|
||||
public LoginScript: BJ_Casino_Bot_Login = null;
|
||||
|
||||
public LobbyScript: BJ_Casino_Bot_Lobby = null;
|
||||
@ -45,8 +48,6 @@ export class BJ_Casino_Bot {
|
||||
|
||||
//#region private
|
||||
|
||||
private _client: any;
|
||||
|
||||
private _conn: NetConnector = null;
|
||||
|
||||
//#endregion
|
||||
@ -56,8 +57,7 @@ export class BJ_Casino_Bot {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
constructor(client: any) {
|
||||
this._client = client;
|
||||
constructor() {
|
||||
this.onLoad();
|
||||
}
|
||||
|
||||
@ -71,15 +71,16 @@ export class BJ_Casino_Bot {
|
||||
|
||||
public async Login(a: string, p: string): Promise<void> {
|
||||
let self: this = this;
|
||||
this.IsLogin.value = true;
|
||||
// const URL: string = "https://game.online-bj.com";
|
||||
// const Port: string = "9005";
|
||||
const URL: string = "http://220.134.195.1";
|
||||
const Port: string = "19005";
|
||||
// const URL: string = "http://220.134.195.1";
|
||||
// const Port: string = "19005";
|
||||
const { host: URL, port: Port } = this.BotController.GetServer();
|
||||
await this.ConnectAsync(URL, +Port);
|
||||
// 取得帳號資料
|
||||
let resp: any = await this._accountLogin(a, p);
|
||||
await this._getAccountInfo(resp.a, resp.pw);
|
||||
this.IsLogin.value = true;
|
||||
this.LobbyShow.value = true;
|
||||
this.SetUI();
|
||||
}
|
||||
@ -87,7 +88,13 @@ export class BJ_Casino_Bot {
|
||||
public async Logout(): Promise<void> {
|
||||
NetManager.Disconnect();
|
||||
this.IsLogin.value = false;
|
||||
|
||||
this.LobbyShow.value = false;
|
||||
this.LobbyScript.IsSlotIn.value = false;
|
||||
|
||||
this.SlotShow.value = false;
|
||||
this.SlotScript.IsSpin.value = false;
|
||||
this.SlotScript.IsRun = false;
|
||||
}
|
||||
|
||||
private async _accountLogin(account: string, password: string): Promise<any> {
|
||||
@ -95,6 +102,7 @@ export class BJ_Casino_Bot {
|
||||
await req.SendAsync(true);
|
||||
let resp: INetResponse<any> = req.Result;
|
||||
if (!resp.IsValid) {
|
||||
this.IsLogin.value = false;
|
||||
CSMessage.NetError(resp.Method, resp.Status, "Registe Account Error!");
|
||||
return;
|
||||
}
|
||||
@ -107,6 +115,7 @@ export class BJ_Casino_Bot {
|
||||
await req.SendAsync(true);
|
||||
let resp: INetResponse<any> = req.Result;
|
||||
if (!resp.IsValid) {
|
||||
this.IsLogin.value = false
|
||||
CSMessage.NetError(resp.Method, resp.Status, "Login Account Error!");
|
||||
return;
|
||||
}
|
||||
@ -121,14 +130,18 @@ export class BJ_Casino_Bot {
|
||||
this.Exp.value = this.UserData.Exp;
|
||||
}
|
||||
|
||||
public AddLog(log: string): void {
|
||||
public AddLog(log: string, ...args: any[]): void {
|
||||
let AIDLog: string = ``;
|
||||
if (this.UserData?.AID) {
|
||||
AIDLog = `AID: ${this.UserData.AID} `;
|
||||
}
|
||||
console.log(`${AIDLog}${log}`);
|
||||
console.log(`${AIDLog}${log}`, ...args);
|
||||
let time: string = dayjs().format("YYYY/MM/DD HH:mm:ss.SSS");
|
||||
if (args.length > 0) {
|
||||
this.Log.value += `${time} ${log}, ${args}\n`;
|
||||
} else {
|
||||
this.Log.value += `${time} ${log}\n`;
|
||||
}
|
||||
const textarea: HTMLElement | null = document.getElementById("DIV_LOG");
|
||||
if (textarea) {
|
||||
textarea.scrollTop = textarea.scrollHeight;
|
||||
|
@ -1,16 +1,22 @@
|
||||
// import { BJ_Casino_Data } from "./BJ_Casino_Data";
|
||||
import dayjs from "dayjs";
|
||||
import { Ref, ref } from "vue";
|
||||
|
||||
export class BJ_Casino_BotController {
|
||||
//#region Lifecycle
|
||||
|
||||
// public BJ_Casino: BJ_Casino_Data | undefined;
|
||||
public Hostport: any[] = ["不選擇環境", "內版", "肉乾", "賴宏", "40", "送審", "外版", "testing1", "testing2", "testing3"];
|
||||
|
||||
public ServerIndedx: number = 6;
|
||||
|
||||
public ServerDefault: Ref<string> = ref(this.Hostport[this.ServerIndedx]);
|
||||
|
||||
//#endregion
|
||||
|
||||
//#region private
|
||||
//#region get set
|
||||
|
||||
private _client: any;
|
||||
// public get Host(): string { return this.Host; }
|
||||
// public get Port(): string { return this.Port; }
|
||||
|
||||
//#endregion
|
||||
|
||||
@ -19,8 +25,7 @@ export class BJ_Casino_BotController {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
constructor(client: any) {
|
||||
this._client = client;
|
||||
constructor() {
|
||||
import("dayjs/locale/zh-tw");
|
||||
dayjs.locale("zh-tw");
|
||||
// this.BJ_Casino = client.BJ_Casino;
|
||||
@ -43,9 +48,84 @@ export class BJ_Casino_BotController {
|
||||
|
||||
//#region Custom
|
||||
|
||||
// public SendData() {
|
||||
// this._client.RankData.value = this.BJ_Casino?.RankWinMoneyData;
|
||||
// }
|
||||
public GetServer(): any {
|
||||
let resp: Object = {};
|
||||
switch (this.ServerIndedx) {
|
||||
// 不選擇環境
|
||||
case 0:
|
||||
// 外網連內版
|
||||
case 1: {
|
||||
resp["host"] = "http://220.134.195.1";
|
||||
resp["port"] = "19005";
|
||||
break;
|
||||
}
|
||||
|
||||
// 肉乾
|
||||
case 2: {
|
||||
resp["host"] = "http://192.168.5.230";
|
||||
resp["port"] = "9006";
|
||||
break;
|
||||
}
|
||||
|
||||
// 賴宏
|
||||
case 3: {
|
||||
resp["host"] = "http://192.168.5.134";
|
||||
resp["port"] = "9005";
|
||||
break;
|
||||
}
|
||||
|
||||
// 40
|
||||
case 4: {
|
||||
resp["host"] = "http://192.168.5.12";
|
||||
resp["port"] = "9487";
|
||||
break;
|
||||
}
|
||||
|
||||
// 送審
|
||||
case 5: {
|
||||
resp["host"] = "https://submit.online-bj.com";
|
||||
resp["port"] = "9005";
|
||||
break;
|
||||
}
|
||||
|
||||
// 外版
|
||||
case 6: {
|
||||
resp["host"] = "https://game.online-bj.com";
|
||||
resp["port"] = "9005";
|
||||
break;
|
||||
}
|
||||
|
||||
// testing1
|
||||
case 7: {
|
||||
resp["host"] = "http://bj-testing1.casino.catan.com.tw";
|
||||
resp["port"] = "9005";
|
||||
break;
|
||||
}
|
||||
|
||||
// testing2
|
||||
case 8: {
|
||||
resp["host"] = "http://bj-testing2.casino.catan.com.tw";
|
||||
resp["port"] = "9005";
|
||||
break;
|
||||
}
|
||||
|
||||
// testing3
|
||||
case 9: {
|
||||
resp["host"] = "http://bj-testing3.casino.catan.com.tw";
|
||||
resp["port"] = "9005";
|
||||
break;
|
||||
}
|
||||
|
||||
default: {
|
||||
break;
|
||||
}
|
||||
}
|
||||
return resp;
|
||||
}
|
||||
|
||||
public SelectServer(data: number): void {
|
||||
this.ServerIndedx = data;
|
||||
}
|
||||
|
||||
//#endregion
|
||||
}
|
||||
|
@ -9,8 +9,7 @@ import { Tools } from "./Tools";
|
||||
export class BJ_Casino_Bot_Lobby {
|
||||
//#region public
|
||||
|
||||
public LobbyCongig: any[] = [2, [
|
||||
"不選擇資源路徑",
|
||||
public LobbyCongig: any[] = [1, [
|
||||
"體驗聽",
|
||||
"一般聽",
|
||||
"高手聽",
|
||||
@ -18,11 +17,11 @@ export class BJ_Casino_Bot_Lobby {
|
||||
]];
|
||||
|
||||
public LobbyShow: Ref<boolean> = ref(false);
|
||||
public Lobby: Ref<number> = ref(0);
|
||||
public Lobby: Ref<number> = ref(1);
|
||||
public LobbyDefault: Ref<string> = ref(this.LobbyCongig[1][this.Lobby.value]);
|
||||
public InputSlot: Ref<string> = ref("");
|
||||
public Slot: number;
|
||||
public Table: Ref<number> = ref(0);
|
||||
public LobbyDefault: Ref<string> = ref("");
|
||||
|
||||
public IsSlotIn: Ref<boolean> = ref(false);
|
||||
|
||||
@ -45,8 +44,7 @@ export class BJ_Casino_Bot_Lobby {
|
||||
}
|
||||
|
||||
public async onLoad(): Promise<void> {
|
||||
this.Lobby.value = this.LobbyCongig[0];
|
||||
this.LobbyDefault.value = this.LobbyCongig[1][this.Lobby.value];
|
||||
//
|
||||
}
|
||||
|
||||
//#endregion
|
||||
@ -76,9 +74,10 @@ export class BJ_Casino_Bot_Lobby {
|
||||
//#region Onclick
|
||||
|
||||
public async OnclickSlotIn(hall: number, slot: number): Promise<void> {
|
||||
if (this.IsSlotIn.value) {
|
||||
if (this.IsSlotIn.value || slot === 0 || slot == null) {
|
||||
return;
|
||||
}
|
||||
hall += 1;
|
||||
this.IsSlotIn.value = true;
|
||||
let table: number = 1;
|
||||
let req: SeatListRequest = new SeatListRequest(hall, slot);
|
||||
@ -93,16 +92,20 @@ export class BJ_Casino_Bot_Lobby {
|
||||
const element: any = data[i];
|
||||
if (element[0].length > 0) {
|
||||
let aid: string = element[0][0];
|
||||
if (aid === this._bj_Casino_Bot.UserData.AID) {
|
||||
if (+aid === +this._bj_Casino_Bot.UserData.AID) {
|
||||
table = i + 1;
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
table = i + 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
let resp_slotIn: any = await this._slotIn(hall, slot, table);
|
||||
if (!resp_slotIn.IsValid) {
|
||||
this.IsSlotIn.value = false;
|
||||
return;
|
||||
}
|
||||
this.Slot = slot;
|
||||
this.Table.value = table;
|
||||
this._bj_Casino_Bot.SlotScript.GameIn(resp_slotIn);
|
||||
@ -119,7 +122,7 @@ export class BJ_Casino_Bot_Lobby {
|
||||
await Tools.Sleep(0.5);
|
||||
}
|
||||
await this._slotOut();
|
||||
this.Slot = null!;
|
||||
this.Slot = null;
|
||||
this.Table.value = 0;
|
||||
this._bj_Casino_Bot.SlotShow.value = false;
|
||||
}
|
||||
@ -137,8 +140,7 @@ export class BJ_Casino_Bot_Lobby {
|
||||
await req.SendAsync(true);
|
||||
let resp: INetResponse<JSON> = req.Result;
|
||||
if (resp.IsValid) {
|
||||
this._bj_Casino_Bot.AddLog(`進機台成功 slot: ${slot}, hall: ${hall}, table: ${uid}`);
|
||||
return resp;
|
||||
this._bj_Casino_Bot.AddLog(`進機台成功 slot: ${slot}, hall: ${this.LobbyDefault.value}, table: ${uid}`);
|
||||
} else {
|
||||
switch (resp.Status) {
|
||||
case 11:
|
||||
@ -150,8 +152,10 @@ export class BJ_Casino_Bot_Lobby {
|
||||
default:
|
||||
break;
|
||||
}
|
||||
this._bj_Casino_Bot.AddLog(resp.Method, resp.Status, "進遊戲失敗");
|
||||
CSMessage.NetError(resp.Method, resp.Status, "進遊戲失敗");
|
||||
}
|
||||
return resp;
|
||||
}
|
||||
|
||||
private async _slotOut(): Promise<any> {
|
||||
|
@ -6,17 +6,17 @@ import { Tools } from "./Tools";
|
||||
export class BJ_Casino_Bot_Slot {
|
||||
//#region public
|
||||
|
||||
public BetDefault: Ref<string> = ref("");
|
||||
public BetIndex: Ref<string> = ref("");
|
||||
|
||||
public SpinDelay: Ref<number> = ref(1);
|
||||
|
||||
public Slot: SlotBase = null!;
|
||||
public Slot: SlotBase = null;
|
||||
|
||||
public GameInData: any = null!;
|
||||
public GameInData: any = null;
|
||||
|
||||
public BetGroup: number[] = [];
|
||||
|
||||
public NowBetIndex: number = null!;
|
||||
public NowBetIndex: number = null;
|
||||
|
||||
public IsSpin: Ref<boolean> = ref(false);
|
||||
|
||||
@ -32,7 +32,7 @@ export class BJ_Casino_Bot_Slot {
|
||||
|
||||
//#region get set
|
||||
|
||||
public get NowBet(): number { return this.BetGroup[this.NowBetIndex]; }
|
||||
public get NowBet(): number { return +this.BetGroup[this.NowBetIndex]; }
|
||||
|
||||
//#endregion
|
||||
|
||||
@ -55,7 +55,7 @@ export class BJ_Casino_Bot_Slot {
|
||||
let Data: any = gameInData.Data;
|
||||
this.BetGroup = Data.br;
|
||||
this.NowBetIndex = Data.db;
|
||||
this.BetDefault.value = this.BetGroup[Data.db].toString();
|
||||
this.BetIndex.value = this.BetGroup[Data.db].toString();
|
||||
}
|
||||
|
||||
//#endregion
|
||||
@ -63,6 +63,10 @@ export class BJ_Casino_Bot_Slot {
|
||||
//#region Custom
|
||||
|
||||
public async Spin(): Promise<void> {
|
||||
if (this._bj_Casino_Bot.UserData.Money < this.NowBet) {
|
||||
this.NoMoney();
|
||||
return;
|
||||
}
|
||||
this.IsRun = true;
|
||||
await this.Slot.Spin();
|
||||
await Tools.Sleep(this.SpinDelay.value * 1000);
|
||||
@ -78,6 +82,12 @@ export class BJ_Casino_Bot_Slot {
|
||||
this._bj_Casino_Bot.AddLog(`改變Bet: ${this.NowBet}`);
|
||||
}
|
||||
|
||||
public NoMoney(): void {
|
||||
this.IsSpin.value = false;
|
||||
this.IsRun = false;
|
||||
this._bj_Casino_Bot.AddLog(`金額不足: ${this._bj_Casino_Bot.UserData.Money}`);
|
||||
}
|
||||
|
||||
//#endregion
|
||||
|
||||
//#region Onclick
|
||||
|
@ -24,7 +24,7 @@ export class BJ_Casino_Data {
|
||||
|
||||
//#region private
|
||||
|
||||
private _conn: NetConnector = null!;
|
||||
private _conn: NetConnector = null;
|
||||
private _ws: any;
|
||||
|
||||
private _rankMagnificationData: any[] = [];
|
||||
|
@ -68,17 +68,17 @@ export default class BusinessTypeSetting {
|
||||
public static IsB2B: boolean = false;
|
||||
|
||||
/** 商業LOGO圖代碼(讀同一張表但UI有改的設定) */
|
||||
public static Logo: number = null!;
|
||||
public static Logo: number = null;
|
||||
/** 連線IP(網頁版會接網址參數所以要多開變數直接指定) */
|
||||
public static UseHost: string = null!;
|
||||
public static UseHost: string = null;
|
||||
/** 連接阜(網頁版會接網址參數所以要多開變數直接指定) */
|
||||
public static UsePort: number = null!;
|
||||
public static UsePort: number = null;
|
||||
/** 資源伺服器網址 */
|
||||
public static UsePatch: string = null!;
|
||||
public static UsePatch: string = null;
|
||||
/** 帳號 */
|
||||
public static Account: string = null!;
|
||||
public static Account: string = null;
|
||||
/** 密碼 */
|
||||
public static Password: string = null!;
|
||||
public static Password: string = null;
|
||||
|
||||
// =======================================================================================
|
||||
/** 執行環境ProductEnum.ServerType */
|
||||
|
@ -17,7 +17,7 @@ export class NetConnector {
|
||||
}
|
||||
|
||||
private _host: string;
|
||||
private _ws: WebSocket = null!;
|
||||
private _ws: WebSocket = null;
|
||||
private _waitings: WsRequestEnumerator[] = [];
|
||||
|
||||
constructor(host: string, port: number, ip: string) {
|
||||
@ -119,7 +119,7 @@ export class NetConnector {
|
||||
this._ws.onopen = null;
|
||||
this._ws.onmessage = null;
|
||||
this._ws.onclose = () => { };
|
||||
this._ws = null!;
|
||||
this._ws = null;
|
||||
|
||||
this.CleanWaitings();
|
||||
this.OnDisconnected.DispatchCallback();
|
||||
|
Loading…
x
Reference in New Issue
Block a user