-
Notifications
You must be signed in to change notification settings - Fork 14
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
chore(deps): add rusty-motors-chat as a dependency #2123
Merged
Merged
Changes from 3 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
393b27a
chore(deps): add rusty-motors-chat as a dependency
drazisil 2616b49
feat(chat): add rusty-motors-chat package
drazisil a7de5bb
chore(deps): add src/* to pnpm-workspace.yaml
drazisil 9888210
fix(chat): update test script in package.json
drazisil 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,2 +1,3 @@ | ||
packages: | ||
- 'packages/*' | ||
- "src/*" |
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,46 @@ | ||
import { | ||
GameMessage, | ||
getServerLogger, | ||
type ServiceResponse, | ||
} from "rusty-motors-shared"; | ||
import type { Serializable } from "rusty-motors-shared-packets"; | ||
|
||
/** | ||
* Receive chat data | ||
* | ||
* @param connectionId - Connection ID | ||
* @param message - Message | ||
* @returns Service response | ||
*/ | ||
async function receiveChatData({ | ||
connectionId, | ||
message, | ||
}: { | ||
connectionId: string; | ||
message: Serializable; | ||
}): Promise<ServiceResponse> { | ||
const log = getServerLogger({}); | ||
|
||
log.info(`Received chat data from connection ${connectionId}`); | ||
log.debug(`Message: ${message.toHexString()}`); | ||
|
||
const inboundMessage = new GameMessage(0); | ||
inboundMessage.deserialize(message.serialize()); | ||
|
||
log.debug(`Deserialized message: ${inboundMessage.toHexString()}`); | ||
|
||
const id = inboundMessage._header.id; | ||
|
||
log.debug(`Message ID: ${id}`); | ||
|
||
throw new Error( | ||
`Unable to process chat data from connection ${connectionId}, data: ${message.toHexString()}`, | ||
); | ||
|
||
return { | ||
connectionId, | ||
messages: [], | ||
}; | ||
drazisil marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} | ||
|
||
export { receiveChatData }; |
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,17 @@ | ||
{ | ||
"name": "rusty-motors-chat", | ||
"version": "1.0.0", | ||
"exports": { | ||
".": { | ||
"import": "./index.js" | ||
} | ||
}, | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
}, | ||
"type": "module", | ||
"keywords": [], | ||
"author": "", | ||
"license": "ISC", | ||
"description": "" | ||
} |
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,11 @@ | ||
{ | ||
"extends": "../../tsconfig.base.json", | ||
"compilerOptions": { | ||
"incremental": true, | ||
"composite": true | ||
}, | ||
"include": [ | ||
"index.ts", | ||
"**/*.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 @@ | ||
export type GameSocketCallback = (messages: Buffer[]) => void; |
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,22 @@ | ||
import { defineConfig } from "vitest/config"; | ||
|
||
export default defineConfig({ | ||
test: { | ||
coverage: { | ||
enabled: true, | ||
all: true, | ||
exclude: [ | ||
"src/**/*.spec.ts", | ||
"src/**/*.test.ts", | ||
"bin/**/*.ts", | ||
"ecosystem.config.js", | ||
"migrate.ts", | ||
"packages/**/*.d.ts", | ||
], | ||
reporter: ["lcov", "text", "cobertura"], | ||
}, | ||
reporters: ["junit", "default", "hanging-process"], | ||
outputFile: "mcos.junit.xml", | ||
pool: "forks", | ||
}, | ||
}); |
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.
Implement the chat data processing logic.
The function is currently throwing an error, indicating that it is unable to process the chat data. This suggests that the implementation is incomplete and requires further development.
Do you want me to help implement the chat data processing logic or open a GitHub issue to track this task?
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.
Open an issue and assign it to me.
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.
@drazisil, the issue has been successfully created and assigned to you. You can find it here: #2129
Analysis chain
@drazisil, I've opened an issue and assigned it to you.
Scripts executed
The following scripts were executed for the analysis:
Script:
Length of output: 475