syntax = "proto3";

package protocol;

// Define services

service GeneralService {
    // Get server info from server.
    //
    // This parameter actually doesn't accept any arguments,
    // but it is still required owing to Protobuf grammar.
    rpc GetServerInfo(Empty) returns (ServerInfo);
}

service GameService {
    rpc Login(LoginRequest) returns (LoginResponse);
    rpc Signup(SignupRequest) returns (SignupResponse);
}

// Define messages

enum RequestResult {
    Success = 0;
    Fail = 1;
}

message Empty {}

message ServerInfo {
    string Lang = 1;
    string ver = 2;
}

message LoginRequest {
    string Username = 1;
    string Password = 2;
}

message LoginResponse {
    RequestResult result = 1;
    string message = 2;
}

message SignupRequest {
    string Username = 1;
    string Password = 2;
}

message SignupResponse {
    RequestResult result = 1;
    string message = 2;
}