Modding:SaveGame Data Storage/ru: Difference between revisions

From Vintage Story Wiki
Created page with "Давайте начнем с создания нового файла .cs для этого мода и добавления нашего импорта и простран..."
(Created page with "Вы можете ознакомиться с методами хранения и извлечения этих массивов байтов для [http://apidocs.vintagest...")
(Created page with "Давайте начнем с создания нового файла .cs для этого мода и добавления нашего импорта и простран...")
 
(4 intermediate revisions by the same user not shown)
Line 11: Line 11:
Вы можете ознакомиться с методами хранения и извлечения этих массивов байтов для [http://apidocs.vintagestory.at/api/Vintagestory.API.Server.IServerChunk.html фрагментов] и для [http://apidocs.vintagestory. at/api/Vintagestory.API.Server.ISaveGame.html#methods SaveGame]
Вы можете ознакомиться с методами хранения и извлечения этих массивов байтов для [http://apidocs.vintagestory.at/api/Vintagestory.API.Server.IServerChunk.html фрагментов] и для [http://apidocs.vintagestory. at/api/Vintagestory.API.Server.ISaveGame.html#methods SaveGame]


== Custom Data in SaveGame ==
== Пользовательские данные в SaveGame ==


Let us show you this powerful set of tools by making an example mod in which we implement an open list of players currently looking for a group to play with ingame.
Давайте покажем вам этот мощный набор инструментов, создав пример мода, в котором мы реализуем открытый список игроков, которые в настоящее время ищут группу для игры в игре.


This list will be a <code>List<string></code> of players which will be stored to the world's <code>SaveGame</code>. Anyone can join it, leave it, or see who needs a group. We'll store this list as an array of bytes, and it can be accessed by the key "lfg".
Этот список будет <code>List<string></code> игроков, который будет сохранен в <code>SaveGame</code> мира. Любой может присоединиться к ней, выйти из нее или посмотреть, кому нужна группа. Мы сохраним этот список в виде массива байтов, доступ к которому можно получить по ключу «lfg».


== Preparation ==
== Подготовка ==


Let's start by creating a new .cs file for this mod, and adding our imports and the <code>VintageStory.ServerMods</code> namespace to wrap our class in. Additionally, we'll declare the class <code>LookingForGroup</code> that will inherit from <code>ModSystem</code> which is the base class for mod systems. You can read more about this [http://apidocs.vintagestory.at/api/Vintagestory.API.Common.ModSystem.html here].
Давайте начнем с создания нового файла .cs для этого мода и добавления нашего импорта и пространства имен <code>VintageStory.ServerMods</code>, чтобы обернуть наш класс. Кроме того, мы объявим класс <code>LookingForGroup</ code>, который будет унаследован от <code>ModSystem</code>, который является базовым классом для систем модов. Подробнее об этом можно прочитать [http://apidocs.vintagestory.at/api/Vintagestory.API.Common.ModSystem.html здесь].


<syntaxhighlight lang="c#">
<syntaxhighlight lang="c#">
Confirmedusers
13,514

edits