公会系统:guild_chat.proto
syntax = "proto3";
package guild;
// 公会聊天消息类型
enum ChatType {
WORLD = 0; // 世界频道
GUILD = 1; // 公会频道
PRIVATE = 2; // 私聊
SYSTEM = 3; // 系统消息
}
// 聊天消息
message ChatMessage {
uint64 message_id = 1; // 消息ID
uint64 sender_id = 2; // 发送者ID
string sender_name = 3; // 发送者名称
uint64 guild_id = 4; // 公会ID
ChatType type = 5; // 消息类型
string content = 6; // 消息内容
uint64 timestamp = 7; // 时间戳
int32 level = 8; // 玩家等级
int32 vip_level = 9; // VIP等级
string avatar = 10; // 头像
repeated uint64 at_user_ids = 11; // @的用户ID列表
string guild_name = 12; // 公会名称
}
// 发送聊天请求
message SendChatRequest {
uint64 guild_id = 1; // 公会ID
ChatType type = 2; // 消息类型
string content = 3; // 消息内容
uint64 target_id = 4; // 目标玩家ID(私聊时使用)
repeated uint64 at_user_ids = 5; // @的用户ID列表
}
// 发送聊天响应
message SendChatResponse {
int32 result = 1; // 结果码
string message = 2; // 结果消息
ChatMessage chat_message = 3; // 发送的消息
}
// 拉取聊天历史请求
message GetChatHistoryRequest {
uint64 guild_id = 1; // 公会ID
ChatType type = 2; // 消息类型
uint64 last_message_id = 3; // 上一条消息ID(用于分页)
int32 count = 4; // 请求数量
}
// 拉取聊天历史响应
message GetChatHistoryResponse {
int32 result = 1; // 结果码
string message = 2; // 结果消息
repeated ChatMessage messages = 3;// 消息列表
}
// 新消息推送
message NewChatPush {
ChatMessage chat_message = 1; // 新消息
}
// 公会成员信息
message GuildMember {
uint64 player_id = 1; // 玩家ID
string player_name = 2; // 玩家名称
int32 level = 3; // 等级
int32 vip_level = 4; // VIP等级
string avatar = 5; // 头像
int32 position = 6; // 职位(1:会长 2:副会长 3:成员)
bool is_online = 7; // 是否在线
}
// 获取公会成员列表请求
message GetGuildMembersRequest {
uint64 guild_id = 1; // 公会ID
}
// 获取公会成员列表响应
message GetGuildMembersResponse {
int32 result = 1; // 结果码
string message = 2; // 结果消息
repeated GuildMember members = 3;// 成员列表
}
// 服务器消息推送
message ServerPush {
oneof push_data {
NewChatPush new_chat = 1; // 新消息推送
GuildMember member_update = 2; // 成员信息更新
string system_notice = 3; // 系统公告
}
}