Свой сервер игры на zloy.net
У игры на zloy.net теперь может быть свой сервер — с правилами самой игры. Возможность экспериментальная и пока открыта по флагу «Внешние платформы».
- Клиент шлёт намерения, сервер решает. Игра просит «посадить морковь» или «выстрелить», а урон, рост урожая, деньги и счёт считает сервер по своим часам. Подменить число в запросе бесполезно.
- Сервер — wasm-компонент, по умолчанию на Rust. Исходники лежат в папке
backend/ игры, готовый файл — в dist-backend/, настройки — в zloy_wasm.json. Работает в песочнице платформы: без сети и файлов, с пределами процессора и памяти.
- Сервер работает с кубиками. Он читает и пишет хранилище, рейтинг и банк от своего имени, а данные, которым он доверяет, закрыты от записи с клиента новыми режимами кубиков
client: read | none.
- Связь — сокет или опрос по HTTP, формат — JSON по умолчанию или Protobuf.
- В Zloy Studio у любой игры появилась вкладка «Сервер»: сборка, загрузка, запуск песочницы, журнал и расход ресурсов.
- Агент Zloy Master сам решает, нужен ли игре свой сервер: если подмена данных вредит только самому игроку — хватит кубиков, а для общего мира, PvP, экономики и общих рейтингов он сначала описывает архитектуру в
zloy_config_server.md, потом пишет сервер.
Заодно в кубиках закрыты дыры: лимит ключей больше не обходится счётчиком, закрытую комнату нельзя открыть перебором номера, а чат комнаты видят только её участники.
An own game server on zloy.net
A game on zloy.net can now have its own server with the game's own rules. The feature is experimental and for now is enabled with the "External platforms" flag.
- The client sends intents, the server decides. The game asks to "plant a carrot" or "fire", while damage, crop growth, money and score are computed by the server on its own clock. Changing a number in a request does nothing.
- The server is a wasm component, written in Rust by default. Sources live in the game's
backend/ folder, the built file in dist-backend/, settings in zloy_wasm.json. It runs in the platform sandbox: no network or files, with CPU and memory limits.
- The server works with cubes. It reads and writes storage, leaderboards and the bank on its own behalf, and the data it trusts is closed to client writes by the new cube modes
client: read | none.
- Transport is a socket or HTTP polling, with JSON by default or Protobuf.
- Zloy Studio has a new Server tab for any game: build, upload, sandbox start, log and resource usage.
- The Zloy Master agent decides whether a game needs its own server: if faking data only hurts the player, cubes are enough; for a shared world, PvP, economy and shared leaderboards it first describes the architecture in
zloy_config_server.md, then writes the server.
Cubes also got fixes: the key limit can no longer be bypassed with a counter, a closed room cannot be opened by guessing its number, and a room chat is visible only to its members.
Комментарии 0
Пока нет комментариев.
Войдите, чтобы комментировать. Войти