ecs/proto/idl/mod_counter.proto
2025-07-16 10:05:22 +08:00

26 lines
968 B
Protocol Buffer
Raw 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.

syntax = "proto3";
package Pb;
option go_package = "pb/";
import "enums.proto";
// ModId.ModuleCounter: 7000
// 计数器模块消息定义
// 如果定义的消息内没有字段或者消息被注释掉了,说明该请求不需要参数,发送消息时仅发送包头即可,包体可为空, 返回的消息亦是如此。
// 计数器用于记录一些有次数限制的行为已经做过了次数,
// 如商店某个商品一天只能购买一定次数,当计数器次数>=可购买次数时,便不可再次购买,直到次日刷新
message Counter {
CounterType Type = 1; //计数器类型
uint64 Id = 2; //键ID1 << 32 | ID2
int64 Time = 3; //最近一次计数的时间
uint32 Daily = 4; //周期性计数,如:每日、每周、每月
uint32 Total = 5; //总计数
}
// MsgId.ModCounterList: 7001
// MsgId.ModCounterChange: 7002
// 计数器列表返回
message CounterListAck {
repeated Counter CounterList = 1;
}