|
| 1 | +syntax = "proto3"; |
| 2 | +import "common/data_type.proto"; |
| 3 | +import "common/common_player.proto"; |
| 4 | +import "common/common_plot.proto"; |
| 5 | + |
| 6 | +option java_package = "com.mcdiamondfire.proto.messages.clientbound.plot"; |
| 7 | +option java_multiple_files = true; |
| 8 | + |
| 9 | +// Sent when the player joins a plot. |
| 10 | +message S2CPlotInfo { |
| 11 | + // Represents a player in a plot. |
| 12 | + message PlotPlayer { |
| 13 | + string user_name = 1; // The name of the player. |
| 14 | + string user_uuid = 2; // The UUID of the player (36 characters including dashes). |
| 15 | + bool is_owner = 3; // Whether the player is the owner of the plot. |
| 16 | + bool is_developer = 4; // Whether the player has developer permissions on the plot. |
| 17 | + bool is_builder = 5; // Whether the player has builder permissions on the plot. |
| 18 | + PlayerMode mode = 6; // The mode the player is in. |
| 19 | + } |
| 20 | + |
| 21 | + int32 id = 1; // The identifier of the plot. |
| 22 | + string name = 2; // The name of the plot as a serialized component in JSON format. |
| 23 | + string owner_name = 3; // The name of the owner of the plot. |
| 24 | + string owner_uuid = 4; // The UUID of the owner of the plot (36 characters including dashes). |
| 25 | + int32 plot_size = 5; // The size of the plot (1 = Basic, 2 = Large, 3 = Massive, 4 = Mega). |
| 26 | + Region build_region = 6; // The build region of the plot. |
| 27 | + Region code_region = 7; // The code region of the plot. |
| 28 | + Region spawn_pos = 8; // The spawn location of the plot. |
| 29 | + bool is_owner = 11; // Whether the player is the owner of the plot. |
| 30 | + bool is_developer = 12; // Whether the player has developer permissions on the plot, is an administrator, or is the support member in a session. |
| 31 | + bool is_builder = 13; // Whether the player has builder permissions on the plot, is an administrator, or is the support member in a session. |
| 32 | + repeated PlotTag tags = 14; // The tags of this plot (e.g. "adventure", "combat", ...). |
| 33 | + string handle = 15; // The handle of the plot, or empty if none is set. |
| 34 | + repeated PlotPlayer players = 16; // The players currently on the plot. |
| 35 | +} |
| 36 | + |
| 37 | +// Sent as a response to a C2SCodeOperation message, |
| 38 | +// error is true if the operation failed (see each operation for details), |
| 39 | +// template is not empty only if a get operation succeeded. |
| 40 | +message S2CCodeOperationResult { |
| 41 | + // Represents an error that occurred while performing a code operation. |
| 42 | + enum Error { |
| 43 | + NONE = 0; // No error, the operation succeeded. |
| 44 | + NO_PERMISSION = 1; // The player does not have developer permissions on the plot. |
| 45 | + NO_LOCATION = 2; // No location was provided for an operation that requires one. |
| 46 | + INVALID_LOCATION = 3; // The provided location is not within the code region of the plot or is an invalid code block position. |
| 47 | + NO_ACTION = 4; // No action was provided for an operation that requires one. |
| 48 | + ACTION_NOT_FOUND = 5; // The provided action or line starter was not found on the plot. |
| 49 | + NO_LOCATION_OR_TEMPLATE = 6; // Either a location or a template were not provided for an operation that requires both. |
| 50 | + INVALID_LOCATION_OR_TEMPLATE = 7; // The provided location is invalid or the provided template is not a valid code template. |
| 51 | + TEMPLATE_NOT_FIT = 8; // The provided template does not fit in the code region at the provided location. |
| 52 | + INVALID_TEMPLATE = 10; // The provided template is not a valid code template. |
| 53 | + INTERNAL_ERROR = 9; // An internal error occurred while performing the operation. |
| 54 | + NO_OPERATION = 11; // No operation was provided. |
| 55 | + } |
| 56 | + |
| 57 | + oneof result { |
| 58 | + Error error = 1; // true if the operation failed, false otherwise |
| 59 | + string template = 2; // The template JSON string, only if a get operation succeeded. |
| 60 | + } |
| 61 | +} |
| 62 | + |
| 63 | +// Sent as a response to a C2SMultiCodeOperations message, |
| 64 | +// contains the results of all operations requested. |
| 65 | +message S2CMultiCodeOperationsResult { |
| 66 | + repeated S2CCodeOperationResult results = 1; // The results of all operations requested. |
| 67 | +} |
| 68 | + |
| 69 | +// Sent when the player joins a plot, |
| 70 | +// requires the player to have developer permissions on the plot. |
| 71 | +message S2CPlotLineStarters { |
| 72 | + repeated CodeLineStarter line_starter = 1; // The line starters on the plot. |
| 73 | +} |
| 74 | + |
| 75 | +// Sent when a line starter is added or removed from the plot, |
| 76 | +// requires the player to have developer permissions on the plot. |
| 77 | +message S2CPlotLineStarterUpdate { |
| 78 | + // Represents an action performed on a line starter. |
| 79 | + enum Action { |
| 80 | + ADD = 0; // A line starter was added. |
| 81 | + REMOVE = 1; // A line starter was removed. |
| 82 | + } |
| 83 | + CodeLineStarter line_starter = 1; // The line starter that was added or removed. |
| 84 | + Action action = 2; // The action performed. |
| 85 | +} |
| 86 | + |
| 87 | +// Sent when the plot finishes a lag measurement, |
| 88 | +// requires the player to have developer permissions on the plot, |
| 89 | +// and be profiling the plot. |
| 90 | +message S2CPlotProfiling { |
| 91 | + int32 cpu_usage = 1; // The CPU usage of the plot in percentage (0 to 100). |
| 92 | +} |
0 commit comments