#ifndef ENSHWICK_H
#define ENSHWICK_H
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#define ENSHWICK_ABI_MAJOR 4
#define ENSHWICK_ABI_MINOR 1
#define ENSHWICK_DAMAGE_TYPES 13
#define ENSHWICK_SURVIVOR_STATUS_SET 256
typedef uint8_t EnshwickAccountActionType;
#define EnshwickAccountActionType_KICK 0
#define EnshwickAccountActionType_BAN 1
#define EnshwickAccountActionType_UN_BAN 2
typedef struct EnshwickHeader {
uint32_t size;
uint16_t abi_major;
uint16_t abi_minor;
} EnshwickHeader;
typedef uint32_t EnshwickEntity;
typedef uint64_t EnshwickPlayerKey;
typedef struct EnshwickPlayerInfo {
struct EnshwickHeader header;
uint32_t slot;
EnshwickEntity entity;
EnshwickPlayerKey key;
uint8_t permissions;
uint8_t name_len;
uint8_t name[64];
} EnshwickPlayerInfo;
#define EnshwickPlayerInfo_CAN_KICK_BAN 1
#define EnshwickPlayerInfo_CAN_ACCESS_INVENTORIES (1 << 1)
#define EnshwickPlayerInfo_CAN_EDIT_BASE (1 << 2)
#define EnshwickPlayerInfo_CAN_EDIT_WORLD (1 << 3)
#define EnshwickPlayerInfo_CAN_EXTEND_BASE (1 << 4)
#define EnshwickPlayerInfo_CAN_RECEIVE_EXP (1 << 5)
typedef struct EnshwickStr {
const uint8_t *ptr;
size_t len;
} EnshwickStr;
typedef struct EnshwickActionCall {
struct EnshwickHeader header;
uint32_t kind;
uint32_t language;
struct EnshwickPlayerInfo player;
struct EnshwickStr action;
struct EnshwickStr args;
} EnshwickActionCall;
#define EnshwickActionCall_SHEET 0
#define EnshwickActionCall_RUN 1
#define EnshwickActionCall_HINTS 2
#define EnshwickActionCall_CONSOLE 3
typedef uint32_t EnshwickBuffTypeId;
typedef struct EnshwickActiveBuff {
struct EnshwickHeader header;
EnshwickBuffTypeId id;
EnshwickEntity entity;
uint32_t slot;
uint32_t level;
int64_t duration;
int64_t remaining;
} EnshwickActiveBuff;
typedef struct EnshwickAffixModifierData {
uint32_t stat;
uint8_t op;
uint8_t reserved[3];
float min;
float max;
float step;
} EnshwickAffixModifierData;
typedef struct EnshwickAffixDefData {
struct EnshwickHeader header;
struct EnshwickStr text;
struct EnshwickStr group;
const struct EnshwickAffixModifierData *modifiers;
uint32_t modifier_count;
uint32_t weight;
uint32_t categories;
uint8_t rarity;
uint8_t reserved[3];
} EnshwickAffixDefData;
typedef uint32_t EnshwickItemId;
typedef struct EnshwickAffixRoll {
struct EnshwickHeader header;
EnshwickEntity pide;
EnshwickItemId item;
uint8_t min;
uint8_t max;
uint8_t max_rarity;
uint8_t flags;
uint64_t seed;
} EnshwickAffixRoll;
#define EnshwickAffixRoll_ONCE 1
typedef struct EnshwickBounds {
int64_t min[3];
int64_t max[3];
} EnshwickBounds;
typedef struct EnshwickAltarInfo {
struct EnshwickHeader header;
EnshwickEntity entity;
uint8_t level;
uint8_t tilted;
uint8_t level_count;
uint8_t reserved;
struct EnshwickBounds zone;
struct EnshwickBounds levels[16];
double position[3];
} EnshwickAltarInfo;
typedef struct EnshwickAltarLimit {
struct EnshwickHeader header;
uint32_t flame_level;
uint8_t vanilla;
uint8_t allowed;
uint8_t reserved[2];
} EnshwickAltarLimit;
typedef struct EnshwickAltarZone {
struct EnshwickHeader header;
EnshwickEntity altar;
uint8_t level;
uint8_t reserved[3];
int64_t grow;
int64_t height;
} EnshwickAltarZone;
typedef struct EnshwickBaseLimitInfo {
struct EnshwickHeader header;
uint32_t zones;
uint32_t bases;
uint32_t vanilla_zones;
uint32_t reserved;
uint32_t vanilla_bases;
uint32_t max_zones;
uint32_t max_bases;
} EnshwickBaseLimitInfo;
typedef uint32_t EnshwickNpcId;
typedef struct EnshwickBedCheck {
struct EnshwickHeader header;
EnshwickNpcId npc_id;
EnshwickEntity entity;
EnshwickEntity bed_id;
int64_t home[3];
int64_t bed_at[3];
} EnshwickBedCheck;
typedef struct EnshwickBlockPlace {
struct EnshwickHeader header;
EnshwickItemId shape;
EnshwickItemId material;
double position[3];
float rotation[4];
} EnshwickBlockPlace;
typedef struct EnshwickBuffRequest {
struct EnshwickHeader header;
EnshwickEntity entity;
EnshwickBuffTypeId id;
uint32_t level;
uint32_t reserved;
int64_t duration;
} EnshwickBuffRequest;
typedef struct EnshwickBuffTypeInfo {
struct EnshwickHeader header;
EnshwickBuffTypeId id;
uint16_t slot;
uint16_t flags;
uint32_t name;
int64_t duration;
} EnshwickBuffTypeInfo;
#define EnshwickBuffTypeInfo_FOOD 0
#define EnshwickBuffTypeInfo_BUFF 1
#define EnshwickBuffTypeInfo_DEBUFF 2
#define EnshwickBuffTypeInfo_RESTED 3
#define EnshwickBuffTypeInfo_TERRAIN 4
#define EnshwickBuffTypeInfo_SAVED 1
#define EnshwickBuffTypeInfo_HIDDEN 2
typedef struct EnshwickBuildCheck {
struct EnshwickHeader header;
EnshwickEntity player;
EnshwickItemId item;
int64_t position[3];
} EnshwickBuildCheck;
typedef uint8_t EnshwickSide;
#define EnshwickSide_SERVER 1
#define EnshwickSide_CLIENT 2
#define EnshwickSide_BOTH 3
typedef struct EnshwickFingerprint {
uint8_t guid[16];
uint32_t age;
} EnshwickFingerprint;
typedef uint8_t EnshwickBuildTable;
#define EnshwickBuildTable_EXACT 0
#define EnshwickBuildTable_PATTERNS 1
typedef struct EnshwickBuildInfo {
struct EnshwickHeader header;
EnshwickSide side;
uint64_t base;
struct EnshwickFingerprint fingerprint;
EnshwickBuildTable table;
} EnshwickBuildInfo;
typedef struct EnshwickBuildRights {
struct EnshwickHeader header;
EnshwickEntity player;
uint32_t refusal;
double min[3];
double max[3];
} EnshwickBuildRights;
#define EnshwickBuildRights_ALLOWED 0
#define EnshwickBuildRights_NO_CAN_EDIT_WORLD 1
#define EnshwickBuildRights_NO_CAN_EDIT_BASE 2
#define EnshwickBuildRights_OUTSIDE_BUILDING_ZONE 3
#define EnshwickBuildRights_INSIDE_STRICT_BUILD_INHIBITOR_ZONE 4
typedef struct EnshwickSymbol {
struct EnshwickStr name;
uint64_t rva;
} EnshwickSymbol;
typedef struct EnshwickBuildRow {
EnshwickSide side;
struct EnshwickFingerprint fingerprint;
const struct EnshwickSymbol *symbols;
size_t symbol_count;
const struct EnshwickSymbol *constants;
size_t constant_count;
} EnshwickBuildRow;
typedef struct EnshwickBuildingData {
struct EnshwickHeader header;
EnshwickEntity entity;
EnshwickEntity player;
EnshwickItemId item;
uint8_t kind;
uint8_t replay;
uint8_t template_[16];
float position[3];
} EnshwickBuildingData;
#define EnshwickBuildingData_PLACED 0
#define EnshwickBuildingData_PICKED_UP 1
#define EnshwickBuildingData_TORN_DOWN 2
typedef struct EnshwickBuildingZoneCheck {
struct EnshwickHeader header;
const struct EnshwickBounds *zones;
size_t zone_count;
struct EnshwickBounds object;
int64_t margin;
} EnshwickBuildingZoneCheck;
typedef struct EnshwickLayoutField {
struct EnshwickStr name;
uint64_t hash;
} EnshwickLayoutField;
typedef struct EnshwickLayout {
const struct EnshwickLayoutField *fields;
uint32_t count;
uint32_t size;
} EnshwickLayout;
typedef struct EnshwickCallSpec {
struct EnshwickHeader header;
struct EnshwickStr name;
uint32_t major;
struct EnshwickLayout input;
struct EnshwickLayout output;
} EnshwickCallSpec;
typedef struct EnshwickCallerFrame {
uint64_t rsp;
uint64_t rbx;
uint64_t rbp;
uint64_t rdi;
uint64_t rsi;
uint64_t r12;
uint64_t r13;
uint64_t r14;
uint64_t r15;
} EnshwickCallerFrame;
typedef uint32_t EnshwickChangeId;
typedef uint32_t EnshwickChangeOp;
#define EnshwickChangeOp_SET 0
#define EnshwickChangeOp_TIMES 1
#define EnshwickChangeOp_RESET 2
typedef struct EnshwickChunkData {
struct EnshwickHeader header;
uint32_t index;
uint32_t x;
uint32_t z;
uint32_t size;
} EnshwickChunkData;
typedef struct EnshwickComfort {
struct EnshwickHeader header;
uint32_t category;
int32_t value;
float position[3];
} EnshwickComfort;
typedef uint32_t EnshwickRecipeId;
typedef struct EnshwickCraftCheck {
struct EnshwickHeader header;
EnshwickEntity crafting_operator_id;
EnshwickEntity crafting_station_id;
EnshwickRecipeId recipe_id;
uint16_t recipe_amount;
uint16_t reserved;
} EnshwickCraftCheck;
typedef struct EnshwickDamageCheck {
struct EnshwickHeader header;
uint32_t cause;
EnshwickEntity target;
EnshwickEntity source;
EnshwickEntity attacker;
float amounts[ENSHWICK_DAMAGE_TYPES];
float total;
} EnshwickDamageCheck;
#define EnshwickDamageCheck_IMPACT 0
#define EnshwickDamageCheck_FALL_DAMAGE 1
#define EnshwickDamageCheck_FOG 2
#define EnshwickDamageCheck_DEADLY_FOG 3
#define EnshwickDamageCheck_SUFFOCATED 4
#define EnshwickDamageCheck_DROWNING_DEATH 5
#define EnshwickDamageCheck_FREEZING 6
#define EnshwickDamageCheck_ADMIN_KILL 7
typedef uint32_t EnshwickDataField;
#define EnshwickDataField_MAX_STACK 1
#define EnshwickDataField_RECIPE_OUTPUT 2
#define EnshwickDataField_RECIPE_COST 3
#define EnshwickDataField_RECIPE_INGREDIENT 4
#define EnshwickDataField_RECIPE_TIME 5
#define EnshwickDataField_CONTAINER_SLOTS 6
#define EnshwickDataField_DAMAGE_MOD 7
#define EnshwickDataField_SPEED_MOD 8
#define EnshwickDataField_ARMOR 9
#define EnshwickDataField_BURN_TIME 10
#define EnshwickDataField_ENERGY_OUTPUT 11
#define EnshwickDataField_COMFORT_AMOUNT 12
#define EnshwickDataField_LOOT_STACK_SIZE 13
#define EnshwickDataField_LOOT_COUNT 14
#define EnshwickDataField_LOOT_SPAWN_PROBABILITY 15
#define EnshwickDataField_LOOT_WEIGHT 16
#define EnshwickDataField_RECIPE_STATION 17
typedef uint32_t EnshwickDataSelect;
#define EnshwickDataSelect_ENTRY 0
#define EnshwickDataSelect_CATEGORY 1
#define EnshwickDataSelect_STACKABLE 2
#define EnshwickDataSelect_CONTAINERS 3
#define EnshwickDataSelect_RECIPE_KIND 4
#define EnshwickDataSelect_WORKSHOP 5
#define EnshwickDataSelect_BACKPACKS 6
typedef struct EnshwickDataChange {
struct EnshwickHeader header;
uint8_t entry[16];
EnshwickDataField field;
EnshwickChangeOp op;
double value;
struct EnshwickStr source;
uint8_t item[16];
EnshwickDataSelect select;
uint32_t categories;
} EnshwickDataChange;
typedef struct EnshwickDaytimeInfo {
struct EnshwickHeader header;
int64_t time;
int64_t day_start;
int64_t day_end;
int64_t day_length;
int64_t night_length;
float speed;
uint32_t flags;
} EnshwickDaytimeInfo;
#define EnshwickDaytimeInfo_DAY 1
typedef uint8_t EnshwickRelation;
#define EnshwickRelation_REQUIRES 0
#define EnshwickRelation_AFTER 1
#define EnshwickRelation_BREAKS 2
#define EnshwickRelation_RECOMMENDS 3
#define EnshwickRelation_REPLACES 4
#define EnshwickRelation_WAS 5
typedef struct EnshwickDependency {
struct EnshwickStr id;
struct EnshwickStr range;
EnshwickRelation relation;
} EnshwickDependency;
typedef uint32_t EnshwickEntityDataFlags;
#define EnshwickEntityDataFlags_NONE 0
#define EnshwickEntityDataFlags_SENT 1
typedef struct EnshwickEntityPlace {
EnshwickEntity entity;
uint32_t reserved;
int64_t position[3];
} EnshwickEntityPlace;
typedef uint32_t EnshwickEvent;
#define EnshwickEvent_SETTINGS_CHANGED 1
#define EnshwickEvent_LOADER_SETTINGS_CHANGED 2
#define EnshwickEvent_TICKED 3
#define EnshwickEvent_WORLD_LOADED 4
#define EnshwickEvent_WORLD_SAVED 5
#define EnshwickEvent_PLAYER_JOINED 6
#define EnshwickEvent_PLAYER_LEFT 7
#define EnshwickEvent_SHUTDOWN_STARTED 8
#define EnshwickEvent_BUILDING_PLACED 9
#define EnshwickEvent_BUILDING_REMOVED 10
#define EnshwickEvent_JOIN_REFUSED 11
#define EnshwickEvent_ALTARS_CHANGED 12
#define EnshwickEvent_DAY_STARTED 13
#define EnshwickEvent_NIGHT_STARTED 14
#define EnshwickEvent_KNOWLEDGE_CHANGED 15
#define EnshwickEvent_QUEST_COMPLETED 16
#define EnshwickEvent_CHUNK_LOADED 17
#define EnshwickEvent_CHUNK_UNLOADED 18
#define EnshwickEvent_SETTINGS_REPLACED 19
#define EnshwickEvent_PLAYER_DIED 20
typedef struct EnshwickEventSpec {
struct EnshwickHeader header;
struct EnshwickStr name;
struct EnshwickLayout layout;
} EnshwickEventSpec;
typedef struct EnshwickEventTypeInfo {
struct EnshwickHeader header;
struct EnshwickStr name;
uint32_t hash;
uint32_t size;
} EnshwickEventTypeInfo;
typedef struct EnshwickExperienceRow {
EnshwickEntity entity;
uint32_t level;
uint32_t progress;
uint32_t need;
uint32_t gained;
} EnshwickExperienceRow;
typedef struct EnshwickExperiencePass {
struct EnshwickHeader header;
struct EnshwickExperienceRow *rows;
size_t row_count;
uint32_t level_cap;
uint32_t (*need_for)(void *token, uint32_t level);
void *token;
} EnshwickExperiencePass;
typedef struct EnshwickFogInfo {
struct EnshwickHeader header;
uint32_t width;
uint32_t height;
float metres_per_pixel;
float size_z;
uint64_t version;
uint64_t session;
} EnshwickFogInfo;
typedef struct EnshwickGameEventData {
struct EnshwickHeader header;
uint32_t type_hash;
uint32_t size;
const uint8_t *data;
} EnshwickGameEventData;
typedef uint32_t EnshwickHookFlags;
#define EnshwickHookFlags_NONE 0
#define EnshwickHookFlags_EXCLUSIVE 1
#define EnshwickHookFlags_CALLER_FRAME 2
typedef struct EnshwickHookSpec {
uint64_t target;
size_t detour;
const uintptr_t *next;
int32_t priority;
EnshwickHookFlags flags;
} EnshwickHookSpec;
typedef uint32_t EnshwickStatus;
#define EnshwickStatus_OK 0
#define EnshwickStatus_MISSING 1
#define EnshwickStatus_AMBIGUOUS 2
#define EnshwickStatus_REFUSED 3
#define EnshwickStatus_BAD_ARGS 4
#define EnshwickStatus_TOO_LATE 5
#define EnshwickStatus_FAULTED 6
#define EnshwickStatus_WRONG_THREAD 7
#define EnshwickStatus_NOT_LOADED 8
#define EnshwickStatus_OUTSIDE_WORLD 9
#define EnshwickStatus_STATIC_HALF 10
#define EnshwickStatus_NOT_A_PROP 11
#define EnshwickStatus_NOT_KEPT 12
typedef size_t EnshwickModHandle;
#define EnshwickModHandle_NONE 0
typedef uint8_t EnshwickLevel;
#define EnshwickLevel_ERROR 0
#define EnshwickLevel_WARN 1
#define EnshwickLevel_INFO 2
#define EnshwickLevel_DEBUG 3
typedef struct EnshwickServiceSpec {
struct EnshwickHeader header;
struct EnshwickStr name;
uint32_t major;
struct EnshwickLayout layout;
const void *table;
} EnshwickServiceSpec;
typedef struct EnshwickServiceFound {
struct EnshwickHeader header;
const void *table;
uint32_t fields;
struct EnshwickStr owner;
struct EnshwickStr owner_version;
struct EnshwickStr reason;
} EnshwickServiceFound;
typedef void (*EnshwickEventFn)(EnshwickEvent event, const void *data, void *user);
typedef struct EnshwickResourceKey {
uint8_t guid[16];
uint32_t type_hash;
uint32_t part;
} EnshwickResourceKey;
typedef EnshwickStatus (*EnshwickResourcePatchFn)(const uint8_t *base,
size_t base_len,
void *user,
const uint8_t **out,
size_t *out_len);
typedef uint32_t EnshwickManifestFlags;
#define EnshwickManifestFlags_NONE 0
#define EnshwickManifestFlags_JOIN 1
#define EnshwickManifestFlags_RELOAD 2
typedef struct EnshwickModInfo {
struct EnshwickHeader header;
struct EnshwickStr id;
struct EnshwickStr version;
EnshwickSide side;
EnshwickManifestFlags flags;
uint8_t off;
struct EnshwickStr file;
struct EnshwickStr name;
struct EnshwickStr description;
const struct EnshwickStr *authors;
size_t author_count;
struct EnshwickStr license;
struct EnshwickStr homepage;
struct EnshwickStr replaced_by;
} EnshwickModInfo;
typedef struct EnshwickRenameCall {
struct EnshwickHeader header;
EnshwickEntity entity;
uint8_t known;
struct EnshwickPlayerInfo player;
struct EnshwickStr text;
} EnshwickRenameCall;
typedef uint8_t (*EnshwickRenameCallFn)(const struct EnshwickRenameCall *call, void *user);
typedef struct EnshwickRegisters {
uint64_t rax;
uint64_t rcx;
uint64_t rdx;
uint64_t rbx;
uint64_t rsp;
uint64_t rbp;
uint64_t rsi;
uint64_t rdi;
uint64_t r8;
uint64_t r9;
uint64_t r10;
uint64_t r11;
uint64_t r12;
uint64_t r13;
uint64_t r14;
uint64_t r15;
uint64_t rflags;
} EnshwickRegisters;
typedef void (*EnshwickMidHookFn)(struct EnshwickRegisters *registers, void *user);
typedef struct EnshwickMidHookSpec {
uint64_t address;
EnshwickMidHookFn handler;
void *user;
int32_t priority;
EnshwickHookFlags flags;
} EnshwickMidHookSpec;
typedef struct EnshwickItemData {
struct EnshwickHeader header;
EnshwickItemId id;
uint16_t max_stack;
uint8_t category;
uint8_t rarity;
uint32_t flags;
uint8_t placed_entity[16];
} EnshwickItemData;
#define EnshwickItemData_HAS_PIDE (1 << 1)
#define EnshwickItemData_IS_CONTAINER (1 << 2)
#define EnshwickItemData_IS_BLUEPRINT (1 << 3)
#define EnshwickItemData_USES_FUEL (1 << 13)
typedef struct EnshwickInventoryOp {
uint32_t kind;
uint32_t flags;
uint64_t target;
uint64_t other;
EnshwickItemId item;
uint32_t count;
} EnshwickInventoryOp;
#define EnshwickInventoryOp_GIVE 1
#define EnshwickInventoryOp_TAKE 2
#define EnshwickInventoryOp_DESTROY_SLOT 3
#define EnshwickInventoryOp_MOVE_SLOT 4
#define EnshwickInventoryOp_MOVE_ALL 5
#define EnshwickInventoryOp_INCLUDE_SPECIAL 1
#define EnshwickInventoryOp_RENEW 6
#define EnshwickInventoryOp_FILLED 2
typedef struct EnshwickInventoryRequest {
struct EnshwickHeader header;
uint32_t flags;
EnshwickEntity actor;
const struct EnshwickInventoryOp *ops;
uint32_t op_count;
uint32_t reserved;
} EnshwickInventoryRequest;
#define EnshwickInventoryRequest_ALLOW_PARTIAL 1
#define EnshwickInventoryRequest_NOTIFY 2
typedef struct EnshwickInventoryOpResult {
uint32_t error;
uint32_t remaining;
} EnshwickInventoryOpResult;
#define EnshwickInventoryOpResult_NOT_RUN 256
typedef struct EnshwickInventoryResult {
struct EnshwickHeader header;
uint32_t outcome;
uint32_t op_count;
const struct EnshwickInventoryOpResult *ops;
} EnshwickInventoryResult;
#define EnshwickInventoryResult_COMMITTED 0
#define EnshwickInventoryResult_ROLLED_BACK 1
#define EnshwickInventoryResult_UNAVAILABLE 2
#define EnshwickInventoryResult_TIMED_OUT 3
typedef void (*EnshwickInventoryResultFn)(const struct EnshwickInventoryResult *result, void *user);
typedef void (*EnshwickStatusFn)(void *user, struct EnshwickStr *out);
typedef uint8_t (*EnshwickBuildingZoneCheckFn)(const struct EnshwickBuildingZoneCheck *check,
void *user);
typedef struct EnshwickSurvivorLookup {
struct EnshwickHeader header;
EnshwickNpcId survivor;
EnshwickEntity vanilla;
uint32_t purpose;
EnshwickEntity entity;
int64_t cell[3];
EnshwickEntity (*bed_of)(void *token, EnshwickEntity entity);
void *token;
} EnshwickSurvivorLookup;
#define EnshwickSurvivorLookup_UNIQUENESS 1
#define EnshwickSurvivorLookup_SPAWN 2
#define EnshwickSurvivorLookup_BED_OWNER 3
#define EnshwickSurvivorLookup_ASSIGN_BED 4
#define EnshwickSurvivorLookup_PREVIOUS_OCCUPANT 5
#define EnshwickSurvivorLookup_ROAMING 6
#define EnshwickSurvivorLookup_BED_BINDING 7
#define EnshwickSurvivorLookup_CURSOR 8
typedef uint8_t (*EnshwickSurvivorLookupFn)(const struct EnshwickSurvivorLookup *call,
void *user,
EnshwickEntity *out);
typedef uint8_t (*EnshwickBedCheckFn)(const struct EnshwickBedCheck *check, void *user);
typedef struct EnshwickSummon {
struct EnshwickHeader header;
EnshwickItemId item;
EnshwickItemId ammo;
uint8_t template_[16];
int64_t target[3];
uint64_t slot;
EnshwickEntity pide;
uint16_t meter[2];
uint8_t consumed;
uint8_t reserved[3];
} EnshwickSummon;
#define EnshwickSummon_TAKE 1
#define EnshwickSummon_REFUSE 2
typedef uint8_t (*EnshwickSummonFn)(const struct EnshwickSummon *summon, void *user);
typedef uint32_t (*EnshwickSurvivorStatusFn)(EnshwickNpcId survivor,
const uint8_t *statuses,
size_t count,
void *user);
typedef struct EnshwickInteraction {
struct EnshwickHeader header;
uint32_t kind;
EnshwickEntity player;
EnshwickEntity target;
EnshwickItemId item;
uint8_t known;
uint8_t reserved[3];
double position[3];
} EnshwickInteraction;
#define EnshwickInteraction_OPEN 1
#define EnshwickInteraction_MOVE 2
#define EnshwickInteraction_SORT 3
#define EnshwickInteraction_STOCK 4
#define EnshwickInteraction_DISMANTLE 5
#define EnshwickInteraction_QUICK_STASH 6
#define EnshwickInteraction_UPGRADE 7
typedef uint8_t (*EnshwickInteractionFn)(const struct EnshwickInteraction *call, void *user);
typedef uint32_t EnshwickSkillNode;
typedef struct EnshwickSkillCheck {
struct EnshwickHeader header;
EnshwickSkillNode node;
uint32_t gate;
uint8_t unlocked;
uint8_t reserved[3];
} EnshwickSkillCheck;
#define EnshwickSkillCheck_OTHER 0
#define EnshwickSkillCheck_FLY_MODE 1
#define EnshwickSkillCheck_VANILLA 0
#define EnshwickSkillCheck_UNLOCKED 1
#define EnshwickSkillCheck_LOCKED 2
typedef uint8_t (*EnshwickSkillCheckFn)(const struct EnshwickSkillCheck *check, void *user);
typedef int32_t (*EnshwickComfortFn)(const struct EnshwickComfort *comfort, void *user);
typedef void (*EnshwickExperiencePassFn)(struct EnshwickExperiencePass *pass, void *user);
typedef void (*EnshwickGameEventFn)(const struct EnshwickGameEventData *event, void *user);
typedef struct EnshwickTeleportRequest {
struct EnshwickHeader header;
EnshwickEntity entity;
uint32_t flags;
int64_t position[3];
float orientation[4];
} EnshwickTeleportRequest;
#define EnshwickTeleportRequest_BEST_SPAWN 1
#define EnshwickTeleportRequest_ORIENTED 2
typedef struct EnshwickSpawnRequest {
struct EnshwickHeader header;
uint8_t template_[16];
int64_t position[3];
float orientation[4];
uint32_t level;
uint32_t reserved;
uint64_t lifetime_ns;
} EnshwickSpawnRequest;
typedef uint8_t (*EnshwickCraftCheckFn)(const struct EnshwickCraftCheck *call, void *user);
typedef uint8_t (*EnshwickBuildCheckFn)(const struct EnshwickBuildCheck *call, void *user);
typedef struct EnshwickNetMessage {
struct EnshwickHeader header;
uint32_t channel;
uint32_t reserved;
EnshwickPlayerKey peer;
const uint8_t *data;
uint32_t size;
uint32_t reserved_tail;
} EnshwickNetMessage;
#define EnshwickNetMessage_SERVER UINT64_MAX
typedef void (*EnshwickNetMessageFn)(const struct EnshwickNetMessage *message, void *user);
typedef void (*EnshwickDamageFilterFn)(struct EnshwickDamageCheck *check, void *user);
typedef uint32_t EnshwickKnowledgeId;
typedef struct EnshwickKnowledgeInfo {
struct EnshwickHeader header;
EnshwickKnowledgeId id;
uint8_t kind;
uint8_t scope;
uint16_t reserved;
uint32_t value;
uint32_t flags;
} EnshwickKnowledgeInfo;
#define EnshwickKnowledgeInfo_BOOL 0
#define EnshwickKnowledgeInfo_COUNTER 1
#define EnshwickKnowledgeInfo_FLAGS 2
#define EnshwickKnowledgeInfo_WORLD 0
#define EnshwickKnowledgeInfo_PLAYER 1
typedef struct EnshwickWeatherFront {
struct EnshwickHeader header;
uint32_t layer;
uint32_t effect;
int64_t position[3];
float radius;
uint32_t reserved;
int64_t remaining;
} EnshwickWeatherFront;
#define EnshwickWeatherFront_NONE 0
#define EnshwickWeatherFront_RAIN 1
#define EnshwickWeatherFront_BLIZZARD 2
typedef struct EnshwickTerrainMaterialInfo {
struct EnshwickHeader header;
uint8_t id;
uint8_t flags;
uint8_t hardness;
uint8_t reserved;
EnshwickItemId item;
int32_t health;
} EnshwickTerrainMaterialInfo;
#define EnshwickTerrainMaterialInfo_FLATTENS 1
typedef struct EnshwickTerrainEdit {
struct EnshwickHeader header;
uint32_t kind;
uint32_t shape;
uint32_t flags;
uint32_t material;
float position[3];
float radius;
float height;
uint8_t protect[16];
} EnshwickTerrainEdit;
#define EnshwickTerrainEdit_ADD 0
#define EnshwickTerrainEdit_DIG 1
#define EnshwickTerrainEdit_FLATTEN 2
#define EnshwickTerrainEdit_ROUND 0
#define EnshwickTerrainEdit_SQUARE 1
#define EnshwickTerrainEdit_DRY_RUN 1
typedef struct EnshwickUiFrame {
struct EnshwickHeader header;
uint64_t token;
uint32_t screen;
uint32_t reserved;
} EnshwickUiFrame;
#define EnshwickUiFrame_MENU 0
#define EnshwickUiFrame_LOADING 1
#define EnshwickUiFrame_IN_GAME 2
typedef void (*EnshwickUiFrameFn)(const struct EnshwickUiFrame *frame, void *user);
typedef struct EnshwickUiWidget {
struct EnshwickHeader header;
uint32_t kind;
uint32_t flags;
uint32_t style;
uint32_t steps;
struct EnshwickStr text;
struct EnshwickStr detail;
const struct EnshwickStr *options;
uint32_t option_count;
uint32_t index;
float value;
float min;
float max;
uint32_t result;
uint32_t anchor;
uint32_t reserved;
} EnshwickUiWidget;
#define EnshwickUiWidget_WINDOW 1
#define EnshwickUiWidget_END 2
#define EnshwickUiWidget_LABEL 3
#define EnshwickUiWidget_BUTTON 4
#define EnshwickUiWidget_TOGGLE 5
#define EnshwickUiWidget_SLIDER 6
#define EnshwickUiWidget_DROPDOWN 7
#define EnshwickUiWidget_PROGRESS 8
#define EnshwickUiWidget_SOUND 9
#define EnshwickUiWidget_READ_ONLY 1
#define EnshwickUiWidget_WRAP 2
#define EnshwickUiWidget_CENTER 4
#define EnshwickUiWidget_STYLE_BODY 0
#define EnshwickUiWidget_STYLE_SECONDARY 1
#define EnshwickUiWidget_STYLE_H1 2
#define EnshwickUiWidget_STYLE_H2 3
#define EnshwickUiWidget_STYLE_H3 4
#define EnshwickUiWidget_STYLE_WARNING 5
#define EnshwickUiWidget_STYLE_POSITIVE 6
#define EnshwickUiWidget_STYLE_NEGATIVE 7
#define EnshwickUiWidget_SOUND_CLICK 0
#define EnshwickUiWidget_SOUND_CONFIRM 1
#define EnshwickUiWidget_SOUND_BACK 2
#define EnshwickUiWidget_SOUND_ERROR 3
#define EnshwickUiWidget_TOP_LEFT 0
#define EnshwickUiWidget_TOP_CENTER 1
#define EnshwickUiWidget_TOP_RIGHT 2
#define EnshwickUiWidget_BOTTOM_LEFT 3
#define EnshwickUiWidget_BOTTOM_CENTER 4
#define EnshwickUiWidget_BOTTOM_RIGHT 5
typedef struct EnshwickUiDialog {
struct EnshwickHeader header;
struct EnshwickStr title;
struct EnshwickStr message;
struct EnshwickStr detail;
uint32_t buttons;
uint32_t flags;
} EnshwickUiDialog;
#define EnshwickUiDialog_RETRY 0
#define EnshwickUiDialog_DISABLE 1
#define EnshwickUiDialog_ERASE 2
#define EnshwickUiDialog_RESET 3
#define EnshwickUiDialog_OVERWRITE 5
#define EnshwickUiDialog_CANCEL 6
#define EnshwickUiDialog_OK 7
#define EnshwickUiDialog_IGNORE 8
#define EnshwickUiDialog_BUTTONS 495
#define EnshwickUiDialog_CLOSED UINT32_MAX
#define EnshwickUiDialog_WAITING 1
typedef void (*EnshwickUiAnswerFn)(uint32_t answer, void *user);
typedef struct EnshwickUiMarker {
struct EnshwickHeader header;
int64_t position[3];
struct EnshwickStr label;
uint32_t color;
uint32_t reserved;
} EnshwickUiMarker;
#define EnshwickUiMarker_WHITE 0
#define EnshwickUiMarker_RED 1
#define EnshwickUiMarker_GREEN 2
#define EnshwickUiMarker_BLUE 3
#define EnshwickUiMarker_YELLOW 4
#define EnshwickUiMarker_PURPLE 5
#define EnshwickUiMarker_TURQUOISE 6
#define EnshwickUiMarker_BLACK 7
typedef EnshwickStatus (*EnshwickConfigCheckFn)(struct EnshwickStr text,
struct EnshwickStr *why,
void *user);
typedef struct EnshwickStatDefData {
struct EnshwickHeader header;
uint8_t ty;
uint8_t format;
uint16_t reserved;
float default_;
float min;
float max;
struct EnshwickStr text;
} EnshwickStatDefData;
#define EnshwickStatDefData_ADDITIVE 0
#define EnshwickStatDefData_MULTIPLICATIVE 1
#define EnshwickStatDefData_FLAG 2
#define EnshwickStatDefData_NUMBER 0
#define EnshwickStatDefData_SIGNED 1
#define EnshwickStatDefData_PERCENT 2
typedef struct EnshwickStatRef {
uint32_t index;
uint32_t key;
} EnshwickStatRef;
typedef struct EnshwickStatModifierData {
uint32_t stat;
uint8_t op;
uint8_t reserved[3];
float value;
} EnshwickStatModifierData;
#define EnshwickStatModifierData_ADD 0
#define EnshwickStatModifierData_MULTIPLY 1
#define EnshwickStatModifierData_MAX 2
#define EnshwickStatModifierData_OVERRIDE 3
typedef struct EnshwickStatModify {
struct EnshwickHeader header;
EnshwickEntity entity;
uint32_t key;
struct EnshwickStatModifierData modifier;
uint32_t flags;
uint64_t duration_ms;
} EnshwickStatModify;
#define EnshwickStatModify_REMOVE 1
#define EnshwickStatModify_SAVED (1 << 1)
typedef struct EnshwickStatChange {
struct EnshwickHeader header;
EnshwickEntity entity;
struct EnshwickStatRef stat;
float old;
float new_;
uint32_t reserved;
} EnshwickStatChange;
typedef void (*EnshwickStatChangeFn)(const struct EnshwickStatChange *change, void *user);
typedef struct EnshwickStatSource {
uint8_t kind;
uint8_t op;
uint16_t reserved;
uint32_t stat;
float value;
uint32_t id;
uint32_t owner;
} EnshwickStatSource;
#define EnshwickStatSource_ITEM 0
#define EnshwickStatSource_BUFF 1
#define EnshwickStatSource_ENTITY 2
typedef void (*EnshwickModEventFn)(const void *data, void *user);
typedef struct EnshwickItemLine {
struct EnshwickStatModifierData modifier;
uint32_t affix;
} EnshwickItemLine;
typedef struct EnshwickMigrationStep {
uint32_t kind;
struct EnshwickStr from;
struct EnshwickStr to;
uint8_t from_guid[16];
uint8_t to_guid[16];
} EnshwickMigrationStep;
#define EnshwickMigrationStep_RENAME_SETTING 1
#define EnshwickMigrationStep_MAP_SETTING 2
#define EnshwickMigrationStep_REMOVE_SETTING 3
#define EnshwickMigrationStep_RENAME_STORE 4
#define EnshwickMigrationStep_MAP_STORE 5
#define EnshwickMigrationStep_RENAME_CONTENT 6
#define EnshwickMigrationStep_TAKE_SETTING 7
typedef struct EnshwickMigration {
struct EnshwickStr id;
const struct EnshwickMigrationStep *steps;
uint32_t count;
} EnshwickMigration;
typedef struct EnshwickMigrationSet {
struct EnshwickHeader header;
const struct EnshwickMigration *migrations;
uint32_t count;
EnshwickStatus (*map)(void *user,
uint32_t migration,
uint32_t step,
struct EnshwickStr input,
struct EnshwickStr *out);
void *user;
} EnshwickMigrationSet;
typedef struct EnshwickKnowledgeInput {
struct EnshwickHeader header;
EnshwickEntity player;
EnshwickKnowledgeId id;
uint8_t kind;
uint8_t scope;
uint16_t reserved;
uint32_t value;
uint32_t refusal;
uint32_t allowed;
} EnshwickKnowledgeInput;
#define EnshwickKnowledgeInput_NO_SCOPE 255
#define EnshwickKnowledgeInput_ALLOWED 0
#define EnshwickKnowledgeInput_UNKNOWN 1
#define EnshwickKnowledgeInput_KIND 2
#define EnshwickKnowledgeInput_WORLD 3
#define EnshwickKnowledgeInput_COUNTER 4
#define EnshwickKnowledgeInput_FLAG_BIT 5
#define EnshwickKnowledgeInput_EXPERIENCE 6
#define EnshwickKnowledgeInput_SKILL_POINTS 7
#define EnshwickKnowledgeInput_QUEST 8
typedef uint8_t (*EnshwickKnowledgeInputFn)(const struct EnshwickKnowledgeInput *call, void *user);
typedef uint32_t EnshwickRecipeRuleKind;
#define EnshwickRecipeRuleKind_RECIPE 0
#define EnshwickRecipeRuleKind_OUTPUT 1
#define EnshwickRecipeRuleKind_WORKSHOP 2
typedef uint32_t EnshwickPointMode;
#define EnshwickPointMode_OBSERVE 0
#define EnshwickPointMode_ADVISE 1
#define EnshwickPointMode_OVERRIDE 2
typedef uint32_t EnshwickPointFlags;
#define EnshwickPointFlags_NONE 0
#define EnshwickPointFlags_REFUSE 1
typedef struct EnshwickPointSpec {
struct EnshwickHeader header;
struct EnshwickStr name;
EnshwickPointMode mode;
EnshwickPointFlags flags;
struct EnshwickLayout input;
struct EnshwickLayout output;
} EnshwickPointSpec;
typedef struct EnshwickPointHandle {
struct EnshwickHeader header;
uint32_t id;
const uint32_t *live;
} EnshwickPointHandle;
typedef struct EnshwickPointLink {
struct EnshwickHeader header;
const struct EnshwickPointSpec *point;
const struct EnshwickStr *before;
const struct EnshwickStr *after;
uint32_t before_count;
uint32_t after_count;
int32_t priority;
} EnshwickPointLink;
typedef uint32_t EnshwickPointVerdict;
#define EnshwickPointVerdict_PASS 0
#define EnshwickPointVerdict_SET 1
#define EnshwickPointVerdict_REFUSE 2
#define EnshwickPointVerdict_PANICKED 3
typedef EnshwickPointVerdict (*EnshwickPointFn)(const void *input, void *value, void *user);
typedef void (*EnshwickActionFn)(const struct EnshwickActionCall *call,
void *user,
struct EnshwickStr *reply);
typedef uint32_t EnshwickRecipeKind;
#define EnshwickRecipeKind_OTHER 0
#define EnshwickRecipeKind_BUILDING_BLOCK 1
#define EnshwickRecipeKind_ROOF 2
#define EnshwickRecipeKind_OVERGROWTH 3
#define EnshwickRecipeKind_TERRAIN 4
#define EnshwickRecipeKind_DECORATIVE 5
#define EnshwickRecipeKind_COMFORT_FURNITURE 6
typedef uint32_t EnshwickRateId;
#define EnshwickRateId_EXPERIENCE_COMBAT 1
#define EnshwickRateId_EXPERIENCE_MINING 2
#define EnshwickRateId_EXPERIENCE_EXPLORATION_QUESTS 3
#define EnshwickRateId_FACTORY_PRODUCTION_SPEED 4
#define EnshwickRateId_RESOURCE_DROP_STACK_AMOUNT 5
#define EnshwickRateId_COMFORT 6
#define EnshwickRateId_SKILL_POINTS 7
#define EnshwickRateId_LOOT 8
typedef struct EnshwickLoopWaitData {
struct EnshwickHeader header;
uint32_t ms;
uint32_t reserved;
int64_t left_ns;
} EnshwickLoopWaitData;
typedef void (*EnshwickLoopWaitFn)(const struct EnshwickLoopWaitData *wait, void *user);
typedef uint32_t EnshwickLoopWaitSites;
#define EnshwickLoopWaitSites_NONE 0
#define EnshwickLoopWaitSites_HANDLES 1
#define EnshwickLoopWaitSites_MESSAGES 2
typedef void (*EnshwickServerWaitFn)(uint64_t *wait_ns, void *user);
typedef void (*EnshwickAltarZoneFn)(struct EnshwickAltarZone *zone, void *user);
typedef void (*EnshwickAltarLimitFilterFn)(struct EnshwickAltarLimit *limit, void *user);
typedef struct EnshwickVoxel {
uint8_t kind;
uint8_t material;
uint8_t fill;
uint8_t reserved;
} EnshwickVoxel;
#define EnshwickVoxel_AIR 0
#define EnshwickVoxel_TERRAIN 1
#define EnshwickVoxel_BUILDING 2
#define EnshwickVoxel_READ_MAX ((64 * 64) * 64)
#define EnshwickVoxel_END (1 << 30)
typedef struct EnshwickTransactionOp {
uint32_t kind;
uint32_t reserved;
const void *data;
} EnshwickTransactionOp;
#define EnshwickTransactionOp_TERRAIN 1
#define EnshwickTransactionOp_VOXELS 2
#define EnshwickTransactionOp_ERASE 3
#define EnshwickTransactionOp_BLOCK 4
#define EnshwickTransactionOp_PLACE_PROP 5
#define EnshwickTransactionOp_REMOVE_PROP 6
typedef struct EnshwickTransactionInfo {
struct EnshwickHeader header;
uint32_t state;
EnshwickStatus reason;
uint32_t ops;
uint32_t applied;
uint64_t bricks;
uint32_t refusal;
uint32_t reserved;
uint32_t holds;
uint32_t created;
} EnshwickTransactionInfo;
#define EnshwickTransactionInfo_PENDING 0
#define EnshwickTransactionInfo_APPLIED 1
#define EnshwickTransactionInfo_UNDOING 2
#define EnshwickTransactionInfo_UNDONE 3
#define EnshwickTransactionInfo_FAILED 4
#define EnshwickTransactionInfo_EXPIRED 5
#define EnshwickTransactionInfo_HOLDS_INVENTORY 1
#define EnshwickTransactionInfo_HOLDS_GROWTH (1 << 1)
#define EnshwickTransactionInfo_HOLDS_FACTORY_STATION (1 << 2)
#define EnshwickTransactionInfo_HOLDS_NPC_BED (1 << 3)
#define EnshwickTransactionInfo_HOLDS_STORE_ASSOCIATED_NPC_IDS (1 << 4)
#define EnshwickTransactionInfo_HOLDS_CUSTOM_PLAYER_STRING (1 << 5)
#define EnshwickTransactionInfo_HOLDS_FUEL (1 << 6)
#define EnshwickTransactionInfo_HOLDS_LOGIC_GRAPH_NODE_CONNECTED (1 << 7)
#define EnshwickTransactionInfo_HOLDS_LOGIC_GRAPH_TRIGGER (1 << 8)
#define EnshwickTransactionInfo_UNDO_REFUSED 6
typedef EnshwickStatus (*EnshwickCallFn)(const void *input, void *output, void *user);
typedef struct EnshwickMapMarkerInfo {
struct EnshwickHeader header;
double position[3];
uint8_t marker_type[16];
uint8_t label[16];
} EnshwickMapMarkerInfo;
typedef uint32_t EnshwickTickHandle;
typedef struct EnshwickMapFrameInfo {
struct EnshwickHeader header;
double origin[2];
double size[2];
double metres_per_cell;
} EnshwickMapFrameInfo;
typedef struct EnshwickHostApi {
struct EnshwickHeader header;
struct EnshwickStr host_version;
void (*build)(struct EnshwickBuildInfo *out);
EnshwickStatus (*symbol)(EnshwickModHandle me, struct EnshwickStr name, uint64_t *out);
EnshwickStatus (*system)(struct EnshwickStr name, uint64_t *out);
EnshwickStatus (*field_offset)(struct EnshwickStr type_name,
struct EnshwickStr field,
uint64_t *out);
EnshwickStatus (*type_size)(struct EnshwickStr type_name, uint32_t *out);
EnshwickStatus (*hook)(EnshwickModHandle me, const struct EnshwickHookSpec *spec);
void (*caller_frame)(struct EnshwickCallerFrame *out);
void (*fault)(EnshwickModHandle me, struct EnshwickStr reason);
void (*log)(EnshwickModHandle me, EnshwickLevel level, struct EnshwickStr message);
EnshwickStatus (*settings)(EnshwickModHandle me,
struct EnshwickStr defaults,
struct EnshwickStr *out);
EnshwickStatus (*publish)(EnshwickModHandle me, const struct EnshwickServiceSpec *spec);
EnshwickStatus (*service)(EnshwickModHandle me,
const struct EnshwickServiceSpec *wanted,
struct EnshwickServiceFound *out);
EnshwickStatus (*constant)(EnshwickModHandle me, struct EnshwickStr name, uint64_t *out);
EnshwickStatus (*data_dir)(EnshwickModHandle me, struct EnshwickStr *out);
EnshwickLevel (*log_level)(EnshwickModHandle me);
EnshwickStatus (*subscribe)(EnshwickModHandle me,
EnshwickEvent event,
EnshwickEventFn callback,
void *user);
EnshwickStatus (*type_hash)(struct EnshwickStr type_name, uint32_t *out);
EnshwickStatus (*component)(EnshwickModHandle me,
EnshwickEntity entity,
uint32_t type_hash,
const void **out);
EnshwickStatus (*entity_template)(EnshwickModHandle me, EnshwickEntity entity, uint8_t (*out)[16]);
EnshwickStatus (*player)(EnshwickModHandle me,
EnshwickEntity entity,
struct EnshwickPlayerInfo *out);
EnshwickStatus (*players)(EnshwickModHandle me,
struct EnshwickPlayerInfo *out,
uint32_t capacity,
uint32_t *count);
EnshwickStatus (*serve_resource)(EnshwickModHandle me,
const struct EnshwickResourceKey *key,
const struct EnshwickResourceKey *base,
EnshwickResourcePatchFn patch,
void *user);
EnshwickStatus (*add_text)(EnshwickModHandle me,
uint32_t id,
uint32_t language,
struct EnshwickStr text);
EnshwickStatus (*mods)(EnshwickModHandle me,
struct EnshwickModInfo *out,
uint32_t entry_size,
uint32_t capacity,
uint32_t *count);
EnshwickStatus (*sync)(EnshwickModHandle me, struct EnshwickStr synced, struct EnshwickStr *out);
EnshwickStatus (*code_range)(uint64_t *start, uint64_t *len);
EnshwickStatus (*patch_code)(EnshwickModHandle me,
uint64_t address,
const uint8_t *expected,
const uint8_t *replacement,
size_t len);
uint32_t (*workshop_recipes)(void);
uint8_t (*hosting)(void);
uint64_t (*server_world)(void);
EnshwickStatus (*chat)(EnshwickModHandle me, EnshwickPlayerKey to, struct EnshwickStr text);
EnshwickStatus (*set_label)(EnshwickModHandle me, EnshwickEntity entity, struct EnshwickStr text);
EnshwickStatus (*rename_filter)(EnshwickModHandle me, EnshwickRenameCallFn callback, void *user);
EnshwickStatus (*join_missing)(EnshwickModHandle me,
struct EnshwickModInfo *out,
uint32_t entry_size,
uint32_t capacity,
uint32_t *count);
EnshwickStatus (*hook_at)(EnshwickModHandle me, const struct EnshwickMidHookSpec *spec);
EnshwickStatus (*inventory_open)(EnshwickModHandle me);
EnshwickStatus (*item_info)(EnshwickModHandle me,
EnshwickItemId item,
struct EnshwickItemData *out);
EnshwickStatus (*inventory_submit)(EnshwickModHandle me,
const struct EnshwickInventoryRequest *request,
EnshwickInventoryResultFn done,
void *user);
EnshwickStatus (*status)(EnshwickModHandle me, EnshwickStatusFn callback, void *user);
EnshwickStatus (*run_console)(EnshwickModHandle me,
struct EnshwickStr line,
struct EnshwickStr *out);
EnshwickStatus (*altars_open)(EnshwickModHandle me);
EnshwickStatus (*altars)(EnshwickModHandle me,
struct EnshwickAltarInfo *out,
uint32_t entry_size,
uint32_t capacity,
uint32_t *count);
EnshwickStatus (*building_zone_check_filter)(EnshwickModHandle me,
EnshwickBuildingZoneCheckFn callback,
void *user);
EnshwickStatus (*survivor_lookup)(EnshwickModHandle me,
EnshwickSurvivorLookupFn callback,
void *user);
EnshwickStatus (*survivor_bed_check)(EnshwickModHandle me, EnshwickBedCheckFn callback, void *user);
EnshwickStatus (*summon_filter)(EnshwickModHandle me, EnshwickSummonFn callback, void *user);
EnshwickStatus (*summon_item)(EnshwickModHandle me, EnshwickItemId item, EnshwickNpcId survivor);
EnshwickStatus (*survivor_status)(EnshwickModHandle me,
EnshwickSurvivorStatusFn callback,
void *user);
EnshwickStatus (*interaction_filter)(EnshwickModHandle me,
EnshwickInteractionFn callback,
void *user);
EnshwickStatus (*skill_override)(EnshwickModHandle me,
EnshwickSkillNode node,
EnshwickSkillCheckFn callback,
void *user);
EnshwickStatus (*comfort_filter)(EnshwickModHandle me, EnshwickComfortFn callback, void *user);
EnshwickStatus (*experience_filter)(EnshwickModHandle me,
EnshwickExperiencePassFn callback,
void *user);
EnshwickStatus (*raise_base_limit)(EnshwickModHandle me);
EnshwickStatus (*base_zones)(EnshwickModHandle me, uint32_t *zones, uint32_t *bases);
EnshwickStatus (*game_event)(EnshwickModHandle me,
uint32_t type_hash,
EnshwickGameEventFn callback,
void *user);
EnshwickStatus (*entities)(EnshwickModHandle me,
uint32_t type_hash,
struct EnshwickEntityPlace *out,
uint32_t capacity,
uint32_t *count);
EnshwickStatus (*destroy)(EnshwickModHandle me, EnshwickEntity entity);
EnshwickStatus (*save_world)(EnshwickModHandle me);
EnshwickStatus (*world_key)(EnshwickModHandle me, struct EnshwickStr *out);
EnshwickStatus (*component_write)(EnshwickModHandle me,
EnshwickEntity entity,
uint32_t type_hash,
void **out);
EnshwickStatus (*emit)(EnshwickModHandle me,
uint32_t type_hash,
const uint8_t *data,
uint32_t size);
EnshwickStatus (*teleport)(EnshwickModHandle me, const struct EnshwickTeleportRequest *request);
EnshwickStatus (*spawn)(EnshwickModHandle me,
const struct EnshwickSpawnRequest *request,
EnshwickEntity *out);
EnshwickStatus (*craft_filter)(EnshwickModHandle me, EnshwickCraftCheckFn callback, void *user);
EnshwickStatus (*build_filter)(EnshwickModHandle me, EnshwickBuildCheckFn callback, void *user);
EnshwickStatus (*net_channel)(EnshwickModHandle me,
struct EnshwickStr name,
EnshwickNetMessageFn callback,
void *user,
uint32_t *out);
EnshwickStatus (*net_send)(EnshwickModHandle me,
uint32_t channel,
EnshwickPlayerKey peer,
const uint8_t *data,
uint32_t size);
EnshwickStatus (*net_ready)(EnshwickModHandle me, EnshwickPlayerKey peer);
EnshwickStatus (*notify)(EnshwickModHandle me, EnshwickPlayerKey key, struct EnshwickStr text);
EnshwickStatus (*time_of_day)(EnshwickModHandle me, struct EnshwickDaytimeInfo *out);
EnshwickStatus (*set_time_of_day)(EnshwickModHandle me, int64_t time);
EnshwickStatus (*time_speed_control)(EnshwickModHandle me);
EnshwickStatus (*set_time_speed)(EnshwickModHandle me, float factor);
EnshwickStatus (*game_settings)(EnshwickModHandle me,
uint8_t *out,
uint32_t size,
uint32_t *preset);
EnshwickStatus (*set_game_settings)(EnshwickModHandle me, const uint8_t *data, uint32_t size);
EnshwickStatus (*damage_filter)(EnshwickModHandle me, EnshwickDamageFilterFn callback, void *user);
EnshwickStatus (*buff_types)(EnshwickModHandle me,
struct EnshwickBuffTypeInfo *out,
uint32_t capacity,
uint32_t *count);
EnshwickStatus (*buffs)(EnshwickModHandle me,
EnshwickEntity entity,
struct EnshwickActiveBuff *out,
uint32_t capacity,
uint32_t *count);
EnshwickStatus (*apply_buff)(EnshwickModHandle me, const struct EnshwickBuffRequest *request);
EnshwickStatus (*remove_buff)(EnshwickModHandle me,
EnshwickEntity entity,
EnshwickBuffTypeId id,
uint8_t *removed);
EnshwickStatus (*knowledge)(EnshwickModHandle me,
EnshwickEntity entity,
EnshwickKnowledgeId id,
struct EnshwickKnowledgeInfo *out);
EnshwickStatus (*grant_knowledge)(EnshwickModHandle me,
EnshwickEntity entity,
EnshwickKnowledgeId id,
uint32_t kind,
uint32_t value);
EnshwickStatus (*quests)(EnshwickModHandle me,
EnshwickKnowledgeId *out,
uint32_t capacity,
uint32_t *count);
EnshwickStatus (*weather_at)(EnshwickModHandle me, const int64_t (*position)[3], float (*out)[4]);
EnshwickStatus (*weather_fronts)(EnshwickModHandle me,
struct EnshwickWeatherFront *out,
uint32_t capacity,
uint32_t *count);
EnshwickStatus (*set_weather)(EnshwickModHandle me, uint32_t effect, int64_t duration);
EnshwickStatus (*terrain_materials)(EnshwickModHandle me,
struct EnshwickTerrainMaterialInfo *out,
uint32_t capacity,
uint32_t *count);
EnshwickStatus (*terrain_edit)(EnshwickModHandle me,
const struct EnshwickTerrainEdit *edit,
float *amount);
EnshwickStatus (*config_schema)(EnshwickModHandle me, struct EnshwickStr schema);
EnshwickStatus (*summoned)(EnshwickModHandle me, EnshwickSummonFn callback, void *user);
EnshwickStatus (*item_data_open)(EnshwickModHandle me, struct EnshwickStr id, uint32_t *out);
EnshwickStatus (*item_data_get)(EnshwickModHandle me,
uint32_t kind,
EnshwickEntity pide,
EnshwickItemId item,
uint8_t *out,
uint32_t capacity,
uint32_t *len);
EnshwickStatus (*item_data_set)(EnshwickModHandle me,
uint32_t kind,
EnshwickEntity pide,
EnshwickItemId item,
const uint8_t *data,
uint32_t len);
EnshwickStatus (*ui_frame)(EnshwickModHandle me, EnshwickUiFrameFn callback, void *user);
EnshwickStatus (*ui_widget)(EnshwickModHandle me, uint64_t frame, struct EnshwickUiWidget *widget);
EnshwickStatus (*ui_dialog)(EnshwickModHandle me,
const struct EnshwickUiDialog *dialog,
EnshwickUiAnswerFn callback,
void *user);
EnshwickStatus (*ui_hud)(EnshwickModHandle me, EnshwickUiFrameFn callback, void *user);
EnshwickStatus (*ui_markers)(EnshwickModHandle me,
const struct EnshwickUiMarker *markers,
uint32_t count);
EnshwickStatus (*config_check)(EnshwickModHandle me, EnshwickConfigCheckFn callback, void *user);
EnshwickStatus (*texts)(EnshwickModHandle me, struct EnshwickStr toml);
EnshwickStatus (*content_serve)(EnshwickModHandle me,
const uint8_t *data,
uint32_t len,
uint32_t (*out)[4]);
EnshwickStatus (*content_read)(EnshwickModHandle me,
const uint32_t (*hash)[4],
uint8_t *out,
uint32_t capacity,
uint32_t *len);
EnshwickStatus (*icons_ready)(EnshwickModHandle me);
EnshwickStatus (*stat_open)(EnshwickModHandle me,
struct EnshwickStr id,
const struct EnshwickStatDefData *def,
struct EnshwickStatRef *out);
EnshwickStatus (*stat_info)(EnshwickModHandle me,
uint32_t stat,
struct EnshwickStatDefData *def,
struct EnshwickStr *id);
EnshwickStatus (*stat_value)(EnshwickModHandle me,
EnshwickEntity entity,
uint32_t stat,
float *out);
EnshwickStatus (*stat_modify)(EnshwickModHandle me, const struct EnshwickStatModify *request);
EnshwickStatus (*stat_buff)(EnshwickModHandle me,
uint32_t buff,
const struct EnshwickStatModifierData *modifiers,
uint32_t count);
EnshwickStatus (*stats_changed)(EnshwickModHandle me, EnshwickStatChangeFn callback, void *user);
EnshwickStatus (*stat_sources)(EnshwickModHandle me,
EnshwickEntity entity,
uint32_t stat,
struct EnshwickStatSource *out,
uint32_t capacity,
uint32_t *count);
EnshwickStatus (*stat_watch)(EnshwickModHandle me, EnshwickEntity entity, uint8_t watch);
EnshwickStatus (*define_event)(EnshwickModHandle me,
const struct EnshwickEventSpec *spec,
uint32_t *out);
EnshwickStatus (*subscribe_event)(EnshwickModHandle me,
const struct EnshwickEventSpec *spec,
EnshwickModEventFn callback,
void *user);
EnshwickStatus (*send_event)(EnshwickModHandle me, uint32_t event, const void *data);
EnshwickStatus (*affix_open)(EnshwickModHandle me,
struct EnshwickStr id,
const struct EnshwickAffixDefData *def,
struct EnshwickStatRef *out);
EnshwickStatus (*affix_roll)(EnshwickModHandle me,
const struct EnshwickAffixRoll *roll,
uint32_t *count);
EnshwickStatus (*item_lines)(EnshwickModHandle me,
EnshwickEntity pide,
EnshwickItemId item,
struct EnshwickItemLine *out,
uint32_t capacity,
uint32_t *count);
EnshwickStatus (*affix_info)(EnshwickModHandle me,
uint32_t affix,
struct EnshwickStr *text,
uint8_t *rarity);
EnshwickStatus (*migrate)(EnshwickModHandle me, const struct EnshwickMigrationSet *set);
EnshwickStatus (*declare_content)(EnshwickModHandle me, struct EnshwickStr id, uint8_t (*out)[16]);
EnshwickStatus (*entity_data_open)(EnshwickModHandle me,
struct EnshwickStr id,
EnshwickEntityDataFlags flags,
uint32_t *out);
EnshwickStatus (*replaced)(EnshwickModHandle me,
struct EnshwickModInfo *out,
uint32_t entry_size,
uint32_t capacity,
uint32_t *count);
EnshwickStatus (*knowledge_input_filter)(EnshwickModHandle me,
EnshwickKnowledgeInputFn callback,
void *user);
uint32_t (*language)(EnshwickModHandle me);
EnshwickStatus (*keep_game_settings)(EnshwickModHandle me,
const uint8_t *data,
const uint8_t *mask,
uint32_t size);
EnshwickStatus (*forget_game_settings)(EnshwickModHandle me);
EnshwickStatus (*revoke_knowledge)(EnshwickModHandle me,
EnshwickEntity entity,
EnshwickKnowledgeId id,
uint32_t kind,
uint32_t value);
EnshwickStatus (*account_knowledge)(EnshwickModHandle me,
EnshwickPlayerKey key,
EnshwickKnowledgeId id,
uint32_t kind,
uint32_t value,
uint32_t revoke);
EnshwickStatus (*resource_read)(EnshwickModHandle me,
const struct EnshwickResourceKey *key,
uint8_t *out,
uint32_t capacity,
uint32_t *len);
EnshwickStatus (*game_text)(EnshwickModHandle me,
uint32_t id,
uint32_t language,
struct EnshwickStr *out);
EnshwickStatus (*rebuild_resource)(EnshwickModHandle me, const struct EnshwickResourceKey *key);
EnshwickStatus (*recipe_rule)(EnshwickModHandle me,
EnshwickRecipeRuleKind kind,
struct EnshwickStr name,
uint32_t disable);
EnshwickStatus (*recipe_disabled)(EnshwickModHandle me, EnshwickRecipeId recipe, uint32_t *out);
EnshwickStatus (*define_point)(EnshwickModHandle me,
const struct EnshwickPointSpec *spec,
struct EnshwickPointHandle *out);
EnshwickStatus (*attach_point)(EnshwickModHandle me,
const struct EnshwickPointLink *link,
EnshwickPointFn callback,
void *user);
EnshwickStatus (*run_point)(EnshwickModHandle me,
uint32_t point,
const void *input,
void *value,
EnshwickPointVerdict *verdict);
EnshwickStatus (*actions)(EnshwickModHandle me, EnshwickActionFn callback, void *user);
EnshwickStatus (*event_types)(EnshwickModHandle me,
struct EnshwickEventTypeInfo *out,
uint32_t capacity,
uint32_t *count);
EnshwickStatus (*recipe_kind)(EnshwickModHandle me, EnshwickItemId item, EnshwickRecipeKind *out);
EnshwickStatus (*feature)(EnshwickModHandle me, struct EnshwickStr name, struct EnshwickStr off);
EnshwickStatus (*rate)(EnshwickModHandle me, EnshwickRateId rate);
EnshwickStatus (*set_rate)(EnshwickModHandle me, EnshwickRateId rate, float factor);
EnshwickStatus (*change_data)(EnshwickModHandle me, const struct EnshwickDataChange *change);
EnshwickStatus (*loop_wait)(EnshwickModHandle me,
EnshwickLoopWaitFn callback,
void *user,
EnshwickLoopWaitSites *found);
EnshwickStatus (*server_wait)(EnshwickModHandle me,
EnshwickServerWaitFn callback,
void *user,
uint32_t *found);
EnshwickStatus (*task_workers)(EnshwickModHandle me,
uint32_t foreground,
uint32_t background,
uint32_t *found);
EnshwickStatus (*altar_zone_filter)(EnshwickModHandle me, EnshwickAltarZoneFn callback, void *user);
EnshwickStatus (*altar_zones_changed)(EnshwickModHandle me);
EnshwickStatus (*altar_limit_filter)(EnshwickModHandle me,
EnshwickAltarLimitFilterFn callback,
void *user);
EnshwickStatus (*base_limit)(EnshwickModHandle me, struct EnshwickBaseLimitInfo *out);
EnshwickStatus (*voxel_read)(EnshwickModHandle me,
const uint32_t (*min)[3],
const uint32_t (*size)[3],
struct EnshwickVoxel *out,
uint64_t capacity);
EnshwickStatus (*declare_change)(EnshwickModHandle me,
const struct EnshwickDataChange *change,
EnshwickChangeId *out);
EnshwickStatus (*set_change)(EnshwickModHandle me,
EnshwickChangeId id,
EnshwickChangeOp op,
double value);
EnshwickStatus (*build_rights)(EnshwickModHandle me, struct EnshwickBuildRights *check);
EnshwickStatus (*transaction_commit)(EnshwickModHandle me,
const struct EnshwickTransactionOp *ops,
uint32_t count,
uint64_t *id);
EnshwickStatus (*transaction_undo)(EnshwickModHandle me, uint64_t id);
EnshwickStatus (*transaction_status)(EnshwickModHandle me,
uint64_t id,
struct EnshwickTransactionInfo *out);
EnshwickStatus (*transaction_commit_for)(EnshwickModHandle me,
EnshwickEntity actor,
const struct EnshwickTransactionOp *ops,
uint32_t count,
uint64_t *id);
EnshwickStatus (*world_quiet)(EnshwickModHandle me);
EnshwickStatus (*fog_open)(EnshwickModHandle me);
EnshwickStatus (*fog_read)(EnshwickModHandle me,
struct EnshwickFogInfo *info,
uint32_t x,
uint32_t y,
uint32_t width,
uint32_t height,
uint8_t *out,
uint32_t capacity);
EnshwickStatus (*serve_call)(EnshwickModHandle me,
const struct EnshwickCallSpec *spec,
EnshwickCallFn callback,
void *user);
EnshwickStatus (*find_call)(EnshwickModHandle me,
const struct EnshwickCallSpec *spec,
uint32_t *out);
EnshwickStatus (*call)(EnshwickModHandle me, uint32_t id, const void *input, void *output);
EnshwickStatus (*transaction_entities)(EnshwickModHandle me,
uint64_t id,
EnshwickEntity *out,
uint32_t capacity,
uint32_t *count);
EnshwickStatus (*world_persists)(EnshwickModHandle me,
const double (*min)[3],
const double (*max)[3],
uint8_t *kept);
EnshwickStatus (*map_markers)(EnshwickModHandle me,
struct EnshwickMapMarkerInfo *out,
uint32_t entry_size,
uint32_t capacity,
uint32_t *count);
EnshwickStatus (*account_action)(EnshwickModHandle me,
EnshwickAccountActionType action,
EnshwickPlayerKey account);
EnshwickStatus (*allowlist_set)(EnshwickModHandle me, EnshwickPlayerKey account, uint8_t listed);
EnshwickStatus (*allowlist_has)(EnshwickModHandle me, EnshwickPlayerKey account, uint8_t *listed);
EnshwickStatus (*subscribe_tick)(EnshwickModHandle me,
uint64_t every_nanos,
EnshwickEventFn callback,
void *user,
EnshwickTickHandle *out);
EnshwickStatus (*set_tick_every)(EnshwickModHandle me,
EnshwickTickHandle handle,
uint64_t every_nanos);
EnshwickStatus (*map_frame)(EnshwickModHandle me, struct EnshwickMapFrameInfo *out);
EnshwickStatus (*request_base_limits)(EnshwickModHandle me, uint32_t zones, uint32_t bases);
} EnshwickHostApi;
typedef struct EnshwickKnowledgeData {
struct EnshwickHeader header;
EnshwickEntity entity;
EnshwickKnowledgeId id;
uint32_t value;
} EnshwickKnowledgeData;
typedef struct EnshwickManifest {
struct EnshwickHeader header;
struct EnshwickStr id;
struct EnshwickStr version;
EnshwickSide side;
EnshwickManifestFlags flags;
const struct EnshwickDependency *dependencies;
size_t dependency_count;
const struct EnshwickBuildRow *builds;
size_t build_count;
struct EnshwickStr name;
struct EnshwickStr description;
const struct EnshwickStr *authors;
size_t author_count;
struct EnshwickStr license;
struct EnshwickStr homepage;
struct EnshwickStr points;
} EnshwickManifest;
typedef struct EnshwickPlayerData {
struct EnshwickHeader header;
uint32_t slot;
EnshwickEntity entity;
EnshwickPlayerKey key;
} EnshwickPlayerData;
typedef struct EnshwickPlayerDeathData {
struct EnshwickHeader header;
EnshwickEntity entity;
uint32_t cause;
EnshwickPlayerKey key;
float position[3];
uint8_t cause_guid[16];
uint8_t was_deadly_fog;
uint8_t drowned;
uint16_t reserved;
EnshwickEntity killer_entity;
uint32_t reserved_tail;
} EnshwickPlayerDeathData;
#define EnshwickPlayerDeathData_IMPACT 0
#define EnshwickPlayerDeathData_FALL_DAMAGE 1
#define EnshwickPlayerDeathData_FOG 2
#define EnshwickPlayerDeathData_SUFFOCATED 3
typedef struct EnshwickPropPlace {
struct EnshwickHeader header;
EnshwickItemId item;
uint32_t reserved;
double position[3];
float orientation[4];
} EnshwickPropPlace;
typedef struct EnshwickPropRemove {
struct EnshwickHeader header;
EnshwickEntity entity;
uint32_t flags;
} EnshwickPropRemove;
#define EnshwickPropRemove_DISCARD_STATE 1
typedef struct EnshwickQuestData {
struct EnshwickHeader header;
EnshwickEntity entity;
EnshwickKnowledgeId quest;
} EnshwickQuestData;
typedef struct EnshwickTickData {
struct EnshwickHeader header;
uint64_t step;
uint64_t elapsed_steps;
uint64_t elapsed_nanos;
uint64_t step_nanos;
uint64_t cost_nanos;
} EnshwickTickData;
typedef struct EnshwickVoxelRegion {
struct EnshwickHeader header;
uint32_t min[3];
uint32_t size[3];
} EnshwickVoxelRegion;
typedef struct EnshwickVoxelWrite {
struct EnshwickHeader header;
uint32_t min[3];
uint32_t size[3];
const struct EnshwickVoxel *voxels;
uint64_t count;
} EnshwickVoxelWrite;
#if defined(_WIN32)
#define ENSHWICK_EXPORT __declspec(dllexport)
#else
#define ENSHWICK_EXPORT
#endif
#define ENSHWICK_STR_INIT(literal) { (const uint8_t *)(literal), sizeof(literal) - 1 }
#ifdef __cplusplus
extern "C" {
#endif
ENSHWICK_EXPORT uint32_t enshwick_mod_abi(void);
ENSHWICK_EXPORT const EnshwickManifest *enshwick_mod_query(void);
ENSHWICK_EXPORT EnshwickStatus enshwick_mod_init(const EnshwickHostApi *host, EnshwickModHandle me);
ENSHWICK_EXPORT void enshwick_mod_ready(const EnshwickHostApi *host, EnshwickModHandle me);
ENSHWICK_EXPORT void enshwick_mod_shutdown(void);
#ifdef __cplusplus
}
#endif
#endif