обновление README
This commit is contained in:
104
core/README.MD
104
core/README.MD
@@ -1,42 +1,100 @@
|
||||
# Core
|
||||
|
||||
Ядро сервера
|
||||
Ядро сервера.
|
||||
|
||||
Пример настройки можно посмотреть в файле `sample-config.xml`.
|
||||
|
||||
## Spring beans
|
||||
|
||||
### ConfigFromSpring
|
||||
### Разное
|
||||
|
||||
Implements: `mc.core.Config`
|
||||
#### CoreEventListener
|
||||
|
||||
Bean:
|
||||
Стандартный обработчик системных событий.
|
||||
|
||||
**Bean example:**
|
||||
|
||||
```xml
|
||||
<bean class="mc.core.CoreEventListener"/>
|
||||
```
|
||||
|
||||
#### ConfigFromSpring
|
||||
|
||||
Настройка параметров сервера через конфигурацию "спринга".
|
||||
|
||||
Имеются следующие настройки:
|
||||
* `descriptionServer` - описание сервера (aka "Motd")
|
||||
* `favicon` - файл с иконкой сервера
|
||||
* `maxPlayers` - максимальная вместимость сервера
|
||||
|
||||
**Implements:** `mc.core.Config`
|
||||
|
||||
**Bean example:**
|
||||
|
||||
```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"/>
|
||||
<property name="favicon" value="icon.png"/>
|
||||
</bean>
|
||||
```
|
||||
|
||||
### IdleTime
|
||||
#### GameLoop
|
||||
|
||||
Implements: `mc.core.time.TimeProcessor`
|
||||
**Bean example:**
|
||||
|
||||
Bean:
|
||||
Доступные параметры:
|
||||
* `gameTimer` - бин, управляющий ходом времени
|
||||
* `percentWarnLowTps` - порог "низкого" значения TPS, в процентах
|
||||
|
||||
```xml
|
||||
<bean id="gameLoop" class="mc.core.GameLoop">
|
||||
<property name="gameTimer" ref="timeProcessor"/>
|
||||
<property name="percentWarnLowTps" value="15"/>
|
||||
</bean>
|
||||
```
|
||||
|
||||
#### SimpleChatProcessor
|
||||
|
||||
Простой обработчик чата.
|
||||
|
||||
**Implements:** `mc.core.chat.ChatProcessor`
|
||||
|
||||
**Bean example:**
|
||||
|
||||
```xml
|
||||
<bean id="chatProcessor" class="mc.core.chat.SimpleChatProcessor" />
|
||||
```
|
||||
|
||||
### Время
|
||||
|
||||
#### IdleTime
|
||||
|
||||
Игровое время суток застывает на указанной отметке.
|
||||
|
||||
Доступные параметры:
|
||||
* `gameTime` - отметка времени (long)
|
||||
|
||||
**Implements:** `mc.core.time.TimeProcessor`
|
||||
|
||||
**Bean example:**
|
||||
|
||||
```xml
|
||||
<bean id="idleTime" class="mc.core.time.IdleTime">
|
||||
<constructor-arg index="0" type="long" value="1000"/>
|
||||
<property name="gameTime" value="1000"/>
|
||||
</bean>
|
||||
```
|
||||
|
||||
в качестве параметра конструктора указывается стартовое время.
|
||||
#### TimePerTick
|
||||
|
||||
### TimePerTick
|
||||
Игровое время суток соответствует игровым тикам (20 tps)
|
||||
|
||||
Implements: `mc.core.time.TimeProcessor`
|
||||
Доступные параметры:
|
||||
* `startGameTime` - стартовое время (long)
|
||||
|
||||
Bean:
|
||||
**Implements:** `mc.core.time.TimeProcessor`
|
||||
|
||||
**Bean example:**
|
||||
|
||||
```xml
|
||||
<bean id="timePerTick" class="mc.core.time.TimePerTick">
|
||||
@@ -44,26 +102,14 @@ Bean:
|
||||
</bean>
|
||||
```
|
||||
|
||||
в качестве параметра указывается стартовое время.
|
||||
#### RealTime
|
||||
|
||||
### RealTime
|
||||
Игровое время суток соответствует реальному времени
|
||||
|
||||
Implements: `mc.core.time.TimeProcessor`
|
||||
**Implements:** `mc.core.time.TimeProcessor`
|
||||
|
||||
Bean:
|
||||
**Bean example:**
|
||||
|
||||
```xml
|
||||
<bean id="realTime" class="mc.core.time.RealTime"/>
|
||||
```
|
||||
|
||||
### GameLoop
|
||||
|
||||
Bean:
|
||||
|
||||
```xml
|
||||
<bean id="gameLoop" class="mc.core.GameLoop">
|
||||
<property name="gameTimer" ref="timeProcessor"/>
|
||||
</bean>
|
||||
```
|
||||
|
||||
`gameTimer` - бин, управляющий ходом времени
|
||||
|
||||
28
core/sample-config.xml
Normal file
28
core/sample-config.xml
Normal file
@@ -0,0 +1,28 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:context="http://www.springframework.org/schema/context"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans
|
||||
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
|
||||
http://www.springframework.org/schema/context
|
||||
http://www.springframework.org/schema/context/spring-context.xsd">
|
||||
<context:annotation-config />
|
||||
|
||||
<bean id="config" class="mc.core.embedded.ConfigFromSpring">
|
||||
<property name="descriptionServer" value="MC Core - LIMBO"/>
|
||||
<property name="maxPlayers" value="1"/>
|
||||
</bean>
|
||||
|
||||
<bean id="timer" class="mc.core.time.IdleTime">
|
||||
<constructor-arg index="0" type="long" value="1000"/>
|
||||
</bean>
|
||||
|
||||
<bean class="mc.core.CoreEventListener"/>
|
||||
|
||||
<bean id="gameLoop" class="mc.core.GameLoop">
|
||||
<property name="gameTimer" ref="timer"/>
|
||||
<property name="percentWarnLowTps" value="15"/>
|
||||
</bean>
|
||||
|
||||
<bean id="chatProcessor" class="mc.core.chat.SimpleChatProcessor" />
|
||||
</beans>
|
||||
Reference in New Issue
Block a user