' +
- '
' +
- '' +
- 'Closed At: {{ closedAt | formatDate(\'long\') }}' +
- '{{ $t("dialog.user.info.close_instance") }}' +
- 'PC: {{ platforms.standalonewindows }}' +
- 'Android: {{ platforms.android }}' +
- '{{ $t("dialog.user.info.instance_game_version") }} {{ gameServerVersion }}' +
- '{{ $t("dialog.user.info.instance_queuing_enabled") }}' +
- '{{ $t("dialog.user.info.instance_disabled_content") }} {{ disabledContentSettings }}' +
- '{{ $t("dialog.user.info.instance_users") }}' +
- '' +
- '
' +
- '' +
- '' +
- '
{{ occupants }}/{{ capacity }}' +
- '
({{ friendcount }})' +
- '
{{ $t("dialog.user.info.instance_full") }}' +
- '
{{ $t("dialog.user.info.instance_hard_closed") }}' +
- '
{{ $t("dialog.user.info.instance_closed") }}' +
- '
{{ $t("dialog.user.info.instance_queue") }} {{ queueSize }}' +
- '
{{ $t("dialog.user.info.instance_age_gated") }}' +
- '
',
- props: {
- location: String,
- instance: Object,
- friendcount: Number,
- updateelement: Number
- },
- data() {
- return {
- isValidInstance: this.isValidInstance,
- isFull: this.isFull,
- isClosed: this.isClosed,
- isHardClosed: this.isHardClosed,
- closedAt: this.closedAt,
- occupants: this.occupants,
- capacity: this.capacity,
- queueSize: this.queueSize,
- queueEnabled: this.queueEnabled,
- platforms: this.platforms,
- userList: this.userList,
- gameServerVersion: this.gameServerVersion,
- canCloseInstance: this.canCloseInstance
- };
- },
- methods: {
- parse() {
- this.isValidInstance = false;
- this.isFull = false;
- this.isClosed = false;
- this.isHardClosed = false;
- this.closedAt = '';
- this.occupants = 0;
- this.capacity = 0;
- this.queueSize = 0;
- this.queueEnabled = false;
- this.platforms = [];
- this.userList = [];
- this.gameServerVersion = '';
- this.canCloseInstance = false;
- this.isAgeGated = false;
- this.disabledContentSettings = '';
- if (
- !this.location ||
- !this.instance ||
- Object.keys(this.instance).length === 0
- ) {
- return;
- }
- this.isValidInstance = true;
- this.isFull =
- typeof this.instance.hasCapacityForYou !==
- 'undefined' && !this.instance.hasCapacityForYou;
- if (this.instance.closedAt) {
- this.isClosed = true;
- this.closedAt = this.instance.closedAt;
- }
- this.isHardClosed = this.instance.hardClose === true;
- this.occupants = this.instance.userCount;
- if (this.location === $app.lastLocation.location) {
- // use gameLog for occupants when in same location
- this.occupants = $app.lastLocation.playerList.size;
- }
- this.capacity = this.instance.capacity;
- this.gameServerVersion = this.instance.gameServerVersion;
- this.queueSize = this.instance.queueSize;
- if (this.instance.platforms) {
- this.platforms = this.instance.platforms;
- }
- if (this.instance.users) {
- this.userList = this.instance.users;
- }
- if (this.instance.ownerId === API.currentUser.id) {
- this.canCloseInstance = true;
- } else if (this.instance?.ownerId?.startsWith('grp_')) {
- // check group perms
- var groupId = this.instance.ownerId;
- var group = API.cachedGroups.get(groupId);
- this.canCloseInstance = hasGroupPermission(
- group,
- 'group-instance-moderate'
- );
- }
- this.isAgeGated = this.instance.ageGate === true;
- if (this.location && this.location.includes('~ageGate')) {
- // dumb workaround for API not returning `ageGate`
- this.isAgeGated = true;
- }
- if (
- this.instance.$disabledContentSettings &&
- this.instance.$disabledContentSettings.length
- ) {
- this.disabledContentSettings =
- this.instance.$disabledContentSettings.join(', ');
- }
- },
- showUserDialog(userId) {
- this.showUserDialog(userId);
- }
- },
- watch: {
- updateelement() {
- this.parse();
- },
- location() {
- this.parse();
- },
- friendcount() {
- this.parse();
- }
- },
- created() {
- this.parse();
- }
- });
-
- Vue.component('avatar-info', {
- template:
- '