diff --git a/lego/utils/codec/factory/factory_map.go b/lego/utils/codec/factory/factory_map.go index 08e9f6909..eac42c436 100644 --- a/lego/utils/codec/factory/factory_map.go +++ b/lego/utils/codec/factory/factory_map.go @@ -154,7 +154,7 @@ func (this *sortKeysMapEncoder) EncodeToMapJson(ptr unsafe.Pointer, w codecore.I err = keystream.Error() return } - k = string(keystream.Buffer()) + k = BytesToString(keystream.Buffer()) } else { k = *((*string)(key)) } @@ -164,7 +164,7 @@ func (this *sortKeysMapEncoder) EncodeToMapJson(ptr unsafe.Pointer, w codecore.I err = elemstream.Error() return } - v = string(elemstream.Buffer()) + v = BytesToString(elemstream.Buffer()) } else { v = *((*string)(elem)) } @@ -228,7 +228,7 @@ func (this *mapEncoder) EncodeToMapJson(ptr unsafe.Pointer, w codecore.IWriter) err = keystream.Error() return } - k = string(keystream.Buffer()) + k = BytesToString(keystream.Buffer()) } else { k = *((*string)(key)) } @@ -238,7 +238,7 @@ func (this *mapEncoder) EncodeToMapJson(ptr unsafe.Pointer, w codecore.IWriter) err = elemstream.Error() return } - v = string(elemstream.Buffer()) + v = BytesToString(elemstream.Buffer()) } else { v = *((*string)(elem)) } diff --git a/lego/utils/codec/factory/factory_slice.go b/lego/utils/codec/factory/factory_slice.go index 2727f9e1f..c093efdcd 100644 --- a/lego/utils/codec/factory/factory_slice.go +++ b/lego/utils/codec/factory/factory_slice.go @@ -76,7 +76,7 @@ func (this *sliceEncoder) EncodeToSliceJson(ptr unsafe.Pointer, w codecore.IWrit err = w.Error() return } - ret[i] = string(w.Buffer()) + ret[i] = BytesToString(w.Buffer()) w.Reset() } return diff --git a/lego/utils/codec/json/writer.go b/lego/utils/codec/json/writer.go index 3b083dfc1..1bc814427 100644 --- a/lego/utils/codec/json/writer.go +++ b/lego/utils/codec/json/writer.go @@ -153,7 +153,7 @@ func (this *JsonWriter) WriteBytes(val []byte) { this.buf = append(this.buf, val...) } func (this *JsonWriter) Reset() { - this.buf = this.buf[:0] + this.buf = []byte{} this.err = nil this.indention = 0 return diff --git a/modules/chat/api_send.go b/modules/chat/api_send.go index 5501ba104..9b6f05f36 100644 --- a/modules/chat/api_send.go +++ b/modules/chat/api_send.go @@ -40,7 +40,7 @@ func (this *apiComp) Send(session comm.IUserSession, req *pb.ChatSendReq) (code Id: primitive.NewObjectID().Hex(), Channel: req.Channel, Suid: session.GetUserId(), - AreaId: user.Avatar, + Avatar: user.Avatar, Content: req.Content, Ctime: time.Now().Unix(), } diff --git a/modules/forum/api_releasecomment.go b/modules/forum/api_releasecomment.go index 0b594d73d..533005ca4 100644 --- a/modules/forum/api_releasecomment.go +++ b/modules/forum/api_releasecomment.go @@ -31,9 +31,11 @@ func (this *apiComp) ReleaseComment(session comm.IUserSession, req *pb.ForumRele Heroid: req.Herocid, Heroobjid: req.Herooid, Uid: session.GetUserId(), + Stage: session.GetServiecTag(), Avatar: req.Avatar, Uname: req.Uname, Ctime: time.Now().Unix(), + Content: req.Content, } if err = this.module.modelForum.releaseComment(comment); err != nil { code = pb.ErrorCode_DBError diff --git a/modules/gateway/agent.go b/modules/gateway/agent.go index 2813b39a4..dd533764a 100644 --- a/modules/gateway/agent.go +++ b/modules/gateway/agent.go @@ -153,11 +153,11 @@ func (this *Agent) decodeUserData(msg *pb.UserMessage) (code pb.ErrorCode, err e //只有login的时候才需要设置Data if msg.MainType == string(comm.ModuleUser) && msg.SubType == "login" { - serverId := jsonRet.Get("serverId").Int() + serverId := jsonRet.Get("serverId").String() account := jsonRet.Get("account").String() req := &pb.UserLoginReq{ Account: account, - Sid: int32(serverId), + Sid: serverId, } ad, err := anypb.New(req) if err != nil { diff --git a/modules/user/model_user.go b/modules/user/model_user.go index 0b55e5ec2..df0071823 100644 --- a/modules/user/model_user.go +++ b/modules/user/model_user.go @@ -33,7 +33,7 @@ func (this *ModelUser) Init(service core.IService, module core.IModule, comp cor return } -func (this *ModelUser) FindByAccount(sid int32, account string) (*pb.DBUser, error) { +func (this *ModelUser) FindByAccount(sid string, account string) (*pb.DBUser, error) { filter := bson.M{ "sid": sid, "binduid": account, @@ -60,7 +60,7 @@ func (this *ModelUser) User_Create(user *pb.DBUser) (err error) { now := time.Now().Unix() _id := primitive.NewObjectID().Hex() user.Id = _id - user.Uid = fmt.Sprintf("%d_%s", user.Sid, _id) + user.Uid = fmt.Sprintf("%s_%s", user.Sid, _id) user.Uuid = uuid.NewV4().String() user.Lv = 1 //初始等级 user.Ctime = now diff --git a/pb/chat_db.pb.go b/pb/chat_db.pb.go index b975bce40..60f1d04cd 100644 --- a/pb/chat_db.pb.go +++ b/pb/chat_db.pb.go @@ -87,7 +87,7 @@ type DBChat struct { Groud int32 `protobuf:"varint,5,opt,name=groud,proto3" json:"groud"` //跨服频道 分组id AreaId int32 `protobuf:"varint,6,opt,name=areaId,proto3" json:"areaId"` //跨服频道 频道Id UnionId string `protobuf:"bytes,7,opt,name=unionId,proto3" json:"unionId"` //工会id - Avatar int32 `protobuf:"varint,8,opt,name=avatar,proto3" json:"avatar"` //用户头像 + Avatar string `protobuf:"bytes,8,opt,name=avatar,proto3" json:"avatar"` //用户头像 Uname string `protobuf:"bytes,9,opt,name=uname,proto3" json:"uname"` //用户名 Content string `protobuf:"bytes,10,opt,name=content,proto3" json:"content"` //内容 Ctime int64 `protobuf:"varint,11,opt,name=ctime,proto3" json:"ctime"` //创建时间 @@ -174,11 +174,11 @@ func (x *DBChat) GetUnionId() string { return "" } -func (x *DBChat) GetAvatar() int32 { +func (x *DBChat) GetAvatar() string { if x != nil { return x.Avatar } - return 0 + return "" } func (x *DBChat) GetUname() string { @@ -218,7 +218,7 @@ var file_chat_chat_db_proto_rawDesc = []byte{ 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x61, 0x72, 0x65, 0x61, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x75, 0x6e, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x75, 0x6e, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x76, 0x61, 0x74, 0x61, - 0x72, 0x18, 0x08, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x12, + 0x72, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x75, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x75, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, diff --git a/pb/chat_msg.pb.go b/pb/chat_msg.pb.go index 6a247b675..a8c238151 100644 --- a/pb/chat_msg.pb.go +++ b/pb/chat_msg.pb.go @@ -465,9 +465,11 @@ type ChatSendReq struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Channel ChatChannel `protobuf:"varint,1,opt,name=channel,proto3,enum=ChatChannel" json:"channel"` //频道 - TargetId string `protobuf:"bytes,2,opt,name=targetId,proto3" json:"targetId"` //目标用户id - Content string `protobuf:"bytes,3,opt,name=content,proto3" json:"content"` //内容 + Avatar string `protobuf:"bytes,1,opt,name=avatar,proto3" json:"avatar"` //用户头像 + Uname string `protobuf:"bytes,2,opt,name=uname,proto3" json:"uname"` //用户名 + Channel ChatChannel `protobuf:"varint,3,opt,name=channel,proto3,enum=ChatChannel" json:"channel"` //频道 + TargetId string `protobuf:"bytes,4,opt,name=targetId,proto3" json:"targetId"` //目标用户id + Content string `protobuf:"bytes,5,opt,name=content,proto3" json:"content"` //内容 } func (x *ChatSendReq) Reset() { @@ -502,6 +504,20 @@ func (*ChatSendReq) Descriptor() ([]byte, []int) { return file_chat_chat_msg_proto_rawDescGZIP(), []int{9} } +func (x *ChatSendReq) GetAvatar() string { + if x != nil { + return x.Avatar + } + return "" +} + +func (x *ChatSendReq) GetUname() string { + if x != nil { + return x.Uname + } + return "" +} + func (x *ChatSendReq) GetChannel() ChatChannel { if x != nil { return x.Channel @@ -568,8 +584,10 @@ type ChatSpanSendReq struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Channel ChatChannel `protobuf:"varint,1,opt,name=channel,proto3,enum=ChatChannel" json:"channel"` //频道 - Content string `protobuf:"bytes,2,opt,name=content,proto3" json:"content"` //内容 + Avatar string `protobuf:"bytes,1,opt,name=avatar,proto3" json:"avatar"` //用户头像 + Uname string `protobuf:"bytes,2,opt,name=uname,proto3" json:"uname"` //用户名 + Channel ChatChannel `protobuf:"varint,3,opt,name=channel,proto3,enum=ChatChannel" json:"channel"` //频道 + Content string `protobuf:"bytes,4,opt,name=content,proto3" json:"content"` //内容 } func (x *ChatSpanSendReq) Reset() { @@ -604,6 +622,20 @@ func (*ChatSpanSendReq) Descriptor() ([]byte, []int) { return file_chat_chat_msg_proto_rawDescGZIP(), []int{11} } +func (x *ChatSpanSendReq) GetAvatar() string { + if x != nil { + return x.Avatar + } + return "" +} + +func (x *ChatSpanSendReq) GetUname() string { + if x != nil { + return x.Uname + } + return "" +} + func (x *ChatSpanSendReq) GetChannel() ChatChannel { if x != nil { return x.Channel @@ -694,23 +726,28 @@ var file_chat_chat_msg_proto_rawDesc = []byte{ 0x6e, 0x65, 0x6c, 0x49, 0x64, 0x22, 0x34, 0x0a, 0x13, 0x43, 0x68, 0x61, 0x74, 0x53, 0x70, 0x61, 0x6e, 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, 0x6b, 0x0a, 0x0b, 0x43, - 0x68, 0x61, 0x74, 0x53, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x12, 0x26, 0x0a, 0x07, 0x63, 0x68, - 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x18, 0x01, 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, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x49, 0x64, 0x12, 0x18, - 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x22, 0x0e, 0x0a, 0x0c, 0x43, 0x68, 0x61, 0x74, - 0x53, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x70, 0x22, 0x53, 0x0a, 0x0f, 0x43, 0x68, 0x61, 0x74, - 0x53, 0x70, 0x61, 0x6e, 0x53, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x12, 0x26, 0x0a, 0x07, 0x63, - 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x18, 0x01, 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, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x22, 0x12, 0x0a, - 0x10, 0x43, 0x68, 0x61, 0x74, 0x53, 0x70, 0x61, 0x6e, 0x53, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x73, - 0x70, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x33, + 0x43, 0x68, 0x61, 0x74, 0x52, 0x05, 0x63, 0x68, 0x61, 0x74, 0x73, 0x22, 0x99, 0x01, 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, 0x26, 0x0a, 0x07, 0x63, 0x68, 0x61, + 0x6e, 0x6e, 0x65, 0x6c, 0x18, 0x03, 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, 0x04, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x08, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x49, 0x64, 0x12, 0x18, 0x0a, + 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, + 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x22, 0x0e, 0x0a, 0x0c, 0x43, 0x68, 0x61, 0x74, 0x53, + 0x65, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x70, 0x22, 0x81, 0x01, 0x0a, 0x0f, 0x43, 0x68, 0x61, 0x74, + 0x53, 0x70, 0x61, 0x6e, 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, 0x26, 0x0a, 0x07, 0x63, 0x68, 0x61, + 0x6e, 0x6e, 0x65, 0x6c, 0x18, 0x03, 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, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x22, 0x12, 0x0a, 0x10, 0x43, + 0x68, 0x61, 0x74, 0x53, 0x70, 0x61, 0x6e, 0x53, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x70, 0x42, + 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/pb/forum_db.pb.go b/pb/forum_db.pb.go index 247185a15..e40c73a44 100644 --- a/pb/forum_db.pb.go +++ b/pb/forum_db.pb.go @@ -77,7 +77,7 @@ type DBComment struct { Heroobjid string `protobuf:"bytes,3,opt,name=heroobjid,proto3" json:"heroobjid"` //目标英雄的实例id Uid string `protobuf:"bytes,4,opt,name=uid,proto3" json:"uid"` //发送用户id Stage string `protobuf:"bytes,5,opt,name=stage,proto3" json:"stage"` //区服id - Avatar int32 `protobuf:"varint,6,opt,name=avatar,proto3" json:"avatar"` //用户头像 + Avatar string `protobuf:"bytes,6,opt,name=avatar,proto3" json:"avatar"` //用户头像 Uname string `protobuf:"bytes,7,opt,name=uname,proto3" json:"uname"` //用户名 State CommentState `protobuf:"varint,8,opt,name=state,proto3,enum=CommentState" json:"state"` //状态 Ctime int64 `protobuf:"varint,9,opt,name=ctime,proto3" json:"ctime"` //发布时间 @@ -152,11 +152,11 @@ func (x *DBComment) GetStage() string { return "" } -func (x *DBComment) GetAvatar() int32 { +func (x *DBComment) GetAvatar() string { if x != nil { return x.Avatar } - return 0 + return "" } func (x *DBComment) GetUname() string { @@ -207,7 +207,7 @@ var file_forum_forum_db_proto_rawDesc = []byte{ 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x67, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x73, 0x74, 0x61, 0x67, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x18, 0x06, 0x20, 0x01, - 0x28, 0x05, 0x52, 0x06, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x75, 0x6e, + 0x28, 0x09, 0x52, 0x06, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x75, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x75, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x23, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0d, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x05, diff --git a/pb/forum_msg.pb.go b/pb/forum_msg.pb.go index ba6fe8ebc..0dc4b4c0e 100644 --- a/pb/forum_msg.pb.go +++ b/pb/forum_msg.pb.go @@ -122,7 +122,7 @@ type ForumReleaseCommentReq struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Avatar int32 `protobuf:"varint,1,opt,name=avatar,proto3" json:"avatar"` //用户头像 + Avatar string `protobuf:"bytes,1,opt,name=avatar,proto3" json:"avatar"` //用户头像 Uname string `protobuf:"bytes,2,opt,name=uname,proto3" json:"uname"` //用户名 Herocid string `protobuf:"bytes,3,opt,name=herocid,proto3" json:"herocid"` //英雄的配置id Herooid string `protobuf:"bytes,4,opt,name=herooid,proto3" json:"herooid"` //英雄的实例id @@ -161,11 +161,11 @@ func (*ForumReleaseCommentReq) Descriptor() ([]byte, []int) { return file_forum_forum_msg_proto_rawDescGZIP(), []int{2} } -func (x *ForumReleaseCommentReq) GetAvatar() int32 { +func (x *ForumReleaseCommentReq) GetAvatar() string { if x != nil { return x.Avatar } - return 0 + return "" } func (x *ForumReleaseCommentReq) GetUname() string { @@ -380,7 +380,7 @@ var file_forum_forum_msg_proto_rawDesc = []byte{ 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x22, 0x94, 0x01, 0x0a, 0x16, 0x46, 0x6f, 0x72, 0x75, 0x6d, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x05, 0x52, 0x06, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x75, + 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, 0x18, 0x0a, 0x07, 0x68, 0x65, 0x72, 0x6f, 0x63, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x68, 0x65, 0x72, 0x6f, 0x63, 0x69, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x68, diff --git a/pb/user_db.pb.go b/pb/user_db.pb.go index fb36bda72..4be60900e 100644 --- a/pb/user_db.pb.go +++ b/pb/user_db.pb.go @@ -109,13 +109,13 @@ type DBUser struct { Uuid string `protobuf:"bytes,3,opt,name=uuid,proto3" json:"uuid" bson:"uuid"` //玩家唯一uuid Binduid string `protobuf:"bytes,4,opt,name=binduid,proto3" json:"binduid" bson:"binduid"` //玩家账号 Name string `protobuf:"bytes,5,opt,name=name,proto3" json:"name" bson:"name"` //玩家名 - Sid int32 `protobuf:"varint,6,opt,name=sid,proto3" json:"sid" bson:"sid"` //区服id + Sid string `protobuf:"bytes,6,opt,name=sid,proto3" json:"sid" bson:"sid"` //区服id Createip string `protobuf:"bytes,7,opt,name=createip,proto3" json:"createip" bson:"createip"` //创建账号时的ip Lastloginip string `protobuf:"bytes,8,opt,name=lastloginip,proto3" json:"lastloginip" bson:"lastloginip"` //最后一次登录时的ip Ctime int64 `protobuf:"varint,9,opt,name=ctime,proto3" json:"ctime" bson:"ctime"` //玩家创号时间戳 Logintime int64 `protobuf:"varint,10,opt,name=logintime,proto3" json:"logintime" bson:"logintime"` //最后一次登录时间 FriendPoint int32 `protobuf:"varint,11,opt,name=friendPoint,proto3" json:"friendPoint" bson:"friendPoint"` //友情点 - Avatar int32 `protobuf:"varint,12,opt,name=avatar,proto3" json:"avatar" bson:"avatar"` //头像 + Avatar string `protobuf:"bytes,12,opt,name=avatar,proto3" json:"avatar" bson:"avatar"` //头像 Gold int32 `protobuf:"varint,13,opt,name=gold,proto3" json:"gold" bson:"gold"` //金币 Exp int32 `protobuf:"varint,14,opt,name=exp,proto3" json:"exp" bson:"exp"` //经验 Created bool `protobuf:"varint,15,opt,name=created,proto3" json:"created" bson:"created"` //创角 @@ -192,11 +192,11 @@ func (x *DBUser) GetName() string { return "" } -func (x *DBUser) GetSid() int32 { +func (x *DBUser) GetSid() string { if x != nil { return x.Sid } - return 0 + return "" } func (x *DBUser) GetCreateip() string { @@ -234,11 +234,11 @@ func (x *DBUser) GetFriendPoint() int32 { return 0 } -func (x *DBUser) GetAvatar() int32 { +func (x *DBUser) GetAvatar() string { if x != nil { return x.Avatar } - return 0 + return "" } func (x *DBUser) GetGold() int32 { @@ -454,7 +454,7 @@ var file_user_user_db_proto_rawDesc = []byte{ 0x18, 0x0a, 0x07, 0x62, 0x69, 0x6e, 0x64, 0x75, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x62, 0x69, 0x6e, 0x64, 0x75, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x10, 0x0a, - 0x03, 0x73, 0x69, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x73, 0x69, 0x64, 0x12, + 0x03, 0x73, 0x69, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x73, 0x69, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x69, 0x70, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x69, 0x70, 0x12, 0x20, 0x0a, 0x0b, 0x6c, 0x61, 0x73, 0x74, 0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x69, 0x70, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, @@ -465,7 +465,7 @@ var file_user_user_db_proto_rawDesc = []byte{ 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x18, 0x0c, 0x20, - 0x01, 0x28, 0x05, 0x52, 0x06, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x67, + 0x01, 0x28, 0x09, 0x52, 0x06, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x67, 0x6f, 0x6c, 0x64, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x67, 0x6f, 0x6c, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x65, 0x78, 0x70, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x65, 0x78, 0x70, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x18, 0x0f, 0x20, 0x01, diff --git a/pb/user_msg.pb.go b/pb/user_msg.pb.go index ea133282f..b1fe33391 100644 --- a/pb/user_msg.pb.go +++ b/pb/user_msg.pb.go @@ -27,7 +27,7 @@ type UserLoginReq struct { unknownFields protoimpl.UnknownFields Account string `protobuf:"bytes,1,opt,name=account,proto3" json:"account"` //账号 - Sid int32 `protobuf:"varint,2,opt,name=sid,proto3" json:"sid"` //区服编号 + Sid string `protobuf:"bytes,2,opt,name=sid,proto3" json:"sid"` //区服编号 } func (x *UserLoginReq) Reset() { @@ -69,11 +69,11 @@ func (x *UserLoginReq) GetAccount() string { return "" } -func (x *UserLoginReq) GetSid() int32 { +func (x *UserLoginReq) GetSid() string { if x != nil { return x.Sid } - return 0 + return "" } type UserLoginResp struct { @@ -223,7 +223,7 @@ type UserRegisterReq struct { unknownFields protoimpl.UnknownFields Account string `protobuf:"bytes,1,opt,name=account,proto3" json:"account"` - Sid int32 `protobuf:"varint,2,opt,name=sid,proto3" json:"sid"` + Sid string `protobuf:"bytes,2,opt,name=sid,proto3" json:"sid"` } func (x *UserRegisterReq) Reset() { @@ -265,11 +265,11 @@ func (x *UserRegisterReq) GetAccount() string { return "" } -func (x *UserRegisterReq) GetSid() int32 { +func (x *UserRegisterReq) GetSid() string { if x != nil { return x.Sid } - return 0 + return "" } type UserRegisterResp struct { @@ -1524,7 +1524,7 @@ var file_user_user_msg_proto_rawDesc = []byte{ 0x6e, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x3a, 0x0a, 0x0c, 0x55, 0x73, 0x65, 0x72, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x63, 0x63, 0x6f, 0x75, - 0x6e, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x73, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x6e, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x73, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x73, 0x69, 0x64, 0x22, 0x65, 0x0a, 0x0d, 0x55, 0x73, 0x65, 0x72, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1b, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x07, 0x2e, 0x44, 0x42, 0x55, 0x73, 0x65, 0x72, 0x52, 0x04, 0x64, 0x61, @@ -1537,7 +1537,7 @@ var file_user_user_msg_proto_rawDesc = []byte{ 0x0a, 0x0f, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x71, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x73, - 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x73, 0x69, 0x64, 0x22, 0x4c, 0x0a, + 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x73, 0x69, 0x64, 0x22, 0x4c, 0x0a, 0x10, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1e, 0x0a, 0x04, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0a, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x04, 0x43, 0x6f, 0x64,