Skip to content

Commit afa78fc

Browse files
author
mopsicus
committed
feat: release
0 parents  commit afa78fc

File tree

124 files changed

+21346
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

124 files changed

+21346
-0
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Change Log
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
## [1.0.0] - 2023-10-10
6+
7+
### First release of Shardy

CHANGELOG.md.meta

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

CODE_OF_CONDUCT.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Code of Conduct - Shardy
2+
3+
## Our Pledge
4+
5+
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.
6+
7+
## Our Standards
8+
9+
Examples of behavior that contributes to a positive environment for our community include:
10+
11+
* Demonstrating empathy and kindness toward other people
12+
* Being respectful of differing opinions, viewpoints, and experiences
13+
* Giving and gracefully accepting constructive feedback
14+
* Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
15+
* Focusing on what is best not just for us as individuals, but for the overall community
16+
17+
Examples of unacceptable behavior include:
18+
19+
* The use of sexualized language or imagery, and sexual attention or advances
20+
* Trolling, insulting or derogatory comments, and personal or political attacks
21+
* Public or private harassment
22+
* Any insults or humiliation based on nationality or actions related to collective responsibility
23+
* Publishing others' private information, such as a physical or email address, without their explicit permission
24+
* Other conduct which could reasonably be considered inappropriate in a professional setting
25+
26+
## Our Responsibilities
27+
28+
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.
29+
30+
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.
31+
32+
## Scope
33+
34+
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.
35+
36+
## Enforcement
37+
38+
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.
39+
40+
All community leaders are obligated to respect the privacy and security of the reporter of any incident.
41+
42+
## Attribution
43+
44+
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).

CODE_OF_CONDUCT.md.meta

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

CONTRIBUTING.md

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
# Contributing to Shardy
2+
3+
First off, thanks for taking the time to contribute! ❤️
4+
5+
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. 🎉
6+
7+
> [!NOTE]
8+
> 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:
9+
> - Star the project
10+
> - Tweet about it
11+
> - Refer this project in your project's readme
12+
> - Donate in any way convenient for you
13+
> - Mention the project at local meetups and tell your friends/colleagues
14+
15+
## Code of Conduct
16+
17+
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].
18+
19+
## I have a question
20+
21+
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.
22+
23+
If you then still feel the need to ask a question and need clarification, we recommend the following:
24+
25+
- Open an [Issue](https://github.com/mopsicus/shardy-unity/issues/new)
26+
- Provide as much context as you can about what you're running into
27+
- Provide project and platform versions (unity, android, ios, webgl, etc), depending on what seems relevant
28+
29+
We will then take care of the issue as soon as possible.
30+
31+
## Types of Contributions
32+
33+
Thanks for taking the time to contribute, once again! Please check out the options for how you can start contributing.
34+
35+
> [!IMPORTANT]
36+
> 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.
37+
38+
### Reporting Bugs
39+
40+
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:
41+
42+
- Make sure that you are using the latest version
43+
- Determine if your bug is really a bug and not an error on your side e.g. using incompatible environment components/versions
44+
- 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)
45+
- Collect information about the bug:
46+
- Stack trace (Traceback)
47+
- OS, Platform and Version (Windows, Linux, macOS, x86, ARM)
48+
- Unity version
49+
- Platform target (Android, iOS, WebGL)
50+
- Version of the interpreter, compiler, SDK, runtime environment, package manager, depending on what seems relevant
51+
- Possibly your input and the output
52+
- Can you reliably reproduce the issue? And can you also reproduce it with older versions?
53+
54+
### Suggesting Enhancements
55+
56+
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.
57+
58+
- Make sure that you are using the latest version
59+
- 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
60+
- Enhancement suggestions are tracked as [GitHub issues](https://github.com/mopsicus/shardy-unity/issues)
61+
- Create new issue
62+
- Use a **clear and descriptive title** for the issue to identify the suggestion
63+
- Provide a **step-by-step description of the suggested enhancement** in as many details as possible
64+
- **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
65+
66+
### Implementing Features
67+
68+
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.
69+
70+
Ready to contribute? Here are the simple steps for local development:
71+
72+
1. [Fork](https://github.com/mopsicus/shardy-unity/fork) the client for Shardy repo on GitHub
73+
2. Clone your fork locally:
74+
```
75+
git clone [email protected]:YOUR_USERNAME/shardy-unity.git
76+
```
77+
3. Make sure you have the minimum 2022.3.x version of Unity installed
78+
4. Create a branch for local development:
79+
```
80+
git checkout -b shardy-bugfix-or-feature
81+
```
82+
5. Implement what you wanted. Please make sure you add comments and stick to the existing code style
83+
6. Use `.editorconfig` file to format and check warnings
84+
7. Make sure there are no errors or warnings after assembly
85+
8. Please, follow the [Conventional Commits](https://www.conventionalcommits.org), when you make a commit
86+
9. Commit your changes and push your branch to GitHub:
87+
```
88+
git add .
89+
git commit -m "feat(transport): Add UDP protocol"
90+
git push origin shardy-bugfix-or-feature
91+
```
92+
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

CONTRIBUTING.md.meta

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Documentation~/building.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# 👾 Android and iOS
2+
3+
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.
4+
5+
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.
6+
7+
In either case, you can use the [`TCP`](./reference.md#-transporttype) or `WebSocket` transport type as you see fit.
8+
9+
# 💻 WebGL
10+
11+
Shardy can only work in WebGL builds with the [`WebSocket`](./reference.md#-websocket) transport, this is a limitation of Unity and C#.
12+
13+
> [!IMPORTANT]
14+
> 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).
15+
16+
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.

Documentation~/index.md

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# 💬 What is Shardy?
2+
3+
- [Overview](./overview.md#-overview)
4+
- [For whom and why](./overview.md#-for-whom-and-why)
5+
- [Why should I use it](./overview.md#-why-should-i-use-it)
6+
- [Plans](./overview.md#-plans)
7+
8+
# 🚀 Getting started
9+
10+
- [Welcome to Shardy](./welcome.md#-welcome-to-shardy)
11+
- [Validator](./welcome.md#-validator)
12+
- [Serializer](./welcome.md#-serializer)
13+
- [Run HelloWorld](./welcome.md#-run-helloworld)
14+
- [Debug and logging](./welcome.md#-debug-and-logging)
15+
16+
# 🕹️ Using
17+
18+
- [Connecting to server](./using.md#-connecting-to-server)
19+
- [Make request](./using.md#-make-request)
20+
- [Send command](./using.md#-send-command)
21+
- [Subscribe on command](./using.md#-subscribe-on-command)
22+
- [Subscribe on request](./using.md#-subscribe-on-request)
23+
24+
# 🏗️ Building
25+
26+
- [Android and iOS](./building.md#-android-and-ios)
27+
- [WebGL](./building.md#-webgl)
28+
29+
# 📑 Reference
30+
31+
- [Block](./reference.md#️-block)
32+
- [BlockData](./reference.md#️-blockdata)
33+
- [BlockType](./reference.md#️-blocktype)
34+
- [Client](./reference.md#-client)
35+
- [ClientOptions](./reference.md#-clientoptions)
36+
- [Commander](./reference.md#-commander)
37+
- [Connection](./reference.md#-connection)
38+
- [DisconnectReason](./reference.md#-disconnectreason)
39+
- [ISerializer](./reference.md#️-iserializer)
40+
- [IValidator](./reference.md#-ivalidator)
41+
- [Logger](./reference.md#-logger)
42+
- [Payload](./reference.md#-payload)
43+
- [PayloadData](./reference.md#-payloaddata)
44+
- [PayloadType](./reference.md#-payloadtype)
45+
- [Protocol](./reference.md#️-protocol)
46+
- [Pulse](./reference.md#-pulse)
47+
- [ReceivedData](./reference.md#-receiveddata)
48+
- [Transport](./reference.md#-transport)
49+
- [TransportType](./reference.md#-transporttype)
50+
- [Utils](./reference.md#️-utils)
51+
- [ValidatorState](./reference.md#️-validatorstate)
52+
- [WebSocket](./reference.md#️-websocket)
53+
- [WebSocketManager](./reference.md#️-websocketmanager)

Documentation~/overview.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# 💬 Overview
2+
3+
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.
4+
5+
[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.
6+
7+
The main goal of Shardy is to give simple free solution for building almost any kind of online project. 💪
8+
9+
# 🥷 For whom and why
10+
11+
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.
12+
13+
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.
14+
15+
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.
16+
17+
> [!NOTE]
18+
> This package doesn't use any third-party libraries for its work. 😎
19+
20+
# 🚀 Why should I use it
21+
22+
Start your project with Shardy and rest assured:
23+
24+
- **easy to use:** work with a user-friendly API and don't worry about how it works under the hood
25+
- **mobile platforms:** build your app for Android, iOS and WebGL from one network codebase
26+
- **fast & lightweight:** core without any 3rd party libs, pure C#
27+
- **full docs:** Shardy provides good docs with all necessary sections and API references, also all code is coverged by comments ✌️
28+
29+
# 🗓️ Plans
30+
31+
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.
32+
33+
First and foremost:
34+
- base helpers
35+
- binding UI
36+
- event bus
37+
- scene/screen manager
38+
- localization
39+
- sound manager
40+
- ads manager
41+
42+
All of these modules will be as separate packages. The list is endless.
43+
44+
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) 🌐

0 commit comments

Comments
 (0)