Commit 0089d94e authored by nanahira's avatar nanahira

Merge branch 'v3' into v3-m1mac

parents 6ebc8dce 47f3b906
...@@ -7,4 +7,4 @@ if [[ -z "$CI_COMMIT_TAG" ]]; then ...@@ -7,4 +7,4 @@ if [[ -z "$CI_COMMIT_TAG" ]]; then
fi fi
npm ci npm ci
npm run dist npm run dist:multiarch
...@@ -14,8 +14,7 @@ macOS_bin: ...@@ -14,8 +14,7 @@ macOS_bin:
paths: paths:
- bin - bin
script: script:
- mkdir -p bin - wget -O - https://cdn01.moecube.com/ygopro-build-materials/mycard-mat/mycard-mat-macos.tar.gz | tar zxf -
- curl --location --retry 5 https://github.com/aria2/aria2/releases/download/release-1.35.0/aria2-1.35.0-osx-darwin.tar.bz2 | tar --strip-components=2 -C bin -jxf - aria2-1.35.0/bin/aria2c
windows_bin: windows_bin:
stage: prepare stage: prepare
...@@ -25,15 +24,7 @@ windows_bin: ...@@ -25,15 +24,7 @@ windows_bin:
paths: paths:
- bin - bin
script: script:
- mkdir -p bin - wget -O - https://cdn01.moecube.com/ygopro-build-materials/mycard-mat/mycard-mat-windows.tar.gz | tar zxf -
#- wget https://cdn01.moecube.com/ygopro-build-materials/mycard-binaries.zip
#- 7z x -y mycard-binaries.zip
- curl --location --retry 5 --output aria2-1.35.0-win-32bit-build1.zip https://github.com/aria2/aria2/releases/download/release-1.35.0/aria2-1.35.0-win-32bit-build1.zip
- unzip -o aria2-1.35.0-win-32bit-build1.zip aria2-1.35.0-win-32bit-build1/aria2c.exe
- mv aria2-1.35.0-win-32bit-build1/aria2c.exe bin
- rm -rf aria2-1.35.0-win-32bit-build1 aria2-1.35.0-win-32bit-build1.zip
- curl --location --retry 5 "http://downloads.sourceforge.net/project/msys2/REPOS/MSYS2/i686/bsdtar-3.4.2-2-i686.pkg.tar.xz" | tar --strip-components=2 -C bin -Jxf - usr/bin/bsdtar.exe
- curl --location --retry 5 "http://downloads.sourceforge.net/project/msys2/Base/i686/msys2-base-i686-20200517.tar.xz" | tar --strip-components=3 -C bin -Jxf - msys32/usr/bin/msys-2.0.dll msys32/usr/bin/msys-bz2-1.dll msys32/usr/bin/msys-expat-1.dll msys32/usr/bin/msys-gcc_s-1.dll msys32/usr/bin/msys-iconv-2.dll msys32/usr/bin/msys-lz4-1.dll msys32/usr/bin/msys-lzma-5.dll msys32/usr/bin/msys-z.dll msys32/usr/bin/msys-zstd-1.dll msys32/usr/bin/sha256sum.exe
windows: windows:
stage: build stage: build
......
...@@ -40,6 +40,8 @@ ...@@ -40,6 +40,8 @@
<i class="fa fa-play" aria-hidden="true"></i> <span i18n>运行</span></button> <i class="fa fa-play" aria-hidden="true"></i> <span i18n>运行</span></button>
<button *ngIf="currentApp.actions.get('network')" [disabled]="!appsService.allReady(currentApp)" (click)="runApp(currentApp,'network')" type="button" class="btn btn-primary btn-sm"> <button *ngIf="currentApp.actions.get('network')" [disabled]="!appsService.allReady(currentApp)" (click)="runApp(currentApp,'network')" type="button" class="btn btn-primary btn-sm">
<i class="fa fa-play" aria-hidden="true"></i> <span>运行 (联机版)</span></button> <i class="fa fa-play" aria-hidden="true"></i> <span>运行 (联机版)</span></button>
<button *ngIf="currentApp.runnable() && currentApp.id === 'th123' && currentApp.references.get('sokuroll').isReady()" (click)="runRoll(currentApp)" [disabled]="!appsService.allReady(currentApp)" type="button" class="btn btn-primary btn-sm">
<i class="fa fa-play" aria-hidden="true"></i> <span i18n>运行 (Roll)</span></button>
<button i18n *ngIf="currentApp.runnable() && currentApp.actions.get('custom')" [disabled]="!appsService.allReady(currentApp)" (click)="custom(currentApp)" type="button" class="btn btn-secondary btn-sm">设置</button> <button i18n *ngIf="currentApp.runnable() && currentApp.actions.get('custom')" [disabled]="!appsService.allReady(currentApp)" (click)="custom(currentApp)" type="button" class="btn btn-secondary btn-sm">设置</button>
......
...@@ -203,6 +203,11 @@ export class AppDetailComponent implements OnInit, OnChanges { ...@@ -203,6 +203,11 @@ export class AppDetailComponent implements OnInit, OnChanges {
this.appsService.runApp(app, 'custom'); this.appsService.runApp(app, 'custom');
} }
async runRoll(app: App) {
await this.appsService.runApp(app, 'roll_main');
await this.appsService.runApp(app, 'roll');
}
async importGame(targetApp: App, option: InstallOption, referencesInstall: { [id: string]: boolean }) { async importGame(targetApp: App, option: InstallOption, referencesInstall: { [id: string]: boolean }) {
$('#import-modal').modal('hide'); $('#import-modal').modal('hide');
let dir = path.dirname(this.import_path); let dir = path.dirname(this.import_path);
...@@ -278,7 +283,7 @@ export class AppDetailComponent implements OnInit, OnChanges { ...@@ -278,7 +283,7 @@ export class AppDetailComponent implements OnInit, OnChanges {
data.set('currency', 'cny'); data.set('currency', 'cny');
data.set('payment', this.payment); data.set('payment', this.payment);
try { try {
let {url} = await this.http.post('https://api.mycard.moe/orders', data).map(response => response.json()).toPromise(); let {url} = await this.http.post('https://sapi.moecube.com:444/orders', data).map(response => response.json()).toPromise();
open(url); open(url);
$('#purchase-modal').modal('hide'); $('#purchase-modal').modal('hide');
$('#purchase-modal-alipay').modal('show'); $('#purchase-modal-alipay').modal('show');
......
...@@ -6,7 +6,7 @@ export class AppLocal { ...@@ -6,7 +6,7 @@ export class AppLocal {
path: string; path: string;
version: string; version: string;
files: Map<string, string>; files: Map<string, string>;
action: Map<string, {execute: string, args: string[], env: {}, open: App}>; action: Map<string, {interpreter?: string, execute: string, args: string[], env: {}, open: App}>;
update(local: any) { update(local: any) {
this.path = local.path; this.path = local.path;
......
import { AppLocal } from './app-local'; import { AppLocal } from './app-local';
import * as path from 'path';
import * as ini from 'ini';
import * as fs from 'fs';
import * as child_process from 'child_process';
export enum Category { export enum Category {
game, game,
...@@ -21,12 +25,21 @@ export enum Category { ...@@ -21,12 +25,21 @@ export enum Category {
// uninstalling, // uninstalling,
// waiting, // waiting,
// } // }
export interface Action { export interface BaseAction {
execute: string; execute: string;
args: string[]; args: string[];
env: {}; env: {};
}
export interface Action extends BaseAction {
interpreter?: string;
open?: App; open?: App;
} }
export interface SpawnAction extends BaseAction {
cwd?: string;
}
export class FileOptions { export class FileOptions {
sync: boolean; sync: boolean;
ignore: boolean; ignore: boolean;
...@@ -85,30 +98,30 @@ export class App { ...@@ -85,30 +98,30 @@ export class App {
static downloadUrl(app: App, platform: string, locale: string): string { static downloadUrl(app: App, platform: string, locale: string): string {
if (app.id === 'ygopro') { if (app.id === 'ygopro') {
return `https://thief.mycard.moe/metalinks/${app.id}-${process.platform}-${locale}/${app.version}`; return `https://sthief.moecube.com:444/metalinks/${app.id}-${process.platform}-${locale}/${app.version}`;
} else if (app.id === 'desmume') { } else if (app.id === 'desmume') {
return `https://thief.mycard.moe/metalinks/${app.id}-${process.platform}/${app.version}`; return `https://sthief.moecube.com:444/metalinks/${app.id}-${process.platform}/${app.version}`;
} }
return `https://thief.mycard.moe/metalinks/${app.id}/${app.version}`; return `https://sthief.moecube.com:444/metalinks/${app.id}/${app.version}`;
} }
static checksumUrl(app: App, platform: string, locale: string): string { static checksumUrl(app: App, platform: string, locale: string): string {
if (app.id === 'ygopro') { if (app.id === 'ygopro') {
return `https://thief.mycard.moe/checksums/${app.id}-${platform}-${locale}/${app.version}`; return `https://sthief.moecube.com:444/checksums/${app.id}-${platform}-${locale}/${app.version}`;
} else if (app.id === 'desmume') { } else if (app.id === 'desmume') {
return `https://thief.mycard.moe/checksums/${app.id}-${platform}/${app.version}`; return `https://sthief.moecube.com:444/checksums/${app.id}-${platform}/${app.version}`;
} }
return `https://thief.mycard.moe/checksums/${app.id}/${app.version}`; return `https://sthief.moecube.com:444/checksums/${app.id}/${app.version}`;
} }
static updateUrl(app: App, platform: string, locale: string): string { static updateUrl(app: App, platform: string, locale: string): string {
if (app.id === 'ygopro') { if (app.id === 'ygopro') {
return `https://thief.mycard.moe/update/${app.id}-${platform}-${locale}/${app.version}`; return `https://sthief.moecube.com:444/update/${app.id}-${platform}-${locale}/${app.version}`;
} else if (app.id === 'desmume') { } else if (app.id === 'desmume') {
return `https://thief.mycard.moe/update/${app.id}-${platform}/${app.version}`; return `https://sthief.moecube.com:444/update/${app.id}-${platform}/${app.version}`;
} }
return `https://thief.mycard.moe/update/${app.id}/${app.version}`; return `https://sthief.moecube.com:444/update/${app.id}/${app.version}`;
} }
isBought(): Boolean { isBought(): Boolean {
...@@ -213,4 +226,103 @@ export class App { ...@@ -213,4 +226,103 @@ export class App {
return dependencies.every((dependency) => dependency.isReady()); return dependencies.every((dependency) => dependency.isReady());
} }
async getSpawnAction(children: App[], action_name = 'main', referencedApp?: App, referencedAction?: Action, cwd?: string): Promise<SpawnAction> {
const appCwd = (<AppLocal>this.local).path;
if(!cwd) {
cwd = appCwd;
}
if (this.id === 'np2fmgen') {
const config_file = path.join(this.local!.path, 'np21nt.ini');
let config = await new Promise((resolve, reject) => {
fs.readFile(config_file, {encoding: 'utf-8'}, (error, data) => {
if (error) {
return reject(error);
}
resolve(ini.parse(data));
});
});
const default_config = {
clk_mult: '48',
DIPswtch: '3e f3 7b',
SampleHz: '44100',
Latencys: '100',
MIX_TYPE: 'true',
windtype: '0'
};
config['NekoProject21'] = Object.assign({}, default_config, config['NekoProject21']);
config['NekoProject21']['HDD1FILE'] =
path.win32.join(process.platform === 'win32' ? '' : 'Z:', referencedApp.local!.path, referencedAction.execute);
config['NekoProject21']['fontfile'] =
path.win32.join(process.platform === 'win32' ? '' : 'Z:', referencedApp.local!.path, 'font.bmp');
await new Promise((resolve, reject) => {
fs.writeFile(config_file, ini.stringify(config), (error) => {
if (error) {
reject(error);
} else {
resolve(null);
}
});
});
cwd = appCwd;
}
let action: Action = <Action>this.actions.get(action_name);
let args: string[] = [];
let env = Object.assign({}, process.env);
for (let child of children) {
if (child.isInstalled()) {
let _action = child.actions.get(action_name);
if (_action) {
action = _action;
}
}
}
let execute: string;
const appExecute = path.join(appCwd, action.execute);
if (action.interpreter) {
execute = action.interpreter;
args.push(appExecute);
} else {
execute = appExecute;
}
if (action.open) {
const np2 = action.open;
const openAction = await np2.getSpawnAction([], 'main', this, action, cwd);
args = args.concat(openAction.args);
args.push(action.execute);
execute = openAction.execute;
cwd = openAction.cwd;
}
args = args.concat(action.args);
env = Object.assign(env, action.env);
return {
execute,
args,
env,
cwd
}
}
async spawnApp(children: App[], action_name = 'main') {
if (this.id === 'th123') {
let th105 = <App>this.references.get('th105');
if (th105.isInstalled()) {
console.log(`Reference of th123: ${th105}`);
const config_file = path.join((<AppLocal>this.local).path, 'configex123.ini');
let config = ini.parse(await fs.promises.readFile(config_file, { encoding: 'utf-8' }));
const th105LocalApp = (<AppLocal>th105.local);
const targetTh105Path = th105LocalApp ? th105LocalApp.path : (<AppLocal>this.local).path.replace(/th123/g, 'th105');
config['th105path'] = {path: targetTh105Path};
await fs.promises.writeFile(config_file, ini.stringify(config));
}
}
const appCwd = (<AppLocal>this.local).path;
const {execute, args, env, cwd} = await this.getSpawnAction(children, action_name);
console.log(execute, args, env, cwd, appCwd);
return child_process.spawn(execute, args, {env: env, cwd: cwd || appCwd});
}
} }
export namespace AppsJson {
export enum Locale {
zh_CN = 'zh-CN',
en_US = 'en-US',
ja_JP = 'ja-JP',
ko_KR = 'ko-KR',
pt_BR = 'pt-BR',
zh_HK = 'zh-HK',
zh_TW = 'zh-TW',
}
export enum Platform {
Linux = 'linux',
macOS = 'darwin',
Windows = 'win32',
}
export type LocaleWise<T> = Record<Locale, T>;
export type PlatformWise<T> = Record<Platform, T>;
export interface Developer {
name: string;
url: string;
}
export interface Trailer {
type: string;
url: string;
url2?: string;
}
export interface Action {
interpreter?: string;
execute: string;
args: any[];
env: Record<string, string>;
open?: string;
}
export type PlatformAction = Record<string, Action>;
export interface News {
url: string;
image: string;
title: string;
text: string;
updated_at: string;
}
export interface NetworkServer {
id: string;
url: string;
}
export interface Network {
protocol: string;
port: number;
servers: NetworkServer[];
}
export interface Syncable {
sync: boolean;
}
export interface Price {
cny: number;
usd: number;
}
export interface App {
id: string;
key?: string;
name?: LocaleWise<string>;
description?: LocaleWise<string>;
developers?: LocaleWise<Developer[]>;
publishers?: LocaleWise<Developer[]>;
released_at?: string;
category?: string;
tags?: string[];
trailer?: Trailer[];
dependencies?: PlatformWise<string[]>;
references?: PlatformWise<string[]>;
author?: string;
homepage?: string;
locales?: string[];
actions?: PlatformWise<PlatformAction>;
version?: PlatformWise<string>;
news?: LocaleWise<News[]>;
conference?: string;
icon?: string;
cover?: string;
background?: string;
parent?: string;
network?: Network;
updated_at?: string;
files?: Record<string, Syncable>;
data?: any;
price?: Price;
}
}
...@@ -7,18 +7,18 @@ import {remote} from 'electron'; ...@@ -7,18 +7,18 @@ import {remote} from 'electron';
import * as sudo from 'electron-sudo'; import * as sudo from 'electron-sudo';
import * as fs from 'fs'; import * as fs from 'fs';
import * as glob from 'glob'; import * as glob from 'glob';
import * as ini from 'ini';
import * as path from 'path'; import * as path from 'path';
import * as readline from 'readline'; import * as readline from 'readline';
import 'rxjs/Rx'; import 'rxjs/Rx';
import {Observable, Observer} from 'rxjs/Rx'; import {Observable, Observer} from 'rxjs/Rx';
import {Action, App, AppStatus} from './app'; import {App, AppStatus} from './app';
import {AppLocal} from './app-local'; import {AppLocal} from './app-local';
import {DownloadService, DownloadStatus} from './download.service'; import {DownloadService, DownloadStatus} from './download.service';
import {InstallOption} from './install-option'; import {InstallOption} from './install-option';
import {LoginService} from './login.service'; import {LoginService} from './login.service';
import {SettingsService} from './settings.sevices'; import {SettingsService} from './settings.sevices';
import {ComparableSet} from './shared/ComparableSet'; import {ComparableSet} from './shared/ComparableSet';
import {AppsJson} from './apps-json-type';
import Timer = NodeJS.Timer; import Timer = NodeJS.Timer;
import ReadableStream = NodeJS.ReadableStream; import ReadableStream = NodeJS.ReadableStream;
...@@ -81,12 +81,12 @@ export class AppsService { ...@@ -81,12 +81,12 @@ export class AppsService {
} }
async loadApps() { async loadApps() {
let appsURL = 'https://api.mycard.moe/apps.json'; let appsURL = 'https://sapi.moecube.com:444/apps.json';
let keysURL = 'https://api.mycard.moe/keys'; let keysURL = 'https://sapi.moecube.com:444/keys';
try { try {
let data = await this.http.get(appsURL) let data = await this.http.get(appsURL)
.timeout(5000) .timeout(5000)
.map((response) => response.json()).toPromise(); .map((response) => response.json()).toPromise<AppsJson.App[]>();
let keys_data = await this.http.get(keysURL, { let keys_data = await this.http.get(keysURL, {
search: { search: {
user_id: this.loginService.user.email user_id: this.loginService.user.email
...@@ -763,115 +763,26 @@ export class AppsService { ...@@ -763,115 +763,26 @@ export class AppsService {
async runApp(app: App, action_name = 'main') { async runApp(app: App, action_name = 'main') {
let children = this.findChildren(app); let children = this.findChildren(app);
let cwd = (<AppLocal>app.local).path;
let action: Action = <Action>app.actions.get(action_name);
let args: string[] = [];
let env = {};
for (let child of children) {
if (child.isInstalled()) {
let _action = child.actions.get(action_name);
if (_action) {
action = _action;
}
}
}
let execute = path.join(cwd, action.execute);
if (app.id === 'th123') {
let th105 = <App>app.references.get('th105');
if (th105.isInstalled()) {
const config_file = path.join((<AppLocal>app.local).path, 'configex123.ini');
let config = await new Promise((resolve, reject) => {
fs.readFile(config_file, {encoding: 'utf-8'}, (error, data) => {
if (error) {
return reject(error);
}
resolve(ini.parse(data));
});
});
config['th105path'] = {path: (<AppLocal>th105.local).path};
await new Promise((resolve, reject) => {
fs.writeFile(config_file, ini.stringify(config), (error) => {
if (error) {
reject(error);
} else {
resolve(null);
}
});
});
}
}
if (action.open) {
let np2 = action.open;
let openAction: Action;
openAction = np2.actions.get('main')!;
let openPath = np2.local!.path;
if (action.open.id === 'np2fmgen') {
const config_file = path.join(action.open!.local!.path, 'np21nt.ini');
let config = await new Promise((resolve, reject) => {
fs.readFile(config_file, {encoding: 'utf-8'}, (error, data) => {
if (error) {
return reject(error);
}
resolve(ini.parse(data));
});
});
const default_config = {
clk_mult: '48',
DIPswtch: '3e f3 7b',
SampleHz: '44100',
Latencys: '100',
MIX_TYPE: 'true',
windtype: '0'
};
config['NekoProject21'] = Object.assign({}, default_config, config['NekoProject21']);
config['NekoProject21']['HDD1FILE'] =
path.win32.join(process.platform === 'win32' ? '' : 'Z:', app.local!.path, action.execute);
config['NekoProject21']['fontfile'] =
path.win32.join(process.platform === 'win32' ? '' : 'Z:', app.local!.path, 'font.bmp');
await new Promise((resolve, reject) => {
fs.writeFile(config_file, ini.stringify(config), (error) => {
if (error) {
reject(error);
} else {
resolve(null);
}
});
});
if (process.platform !== 'win32') { const handle = await app.spawnApp(children, action_name);
args.push(openAction.execute);
args = args.concat(openAction.args);
let wine = openAction.open!;
openPath = wine.local!.path;
openAction = openAction!.open!.actions.get('main')!;
}
cwd = np2.local!.path;
}
args = args.concat(openAction.args);
args.push(action.execute);
execute = path.join(openPath, openAction.execute);
env = Object.assign(env, openAction.env);
}
args = args.concat(action.args);
env = Object.assign(env, action.env);
console.log(execute, args, env, cwd);
let handle = child_process.spawn(execute, args, {env: env, cwd: cwd});
handle.stdout.on('data', (data) => { handle.stdout.on('data', (data) => {
console.log(`stdout: ${data}`); console.log(`${app.id} ${action_name} stdout: ${data}`);
}); });
handle.stderr.on('data', (data) => { handle.stderr.on('data', (data) => {
console.log(`stderr: ${data}`); console.log(`${app.id} ${action_name} stderr: ${data}`);
}); });
handle.on('close', (code) => { handle.on('close', (code) => {
console.log(`child process exited with code ${code}`); console.log(`${app.id} ${action_name}: child process exited with code ${code}`);
remote.getCurrentWindow().restore(); if (action_name !== 'roll') {
remote.getCurrentWindow().restore();
}
}); });
if (action_name !== 'roll') {
remote.getCurrentWindow().minimize(); remote.getCurrentWindow().minimize();
}
} }
browse(app: App) { browse(app: App) {
...@@ -883,7 +794,7 @@ export class AppsService { ...@@ -883,7 +794,7 @@ export class AppsService {
async network(app: App, server: any) { async network(app: App, server: any) {
if (!this.maotama) { if (!this.maotama) {
this.maotama = new Promise((resolve, reject) => { this.maotama = new Promise((resolve, reject) => {
let child = sudo.fork('maotama', [], {stdio: ['inherit', 'inherit', 'inherit', 'ipc']}); let child = (process.platform === 'linux' ? child_process : sudo).fork('maotama', [], {stdio: ['inherit', 'inherit', 'inherit', 'ipc']}); // it's very shit of Linux electron-sudo
child.once('message', () => resolve(child)); child.once('message', () => resolve(child));
child.once('error', reject); child.once('error', reject);
child.once('exit', reject); child.once('exit', reject);
......
...@@ -58,7 +58,7 @@ export class LobbyComponent implements OnInit { ...@@ -58,7 +58,7 @@ export class LobbyComponent implements OnInit {
} }
this.ref.detectChanges(); this.ref.detectChanges();
/* let url = new URL('wss://api.moecube.com:3100'); /* let url = new URL('wss://sapi.moecube.com:444:3100');
let params: URLSearchParams = url.searchParams; let params: URLSearchParams = url.searchParams;
params.set('user_id', this.loginService.user.email); params.set('user_id', this.loginService.user.email);
this.messages = new ReconnectingWebSocket(url); this.messages = new ReconnectingWebSocket(url);
......
...@@ -83,6 +83,7 @@ export class MyCardComponent implements OnInit { ...@@ -83,6 +83,7 @@ export class MyCardComponent implements OnInit {
this.currentWindow.on('unmaximize', () => this.ref.detectChanges()); this.currentWindow.on('unmaximize', () => this.ref.detectChanges());
autoUpdater.on('error', (error) => { autoUpdater.on('error', (error) => {
console.dir(error);
this.set_update_status('error'); this.set_update_status('error');
}); });
autoUpdater.on('checking-for-update', () => { autoUpdater.on('checking-for-update', () => {
......
...@@ -18,4 +18,4 @@ ...@@ -18,4 +18,4 @@
</div> </div>
</div> </div>
</div> </div>
</div> </div>
\ No newline at end of file
...@@ -576,7 +576,7 @@ export class YGOProComponent implements OnInit, OnDestroy { ...@@ -576,7 +576,7 @@ export class YGOProComponent implements OnInit, OnDestroy {
console.log(error); console.log(error);
} }
try { try {
this.http.get('https://api.mycard.moe/ygopro/arena/user', {search: {username: this.loginService.user.username}}) this.http.get('https://sapi.moecube.com:444/ygopro/arena/user', {search: {username: this.loginService.user.username}})
.map((response) => response.json()) .map((response) => response.json())
.toPromise() .toPromise()
.then((d2) => { .then((d2) => {
...@@ -604,7 +604,7 @@ export class YGOProComponent implements OnInit, OnDestroy { ...@@ -604,7 +604,7 @@ export class YGOProComponent implements OnInit, OnDestroy {
data.myname = this.loginService.user.username; data.myname = this.loginService.user.username;
}); });
await this.http.get('https://api.mycard.moe/ygopro/arena/user', { await this.http.get('https://sapi.moecube.com:444/ygopro/arena/user', {
search: { search: {
username: this.loginService.user.username, username: this.loginService.user.username,
} }
...@@ -718,7 +718,7 @@ export class YGOProComponent implements OnInit, OnDestroy { ...@@ -718,7 +718,7 @@ export class YGOProComponent implements OnInit, OnDestroy {
'Basic ' + Buffer.from(this.loginService.user.username + ':' + this.loginService.user.external_id).toString('base64')); 'Basic ' + Buffer.from(this.loginService.user.username + ':' + this.loginService.user.external_id).toString('base64'));
match_started_at = new Date(); match_started_at = new Date();
this.matching_arena = matching_arena = arena; this.matching_arena = matching_arena = arena;
this.matching = matching = this.http.post('https://api.mycard.moe/ygopro/match', null, { this.matching = matching = this.http.post('https://sapi.moecube.com:444/ygopro/match', null, {
headers: headers, headers: headers,
search: { search: {
arena, arena,
......
{ {
"name": "mycard", "name": "mycard",
"version": "3.0.44", "version": "3.0.48",
"lockfileVersion": 2, "lockfileVersion": 2,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"version": "3.0.44", "version": "3.0.48",
"hasInstallScript": true, "hasInstallScript": true,
"license": "UNLICENSED", "license": "UNLICENSED",
"dependencies": { "dependencies": {
...@@ -55,6 +55,7 @@ ...@@ -55,6 +55,7 @@
"@types/glob": "latest", "@types/glob": "latest",
"@types/ini": "latest", "@types/ini": "latest",
"@types/jquery": "^2.0.47", "@types/jquery": "^2.0.47",
"@types/lodash": "^4.14.172",
"@types/marked": "latest", "@types/marked": "latest",
"@types/node": "^14.0.1", "@types/node": "^14.0.1",
"@types/tether": "latest", "@types/tether": "latest",
...@@ -62,12 +63,13 @@ ...@@ -62,12 +63,13 @@
"electron": "^4.2.12", "electron": "^4.2.12",
"electron-builder": "latest", "electron-builder": "latest",
"electron-builder-notarize": "^1.2.0", "electron-builder-notarize": "^1.2.0",
"lodash": "^4.17.21",
"rollup": "latest", "rollup": "latest",
"rollup-plugin-commonjs": "latest", "rollup-plugin-commonjs": "latest",
"rollup-plugin-node-resolve": "latest", "rollup-plugin-node-resolve": "latest",
"rollup-plugin-uglify": "latest", "rollup-plugin-uglify": "latest",
"tslint": "^3.15.1", "tslint": "^3.15.1",
"typescript": "latest" "typescript": "^2.9.2"
} }
}, },
"node_modules/@angular/animations": { "node_modules/@angular/animations": {
...@@ -544,6 +546,12 @@ ...@@ -544,6 +546,12 @@
"integrity": "sha512-QUJ5wVL8iTZofgZjCfVnHxcMqqPPLfVfEKe8rfksMdmSmqEenpcpEBQO45VSSfng/tunwoLF+3I8rzEzVhYNLQ==", "integrity": "sha512-QUJ5wVL8iTZofgZjCfVnHxcMqqPPLfVfEKe8rfksMdmSmqEenpcpEBQO45VSSfng/tunwoLF+3I8rzEzVhYNLQ==",
"dev": true "dev": true
}, },
"node_modules/@types/lodash": {
"version": "4.14.172",
"resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.172.tgz",
"integrity": "sha512-/BHF5HAx3em7/KkzVKm3LrsD6HZAXuXO1AJZQ3cRRBZj4oHZDviWPYu0aEplAqDFNHZPW6d3G7KN+ONcCCC7pw==",
"dev": true
},
"node_modules/@types/marked": { "node_modules/@types/marked": {
"version": "2.0.4", "version": "2.0.4",
"resolved": "https://registry.npmjs.org/@types/marked/-/marked-2.0.4.tgz", "resolved": "https://registry.npmjs.org/@types/marked/-/marked-2.0.4.tgz",
...@@ -5878,6 +5886,12 @@ ...@@ -5878,6 +5886,12 @@
"integrity": "sha512-QUJ5wVL8iTZofgZjCfVnHxcMqqPPLfVfEKe8rfksMdmSmqEenpcpEBQO45VSSfng/tunwoLF+3I8rzEzVhYNLQ==", "integrity": "sha512-QUJ5wVL8iTZofgZjCfVnHxcMqqPPLfVfEKe8rfksMdmSmqEenpcpEBQO45VSSfng/tunwoLF+3I8rzEzVhYNLQ==",
"dev": true "dev": true
}, },
"@types/lodash": {
"version": "4.14.172",
"resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.172.tgz",
"integrity": "sha512-/BHF5HAx3em7/KkzVKm3LrsD6HZAXuXO1AJZQ3cRRBZj4oHZDviWPYu0aEplAqDFNHZPW6d3G7KN+ONcCCC7pw==",
"dev": true
},
"@types/marked": { "@types/marked": {
"version": "2.0.4", "version": "2.0.4",
"resolved": "https://registry.npmjs.org/@types/marked/-/marked-2.0.4.tgz", "resolved": "https://registry.npmjs.org/@types/marked/-/marked-2.0.4.tgz",
......
{ {
"name": "mycard", "name": "mycard",
"version": "3.0.45", "version": "3.0.50",
"description": "moecube", "description": "moecube",
"keywords": [], "keywords": [],
"author": "zh99998 <zh99998@gmail.com>", "author": "zh99998 <zh99998@gmail.com>",
...@@ -11,8 +11,8 @@ ...@@ -11,8 +11,8 @@
"start": "tsc && electron .", "start": "tsc && electron .",
"lint": "tslint ./app/*.ts -t verbose", "lint": "tslint ./app/*.ts -t verbose",
"pack": "tsc && electron-builder --dir", "pack": "tsc && electron-builder --dir",
"dist": "tsc && electron-builder --x64 --arm64", "dist:multiarch": "tsc && electron-builder --x64 --arm64",
"dist:windows": "tsc && electron-builder", "dist": "tsc && electron-builder --x64",
"release": "tsc && electron-builder", "release": "tsc && electron-builder",
"build:aot": "ngc -p tsconfig-aot.json && rollup -c rollup-config.js", "build:aot": "ngc -p tsconfig-aot.json && rollup -c rollup-config.js",
"tsc": "tsc", "tsc": "tsc",
...@@ -69,6 +69,7 @@ ...@@ -69,6 +69,7 @@
"@types/glob": "latest", "@types/glob": "latest",
"@types/ini": "latest", "@types/ini": "latest",
"@types/jquery": "^2.0.47", "@types/jquery": "^2.0.47",
"@types/lodash": "^4.14.172",
"@types/marked": "latest", "@types/marked": "latest",
"@types/node": "^14.0.1", "@types/node": "^14.0.1",
"@types/tether": "latest", "@types/tether": "latest",
...@@ -76,6 +77,7 @@ ...@@ -76,6 +77,7 @@
"electron": "^4.2.12", "electron": "^4.2.12",
"electron-builder": "latest", "electron-builder": "latest",
"electron-builder-notarize": "^1.2.0", "electron-builder-notarize": "^1.2.0",
"lodash": "^4.17.21",
"rollup": "latest", "rollup": "latest",
"rollup-plugin-commonjs": "latest", "rollup-plugin-commonjs": "latest",
"rollup-plugin-node-resolve": "latest", "rollup-plugin-node-resolve": "latest",
......
"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", { value: true });
const fs_1 = require("fs");
const _ = require("lodash");
function main() {
return __awaiter(this, void 0, void 0, function* () {
const apps = JSON.parse(yield fs_1.promises.readFile(process.argv[2], 'utf-8'));
for (const app of apps) {
console.log(`Reading ${app.id}`);
const actions = app.actions;
actions.linux = _.cloneDeep(actions.darwin);
for (const [actionName, action] of Object.entries(actions.linux)) {
if (action.open === 'wine') {
console.log(`Patching Linux action ${app.id}-${actionName}`);
action.open = undefined;
action.interpreter = 'wine';
}
}
}
yield fs_1.promises.writeFile(process.argv[2], JSON.stringify(apps, null, 2));
});
}
main();
//# sourceMappingURL=patch-linux-wine.js.map
\ No newline at end of file
{"version":3,"file":"patch-linux-wine.js","sourceRoot":"","sources":["patch-linux-wine.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,2BAAoC;AAEpC,4BAA4B;AAE5B;;QACI,MAAM,IAAI,GAAmB,IAAI,CAAC,KAAK,CAAC,MAAM,aAAE,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC;QACrF,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE;YACpB,OAAO,CAAC,GAAG,CAAC,WAAW,GAAG,CAAC,EAAE,EAAE,CAAC,CAAC;YACjC,MAAM,OAAO,GAAG,GAAG,CAAC,OAAO,CAAC;YAC5B,OAAO,CAAC,KAAK,GAAG,CAAC,CAAC,SAAS,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;YAC5C,KAAK,MAAM,CAAC,UAAU,EAAE,MAAM,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;gBAC9D,IAAI,MAAM,CAAC,IAAI,KAAK,MAAM,EAAE;oBACxB,OAAO,CAAC,GAAG,CAAC,yBAAyB,GAAG,CAAC,EAAE,IAAI,UAAU,EAAE,CAAC,CAAC;oBAC7D,MAAM,CAAC,IAAI,GAAG,SAAS,CAAC;oBACxB,MAAM,CAAC,WAAW,GAAG,MAAM,CAAC;iBAC/B;aACJ;SACJ;QACD,MAAM,aAAE,CAAC,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;IACvE,CAAC;CAAA;AACD,IAAI,EAAE,CAAC"}
\ No newline at end of file
import { promises as fs } from 'fs';
import { AppsJson } from '../app/apps-json-type';
import * as _ from 'lodash';
async function main() {
const apps: AppsJson.App[] = JSON.parse(await fs.readFile(process.argv[2], 'utf-8'));
for (const app of apps) {
console.log(`Reading ${app.id}`);
const actions = app.actions;
actions.linux = _.cloneDeep(actions.darwin);
for (const [actionName, action] of Object.entries(actions.linux)) {
if (action.open === 'wine') {
console.log(`Patching Linux action ${app.id}-${actionName}`);
action.open = undefined;
action.interpreter = 'wine';
}
}
}
await fs.writeFile(process.argv[2], JSON.stringify(apps, null, 2));
}
main();
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment