-
Notifications
You must be signed in to change notification settings - Fork 16
Gta #2691
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
Open
drazisil
wants to merge
64
commits into
dev
Choose a base branch
from
gta
base: dev
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
Gta #2691
Changes from all commits
Commits
Show all changes
64 commits
Select commit
Hold shift + click to select a range
51de469
refactor: update
drazisil d8f0465
📝 Add docstrings to `gta` (#2679)
coderabbitai[bot] ebd2129
refactor: imports and logging in transactions, login, trackingPing, …
drazisil be7a076
fix: improve error handling in deserialize method of BytableByte class
drazisil 23f6599
feat: add unit tests for BytableBase class and enhance documentation
drazisil 4939e69
fix: cast query results to UserRecordMini type for improved type safety
drazisil 3f8173a
refactor: autofix issues in 19 files
deepsource-autofix[bot] 993ef5a
Merge branch 'dev' into gta
drazisil 092f0da
fix: remove TypeScript error suppression in SubThread initialization
drazisil b28a385
feat: enhance socket data processing and error handling in npsPortRouter
drazisil 3fd7ba3
Merge branch 'gta' of https://github.com/rustymotors/server into gta
drazisil d59ca0a
fix: add missing comma in VSCode settings for proper JSON formatting
drazisil 93691ed
feat: add unit tests for BinaryMember and BytableCString classes
drazisil c2c3d8f
Merge branch 'dev' into gta
drazisil 1d80c04
chore: update swc and rebuild lockfile
drazisil 1d5a202
feat: add unit tests for BytableByte class
drazisil 07ee2f5
Merge branch 'dev' into gta
drazisil 55b4ea8
feat: implement MockField and MockCStringField with serialization tes…
drazisil e2392b1
chore: remove biomejs.biome from VSCode extensions recommendations
drazisil 441d8fc
chore: update @sentry/profiling-node to version 9.19.0
drazisil 4668651
refactor: remove unused binary.ts file and its associated functions
drazisil c957a1c
test: add unit tests for BytableServerHeader with serialization and d…
drazisil 1dacf0a
fix: correct formatting and alignment in README.md
drazisil f50f23b
fix: ensure node_modules is removed in clean target
drazisil effb0e6
refactor: replace NPSHeader with BytableHeader in NPSMessage and rela…
drazisil 2c23129
test: add unit tests for BytableStructure serialization and deseriali…
drazisil 155a60e
refactor: update BytableServerHeader methods and add BytableServerMes…
drazisil 81654ea
Revert "refactor: update BytableServerHeader methods and add BytableS…
drazisil 207772b
refactor: update project name in CHANGELOG from rusty-motors-shared t…
drazisil 5906323
fix: correct export type syntax in logger index file
drazisil b7d512e
fix: improve alignment function to handle non-positive alignment values
drazisil 371cc81
refactor: streamline BinaryMember set method to handle padding and si…
drazisil 7e7a97d
test: update BinaryMember test to handle empty Uint8Array and verify …
drazisil 54f1967
test: add Uint16_t tests for initialization, value setting, and error…
drazisil 2dade10
refactor: remove unused CString class and its associated methods from…
drazisil 382bc39
refactor: clear fields before deserializing and setting body in Bytab…
drazisil 0413f50
Merge branch 'dev' into gta
drazisil 13a7a73
chore: add @biomejs/biome to onlyBuiltDependencies in package.json
drazisil 72dd86e
refactor: improve serialization logic in PersonaRecord class
drazisil 4680a03
refactor: streamline mcotsPortRouter and enhance data handling with d…
drazisil b296a68
refactor: enhance mcotsPortRouter tests with improved logging and soc…
drazisil 45e98c7
refactor: update import paths to use .js extensions for consistency
drazisil c9347e5
refactor: add licensing information and update import paths to use .j…
drazisil b23071d
refactor: enhance documentation for BytableServerHeader class with de…
drazisil 6d8af70
refactor: standardize import statements and enhance utility functions…
drazisil 69120a0
refactor: add licensing information and standardize comments across m…
drazisil fb7f00c
refactor: streamline test setup by introducing utility functions for …
drazisil addb69e
refactor: move user lookup to database module
drazisil 9d469b6
refactor: implement configuration management using config and dotenv …
drazisil 2931f23
refactor: update VSCode extensions recommendations for improved devel…
drazisil 28b0a86
refactor: update Node.js version matrix in GitHub Actions workflow
drazisil 829bf42
refactor: code structure for improved readability and maintainability
drazisil 6300647
refactor: implement code changes to enhance functionality and improve…
drazisil 5ac53dc
refactor: simplify test cases for splitPackets function
drazisil 1a3eb72
refactor: add deprecation notice for Q library in pnpm-lock.yaml
drazisil e1bdd3f
test: add unit tests for BytableContainer and BytableShortContainer c…
drazisil 453e827
refactor: consolidate BytableContainer and BytableShortContainer classes
drazisil c6c0938
refactor: enhance BinaryMember tests and add new utility function tests
drazisil bbf9937
refactor: migrate byte order utility functions to Endian object and f…
drazisil f5d0044
refactor: add mock implementations for deserialize and setMessageLeng…
drazisil 4cce491
refactor: remove BinaryMember and related utility functions
drazisil c070ef9
refactor: replace databaseManager with databaseService and clean up u…
drazisil cec54eb
refactor: remove DatabaseManager and its associated functions
drazisil 0f213e0
refactor: update databaseService methods to async and adjust related …
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 hidden or 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 |
|---|---|---|
|
|
@@ -12,3 +12,4 @@ PRIVATE_KEY_FILE= | |
| PUBLIC_KEY_FILE= | ||
| SENTRY_DSN= | ||
| MCO_LOG_LEVEL= | ||
| MCO_LOGGING_GROUPS= | ||
This file contains hidden or 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 hidden or 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,10 +1,11 @@ | ||
| { | ||
| "recommendations": [ | ||
| "ms-azuretools.vscode-docker", | ||
| "ms-vscode.makefile-tools", | ||
| "usernamehw.errorlens", | ||
| "biomejs.biome", | ||
| "dbaeumer.vscode-eslint", | ||
| "esbenp.prettier-vscode" | ||
| "ms-azuretools.vscode-containers", | ||
| "kisstkondoros.vscode-codemetrics", | ||
| "mhutchie.git-graph", | ||
| "vitest.explorer", | ||
| "biomejs.biome" | ||
| ] | ||
| } |
This file contains hidden or 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 hidden or 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,5 +1,6 @@ | ||
| { | ||
| "git.enableCommitSigning": true, | ||
| "typescript.tsdk": "node_modules/typescript/lib", | ||
| "js/ts.implicitProjectConfig.checkJs": true | ||
| "git.enableCommitSigning": true, | ||
| "typescript.tsdk": "node_modules/typescript/lib", | ||
| "js/ts.implicitProjectConfig.checkJs": true, | ||
| "vitest.rootConfig": "vite.config.ts" | ||
| } | ||
This file contains hidden or 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 hidden or 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 hidden or 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,82 @@ | ||
| # Configuration System for Rusty Motors Server | ||
|
|
||
| This project uses the [`config`](https://www.npmjs.com/package/config) and [`dotenv`](https://www.npmjs.com/package/dotenv) packages for secure, flexible, and environment-based configuration management. | ||
|
|
||
| ## How It Works | ||
|
|
||
| - **Config Directory:** All configuration files are located in the root-level `config/` directory. | ||
| - **Default Values:** The main configuration is in `config/default.json`. | ||
| - **Environment Variables:** You can override any config value using environment variables, as mapped in `config/custom-environment-variables.json`. | ||
| - **.env Support:** You can also use a `.env` file in the project root to set environment variables for local development. | ||
| - **Environment-Specific Config:** You can add files like `config/production.json` or `config/development.json` for environment-specific overrides. | ||
|
|
||
| ## How to Use | ||
|
|
||
| 1. **Edit `config/default.json`** to set project-wide defaults (see example below). | ||
| 2. **Override with environment variables** (e.g., in your shell, CI/CD, or `.env` file): | ||
| - Example: `export CERTIFICATE_FILE=/path/to/cert.pem` | ||
| 3. **(Optional) Add a `.env` file** in the project root for local development: | ||
| ```env | ||
| CERTIFICATE_FILE=./data/mcouniverse.crt | ||
| PRIVATE_KEY_FILE=./data/private_key.pem | ||
| PUBLIC_KEY_FILE=./data/pub.key | ||
| EXTERNAL_HOST=localhost | ||
| MCO_LOG_LEVEL=debug | ||
| ``` | ||
| 4. **(Optional) Add `production.json`, `test.json`, etc.** for environment-specific config. | ||
|
|
||
| ## Example: `config/default.json` | ||
|
|
||
| ```json | ||
| { | ||
| "host": "localhost", | ||
| "logLevel": "debug", | ||
| "certificateFile": "./data/mcouniverse.crt", | ||
| "privateKeyFile": "./data/private_key.pem", | ||
| "publicKeyFile": "./data/pub.key" | ||
| } | ||
| ``` | ||
|
|
||
| ## Example: `config/custom-environment-variables.json` | ||
|
|
||
| ```json | ||
| { | ||
| "host": "EXTERNAL_HOST", | ||
| "logLevel": "MCO_LOG_LEVEL", | ||
| "certificateFile": "CERTIFICATE_FILE", | ||
| "privateKeyFile": "PRIVATE_KEY_FILE", | ||
| "publicKeyFile": "PUBLIC_KEY_FILE" | ||
| } | ||
| ``` | ||
|
|
||
| ## How the Code Loads Config | ||
|
|
||
| The code uses the `config` package to load settings. For example: | ||
|
|
||
| ```typescript | ||
| import config from 'config'; | ||
| const host = config.get<string>('host'); | ||
| ``` | ||
|
|
||
| Or, using the provided helper: | ||
|
|
||
| ```typescript | ||
| import { getServerConfiguration } from 'rusty-motors-shared'; | ||
| const config = getServerConfiguration(); | ||
| console.log(config.host); | ||
| ``` | ||
|
|
||
| ## Best Practices | ||
|
|
||
| - **Never commit secrets** (like private keys) directly to config files. Use environment variables or a secure secrets manager. | ||
| - **Document any required config values** for new developers. | ||
| - **Check the config/ directory** for all available options and mappings. | ||
|
|
||
| ## Further Reading | ||
|
|
||
| - [node-config documentation](https://github.com/node-config/node-config/wiki/Configuration-Files) | ||
| - [dotenv documentation](https://github.com/motdotla/dotenv) | ||
|
|
||
| --- | ||
|
|
||
| For questions, see the project README or ask in the project chat. |
This file contains hidden or 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,7 @@ | ||
| { | ||
| "host": "EXTERNAL_HOST", | ||
| "logLevel": "MCO_LOG_LEVEL", | ||
| "certificateFile": "CERTIFICATE_FILE", | ||
| "privateKeyFile": "PRIVATE_KEY_FILE", | ||
| "publicKeyFile": "PUBLIC_KEY_FILE" | ||
| } |
This file contains hidden or 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,7 @@ | ||
| { | ||
| "host": "localhost", | ||
| "logLevel": "debug", | ||
| "certificateFile": "./data/mcouniverse.crt", | ||
| "privateKeyFile": "./data/private_key.pem", | ||
| "publicKeyFile": "./data/pub.key" | ||
| } |
This file contains hidden or 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 hidden or 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,5 +1,21 @@ | ||
| export * from "./lib/Bytable"; | ||
| export * from "./lib/BytableContainer"; | ||
| export * from "./lib/BytableDword"; | ||
| export * from "./lib/BytableHeader"; | ||
| export * from "./lib/BytableMessage"; | ||
| // mcos is a game server, written from scratch, for an old game | ||
| // Copyright (C) <2017> <Drazi Crendraven> | ||
| // | ||
| // This program is free software: you can redistribute it and/or modify | ||
| // it under the terms of the GNU Affero General Public License as published | ||
| // by the Free Software Foundation, either version 3 of the License, or | ||
| // (at your option) any later version. | ||
| // | ||
| // This program is distributed in the hope that it will be useful, | ||
| // but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| // GNU Affero General Public License for more details. | ||
| // | ||
| // You should have received a copy of the GNU Affero General Public License | ||
| // along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
|
|
||
| export * from './lib/Bytable.js'; | ||
| export * from './lib/BytableContainer.js'; | ||
| export * from './lib/BytableDword.js'; | ||
| export * from './lib/BytableHeader.js'; | ||
| export * from './lib/BytableMessage.js'; |
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.
Uh oh!
There was an error while loading. Please reload this page.