Files
2026-05-23 22:10:14 +08:00

270 lines
11 KiB
Erlang
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
%%%-------------------------------------------------------------------
%%% @author yzq <741287960@qq.com>
%%% @copyright (C) 2018, yzq
%%% @doc
%%% 市场协议
%%% @end
%%% Created : 4 June 2018 by yzq
%%%-------------------------------------------------------------------
-module(proto_235).
-export([
info/0
,cfg/0
]
).
-include("protocol.hrl").
info() ->
{
"市场相关协议"
, ["market_gold.hrl"
, "market_silver.hrl"
, "market.hrl"
]
}.
cfg() ->
[
#rpc{
code = 23500
, log_title = "获取金币市场指定分类的数据"
, req_desc = {"获取金币市场指定分类的数据:[类别:~w]", [catalg]}
, req =
[{uint32, catalg, "市场类型"}
]
, reply_desc = "返回金币市场指定分类的数据"
, reply =
[{uint32, catalg, "类型"}
, {array, market_gold_item, goods, "分类物品数据"
, [{uint32, id, "物品编号"}
, {uint32, base_id, "物品基础Id"}
, {uint32, cur_price, "当前价格"}
, {uint32, margin, "涨幅:若大于1000表示“涨”,若小于1000表示“跌”"}
]
}
]
}
, #rpc{
code = 23501
, log_title = "购买金币市场物品"
, req_desc = {"购买金币市场物品:[物品基础Id:~w][num:~w]", [base_id, num]}
, req =
[{uint32, base_id, "物品基础Id"}
, {uint16, num, "购买物品数量"}
]
, reply_desc = {"购买金币市场物品:[falg:~w]", [flag]}
, reply =
[{uint8, flag, "成功:1;失败:0"}
]
}
, #rpc{
code = 23502
, log_title = "出售金币市场物品"
, req_desc = {"出售金币市场物品:[物品Id:~w][出售数量:~w]", [id, num]}
, req =
[{uint32, id, "物品Id"}
, {uint16, num, "出售数量"}
]
, reply = [{uint8, flag, "成功:1;失败:0"}]
}
, #rpc{
code = 23504
, log_title = "银币市场物品上架"
, req_desc = {"物品上架:[类型:~w][物品Id:~w][数量:~w][百分比:~w][摊位:~w]", [package_type, item_id, num, percent, cell_id]}
, req =
[{uint8, package_type, "背包:1"}
, {uint32, item_id, "物品Id"}
, {uint8, num, "数量"}
, {uint32, percent, "价格百分比,50200之间(50% ~ 200%"}
, {uint8, cell_id, "摊位编号"}
]
, reply = []
}
, #rpc{
code = 23505
, log_title = "购买银币市场物品"
, req_desc = {"购买银币市场物品[分类标签:~w][刷新编号:~w]", [type, id]}
, req =
[{uint8, type, "物品分类标签"}
, {uint8, id, "刷新编号"}
, {uint8, num, "购买数量"}
]
, reply_desc = {"购买银币市场物品[分类标签:~w][刷新编号:~w][物品状态:~w][剩余数量:~w]", [type, id, status, num]}
, reply = [{uint8, type, "物品分类标签"}
, {uint8, id, "刷新编号"}
, {uint8, status, "物品状态"}
, {uint8, num, "物品剩余数量"}
]
}
, #rpc{
code = 23506
, log_title = "银币市场物品下架"
, req_desc = {"物品下架[摊位编号:~w]", [cell_id]}
, req = [{uint8, cell_id, "摊位编号"}]
, reply_desc = {"物品下架[摊位编号:~w][flag:~w]", [cell_id, flag]}
, reply = [{uint8, cell_id, "摊位编号"}
, {uint8, flag, "成功:1;失败:0"}
]
}
, #rpc{
code = 23507
, log_title = "获取银币市场摊位信息"
, req_desc = "获取摊位信息"
, req = []
, reply =
[{rec, market_silver_shop, market_silver_shop
, [{array, single, free_ids, "空闲摊位编号"
, [{uint8, cell_id, "摊位编号"}]
}
, {array, market_silver_shop_cell, cells, "摊位数据"
, [{uint8, cell_id, "摊位Id"}
%% , {uint32, id, "市场物品编号"}
, {uint32, item_base_id, "物品基础Id"}
, {uint8, num, "数量"}
, {uint32, price, "出售价格"}
, {uint32, expiry, "下架时间"}
, {array, tuple, item_attrs, "物品状态"
, [{uint8, attr, "属性名称"}
, {uint32, value, "属性值"}
]
}
, {uint8, status, "摊位状态,未出售:0;已出售:1;废弃物品:2"}
]
}
]
}
]
}
, #rpc{
code = 23508
, log_title = "查询银币市场物品价格"
, req_desc = "获取银币市场物品价格"
, req = [{uint32, item_base_id, "物品基础Id"}]
, reply = [{uint32, item_base_id, "物品基础Id"}
, {uint32, price, "当前价格"}
]
}
, #rpc{
code = 23509
, log_title = "银币市场刷新"
, req_desc = {"银币市场刷新[type:~w]", [refresh_type]}
, req = [{uint8, refresh_type, "操作类型,免费刷新:1;消耗刷新:2;获取银币市场数据:3"}]
, reply =
[{uint32, refresh_time, "刷新到期时间"}
, {array, tuple, data, "刷新数据"
, [{uint8, type, "物品分类标签,表示锻造、药品等"}
, {array, market_silver_refresh, goods, "刷新时返回的市场数据"
, [{uint8, id, "刷新编号"}
%% , {uint32, goods_id, "市场物品编号"}
, {uint32, item_base_id, "物品基础Id"}
, {uint8, num, "物品数量"}
, {uint32, price, "单位售价"}
, {uint8, status, "物品状态,0:未出售; 1:自己已购买; 2:已被他人购买; 3:已下架"}
, {array, tuple, item_attrs, "物品状态"
, [{uint8, attr, "属性名称"}
, {uint32, value, "属性值"}
]
}
]
}
]
}
]
}
, #rpc{
code = 23511
, log_title = "银币市场提取摊位收益"
, req_desc = {"提取摊位收益:[cell_id:~w]", [cell_id]}
, req = [{uint8, cell_id, "摊位Id"}]
, reply_desc = {"提取摊位收益:[cell_id:~w][flag:~w]", [cell_id, flag]}
, reply = [{uint8, cell_id, "摊位Id"}
, {uint8, flag, "成功:1;失败:0"}
]
}
, #rpc{
code = 23512
, log_title = "银币市场开放摊位"
, req_desc = "开放摊位"
, req = []
, reply_desc = {"开放摊位:[cell_id:~w][flag:~w]", [cell_id, flag]}
, reply = [{uint8, cell_id, "摊位Id"}
, {uint8, flag, "成功:1;失败:0"}
]
}
, #rpc{
code = 23513
, log_title = "银币市场重新上架"
, req_desc = {"重新上架:[cell_id:~w][percent:~w][num:~w]", [cell_id, percent, num]}
, req = [{uint8, cell_id, "摊位Id"}
, {uint32, percent, "价格百分比,50200之间(50% ~ 200%"}
, {uint8, num, "新增上架数量"}
]
, reply = []
}
, #rpc{
code = 23514
, log_title = "银币市场一键操作"
, req_desc = {"一键操作[type:~w]", [type]}
, req = [{uint8, type, "一键操作类型,一键上架:1;一键提现:2"}]
, reply = []
}
, #rpc{
code = 23516
, log_title = "查询市场、商城物品价格"
, req_desc = "请求多个物品价格"
, req = [{array, single, base_ids, "物品base_id列表"
, [{uint32, base_id, "物品base_id"}]
}
]
, reply =
[
{array, market_price, market_price, "价格列表"
, [{uint8, source, "来源, 3:银币市场, 2:金币市场,1:商城"}
, {uint32, base_id, "道具基础Id"}
, {uint32, assets, "资产类型"}
, {uint32, price, "价格"}
]
}
]
}
, #rpc{
code = 23518
, log_title = "更新金币市场分类的数据"
, req_desc = {"更新金币市场分类数据:[~w]", [catalg]}
, req =
[{uint32, catalg, "类型"}
]
, reply_desc = "返回金币市场分类的更新数据"
, reply =
[{array, market_gold_item, goods, "分类物品数据"
, [{uint32, id, "物品编号"}
, {uint32, base_id, "物品基础Id"}
, {uint32, cur_price, "当前价格"}
, {uint32, margin, "涨幅:若大于1000表示“涨”,若小于1000表示“跌”"}
]
}
]
}
, #rpc{
code = 23519
, log_title = "银币市场通知客户端提现"
, req_desc = "通知客户端摊位可以提现"
, req = []
, reply_desc = "通知客户端摊位可以提现"
, reply = []
}
, #rpc{
code = 23520
,log_title = "金币市场获取玩家限购数据"
, req_desc = "金币市场获取玩家限购数据"
, req = []
, reply_desc = "金币市场获取玩家限购数据"
, reply = [
{array, tuple, limit_data, "限购数据", [
{uint32, item_id, "道具基础Id"}
,{uint32, count, "已经购买的数据"}
]}
]
}
].