Чат и список игроков
- Протокол: Chat (что сказал сервер), ChatSend (что сказал клиент) и PlayerList (весь список игроков с их режимами). - Сервер: сообщения уходят всем, а имя отправителя ставит сервер, поэтому подделать его нельзя. Список игроков уходит всем целиком, когда он меняется. Команды сервера: /help и /players. - Клиент: перевод наших пакетов в игровые (SPacketChat и SPacketPlayerListItem), уходящий чат перехватывается патчем, список игроков обновляется по разнице (ушедших убираем, пришедших добавляем). - Тесты: два игрока, один пишет - второй слышит с правильным именем; список игроков приходит обоим и меняется, когда кто-то выходит. Попутно: run-server.ps1 теперь знает про rsx-plugin-api, иначе сервер не запускался (нет класса Hitboxes в classpath). Тесты: протокол 34, сервер 87. Форк собирается чисто.
This commit is contained in:
@@ -24,8 +24,9 @@ $Workspace = Split-Path -Parent $Repo
|
||||
|
||||
$Protocol = Join-Path $Workspace 'rsx-protocol\build\classes'
|
||||
$Auth = Join-Path $Workspace 'rsx-auth\build\classes'
|
||||
$PluginApi = Join-Path $Workspace 'rsx-plugin-api\build\classes'
|
||||
$Server = Join-Path $Repo 'build\classes'
|
||||
foreach ($dep in @($Protocol, $Auth, $Server)) {
|
||||
foreach ($dep in @($Protocol, $Auth, $PluginApi, $Server)) {
|
||||
if (-not (Test-Path $dep)) {
|
||||
Write-Host " Missing: $dep" -ForegroundColor Red
|
||||
Write-Host ' Build rsx-protocol, rsx-auth and rsx-server-core first.' -ForegroundColor Red
|
||||
@@ -37,7 +38,7 @@ if (-not $Accounts) { $Accounts = Join-Path $Repo 'accounts.txt' }
|
||||
if (-not $World) { $World = Join-Path $Repo 'world' }
|
||||
|
||||
if ($Register) {
|
||||
& java -cp "$Protocol;$Auth;$Server" net.rustnotmc.server.ServerMain `
|
||||
& java -cp "$Protocol;$Auth;$PluginApi;$Server" net.rustnotmc.server.ServerMain `
|
||||
--accounts $Accounts --register $Register --password $Password
|
||||
exit $LASTEXITCODE
|
||||
}
|
||||
@@ -56,7 +57,7 @@ Write-Host " port : $Port"
|
||||
Write-Host " capacity : $Capacity"
|
||||
Write-Host ''
|
||||
|
||||
& java -cp "$Protocol;$Auth;$Server" net.rustnotmc.server.ServerMain `
|
||||
& java -cp "$Protocol;$Auth;$PluginApi;$Server" net.rustnotmc.server.ServerMain `
|
||||
--port $Port --accounts $Accounts --capacity $Capacity --name $Name --motd $Motd `
|
||||
--world $World --seed $Seed
|
||||
exit $LASTEXITCODE
|
||||
Reference in New Issue
Block a user