syntax = "proto3";

package rpc_proto;

import "rpc_error.proto";

message Cookie
{
	bytes				name = 1;
	bytes				value = 2;
	uint64				expirytime = 3;
}

message Token
{
	string				value = 1;
	uint64				expirytime = 2;
}

//所有验证性、必带性的属性
message RpcHeader
{
	//uid相关
	uint64				userid = 1;
	Cookie				ticket = 2;						//验证ticket，服务器返回session
	Cookie				session = 3;					//验证uid session
	Token				utoken = 16;					//验证utoken
	
	//角色相关
	string				roleid = 4;						//角色id
	string				rsid = 5;						//角色sessionid

	//其他属性
	uint32				platform = 6;					//平台
	string				channel = 7;					//app channel
	string				appversion = 8;					//版本号
	string				deviceid = 9;					//设备id

	//请求属性
	string				request_name = 10;				//请求名字
	uint32				request_cmd = 11;				//请求cmd

	//rpc auth 结果
	uint32				auth_ret = 12;					//验证结果
	string				auth_reason = 13;				//验证返回错误结果描述

	ErrorCode			rsp_err = 14;					//应答统一返回错误
	uint32				client_seq = 15;				//客户端seq
}

message RpcAuthReq
{
	string				request_name = 1;				//请求验证的function
}

message RpcKeepaliveReq
{}

message RpcKeepaliveRsp
{}
