diff --git a/README.en.md b/README.en.md new file mode 100644 index 0000000000000000000000000000000000000000..b7a7af73a88655f9bd093a0573a4114d99c3930b --- /dev/null +++ b/README.en.md @@ -0,0 +1,82 @@ +# Fantasy Network Framework + +Fantasy is a high-performance network development framework based on .NET, supporting mainstream protocols and suitable for front-end and back-end separation architecture. It is compatible with various C# clients, including Unity, Godot, WinForm, WPF, and Console. The framework supports TCP, KCP, WebSocket, and HTTP protocols (Unity can be published as H5), making it ideal for projects requiring rapid development, scalability, distributed architecture, and cross-platform commercial solutions. + +## Features + +- **Multi-Protocol Support**: Supports TCP, KCP, WebSocket, and HTTP protocols. +- **High Performance**: Optimized network communication mechanism suitable for high-concurrency scenarios. +- **Front-End and Back-End Separation Architecture**: Facilitates the development and maintenance of large-scale projects. +- **Cross-Platform Support**: Applicable to various clients such as Unity, Godot, WinForm, WPF, and Console. +- **Distributed Architecture Support**: Suitable for building distributed systems. + +## Getting Started + +### Installation + +1. Clone the repository: + ```bash + git clone https://gitee.com/zhangjunming/mcore.network + ``` + +2. Import into a Unity project: + - Import the `Fantasy.Unity` folder into your Unity project. + +### Usage Example + +#### Create a Scene + +```csharp +using Fantasy; + +public class ExampleScene : Scene +{ + public override void Initialize() + { + // Initialization logic for the scene + } + + public override void Update() + { + // Update logic + } +} +``` + +#### Network Communication + +```csharp +using Fantasy.Network; + +public class ExampleNetwork : AClientNetwork +{ + public override void Initialize(NetworkType networkType, NetworkProtocolType networkProtocolType, NetworkTarget networkTarget) + { + // Initialization logic for the network + } + + public override void Dispose() + { + // Resource cleanup + } + + public override void Send(uint rpcId, long routeId, MemoryStreamBuffer memoryStream, IMessage message) + { + // Logic for sending messages + } +} +``` + +## Communication and Discussion + +- [ET Framework](https://github.com/egametang/ET): A comprehensive game development framework. +- [TEngine](https://github.com/ALEXTANGXIAO/TEngine): A simple yet powerful cross-platform solution for Unity. +- [Legends-Of-Heroes](https://github.com/FlameskyDexive/Legends-Of-Heroes): A League of Legends-style Agar.io game based on ET. + +## Special Thanks + +We thank all developers and supporters who have contributed to this project. + +## License + +This project follows an open-source license. Please refer to the [LICENSE](LICENSE) file for detailed information. \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000000000000000000000000000000000000..64369fee89dac8ea0b71d2fd209dc30476017941 --- /dev/null +++ b/README.md @@ -0,0 +1,82 @@ +# Fantasy 网络框架 + +Fantasy 是一个基于 .NET 的高性能网络开发框架,支持主流协议并适用于前后端分离架构。它兼容多种 C# 客户端,包括 Unity、Godot、WinForm、WPF 和 Console。框架支持 TCP、KCP、WebSocket 和 HTTP(支持 Unity 发布为 H5)协议,适合用于需要快速开发、可扩展、分布式和全平台商业级解决方案的项目。 + +## 特性 + +- **多协议支持**:支持 TCP、KCP、WebSocket 和 HTTP 协议。 +- **高性能**:优化的网络通信机制,适用于高并发场景。 +- **前后端分离架构**:便于开发和维护大型项目。 +- **全平台支持**:适用于 Unity、Godot、WinForm、WPF、Console 等多种客户端。 +- **分布式架构支持**:适合构建分布式系统。 + +## 快速上手 + +### 安装 + +1. 克隆仓库: + ```bash + git clone https://gitee.com/zhangjunming/mcore.network + ``` + +2. 导入 Unity 项目: + - 将 `Fantasy.Unity` 文件夹导入到 Unity 项目中。 + +### 使用示例 + +#### 创建场景 + +```csharp +using Fantasy; + +public class ExampleScene : Scene +{ + public override void Initialize() + { + // 初始化场景逻辑 + } + + public override void Update() + { + // 更新逻辑 + } +} +``` + +#### 网络通信 + +```csharp +using Fantasy.Network; + +public class ExampleNetwork : AClientNetwork +{ + public override void Initialize(NetworkType networkType, NetworkProtocolType networkProtocolType, NetworkTarget networkTarget) + { + // 初始化网络逻辑 + } + + public override void Dispose() + { + // 释放资源 + } + + public override void Send(uint rpcId, long routeId, MemoryStreamBuffer memoryStream, IMessage message) + { + // 发送消息逻辑 + } +} +``` + +## 交流与讨论 + +- [ET 框架](https://github.com/egametang/ET):一个完善的游戏开发框架。 +- [TEngine](https://github.com/ALEXTANGXIAO/TEngine):一个简单且强大的 Unity 框架全平台解决方案。 +- [Legends-Of-Heroes](https://github.com/FlameskyDexive/Legends-Of-Heroes):一个基于 ET 的 LOL 风格球球大作战游戏。 + +## 特别鸣谢 + +感谢所有为本项目做出贡献的开发者和支持者。 + +## 许可证 + +本项目遵循开源协议,请参阅 [LICENSE](LICENSE) 文件以获取详细信息。 \ No newline at end of file