import "client2world_msg_type.proto";
import "msg_type_def.proto";
import "msg_info_def.proto";

package client2world_protocols;

//连接世界
/*message packetc2w_player_connect {
	optional e_server_msg_type packet_id = 1 [default = e_mst_c2w_player_connect];	
	optional string account = 2;
	optional string token = 3;	
	optional string sign = 4;
	optional string platform = 5 [default = "dwc_def"]; 
	optional string pay_platform = 6 [default = "dwc_def"]; 
	optional string channel = 7 [default = "0"];
}

//连接返回
message packetw2c_player_connect_result {
	optional e_server_msg_type packet_id = 1 [default = e_mst_w2c_player_connect_result];	
	optional msg_type_def.e_msg_result_def result = 2 [default = e_rmt_fail];
	optional int32 servertime = 3;//服务器时间
	optional int32 gaming = 4[default = 0];//是否在游戏中
	optional string ver = 5;//当前游戏版本
}*/

//请求时间同步
message packet_c2w_timesync {
	optional e_server_msg_type packet_id = 1 [default = e_mst_c2w_timesync];
}

//
message packet_w2c_timesync_result {
	optional e_server_msg_type packet_id = 1 [default = e_mst_w2c_timesync_result];	
	optional int32 server_time = 2;
}

// 请求玩家大厅数据
message packetc2w_ask_login {
	optional e_server_msg_type packet_id = 1 [default = e_mst_c2w_asklogin];	
}

message msg_game_info{
	optional int32 gameid = 1;	//游戏id
	optional int32 gamever = 2;		//游戏版本

	optional int32 curOnlineNum = 3;		//当前在线人数
}
// 请求玩家大厅数据结果
message packetw2c_ask_login_result {
	optional e_server_msg_type packet_id = 1 [default = e_mst_w2c_asklogin_result];	
	optional msg_info_def.msg_account_info account_info = 2;	//账号信息
	repeated msg_game_info game_list = 3;	//游戏列表
	optional int32 gaming = 4[default = 0];//正在进行的游戏id
}

// 请求进入游戏大厅
message packetc2w_enter_game{
	optional e_server_msg_type packet_id = 1 [default = e_mst_c2w_enter_game];	
	optional int32 gameid = 2;		//游戏id
	optional int32 gamever = 3;		//游戏版本 （校验玩家客户端）

	optional int32 roomId = 4;		//房间id
}

// 请求进入游戏大厅返回
message packetw2c_enter_game_result {
	optional e_server_msg_type packet_id = 1 [default = e_mst_w2c_enter_game_result];	
	optional msg_type_def.e_msg_result_def result = 2 [default = e_rmt_fail];	
}

//gm命令
message packetc2w_gm_command {
	optional e_server_msg_type packet_id = 1 [default = e_mst_c2w_command];	
	optional string command = 2;
}

message packetw2c_gm_command_result {
	optional e_server_msg_type packet_id = 1 [default = e_mst_w2c_command_result];	
	optional msg_type_def.e_msg_result_def result = 2 [default = e_rmt_fail];
}

//请求发起支付
message packetc2w_ask_for_pay {
	optional e_server_msg_type packet_id = 1 [default = e_mst_c2w_ask_for_pay];	
	optional string channel = 2;
	optional int32 pay_code = 3;  
	optional string pay_type = 4;   // anysdk, ysdk, xunlei
}

message packetw2c_ask_for_pay_result {
	optional e_server_msg_type packet_id = 1 [default = e_mst_w2c_ask_for_pay_result];	
	optional msg_type_def.e_msg_result_def result = 2 [default = e_rmt_fail];
	optional string order_id = 3;   // 订单号
}

//请求验证支付
message packetc2w_ask_check_payment{
	optional e_server_msg_type packet_id = 1 [default = e_mst_c2w_ask_check_payment];	
	optional string orderid = 2;	
	optional bool ex_mark = 3[default=false];	//扩展标志

	// 本次支付方式
	optional string payType = 4; 
}

//请求测试支付
message packetc2w_ask_test_payment{
	optional e_server_msg_type packet_id = 1 [default = e_mst_c2w_ask_test_payment];	
	optional int32 payid = 2;   //对应RechangeCFG的id
	optional bool ex_mark = 3[default=false];	//扩展标志
}

//返回
message packetw2c_ask_check_payment_result{
	optional e_server_msg_type packet_id = 1 [default = e_mst_w2c_ask_check_payment_result];	
	optional int32 payid = 2;   //对应RechangeCFG的id
	optional bool result = 3[default = true];
	optional int32 gold_count = 4[default = 0];  // 充值得到金币总额
	optional int32 ticket_count = 5[default = 0];  // 充值得到的钻石总额

	repeated msg_info_def.ItemInfo rewardItem = 9;
	repeated msg_info_def.ActivityItemInfo activityItem = 10;	//活动特殊道具
}

//免费礼包
message packetc2w_free_gift_payment{
	optional e_server_msg_type packet_id = 1 [default = e_mst_c2w_free_gift_payment];	
	optional int32 payid = 2;   //对应RechangeCFG的id
	optional bool ex_mark = 3[default=false];	//扩展标志
}

//打开礼包
message packetc2w_open_gift{
	optional e_server_msg_type packet_id = 1 [default = e_mst_c2w_open_gift];	
	optional int32 giftId = 2;
}

message packetw2c_open_gift_result{
	optional e_server_msg_type packet_id = 1 [default = e_mst_w2c_open_gift_result];	
	optional int32 result = 2;
	optional int32 giftId = 3;
}

//请求退出小游戏
message packetc2w_leave_game{
	optional e_server_msg_type packet_id = 1 [default = e_mst_c2w_leave_game];	
}

//退出小游戏返回
message packetw2c_leave_game_result {
	optional e_server_msg_type packet_id = 1 [default = e_mst_w2c_leave_game_result];	
}


//被人踢下线 重复登录
message packetw2c_player_kick {
	optional e_server_msg_type packet_id = 1 [default = e_mst_w2c_player_kick];	
}

//请求游戏列表
message packetc2w_get_gamelist{
	optional e_server_msg_type packet_id = 1 [default = e_mst_c2w_get_gamelist];	
}

//返回游戏列表
message packetw2c_get_gamelist_result{
	optional e_server_msg_type packet_id = 1 [default = e_mst_w2c_get_gamelist_result];	
	repeated msg_game_info game_list = 2;	//游戏列表
}


//首次登陆
message packetc2w_first_login{
	optional e_server_msg_type packet_id = 1 [default = e_mst_c2w_first_login];	
}

//首次登陆返回
message packetw2c_first_login_result{
	optional e_server_msg_type packet_id = 1 [default = e_mst_w2c_first_login_result];	
	optional msg_type_def.e_msg_result_def result = 2 [default = e_rmt_fail];
}

////////////////////////////////////////////////////////////////////////////////////
// 请求进入捕鱼游戏房间( 点击客户端某房间图标时发送 )
message packetc2w_enter_fish_game
{
	optional e_server_msg_type packet_id = 1 [default = e_mst_c2w_enter_fish_game];	

	optional int32 gamever = 2;		//游戏版本 （校验玩家客户端）

	optional int32 roomId = 3;		//房间id
}
 
// 请求进入捕鱼游戏返回
message packetw2c_enter_fish_game_result 
{
	optional e_server_msg_type packet_id = 1 [default = e_mst_w2c_enter_fish_game_result];	

	optional int32 result = 2;

	optional int32 roomId = 3;
}


/*
// 请求退出捕鱼
message packetc2w_leave_fish_game
{
	optional e_server_msg_type packet_id = 1 [default = e_mst_c2w_leave_fish_game];	
}

// 退出捕鱼返回
message packetw2c_leave_fish_game_result 
{
	optional e_server_msg_type packet_id = 1 [default = e_mst_w2c_leave_fish_game_result ];	
}
*/

message msg_airdropitem {
	optional int32 uuid = 1;			//空投ID
	optional int32 playerid = 2;		//空投玩家ID
	optional int32 itemid = 3;			//物品id
	optional int32 itemcount = 4;		//物品数量
	optional string nickname = 5;		//空投玩家昵称
	optional int32 headid = 6;			//空投玩家头像
	optional string pwd = 7;			//空投密码
	optional int32 leftsecond = 8;		//空投剩余有效时间
	optional int32 receiveId = 9;		//领取人ID
}

// 创建空投
message packetc2w_create_airdrop
{
	optional e_server_msg_type packet_id = 1 [default = e_mst_c2w_create_airdrop];	
	optional int32 itemid = 2;
	optional int32 itemcount = 3;
	optional string pwd = 4;
}

// 创建空投返回
message packetw2c_create_airdrop_result
{
	optional e_server_msg_type packet_id = 1 [default = e_mst_w2c_create_airdrop_result];
	optional int32 result = 2;
	optional int32 itemid = 3;
	optional int32 itemcount = 4;
	optional string pwd = 5;
	optional int32 uuid = 6;
}

//获取空投列表
message packetc2w_get_airdrop_list
{
	optional e_server_msg_type packet_id = 1 [default = e_mst_c2w_get_airdrop_list ];
	optional bool bplayerairdrop = 2;
}

//获取空投列表返回
message packetw2c_get_airdrop_list_result {
	optional e_server_msg_type packet_id = 1 [default = e_mst_w2c_get_airdrop_list_result];
	optional int32 result = 2;
	optional bool bplayerairdrop = 3;
	repeated msg_airdropitem items = 4;
	optional int32 errorcount = 5;
}

//查询空投
message packetc2w_get_airdrop_info {
	optional e_server_msg_type packet_id = 1 [default = e_mst_c2w_get_airdrop_info];
	optional int32 uuid  = 2;	
}

//查询空投返回
message packetw2c_get_airdrop_info_result {
	optional e_server_msg_type packet_id = 1 [default = e_mst_w2c_get_airdrop_info_result];
	optional int32 result = 2;
	optional msg_airdropitem item = 3;
}

//领取空投
message packetc2w_draw_airdrop {
	optional e_server_msg_type packet_id = 1 [default = e_mst_c2w_draw_airdrop];
	optional int32 uuid = 2;
	optional string pwd = 3;
}

//领取空投返回
message packetw2c_draw_airdrop_result {
	optional e_server_msg_type packet_id = 1 [default = e_mst_w2c_draw_airdrop_result];
	optional int32 result = 2;
	optional msg_airdropitem item = 3;
}

//领取VIP奖励
message packetc2w_receive_vip_reward {
	optional e_server_msg_type packet_id = 1 [default = e_mst_c2w_receive_vip_reward];
	optional int32 result = 2;
	optional int32 rewardid = 3;
}

//领取VIP奖励返回
message packetw2c_receive_vip_reward_result {
	optional e_server_msg_type packet_id = 1 [default = e_mst_w2c_receive_vip_reward_result];
	optional int32 result = 2;
	optional int32 rewardid = 3;
}

//请求VIP金币对齐返回
message packetw2c_check_vip_money_result {
	optional e_server_msg_type packet_id = 1 [default = e_mst_w2c_check_vip_money_result];
	optional int32 result = 2;
}

//刷新数据通知
message packetw2c_timer_update {
	optional e_server_msg_type packet_id = 1 [default = e_mst_w2c_timer_update];
}

message recordInfo {
	optional int32 type = 1;			//统计类型
	optional int32 param = 2;			//统计参数
	optional int32 count = 3;			//统计数量
}

//同步统计信息
message packetc2w_syn_record_info {
	optional e_server_msg_type packet_id = 1 [default = e_mst_c2w_syn_record_info];
	repeated recordInfo recordList  = 2;
}

//钻石购买
message packetc2w_pay_by_diamond {
	optional e_server_msg_type packet_id = 1 [default = e_mst_c2w_pay_by_diamond];	
	optional int32 payid = 2;  
}

message packetw2c_pay_by_diamond_result {
	optional e_server_msg_type packet_id = 1 [default = e_mst_w2c_pay_by_diamond_result];	
	optional int32 result = 2;
	optional int32 payid = 3;  
}

//钻石购买
message packetc2w_exchange_vip_item {
	optional e_server_msg_type packet_id = 1 [default = e_mst_c2w_exchange_vip_item];	
	optional int32 index = 2;  
}

message packetw2c_exchange_vip_item_result {
	optional e_server_msg_type packet_id = 1 [default = e_mst_w2c_exchange_vip_item_result];	
	optional int32 result = 2;
	optional int32 index = 3;  
}

message storeInfo
{
	optional int32 id = 1;
	optional int32 store = 2;
}

//请求全服同步
message packet_c2w_sync_global_data {
	optional e_server_msg_type packet_id = 1 [default = e_mst_c2w_sync_global_data];
}

message packet_w2c_sync_global_data_result {
	optional e_server_msg_type packet_id = 1 [default = e_mst_w2c_sync_global_data_result];	
	repeated storeInfo vipExchangeStore = 2;
	optional int32 firstRechargeGiftPayCount = 3;
}

message packet_w2c_trigger_seven_day_rechage {
	optional e_server_msg_type packet_id = 1 [default = e_mst_w2c_trigger_seven_day_rechage];	
	optional int32 endTime = 2;
	optional int32 leftsecond = 3;
}

message treasureItem{
	optional int32 index = 1;
	optional int32 itemId = 2;
	optional int32 itemCount = 3;
}

//触发每日宝藏
message packetw2c_trigger_daily_treasure {
	optional e_server_msg_type packet_id = 1 [default = e_mst_w2c_trigger_daily_treasure];	
	optional int32 giftId = 2;
	optional int32 resetCard = 3;
	repeated treasureItem treasureList = 4;
}

message packetc2w_daily_treasure_lottery {
	optional e_server_msg_type packet_id = 1 [default = e_mst_c2w_daily_treasure_lottery];	
	optional int32 index = 2;  
}

message packetw2c_daily_treasure_lottery_result {
	optional e_server_msg_type packet_id = 1 [default = e_mst_w2c_daily_treasure_lottery_result];	
	optional int32 result = 2;
	optional int32 index = 3;
	optional int32 randCount = 4;
}

message packetc2w_receive_treasure_lottery {
	optional e_server_msg_type packet_id = 1 [default = e_mst_c2w_receive_treasure_lottery];	
}
message packetw2c_receive_treasure_lottery_result {
	optional e_server_msg_type packet_id = 1 [default = e_mst_w2c_receive_treasure_lottery_result];
	optional int32 result = 2;
	optional int32 giftId = 3;
	repeated treasureItem treasureList = 4;
}

message packetc2w_receive_sail_reward {
	optional e_server_msg_type packet_id = 1 [default = e_mst_c2w_receive_sail_reward];
	optional int32 type = 2;		//1签到奖励 2签到总次数奖励 3成就等级奖励 4VIP等级奖励 5VIP神秘宝箱奖励 6储蓄罐
	optional int32 index = 3;
}

message packetw2c_receive_sail_result {
	optional e_server_msg_type packet_id = 1 [default = e_mst_w2c_receive_sail_result];
	optional int32 type = 2;
	optional int32 index = 3;
	optional int32 result = 4;
	optional int32 resultParam = 5;
}

message packetc2w_syn_sail_piggy_gold {
	optional e_server_msg_type packet_id = 1 [default = e_mst_c2w_syn_sail_piggy_gold];
}

message packetw2c_syn_sail_piggy_gold_result {
	optional e_server_msg_type packet_id = 1 [default = e_mst_w2c_syn_sail_piggy_gold_result];
	optional int32 piggyGold = 2;
	optional int32 fishGold = 3;
	optional int32 onlineGold = 4;
}

//成就抽奖
message packetc2w_sail_achieve_lottery {
	optional e_server_msg_type packet_id = 1 [default = e_mst_c2w_sail_achieve_lottery];
	optional int32 count = 2;
}
message packetw2c_sail_achieve_lottery_result {
	optional e_server_msg_type packet_id = 1 [default = e_mst_w2c_sail_achieve_lottery_result];
	optional int32 count = 2;
	optional int32 result = 3;
	repeated int32 rewardList = 4;
}

message packetw2c_trigger_sail_achieve {
	optional e_server_msg_type packet_id = 1 [default = e_mst_w2c_trigger_sail_achieve];
	optional msg_info_def.SailCeremonyInfo sailInfo = 2;
}

message sailLotteryInfo
{
	optional string nickname = 1;
	optional int32 itemID = 2;
	optional int32 itemCount = 3;
	optional int32 time = 4;
}

//成就抽奖历史
message packetc2w_sail_get_lottery_history {
	optional e_server_msg_type packet_id = 1 [default = e_mst_c2w_sail_get_lottery_history];
}
message packetw2c_sail_get_lottery_history_result {
	optional e_server_msg_type packet_id = 1 [default = e_mst_w2c_sail_get_lottery_history_result];
	repeated sailLotteryInfo his = 2;
}

//回归登录奖励
message packetc2w_recv_return_login_reward{
	optional e_server_msg_type packet_id = 1 [default = e_mst_c2w_recv_return_login_reward];
	optional int32 index = 2;
}

message packetw2c_recv_return_login_reward_result {
	optional e_server_msg_type packet_id = 1 [default = e_mst_w2c_recv_return_login_reward_result];
	optional int32 result = 2;
	optional int32 index = 3;
}

//回归充值返利
message packetc2w_recv_return_recharge_reward{
	optional e_server_msg_type packet_id = 1 [default = e_mst_c2w_recv_return_recharge_reward];
	optional int32 index = 2;
}

message packetw2c_recv_return_recharge_reward_result {
	optional e_server_msg_type packet_id = 1 [default = e_mst_w2c_recv_return_recharge_reward_result];
	optional int32 result = 2;
	optional int32 index = 3;
}

//深渊捕鱼王签到
message packetc2w_abysm_sign{
	optional e_server_msg_type packet_id = 1 [default = e_mst_c2w_abysm_sign];
	optional int32 index = 2;
}

message packetw2c_abysm_sign_result {
	optional e_server_msg_type packet_id = 1 [default = e_mst_w2c_abysm_sign_result];
	optional int32 result = 2;
	optional int32 index = 3;
	repeated msg_info_def.ItemInfo rewardItem = 4;
}

//龙珠抽奖
message packetc2w_dragonball_lottery{
	optional e_server_msg_type packet_id = 1 [default = e_mst_c2w_dragonball_lottery];
	optional int32 count = 2;		//抽奖次数
}

message packetw2c_dragonball_lottery_result{
	optional e_server_msg_type packet_id = 1 [default = e_mst_w2c_dragonball_lottery_result];
	optional int32 result = 2;
	optional int32 count = 3;
	optional int32 curlucky = 4;
	optional int32 dragonball = 5;
	repeated int32 rewards = 6;
}
