# tenio
**Repository Path**: github-codes/tenio
## Basic Information
- **Project Name**: tenio
- **Description**: No description available
- **Primary Language**: Unknown
- **License**: MIT
- **Default Branch**: master
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 0
- **Created**: 2022-02-07
- **Last Updated**: 2022-02-07
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
# TenIO [](https://twitter.com/intent/tweet?text=TenIO%20is%20a%20java%20NIO%20based%20server%20specifically%20designed%20for%20multiplayer%20games.%0D%0A&url=https://github.com/congcoi123/tenio%0D%0A&hashtags=tenio,java,gameserver,multiplayer,nio,netty,jetty,msgpack,cocos2dx,unity,libgdx,phaserjs%0D%0A&via=congcoi123)
`TenIO` is an open-source project to create multiplayer online games that includes a java NIO (Non-blocking I/O) based server specifically designed for multiplayer games, which supports UDP, TCP, Websocket, HTTP transports, and available simple client projects for quick development.
## Features
- Scalable, distributed design
- Easy-to-use, OOP design
- Based on standard Java development, ensuring cross-platform support
- Simple event handlers implementation
- Simple physic simulator and debugger
- Have simple existing game clients for rapid development
## Showcases
| [
Gold Miner Online](https://www.youtube.com/watch?v=BBv5IQFHLjc)
| [
Retro Brick Game Online](https://www.youtube.com/watch?v=nojkJMAfG6Y)
|
| :-----------------------------------------------------------------------------------------------------------------------------------------------------------------: | :-----------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
## MMOG System Architecture


## First Glimpse
- Simple Movement Simulation

## Simple Implementation
```Java
@Bootstrap
public final class TestServerLogin {
public static void main(String[] params) {
ApplicationLauncher.run(TestServerLogin.class, params);
}
}
@Component
final class ConnectionEstablishedHandler extends AbstractExtension implements EventConnectionEstablishedResult {
@Override
public void handle(Session session, ServerMessage message, ConnectionEstablishedResult result) {
if (result == ConnectionEstablishedResult.SUCCESS) {
var data = (ZeroObject) message.getData();
api().login(data.getString(SharedEventKey.KEY_PLAYER_LOGIN), session);
}
}
}
@Component
final class PlayerLoggedinHandler extends AbstractExtension implements EventPlayerLoggedinResult {
@Override
public void handle(Player player, PlayerLoggedinResult result) {
if (result == PlayerLoggedinResult.SUCCESS) {
var data = object().putString(SharedEventKey.KEY_PLAYER_LOGIN,
String.format("Welcome to server: %s", player.getName()));
response().setContent(data.toBinary()).setRecipient(player).write();
}
}
}
@Component
final class ReceivedMessageFromPlayerHandler extends AbstractExtension
implements EventReceivedMessageFromPlayer {
@Override
public void handle(Player player, ServerMessage message) {
var data = object().putString(SharedEventKey.KEY_CLIENT_SERVER_ECHO, String.format("Echo(%s): %s",
player.getName(), ((ZeroObject) message.getData()).getString(SharedEventKey.KEY_CLIENT_SERVER_ECHO)));
response().setContent(data.toBinary()).setRecipient(player).write();
}
}
```
## Wiki
The [wiki](https://github.com/congcoi123/tenio/wiki) provides implementation level details and answers to general questions that a developer starting to use `TenIO` might have about it.
## Clients
| [
TenIO Cocos2dx](https://github.com/congcoi123/tenio-cocos2dx)
| [
TenIO Libgdx](https://github.com/congcoi123/tenio-libgdx)
| [
TenIO Unity](https://github.com/congcoi123/tenio-unity)
| [
TenIO Phaserjs](https://github.com/congcoi123/tenio-phaserjs)
|
| :-----------------------------------------------------------------------------------------------------------------------------------------------------------------: | :-----------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :-------------------------------------------------------------------------------------------------------------------------------------------------------------: |
## Framework
The project is strongly based on the same name framework as you can be referenced by the following repositories.
- [`tenio-common`](https://github.com/congcoi123/tenio-common.git)
- [`tenio-core`](https://github.com/congcoi123/tenio-core.git)
- [`tenio-engine`](https://github.com/congcoi123/tenio-engine.git)
## Requirements
```txt
- Java 11
- Java 8
- Docker
```
## License
The `TenIO` project is currently available under the [MIT](LICENSE) License.
## Contributing
Please check out the [contributing guideline](CONTRIBUTING.md) for more details.
## Documentations
Please check out the [documentations directory](documentations) for more details.
## Installation
```sh
$ git clone https://github.com/congcoi123/tenio.git
```
## Examples
### Collection
Please check out [`this repository`](https://github.com/congcoi123/tenio-examples.git) for references.
### Wanna try Kotlin?
Then you should check out [`this showcase`](https://github.com/congcoi123/lonely-dragon.git) for more details.
> Happy coding !