本文整理匯總了TypeScript中poker/authmanager.authManager類的典型用法代碼示例。如果您正苦於以下問題:TypeScript authManager類的具體用法?TypeScript authManager怎麽用?TypeScript authManager使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了authManager類的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: constructor
constructor() {
super();
const self = this;
this.withdrawalAmount = ko.observable(null);
this.withdrawalMethod = ko.observable(null);
this.withdrawalMethods = ko.observableArray([
{ id: 1, text: "Unitbag" },
{ id: 2, text: "Visa" },
{ id: 3, text: "MasterCard" },
]);
this.accountNumber = ko.observable(null);
authManager.registerAuthenticationChangedHandler(async (newValue) => {
if (newValue) {
const api = new AccountManager();
const data = await api.getAccount();
const personalAccountData = data.Data;
self.player({
login: authManager.login(),
amount: personalAccountData.RealMoney,
});
} else {
self.player({
login: "",
amount: null,
});
}
});
this.player = ko.observable({
login: "",
amount: null,
});
}
示例2: checkTableReload
private async checkTableReload(tableId: number) {
const reloadData = await this.getReload(tableId);
if (reloadData.emergencyReload) {
console.log("Emergency reload requested.");
const api = this.getApi();
// await api.confirmEmergencyReload(tableId);
window.location.replace("http://google.com/");
return;
}
if (reloadData.reloadRequired) {
console.log("Normal reload requested.");
if (appConfig.game.seatMode) {
const seatId = parseInt(authManager.login().replace("Игрок", ""), 10);
const propertyName = `seat${seatId}Reloaded`;
if (reloadData[propertyName] === false) {
console.log(`Reloading seat ${seatId}.`);
const api = this.getApi();
await api.confirmSeatReload(tableId, seatId);
location.reload();
}
}
if (appConfig.game.tablePreviewMode && !reloadData.tableReloaded) {
console.log("Reloading table.");
const api = this.getApi();
await api.confirmTableReload(tableId);
location.reload();
}
}
}
示例3:
authManager.registerAuthenticationChangedHandler(function (newValue) {
if (authManager.login() === null) {
self.amount(0);
} else {
self.updateAccount();
}
});
示例4: constructor
constructor(messageId: number, date: Date, sender: string, message: string) {
this.messageId = messageId;
this.isAdmin = false;
if (sender.toLowerCase() === "admin") {
this.isAdmin = true;
}
this.isMy = ko.observable(authManager.login() === sender);
authManager.registerAuthenticationChangedHandler(() => {
this.isMy(authManager.login() === sender);
});
this.sender = sender;
this.message = ko.observable(message);
this.date = date.getHours() + ":" + date.getMinutes();
this.fullMessage = ko.computed(() => {
return "[" + this.date + "]" + this.sender + " - " + this.message();
});
}
示例5: updateAccount
public async updateAccount() {
if (!authManager.authenticated()) {
return;
}
const self = this;
try {
await this.updateAccountData();
} catch (e) {
self.updateAccount();
}
}
示例6: AccountManager
authManager.registerAuthenticationChangedHandler(async (newValue) => {
if (newValue) {
const api = new AccountManager();
const data = await api.getAccount();
const personalAccountData = data.Data;
self.player({
login: authManager.login(),
amount: personalAccountData.RealMoney,
});
} else {
self.player({
login: "",
amount: null,
});
}
});
示例7:
authManager.registerAuthenticationChangedHandler(() => {
this.isMy(authManager.login() === sender);
});
示例8: constructor
constructor() {
super();
const self = this;
this.showScreenOverlay = ko.computed(() => {
if (!appConfig.ui.enableScreenOverlay) {
return false;
}
if ((/iphone|ipod|ipad/gi).test(navigator.platform)) {
if (!navigator.standalone) {
return true;
}
return false;
}
return false;
});
this.currentTime = ko.computed(function () {
return timeService.currentTime();
}, this);
this.online = metadataManager.online;
this.registered = metadataManager.registered;
this.captionLabel = ko.computed(() => {
return _("header.onlinePlayersShort")
.replace("#registered", this.registered())
.replace("#online", this.online());
});
this.tournamentsCaption = ko.computed(function () {
return _("tournamentsList.headerCaption")
.replace("#count", "0".toString());
}, this);
this.cashOptions = new CashOptions();
this.tournamentOptions = new TournamentOptions();
this.sngOptions = new TournamentOptions();
this.tournaments = ko.observableArray<LobbyTournamentItemEx>([]);
this.sngs = ko.observableArray<LobbyTournamentItemEx>([]);
this.tables = ko.observableArray([]);
this.showFilterSlider = ko.observable(false);
this.showItemsListSlider = ko.observable(true);
this.filterLocked = ko.observable(false);
this.slider = new Slider();
this.slider.addOption(_("lobby.cashGames"), "cash", null);
this.slider.addOption(_("lobby.tournaments"), "tournaments", null);
this.slider.addOption(_("lobby.sitAndGo"), "sng", null);
this.cashTablesEnabled = ko.observable(appConfig.lobby.cashTablesEnabled);
this.tournamentTablesEnabled = ko.observable(appConfig.lobby.tournamentTablesEnabled);
this.sngTablesEnabled = ko.observable(appConfig.lobby.sngTablesEnabled);
if (!appConfig.tournament.enabled) {
this.slider.enabled(false);
this.tournamentTablesEnabled(false);
this.sngTablesEnabled(false);
}
if (appConfig.tournament.enableTournamentOnly) {
this.slider.enabled(false);
this.slider.currentIndex(1);
}
this.loading = ko.observable(false);
this.selectionCaption = ko.computed(function () {
if (self.slider.currentIndex() === 0) {
return _("tablesList.headerCaption")
.replace("#count", self.tables().length.toString());
}
if (self.slider.currentIndex() === 1) {
return _("tournamentsList.headerCaption")
.replace("#count", self.tournaments().length.toString());
}
return _("tournamentsList.sngCaption")
.replace("#count", self.sngs().length.toString());
}, this);
tableManager.tables.subscribe(function () {
self.updateOpenedTables();
});
this.authenticated = ko.computed(function () {
return authManager.authenticated();
}, this);
this.login = ko.computed(function () {
return authManager.login();
}, this);
authManager.registerAuthenticationChangedHandler(function (newValue) {
if (authManager.login() === null) {
self.amount(0);
} else {
self.updateAccount();
}
});
this.amount = ko.observable(0);
}