* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* Update CHANGELOG.md

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* Update CHANGELOG.md

* Update CHANGELOG.md

* wip

* Update CHANGELOG.md

* wip

* wip

* wip

* wip
This commit is contained in:
syuilo
2018-10-07 11:06:17 +09:00
committed by GitHub
parent 0b98a2364b
commit d0570d7fe3
126 changed files with 1812 additions and 2273 deletions

View File

@@ -9,7 +9,6 @@
import Vue from 'vue';
import XGame from './reversi.game.vue';
import XRoom from './reversi.room.vue';
import { ReversiGameStream } from '../../../../scripts/streaming/games/reversi/reversi-game';
export default Vue.extend({
components: {
@@ -34,12 +33,13 @@ export default Vue.extend({
},
created() {
this.g = this.game;
this.connection = new ReversiGameStream((this as any).os, this.$store.state.i, this.game);
this.connection = (this as any).os.stream.connectToChannel('gamesReversiGame', {
gameId: this.game.id
});
this.connection.on('started', this.onStarted);
},
beforeDestroy() {
this.connection.off('started', this.onStarted);
this.connection.close();
this.connection.dispose();
},
methods: {
onStarted(game) {

View File

@@ -59,15 +59,13 @@ export default Vue.extend({
myGames: [],
matching: null,
invitations: [],
connection: null,
connectionId: null
connection: null
};
},
mounted() {
if (this.$store.getters.isSignedIn) {
this.connection = (this as any).os.streams.reversiStream.getConnection();
this.connectionId = (this as any).os.streams.reversiStream.use();
this.connection = (this as any).os.stream.useSharedConnection('gamesReversi');
this.connection.on('invited', this.onInvited);
@@ -90,8 +88,7 @@ export default Vue.extend({
beforeDestroy() {
if (this.connection) {
this.connection.off('invited', this.onInvited);
(this as any).os.streams.reversiStream.dispose(this.connectionId);
this.connection.dispose();
}
},

View File

@@ -47,7 +47,6 @@ export default Vue.extend({
game: null,
matching: null,
connection: null,
connectionId: null,
pingClock: null
};
},
@@ -66,8 +65,7 @@ export default Vue.extend({
this.fetch();
if (this.$store.getters.isSignedIn) {
this.connection = (this as any).os.streams.reversiStream.getConnection();
this.connectionId = (this as any).os.streams.reversiStream.use();
this.connection = (this as any).os.stream.useSharedConnection('gamesReversi');
this.connection.on('matched', this.onMatched);
@@ -84,9 +82,7 @@ export default Vue.extend({
beforeDestroy() {
if (this.connection) {
this.connection.off('matched', this.onMatched);
(this as any).os.streams.reversiStream.dispose(this.connectionId);
this.connection.dispose();
clearInterval(this.pingClock);
}
},

View File

@@ -30,7 +30,6 @@
<script lang="ts">
import Vue from 'vue';
import { MessagingStream } from '../../scripts/streaming/messaging';
import XMessage from './messaging-room.message.vue';
import XForm from './messaging-room.form.vue';
import { url } from '../../../config';
@@ -72,7 +71,7 @@ export default Vue.extend({
},
mounted() {
this.connection = new MessagingStream((this as any).os, this.$store.state.i, this.user.id);
this.connection =((this as any).os.stream.connectToChannel('messaging', { otherparty: this.user.id });
this.connection.on('message', this.onMessage);
this.connection.on('read', this.onRead);
@@ -92,9 +91,7 @@ export default Vue.extend({
},
beforeDestroy() {
this.connection.off('message', this.onMessage);
this.connection.off('read', this.onRead);
this.connection.close();
this.connection.dispose();
if (this.isNaked) {
window.removeEventListener('scroll', this.onScroll);
@@ -166,6 +163,7 @@ export default Vue.extend({
},
onMessage(message) {
console.log(message);
// サウンドを再生する
if (this.$store.state.device.enableSounds) {
const sound = new Audio(`${url}/assets/message.mp3`);

View File

@@ -71,13 +71,11 @@ export default Vue.extend({
messages: [],
q: null,
result: [],
connection: null,
connectionId: null
connection: null
};
},
mounted() {
this.connection = (this as any).os.streams.messagingIndexStream.getConnection();
this.connectionId = (this as any).os.streams.messagingIndexStream.use();
this.connection = (this as any).os.stream.useSharedConnection('messagingIndex');
this.connection.on('message', this.onMessage);
this.connection.on('read', this.onRead);
@@ -88,9 +86,7 @@ export default Vue.extend({
});
},
beforeDestroy() {
this.connection.off('message', this.onMessage);
this.connection.off('read', this.onRead);
(this as any).os.streams.messagingIndexStream.dispose(this.connectionId);
this.connection.dispose();
},
methods: {
getAcct,

View File

@@ -56,7 +56,7 @@ export default Vue.extend({
username: this.username,
password: this.password,
token: this.user && this.user.twoFactorEnabled ? this.token : undefined
}).then(() => {
}, true).then(() => {
location.reload();
}).catch(() => {
alert('%i18n:@login-failed%');

View File

@@ -131,11 +131,11 @@ export default Vue.extend({
password: this.password,
invitationCode: this.invitationCode,
'g-recaptcha-response': this.meta.recaptchaSitekey != null ? (window as any).grecaptcha.getResponse() : null
}).then(() => {
}, true).then(() => {
(this as any).api('signin', {
username: this.username,
password: this.password
}).then(() => {
}, true).then(() => {
location.href = '/';
});
}).catch(() => {

View File

@@ -22,7 +22,7 @@ import * as anime from 'animejs';
export default Vue.extend({
computed: {
stream() {
return (this as any).os.stream;
return (this as any).os.stream.useSharedConnection('main');
}
},
created() {

View File

@@ -38,23 +38,20 @@ export default Vue.extend({
return {
fetching: true,
notes: [],
connection: null,
connectionId: null
connection: null
};
},
mounted() {
this.fetch();
this.connection = (this as any).os.streams.localTimelineStream.getConnection();
this.connectionId = (this as any).os.streams.localTimelineStream.use();
this.connection = (this as any).os.stream.useSharedConnection('localTimeline');
this.connection.on('note', this.onNote);
},
beforeDestroy() {
this.connection.off('note', this.onNote);
(this as any).os.streams.localTimelineStream.dispose(this.connectionId);
this.connection.dispose();
},
methods: {