From 7eabb63bc7e7b27f3e73faaf303199c12320aa81 Mon Sep 17 00:00:00 2001 From: liwei <2211068034@qq.com> Date: Thu, 27 Jul 2023 10:33:40 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E8=81=8A=E5=A4=A9?= =?UTF-8?q?=E6=B6=88=E6=81=AF=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/chat/api_send.go | 3 +- modules/moonfantasy/modelDream.go | 6 +- pb/chat_db.pb.go | 103 +++++++++++++++++------------- pb/chat_msg.pb.go | 85 +++++++++++++----------- 4 files changed, 111 insertions(+), 86 deletions(-) diff --git a/modules/chat/api_send.go b/modules/chat/api_send.go index b2975ad46..ebb24629c 100644 --- a/modules/chat/api_send.go +++ b/modules/chat/api_send.go @@ -40,7 +40,8 @@ func (this *apiComp) Send(session comm.IUserSession, req *pb.ChatSendReq) (errda Suid: session.GetUserId(), Slv: req.Ulv, Uname: req.Uname, - Avatar: req.Avatar, + Gender: req.Gender, + Skin: req.Skin, Stag: session.GetServiecTag(), Ctype: req.Ctype, Content: req.Content, diff --git a/modules/moonfantasy/modelDream.go b/modules/moonfantasy/modelDream.go index ed88a3428..9845edd9b 100644 --- a/modules/moonfantasy/modelDream.go +++ b/modules/moonfantasy/modelDream.go @@ -124,7 +124,8 @@ func (this *modelDreamComp) trigger(session comm.IUserSession) { chat = &pb.DBChat{ Ctype: pb.ChatType_Moonfantasy, Suid: session.GetUserId(), - Avatar: user.Avatar, + Gender: user.Gender, + Skin: user.CurSkin, Uname: user.Name, Slv: user.Lv, Ctime: configure.Now().Unix(), @@ -178,7 +179,8 @@ func (this *modelDreamComp) triggerbyid(session comm.IUserSession, boosid string chat = &pb.DBChat{ Ctype: pb.ChatType_Moonfantasy, Suid: session.GetUserId(), - Avatar: user.Avatar, + Gender: user.Gender, + Skin: user.CurSkin, Uname: user.Name, Slv: user.Lv, Ctime: configure.Now().Unix(), diff --git a/pb/chat_db.pb.go b/pb/chat_db.pb.go index 6f84f7f02..930b4fcb0 100644 --- a/pb/chat_db.pb.go +++ b/pb/chat_db.pb.go @@ -86,6 +86,7 @@ const ( ChatType_EquipmentShare ChatType = 4 //装备分享 ChatType_ItemShare ChatType = 5 //道具分享 ChatType_Parkour ChatType = 6 //捕羊大赛邀请 + ChatType_Questionnaire ChatType = 7 //问答分享 ) // Enum value maps for ChatType. @@ -98,6 +99,7 @@ var ( 4: "EquipmentShare", 5: "ItemShare", 6: "Parkour", + 7: "Questionnaire", } ChatType_value = map[string]int32{ "Text": 0, @@ -107,6 +109,7 @@ var ( "EquipmentShare": 4, "ItemShare": 5, "Parkour": 6, + "Questionnaire": 7, } ) @@ -151,16 +154,17 @@ type DBChat struct { ChannelId int32 `protobuf:"varint,7,opt,name=channelId,proto3" json:"channelId" bson:"channelId"` //ID跨服频道 频道Id UnionId string `protobuf:"bytes,8,opt,name=unionId,proto3" json:"unionId"` //@go_tags(`bson:"unionId"`)工会id Stag string `protobuf:"bytes,9,opt,name=stag,proto3" json:"stag"` //区服id - Avatar string `protobuf:"bytes,10,opt,name=avatar,proto3" json:"avatar"` //用户头像 - Uname string `protobuf:"bytes,11,opt,name=uname,proto3" json:"uname"` //用户名 - Content string `protobuf:"bytes,12,opt,name=content,proto3" json:"content"` //内容 - Ctime int64 `protobuf:"varint,13,opt,name=ctime,proto3" json:"ctime"` //创建时间 - AppendInt int64 `protobuf:"varint,14,opt,name=appendInt,proto3" json:"appendInt" bson:"appendInt"` //聊天附加数据 - AppendStr string `protobuf:"bytes,15,opt,name=appendStr,proto3" json:"appendStr" bson:"appendStr"` //聊天附加数据 - AppendBool string `protobuf:"bytes,16,opt,name=appendBool,proto3" json:"appendBool" bson:"appendBool"` //聊天附加数据 - AppendBytes []byte `protobuf:"bytes,17,opt,name=appendBytes,proto3" json:"appendBytes" bson:"appendBytes"` //聊天附加数据 - Display bool `protobuf:"varint,18,opt,name=display,proto3" json:"display"` //@go_tags(`bson:"display"`)是否显示到跑马灯 - AppendStrs []string `protobuf:"bytes,19,rep,name=appendStrs,proto3" json:"appendStrs" bson:"appendStrs"` //聊天附加数据 + Skin string `protobuf:"bytes,10,opt,name=skin,proto3" json:"skin"` //发送者皮肤 + Gender int32 `protobuf:"varint,11,opt,name=gender,proto3" json:"gender"` //发送者性别 + Uname string `protobuf:"bytes,12,opt,name=uname,proto3" json:"uname"` //用户名 + Content string `protobuf:"bytes,13,opt,name=content,proto3" json:"content"` //内容 + Ctime int64 `protobuf:"varint,14,opt,name=ctime,proto3" json:"ctime"` //创建时间 + AppendInt int64 `protobuf:"varint,15,opt,name=appendInt,proto3" json:"appendInt" bson:"appendInt"` //聊天附加数据 + AppendStr string `protobuf:"bytes,16,opt,name=appendStr,proto3" json:"appendStr" bson:"appendStr"` //聊天附加数据 + AppendBool string `protobuf:"bytes,17,opt,name=appendBool,proto3" json:"appendBool" bson:"appendBool"` //聊天附加数据 + AppendBytes []byte `protobuf:"bytes,18,opt,name=appendBytes,proto3" json:"appendBytes" bson:"appendBytes"` //聊天附加数据 + Display bool `protobuf:"varint,19,opt,name=display,proto3" json:"display"` //@go_tags(`bson:"display"`)是否显示到跑马灯 + AppendStrs []string `protobuf:"bytes,20,rep,name=appendStrs,proto3" json:"appendStrs" bson:"appendStrs"` //聊天附加数据 } func (x *DBChat) Reset() { @@ -258,13 +262,20 @@ func (x *DBChat) GetStag() string { return "" } -func (x *DBChat) GetAvatar() string { +func (x *DBChat) GetSkin() string { if x != nil { - return x.Avatar + return x.Skin } return "" } +func (x *DBChat) GetGender() int32 { + if x != nil { + return x.Gender + } + return 0 +} + func (x *DBChat) GetUname() string { if x != nil { return x.Uname @@ -332,7 +343,7 @@ var File_chat_chat_db_proto protoreflect.FileDescriptor var file_chat_chat_db_proto_rawDesc = []byte{ 0x0a, 0x12, 0x63, 0x68, 0x61, 0x74, 0x2f, 0x63, 0x68, 0x61, 0x74, 0x5f, 0x64, 0x62, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xfd, 0x03, 0x0a, 0x06, 0x44, 0x42, 0x43, 0x68, 0x61, 0x74, 0x12, + 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x91, 0x04, 0x0a, 0x06, 0x44, 0x42, 0x43, 0x68, 0x61, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x26, 0x0a, 0x07, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0c, 0x2e, 0x43, 0x68, 0x61, 0x74, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x52, 0x07, @@ -346,38 +357,40 @@ var file_chat_chat_db_proto_rawDesc = []byte{ 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x75, 0x6e, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x75, 0x6e, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x74, - 0x61, 0x67, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x73, 0x74, 0x61, 0x67, 0x12, 0x16, - 0x0a, 0x06, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, - 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x75, 0x6e, 0x61, 0x6d, 0x65, 0x18, - 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x75, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, - 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, - 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x74, 0x69, 0x6d, 0x65, 0x18, - 0x0d, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x63, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x1c, 0x0a, 0x09, - 0x61, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x49, 0x6e, 0x74, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x03, 0x52, - 0x09, 0x61, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x49, 0x6e, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x70, - 0x70, 0x65, 0x6e, 0x64, 0x53, 0x74, 0x72, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, - 0x70, 0x70, 0x65, 0x6e, 0x64, 0x53, 0x74, 0x72, 0x12, 0x1e, 0x0a, 0x0a, 0x61, 0x70, 0x70, 0x65, - 0x6e, 0x64, 0x42, 0x6f, 0x6f, 0x6c, 0x18, 0x10, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x61, 0x70, - 0x70, 0x65, 0x6e, 0x64, 0x42, 0x6f, 0x6f, 0x6c, 0x12, 0x20, 0x0a, 0x0b, 0x61, 0x70, 0x70, 0x65, - 0x6e, 0x64, 0x42, 0x79, 0x74, 0x65, 0x73, 0x18, 0x11, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0b, 0x61, - 0x70, 0x70, 0x65, 0x6e, 0x64, 0x42, 0x79, 0x74, 0x65, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x64, 0x69, - 0x73, 0x70, 0x6c, 0x61, 0x79, 0x18, 0x12, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x64, 0x69, 0x73, - 0x70, 0x6c, 0x61, 0x79, 0x12, 0x1e, 0x0a, 0x0a, 0x61, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x53, 0x74, - 0x72, 0x73, 0x18, 0x13, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0a, 0x61, 0x70, 0x70, 0x65, 0x6e, 0x64, - 0x53, 0x74, 0x72, 0x73, 0x2a, 0x4d, 0x0a, 0x0b, 0x43, 0x68, 0x61, 0x74, 0x43, 0x68, 0x61, 0x6e, - 0x6e, 0x65, 0x6c, 0x12, 0x09, 0x0a, 0x05, 0x57, 0x6f, 0x72, 0x6c, 0x64, 0x10, 0x00, 0x12, 0x09, - 0x0a, 0x05, 0x55, 0x6e, 0x69, 0x6f, 0x6e, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x50, 0x72, 0x69, - 0x76, 0x61, 0x74, 0x65, 0x10, 0x02, 0x12, 0x0f, 0x0a, 0x0b, 0x43, 0x72, 0x6f, 0x73, 0x73, 0x53, - 0x65, 0x72, 0x76, 0x65, 0x72, 0x10, 0x03, 0x12, 0x0a, 0x0a, 0x06, 0x53, 0x79, 0x73, 0x74, 0x65, - 0x6d, 0x10, 0x04, 0x2a, 0x6f, 0x0a, 0x08, 0x43, 0x68, 0x61, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, - 0x08, 0x0a, 0x04, 0x54, 0x65, 0x78, 0x74, 0x10, 0x00, 0x12, 0x0f, 0x0a, 0x0b, 0x4d, 0x6f, 0x6f, - 0x6e, 0x66, 0x61, 0x6e, 0x74, 0x61, 0x73, 0x79, 0x10, 0x01, 0x12, 0x09, 0x0a, 0x05, 0x53, 0x68, - 0x61, 0x72, 0x65, 0x10, 0x02, 0x12, 0x0d, 0x0a, 0x09, 0x48, 0x65, 0x72, 0x6f, 0x53, 0x68, 0x61, - 0x72, 0x65, 0x10, 0x03, 0x12, 0x12, 0x0a, 0x0e, 0x45, 0x71, 0x75, 0x69, 0x70, 0x6d, 0x65, 0x6e, - 0x74, 0x53, 0x68, 0x61, 0x72, 0x65, 0x10, 0x04, 0x12, 0x0d, 0x0a, 0x09, 0x49, 0x74, 0x65, 0x6d, - 0x53, 0x68, 0x61, 0x72, 0x65, 0x10, 0x05, 0x12, 0x0b, 0x0a, 0x07, 0x50, 0x61, 0x72, 0x6b, 0x6f, - 0x75, 0x72, 0x10, 0x06, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x33, + 0x61, 0x67, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x73, 0x74, 0x61, 0x67, 0x12, 0x12, + 0x0a, 0x04, 0x73, 0x6b, 0x69, 0x6e, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x73, 0x6b, + 0x69, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x67, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x18, 0x0b, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x06, 0x67, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x75, 0x6e, + 0x61, 0x6d, 0x65, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x75, 0x6e, 0x61, 0x6d, 0x65, + 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x0d, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x74, + 0x69, 0x6d, 0x65, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x63, 0x74, 0x69, 0x6d, 0x65, + 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x49, 0x6e, 0x74, 0x18, 0x0f, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x09, 0x61, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x49, 0x6e, 0x74, 0x12, 0x1c, + 0x0a, 0x09, 0x61, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x53, 0x74, 0x72, 0x18, 0x10, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x09, 0x61, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x53, 0x74, 0x72, 0x12, 0x1e, 0x0a, 0x0a, + 0x61, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x42, 0x6f, 0x6f, 0x6c, 0x18, 0x11, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0a, 0x61, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x42, 0x6f, 0x6f, 0x6c, 0x12, 0x20, 0x0a, 0x0b, + 0x61, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x42, 0x79, 0x74, 0x65, 0x73, 0x18, 0x12, 0x20, 0x01, 0x28, + 0x0c, 0x52, 0x0b, 0x61, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x42, 0x79, 0x74, 0x65, 0x73, 0x12, 0x18, + 0x0a, 0x07, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x18, 0x13, 0x20, 0x01, 0x28, 0x08, 0x52, + 0x07, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x12, 0x1e, 0x0a, 0x0a, 0x61, 0x70, 0x70, 0x65, + 0x6e, 0x64, 0x53, 0x74, 0x72, 0x73, 0x18, 0x14, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0a, 0x61, 0x70, + 0x70, 0x65, 0x6e, 0x64, 0x53, 0x74, 0x72, 0x73, 0x2a, 0x4d, 0x0a, 0x0b, 0x43, 0x68, 0x61, 0x74, + 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x12, 0x09, 0x0a, 0x05, 0x57, 0x6f, 0x72, 0x6c, 0x64, + 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x55, 0x6e, 0x69, 0x6f, 0x6e, 0x10, 0x01, 0x12, 0x0b, 0x0a, + 0x07, 0x50, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x10, 0x02, 0x12, 0x0f, 0x0a, 0x0b, 0x43, 0x72, + 0x6f, 0x73, 0x73, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x10, 0x03, 0x12, 0x0a, 0x0a, 0x06, 0x53, + 0x79, 0x73, 0x74, 0x65, 0x6d, 0x10, 0x04, 0x2a, 0x82, 0x01, 0x0a, 0x08, 0x43, 0x68, 0x61, 0x74, + 0x54, 0x79, 0x70, 0x65, 0x12, 0x08, 0x0a, 0x04, 0x54, 0x65, 0x78, 0x74, 0x10, 0x00, 0x12, 0x0f, + 0x0a, 0x0b, 0x4d, 0x6f, 0x6f, 0x6e, 0x66, 0x61, 0x6e, 0x74, 0x61, 0x73, 0x79, 0x10, 0x01, 0x12, + 0x09, 0x0a, 0x05, 0x53, 0x68, 0x61, 0x72, 0x65, 0x10, 0x02, 0x12, 0x0d, 0x0a, 0x09, 0x48, 0x65, + 0x72, 0x6f, 0x53, 0x68, 0x61, 0x72, 0x65, 0x10, 0x03, 0x12, 0x12, 0x0a, 0x0e, 0x45, 0x71, 0x75, + 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x53, 0x68, 0x61, 0x72, 0x65, 0x10, 0x04, 0x12, 0x0d, 0x0a, + 0x09, 0x49, 0x74, 0x65, 0x6d, 0x53, 0x68, 0x61, 0x72, 0x65, 0x10, 0x05, 0x12, 0x0b, 0x0a, 0x07, + 0x50, 0x61, 0x72, 0x6b, 0x6f, 0x75, 0x72, 0x10, 0x06, 0x12, 0x11, 0x0a, 0x0d, 0x51, 0x75, 0x65, + 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x6e, 0x61, 0x69, 0x72, 0x65, 0x10, 0x07, 0x42, 0x06, 0x5a, 0x04, + 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/pb/chat_msg.pb.go b/pb/chat_msg.pb.go index 3044e7bc6..b0ae85e31 100644 --- a/pb/chat_msg.pb.go +++ b/pb/chat_msg.pb.go @@ -377,17 +377,18 @@ type ChatSendReq struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Avatar string `protobuf:"bytes,1,opt,name=avatar,proto3" json:"avatar"` //用户头像 - Uname string `protobuf:"bytes,2,opt,name=uname,proto3" json:"uname"` //用户名 - Ulv int32 `protobuf:"varint,3,opt,name=ulv,proto3" json:"ulv"` //用户等级 - Channel ChatChannel `protobuf:"varint,4,opt,name=channel,proto3,enum=ChatChannel" json:"channel"` //频道 - TargetId string `protobuf:"bytes,5,opt,name=targetId,proto3" json:"targetId"` //目标用户id - Ctype ChatType `protobuf:"varint,6,opt,name=ctype,proto3,enum=ChatType" json:"ctype"` //消息类型 - Content string `protobuf:"bytes,7,opt,name=content,proto3" json:"content"` //内容 - AppendInt int64 `protobuf:"varint,8,opt,name=appendInt,proto3" json:"appendInt" bson:"appendInt"` //聊天附加数据 - AppendStr string `protobuf:"bytes,9,opt,name=appendStr,proto3" json:"appendStr" bson:"appendStr"` //聊天附加数据 - AppendBool string `protobuf:"bytes,10,opt,name=appendBool,proto3" json:"appendBool" bson:"appendBool"` //聊天附加数据 - AppendBytes []byte `protobuf:"bytes,11,opt,name=appendBytes,proto3" json:"appendBytes" bson:"appendInt"` //聊天附加数据 + Skin string `protobuf:"bytes,1,opt,name=skin,proto3" json:"skin"` //发送者皮肤 + Gender int32 `protobuf:"varint,2,opt,name=gender,proto3" json:"gender"` //发送者性别 + Uname string `protobuf:"bytes,3,opt,name=uname,proto3" json:"uname"` //用户名 + Ulv int32 `protobuf:"varint,4,opt,name=ulv,proto3" json:"ulv"` //用户等级 + Channel ChatChannel `protobuf:"varint,5,opt,name=channel,proto3,enum=ChatChannel" json:"channel"` //频道 + TargetId string `protobuf:"bytes,6,opt,name=targetId,proto3" json:"targetId"` //目标用户id + Ctype ChatType `protobuf:"varint,7,opt,name=ctype,proto3,enum=ChatType" json:"ctype"` //消息类型 + Content string `protobuf:"bytes,8,opt,name=content,proto3" json:"content"` //内容 + AppendInt int64 `protobuf:"varint,9,opt,name=appendInt,proto3" json:"appendInt" bson:"appendInt"` //聊天附加数据 + AppendStr string `protobuf:"bytes,10,opt,name=appendStr,proto3" json:"appendStr" bson:"appendStr"` //聊天附加数据 + AppendBool string `protobuf:"bytes,11,opt,name=appendBool,proto3" json:"appendBool" bson:"appendBool"` //聊天附加数据 + AppendBytes []byte `protobuf:"bytes,12,opt,name=appendBytes,proto3" json:"appendBytes" bson:"appendInt"` //聊天附加数据 } func (x *ChatSendReq) Reset() { @@ -422,13 +423,20 @@ func (*ChatSendReq) Descriptor() ([]byte, []int) { return file_chat_chat_msg_proto_rawDescGZIP(), []int{7} } -func (x *ChatSendReq) GetAvatar() string { +func (x *ChatSendReq) GetSkin() string { if x != nil { - return x.Avatar + return x.Skin } return "" } +func (x *ChatSendReq) GetGender() int32 { + if x != nil { + return x.Gender + } + return 0 +} + func (x *ChatSendReq) GetUname() string { if x != nil { return x.Uname @@ -579,31 +587,32 @@ var file_chat_chat_msg_proto_rawDesc = []byte{ 0x30, 0x0a, 0x0f, 0x43, 0x68, 0x61, 0x74, 0x47, 0x65, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1d, 0x0a, 0x05, 0x63, 0x68, 0x61, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x07, 0x2e, 0x44, 0x42, 0x43, 0x68, 0x61, 0x74, 0x52, 0x05, 0x63, 0x68, 0x61, 0x74, - 0x73, 0x22, 0xca, 0x02, 0x0a, 0x0b, 0x43, 0x68, 0x61, 0x74, 0x53, 0x65, 0x6e, 0x64, 0x52, 0x65, - 0x71, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x06, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x75, 0x6e, 0x61, - 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x75, 0x6e, 0x61, 0x6d, 0x65, 0x12, - 0x10, 0x0a, 0x03, 0x75, 0x6c, 0x76, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x75, 0x6c, - 0x76, 0x12, 0x26, 0x0a, 0x07, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x0e, 0x32, 0x0c, 0x2e, 0x43, 0x68, 0x61, 0x74, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, - 0x52, 0x07, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x12, 0x1a, 0x0a, 0x08, 0x74, 0x61, 0x72, - 0x67, 0x65, 0x74, 0x49, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x74, 0x61, 0x72, - 0x67, 0x65, 0x74, 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x05, 0x63, 0x74, 0x79, 0x70, 0x65, 0x18, 0x06, - 0x20, 0x01, 0x28, 0x0e, 0x32, 0x09, 0x2e, 0x43, 0x68, 0x61, 0x74, 0x54, 0x79, 0x70, 0x65, 0x52, - 0x05, 0x63, 0x74, 0x79, 0x70, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, - 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, - 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x49, 0x6e, 0x74, 0x18, 0x08, 0x20, - 0x01, 0x28, 0x03, 0x52, 0x09, 0x61, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x49, 0x6e, 0x74, 0x12, 0x1c, - 0x0a, 0x09, 0x61, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x53, 0x74, 0x72, 0x18, 0x09, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x09, 0x61, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x53, 0x74, 0x72, 0x12, 0x1e, 0x0a, 0x0a, - 0x61, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x42, 0x6f, 0x6f, 0x6c, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0a, 0x61, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x42, 0x6f, 0x6f, 0x6c, 0x12, 0x20, 0x0a, 0x0b, - 0x61, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x42, 0x79, 0x74, 0x65, 0x73, 0x18, 0x0b, 0x20, 0x01, 0x28, - 0x0c, 0x52, 0x0b, 0x61, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x42, 0x79, 0x74, 0x65, 0x73, 0x22, 0x26, - 0x0a, 0x0c, 0x43, 0x68, 0x61, 0x74, 0x53, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x70, 0x12, 0x16, - 0x0a, 0x06, 0x69, 0x73, 0x73, 0x75, 0x63, 0x63, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, - 0x69, 0x73, 0x73, 0x75, 0x63, 0x63, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x73, 0x22, 0xde, 0x02, 0x0a, 0x0b, 0x43, 0x68, 0x61, 0x74, 0x53, 0x65, 0x6e, 0x64, 0x52, 0x65, + 0x71, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x6b, 0x69, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x04, 0x73, 0x6b, 0x69, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x67, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x67, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x12, 0x14, 0x0a, + 0x05, 0x75, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x75, 0x6e, + 0x61, 0x6d, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x6c, 0x76, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x03, 0x75, 0x6c, 0x76, 0x12, 0x26, 0x0a, 0x07, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0c, 0x2e, 0x43, 0x68, 0x61, 0x74, 0x43, 0x68, 0x61, + 0x6e, 0x6e, 0x65, 0x6c, 0x52, 0x07, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x12, 0x1a, 0x0a, + 0x08, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x49, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x08, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x05, 0x63, 0x74, 0x79, + 0x70, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x09, 0x2e, 0x43, 0x68, 0x61, 0x74, 0x54, + 0x79, 0x70, 0x65, 0x52, 0x05, 0x63, 0x74, 0x79, 0x70, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, + 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e, + 0x74, 0x65, 0x6e, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x49, 0x6e, + 0x74, 0x18, 0x09, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x61, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x49, + 0x6e, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x53, 0x74, 0x72, 0x18, + 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x53, 0x74, 0x72, + 0x12, 0x1e, 0x0a, 0x0a, 0x61, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x42, 0x6f, 0x6f, 0x6c, 0x18, 0x0b, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x61, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x42, 0x6f, 0x6f, 0x6c, + 0x12, 0x20, 0x0a, 0x0b, 0x61, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x42, 0x79, 0x74, 0x65, 0x73, 0x18, + 0x0c, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0b, 0x61, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x42, 0x79, 0x74, + 0x65, 0x73, 0x22, 0x26, 0x0a, 0x0c, 0x43, 0x68, 0x61, 0x74, 0x53, 0x65, 0x6e, 0x64, 0x52, 0x65, + 0x73, 0x70, 0x12, 0x16, 0x0a, 0x06, 0x69, 0x73, 0x73, 0x75, 0x63, 0x63, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x08, 0x52, 0x06, 0x69, 0x73, 0x73, 0x75, 0x63, 0x63, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, + 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( From 21866fb344d1e6f75de8dbbc9f4b100f0c22f1ab Mon Sep 17 00:00:00 2001 From: liwei <2211068034@qq.com> Date: Thu, 27 Jul 2023 10:35:29 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E8=81=8A=E5=A4=A9?= =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/chat/api_send.go | 3 +- modules/moonfantasy/modelDream.go | 6 +- pb/chat_db.pb.go | 101 ++++++++++++++---------------- pb/chat_msg.pb.go | 85 +++++++++++-------------- 4 files changed, 87 insertions(+), 108 deletions(-) diff --git a/modules/chat/api_send.go b/modules/chat/api_send.go index ebb24629c..b2975ad46 100644 --- a/modules/chat/api_send.go +++ b/modules/chat/api_send.go @@ -40,8 +40,7 @@ func (this *apiComp) Send(session comm.IUserSession, req *pb.ChatSendReq) (errda Suid: session.GetUserId(), Slv: req.Ulv, Uname: req.Uname, - Gender: req.Gender, - Skin: req.Skin, + Avatar: req.Avatar, Stag: session.GetServiecTag(), Ctype: req.Ctype, Content: req.Content, diff --git a/modules/moonfantasy/modelDream.go b/modules/moonfantasy/modelDream.go index 9845edd9b..ed88a3428 100644 --- a/modules/moonfantasy/modelDream.go +++ b/modules/moonfantasy/modelDream.go @@ -124,8 +124,7 @@ func (this *modelDreamComp) trigger(session comm.IUserSession) { chat = &pb.DBChat{ Ctype: pb.ChatType_Moonfantasy, Suid: session.GetUserId(), - Gender: user.Gender, - Skin: user.CurSkin, + Avatar: user.Avatar, Uname: user.Name, Slv: user.Lv, Ctime: configure.Now().Unix(), @@ -179,8 +178,7 @@ func (this *modelDreamComp) triggerbyid(session comm.IUserSession, boosid string chat = &pb.DBChat{ Ctype: pb.ChatType_Moonfantasy, Suid: session.GetUserId(), - Gender: user.Gender, - Skin: user.CurSkin, + Avatar: user.Avatar, Uname: user.Name, Slv: user.Lv, Ctime: configure.Now().Unix(), diff --git a/pb/chat_db.pb.go b/pb/chat_db.pb.go index 930b4fcb0..85fa47992 100644 --- a/pb/chat_db.pb.go +++ b/pb/chat_db.pb.go @@ -154,17 +154,16 @@ type DBChat struct { ChannelId int32 `protobuf:"varint,7,opt,name=channelId,proto3" json:"channelId" bson:"channelId"` //ID跨服频道 频道Id UnionId string `protobuf:"bytes,8,opt,name=unionId,proto3" json:"unionId"` //@go_tags(`bson:"unionId"`)工会id Stag string `protobuf:"bytes,9,opt,name=stag,proto3" json:"stag"` //区服id - Skin string `protobuf:"bytes,10,opt,name=skin,proto3" json:"skin"` //发送者皮肤 - Gender int32 `protobuf:"varint,11,opt,name=gender,proto3" json:"gender"` //发送者性别 - Uname string `protobuf:"bytes,12,opt,name=uname,proto3" json:"uname"` //用户名 - Content string `protobuf:"bytes,13,opt,name=content,proto3" json:"content"` //内容 - Ctime int64 `protobuf:"varint,14,opt,name=ctime,proto3" json:"ctime"` //创建时间 - AppendInt int64 `protobuf:"varint,15,opt,name=appendInt,proto3" json:"appendInt" bson:"appendInt"` //聊天附加数据 - AppendStr string `protobuf:"bytes,16,opt,name=appendStr,proto3" json:"appendStr" bson:"appendStr"` //聊天附加数据 - AppendBool string `protobuf:"bytes,17,opt,name=appendBool,proto3" json:"appendBool" bson:"appendBool"` //聊天附加数据 - AppendBytes []byte `protobuf:"bytes,18,opt,name=appendBytes,proto3" json:"appendBytes" bson:"appendBytes"` //聊天附加数据 - Display bool `protobuf:"varint,19,opt,name=display,proto3" json:"display"` //@go_tags(`bson:"display"`)是否显示到跑马灯 - AppendStrs []string `protobuf:"bytes,20,rep,name=appendStrs,proto3" json:"appendStrs" bson:"appendStrs"` //聊天附加数据 + Avatar string `protobuf:"bytes,10,opt,name=avatar,proto3" json:"avatar"` //用户头像 + Uname string `protobuf:"bytes,11,opt,name=uname,proto3" json:"uname"` //用户名 + Content string `protobuf:"bytes,12,opt,name=content,proto3" json:"content"` //内容 + Ctime int64 `protobuf:"varint,13,opt,name=ctime,proto3" json:"ctime"` //创建时间 + AppendInt int64 `protobuf:"varint,14,opt,name=appendInt,proto3" json:"appendInt" bson:"appendInt"` //聊天附加数据 + AppendStr string `protobuf:"bytes,15,opt,name=appendStr,proto3" json:"appendStr" bson:"appendStr"` //聊天附加数据 + AppendBool string `protobuf:"bytes,16,opt,name=appendBool,proto3" json:"appendBool" bson:"appendBool"` //聊天附加数据 + AppendBytes []byte `protobuf:"bytes,17,opt,name=appendBytes,proto3" json:"appendBytes" bson:"appendBytes"` //聊天附加数据 + Display bool `protobuf:"varint,18,opt,name=display,proto3" json:"display"` //@go_tags(`bson:"display"`)是否显示到跑马灯 + AppendStrs []string `protobuf:"bytes,19,rep,name=appendStrs,proto3" json:"appendStrs" bson:"appendStrs"` //聊天附加数据 } func (x *DBChat) Reset() { @@ -262,20 +261,13 @@ func (x *DBChat) GetStag() string { return "" } -func (x *DBChat) GetSkin() string { +func (x *DBChat) GetAvatar() string { if x != nil { - return x.Skin + return x.Avatar } return "" } -func (x *DBChat) GetGender() int32 { - if x != nil { - return x.Gender - } - return 0 -} - func (x *DBChat) GetUname() string { if x != nil { return x.Uname @@ -343,7 +335,7 @@ var File_chat_chat_db_proto protoreflect.FileDescriptor var file_chat_chat_db_proto_rawDesc = []byte{ 0x0a, 0x12, 0x63, 0x68, 0x61, 0x74, 0x2f, 0x63, 0x68, 0x61, 0x74, 0x5f, 0x64, 0x62, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x91, 0x04, 0x0a, 0x06, 0x44, 0x42, 0x43, 0x68, 0x61, 0x74, 0x12, + 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xfd, 0x03, 0x0a, 0x06, 0x44, 0x42, 0x43, 0x68, 0x61, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x26, 0x0a, 0x07, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0c, 0x2e, 0x43, 0x68, 0x61, 0x74, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x52, 0x07, @@ -357,40 +349,39 @@ var file_chat_chat_db_proto_rawDesc = []byte{ 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x75, 0x6e, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x75, 0x6e, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x74, - 0x61, 0x67, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x73, 0x74, 0x61, 0x67, 0x12, 0x12, - 0x0a, 0x04, 0x73, 0x6b, 0x69, 0x6e, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x73, 0x6b, - 0x69, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x67, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x18, 0x0b, 0x20, 0x01, - 0x28, 0x05, 0x52, 0x06, 0x67, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x75, 0x6e, - 0x61, 0x6d, 0x65, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x75, 0x6e, 0x61, 0x6d, 0x65, - 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x0d, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x74, - 0x69, 0x6d, 0x65, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x63, 0x74, 0x69, 0x6d, 0x65, - 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x49, 0x6e, 0x74, 0x18, 0x0f, 0x20, - 0x01, 0x28, 0x03, 0x52, 0x09, 0x61, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x49, 0x6e, 0x74, 0x12, 0x1c, - 0x0a, 0x09, 0x61, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x53, 0x74, 0x72, 0x18, 0x10, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x09, 0x61, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x53, 0x74, 0x72, 0x12, 0x1e, 0x0a, 0x0a, - 0x61, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x42, 0x6f, 0x6f, 0x6c, 0x18, 0x11, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0a, 0x61, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x42, 0x6f, 0x6f, 0x6c, 0x12, 0x20, 0x0a, 0x0b, - 0x61, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x42, 0x79, 0x74, 0x65, 0x73, 0x18, 0x12, 0x20, 0x01, 0x28, - 0x0c, 0x52, 0x0b, 0x61, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x42, 0x79, 0x74, 0x65, 0x73, 0x12, 0x18, - 0x0a, 0x07, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x18, 0x13, 0x20, 0x01, 0x28, 0x08, 0x52, - 0x07, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x12, 0x1e, 0x0a, 0x0a, 0x61, 0x70, 0x70, 0x65, - 0x6e, 0x64, 0x53, 0x74, 0x72, 0x73, 0x18, 0x14, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0a, 0x61, 0x70, - 0x70, 0x65, 0x6e, 0x64, 0x53, 0x74, 0x72, 0x73, 0x2a, 0x4d, 0x0a, 0x0b, 0x43, 0x68, 0x61, 0x74, - 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x12, 0x09, 0x0a, 0x05, 0x57, 0x6f, 0x72, 0x6c, 0x64, - 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x55, 0x6e, 0x69, 0x6f, 0x6e, 0x10, 0x01, 0x12, 0x0b, 0x0a, - 0x07, 0x50, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x10, 0x02, 0x12, 0x0f, 0x0a, 0x0b, 0x43, 0x72, - 0x6f, 0x73, 0x73, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x10, 0x03, 0x12, 0x0a, 0x0a, 0x06, 0x53, - 0x79, 0x73, 0x74, 0x65, 0x6d, 0x10, 0x04, 0x2a, 0x82, 0x01, 0x0a, 0x08, 0x43, 0x68, 0x61, 0x74, - 0x54, 0x79, 0x70, 0x65, 0x12, 0x08, 0x0a, 0x04, 0x54, 0x65, 0x78, 0x74, 0x10, 0x00, 0x12, 0x0f, - 0x0a, 0x0b, 0x4d, 0x6f, 0x6f, 0x6e, 0x66, 0x61, 0x6e, 0x74, 0x61, 0x73, 0x79, 0x10, 0x01, 0x12, - 0x09, 0x0a, 0x05, 0x53, 0x68, 0x61, 0x72, 0x65, 0x10, 0x02, 0x12, 0x0d, 0x0a, 0x09, 0x48, 0x65, - 0x72, 0x6f, 0x53, 0x68, 0x61, 0x72, 0x65, 0x10, 0x03, 0x12, 0x12, 0x0a, 0x0e, 0x45, 0x71, 0x75, - 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x53, 0x68, 0x61, 0x72, 0x65, 0x10, 0x04, 0x12, 0x0d, 0x0a, - 0x09, 0x49, 0x74, 0x65, 0x6d, 0x53, 0x68, 0x61, 0x72, 0x65, 0x10, 0x05, 0x12, 0x0b, 0x0a, 0x07, - 0x50, 0x61, 0x72, 0x6b, 0x6f, 0x75, 0x72, 0x10, 0x06, 0x12, 0x11, 0x0a, 0x0d, 0x51, 0x75, 0x65, - 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x6e, 0x61, 0x69, 0x72, 0x65, 0x10, 0x07, 0x42, 0x06, 0x5a, 0x04, - 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x61, 0x67, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x73, 0x74, 0x61, 0x67, 0x12, 0x16, + 0x0a, 0x06, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, + 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x75, 0x6e, 0x61, 0x6d, 0x65, 0x18, + 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x75, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, + 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, + 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x74, 0x69, 0x6d, 0x65, 0x18, + 0x0d, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x63, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x1c, 0x0a, 0x09, + 0x61, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x49, 0x6e, 0x74, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x09, 0x61, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x49, 0x6e, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x70, + 0x70, 0x65, 0x6e, 0x64, 0x53, 0x74, 0x72, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, + 0x70, 0x70, 0x65, 0x6e, 0x64, 0x53, 0x74, 0x72, 0x12, 0x1e, 0x0a, 0x0a, 0x61, 0x70, 0x70, 0x65, + 0x6e, 0x64, 0x42, 0x6f, 0x6f, 0x6c, 0x18, 0x10, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x61, 0x70, + 0x70, 0x65, 0x6e, 0x64, 0x42, 0x6f, 0x6f, 0x6c, 0x12, 0x20, 0x0a, 0x0b, 0x61, 0x70, 0x70, 0x65, + 0x6e, 0x64, 0x42, 0x79, 0x74, 0x65, 0x73, 0x18, 0x11, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0b, 0x61, + 0x70, 0x70, 0x65, 0x6e, 0x64, 0x42, 0x79, 0x74, 0x65, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x64, 0x69, + 0x73, 0x70, 0x6c, 0x61, 0x79, 0x18, 0x12, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x64, 0x69, 0x73, + 0x70, 0x6c, 0x61, 0x79, 0x12, 0x1e, 0x0a, 0x0a, 0x61, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x53, 0x74, + 0x72, 0x73, 0x18, 0x13, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0a, 0x61, 0x70, 0x70, 0x65, 0x6e, 0x64, + 0x53, 0x74, 0x72, 0x73, 0x2a, 0x4d, 0x0a, 0x0b, 0x43, 0x68, 0x61, 0x74, 0x43, 0x68, 0x61, 0x6e, + 0x6e, 0x65, 0x6c, 0x12, 0x09, 0x0a, 0x05, 0x57, 0x6f, 0x72, 0x6c, 0x64, 0x10, 0x00, 0x12, 0x09, + 0x0a, 0x05, 0x55, 0x6e, 0x69, 0x6f, 0x6e, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x50, 0x72, 0x69, + 0x76, 0x61, 0x74, 0x65, 0x10, 0x02, 0x12, 0x0f, 0x0a, 0x0b, 0x43, 0x72, 0x6f, 0x73, 0x73, 0x53, + 0x65, 0x72, 0x76, 0x65, 0x72, 0x10, 0x03, 0x12, 0x0a, 0x0a, 0x06, 0x53, 0x79, 0x73, 0x74, 0x65, + 0x6d, 0x10, 0x04, 0x2a, 0x82, 0x01, 0x0a, 0x08, 0x43, 0x68, 0x61, 0x74, 0x54, 0x79, 0x70, 0x65, + 0x12, 0x08, 0x0a, 0x04, 0x54, 0x65, 0x78, 0x74, 0x10, 0x00, 0x12, 0x0f, 0x0a, 0x0b, 0x4d, 0x6f, + 0x6f, 0x6e, 0x66, 0x61, 0x6e, 0x74, 0x61, 0x73, 0x79, 0x10, 0x01, 0x12, 0x09, 0x0a, 0x05, 0x53, + 0x68, 0x61, 0x72, 0x65, 0x10, 0x02, 0x12, 0x0d, 0x0a, 0x09, 0x48, 0x65, 0x72, 0x6f, 0x53, 0x68, + 0x61, 0x72, 0x65, 0x10, 0x03, 0x12, 0x12, 0x0a, 0x0e, 0x45, 0x71, 0x75, 0x69, 0x70, 0x6d, 0x65, + 0x6e, 0x74, 0x53, 0x68, 0x61, 0x72, 0x65, 0x10, 0x04, 0x12, 0x0d, 0x0a, 0x09, 0x49, 0x74, 0x65, + 0x6d, 0x53, 0x68, 0x61, 0x72, 0x65, 0x10, 0x05, 0x12, 0x0b, 0x0a, 0x07, 0x50, 0x61, 0x72, 0x6b, + 0x6f, 0x75, 0x72, 0x10, 0x06, 0x12, 0x11, 0x0a, 0x0d, 0x51, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, + 0x6e, 0x6e, 0x61, 0x69, 0x72, 0x65, 0x10, 0x07, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/pb/chat_msg.pb.go b/pb/chat_msg.pb.go index b0ae85e31..3044e7bc6 100644 --- a/pb/chat_msg.pb.go +++ b/pb/chat_msg.pb.go @@ -377,18 +377,17 @@ type ChatSendReq struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Skin string `protobuf:"bytes,1,opt,name=skin,proto3" json:"skin"` //发送者皮肤 - Gender int32 `protobuf:"varint,2,opt,name=gender,proto3" json:"gender"` //发送者性别 - Uname string `protobuf:"bytes,3,opt,name=uname,proto3" json:"uname"` //用户名 - Ulv int32 `protobuf:"varint,4,opt,name=ulv,proto3" json:"ulv"` //用户等级 - Channel ChatChannel `protobuf:"varint,5,opt,name=channel,proto3,enum=ChatChannel" json:"channel"` //频道 - TargetId string `protobuf:"bytes,6,opt,name=targetId,proto3" json:"targetId"` //目标用户id - Ctype ChatType `protobuf:"varint,7,opt,name=ctype,proto3,enum=ChatType" json:"ctype"` //消息类型 - Content string `protobuf:"bytes,8,opt,name=content,proto3" json:"content"` //内容 - AppendInt int64 `protobuf:"varint,9,opt,name=appendInt,proto3" json:"appendInt" bson:"appendInt"` //聊天附加数据 - AppendStr string `protobuf:"bytes,10,opt,name=appendStr,proto3" json:"appendStr" bson:"appendStr"` //聊天附加数据 - AppendBool string `protobuf:"bytes,11,opt,name=appendBool,proto3" json:"appendBool" bson:"appendBool"` //聊天附加数据 - AppendBytes []byte `protobuf:"bytes,12,opt,name=appendBytes,proto3" json:"appendBytes" bson:"appendInt"` //聊天附加数据 + Avatar string `protobuf:"bytes,1,opt,name=avatar,proto3" json:"avatar"` //用户头像 + Uname string `protobuf:"bytes,2,opt,name=uname,proto3" json:"uname"` //用户名 + Ulv int32 `protobuf:"varint,3,opt,name=ulv,proto3" json:"ulv"` //用户等级 + Channel ChatChannel `protobuf:"varint,4,opt,name=channel,proto3,enum=ChatChannel" json:"channel"` //频道 + TargetId string `protobuf:"bytes,5,opt,name=targetId,proto3" json:"targetId"` //目标用户id + Ctype ChatType `protobuf:"varint,6,opt,name=ctype,proto3,enum=ChatType" json:"ctype"` //消息类型 + Content string `protobuf:"bytes,7,opt,name=content,proto3" json:"content"` //内容 + AppendInt int64 `protobuf:"varint,8,opt,name=appendInt,proto3" json:"appendInt" bson:"appendInt"` //聊天附加数据 + AppendStr string `protobuf:"bytes,9,opt,name=appendStr,proto3" json:"appendStr" bson:"appendStr"` //聊天附加数据 + AppendBool string `protobuf:"bytes,10,opt,name=appendBool,proto3" json:"appendBool" bson:"appendBool"` //聊天附加数据 + AppendBytes []byte `protobuf:"bytes,11,opt,name=appendBytes,proto3" json:"appendBytes" bson:"appendInt"` //聊天附加数据 } func (x *ChatSendReq) Reset() { @@ -423,20 +422,13 @@ func (*ChatSendReq) Descriptor() ([]byte, []int) { return file_chat_chat_msg_proto_rawDescGZIP(), []int{7} } -func (x *ChatSendReq) GetSkin() string { +func (x *ChatSendReq) GetAvatar() string { if x != nil { - return x.Skin + return x.Avatar } return "" } -func (x *ChatSendReq) GetGender() int32 { - if x != nil { - return x.Gender - } - return 0 -} - func (x *ChatSendReq) GetUname() string { if x != nil { return x.Uname @@ -587,32 +579,31 @@ var file_chat_chat_msg_proto_rawDesc = []byte{ 0x30, 0x0a, 0x0f, 0x43, 0x68, 0x61, 0x74, 0x47, 0x65, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1d, 0x0a, 0x05, 0x63, 0x68, 0x61, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x07, 0x2e, 0x44, 0x42, 0x43, 0x68, 0x61, 0x74, 0x52, 0x05, 0x63, 0x68, 0x61, 0x74, - 0x73, 0x22, 0xde, 0x02, 0x0a, 0x0b, 0x43, 0x68, 0x61, 0x74, 0x53, 0x65, 0x6e, 0x64, 0x52, 0x65, - 0x71, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x6b, 0x69, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x04, 0x73, 0x6b, 0x69, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x67, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x67, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x12, 0x14, 0x0a, - 0x05, 0x75, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x75, 0x6e, - 0x61, 0x6d, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x6c, 0x76, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, - 0x52, 0x03, 0x75, 0x6c, 0x76, 0x12, 0x26, 0x0a, 0x07, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, - 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0c, 0x2e, 0x43, 0x68, 0x61, 0x74, 0x43, 0x68, 0x61, - 0x6e, 0x6e, 0x65, 0x6c, 0x52, 0x07, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x12, 0x1a, 0x0a, - 0x08, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x49, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x08, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x05, 0x63, 0x74, 0x79, - 0x70, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x09, 0x2e, 0x43, 0x68, 0x61, 0x74, 0x54, - 0x79, 0x70, 0x65, 0x52, 0x05, 0x63, 0x74, 0x79, 0x70, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, - 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e, - 0x74, 0x65, 0x6e, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x49, 0x6e, - 0x74, 0x18, 0x09, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x61, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x49, - 0x6e, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x53, 0x74, 0x72, 0x18, - 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x53, 0x74, 0x72, - 0x12, 0x1e, 0x0a, 0x0a, 0x61, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x42, 0x6f, 0x6f, 0x6c, 0x18, 0x0b, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x61, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x42, 0x6f, 0x6f, 0x6c, - 0x12, 0x20, 0x0a, 0x0b, 0x61, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x42, 0x79, 0x74, 0x65, 0x73, 0x18, - 0x0c, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0b, 0x61, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x42, 0x79, 0x74, - 0x65, 0x73, 0x22, 0x26, 0x0a, 0x0c, 0x43, 0x68, 0x61, 0x74, 0x53, 0x65, 0x6e, 0x64, 0x52, 0x65, - 0x73, 0x70, 0x12, 0x16, 0x0a, 0x06, 0x69, 0x73, 0x73, 0x75, 0x63, 0x63, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x08, 0x52, 0x06, 0x69, 0x73, 0x73, 0x75, 0x63, 0x63, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, - 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x73, 0x22, 0xca, 0x02, 0x0a, 0x0b, 0x43, 0x68, 0x61, 0x74, 0x53, 0x65, 0x6e, 0x64, 0x52, 0x65, + 0x71, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x06, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x75, 0x6e, 0x61, + 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x75, 0x6e, 0x61, 0x6d, 0x65, 0x12, + 0x10, 0x0a, 0x03, 0x75, 0x6c, 0x76, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x75, 0x6c, + 0x76, 0x12, 0x26, 0x0a, 0x07, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x0e, 0x32, 0x0c, 0x2e, 0x43, 0x68, 0x61, 0x74, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, + 0x52, 0x07, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x12, 0x1a, 0x0a, 0x08, 0x74, 0x61, 0x72, + 0x67, 0x65, 0x74, 0x49, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x74, 0x61, 0x72, + 0x67, 0x65, 0x74, 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x05, 0x63, 0x74, 0x79, 0x70, 0x65, 0x18, 0x06, + 0x20, 0x01, 0x28, 0x0e, 0x32, 0x09, 0x2e, 0x43, 0x68, 0x61, 0x74, 0x54, 0x79, 0x70, 0x65, 0x52, + 0x05, 0x63, 0x74, 0x79, 0x70, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, + 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, + 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x49, 0x6e, 0x74, 0x18, 0x08, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x09, 0x61, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x49, 0x6e, 0x74, 0x12, 0x1c, + 0x0a, 0x09, 0x61, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x53, 0x74, 0x72, 0x18, 0x09, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x09, 0x61, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x53, 0x74, 0x72, 0x12, 0x1e, 0x0a, 0x0a, + 0x61, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x42, 0x6f, 0x6f, 0x6c, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0a, 0x61, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x42, 0x6f, 0x6f, 0x6c, 0x12, 0x20, 0x0a, 0x0b, + 0x61, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x42, 0x79, 0x74, 0x65, 0x73, 0x18, 0x0b, 0x20, 0x01, 0x28, + 0x0c, 0x52, 0x0b, 0x61, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x42, 0x79, 0x74, 0x65, 0x73, 0x22, 0x26, + 0x0a, 0x0c, 0x43, 0x68, 0x61, 0x74, 0x53, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x70, 0x12, 0x16, + 0x0a, 0x06, 0x69, 0x73, 0x73, 0x75, 0x63, 0x63, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, + 0x69, 0x73, 0x73, 0x75, 0x63, 0x63, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var (