Skip to content

NameLayer API

Maxopoly edited this page Jul 12, 2020 · 4 revisions

WIP WIP WIP

NameLayer General info

Requests general group information. In response to this the server will send a NameLayer info packet.

{
  "type": "nl-info",
  "identifier": "UNIQUE_IDENTIFIER"
  "subscribe_invites": "true"
}

NameLayer Group info

Requests information specific to a group In response to this the server will send a NameLayer group info packet.

{
  "type": "nl-groupinfo",
  "identifier": "UNIQUE_IDENTIFIER",
  "group": "Hjaltland"
}

NameLayer Handle Invite

Replies to a group invitation In response to this the server will send a NameLayer confirmation packet.

{
  "type": "nl-handleinvite",
  "identifier": "UNIQUE_IDENTIFIER",
  "group": "Hjaltland",
  "accept": "true"
}

NameLayer Toggle Autoaccept Invites

Toggles whether you will auto accept invites No reply will be sent to this packet

{
  "type": "nl-autoaccept",
  "state": "true"
}

NameLayer Invite

Allows you to invite a player to a group In response to this the server will send a NameLayer confirmation packet. Rank is optional, if not specified the default invitation rank for this group will be used. Player may be specified by name or UUID

{
  "type": "nl-invite",
  "identifier": "UNIQUE_IDENTIFIER",
  "group": "Hjaltland",
  "player": "Maxopoly",
  "rank": "Owner"
}

NameLayer Kick Player

Allows you to kick a player from a group In response to this the server will send a NameLayer confirmation packet. Player may be specified by name or UUID

{
  "type": "nl-kick",
  "identifier": "UNIQUE_IDENTIFIER",
  "group": "Hjaltland",
  "player": "Maxopoly"
}

NameLayer Blacklist Player

Allows you to blacklist a player from a group In response to this the server will send a NameLayer confirmation packet. Player may be specified by name or UUID

{
  "type": "nl-blacklist",
  "identifier": "UNIQUE_IDENTIFIER",
  "group": "Hjaltland",
  "rank": "Banished"
  "player": "Thoths_Librarian"
}

NameLayer Change Player Rank

Allows you to change a players rank in a group In response to this the server will send a NameLayer confirmation packet. Player may be specified by name or UUID

{
  "type": "nl-changerank",
  "identifier": "UNIQUE_IDENTIFIER",
  "group": "Hjaltland",
  "player": "Maxopoly",
  "rank": "Owner"
}

NameLayer Delete group

Allows you to delete a group In response to this the server will send a NameLayer confirmation packet.

{
  "type": "nl-deletegroup",
  "identifier": "UNIQUE_IDENTIFIER",
  "group": "Hjaltland"
}

NameLayer Rename group

Allows you to rename a group In response to this the server will send a NameLayer confirmation packet.

{
  "type": "nl-renamegroup",
  "identifier": "UNIQUE_IDENTIFIER",
  "group": "Hjaltland",
  "new_name": "Falstadt"
}

NameLayer Set group password

Allows you to change a groups password In response to this the server will send a NameLayer confirmation packet.

{
  "type": "nl-setpassword",
  "identifier": "UNIQUE_IDENTIFIER",
  "group": "Hjaltland"
  "password": "squids69"
}

NameLayer Merge group

Allows you to merge a group into another In response to this the server will send a NameLayer confirmation packet.

{
  "type": "nl-merge",
  "identifier": "UNIQUE_IDENTIFIER",
  "group_to_keep": "Hjaltland",
  "group_to_remove": "Falstadt"
}

NameLayer Leave group

Allows you to leave a group In response to this the server will send a NameLayer confirmation packet.

{
  "type": "nl-leave",
  "identifier": "UNIQUE_IDENTIFIER",
  "group": "Hjaltland"
}

NameLayer Create group

Creates a group In response to this the server will send a NameLayer confirmation packet.

{
  "type": "nl-creategroup",
  "identifier": "UNIQUE_IDENTIFIER",
  "group": "Hjaltland"
}

NameLayer Create rank

Creates a new rank for a group In response to this the server will send a NameLayer confirmation packet.

{
  "type": "nl-createrank",
  "identifier": "UNIQUE_IDENTIFIER",
  "group": "Hjaltland",
  "rank": "Chad"
}

NameLayer Rename rank

Renames a rank for a group In response to this the server will send a NameLayer confirmation packet.

{
  "type": "nl-renamerank",
  "identifier": "UNIQUE_IDENTIFIER",
  "group": "Hjaltland",
  "rank": "Chad",
  "new_name": "Gigachad"
}

NameLayer Delete rank

Deletes a rank from a group In response to this the server will send a NameLayer confirmation packet.

{
  "type": "nl-deleterank",
  "identifier": "UNIQUE_IDENTIFIER",
  "group": "Hjaltland",
  "rank": "Chad",
}

NameLayer Modify permission

Modifies a permission for a rank in a group In response to this the server will send a NameLayer confirmation packet.

{
  "type": "nl-modifyperm",
  "identifier": "UNIQUE_IDENTIFIER",
  "group": "Hjaltland",
  "rank": "Chad",
  "permission": "REINFORCE",
  "state": "true"
}

NameLayer Add link

Adds a link from one rank in a group to a rank in another group In response to this the server will send a NameLayer confirmation packet.

{
  "type": "nl-addlink",
  "identifier": "UNIQUE_IDENTIFIER",
  "source_group": "Hjaltland",
  "source_rank": "Chad",
  "target_group": "Falstadt",
  "target_rank": "Winner"
}

NameLayer Remove link

Removes a link from one rank in a group to a rank in another group In response to this the server will send a NameLayer confirmation packet.

{
  "type": "nl-removelink",
  "identifier": "UNIQUE_IDENTIFIER",
  "source_group": "Hjaltland",
  "source_rank": "Chad",
  "target_group": "Falstadt",
  "target_rank": "Winner"
}

NameLayer Subscribe updates

Subscribes to group changes, which will be sent in group change packets Will be replied to with a subscribed group packet

{
  "type": "nl-subscribe",
  "identifier": "UNIQUE_IDENTIFIER",
  "groups": ["Hjaltand", "Falstadt", "VRA"]
}

NameLayer Unsubscribe updates

Unsubscribes from group changes packets for certain groups Will be replied to with a subscribed group packet

{
  "type": "nl-unsubscribe",
  "identifier": "UNIQUE_IDENTIFIER",
  "groups": ["Hjaltand", "Falstadt", "VRA"]
}

Will be sent in reply to TODO info packet.

{
  "type": "nl-inforeply",
  "identifier": "UNIQUE_IDENTIFIER",
  "groups": 
  {
    {
       "name": "Hjaltland",
       "rank": "Owner"
    },
    {
       "name": "Falstadt",
       "rank": "Owner"
    },
    {
       "name": "Yoahtl",
       "rank": "Member"
    }
  },
  "auto_accept_invites": "true",
  "invites":
  {
    {
       "name": "VRA",
       "rank": "Admin"
    },
    {
       "name": "Alpha",
       "rank": "Mod"
    }
  }
}

Will be sent in reply to TODO group info packet. The members, blacklist and open_invites sections will only include the players with ranks you have listing permissions for. If a rank does not specify a parent, it is either the root node if it is not a blacklist rank or inheriting from the default non-member type if it is a blacklist rank. The permissions section will always contain at least the permissions for the players own rank, but only more if the player has sufficient permission. Action_log will only be included if you have permission to see it.

{
  "type": "nl-groupinforeply",
  "identifier": "UNIQUE_IDENTIFIER",
  "visible_ranks":
  {
    {
       "name": "Owner",
       "blacklisted": "false",
    },
    {
       "name": "Admin",
       "blacklisted": "false",
       "parent": "Owner"
    },
    {
       "name": "Mod",
       "blacklisted": "false",
       "parent": "Admin"
    },
    {
       "name": "Member",
       "blacklisted": "false",
       "parent": "Mod"
    },
    {
       "name": "Banished",
       "blacklisted": "true",
    }
  },
  "members": 
  {
    {
       "name": "Frensin",
       "rank": "Owner"
    },
    {
       "name": "Maxopoly",
       "rank": "Owner"
    },
    {
       "name": "tankbuster44",
       "rank": "Admin"
    }
  },
  "blacklist": 
  {
    {
       "name": "Thoths_Librarian",
       "rank": "Banished"
    }
  },
  "open_invites":
  {
    {
       "name": "tankbuster44",
       "rank": "Owner"
    }
  }
  "permissions":
  {
    {
       "rank": "Owner",
       "permissions": ["REINFORCE","CHAT"]
    },
    {
       "rank": "Admin",
       "permissions": ["CHAT"]
    },
    ...
  },
  action_log:
  {
    {
       "time": "1543456000" //UNIX in ms
       "type": "Invite",
       "player": "Frensin",
       "rank": "Owner",
       "cause": "Maxopoly"
    },
    ...
  }
}

NameLayer confirmation packet

Sent in reply to a group edit.

Result will be one of the following: "SUCCESS", "INSUFFICIENT_PERMISSION", "GROUP_NAME_TAKEN", "RANK_NAME_TAKEN", "NOT_INVITED", "GROUP_DOES_NOT_EXIST", "RANK_DOES_NOT_EXIST", "PLAYER_DOES_NOT_EXIST", "PLAYER_NOT_A_MEMBER", "PLAYER_IS_MEMBER","NO_CHANGES_MADE", "FAILURE"

Message is individual to the type of request made and may provide additional information

{
  "type": "nl-reply",
  "identifier": "UNIQUE_IDENTIFIER",
  "result": "SUCCESS",
  "message": "All good",
}

Subscribed group packet

Sent in reply to subscribing/unsubscribing from groups

{
  "type": "nl-subscribereply",
  "identifier": "UNIQUE_IDENTIFIER",
  "groups": ["Mir","AoN"]
}

Group update

Sent for groups you have subscribed to

{
  "type": "nl-groupsub",
  "group": "Hjaltland",
  "change_type": "invite_player",
  "player": "Frensin",
  "rank": "Owner"
  "cause": "Maxopoly"
}

Invite received

Sent when you are subscribed to group invitations and invited to a group

{
  "type": "nl-invitereceived",
  "group": "Hjaltland",
  "rank": "Owner"
  "auto_accepted": "true"
}

Invite revoked

Sent when you are subscribed to group invitations and an invite for you is revoked

{
  "type": "nl-inviterevoked",
  "group": "Hjaltland",
  "rank": "Owner"
}