-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(serve): add nicoliveComment plugin (server side) #1459
Open
xnv
wants to merge
27
commits into
main
Choose a base branch
from
feat-serve-cmt
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
1c783bd
feat(serve): add nicoliveComment plugin on server
xnv 4715b03
feat(serve): rename NicoliveCommentConfigTemplate#startBy value. add …
xnv 585deb2
refactor(serve): rename NiconicoDevtool to NiconicoDevtoolRankingPage
xnv 2d805d7
feat(serve): add NiconicoDevtoolCommentPage (WIP)
xnv dd7e31b
chore(serve): move NicoliveComment related types to common/
xnv a9d651b
fix(serve): exclude unused files from 'module' build
xnv e004ba3
fix(serve): fix broken imports
xnv 5c9af78
refactor(serve): introduce SandboxConfigExternalDefinition
xnv 66483af
feat(serve): introduce niconicoToolActivePage in queryParameters and …
xnv 48a2a14
feat(serve): add NicoliveCommentClientPlugin, DevtoolUiommentPageStore
xnv 98f32af
fix(serve): fix wrong argument for broadcaster in -s nicolive
xnv fdc4e66
feat(serve): send comments by enter, cosmetic changes
xnv d728cdb
feat(serve): enable to send nicolive comments from devtool
xnv ad7a3c4
fix(serve): avoid to throw error in NicoliveCommentPlugin#start(), wa…
xnv 7c15fe2
merge feat-serve-cmt into feat-serve-cmt-ui
xnv a35590b
fix(serve): revert to throw error in NicoliveCommentPlugin#start()
xnv 5638321
feat(serve): throw error in NicoliveCommentPlugin#start() only when c…
xnv b211b33
Merge branch 'feat-serve-cmt' into feat-serve-cmt-ui
xnv 3980789
fix(serve): disable enter key on input while composing
xnv d7243be
chore(serve): fix comments
xnv 4747c8f
Merge branch 'feat-serve-cmt' into feat-serve-cmt-ui
xnv f0fa91e
fix(serve): fix some bugs around nicoliveComment plugin
xnv b701590
chore(serve): fix comment
xnv 1230ea2
feat(serve): introduce Store#hashedPlayerId
xnv aaf3539
feat(serve): reject invalid use of nicoliveComment
xnv 7e25485
Merge pull request #1464 from akashic-games/feat-serve-cmt-ui
xnv 41da412
refactor(serve): rename several types around comments
xnv File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
packages/akashic-cli-serve/src/client/akashic/plugin/NicoliveCommentClientPlugin.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { Trigger } from "@akashic/trigger"; | ||
import { callOrThrow } from "../../../common/callOrThrow"; | ||
import type { NicoliveCommentPlugin } from "../../../common/types/NicoliveCommentPlugin"; | ||
|
||
export class NicoliveCommentClientPlugin implements agv.ExternalPlugin { | ||
readonly name: string = "nicoliveComment"; | ||
readonly onStartStop: Trigger<boolean> = new Trigger(); | ||
|
||
onload(game: agv.GameLike, _dataBus: unknown, _gameContent: agv.GameContent): void { | ||
let started = false; | ||
|
||
const exposed: NicoliveCommentPlugin = { | ||
start: (_opts, callback) => { | ||
if (started) { | ||
callOrThrow(callback, new Error("g.game.nicoliveComment.start(): already started")); | ||
return; | ||
} | ||
started = true; | ||
this.onStartStop.fire(true); | ||
if (callback) | ||
setTimeout(callback, 0); | ||
}, | ||
stop: () => { | ||
if (!started) | ||
throw new Error("g.game.nicoliveComment.stop(): not started"); | ||
started = false; | ||
this.onStartStop.fire(false); | ||
}, | ||
}; | ||
game.external.nicoliveComment = exposed; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
このトリガーまでは fire していますがこの先の利用者は未実装です。