-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
mopsicus
committed
Oct 10, 2024
0 parents
commit afa78fc
Showing
124 changed files
with
21,346 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Change Log | ||
|
||
All notable changes to this project will be documented in this file. | ||
|
||
## [1.0.0] - 2023-10-10 | ||
|
||
### First release of Shardy |
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 |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# Code of Conduct - Shardy | ||
|
||
## Our Pledge | ||
|
||
In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to make participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation. | ||
|
||
## Our Standards | ||
|
||
Examples of behavior that contributes to a positive environment for our community include: | ||
|
||
* Demonstrating empathy and kindness toward other people | ||
* Being respectful of differing opinions, viewpoints, and experiences | ||
* Giving and gracefully accepting constructive feedback | ||
* Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience | ||
* Focusing on what is best not just for us as individuals, but for the overall community | ||
|
||
Examples of unacceptable behavior include: | ||
|
||
* The use of sexualized language or imagery, and sexual attention or advances | ||
* Trolling, insulting or derogatory comments, and personal or political attacks | ||
* Public or private harassment | ||
* Any insults or humiliation based on nationality or actions related to collective responsibility | ||
* Publishing others' private information, such as a physical or email address, without their explicit permission | ||
* Other conduct which could reasonably be considered inappropriate in a professional setting | ||
|
||
## Our Responsibilities | ||
|
||
Project maintainers are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any instances of unacceptable behavior. | ||
|
||
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. | ||
|
||
## Scope | ||
|
||
This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. | ||
|
||
## Enforcement | ||
|
||
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at [email protected]. All complaints will be reviewed and investigated promptly and fairly. | ||
|
||
All community leaders are obligated to respect the privacy and security of the reporter of any incident. | ||
|
||
## Attribution | ||
|
||
This Code of Conduct is adapted from the [Contributor Covenant](https://contributor-covenant.org/), version [1.4](https://www.contributor-covenant.org/version/1/4/code-of-conduct/code_of_conduct.md) and [2.0](https://www.contributor-covenant.org/version/2/0/code_of_conduct/code_of_conduct.md). |
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 |
---|---|---|
@@ -0,0 +1,92 @@ | ||
# Contributing to Shardy | ||
|
||
First off, thanks for taking the time to contribute! ❤️ | ||
|
||
All types of contributions are encouraged and valued. See the sections below for different ways to help and details about how this project handles them. Please make sure to read the relevant section before making your contribution. It will make it a lot easier for us maintainers and smooth out the experience for all involved. The community looks forward to your contributions. 🎉 | ||
|
||
> [!NOTE] | ||
> And if you like the project, but just don't have time to contribute, that's fine. There are other easy ways to support the project and show your appreciation, which we would also be very happy about: | ||
> - Star the project | ||
> - Tweet about it | ||
> - Refer this project in your project's readme | ||
> - Donate in any way convenient for you | ||
> - Mention the project at local meetups and tell your friends/colleagues | ||
## Code of Conduct | ||
|
||
This project and everyone participating in it is governed by the [Shardy Code of Conduct](./CODE_OF_CONDUCT.md). By participating, you are expected to uphold this code. Please report unacceptable behavior to [email protected]. | ||
|
||
## I have a question | ||
|
||
Before you ask a question, it is best to search for existing [Issues](https://github.com/mopsicus/shardy-unity/issues) that might help you. In case you have found a suitable issue and still need clarification, you can write your question in this issue. It is also advisable to search the internet for answers first. | ||
|
||
If you then still feel the need to ask a question and need clarification, we recommend the following: | ||
|
||
- Open an [Issue](https://github.com/mopsicus/shardy-unity/issues/new) | ||
- Provide as much context as you can about what you're running into | ||
- Provide project and platform versions (unity, android, ios, webgl, etc), depending on what seems relevant | ||
|
||
We will then take care of the issue as soon as possible. | ||
|
||
## Types of Contributions | ||
|
||
Thanks for taking the time to contribute, once again! Please check out the options for how you can start contributing. | ||
|
||
> [!IMPORTANT] | ||
> When contributing to this project, you must agree that you have authored 100% of the content, that you have the necessary rights to the content and that the content you contribute may be provided under the project license. | ||
### Reporting Bugs | ||
|
||
A good bug report shouldn’t leave others needing to chase you up for more information. Therefore, we ask you to investigate carefully, collect information and describe the issue in detail in your report. Please complete the following steps in advance to help us fix any potential bug as fast as possible: | ||
|
||
- Make sure that you are using the latest version | ||
- Determine if your bug is really a bug and not an error on your side e.g. using incompatible environment components/versions | ||
- To see if other users have experienced (and potentially already solved) the same issue you are having, check if there is not already a bug report existing for your bug or error in the [bug tracker](https://github.com/mopsicus/shardy-unity/issues?q=label%3Abug) | ||
- Collect information about the bug: | ||
- Stack trace (Traceback) | ||
- OS, Platform and Version (Windows, Linux, macOS, x86, ARM) | ||
- Unity version | ||
- Platform target (Android, iOS, WebGL) | ||
- Version of the interpreter, compiler, SDK, runtime environment, package manager, depending on what seems relevant | ||
- Possibly your input and the output | ||
- Can you reliably reproduce the issue? And can you also reproduce it with older versions? | ||
|
||
### Suggesting Enhancements | ||
|
||
This section guides you through submitting an enhancement suggestion for Unity client for Shardy, including completely new features and minor improvements to existing functionality. Following these guidelines will help maintainers and the community to understand your suggestion and find related suggestions. | ||
|
||
- Make sure that you are using the latest version | ||
- Perform a [search](https://github.com/mopsicus/shardy-unity/issues) to see if the enhancement has already been suggested. If it has, add a comment to the existing issue instead of opening a new one | ||
- Enhancement suggestions are tracked as [GitHub issues](https://github.com/mopsicus/shardy-unity/issues) | ||
- Create new issue | ||
- Use a **clear and descriptive title** for the issue to identify the suggestion | ||
- Provide a **step-by-step description of the suggested enhancement** in as many details as possible | ||
- **Explain why this enhancement would be useful** to most Shardy users. You may also want to point out the other projects that solved it better and which could serve as inspiration | ||
|
||
### Implementing Features | ||
|
||
Look through the [GitHub issues](https://github.com/mopsicus/shardy-unity/issues) for features. Anything tagged with "enhancement" is open to whoever wants to implement it. | ||
|
||
Ready to contribute? Here are the simple steps for local development: | ||
|
||
1. [Fork](https://github.com/mopsicus/shardy-unity/fork) the client for Shardy repo on GitHub | ||
2. Clone your fork locally: | ||
``` | ||
git clone [email protected]:YOUR_USERNAME/shardy-unity.git | ||
``` | ||
3. Make sure you have the minimum 2022.3.x version of Unity installed | ||
4. Create a branch for local development: | ||
``` | ||
git checkout -b shardy-bugfix-or-feature | ||
``` | ||
5. Implement what you wanted. Please make sure you add comments and stick to the existing code style | ||
6. Use `.editorconfig` file to format and check warnings | ||
7. Make sure there are no errors or warnings after assembly | ||
8. Please, follow the [Conventional Commits](https://www.conventionalcommits.org), when you make a commit | ||
9. Commit your changes and push your branch to GitHub: | ||
``` | ||
git add . | ||
git commit -m "feat(transport): Add UDP protocol" | ||
git push origin shardy-bugfix-or-feature | ||
``` | ||
10. Submit a [pull request](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request) through the GitHub website |
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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# 👾 Android and iOS | ||
|
||
There are no limitations for using Shardy on Android or iOS. You can create your own app for these platforms and be sure that everything will work well. | ||
|
||
Shardy uses the `IPv6` plugin on iOS to convert host and connection parameters. This is [required for AppStore](https://developer.apple.com/library/archive/documentation/NetworkingInternetWeb/Conceptual/NetworkingOverview/UnderstandingandPreparingfortheIPv6Transition/UnderstandingandPreparingfortheIPv6Transition.html#//apple_ref/doc/uid/TP40010220-CH213-SW1) review, and your app may be rejected if you skip this step. | ||
|
||
In either case, you can use the [`TCP`](./reference.md#-transporttype) or `WebSocket` transport type as you see fit. | ||
|
||
# 💻 WebGL | ||
|
||
Shardy can only work in WebGL builds with the [`WebSocket`](./reference.md#-websocket) transport, this is a limitation of Unity and C#. | ||
|
||
> [!IMPORTANT] | ||
> You can’t use any .NET networking classes within the Web platform because JavaScript code doesn’t have direct access to internet protocol (IP) sockets to implement network connectivity. Specifically, Web doesn’t support any .NET classes within the System.Net namespace. [Read Unity docs](https://docs.unity3d.com/Manual/webgl-networking.html). | ||
Since the `System.Net.Sockets` namespace is not supported on this platform, you cannot use the built-in WebSockets. To solve this "snag", Shardy uses a JavaScript plugin under the hood for WebGL builds, but everything is available from C# for the developer. Just use [`TransportType.WebSocket`](./reference.md#-transporttype) for your clients and services. |
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,53 @@ | ||
# 💬 What is Shardy? | ||
|
||
- [Overview](./overview.md#-overview) | ||
- [For whom and why](./overview.md#-for-whom-and-why) | ||
- [Why should I use it](./overview.md#-why-should-i-use-it) | ||
- [Plans](./overview.md#-plans) | ||
|
||
# 🚀 Getting started | ||
|
||
- [Welcome to Shardy](./welcome.md#-welcome-to-shardy) | ||
- [Validator](./welcome.md#-validator) | ||
- [Serializer](./welcome.md#-serializer) | ||
- [Run HelloWorld](./welcome.md#-run-helloworld) | ||
- [Debug and logging](./welcome.md#-debug-and-logging) | ||
|
||
# 🕹️ Using | ||
|
||
- [Connecting to server](./using.md#-connecting-to-server) | ||
- [Make request](./using.md#-make-request) | ||
- [Send command](./using.md#-send-command) | ||
- [Subscribe on command](./using.md#-subscribe-on-command) | ||
- [Subscribe on request](./using.md#-subscribe-on-request) | ||
|
||
# 🏗️ Building | ||
|
||
- [Android and iOS](./building.md#-android-and-ios) | ||
- [WebGL](./building.md#-webgl) | ||
|
||
# 📑 Reference | ||
|
||
- [Block](./reference.md#️-block) | ||
- [BlockData](./reference.md#️-blockdata) | ||
- [BlockType](./reference.md#️-blocktype) | ||
- [Client](./reference.md#-client) | ||
- [ClientOptions](./reference.md#-clientoptions) | ||
- [Commander](./reference.md#-commander) | ||
- [Connection](./reference.md#-connection) | ||
- [DisconnectReason](./reference.md#-disconnectreason) | ||
- [ISerializer](./reference.md#️-iserializer) | ||
- [IValidator](./reference.md#-ivalidator) | ||
- [Logger](./reference.md#-logger) | ||
- [Payload](./reference.md#-payload) | ||
- [PayloadData](./reference.md#-payloaddata) | ||
- [PayloadType](./reference.md#-payloadtype) | ||
- [Protocol](./reference.md#️-protocol) | ||
- [Pulse](./reference.md#-pulse) | ||
- [ReceivedData](./reference.md#-receiveddata) | ||
- [Transport](./reference.md#-transport) | ||
- [TransportType](./reference.md#-transporttype) | ||
- [Utils](./reference.md#️-utils) | ||
- [ValidatorState](./reference.md#️-validatorstate) | ||
- [WebSocket](./reference.md#️-websocket) | ||
- [WebSocketManager](./reference.md#️-websocketmanager) |
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,44 @@ | ||
# 💬 Overview | ||
|
||
This package is a Unity client for Shardy. It provides RPC framework with simple user-friendly API: requests, commands and subscribe for communication with Shardy microservices. | ||
|
||
[Shardy](https://github.com/mopsicus/shardy) is a server framework for online games and applications for Node.js. It provides the basic development framework for building microservices solutions: mobile, social, web, multiplayer games, realtime applications, chats, middleware services, etc. | ||
|
||
The main goal of Shardy is to give simple free solution for building almost any kind of online project. 💪 | ||
|
||
# 🥷 For whom and why | ||
|
||
Shardy grew out of a few scripts for internal use, as is often the case. It was mostly used as a local game backend. It was inspired by a rather famous old project - Pomelo. The package format and general concept of the RPC framework were taken from there. New features were added - the code became more complex. In the end, it was decided to rewrite everything, add WebSocket support and share it. | ||
|
||
I made it alone, primarily for my own needs, after several iterations of rewriting the entire codebase 😄 I'm not claiming that Shardy will work for your project, but it's a really simple solution for adding multiplayer to your game. | ||
|
||
If you have minimal knowledge of Node.js and TypeScript, you can easily [launch your own service on Shardy](https://github.com/mopsicus/shardy-template) and use it as a server for your game or application. | ||
|
||
> [!NOTE] | ||
> This package doesn't use any third-party libraries for its work. 😎 | ||
# 🚀 Why should I use it | ||
|
||
Start your project with Shardy and rest assured: | ||
|
||
- **easy to use:** work with a user-friendly API and don't worry about how it works under the hood | ||
- **mobile platforms:** build your app for Android, iOS and WebGL from one network codebase | ||
- **fast & lightweight:** core without any 3rd party libs, pure C# | ||
- **full docs:** Shardy provides good docs with all necessary sections and API references, also all code is coverged by comments ✌️ | ||
|
||
# 🗓️ Plans | ||
|
||
The plans are truly grand! It is to create an ecosystem for developers who will be able to build their game backend out of existing Shardy services like bricks, and compose mobile clients from Shardy modules. | ||
|
||
First and foremost: | ||
- base helpers | ||
- binding UI | ||
- event bus | ||
- scene/screen manager | ||
- localization | ||
- sound manager | ||
- ads manager | ||
|
||
All of these modules will be as separate packages. The list is endless. | ||
|
||
Also in the plans: writing tutorials, more examples and open source game. And don't forget to [read about server-side plans](https://github.com/mopsicus/shardy/blob/main/Documentation~/overview.md#-plans) 🌐 |
Oops, something went wrong.