Skip to content

Instantly share code, notes, and snippets.

@remeniuk
Created September 10, 2013 19:33
Show Gist options
  • Save remeniuk/6514425 to your computer and use it in GitHub Desktop.
Save remeniuk/6514425 to your computer and use it in GitHub Desktop.
package com.embudo.loader.api;
enum Status {
OK = 1;
INVALID_REQUEST = 2;
ERROR = 3;
}
enum RequestType {
LOGIN = 1;
TRACK_USER = 2;
TRACK_USERS = 3;
TRACK_PURCHASE = 4;
TRACK_EVENT = 5;
TRACK_EVENTS = 6;
GET_PROMOTIONS = 7;
}
message Request {
required unit32 requestType = 1;
required bytes dataBytes = 2;
required string api_key = 3;
optional string session_id = 4;
optional uint32 sequence_number = 5;
}
message Response {
required unit32 requestType = 1;
required bytes dataBytes = 2;
required Status status = 3;
optional string error_message = 4;
optional string session_id = 5;
optional uint32 sequence_number = 6;
}
message Users {
repeated User users = 1;
}
message User {
required uint64 application_user_id = 1;
optional string nick_name = 2;
optional string login = 3;
optional string first_name = 4;
optional string last_name = 5;
optional string e_mail = 6;
optional uint32 age = 7;
optional bool gender = 8;
optional string lang_code = 9;
optional string country = 10;
optional uint64 registration_date = 11;
repeated string custom_params = 12;
}
// any item, NPC, reference to other player
message Item {
required uint64 item_id = 1;
required string item_type = 2;
required string name = 3;
optional string description = 4;
repeated string custom_params = 5;
}
message Events {
repeated Event events = 1;
}
message Event {
required uint32 event_type = 1;
required uint64 timestamp = 2;
optional Item item = 3;
optional int32 amount = 4;
repeated string custom_params = 5;
}
message Purchase {
required Item item = 1;
required uint32 amount = 2;
required uint32 price = 3;
required uint64 timestamp = 4;
}
message Login {
required string application_user_id = 1;
optional uint64 timestamp = 2;
optional string platform = 3;
optional string ip = 4;
repeated string custom_params = 5;
}
message TransferProgress {
required uint32 progress = 1;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment