Commit dd4db6b7 authored by nanahira's avatar nanahira

ygopro room

parent 54c7ae40
......@@ -82,9 +82,10 @@
<span i18n *ngIf="room.options.start_lp != default_options.start_lp">{{room.options.start_lp}}LP</span>
<span i18n i18n-title *ngIf="room.options.start_hand != default_options.start_hand" title="初始起手数量">{{room.options.start_hand}}初始</span>
<span i18n i18n-title *ngIf="room.options.draw_count != default_options.draw_count" title="每回合抽卡数量">{{room.options.draw_count}}抽卡</span>
<span i18n i18n-title *ngIf="room.options.enable_priority != default_options.enable_priority" title="上个版本的大师规则">旧规则</span>
<span i18n i18n-title *ngIf="room.options.duel_rule != default_options.duel_rule" title="上个版本的大师规则">大师规则{{room.options.duel_rule}}</span>
<span i18n i18n-title *ngIf="room.options.no_check_deck != default_options.no_check_deck" title="不检查卡组是否合规">不检查</span>
<span i18n i18n-title *ngIf="room.options.no_shuffle_deck != default_options.no_shuffle_deck" title="任何时候都不洗切卡组">不洗卡</span>
<span i18n i18n-title *ngIf="!!room.options.auto_death" title="40分钟自动死三">自动加时赛</span>
</td>
</tr>
</tbody>
......@@ -125,6 +126,7 @@
<option i18n value="1">TCG</option>
<option i18n value="2">OCG & TCG</option>
<option i18n value="3">专有卡禁止</option>
<option i18n value="4">简体中文</option>
</select>
</div>
<div class="form-group">
......@@ -135,6 +137,16 @@
<option i18n value="2">TAG</option>
</select>
</div>
<div class="form-group">
<label i18n for="game-create-rule">决斗规则</label>
<select class="form-control form-control-sm" id="game-create-duelrule" name="rule" [(ngModel)]="room.options.duel_rule">
<option i18n value="1">大师规则1</option>
<option i18n value="2">大师规则2</option>
<option i18n value="3">大师规则3</option>
<option i18n value="4">新大师规则</option>
<option i18n value="5">大师规则2020</option>
</select>
</div>
<fieldset>
<legend i18n class="col-form-legend">额外选项</legend>
......@@ -160,10 +172,10 @@
<input id="private" name="private" [(ngModel)]="room.private" type="checkbox">
<label i18n for="private">私密房间</label>
</div>
<div>
<!--div>
<input id="enable_priority" name="enable_priority" [(ngModel)]="room.options.enable_priority" type="checkbox">
<label i18n for="enable_priority">旧规则</label>
</div>
</div-->
<div>
<input id="no_check_deck" name="no_check_deck" [(ngModel)]="room.options.no_check_deck" type="checkbox">
<label i18n for="no_check_deck">不检查卡组</label>
......@@ -172,6 +184,10 @@
<input id="no_shuffle_deck" name="no_shuffle_deck" type="checkbox" [(ngModel)]="room.options.no_shuffle_deck">
<label i18n for="no_shuffle_deck">不洗切卡组</label>
</div>
<div>
<input id="auto_death" name="auto_death" type="checkbox" [(ngModel)]="room.options.auto_death">
<label i18n for="auto_death">40分自动加时赛</label>
</div>
</fieldset>
<div id="game-create-actions">
......@@ -289,9 +305,10 @@
<span i18n *ngIf="room.options.start_lp != default_options.start_lp_tag && room.options.mode == 2">{{room.options.start_lp}}LP</span>
<span i18n i18n-title *ngIf="room.options.start_hand != default_options.start_hand" title="初始起手数量">{{room.options.start_hand}}初始</span>
<span i18n i18n-title *ngIf="room.options.draw_count != default_options.draw_count" title="每回合抽卡数量">{{room.options.draw_count}}抽卡</span>
<span i18n i18n-title *ngIf="room.options.enable_priority != default_options.enable_priority" title="上个版本的大师规则">旧规则</span>
<span i18n i18n-title *ngIf="room.options.duel_rule != default_options.duel_rule" title="上个版本的大师规则">大师规则{{room.options.duel_rule}}</span>
<span i18n i18n-title *ngIf="room.options.no_check_deck != default_options.no_check_deck" title="不检查卡组是否合规">不检查</span>
<span i18n i18n-title *ngIf="room.options.no_shuffle_deck != default_options.no_shuffle_deck" title="任何时候都不洗切卡组">不洗卡</span>
<span i18n i18n-title *ngIf="!!room.options.auto_death" title="40分钟自动死三">自动加时赛</span>
</div>
</td>
</tr>
......@@ -317,4 +334,4 @@
<!--</div>-->
</div>
</div>
</div>
\ No newline at end of file
</div>
......@@ -72,11 +72,12 @@ interface Options {
start_lp_tag: number;
start_hand: number;
draw_count: number;
enable_priority: boolean;
duel_rule: number;
no_check_deck: boolean;
no_shuffle_deck: boolean;
lflist?: number;
time_limit?: number;
auto_death: boolean;
}
export interface Points {
......@@ -141,11 +142,12 @@ export class YGOProComponent implements OnInit, OnDestroy {
start_lp_tag: 16000,
start_hand: 5,
draw_count: 1,
enable_priority: false,
duel_rule: 5,
no_check_deck: false,
no_shuffle_deck: false,
lflist: 0,
time_limit: 180
time_limit: 180,
auto_death: false
};
room: Room = {title: this.loginService.user.username + '的房间', options: Object.assign({}, this.default_options)};
......@@ -215,7 +217,7 @@ export class YGOProComponent implements OnInit, OnDestroy {
}, 1000);
}
if (this.settingsService.getLocale().startsWith('zh')) {
// if (this.settingsService.getLocale().startsWith('zh')) {
this.servers.push({
id: 'tiramisu',
url: 'wss://tiramisu.mycard.moe:7923',
......@@ -231,7 +233,7 @@ export class YGOProComponent implements OnInit, OnDestroy {
custom: false,
replay: true
});
} else {
/*} else {
this.servers.push({
id: 'mercury-us-1-athletic',
url: 'wss://mercury-us-1.mycard.moe:7923',
......@@ -247,7 +249,7 @@ export class YGOProComponent implements OnInit, OnDestroy {
custom: false,
replay: true
});
}
}*/
}
......@@ -632,11 +634,12 @@ export class YGOProComponent implements OnInit, OnDestroy {
create_room(room: Room) {
let options_buffer = Buffer.alloc(6);
// 建主密码 https://docs.google.com/document/d/1rvrCGIONua2KeRaYNjKBLqyG9uybs9ZI-AmzZKNftOI/edit
options_buffer.writeUInt8((room.private ? 2 : 1) << 4, 1);
options_buffer.writeUInt8(((room.private ? 2 : 1) << 4) |
(room.options.duel_rule << 1) |
(room.options.auto_death ? 0x1 : 0), 1);
options_buffer.writeUInt8(
room.options.rule << 5 |
room.options.mode << 3 |
(room.options.enable_priority ? 1 << 2 : 0) |
(room.options.no_check_deck ? 1 << 1 : 0) |
(room.options.no_shuffle_deck ? 1 : 0)
, 2);
......
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