Добавлено описание модулям
This commit is contained in:
52
core/README.MD
Normal file
52
core/README.MD
Normal file
@@ -0,0 +1,52 @@
|
|||||||
|
# Core
|
||||||
|
|
||||||
|
Ядро сервера
|
||||||
|
|
||||||
|
## Spring beans
|
||||||
|
|
||||||
|
### ConfigFromSpring
|
||||||
|
|
||||||
|
Implements: `mc.core.Config`
|
||||||
|
|
||||||
|
Bean:
|
||||||
|
|
||||||
|
```xml
|
||||||
|
<bean id="config" class="mc.core.embedded.ConfigFromSpring">
|
||||||
|
<property name="descriptionServer" value="MC Core"/>
|
||||||
|
<property name="maxPlayers" value="100"/>
|
||||||
|
<property name="faviconBase64" value="icon.png"/>
|
||||||
|
</bean>
|
||||||
|
```
|
||||||
|
|
||||||
|
### InMemoryPlayerManager
|
||||||
|
|
||||||
|
Implements: `mc.core.PlayerManager`
|
||||||
|
|
||||||
|
Bean:
|
||||||
|
|
||||||
|
```xml
|
||||||
|
<bean id="playerManager" class="mc.core.embedded.InMemoryPlayerManager">
|
||||||
|
<property name="keepAliveInterval" value="10"/>
|
||||||
|
</bean>
|
||||||
|
```
|
||||||
|
|
||||||
|
`keepAliveInterval` - как часто (в ms) отправлять клиентам пакет `KeepAlive`
|
||||||
|
|
||||||
|
### GameLoop
|
||||||
|
|
||||||
|
Bean:
|
||||||
|
|
||||||
|
```xml
|
||||||
|
<bean id="gameLoop" class="mc.core.GameLoop">
|
||||||
|
<property name="startGameTime" value="6000"/>
|
||||||
|
<property name="timeMode" value="realtime"/>
|
||||||
|
</bean>
|
||||||
|
```
|
||||||
|
|
||||||
|
`timeMode` - режим хода времени суток.
|
||||||
|
|
||||||
|
Есть три режима:
|
||||||
|
|
||||||
|
* `0` или `idle` - полная остановка хода времени суток;
|
||||||
|
* `normal` - стандартных ход времени (20 минут = 1 игровой день);
|
||||||
|
* `realtime` - соответствует реальному системному времени.
|
||||||
29
proto125_netty/README.MD
Normal file
29
proto125_netty/README.MD
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
# Protocol 1.2.5 (Netty impl.)
|
||||||
|
|
||||||
|
Реализация протокола "1.2.5" на сетевом движке Netty.
|
||||||
|
|
||||||
|
## Spring beans
|
||||||
|
|
||||||
|
### NettyServer
|
||||||
|
|
||||||
|
Bean:
|
||||||
|
|
||||||
|
```xml
|
||||||
|
<bean id="pipeline.decoder" class="mc.core.network.proto_125.netty.PacketDecoder" scope="prototype"/>
|
||||||
|
<bean id="pipeline.encoder" class="mc.core.network.proto_125.netty.PacketEncoder" scope="prototype"/>
|
||||||
|
<bean id="pipeline.handler" class="mc.core.network.proto_125.netty.PacketHandler" scope="prototype"/>
|
||||||
|
|
||||||
|
<bean id="server" class="mc.core.network.proto_125.netty.NettyServer">
|
||||||
|
<property name="host" value="127.0.0.1"/>
|
||||||
|
<property name="port" value="25565"/>
|
||||||
|
<property name="workerGroupCount" value="2"/>
|
||||||
|
</bean>
|
||||||
|
```
|
||||||
|
|
||||||
|
`workerGroupCount` - максимальное количество потоков для обработки соединений
|
||||||
|
|
||||||
|
Для логирования содержимого пакетов, можно добавить следующий bean:
|
||||||
|
|
||||||
|
```xml
|
||||||
|
<bean id="pipeline.log" class="io.netty.handler.logging.LoggingHandler" scope="prototype"/>
|
||||||
|
```
|
||||||
Reference in New Issue
Block a user