-
-
Notifications
You must be signed in to change notification settings - Fork 658
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into dudantas/change-while-to-std-erase-if
- Loading branch information
Showing
1,132 changed files
with
47,716 additions
and
34,155 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -47,14 +47,6 @@ jobs: | |
with: | ||
install: true | ||
|
||
- name: Cache Docker layers | ||
uses: actions/cache@main | ||
with: | ||
path: /tmp/.buildx-cache | ||
key: ${{ runner.os }}-x86-${{ github.sha }} | ||
restore-keys: | | ||
${{ runner.os }}-x86- | ||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v2 | ||
with: | ||
|
@@ -109,14 +101,6 @@ jobs: | |
with: | ||
install: true | ||
|
||
- name: Cache Docker layers | ||
uses: actions/cache@main | ||
with: | ||
path: /tmp/.buildx-cache | ||
key: ${{ runner.os }}-arm-${{ github.sha }} | ||
restore-keys: | | ||
${{ runner.os }}-arm- | ||
- name: Build | ||
uses: docker/[email protected] | ||
with: | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
# Contributing to Canary | ||
|
||
Thank you for your interest in contributing to Canary! This document provides guidelines for contributing to the project to ensure a smooth and effective collaboration. | ||
|
||
## Code of Conduct | ||
|
||
This project adheres to the [Contributor Covenant Code of Conduct](https://github.com/opentibiabr/canary/blob/main/CODE_OF_CONDUCT.md). By participating, you are expected to uphold this code. Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at email: [email protected] or discord: https://discord.com/invite/gvTj5sh9Mp | ||
|
||
## Project Roadmap | ||
|
||
- The Canary project is part of a larger ecosystem within the Open Tibia BR organization, which includes various projects focused on enhancing and innovating within OT server development. You can follow our shared roadmap, encompassing projects like Canary, OTServBR, and OTServBR-Global, among others, in the projects section on GitHub: [Open Tibia BR - Project Roadmap](https://github.com/orgs/opentibiabr/projects). | ||
|
||
- This roadmap aims to ensure alignment of initiatives and prioritize the development of improvements and new features that benefit the community. Community participation is crucial, and we encourage contributors to review the roadmap before proposing major changes, to ensure these align with the strategic direction of our projects. | ||
|
||
|
||
## Getting Started | ||
|
||
### Issues | ||
|
||
- **Bug Reports**: If you encounter any bugs or issues while using Canary, please submit them via our [bug report template](https://github.com/opentibiabr/canary/blob/main/.github/ISSUE_TEMPLATE/bug.yaml). | ||
- **Feature Requests**: If you have any ideas for features or enhancements, you can submit them through our [feature request template](https://github.com/opentibiabr/canary/blob/main/.github/ISSUE_TEMPLATE/request.yaml). | ||
|
||
Please provide as much relevant information as possible, including logs, screenshots, or other details to help the team understand the problem or your request. | ||
|
||
### Pull Requests | ||
|
||
To contribute code to the project, please follow these guidelines: | ||
|
||
1. **Fork the Repository**: Fork the Canary repository and create your own branch to make changes. | ||
2. **Follow the Style Guides**: The project uses **Clang Format** for C++ and **Lua Format** for Lua scripts. It is important that your code follows these styles. We use GitHub Actions (GHA) for formatting checks, so make sure to format your code properly before submitting. | ||
3. **No Complex Lua Scripts**: Contributions involving Lua scripts should focus on simple and efficient implementations. Performance-heavy features should be implemented in C++, and contributions that introduce overly complex Lua scripts may be rejected in favor of a C++ implementation. | ||
4. **Database Standards**: We use an advanced key/value system for data storage called "KV System." We do not accept new tables in the MySQL database. All persistent data must be integrated using the KV system, which includes a protobuf-based abstraction for performance and integration. Please refer to the [KV System README](https://github.com/opentibiabr/canary/blob/main/src/kv/README.md) for more information. | ||
5. **PR Guidelines**: Use our [Pull Request Template](https://github.com/opentibiabr/canary/blob/main/.github/PULL_REQUEST_TEMPLATE.md) when submitting a pull request. Ensure your PR: | ||
- Follows the project coding standards. | ||
- Contains relevant descriptions and details about the changes. | ||
- Respects project maintainers' decisions. Some contributions may not be merged immediately or might be rejected due to internal project priorities. | ||
6. **Do Not Use Legacy Storage System**: Pull requests that introduce new features using the legacy storage system will not be accepted. Contributors must adopt the "KV System" to ensure compatibility with our modern approach. | ||
|
||
## Development Standards | ||
|
||
### Code Quality | ||
- Follow modern C++20+ standards when contributing to the codebase. | ||
- Ensure that your code is well-documented. Comments should be in English, and special attention should be given to areas that are hard to understand. | ||
|
||
### Formatting and Style | ||
- **C++**: Code must be formatted with **Clang Format** according to the project's style configuration. | ||
- **Lua**: Scripts must follow the formatting provided by **Lua Format**. | ||
|
||
We recommend using the provided GitHub Actions to validate the formatting before submitting any pull requests. | ||
|
||
## Communication | ||
|
||
Please use a respectful and welcoming tone when communicating with others. We aim to foster a positive and friendly community, so be mindful of others' perspectives and experiences. | ||
|
||
If you need to reach out to project maintainers for any assistance or inquiries, feel free to contact us at [email protected]. | ||
|
||
## Review Process | ||
|
||
- Pull requests will be reviewed by the project maintainers. Please be patient, as it may take some time to get feedback. | ||
- Contributors must be prepared for their PRs to be modified or even rejected. Reasons for this include internal priorities, a need for better performance, or violations of contribution guidelines. | ||
|
||
## Best Practices | ||
- Respect the project standards and guidelines. | ||
- Make small, focused pull requests, as it makes the review process easier. | ||
- Write tests where possible to ensure that your changes do not introduce new issues. | ||
- Provide clear descriptions in your commits and pull requests. | ||
- Ensure that new features are properly integrated with existing systems. | ||
|
||
## Advanced Contribution | ||
- **Complex Systems**: For features that impact performance or require deeper integrations, discuss them with the maintainers before implementation. | ||
- **KV System Usage**: All persistent data should leverage the KV system. It allows for efficient data mapping, storing complex structures seamlessly. Learn more about the KV system [here](https://github.com/opentibiabr/canary/blob/main/src/kv/README.md). | ||
|
||
Thank you for your contributions and for helping make Canary better! | ||
|
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 was deleted.
Oops, something went wrong.
This file was deleted.
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 |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# Database Migration System | ||
|
||
This document provides an overview of the current database migration system for the project. The migration process has been streamlined to ensure that all migration scripts are automatically applied in order, making it easier to maintain database updates. | ||
|
||
## How It Works | ||
|
||
The migration system is designed to apply updates to the database schema or data whenever a new server version is started. Migration scripts are stored in the `migrations` directory, and the system will automatically apply any scripts that have not yet been executed. | ||
|
||
### Steps Involved | ||
|
||
1. **Retrieve Current Database Version**: | ||
- The system first retrieves the current version of the database using `getDatabaseVersion()`. | ||
- This version is used to determine which migration scripts need to be executed. | ||
|
||
2. **Migration Files Directory**: | ||
- All migration scripts are stored in the `migrations` directory. | ||
- Each migration script is named using a numerical pattern, such as `1.lua`, `2.lua`, etc. | ||
- The naming convention helps determine the order in which scripts should be applied. | ||
|
||
3. **Execute Migration Scripts**: | ||
- The migration system iterates through the migration directory and applies each migration script that has a version greater than the current database version. | ||
- Only scripts that have not been applied are executed. | ||
- The Lua state (`lua_State* L`) is initialized to run each script. | ||
|
||
4. **Update Database Version**: | ||
- After each migration script is successfully applied, the system updates the database version to reflect the applied change. | ||
- This ensures that the script is not re-applied on subsequent server startups. | ||
|
||
## Example Migration Script | ||
|
||
Below is an example of what a migration script might look like. Note that no return value is required, as all migration files are applied based on the current database version. | ||
|
||
```lua | ||
-- Migration script example (for documentation purposes only) | ||
-- This migration script should include all necessary SQL commands or operations to apply a specific update to the database. | ||
|
||
-- Example: Adding a new column to the "players" table | ||
local query = [[ | ||
ALTER TABLE players ADD COLUMN new_feature_flag TINYINT(1) NOT NULL DEFAULT 0; | ||
]] | ||
|
||
-- Execute the query | ||
db.execute(query) -- This function executes the given SQL query on the database. | ||
|
||
-- Note: Ensure that queries are validated to avoid errors during the migration process. |
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
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.