BinarySpecifications

Aggregate Repository of all Binary File Format Specifications I have released.

View on GitHub

Gac14 Faction Info Descriptor Specification v 1.0

The Gac14 Faction Info Descriptor Format is based upon the LCLib Binary IO Specification, and uses exclusively the Big-Endian Byte Order Mode. The LCLib Binary IO Specification can be found here.

Rejecting files

At given points Implementations MUST, SHOULD, or MAY Reject a file.

Files which are Rejected MUST NOT be loaded and SHOULD be discarded by the Implementation.

If an a MUST/MUST NOT requirement is broken by a file, then the Implementation MUST Reject that file.

If a SHOULD/SHOULD NOT requirement is broken by a file, then the Implementation SHOULD reject that file.

Implementations MUST NOT generate files which it would reject.

It MUST be possible for at least one Faction Info Descriptor file to be created for any given Implemenation, such that the Implementation would not reject that file.

Descriptor Structure

A Gac14 Faction Info Descriptor consists of 4 parts, a header, the member list, claim list, and the faction stats info.

The format of the file is a follows:

struct faction_descriptor{
	faction_head head;
	members_list members;
	claims_list claims;
	faction_stats stats;
	byte sha256[32];
}

head is the header of the descriptor and indicates basic info about the faction as well as declares the format.

members lists the members of the faction as well as any relations with other factions.

The header is described by the following structure

struct faction_head{
	byte magic[4];
	version ver;
	uuid factionId;
	uuid owner;
	string factionName;
	string factionDescription;
}

magic MUST be exactly the bytes [FF 46 49 44].

ver indicates the version which is supported. The Current version of the specification is 1.0 (indicated by the bytes [00 00]). Implementations MAY support any number of released versions of the specification, and MUST support all versions previous to each of those versions in the same Major Version. Implementations MUST reject files that indicates an unsupported version or a version which has not been released.

factionId is the UUID of the Faction. owner is the UUID of the player who created the faction (or who the ownership of the faction was transfered to). If factionId is the nil UUID (00000000-0000-0000-0000-000000000000), then owner MUST also be the nil UUID. Otherwise owner MUST NOT be the nil UUID.

factionName is the Tag name of the Faction, and is parsed the same way that the <text> blob for /tellraw <text> is parsed.

factionDescription is the Description of the Faction, and is parsed as above.

Member List

The Member List is described by the following structure

struct member_list{
	byte memberCount;
	struct member{
		uuid playerId;
		string role;
		byte roleId;
	} members[memberCount];
	ushort relationsCount;
	struct relation{
		uuid factionId;
		byte relationKind;
	} relations[relationsCount];
}

playerId in the member structure or factionId in the relation structure MUST NOT be the NIL UUID.

roleId indicates the role of the player, where 0 is the lowest (member), and 255 is the highest (owner).

role is parsed as though it was the <text> component of /tellraw <text>.

There MUST be exactly one member of the faction which has roleId 255, unless owner is the NIL UUID. This member must have the playerId equal to the owner.

relationKind MUST be either 0 (enemy), 1 (neutral), 2 (truce), or 3 (ally).

Implementations MAY Impose any limits on the number of members of a Faction, and the number of any give kind of relation. Implementations SHOULD reject files which violate these limits.

The player indicated by playerId does not have to have ever joined (or even be capable of joining) the server which the implementation applies to, or even have to exist or be a valid player UUID. Implementations MAY reject files which do not follow these rules, however.

Claims List

The Claims list is described by the following structure:

struct claims_list{
	ushort count;
	struct claim{
		uuid zoneId;
		ushort collectedChunks;
	} claims[count];
};

zoneId MUST indicate the id of a valid Worldguard Zone. collectedChunks MUST be the total number of chunks which the zone indicated by zoneId affects.

If Worldguard Zones are not supported, then Implementations MAY use a different system to track the permissions and area of claims. Otherwise count SHOULD be 0.

Faction Stats

A Factions Stats are described by the following structure:

struct faction_stats{
	ushort totalPower;
	ushort maxPower;
	ushort totalLand;
	byte flags;
	instant createdOn;
};

totalPower is the total ammount of power the Faction Currently has. This is computed by summing the member power across members_list.members.

maxPower is the total maximum power the faction has. This is computed by summing the maximum member power across member_list.members.

totalLand is the power be spent on maintaining land.

flags is a set of flags that indicate various information about the Faction. The following flags may be set in the faction. All other flags MUST NOT be set.

Flag Name Description
0x01 Peaceful If set, the faction is peaceful (see Gac14 Specification, `[commands.faction.peaceful]` for details)
0x02 Unraidable If set, the faction cannot be raided. This usually set by default for factions that are younger than a certain period of time (see Gac14 Specification, `[gameplay.factions.raid]` for details)