diff --git a/.gitignore b/.gitignore index 0b3f572a..50cd6fa1 100644 --- a/.gitignore +++ b/.gitignore @@ -17,4 +17,5 @@ __pycache__ node_modules/ nohup.out bin/ -.idea \ No newline at end of file +.idea +.vscode \ No newline at end of file diff --git a/server/guildserver/go.sum b/server/guildserver/go.sum new file mode 100644 index 00000000..e31bb169 --- /dev/null +++ b/server/guildserver/go.sum @@ -0,0 +1,16 @@ +github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= +github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= +github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= +github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= +github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= +github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= +google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= +google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= +google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= +google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= +google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= diff --git a/server/hallserver/go.sum b/server/hallserver/go.sum new file mode 100644 index 00000000..e31bb169 --- /dev/null +++ b/server/hallserver/go.sum @@ -0,0 +1,16 @@ +github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= +github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= +github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= +github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= +github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= +github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= +google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= +google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= +google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= +google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= +google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= diff --git a/server/imserver/cs/cs.auto_gen.go b/server/imserver/cs/cs.auto_gen.go index 1b59d7e8..424f214b 100644 --- a/server/imserver/cs/cs.auto_gen.go +++ b/server/imserver/cs/cs.auto_gen.go @@ -5,25 +5,20 @@ import ( proto "github.com/golang/protobuf/proto" ) +type CsNetMsgHandler f5.NetMsgHandler[MsgHandler]; + type MsgHandlerImpl struct { } -type NetMsgHandler struct { - MsgId int - HandlerId int - parseCb func([]byte) interface{} - cb func(*f5.MsgHdr, MsgHandler) -} +var handlers [2000]*CsNetMsgHandler -var handlers [2000]*NetMsgHandler - -func GetNetMsgHandler(msgId uint16) *NetMsgHandler { +func GetNetMsgHandler(msgId uint16) *CsNetMsgHandler { handler := handlers[msgId] return handler } -func DispatchMsg(handler *NetMsgHandler, hdr *f5.MsgHdr, msgHandler MsgHandler) { - handler.cb(hdr, msgHandler) +func DispatchMsg(handler *CsNetMsgHandler, hdr *f5.MsgHdr, msgHandler MsgHandler) { + handler.Cb(hdr, msgHandler) } func RegHandlerId(msgId int, handlerId int) { @@ -36,18 +31,21 @@ func ParsePb(msgId uint16, data []byte) interface{} { if handler == nil { return nil } - return handler.parseCb(data) + return handler.ParseCb(data) } type MsgHandler interface { CMPing(*f5.MsgHdr, *CMPing) CMLogin(*f5.MsgHdr, *CMLogin) CMReconnect(*f5.MsgHdr, *CMReconnect) - CMSearchFriend(*f5.MsgHdr, *CMSearchFriend) - CMListPendingFriendRequest(*f5.MsgHdr, *CMListPendingFriendRequest) + CMSearchUser(*f5.MsgHdr, *CMSearchUser) + CMSearchUserByAccountId(*f5.MsgHdr, *CMSearchUserByAccountId) CMAddFriendRequest(*f5.MsgHdr, *CMAddFriendRequest) CMAcceptFriendRequest(*f5.MsgHdr, *CMAcceptFriendRequest) + CMRejectFriendRequest(*f5.MsgHdr, *CMRejectFriendRequest) + CMListPendingFriendRequest(*f5.MsgHdr, *CMListPendingFriendRequest) CMListFriend(*f5.MsgHdr, *CMListFriend) + CMDeleteFriendShip(*f5.MsgHdr, *CMDeleteFriendShip) } func (this *MsgHandlerImpl) CMPing(hdr *f5.MsgHdr, msg *CMPing) { @@ -59,10 +57,10 @@ func (this *MsgHandlerImpl) CMLogin(hdr *f5.MsgHdr, msg *CMLogin) { func (this *MsgHandlerImpl) CMReconnect(hdr *f5.MsgHdr, msg *CMReconnect) { } -func (this *MsgHandlerImpl) CMSearchFriend(hdr *f5.MsgHdr, msg *CMSearchFriend) { +func (this *MsgHandlerImpl) CMSearchUser(hdr *f5.MsgHdr, msg *CMSearchUser) { } -func (this *MsgHandlerImpl) CMListPendingFriendRequest(hdr *f5.MsgHdr, msg *CMListPendingFriendRequest) { +func (this *MsgHandlerImpl) CMSearchUserByAccountId(hdr *f5.MsgHdr, msg *CMSearchUserByAccountId) { } func (this *MsgHandlerImpl) CMAddFriendRequest(hdr *f5.MsgHdr, msg *CMAddFriendRequest) { @@ -71,9 +69,18 @@ func (this *MsgHandlerImpl) CMAddFriendRequest(hdr *f5.MsgHdr, msg *CMAddFriendR func (this *MsgHandlerImpl) CMAcceptFriendRequest(hdr *f5.MsgHdr, msg *CMAcceptFriendRequest) { } +func (this *MsgHandlerImpl) CMRejectFriendRequest(hdr *f5.MsgHdr, msg *CMRejectFriendRequest) { +} + +func (this *MsgHandlerImpl) CMListPendingFriendRequest(hdr *f5.MsgHdr, msg *CMListPendingFriendRequest) { +} + func (this *MsgHandlerImpl) CMListFriend(hdr *f5.MsgHdr, msg *CMListFriend) { } +func (this *MsgHandlerImpl) CMDeleteFriendShip(hdr *f5.MsgHdr, msg *CMDeleteFriendShip) { +} + func (this *CMPing) GetNetMsgId() uint16 { return uint16(CMMessageIdE__CMPing) } @@ -102,20 +109,20 @@ func (this *SMReconnect) GetNetMsgId() uint16 { return uint16(SMMessageIdE__SMReconnect) } -func (this *CMSearchFriend) GetNetMsgId() uint16 { - return uint16(CMMessageIdE__CMSearchFriend) +func (this *CMSearchUser) GetNetMsgId() uint16 { + return uint16(CMMessageIdE__CMSearchUser) } -func (this *SMSearchFriend) GetNetMsgId() uint16 { - return uint16(SMMessageIdE__SMSearchFriend) +func (this *SMSearchUser) GetNetMsgId() uint16 { + return uint16(SMMessageIdE__SMSearchUser) } -func (this *CMListPendingFriendRequest) GetNetMsgId() uint16 { - return uint16(CMMessageIdE__CMListPendingFriendRequest) +func (this *CMSearchUserByAccountId) GetNetMsgId() uint16 { + return uint16(CMMessageIdE__CMSearchUserByAccountId) } -func (this *SMListPendingFriendRequest) GetNetMsgId() uint16 { - return uint16(SMMessageIdE__SMListPendingFriendRequest) +func (this *SMSearchUserByAccountId) GetNetMsgId() uint16 { + return uint16(SMMessageIdE__SMSearchUserByAccountId) } func (this *CMAddFriendRequest) GetNetMsgId() uint16 { @@ -134,6 +141,22 @@ func (this *SMAcceptFriendRequest) GetNetMsgId() uint16 { return uint16(SMMessageIdE__SMAcceptFriendRequest) } +func (this *CMRejectFriendRequest) GetNetMsgId() uint16 { + return uint16(CMMessageIdE__CMRejectFriendRequest) +} + +func (this *SMRejectFriendRequest) GetNetMsgId() uint16 { + return uint16(SMMessageIdE__SMRejectFriendRequest) +} + +func (this *CMListPendingFriendRequest) GetNetMsgId() uint16 { + return uint16(CMMessageIdE__CMListPendingFriendRequest) +} + +func (this *SMListPendingFriendRequest) GetNetMsgId() uint16 { + return uint16(SMMessageIdE__SMListPendingFriendRequest) +} + func (this *CMListFriend) GetNetMsgId() uint16 { return uint16(CMMessageIdE__CMListFriend) } @@ -142,102 +165,146 @@ func (this *SMListFriend) GetNetMsgId() uint16 { return uint16(SMMessageIdE__SMListFriend) } +func (this *CMDeleteFriendShip) GetNetMsgId() uint16 { + return uint16(CMMessageIdE__CMDeleteFriendShip) +} + +func (this *SMDeleteFriendShip) GetNetMsgId() uint16 { + return uint16(SMMessageIdE__SMDeleteFriendShip) +} + func init() { - handlers[int(CMMessageIdE__CMPing)] = &NetMsgHandler{ + handlers[int(CMMessageIdE__CMPing)] = &CsNetMsgHandler{ MsgId: int(CMMessageIdE__CMPing), - parseCb: func (data []byte) interface{} { + ParseCb: func (data []byte) interface{} { msg := &CMPing{} proto.Unmarshal(data, msg) return msg }, - cb: func (hdr *f5.MsgHdr, handler MsgHandler) { + Cb: func (hdr *f5.MsgHdr, handler MsgHandler) { handler.CMPing(hdr, hdr.Msg.(*CMPing)) }, } - handlers[int(CMMessageIdE__CMLogin)] = &NetMsgHandler{ + handlers[int(CMMessageIdE__CMLogin)] = &CsNetMsgHandler{ MsgId: int(CMMessageIdE__CMLogin), - parseCb: func (data []byte) interface{} { + ParseCb: func (data []byte) interface{} { msg := &CMLogin{} proto.Unmarshal(data, msg) return msg }, - cb: func (hdr *f5.MsgHdr, handler MsgHandler) { + Cb: func (hdr *f5.MsgHdr, handler MsgHandler) { handler.CMLogin(hdr, hdr.Msg.(*CMLogin)) }, } - handlers[int(CMMessageIdE__CMReconnect)] = &NetMsgHandler{ + handlers[int(CMMessageIdE__CMReconnect)] = &CsNetMsgHandler{ MsgId: int(CMMessageIdE__CMReconnect), - parseCb: func (data []byte) interface{} { + ParseCb: func (data []byte) interface{} { msg := &CMReconnect{} proto.Unmarshal(data, msg) return msg }, - cb: func (hdr *f5.MsgHdr, handler MsgHandler) { + Cb: func (hdr *f5.MsgHdr, handler MsgHandler) { handler.CMReconnect(hdr, hdr.Msg.(*CMReconnect)) }, } - handlers[int(CMMessageIdE__CMSearchFriend)] = &NetMsgHandler{ - MsgId: int(CMMessageIdE__CMSearchFriend), - parseCb: func (data []byte) interface{} { - msg := &CMSearchFriend{} + handlers[int(CMMessageIdE__CMSearchUser)] = &CsNetMsgHandler{ + MsgId: int(CMMessageIdE__CMSearchUser), + ParseCb: func (data []byte) interface{} { + msg := &CMSearchUser{} proto.Unmarshal(data, msg) return msg }, - cb: func (hdr *f5.MsgHdr, handler MsgHandler) { - handler.CMSearchFriend(hdr, hdr.Msg.(*CMSearchFriend)) + Cb: func (hdr *f5.MsgHdr, handler MsgHandler) { + handler.CMSearchUser(hdr, hdr.Msg.(*CMSearchUser)) }, } - handlers[int(CMMessageIdE__CMListPendingFriendRequest)] = &NetMsgHandler{ - MsgId: int(CMMessageIdE__CMListPendingFriendRequest), - parseCb: func (data []byte) interface{} { - msg := &CMListPendingFriendRequest{} + handlers[int(CMMessageIdE__CMSearchUserByAccountId)] = &CsNetMsgHandler{ + MsgId: int(CMMessageIdE__CMSearchUserByAccountId), + ParseCb: func (data []byte) interface{} { + msg := &CMSearchUserByAccountId{} proto.Unmarshal(data, msg) return msg }, - cb: func (hdr *f5.MsgHdr, handler MsgHandler) { - handler.CMListPendingFriendRequest(hdr, hdr.Msg.(*CMListPendingFriendRequest)) + Cb: func (hdr *f5.MsgHdr, handler MsgHandler) { + handler.CMSearchUserByAccountId(hdr, hdr.Msg.(*CMSearchUserByAccountId)) }, } - handlers[int(CMMessageIdE__CMAddFriendRequest)] = &NetMsgHandler{ + handlers[int(CMMessageIdE__CMAddFriendRequest)] = &CsNetMsgHandler{ MsgId: int(CMMessageIdE__CMAddFriendRequest), - parseCb: func (data []byte) interface{} { + ParseCb: func (data []byte) interface{} { msg := &CMAddFriendRequest{} proto.Unmarshal(data, msg) return msg }, - cb: func (hdr *f5.MsgHdr, handler MsgHandler) { + Cb: func (hdr *f5.MsgHdr, handler MsgHandler) { handler.CMAddFriendRequest(hdr, hdr.Msg.(*CMAddFriendRequest)) }, } - handlers[int(CMMessageIdE__CMAcceptFriendRequest)] = &NetMsgHandler{ + handlers[int(CMMessageIdE__CMAcceptFriendRequest)] = &CsNetMsgHandler{ MsgId: int(CMMessageIdE__CMAcceptFriendRequest), - parseCb: func (data []byte) interface{} { + ParseCb: func (data []byte) interface{} { msg := &CMAcceptFriendRequest{} proto.Unmarshal(data, msg) return msg }, - cb: func (hdr *f5.MsgHdr, handler MsgHandler) { + Cb: func (hdr *f5.MsgHdr, handler MsgHandler) { handler.CMAcceptFriendRequest(hdr, hdr.Msg.(*CMAcceptFriendRequest)) }, } - handlers[int(CMMessageIdE__CMListFriend)] = &NetMsgHandler{ + handlers[int(CMMessageIdE__CMRejectFriendRequest)] = &CsNetMsgHandler{ + MsgId: int(CMMessageIdE__CMRejectFriendRequest), + ParseCb: func (data []byte) interface{} { + msg := &CMRejectFriendRequest{} + proto.Unmarshal(data, msg) + return msg + }, + Cb: func (hdr *f5.MsgHdr, handler MsgHandler) { + handler.CMRejectFriendRequest(hdr, hdr.Msg.(*CMRejectFriendRequest)) + }, + } + + handlers[int(CMMessageIdE__CMListPendingFriendRequest)] = &CsNetMsgHandler{ + MsgId: int(CMMessageIdE__CMListPendingFriendRequest), + ParseCb: func (data []byte) interface{} { + msg := &CMListPendingFriendRequest{} + proto.Unmarshal(data, msg) + return msg + }, + Cb: func (hdr *f5.MsgHdr, handler MsgHandler) { + handler.CMListPendingFriendRequest(hdr, hdr.Msg.(*CMListPendingFriendRequest)) + }, + } + + handlers[int(CMMessageIdE__CMListFriend)] = &CsNetMsgHandler{ MsgId: int(CMMessageIdE__CMListFriend), - parseCb: func (data []byte) interface{} { + ParseCb: func (data []byte) interface{} { msg := &CMListFriend{} proto.Unmarshal(data, msg) return msg }, - cb: func (hdr *f5.MsgHdr, handler MsgHandler) { + Cb: func (hdr *f5.MsgHdr, handler MsgHandler) { handler.CMListFriend(hdr, hdr.Msg.(*CMListFriend)) }, } + handlers[int(CMMessageIdE__CMDeleteFriendShip)] = &CsNetMsgHandler{ + MsgId: int(CMMessageIdE__CMDeleteFriendShip), + ParseCb: func (data []byte) interface{} { + msg := &CMDeleteFriendShip{} + proto.Unmarshal(data, msg) + return msg + }, + Cb: func (hdr *f5.MsgHdr, handler MsgHandler) { + handler.CMDeleteFriendShip(hdr, hdr.Msg.(*CMDeleteFriendShip)) + }, + } + } \ No newline at end of file diff --git a/server/imserver/cs/cs_msgid.pb.go b/server/imserver/cs/cs_msgid.pb.go index 8d57796b..5def06b9 100644 --- a/server/imserver/cs/cs_msgid.pb.go +++ b/server/imserver/cs/cs_msgid.pb.go @@ -27,11 +27,14 @@ const ( CMMessageIdE__CMPing CMMessageIdE = 101 CMMessageIdE__CMLogin CMMessageIdE = 103 CMMessageIdE__CMReconnect CMMessageIdE = 104 - CMMessageIdE__CMSearchFriend CMMessageIdE = 105 - CMMessageIdE__CMListPendingFriendRequest CMMessageIdE = 106 + CMMessageIdE__CMSearchUserByAccountId CMMessageIdE = 105 + CMMessageIdE__CMSearchUser CMMessageIdE = 106 CMMessageIdE__CMAddFriendRequest CMMessageIdE = 107 CMMessageIdE__CMAcceptFriendRequest CMMessageIdE = 108 - CMMessageIdE__CMListFriend CMMessageIdE = 109 + CMMessageIdE__CMRejectFriendRequest CMMessageIdE = 109 + CMMessageIdE__CMListPendingFriendRequest CMMessageIdE = 110 + CMMessageIdE__CMListFriend CMMessageIdE = 111 + CMMessageIdE__CMDeleteFriendShip CMMessageIdE = 112 ) // Enum value maps for CMMessageIdE. @@ -40,21 +43,27 @@ var ( 101: "_CMPing", 103: "_CMLogin", 104: "_CMReconnect", - 105: "_CMSearchFriend", - 106: "_CMListPendingFriendRequest", + 105: "_CMSearchUserByAccountId", + 106: "_CMSearchUser", 107: "_CMAddFriendRequest", 108: "_CMAcceptFriendRequest", - 109: "_CMListFriend", + 109: "_CMRejectFriendRequest", + 110: "_CMListPendingFriendRequest", + 111: "_CMListFriend", + 112: "_CMDeleteFriendShip", } CMMessageIdE_value = map[string]int32{ "_CMPing": 101, "_CMLogin": 103, "_CMReconnect": 104, - "_CMSearchFriend": 105, - "_CMListPendingFriendRequest": 106, + "_CMSearchUserByAccountId": 105, + "_CMSearchUser": 106, "_CMAddFriendRequest": 107, "_CMAcceptFriendRequest": 108, - "_CMListFriend": 109, + "_CMRejectFriendRequest": 109, + "_CMListPendingFriendRequest": 110, + "_CMListFriend": 111, + "_CMDeleteFriendShip": 112, } ) @@ -100,13 +109,16 @@ type SMMessageIdE int32 const ( SMMessageIdE__SMPing SMMessageIdE = 101 SMMessageIdE__SMRpcError SMMessageIdE = 102 + SMMessageIdE__SMLogin SMMessageIdE = 103 SMMessageIdE__SMReconnect SMMessageIdE = 104 - SMMessageIdE__SMSearchFriend SMMessageIdE = 105 - SMMessageIdE__SMListPendingFriendRequest SMMessageIdE = 106 + SMMessageIdE__SMSearchUserByAccountId SMMessageIdE = 105 + SMMessageIdE__SMSearchUser SMMessageIdE = 106 SMMessageIdE__SMAddFriendRequest SMMessageIdE = 107 SMMessageIdE__SMAcceptFriendRequest SMMessageIdE = 108 - SMMessageIdE__SMListFriend SMMessageIdE = 109 - SMMessageIdE__SMLogin SMMessageIdE = 103 + SMMessageIdE__SMRejectFriendRequest SMMessageIdE = 109 + SMMessageIdE__SMListPendingFriendRequest SMMessageIdE = 110 + SMMessageIdE__SMListFriend SMMessageIdE = 111 + SMMessageIdE__SMDeleteFriendShip SMMessageIdE = 112 ) // Enum value maps for SMMessageIdE. @@ -114,24 +126,30 @@ var ( SMMessageIdE_name = map[int32]string{ 101: "_SMPing", 102: "_SMRpcError", + 103: "_SMLogin", 104: "_SMReconnect", - 105: "_SMSearchFriend", - 106: "_SMListPendingFriendRequest", + 105: "_SMSearchUserByAccountId", + 106: "_SMSearchUser", 107: "_SMAddFriendRequest", 108: "_SMAcceptFriendRequest", - 109: "_SMListFriend", - 103: "_SMLogin", + 109: "_SMRejectFriendRequest", + 110: "_SMListPendingFriendRequest", + 111: "_SMListFriend", + 112: "_SMDeleteFriendShip", } SMMessageIdE_value = map[string]int32{ "_SMPing": 101, "_SMRpcError": 102, + "_SMLogin": 103, "_SMReconnect": 104, - "_SMSearchFriend": 105, - "_SMListPendingFriendRequest": 106, + "_SMSearchUserByAccountId": 105, + "_SMSearchUser": 106, "_SMAddFriendRequest": 107, "_SMAcceptFriendRequest": 108, - "_SMListFriend": 109, - "_SMLogin": 103, + "_SMRejectFriendRequest": 109, + "_SMListPendingFriendRequest": 110, + "_SMListFriend": 111, + "_SMDeleteFriendShip": 112, } ) @@ -176,32 +194,42 @@ var File_cs_msgid_proto protoreflect.FileDescriptor var file_cs_msgid_proto_rawDesc = []byte{ 0x0a, 0x0e, 0x63, 0x73, 0x5f, 0x6d, 0x73, 0x67, 0x69, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x12, 0x02, 0x63, 0x73, 0x2a, 0xba, 0x01, 0x0a, 0x0d, 0x43, 0x4d, 0x4d, 0x65, 0x73, 0x73, 0x61, + 0x12, 0x02, 0x63, 0x73, 0x2a, 0x8b, 0x02, 0x0a, 0x0d, 0x43, 0x4d, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x49, 0x64, 0x5f, 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x5f, 0x43, 0x4d, 0x50, 0x69, 0x6e, 0x67, 0x10, 0x65, 0x12, 0x0c, 0x0a, 0x08, 0x5f, 0x43, 0x4d, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x10, 0x67, 0x12, 0x10, 0x0a, 0x0c, 0x5f, 0x43, 0x4d, 0x52, 0x65, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, - 0x74, 0x10, 0x68, 0x12, 0x13, 0x0a, 0x0f, 0x5f, 0x43, 0x4d, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, - 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x10, 0x69, 0x12, 0x1f, 0x0a, 0x1b, 0x5f, 0x43, 0x4d, 0x4c, - 0x69, 0x73, 0x74, 0x50, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x10, 0x6a, 0x12, 0x17, 0x0a, 0x13, 0x5f, 0x43, 0x4d, - 0x41, 0x64, 0x64, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x10, 0x6b, 0x12, 0x1a, 0x0a, 0x16, 0x5f, 0x43, 0x4d, 0x41, 0x63, 0x63, 0x65, 0x70, 0x74, 0x46, - 0x72, 0x69, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x10, 0x6c, 0x12, 0x11, - 0x0a, 0x0d, 0x5f, 0x43, 0x4d, 0x4c, 0x69, 0x73, 0x74, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x10, - 0x6d, 0x2a, 0xcb, 0x01, 0x0a, 0x0d, 0x53, 0x4d, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x49, - 0x64, 0x5f, 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x5f, 0x53, 0x4d, 0x50, 0x69, 0x6e, 0x67, 0x10, 0x65, - 0x12, 0x0f, 0x0a, 0x0b, 0x5f, 0x53, 0x4d, 0x52, 0x70, 0x63, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x10, - 0x66, 0x12, 0x10, 0x0a, 0x0c, 0x5f, 0x53, 0x4d, 0x52, 0x65, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, - 0x74, 0x10, 0x68, 0x12, 0x13, 0x0a, 0x0f, 0x5f, 0x53, 0x4d, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, - 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x10, 0x69, 0x12, 0x1f, 0x0a, 0x1b, 0x5f, 0x53, 0x4d, 0x4c, - 0x69, 0x73, 0x74, 0x50, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x10, 0x6a, 0x12, 0x17, 0x0a, 0x13, 0x5f, 0x53, 0x4d, - 0x41, 0x64, 0x64, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x10, 0x6b, 0x12, 0x1a, 0x0a, 0x16, 0x5f, 0x53, 0x4d, 0x41, 0x63, 0x63, 0x65, 0x70, 0x74, 0x46, - 0x72, 0x69, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x10, 0x6c, 0x12, 0x11, - 0x0a, 0x0d, 0x5f, 0x53, 0x4d, 0x4c, 0x69, 0x73, 0x74, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x10, - 0x6d, 0x12, 0x0c, 0x0a, 0x08, 0x5f, 0x53, 0x4d, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x10, 0x67, 0x42, - 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x63, 0x73, + 0x74, 0x10, 0x68, 0x12, 0x1c, 0x0a, 0x18, 0x5f, 0x43, 0x4d, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, + 0x55, 0x73, 0x65, 0x72, 0x42, 0x79, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x64, 0x10, + 0x69, 0x12, 0x11, 0x0a, 0x0d, 0x5f, 0x43, 0x4d, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x55, 0x73, + 0x65, 0x72, 0x10, 0x6a, 0x12, 0x17, 0x0a, 0x13, 0x5f, 0x43, 0x4d, 0x41, 0x64, 0x64, 0x46, 0x72, + 0x69, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x10, 0x6b, 0x12, 0x1a, 0x0a, + 0x16, 0x5f, 0x43, 0x4d, 0x41, 0x63, 0x63, 0x65, 0x70, 0x74, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x10, 0x6c, 0x12, 0x1a, 0x0a, 0x16, 0x5f, 0x43, 0x4d, + 0x52, 0x65, 0x6a, 0x65, 0x63, 0x74, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x10, 0x6d, 0x12, 0x1f, 0x0a, 0x1b, 0x5f, 0x43, 0x4d, 0x4c, 0x69, 0x73, 0x74, + 0x50, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x10, 0x6e, 0x12, 0x11, 0x0a, 0x0d, 0x5f, 0x43, 0x4d, 0x4c, 0x69, 0x73, + 0x74, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x10, 0x6f, 0x12, 0x17, 0x0a, 0x13, 0x5f, 0x43, 0x4d, + 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x53, 0x68, 0x69, 0x70, + 0x10, 0x70, 0x2a, 0x9c, 0x02, 0x0a, 0x0d, 0x53, 0x4d, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, + 0x49, 0x64, 0x5f, 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x5f, 0x53, 0x4d, 0x50, 0x69, 0x6e, 0x67, 0x10, + 0x65, 0x12, 0x0f, 0x0a, 0x0b, 0x5f, 0x53, 0x4d, 0x52, 0x70, 0x63, 0x45, 0x72, 0x72, 0x6f, 0x72, + 0x10, 0x66, 0x12, 0x0c, 0x0a, 0x08, 0x5f, 0x53, 0x4d, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x10, 0x67, + 0x12, 0x10, 0x0a, 0x0c, 0x5f, 0x53, 0x4d, 0x52, 0x65, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, + 0x10, 0x68, 0x12, 0x1c, 0x0a, 0x18, 0x5f, 0x53, 0x4d, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x55, + 0x73, 0x65, 0x72, 0x42, 0x79, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x64, 0x10, 0x69, + 0x12, 0x11, 0x0a, 0x0d, 0x5f, 0x53, 0x4d, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x55, 0x73, 0x65, + 0x72, 0x10, 0x6a, 0x12, 0x17, 0x0a, 0x13, 0x5f, 0x53, 0x4d, 0x41, 0x64, 0x64, 0x46, 0x72, 0x69, + 0x65, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x10, 0x6b, 0x12, 0x1a, 0x0a, 0x16, + 0x5f, 0x53, 0x4d, 0x41, 0x63, 0x63, 0x65, 0x70, 0x74, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x10, 0x6c, 0x12, 0x1a, 0x0a, 0x16, 0x5f, 0x53, 0x4d, 0x52, + 0x65, 0x6a, 0x65, 0x63, 0x74, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x10, 0x6d, 0x12, 0x1f, 0x0a, 0x1b, 0x5f, 0x53, 0x4d, 0x4c, 0x69, 0x73, 0x74, 0x50, + 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x10, 0x6e, 0x12, 0x11, 0x0a, 0x0d, 0x5f, 0x53, 0x4d, 0x4c, 0x69, 0x73, 0x74, + 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x10, 0x6f, 0x12, 0x17, 0x0a, 0x13, 0x5f, 0x53, 0x4d, 0x44, + 0x65, 0x6c, 0x65, 0x74, 0x65, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x53, 0x68, 0x69, 0x70, 0x10, + 0x70, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x63, 0x73, } var ( diff --git a/server/imserver/cs/cs_proto.pb.go b/server/imserver/cs/cs_proto.pb.go index 6c3bf8eb..8292c6dc 100644 --- a/server/imserver/cs/cs_proto.pb.go +++ b/server/imserver/cs/cs_proto.pb.go @@ -750,18 +750,16 @@ func (x *SMReconnect) GetErrmsg() string { } // 请求搜索用户 -type CMSearchFriend struct { +type CMSearchUser struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - ServerId *int32 `protobuf:"varint,1,opt,name=server_id,json=serverId" json:"server_id,omitempty"` //保留 - TeamUuid *string `protobuf:"bytes,2,opt,name=team_uuid,json=teamUuid" json:"team_uuid,omitempty"` //保留 - SearchKeyword *string `protobuf:"bytes,6,opt,name=search_keyword,json=searchKeyword" json:"search_keyword,omitempty"` //搜索文本关键字 + SearchKeyword *string `protobuf:"bytes,1,opt,name=search_keyword,json=searchKeyword" json:"search_keyword,omitempty"` //搜索文本关键字 } -func (x *CMSearchFriend) Reset() { - *x = CMSearchFriend{} +func (x *CMSearchUser) Reset() { + *x = CMSearchUser{} if protoimpl.UnsafeEnabled { mi := &file_cs_proto_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -769,13 +767,13 @@ func (x *CMSearchFriend) Reset() { } } -func (x *CMSearchFriend) String() string { +func (x *CMSearchUser) String() string { return protoimpl.X.MessageStringOf(x) } -func (*CMSearchFriend) ProtoMessage() {} +func (*CMSearchUser) ProtoMessage() {} -func (x *CMSearchFriend) ProtoReflect() protoreflect.Message { +func (x *CMSearchUser) ProtoReflect() protoreflect.Message { mi := &file_cs_proto_proto_msgTypes[11] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -787,26 +785,12 @@ func (x *CMSearchFriend) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use CMSearchFriend.ProtoReflect.Descriptor instead. -func (*CMSearchFriend) Descriptor() ([]byte, []int) { +// Deprecated: Use CMSearchUser.ProtoReflect.Descriptor instead. +func (*CMSearchUser) Descriptor() ([]byte, []int) { return file_cs_proto_proto_rawDescGZIP(), []int{11} } -func (x *CMSearchFriend) GetServerId() int32 { - if x != nil && x.ServerId != nil { - return *x.ServerId - } - return 0 -} - -func (x *CMSearchFriend) GetTeamUuid() string { - if x != nil && x.TeamUuid != nil { - return *x.TeamUuid - } - return "" -} - -func (x *CMSearchFriend) GetSearchKeyword() string { +func (x *CMSearchUser) GetSearchKeyword() string { if x != nil && x.SearchKeyword != nil { return *x.SearchKeyword } @@ -814,16 +798,16 @@ func (x *CMSearchFriend) GetSearchKeyword() string { } // 回复搜索用户 -type SMSearchFriend struct { +type SMSearchUser struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Friends []*MFFriend `protobuf:"bytes,1,rep,name=friends" json:"friends,omitempty"` + Users []*MFUser `protobuf:"bytes,1,rep,name=users" json:"users,omitempty"` } -func (x *SMSearchFriend) Reset() { - *x = SMSearchFriend{} +func (x *SMSearchUser) Reset() { + *x = SMSearchUser{} if protoimpl.UnsafeEnabled { mi := &file_cs_proto_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -831,13 +815,13 @@ func (x *SMSearchFriend) Reset() { } } -func (x *SMSearchFriend) String() string { +func (x *SMSearchUser) String() string { return protoimpl.X.MessageStringOf(x) } -func (*SMSearchFriend) ProtoMessage() {} +func (*SMSearchUser) ProtoMessage() {} -func (x *SMSearchFriend) ProtoReflect() protoreflect.Message { +func (x *SMSearchUser) ProtoReflect() protoreflect.Message { mi := &file_cs_proto_proto_msgTypes[12] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -849,30 +833,29 @@ func (x *SMSearchFriend) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use SMSearchFriend.ProtoReflect.Descriptor instead. -func (*SMSearchFriend) Descriptor() ([]byte, []int) { +// Deprecated: Use SMSearchUser.ProtoReflect.Descriptor instead. +func (*SMSearchUser) Descriptor() ([]byte, []int) { return file_cs_proto_proto_rawDescGZIP(), []int{12} } -func (x *SMSearchFriend) GetFriends() []*MFFriend { +func (x *SMSearchUser) GetUsers() []*MFUser { if x != nil { - return x.Friends + return x.Users } return nil } -// 请求等待验证的好友请求 -type CMListPendingFriendRequest struct { +// 请求搜索用户 CMSearchUserByAccountId +type CMSearchUserByAccountId struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - ServerId *int32 `protobuf:"varint,1,opt,name=server_id,json=serverId" json:"server_id,omitempty"` //保留 - TeamUuid *string `protobuf:"bytes,2,opt,name=team_uuid,json=teamUuid" json:"team_uuid,omitempty"` //保留 + SearchKeyword *string `protobuf:"bytes,1,opt,name=search_keyword,json=searchKeyword" json:"search_keyword,omitempty"` //搜索account id } -func (x *CMListPendingFriendRequest) Reset() { - *x = CMListPendingFriendRequest{} +func (x *CMSearchUserByAccountId) Reset() { + *x = CMSearchUserByAccountId{} if protoimpl.UnsafeEnabled { mi := &file_cs_proto_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -880,13 +863,13 @@ func (x *CMListPendingFriendRequest) Reset() { } } -func (x *CMListPendingFriendRequest) String() string { +func (x *CMSearchUserByAccountId) String() string { return protoimpl.X.MessageStringOf(x) } -func (*CMListPendingFriendRequest) ProtoMessage() {} +func (*CMSearchUserByAccountId) ProtoMessage() {} -func (x *CMListPendingFriendRequest) ProtoReflect() protoreflect.Message { +func (x *CMSearchUserByAccountId) ProtoReflect() protoreflect.Message { mi := &file_cs_proto_proto_msgTypes[13] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -898,36 +881,30 @@ func (x *CMListPendingFriendRequest) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use CMListPendingFriendRequest.ProtoReflect.Descriptor instead. -func (*CMListPendingFriendRequest) Descriptor() ([]byte, []int) { +// Deprecated: Use CMSearchUserByAccountId.ProtoReflect.Descriptor instead. +func (*CMSearchUserByAccountId) Descriptor() ([]byte, []int) { return file_cs_proto_proto_rawDescGZIP(), []int{13} } -func (x *CMListPendingFriendRequest) GetServerId() int32 { - if x != nil && x.ServerId != nil { - return *x.ServerId - } - return 0 -} - -func (x *CMListPendingFriendRequest) GetTeamUuid() string { - if x != nil && x.TeamUuid != nil { - return *x.TeamUuid +func (x *CMSearchUserByAccountId) GetSearchKeyword() string { + if x != nil && x.SearchKeyword != nil { + return *x.SearchKeyword } return "" } -// 回复等待验证的好友请求 -type SMListPendingFriendRequest struct { +// 回复搜索用户 +type SMSearchUserByAccountId struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - PendingFriendRequest []*MFPendingFriendRequest `protobuf:"bytes,1,rep,name=pendingFriendRequest" json:"pendingFriendRequest,omitempty"` + AccountId *string `protobuf:"bytes,1,opt,name=account_id,json=accountId" json:"account_id,omitempty"` + Username *string `protobuf:"bytes,2,opt,name=username" json:"username,omitempty"` } -func (x *SMListPendingFriendRequest) Reset() { - *x = SMListPendingFriendRequest{} +func (x *SMSearchUserByAccountId) Reset() { + *x = SMSearchUserByAccountId{} if protoimpl.UnsafeEnabled { mi := &file_cs_proto_proto_msgTypes[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -935,13 +912,13 @@ func (x *SMListPendingFriendRequest) Reset() { } } -func (x *SMListPendingFriendRequest) String() string { +func (x *SMSearchUserByAccountId) String() string { return protoimpl.X.MessageStringOf(x) } -func (*SMListPendingFriendRequest) ProtoMessage() {} +func (*SMSearchUserByAccountId) ProtoMessage() {} -func (x *SMListPendingFriendRequest) ProtoReflect() protoreflect.Message { +func (x *SMSearchUserByAccountId) ProtoReflect() protoreflect.Message { mi := &file_cs_proto_proto_msgTypes[14] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -953,16 +930,23 @@ func (x *SMListPendingFriendRequest) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use SMListPendingFriendRequest.ProtoReflect.Descriptor instead. -func (*SMListPendingFriendRequest) Descriptor() ([]byte, []int) { +// Deprecated: Use SMSearchUserByAccountId.ProtoReflect.Descriptor instead. +func (*SMSearchUserByAccountId) Descriptor() ([]byte, []int) { return file_cs_proto_proto_rawDescGZIP(), []int{14} } -func (x *SMListPendingFriendRequest) GetPendingFriendRequest() []*MFPendingFriendRequest { - if x != nil { - return x.PendingFriendRequest +func (x *SMSearchUserByAccountId) GetAccountId() string { + if x != nil && x.AccountId != nil { + return *x.AccountId } - return nil + return "" +} + +func (x *SMSearchUserByAccountId) GetUsername() string { + if x != nil && x.Username != nil { + return *x.Username + } + return "" } // 请求发送添加好友请求 @@ -971,9 +955,7 @@ type CMAddFriendRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - ServerId *int32 `protobuf:"varint,1,opt,name=server_id,json=serverId" json:"server_id,omitempty"` //保留 - TeamUuid *string `protobuf:"bytes,2,opt,name=team_uuid,json=teamUuid" json:"team_uuid,omitempty"` //保留 - TargetAccountId *string `protobuf:"bytes,3,opt,name=target_account_id,json=targetAccountId" json:"target_account_id,omitempty"` //账号id + TargetAccountId *string `protobuf:"bytes,1,opt,name=target_account_id,json=targetAccountId" json:"target_account_id,omitempty"` // 账号id } func (x *CMAddFriendRequest) Reset() { @@ -1008,20 +990,6 @@ func (*CMAddFriendRequest) Descriptor() ([]byte, []int) { return file_cs_proto_proto_rawDescGZIP(), []int{15} } -func (x *CMAddFriendRequest) GetServerId() int32 { - if x != nil && x.ServerId != nil { - return *x.ServerId - } - return 0 -} - -func (x *CMAddFriendRequest) GetTeamUuid() string { - if x != nil && x.TeamUuid != nil { - return *x.TeamUuid - } - return "" -} - func (x *CMAddFriendRequest) GetTargetAccountId() string { if x != nil && x.TargetAccountId != nil { return *x.TargetAccountId @@ -1085,15 +1053,13 @@ func (x *SMAddFriendRequest) GetStatus() string { return "" } -// 同意接受发送添加好友请求 +// 请求接受好友请求 type CMAcceptFriendRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - ServerId *int32 `protobuf:"varint,1,opt,name=server_id,json=serverId" json:"server_id,omitempty"` //保留 - TeamUuid *string `protobuf:"bytes,2,opt,name=team_uuid,json=teamUuid" json:"team_uuid,omitempty"` //保留 - TargetAccountId *string `protobuf:"bytes,3,opt,name=target_account_id,json=targetAccountId" json:"target_account_id,omitempty"` // + TargetAccountId *string `protobuf:"bytes,1,opt,name=target_account_id,json=targetAccountId" json:"target_account_id,omitempty"` // 账号id } func (x *CMAcceptFriendRequest) Reset() { @@ -1128,20 +1094,6 @@ func (*CMAcceptFriendRequest) Descriptor() ([]byte, []int) { return file_cs_proto_proto_rawDescGZIP(), []int{17} } -func (x *CMAcceptFriendRequest) GetServerId() int32 { - if x != nil && x.ServerId != nil { - return *x.ServerId - } - return 0 -} - -func (x *CMAcceptFriendRequest) GetTeamUuid() string { - if x != nil && x.TeamUuid != nil { - return *x.TeamUuid - } - return "" -} - func (x *CMAcceptFriendRequest) GetTargetAccountId() string { if x != nil && x.TargetAccountId != nil { return *x.TargetAccountId @@ -1149,7 +1101,7 @@ func (x *CMAcceptFriendRequest) GetTargetAccountId() string { return "" } -// 同意接受发送添加好友请求 +// 回复接受好友请求 type SMAcceptFriendRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -1205,20 +1157,208 @@ func (x *SMAcceptFriendRequest) GetStatus() string { return "" } +// 请求拒绝好友请求 +type CMRejectFriendRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + TargetAccountId *string `protobuf:"bytes,1,opt,name=target_account_id,json=targetAccountId" json:"target_account_id,omitempty"` // 账号id +} + +func (x *CMRejectFriendRequest) Reset() { + *x = CMRejectFriendRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_cs_proto_proto_msgTypes[19] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CMRejectFriendRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CMRejectFriendRequest) ProtoMessage() {} + +func (x *CMRejectFriendRequest) ProtoReflect() protoreflect.Message { + mi := &file_cs_proto_proto_msgTypes[19] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CMRejectFriendRequest.ProtoReflect.Descriptor instead. +func (*CMRejectFriendRequest) Descriptor() ([]byte, []int) { + return file_cs_proto_proto_rawDescGZIP(), []int{19} +} + +func (x *CMRejectFriendRequest) GetTargetAccountId() string { + if x != nil && x.TargetAccountId != nil { + return *x.TargetAccountId + } + return "" +} + +// 回复拒绝好友请求 +type SMRejectFriendRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Reason *string `protobuf:"bytes,1,opt,name=reason" json:"reason,omitempty"` + Status *string `protobuf:"bytes,2,opt,name=status" json:"status,omitempty"` +} + +func (x *SMRejectFriendRequest) Reset() { + *x = SMRejectFriendRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_cs_proto_proto_msgTypes[20] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SMRejectFriendRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SMRejectFriendRequest) ProtoMessage() {} + +func (x *SMRejectFriendRequest) ProtoReflect() protoreflect.Message { + mi := &file_cs_proto_proto_msgTypes[20] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SMRejectFriendRequest.ProtoReflect.Descriptor instead. +func (*SMRejectFriendRequest) Descriptor() ([]byte, []int) { + return file_cs_proto_proto_rawDescGZIP(), []int{20} +} + +func (x *SMRejectFriendRequest) GetReason() string { + if x != nil && x.Reason != nil { + return *x.Reason + } + return "" +} + +func (x *SMRejectFriendRequest) GetStatus() string { + if x != nil && x.Status != nil { + return *x.Status + } + return "" +} + +// 请求等待验证的好友请求 +type CMListPendingFriendRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *CMListPendingFriendRequest) Reset() { + *x = CMListPendingFriendRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_cs_proto_proto_msgTypes[21] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CMListPendingFriendRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CMListPendingFriendRequest) ProtoMessage() {} + +func (x *CMListPendingFriendRequest) ProtoReflect() protoreflect.Message { + mi := &file_cs_proto_proto_msgTypes[21] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CMListPendingFriendRequest.ProtoReflect.Descriptor instead. +func (*CMListPendingFriendRequest) Descriptor() ([]byte, []int) { + return file_cs_proto_proto_rawDescGZIP(), []int{21} +} + +// 回复等待验证的好友请求 +type SMListPendingFriendRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + PendingFriendRequest []*MFPendingFriendRequest `protobuf:"bytes,1,rep,name=pendingFriendRequest" json:"pendingFriendRequest,omitempty"` +} + +func (x *SMListPendingFriendRequest) Reset() { + *x = SMListPendingFriendRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_cs_proto_proto_msgTypes[22] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SMListPendingFriendRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SMListPendingFriendRequest) ProtoMessage() {} + +func (x *SMListPendingFriendRequest) ProtoReflect() protoreflect.Message { + mi := &file_cs_proto_proto_msgTypes[22] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SMListPendingFriendRequest.ProtoReflect.Descriptor instead. +func (*SMListPendingFriendRequest) Descriptor() ([]byte, []int) { + return file_cs_proto_proto_rawDescGZIP(), []int{22} +} + +func (x *SMListPendingFriendRequest) GetPendingFriendRequest() []*MFPendingFriendRequest { + if x != nil { + return x.PendingFriendRequest + } + return nil +} + // 请求我的好友列表 type CMListFriend struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - - ServerId *int32 `protobuf:"varint,1,opt,name=server_id,json=serverId" json:"server_id,omitempty"` //保留 - TeamUuid *string `protobuf:"bytes,2,opt,name=team_uuid,json=teamUuid" json:"team_uuid,omitempty"` //保留 } func (x *CMListFriend) Reset() { *x = CMListFriend{} if protoimpl.UnsafeEnabled { - mi := &file_cs_proto_proto_msgTypes[19] + mi := &file_cs_proto_proto_msgTypes[23] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1231,7 +1371,7 @@ func (x *CMListFriend) String() string { func (*CMListFriend) ProtoMessage() {} func (x *CMListFriend) ProtoReflect() protoreflect.Message { - mi := &file_cs_proto_proto_msgTypes[19] + mi := &file_cs_proto_proto_msgTypes[23] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1244,24 +1384,216 @@ func (x *CMListFriend) ProtoReflect() protoreflect.Message { // Deprecated: Use CMListFriend.ProtoReflect.Descriptor instead. func (*CMListFriend) Descriptor() ([]byte, []int) { - return file_cs_proto_proto_rawDescGZIP(), []int{19} + return file_cs_proto_proto_rawDescGZIP(), []int{23} } -func (x *CMListFriend) GetServerId() int32 { - if x != nil && x.ServerId != nil { - return *x.ServerId +// 回复我的好友列表 +type SMListFriend struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Users []*MFUser `protobuf:"bytes,1,rep,name=users" json:"users,omitempty"` +} + +func (x *SMListFriend) Reset() { + *x = SMListFriend{} + if protoimpl.UnsafeEnabled { + mi := &file_cs_proto_proto_msgTypes[24] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } - return 0 } -func (x *CMListFriend) GetTeamUuid() string { - if x != nil && x.TeamUuid != nil { - return *x.TeamUuid +func (x *SMListFriend) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SMListFriend) ProtoMessage() {} + +func (x *SMListFriend) ProtoReflect() protoreflect.Message { + mi := &file_cs_proto_proto_msgTypes[24] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SMListFriend.ProtoReflect.Descriptor instead. +func (*SMListFriend) Descriptor() ([]byte, []int) { + return file_cs_proto_proto_rawDescGZIP(), []int{24} +} + +func (x *SMListFriend) GetUsers() []*MFUser { + if x != nil { + return x.Users + } + return nil +} + +// 请求删除好友 +type CMDeleteFriendShip struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + TargetAccountId *string `protobuf:"bytes,1,opt,name=target_account_id,json=targetAccountId" json:"target_account_id,omitempty"` // 账号id +} + +func (x *CMDeleteFriendShip) Reset() { + *x = CMDeleteFriendShip{} + if protoimpl.UnsafeEnabled { + mi := &file_cs_proto_proto_msgTypes[25] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CMDeleteFriendShip) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CMDeleteFriendShip) ProtoMessage() {} + +func (x *CMDeleteFriendShip) ProtoReflect() protoreflect.Message { + mi := &file_cs_proto_proto_msgTypes[25] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CMDeleteFriendShip.ProtoReflect.Descriptor instead. +func (*CMDeleteFriendShip) Descriptor() ([]byte, []int) { + return file_cs_proto_proto_rawDescGZIP(), []int{25} +} + +func (x *CMDeleteFriendShip) GetTargetAccountId() string { + if x != nil && x.TargetAccountId != nil { + return *x.TargetAccountId + } + return "" +} + +// 回复删除好友 +type SMDeleteFriendShip struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Reason *string `protobuf:"bytes,1,opt,name=reason" json:"reason,omitempty"` + Status *string `protobuf:"bytes,2,opt,name=status" json:"status,omitempty"` +} + +func (x *SMDeleteFriendShip) Reset() { + *x = SMDeleteFriendShip{} + if protoimpl.UnsafeEnabled { + mi := &file_cs_proto_proto_msgTypes[26] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SMDeleteFriendShip) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SMDeleteFriendShip) ProtoMessage() {} + +func (x *SMDeleteFriendShip) ProtoReflect() protoreflect.Message { + mi := &file_cs_proto_proto_msgTypes[26] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SMDeleteFriendShip.ProtoReflect.Descriptor instead. +func (*SMDeleteFriendShip) Descriptor() ([]byte, []int) { + return file_cs_proto_proto_rawDescGZIP(), []int{26} +} + +func (x *SMDeleteFriendShip) GetReason() string { + if x != nil && x.Reason != nil { + return *x.Reason + } + return "" +} + +func (x *SMDeleteFriendShip) GetStatus() string { + if x != nil && x.Status != nil { + return *x.Status + } + return "" +} + +type MFUser struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + AccountId *string `protobuf:"bytes,1,opt,name=account_id,json=accountId" json:"account_id,omitempty"` + Username *string `protobuf:"bytes,2,opt,name=username" json:"username,omitempty"` +} + +func (x *MFUser) Reset() { + *x = MFUser{} + if protoimpl.UnsafeEnabled { + mi := &file_cs_proto_proto_msgTypes[27] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MFUser) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MFUser) ProtoMessage() {} + +func (x *MFUser) ProtoReflect() protoreflect.Message { + mi := &file_cs_proto_proto_msgTypes[27] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use MFUser.ProtoReflect.Descriptor instead. +func (*MFUser) Descriptor() ([]byte, []int) { + return file_cs_proto_proto_rawDescGZIP(), []int{27} +} + +func (x *MFUser) GetAccountId() string { + if x != nil && x.AccountId != nil { + return *x.AccountId + } + return "" +} + +func (x *MFUser) GetUsername() string { + if x != nil && x.Username != nil { + return *x.Username } return "" } -// 回复等待验证的好友请求 type MFPendingFriendRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -1274,7 +1606,7 @@ type MFPendingFriendRequest struct { func (x *MFPendingFriendRequest) Reset() { *x = MFPendingFriendRequest{} if protoimpl.UnsafeEnabled { - mi := &file_cs_proto_proto_msgTypes[20] + mi := &file_cs_proto_proto_msgTypes[28] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1287,7 +1619,7 @@ func (x *MFPendingFriendRequest) String() string { func (*MFPendingFriendRequest) ProtoMessage() {} func (x *MFPendingFriendRequest) ProtoReflect() protoreflect.Message { - mi := &file_cs_proto_proto_msgTypes[20] + mi := &file_cs_proto_proto_msgTypes[28] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1300,7 +1632,7 @@ func (x *MFPendingFriendRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use MFPendingFriendRequest.ProtoReflect.Descriptor instead. func (*MFPendingFriendRequest) Descriptor() ([]byte, []int) { - return file_cs_proto_proto_rawDescGZIP(), []int{20} + return file_cs_proto_proto_rawDescGZIP(), []int{28} } func (x *MFPendingFriendRequest) GetAccountId() string { @@ -1317,109 +1649,6 @@ func (x *MFPendingFriendRequest) GetFlag() bool { return false } -// 回复我的好友列表 -type MFFriend struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - AccountId *string `protobuf:"bytes,1,opt,name=account_id,json=accountId" json:"account_id,omitempty"` - Username *string `protobuf:"bytes,2,opt,name=username" json:"username,omitempty"` -} - -func (x *MFFriend) Reset() { - *x = MFFriend{} - if protoimpl.UnsafeEnabled { - mi := &file_cs_proto_proto_msgTypes[21] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *MFFriend) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MFFriend) ProtoMessage() {} - -func (x *MFFriend) ProtoReflect() protoreflect.Message { - mi := &file_cs_proto_proto_msgTypes[21] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use MFFriend.ProtoReflect.Descriptor instead. -func (*MFFriend) Descriptor() ([]byte, []int) { - return file_cs_proto_proto_rawDescGZIP(), []int{21} -} - -func (x *MFFriend) GetAccountId() string { - if x != nil && x.AccountId != nil { - return *x.AccountId - } - return "" -} - -func (x *MFFriend) GetUsername() string { - if x != nil && x.Username != nil { - return *x.Username - } - return "" -} - -type SMListFriend struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Friends []*MFFriend `protobuf:"bytes,1,rep,name=friends" json:"friends,omitempty"` -} - -func (x *SMListFriend) Reset() { - *x = SMListFriend{} - if protoimpl.UnsafeEnabled { - mi := &file_cs_proto_proto_msgTypes[22] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SMListFriend) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SMListFriend) ProtoMessage() {} - -func (x *SMListFriend) ProtoReflect() protoreflect.Message { - mi := &file_cs_proto_proto_msgTypes[22] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SMListFriend.ProtoReflect.Descriptor instead. -func (*SMListFriend) Descriptor() ([]byte, []int) { - return file_cs_proto_proto_rawDescGZIP(), []int{22} -} - -func (x *SMListFriend) GetFriends() []*MFFriend { - if x != nil { - return x.Friends - } - return nil -} - var File_cs_proto_proto protoreflect.FileDescriptor var file_cs_proto_proto_rawDesc = []byte{ @@ -1482,75 +1711,83 @@ var file_cs_proto_proto_rawDesc = []byte{ 0x53, 0x4d, 0x52, 0x65, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x72, 0x72, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x65, 0x72, 0x72, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x65, 0x72, 0x72, 0x6d, 0x73, 0x67, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x65, 0x72, 0x72, 0x6d, 0x73, 0x67, 0x22, 0x71, 0x0a, - 0x0e, 0x43, 0x4d, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x12, - 0x1b, 0x0a, 0x09, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x05, 0x52, 0x08, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, - 0x74, 0x65, 0x61, 0x6d, 0x5f, 0x75, 0x75, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x08, 0x74, 0x65, 0x61, 0x6d, 0x55, 0x75, 0x69, 0x64, 0x12, 0x25, 0x0a, 0x0e, 0x73, 0x65, 0x61, - 0x72, 0x63, 0x68, 0x5f, 0x6b, 0x65, 0x79, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x0d, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x4b, 0x65, 0x79, 0x77, 0x6f, 0x72, 0x64, - 0x22, 0x38, 0x0a, 0x0e, 0x53, 0x4d, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x46, 0x72, 0x69, 0x65, - 0x6e, 0x64, 0x12, 0x26, 0x0a, 0x07, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x73, 0x18, 0x01, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x63, 0x73, 0x2e, 0x4d, 0x46, 0x46, 0x72, 0x69, 0x65, 0x6e, - 0x64, 0x52, 0x07, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x73, 0x22, 0x56, 0x0a, 0x1a, 0x43, 0x4d, - 0x4c, 0x69, 0x73, 0x74, 0x50, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x46, 0x72, 0x69, 0x65, 0x6e, - 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x73, 0x65, 0x72, 0x76, - 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x73, 0x65, 0x72, - 0x76, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x74, 0x65, 0x61, 0x6d, 0x5f, 0x75, 0x75, - 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x74, 0x65, 0x61, 0x6d, 0x55, 0x75, - 0x69, 0x64, 0x22, 0x6c, 0x0a, 0x1a, 0x53, 0x4d, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x65, 0x6e, 0x64, - 0x69, 0x6e, 0x67, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x12, 0x4e, 0x0a, 0x14, 0x70, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x46, 0x72, 0x69, 0x65, 0x6e, - 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, - 0x2e, 0x63, 0x73, 0x2e, 0x4d, 0x46, 0x50, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x46, 0x72, 0x69, - 0x65, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x14, 0x70, 0x65, 0x6e, 0x64, - 0x69, 0x6e, 0x67, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x22, 0x7a, 0x0a, 0x12, 0x43, 0x4d, 0x41, 0x64, 0x64, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, - 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x73, 0x65, 0x72, 0x76, 0x65, - 0x72, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x74, 0x65, 0x61, 0x6d, 0x5f, 0x75, 0x75, 0x69, 0x64, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x74, 0x65, 0x61, 0x6d, 0x55, 0x75, 0x69, 0x64, - 0x12, 0x2a, 0x0a, 0x11, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, - 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x74, 0x61, 0x72, - 0x67, 0x65, 0x74, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x64, 0x22, 0x44, 0x0a, 0x12, - 0x53, 0x4d, 0x41, 0x64, 0x64, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x65, 0x72, 0x72, 0x6d, 0x73, 0x67, 0x22, 0x35, 0x0a, + 0x0c, 0x43, 0x4d, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x55, 0x73, 0x65, 0x72, 0x12, 0x25, 0x0a, + 0x0e, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x5f, 0x6b, 0x65, 0x79, 0x77, 0x6f, 0x72, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x4b, 0x65, 0x79, + 0x77, 0x6f, 0x72, 0x64, 0x22, 0x30, 0x0a, 0x0c, 0x53, 0x4d, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, + 0x55, 0x73, 0x65, 0x72, 0x12, 0x20, 0x0a, 0x05, 0x75, 0x73, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x63, 0x73, 0x2e, 0x4d, 0x46, 0x55, 0x73, 0x65, 0x72, 0x52, + 0x05, 0x75, 0x73, 0x65, 0x72, 0x73, 0x22, 0x40, 0x0a, 0x17, 0x43, 0x4d, 0x53, 0x65, 0x61, 0x72, + 0x63, 0x68, 0x55, 0x73, 0x65, 0x72, 0x42, 0x79, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, + 0x64, 0x12, 0x25, 0x0a, 0x0e, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x5f, 0x6b, 0x65, 0x79, 0x77, + 0x6f, 0x72, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x73, 0x65, 0x61, 0x72, 0x63, + 0x68, 0x4b, 0x65, 0x79, 0x77, 0x6f, 0x72, 0x64, 0x22, 0x54, 0x0a, 0x17, 0x53, 0x4d, 0x53, 0x65, + 0x61, 0x72, 0x63, 0x68, 0x55, 0x73, 0x65, 0x72, 0x42, 0x79, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, + 0x74, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x69, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x40, + 0x0a, 0x12, 0x43, 0x4d, 0x41, 0x64, 0x64, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x2a, 0x0a, 0x11, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x5f, 0x61, + 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0f, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x64, + 0x22, 0x44, 0x0a, 0x12, 0x53, 0x4d, 0x41, 0x64, 0x64, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x12, 0x16, + 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, + 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x43, 0x0a, 0x15, 0x43, 0x4d, 0x41, 0x63, 0x63, 0x65, + 0x70, 0x74, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x2a, 0x0a, 0x11, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, + 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x74, 0x61, 0x72, 0x67, + 0x65, 0x74, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x64, 0x22, 0x47, 0x0a, 0x15, 0x53, + 0x4d, 0x41, 0x63, 0x63, 0x65, 0x70, 0x74, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x06, + 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x74, + 0x61, 0x74, 0x75, 0x73, 0x22, 0x43, 0x0a, 0x15, 0x43, 0x4d, 0x52, 0x65, 0x6a, 0x65, 0x63, 0x74, + 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2a, 0x0a, + 0x11, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, + 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x64, 0x22, 0x47, 0x0a, 0x15, 0x53, 0x4d, 0x52, + 0x65, 0x6a, 0x65, 0x63, 0x74, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, - 0x75, 0x73, 0x22, 0x7d, 0x0a, 0x15, 0x43, 0x4d, 0x41, 0x63, 0x63, 0x65, 0x70, 0x74, 0x46, 0x72, - 0x69, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x73, - 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, - 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x74, 0x65, 0x61, 0x6d, - 0x5f, 0x75, 0x75, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x74, 0x65, 0x61, - 0x6d, 0x55, 0x75, 0x69, 0x64, 0x12, 0x2a, 0x0a, 0x11, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x5f, - 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0f, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, - 0x64, 0x22, 0x47, 0x0a, 0x15, 0x53, 0x4d, 0x41, 0x63, 0x63, 0x65, 0x70, 0x74, 0x46, 0x72, 0x69, - 0x65, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, - 0x61, 0x73, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x65, 0x61, 0x73, - 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x48, 0x0a, 0x0c, 0x43, 0x4d, - 0x4c, 0x69, 0x73, 0x74, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x73, 0x65, - 0x72, 0x76, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x73, - 0x65, 0x72, 0x76, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x74, 0x65, 0x61, 0x6d, 0x5f, - 0x75, 0x75, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x74, 0x65, 0x61, 0x6d, - 0x55, 0x75, 0x69, 0x64, 0x22, 0x4b, 0x0a, 0x16, 0x4d, 0x46, 0x50, 0x65, 0x6e, 0x64, 0x69, 0x6e, - 0x67, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, - 0x0a, 0x0a, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x09, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x12, 0x0a, - 0x04, 0x66, 0x6c, 0x61, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x66, 0x6c, 0x61, - 0x67, 0x22, 0x45, 0x0a, 0x08, 0x4d, 0x46, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x12, 0x1d, 0x0a, - 0x0a, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x09, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, - 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, - 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x36, 0x0a, 0x0c, 0x53, 0x4d, 0x4c, 0x69, - 0x73, 0x74, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x12, 0x26, 0x0a, 0x07, 0x66, 0x72, 0x69, 0x65, - 0x6e, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x63, 0x73, 0x2e, 0x4d, - 0x46, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x52, 0x07, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x73, - 0x2a, 0x22, 0x0a, 0x0a, 0x43, 0x6f, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x74, 0x5f, 0x65, 0x12, 0x14, - 0x0a, 0x0c, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x10, 0xd1, - 0xa2, 0xd5, 0xc4, 0x07, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x63, 0x73, + 0x75, 0x73, 0x22, 0x1c, 0x0a, 0x1a, 0x43, 0x4d, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x65, 0x6e, 0x64, + 0x69, 0x6e, 0x67, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x22, 0x6c, 0x0a, 0x1a, 0x53, 0x4d, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x65, 0x6e, 0x64, 0x69, 0x6e, + 0x67, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x4e, + 0x0a, 0x14, 0x70, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x63, + 0x73, 0x2e, 0x4d, 0x46, 0x50, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x46, 0x72, 0x69, 0x65, 0x6e, + 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x14, 0x70, 0x65, 0x6e, 0x64, 0x69, 0x6e, + 0x67, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x0e, + 0x0a, 0x0c, 0x43, 0x4d, 0x4c, 0x69, 0x73, 0x74, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x22, 0x30, + 0x0a, 0x0c, 0x53, 0x4d, 0x4c, 0x69, 0x73, 0x74, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x12, 0x20, + 0x0a, 0x05, 0x75, 0x73, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0a, 0x2e, + 0x63, 0x73, 0x2e, 0x4d, 0x46, 0x55, 0x73, 0x65, 0x72, 0x52, 0x05, 0x75, 0x73, 0x65, 0x72, 0x73, + 0x22, 0x40, 0x0a, 0x12, 0x43, 0x4d, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x46, 0x72, 0x69, 0x65, + 0x6e, 0x64, 0x53, 0x68, 0x69, 0x70, 0x12, 0x2a, 0x0a, 0x11, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, + 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0f, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x49, 0x64, 0x22, 0x44, 0x0a, 0x12, 0x53, 0x4d, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x46, 0x72, + 0x69, 0x65, 0x6e, 0x64, 0x53, 0x68, 0x69, 0x70, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x61, 0x73, + 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, + 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x43, 0x0a, 0x06, 0x4d, 0x46, 0x55, 0x73, + 0x65, 0x72, 0x12, 0x1d, 0x0a, 0x0a, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, + 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x4b, 0x0a, + 0x16, 0x4d, 0x46, 0x50, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x61, 0x63, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x63, 0x63, + 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x66, 0x6c, 0x61, 0x67, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x66, 0x6c, 0x61, 0x67, 0x2a, 0x22, 0x0a, 0x0a, 0x43, 0x6f, + 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x74, 0x5f, 0x65, 0x12, 0x14, 0x0a, 0x0c, 0x50, 0x72, 0x6f, 0x74, + 0x6f, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x10, 0xd1, 0xa2, 0xd5, 0xc4, 0x07, 0x42, 0x06, + 0x5a, 0x04, 0x2e, 0x3b, 0x63, 0x73, } var ( @@ -1566,7 +1803,7 @@ func file_cs_proto_proto_rawDescGZIP() []byte { } var file_cs_proto_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_cs_proto_proto_msgTypes = make([]protoimpl.MessageInfo, 23) +var file_cs_proto_proto_msgTypes = make([]protoimpl.MessageInfo, 29) var file_cs_proto_proto_goTypes = []interface{}{ (ConstantE)(0), // 0: cs.Constant_e (*CMPing)(nil), // 1: cs.CMPing @@ -1580,23 +1817,29 @@ var file_cs_proto_proto_goTypes = []interface{}{ (*SMLogin)(nil), // 9: cs.SMLogin (*CMReconnect)(nil), // 10: cs.CMReconnect (*SMReconnect)(nil), // 11: cs.SMReconnect - (*CMSearchFriend)(nil), // 12: cs.CMSearchFriend - (*SMSearchFriend)(nil), // 13: cs.SMSearchFriend - (*CMListPendingFriendRequest)(nil), // 14: cs.CMListPendingFriendRequest - (*SMListPendingFriendRequest)(nil), // 15: cs.SMListPendingFriendRequest + (*CMSearchUser)(nil), // 12: cs.CMSearchUser + (*SMSearchUser)(nil), // 13: cs.SMSearchUser + (*CMSearchUserByAccountId)(nil), // 14: cs.CMSearchUserByAccountId + (*SMSearchUserByAccountId)(nil), // 15: cs.SMSearchUserByAccountId (*CMAddFriendRequest)(nil), // 16: cs.CMAddFriendRequest (*SMAddFriendRequest)(nil), // 17: cs.SMAddFriendRequest (*CMAcceptFriendRequest)(nil), // 18: cs.CMAcceptFriendRequest (*SMAcceptFriendRequest)(nil), // 19: cs.SMAcceptFriendRequest - (*CMListFriend)(nil), // 20: cs.CMListFriend - (*MFPendingFriendRequest)(nil), // 21: cs.MFPendingFriendRequest - (*MFFriend)(nil), // 22: cs.MFFriend - (*SMListFriend)(nil), // 23: cs.SMListFriend + (*CMRejectFriendRequest)(nil), // 20: cs.CMRejectFriendRequest + (*SMRejectFriendRequest)(nil), // 21: cs.SMRejectFriendRequest + (*CMListPendingFriendRequest)(nil), // 22: cs.CMListPendingFriendRequest + (*SMListPendingFriendRequest)(nil), // 23: cs.SMListPendingFriendRequest + (*CMListFriend)(nil), // 24: cs.CMListFriend + (*SMListFriend)(nil), // 25: cs.SMListFriend + (*CMDeleteFriendShip)(nil), // 26: cs.CMDeleteFriendShip + (*SMDeleteFriendShip)(nil), // 27: cs.SMDeleteFriendShip + (*MFUser)(nil), // 28: cs.MFUser + (*MFPendingFriendRequest)(nil), // 29: cs.MFPendingFriendRequest } var file_cs_proto_proto_depIdxs = []int32{ - 22, // 0: cs.SMSearchFriend.friends:type_name -> cs.MFFriend - 21, // 1: cs.SMListPendingFriendRequest.pendingFriendRequest:type_name -> cs.MFPendingFriendRequest - 22, // 2: cs.SMListFriend.friends:type_name -> cs.MFFriend + 28, // 0: cs.SMSearchUser.users:type_name -> cs.MFUser + 29, // 1: cs.SMListPendingFriendRequest.pendingFriendRequest:type_name -> cs.MFPendingFriendRequest + 28, // 2: cs.SMListFriend.users:type_name -> cs.MFUser 3, // [3:3] is the sub-list for method output_type 3, // [3:3] is the sub-list for method input_type 3, // [3:3] is the sub-list for extension type_name @@ -1743,7 +1986,7 @@ func file_cs_proto_proto_init() { } } file_cs_proto_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CMSearchFriend); i { + switch v := v.(*CMSearchUser); i { case 0: return &v.state case 1: @@ -1755,7 +1998,7 @@ func file_cs_proto_proto_init() { } } file_cs_proto_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SMSearchFriend); i { + switch v := v.(*SMSearchUser); i { case 0: return &v.state case 1: @@ -1767,7 +2010,7 @@ func file_cs_proto_proto_init() { } } file_cs_proto_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CMListPendingFriendRequest); i { + switch v := v.(*CMSearchUserByAccountId); i { case 0: return &v.state case 1: @@ -1779,7 +2022,7 @@ func file_cs_proto_proto_init() { } } file_cs_proto_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SMListPendingFriendRequest); i { + switch v := v.(*SMSearchUserByAccountId); i { case 0: return &v.state case 1: @@ -1839,7 +2082,7 @@ func file_cs_proto_proto_init() { } } file_cs_proto_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CMListFriend); i { + switch v := v.(*CMRejectFriendRequest); i { case 0: return &v.state case 1: @@ -1851,7 +2094,7 @@ func file_cs_proto_proto_init() { } } file_cs_proto_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MFPendingFriendRequest); i { + switch v := v.(*SMRejectFriendRequest); i { case 0: return &v.state case 1: @@ -1863,7 +2106,7 @@ func file_cs_proto_proto_init() { } } file_cs_proto_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MFFriend); i { + switch v := v.(*CMListPendingFriendRequest); i { case 0: return &v.state case 1: @@ -1875,6 +2118,30 @@ func file_cs_proto_proto_init() { } } file_cs_proto_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SMListPendingFriendRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cs_proto_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CMListFriend); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cs_proto_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*SMListFriend); i { case 0: return &v.state @@ -1886,6 +2153,54 @@ func file_cs_proto_proto_init() { return nil } } + file_cs_proto_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CMDeleteFriendShip); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cs_proto_proto_msgTypes[26].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SMDeleteFriendShip); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cs_proto_proto_msgTypes[27].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MFUser); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cs_proto_proto_msgTypes[28].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MFPendingFriendRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } } type x struct{} out := protoimpl.TypeBuilder{ @@ -1893,7 +2208,7 @@ func file_cs_proto_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_cs_proto_proto_rawDesc, NumEnums: 1, - NumMessages: 23, + NumMessages: 29, NumExtensions: 0, NumServices: 0, }, diff --git a/server/imserver/friends.go b/server/imserver/friends.go index a939213f..7a0efc61 100644 --- a/server/imserver/friends.go +++ b/server/imserver/friends.go @@ -1,9 +1,6 @@ package main -import ( - "math/rand" - "strings" -) +import "q5" // User 用户实体 type User struct { @@ -23,27 +20,13 @@ type FriendRequest struct { ReceiverID int } +// BlockedUser 直接存列表, 黑名单上限就50个 type BlockedUser struct { AccountId string BlockedAccountId string } -// RandomString generates a random string of length n -const alphabet = "abcdefghijklmnopqrstuvwxyz" - -func RandomString(n int) string { - var sb strings.Builder - k := len(alphabet) - - for i := 0; i < n; i++ { - c := alphabet[rand.Intn(k)] - sb.WriteByte(c) - } - - return sb.String() -} - // RandomUsername generates a random username func RandomUsername() string { - return RandomString(6) + return q5.RandomString(6) } diff --git a/server/imserver/friendsmgr.go b/server/imserver/friendsmgr.go index 1c4d0705..97660c94 100644 --- a/server/imserver/friendsmgr.go +++ b/server/imserver/friendsmgr.go @@ -13,16 +13,16 @@ import ( const ( FriendMemberCount = 200 - PendingReqsCount = 20 + PendingReqCount = 20 ) type FriendsMgr struct { cs.MsgHandlerImpl - users map[string]*User - searchCaches map[string]SearchCache - friendships map[string][]*Friendship - pendingReqs map[string]map[string]bool - blockedUser map[string][]string + users map[string]*User // AccountId -> 用户 + searchCaches map[string]SearchCache // SearchKeyword -> 好友搜索结果 []*User + friendships map[string][]*Friendship // AccountId -> 好友关系列表 []*Friendship + pendingReqs map[string]map[string]bool // AccountId -> 等待请求列表 map[account2Id]true + blockedUser map[string][]string // AccountId -> 黑名单列表 []AccountIds } type SearchCache struct { @@ -75,7 +75,7 @@ func (fm *FriendsMgr) unInit() { // 2. Struct Data Persist to DB } -func (fm *FriendsMgr) searchUserByAccountId(accountId string) *User { +func (fm *FriendsMgr) searchByAccountId(accountId string) *User { if user, ok := fm.users[accountId]; ok { return user } @@ -93,7 +93,8 @@ func (fm *FriendsMgr) searchUsers(keyword string) []*User { } } - var listFriend []*User + maxUsers := 20 + listFriend := make([]*User, 0, maxUsers) lowercaseQuery := strings.ToLower(keyword) for _, u := range fm.users { if strings.Contains(strings.ToLower(u.Username), lowercaseQuery) { @@ -103,6 +104,10 @@ func (fm *FriendsMgr) searchUsers(keyword string) []*User { } listFriend = append(listFriend, uEntity) } + // 显示搜索结果 20条 + if len(listFriend) >= maxUsers { + break + } } // Add to caches @@ -112,6 +117,9 @@ func (fm *FriendsMgr) searchUsers(keyword string) []*User { } fm.clearExpiredCaches() + // Print result: + PrintUsers("Search result:", listFriend) + return listFriend } @@ -119,15 +127,37 @@ func (fm *FriendsMgr) addBlocked(account1Id string, account2Id string) error { if fm.blockedUser[account1Id] == nil { fm.blockedUser[account1Id] = []string{} } - fm.blockedUser[account1Id] = append(fm.blockedUser[account1Id], account2Id) + if len(fm.blockedUser[account1Id]) >= 50 { + return fmt.Errorf("your blacklist has reached the limit") + } + + index := fm.findBlockedUserIndex(account1Id, account2Id) + if index < 0 { + fm.blockedUser[account1Id] = append(fm.blockedUser[account1Id], account2Id) + } + return nil } func (fm *FriendsMgr) removeBlocked(account1Id string, account2Id string) error { + if fm.blockedUser[account1Id] == nil { + return fmt.Errorf("your blacklist is emtpy") + } + + index := fm.findBlockedUserIndex(account1Id, account2Id) + if index < 0 { + return fmt.Errorf("your blacklist not exists target account id") + } + + blockedUsers := fm.blockedUser[account1Id] + blockedUsers = append(blockedUsers[:index], blockedUsers[index+1:]...) + + fm.blockedUser[account1Id] = blockedUsers + return nil } -// addFriendRequest 发送好友请求 +// addFriendRequest 添加好友请求 func (fm *FriendsMgr) addFriendRequest(account1Id string, account2Id string) error { _, exists1 := fm.users[account1Id] _, exists2 := fm.users[account2Id] @@ -146,22 +176,28 @@ func (fm *FriendsMgr) addFriendRequest(account1Id string, account2Id string) err return errors.New("users in blocked") } } - // step2. check target user member count + // 已发送请求 + if _, ok := fm.pendingReqs[account1Id][account2Id]; ok { + return nil + } + // 自己好友已满 if fm.getFriendCount(account1Id) >= FriendMemberCount { return fmt.Errorf("player:%s, friends are full", account1Id) } + // 对方好友已满 if fm.getFriendCount(account2Id) >= FriendMemberCount { return fmt.Errorf("player:%s, friends are full", account2Id) } - // step3. check target user pending request count - if fm.getFriendRequestCount(account2Id) >= PendingReqsCount { + // 对方待请求已满 + if fm.getFriendRequestCount(account2Id) >= PendingReqCount { return fmt.Errorf("player:%s, friends are full", account2Id) } // 为 account2Id 创建等待验证好友请求 记录,由 account1Id 申请的 if fm.pendingReqs[account2Id] == nil { - fm.pendingReqs[account2Id] = make(map[string]bool) + fm.pendingReqs[account2Id] = make(map[string]bool, 0) } + fm.pendingReqs[account1Id][account2Id] = true fm.pendingReqs[account2Id][account1Id] = true return nil @@ -169,12 +205,9 @@ func (fm *FriendsMgr) addFriendRequest(account1Id string, account2Id string) err // acceptFriendRequest 接受好友请求 func (fm *FriendsMgr) acceptFriendRequest(account1Id string, account2Id string) error { - if !fm.pendingReqs[account1Id][account2Id] { + if _, ok := fm.pendingReqs[account1Id][account2Id]; ok { return errors.New("no pending friend request from account1Id to account2Id") } - // step1. delete or update friend request record - // step2. add friend history to db - // step3. add friendship if fm.getFriendCount(account1Id) >= FriendMemberCount { return fmt.Errorf("player:%s, friends are full", account1Id) @@ -206,28 +239,42 @@ func (fm *FriendsMgr) rejectFriendRequest(account1Id string, account2Id string) if fm.pendingReqs[account1Id] == nil { return errors.New("no pending friend request to reject") } - if !fm.pendingReqs[account1Id][account2Id] { + if _, ok := fm.pendingReqs[account1Id][account2Id]; ok { return errors.New("no pending friend request from user1 to user2") } delete(fm.pendingReqs[account1Id], account2Id) - if len(fm.pendingReqs[account2Id]) == 0 { - delete(fm.pendingReqs, account2Id) - } - - //err := fm.acceptFriendRequestToDB(account1Id, account2Id) - //if err != nil { - // return err - //} - - //fm.pendingReqs[account1Id], account2Id - //fm.pendingReqs[account2Id], account1Id + delete(fm.pendingReqs[account2Id], account1Id) return nil } -func (fm *FriendsMgr) deleteFriendShip(accountId string, account2Id string) { - //delete(fm.friendships[accountId], account2Id) +// deleteFriendShip 删除好友 +func (fm *FriendsMgr) deleteFriendShip(account1ID, account2ID string) error { + user1Friendships := fm.friendships[account1ID] + user2Friendships := fm.friendships[account2ID] + + var found bool + for i, friendship := range user1Friendships { + if friendship.User1.Username == account2ID || friendship.User2.Username == account2ID { + fm.friendships[account1ID] = append(user1Friendships[:i], user1Friendships[i+1:]...) + found = true + break + } + } + + if !found { + return errors.New("friendship not found") + } + + for i, friendship := range user2Friendships { + if friendship.User1.Username == account1ID || friendship.User2.Username == account1ID { + fm.friendships[account2ID] = append(user2Friendships[:i], user2Friendships[i+1:]...) + break + } + } + + return nil } // getFriendCount 好友数量 @@ -348,15 +395,15 @@ func (fm *FriendsMgr) loadPendingRequestsFromDB(conn *q5.Mysql) { if err := rows.Scan(&senderAccountId, &receiverAccountId, &requestStatus); err != nil { continue } - if pendingReqs[senderAccountId] == nil { - pendingReqs[senderAccountId] = make(map[string]bool) + if pendingReqs[receiverAccountId] == nil { + pendingReqs[receiverAccountId] = make(map[string]bool) } status := true if requestStatus == "1" { // 等待验证的好友请求, 拒绝 status = false } - pendingReqs[senderAccountId][receiverAccountId] = status + pendingReqs[receiverAccountId][senderAccountId] = status } if err := rows.Err(); err != nil { return @@ -394,3 +441,28 @@ func PrintUsers(str string, userList []*User) { fmt.Printf("[%s]:accountId:%s, username:%s \n", str, user.AccountId, user.Username) } } + +func (fm *FriendsMgr) findBlockedUserIndex(Account1Id, Account2Id string) int { + if fm.blockedUser[Account1Id] != nil { + for i, blockedAccountId := range fm.blockedUser[Account1Id] { + if blockedAccountId == Account2Id { + return i + } + } + } + + return -1 +} + +func (fm *FriendsMgr) findFriendShipIndex(Account1Id, Account2Id string) int { + // 通常 account1Id,指自己, account2Id 指对方 + if _, exists := fm.friendships[Account1Id]; exists { + for i, friendship := range fm.friendships[Account1Id] { + if friendship.User2.AccountId == Account2Id { + return i + } + } + } + + return -1 +} diff --git a/server/imserver/go.sum b/server/imserver/go.sum index 546d5b7b..805f0f2a 100644 --- a/server/imserver/go.sum +++ b/server/imserver/go.sum @@ -1,6 +1,5 @@ github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/garyburd/redigo v1.6.2/go.mod h1:NR3MbYisc3/PwhQ00EMzDiPmrwpPxAn5GI05/YaO1SY= github.com/go-sql-driver/mysql v1.5.0 h1:ozyZYNQW3x3HtqT1jira07DN2PArx2v7/mN66gGcHOs= github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= diff --git a/server/imserver/guildmgr.go b/server/imserver/guildmgr.go index ce129899..2d2e168a 100644 --- a/server/imserver/guildmgr.go +++ b/server/imserver/guildmgr.go @@ -239,33 +239,6 @@ func (gm *GuildMgr) WriteLog(guildID int, accountId string, logType uint16, cont gm.Logs[guildID] = append(gm.Logs[guildID], log) } -// SearchGuilds 根据关键字搜索公会 -func (gm *GuildMgr) SearchGuilds(keyword string) []Guild { - var results []Guild - for _, guild := range gm.Guilds { - if containsSubstring(guild.Name, keyword) { - results = append(results, *guild) - } - } - return results -} - -// RandomGuilds 随机显示10个公会 -func (gm *GuildMgr) RandomGuilds() []Guild { - randomGuildNum := 10 - count := len(gm.Guilds) - if count <= randomGuildNum { - randomGuildNum = count - } - // shuffle 从count50,返回一个slice []int, 包含10个元素 - randIndices := rand.Perm(count)[:randomGuildNum] - var results []Guild - for _, idx := range randIndices { - results = append(results, *gm.Guilds[idx]) - } - return results -} - // Disband 解散公会 func (gm *GuildMgr) Disband(guildID int, accountId string) error { guild, exists := gm.Guilds[guildID] @@ -283,6 +256,8 @@ func (gm *GuildMgr) Disband(guildID int, accountId string) error { gm.Guilds[guildID] = nil gm.PendingAccountIds[guildID] = nil gm.Logs[guildID] = nil + + // 确保在删除之前没有其他地方引用了公会对象的指针, 以避免空指针异常 delete(gm.Guilds, guildID) delete(gm.PendingAccountIds, guildID) delete(gm.Logs, guildID) @@ -292,6 +267,59 @@ func (gm *GuildMgr) Disband(guildID int, accountId string) error { return nil } +// SearchGuilds 根据关键字搜索公会 +func (gm *GuildMgr) SearchGuilds(keyword string) []Guild { + var results []Guild + for _, guild := range gm.Guilds { + if containsSubstring(guild.Name, keyword) { + results = append(results, *guild) + } + } + return results +} + +// RandomGuilds 随机10个公会 +func (gm *GuildMgr) RandomGuilds() []Guild { + randomGuildNum := 10 + count := len(gm.Guilds) + if count <= randomGuildNum { + randomGuildNum = count + } + // shuffle 从count50,返回一个slice []int, 包含10个元素 + randIndices := rand.Perm(count)[:randomGuildNum] + var results []Guild + for _, idx := range randIndices { + results = append(results, *gm.Guilds[idx]) + } + return results +} + +// GetGuildByAccountId 查询我的工会 +func (gm *GuildMgr) GetGuildByAccountId(accountId string) *Guild { + for _, guild := range gm.Guilds { + for _, member := range guild.Members { + if accountId == member.AccountId { + return guild + } + } + } + return nil +} + +// Info 工会信息 +func (gm *GuildMgr) Info(accountId string) (*Guild, []string, []*GuildLog) { + guild := gm.GetGuildByAccountId(accountId) + pendingAccountIds := make([]string, 10) + guildLogs := make([]*GuildLog, 10) + if guild != nil { + guildId := guild.ID + pendingAccountIds = gm.PendingAccountIds[guildId] + guildLogs = gm.Logs[guildId] + } + + return guild, pendingAccountIds, guildLogs +} + func containsSubstring(s, substr string) bool { return len(s) >= len(substr) && s[len(s)-len(substr):] == substr } diff --git a/server/imserver/handlermgr.go b/server/imserver/handlermgr.go index d57fd441..e9b1110b 100644 --- a/server/imserver/handlermgr.go +++ b/server/imserver/handlermgr.go @@ -14,7 +14,14 @@ func (this *HandlerMgr) init() { cs.RegHandlerId(int(cs.CMMessageIdE__CMPing), PLAYER_MGR_HANDLER_ID) cs.RegHandlerId(int(cs.CMMessageIdE__CMLogin), PLAYER_MGR_HANDLER_ID) - cs.RegHandlerId(int(cs.CMMessageIdE__CMSearchFriend), PLAYER_HANDLER_ID) + cs.RegHandlerId(int(cs.CMMessageIdE__CMSearchUser), PLAYER_HANDLER_ID) + cs.RegHandlerId(int(cs.CMMessageIdE__CMSearchUserByAccountId), PLAYER_HANDLER_ID) + cs.RegHandlerId(int(cs.CMMessageIdE__CMAddFriendRequest), PLAYER_HANDLER_ID) + cs.RegHandlerId(int(cs.CMMessageIdE__CMAcceptFriendRequest), PLAYER_HANDLER_ID) + cs.RegHandlerId(int(cs.CMMessageIdE__CMRejectFriendRequest), PLAYER_HANDLER_ID) + cs.RegHandlerId(int(cs.CMMessageIdE__CMListPendingFriendRequest), PLAYER_HANDLER_ID) + cs.RegHandlerId(int(cs.CMMessageIdE__CMListFriend), PLAYER_HANDLER_ID) + cs.RegHandlerId(int(cs.CMMessageIdE__CMDeleteFriendShip), PLAYER_HANDLER_ID) } func (this *HandlerMgr) unInit() { diff --git a/server/imserver/player.go b/server/imserver/player.go index 94cefe2b..ab2d03b0 100644 --- a/server/imserver/player.go +++ b/server/imserver/player.go @@ -3,6 +3,7 @@ package main import ( "cs" "f5" + "fmt" ) type Player struct { @@ -12,35 +13,36 @@ type Player struct { sessionId string } -func (p *Player) CMSearchFriends(hdr *f5.MsgHdr, msg *cs.CMSearchFriend) { - rspMsg := new(cs.SMSearchFriend) +// CMSearchUser 搜索用户 +func (p *Player) CMSearchUser(hdr *f5.MsgHdr, msg *cs.CMSearchUser) { + rspMsg := new(cs.SMSearchUser) //rspMsg := &cs.SMSearchFriend{} listUsers := friendMgr.searchUsers(msg.GetSearchKeyword()) for _, u := range listUsers { - friend := &cs.MFFriend{ + friend := &cs.MFUser{ AccountId: &u.AccountId, Username: &u.Username, } - rspMsg.Friends = append(rspMsg.Friends, friend) + rspMsg.Users = append(rspMsg.Users, friend) + } + fmt.Printf("length%d \n", len(rspMsg.Users)) + + wspListener.sendProxyMsg(hdr.Conn, hdr.SocketHandle, rspMsg) +} + +// CMSearchUserByAccountId 搜索指定用户 +func (p *Player) CMSearchUserByAccountId(hdr *f5.MsgHdr, msg *cs.CMSearchUserByAccountId) { + rspMsg := new(cs.SMSearchUserByAccountId) + user := friendMgr.searchByAccountId(msg.GetSearchKeyword()) + if user != nil { + rspMsg.AccountId = &user.AccountId + rspMsg.Username = &user.Username + fmt.Printf("search result: accountId:%s \n", *rspMsg.AccountId) } wspListener.sendProxyMsg(hdr.Conn, hdr.SocketHandle, rspMsg) } -// CMListPendingFriendRequest 等待验证的好友请求 -func (p *Player) CMListPendingFriendRequest(hdr *f5.MsgHdr, msg *cs.CMListPendingFriendRequest) { - rspMsg := &cs.SMListPendingFriendRequest{} - accountId := p.accountId - for accountId, flag := range friendMgr.pendingReqs[accountId] { - row := &cs.MFPendingFriendRequest{ - AccountId: &accountId, - Flag: &flag, - } - rspMsg.PendingFriendRequest = append(rspMsg.PendingFriendRequest, row) - } - f5.GetSysLog().Info("CMListPendingFriendRequest requests count:%d\n", len(rspMsg.PendingFriendRequest)) - wspListener.sendProxyMsg(hdr.Conn, hdr.SocketHandle, rspMsg) -} - +// CMAddFriendRequest 添加好友请求 func (p *Player) CMAddFriendRequest(hdr *f5.MsgHdr, msg *cs.CMAddFriendRequest) { rspMsg := &cs.SMAddFriendRequest{} @@ -60,6 +62,7 @@ func (p *Player) CMAddFriendRequest(hdr *f5.MsgHdr, msg *cs.CMAddFriendRequest) wspListener.sendProxyMsg(hdr.Conn, hdr.SocketHandle, rspMsg) } +// CMAcceptFriendRequest 接受好友请求 func (p *Player) CMAcceptFriendRequest(hdr *f5.MsgHdr, msg *cs.CMAcceptFriendRequest) { rspMsg := &cs.SMAcceptFriendRequest{} @@ -79,25 +82,80 @@ func (p *Player) CMAcceptFriendRequest(hdr *f5.MsgHdr, msg *cs.CMAcceptFriendReq wspListener.sendProxyMsg(hdr.Conn, hdr.SocketHandle, rspMsg) } +// CMRejectFriendRequest 拒绝好友请求 +func (p *Player) CMRejectFriendRequest(hdr *f5.MsgHdr, msg *cs.CMRejectFriendRequest) { + rspMsg := &cs.SMRejectFriendRequest{} + + user1Id := p.accountId + user2Id := msg.GetTargetAccountId() + err := friendMgr.acceptFriendRequest(user1Id, user2Id) + if err != nil { + reason := err.Error() + rspMsg.Reason = &reason + wspListener.sendProxyMsg(hdr.Conn, hdr.SocketHandle, rspMsg) + f5.GetSysLog().Info("CMAcceptFriendRequest: reason:%s, params: %s or %s\n", reason, user1Id, user2Id) + return + } + + status := "reject" + rspMsg.Status = &status + wspListener.sendProxyMsg(hdr.Conn, hdr.SocketHandle, rspMsg) +} + +// CMListPendingFriendRequest 等待验证的好友请求 +func (p *Player) CMListPendingFriendRequest(hdr *f5.MsgHdr, msg *cs.CMListPendingFriendRequest) { + rspMsg := &cs.SMListPendingFriendRequest{} + accountId := p.accountId + for accountId, flag := range friendMgr.pendingReqs[accountId] { + row := &cs.MFPendingFriendRequest{ + AccountId: &accountId, + Flag: &flag, + } + rspMsg.PendingFriendRequest = append(rspMsg.PendingFriendRequest, row) + } + f5.GetSysLog().Info("CMListPendingFriendRequest requests count:%d\n", len(rspMsg.PendingFriendRequest)) + wspListener.sendProxyMsg(hdr.Conn, hdr.SocketHandle, rspMsg) +} + +// CMListFriend 我的好友列表 func (p *Player) CMListFriend(hdr *f5.MsgHdr, msg *cs.CMListFriend) { rspMsg := &cs.SMListFriend{} accountId := p.accountId for _, friendship := range friendMgr.friendships[accountId] { if friendship.User1.AccountId != accountId { - friend := &cs.MFFriend{ + friend := &cs.MFUser{ AccountId: &friendship.User1.AccountId, Username: &friendship.User1.Username, } - rspMsg.Friends = append(rspMsg.Friends, friend) + rspMsg.Users = append(rspMsg.Users, friend) } else { - friend := &cs.MFFriend{ + friend := &cs.MFUser{ AccountId: &friendship.User2.AccountId, Username: &friendship.User2.Username, } - rspMsg.Friends = append(rspMsg.Friends, friend) + rspMsg.Users = append(rspMsg.Users, friend) } } - f5.GetSysLog().Info("CMListFriend friends count:%d\n", len(rspMsg.Friends)) + f5.GetSysLog().Info("CMListFriend friends count:%d\n", len(rspMsg.Users)) + wspListener.sendProxyMsg(hdr.Conn, hdr.SocketHandle, rspMsg) +} + +// CMDeleteFriendShip 删除好友 +func (p *Player) CMDeleteFriendShip(hdr *f5.MsgHdr, msg *cs.CMDeleteFriendShip) { + rspMsg := &cs.SMDeleteFriendShip{} + user1Id := p.accountId + user2Id := msg.GetTargetAccountId() + err := friendMgr.deleteFriendShip(user1Id, user2Id) + if err != nil { + reason := err.Error() + rspMsg.Reason = &reason + wspListener.sendProxyMsg(hdr.Conn, hdr.SocketHandle, rspMsg) + f5.GetSysLog().Info("CMDeleteFriendShip: reason:%s, params: %s or %s\n", reason, user1Id, user2Id) + return + } + + status := "deleted" + rspMsg.Status = &status wspListener.sendProxyMsg(hdr.Conn, hdr.SocketHandle, rspMsg) } diff --git a/server/imserver/proto/cs_msgid.proto b/server/imserver/proto/cs_msgid.proto index ffed4b64..6f36c430 100644 --- a/server/imserver/proto/cs_msgid.proto +++ b/server/imserver/proto/cs_msgid.proto @@ -6,25 +6,33 @@ option go_package = ".;cs"; enum CMMessageId_e { _CMPing = 101; - _CMLogin = 103; _CMReconnect = 104; - _CMSearchFriend = 105; - _CMListPendingFriendRequest = 106; + + _CMSearchUserByAccountId = 105; + _CMSearchUser = 106; _CMAddFriendRequest = 107; _CMAcceptFriendRequest = 108; - _CMListFriend = 109; + _CMRejectFriendRequest = 109; + _CMListPendingFriendRequest = 110; + _CMListFriend = 111; + _CMDeleteFriendShip = 112; } enum SMMessageId_e { _SMPing = 101; _SMRpcError = 102; + _SMLogin = 103; _SMReconnect = 104; - _SMSearchFriend = 105; - _SMListPendingFriendRequest = 106; + + _SMSearchUserByAccountId = 105; + _SMSearchUser = 106; _SMAddFriendRequest = 107; _SMAcceptFriendRequest = 108; - _SMListFriend = 109; - _SMLogin = 103; + _SMRejectFriendRequest = 109; + _SMListPendingFriendRequest = 110; + _SMListFriend = 111; + _SMDeleteFriendShip = 112; + } diff --git a/server/imserver/proto/cs_proto.proto b/server/imserver/proto/cs_proto.proto index 3be588f7..cfe09bce 100644 --- a/server/imserver/proto/cs_proto.proto +++ b/server/imserver/proto/cs_proto.proto @@ -119,38 +119,34 @@ message SMReconnect // 请求搜索用户 -message CMSearchFriend +message CMSearchUser { - optional int32 server_id = 1; //保留 - optional string team_uuid = 2; //保留 - optional string search_keyword = 6; //搜索文本关键字 + optional string search_keyword = 1; //搜索文本关键字 } // 回复搜索用户 -message SMSearchFriend +message SMSearchUser { - repeated MFFriend friends = 1; + repeated MFUser users = 1; } -// 请求等待验证的好友请求 -message CMListPendingFriendRequest +// 请求搜索用户 CMSearchUserByAccountId +message CMSearchUserByAccountId { - optional int32 server_id = 1; //保留 - optional string team_uuid = 2; //保留 + optional string search_keyword = 1; //搜索account id } -// 回复等待验证的好友请求 -message SMListPendingFriendRequest +// 回复搜索用户 +message SMSearchUserByAccountId { - repeated MFPendingFriendRequest pendingFriendRequest = 1; + optional string account_id = 1; + optional string username = 2; } // 请求发送添加好友请求 message CMAddFriendRequest { - optional int32 server_id = 1; //保留 - optional string team_uuid = 2; //保留 - optional string target_account_id = 3; //账号id + optional string target_account_id = 1; // 账号id } // 回复发送添加好友请求 @@ -160,41 +156,74 @@ message SMAddFriendRequest optional string status = 2; } -// 同意接受发送添加好友请求 +// 请求接受好友请求 message CMAcceptFriendRequest { - optional int32 server_id = 1; //保留 - optional string team_uuid = 2; //保留 - optional string target_account_id = 3; // + optional string target_account_id = 1; // 账号id } -// 同意接受发送添加好友请求 +// 回复接受好友请求 message SMAcceptFriendRequest { optional string reason = 1; optional string status = 2; } -// 请求我的好友列表 -message CMListFriend +// 请求拒绝好友请求 +message CMRejectFriendRequest +{ + optional string target_account_id = 1; // 账号id +} + +// 回复拒绝好友请求 +message SMRejectFriendRequest +{ + optional string reason = 1; + optional string status = 2; +} + + +// 请求等待验证的好友请求 +message CMListPendingFriendRequest { - optional int32 server_id = 1; //保留 - optional string team_uuid = 2; //保留 } // 回复等待验证的好友请求 +message SMListPendingFriendRequest +{ + repeated MFPendingFriendRequest pendingFriendRequest = 1; +} + +// 请求我的好友列表 +message CMListFriend +{ +} + +// 回复我的好友列表 +message SMListFriend +{ + repeated MFUser users = 1; +} + + +// 请求删除好友 +message CMDeleteFriendShip +{ + optional string target_account_id = 1; // 账号id +} + +// 回复删除好友 +message SMDeleteFriendShip +{ + optional string reason = 1; + optional string status = 2; +} + +message MFUser { + optional string account_id = 1; + optional string username = 2; +} message MFPendingFriendRequest { optional string account_id = 1; optional bool flag = 2; } - -// 回复我的好友列表 -message MFFriend { - optional string account_id = 1; - optional string username = 2; -} - -message SMListFriend -{ - repeated MFFriend friends = 1; -} diff --git a/server/imserver/ss/ss.auto_gen.go b/server/imserver/ss/ss.auto_gen.go index c9818852..d9564a55 100644 --- a/server/imserver/ss/ss.auto_gen.go +++ b/server/imserver/ss/ss.auto_gen.go @@ -38,8 +38,6 @@ type MsgHandler interface { SS_Ping(*f5.MsgHdr, *SS_Ping) SS_Pong(*f5.MsgHdr, *SS_Pong) SS_WSP_SocketDisconnect(*f5.MsgHdr, *SS_WSP_SocketDisconnect) - SS_WSP_RequestTargetServer(*f5.MsgHdr, *SS_WSP_RequestTargetServer) - SS_MS_ResponseTargetServer(*f5.MsgHdr, *SS_MS_ResponseTargetServer) SS_ForceCloseSocket(*f5.MsgHdr, *SS_ForceCloseSocket) } @@ -52,12 +50,6 @@ func (this *MsgHandlerImpl) SS_Pong(hdr *f5.MsgHdr, msg *SS_Pong) { func (this *MsgHandlerImpl) SS_WSP_SocketDisconnect(hdr *f5.MsgHdr, msg *SS_WSP_SocketDisconnect) { } -func (this *MsgHandlerImpl) SS_WSP_RequestTargetServer(hdr *f5.MsgHdr, msg *SS_WSP_RequestTargetServer) { -} - -func (this *MsgHandlerImpl) SS_MS_ResponseTargetServer(hdr *f5.MsgHdr, msg *SS_MS_ResponseTargetServer) { -} - func (this *MsgHandlerImpl) SS_ForceCloseSocket(hdr *f5.MsgHdr, msg *SS_ForceCloseSocket) { } @@ -73,14 +65,6 @@ func (this *SS_WSP_SocketDisconnect) GetNetMsgId() uint16 { return uint16(SSMessageIdE__SS_WSP_SocketDisconnect) } -func (this *SS_WSP_RequestTargetServer) GetNetMsgId() uint16 { - return uint16(SSMessageIdE__SS_WSP_RequestTargetServer) -} - -func (this *SS_MS_ResponseTargetServer) GetNetMsgId() uint16 { - return uint16(SSMessageIdE__SS_MS_ResponseTargetServer) -} - func (this *SS_ForceCloseSocket) GetNetMsgId() uint16 { return uint16(SSMessageIdE__SS_ForceCloseSocket) } @@ -123,30 +107,6 @@ func init() { }, } - handlers[int(SSMessageIdE__SS_WSP_RequestTargetServer)] = &SsNetMsgHandler{ - MsgId: int(SSMessageIdE__SS_WSP_RequestTargetServer), - ParseCb: func (data []byte) interface{} { - msg := &SS_WSP_RequestTargetServer{} - proto.Unmarshal(data, msg) - return msg - }, - Cb: func (hdr *f5.MsgHdr, handler MsgHandler) { - handler.SS_WSP_RequestTargetServer(hdr, hdr.Msg.(*SS_WSP_RequestTargetServer)) - }, - } - - handlers[int(SSMessageIdE__SS_MS_ResponseTargetServer)] = &SsNetMsgHandler{ - MsgId: int(SSMessageIdE__SS_MS_ResponseTargetServer), - ParseCb: func (data []byte) interface{} { - msg := &SS_MS_ResponseTargetServer{} - proto.Unmarshal(data, msg) - return msg - }, - Cb: func (hdr *f5.MsgHdr, handler MsgHandler) { - handler.SS_MS_ResponseTargetServer(hdr, hdr.Msg.(*SS_MS_ResponseTargetServer)) - }, - } - handlers[int(SSMessageIdE__SS_ForceCloseSocket)] = &SsNetMsgHandler{ MsgId: int(SSMessageIdE__SS_ForceCloseSocket), ParseCb: func (data []byte) interface{} { diff --git a/server/imserver/ss/ss_msgid.pb.go b/server/imserver/ss/ss_msgid.pb.go index ee8ae9ad..c29fb2ab 100644 --- a/server/imserver/ss/ss_msgid.pb.go +++ b/server/imserver/ss/ss_msgid.pb.go @@ -24,12 +24,10 @@ const ( type SSMessageIdE int32 const ( - SSMessageIdE__SS_Ping SSMessageIdE = 8 - SSMessageIdE__SS_Pong SSMessageIdE = 9 - SSMessageIdE__SS_WSP_SocketDisconnect SSMessageIdE = 10 - SSMessageIdE__SS_WSP_RequestTargetServer SSMessageIdE = 11 - SSMessageIdE__SS_MS_ResponseTargetServer SSMessageIdE = 12 - SSMessageIdE__SS_ForceCloseSocket SSMessageIdE = 13 + SSMessageIdE__SS_Ping SSMessageIdE = 8 + SSMessageIdE__SS_Pong SSMessageIdE = 9 + SSMessageIdE__SS_WSP_SocketDisconnect SSMessageIdE = 10 + SSMessageIdE__SS_ForceCloseSocket SSMessageIdE = 13 ) // Enum value maps for SSMessageIdE. @@ -38,17 +36,13 @@ var ( 8: "_SS_Ping", 9: "_SS_Pong", 10: "_SS_WSP_SocketDisconnect", - 11: "_SS_WSP_RequestTargetServer", - 12: "_SS_MS_ResponseTargetServer", 13: "_SS_ForceCloseSocket", } SSMessageIdE_value = map[string]int32{ - "_SS_Ping": 8, - "_SS_Pong": 9, - "_SS_WSP_SocketDisconnect": 10, - "_SS_WSP_RequestTargetServer": 11, - "_SS_MS_ResponseTargetServer": 12, - "_SS_ForceCloseSocket": 13, + "_SS_Ping": 8, + "_SS_Pong": 9, + "_SS_WSP_SocketDisconnect": 10, + "_SS_ForceCloseSocket": 13, } ) @@ -93,18 +87,14 @@ var File_ss_msgid_proto protoreflect.FileDescriptor var file_ss_msgid_proto_rawDesc = []byte{ 0x0a, 0x0e, 0x73, 0x73, 0x5f, 0x6d, 0x73, 0x67, 0x69, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x12, 0x02, 0x73, 0x73, 0x2a, 0xa5, 0x01, 0x0a, 0x0d, 0x53, 0x53, 0x4d, 0x65, 0x73, 0x73, 0x61, - 0x67, 0x65, 0x49, 0x64, 0x5f, 0x65, 0x12, 0x0c, 0x0a, 0x08, 0x5f, 0x53, 0x53, 0x5f, 0x50, 0x69, - 0x6e, 0x67, 0x10, 0x08, 0x12, 0x0c, 0x0a, 0x08, 0x5f, 0x53, 0x53, 0x5f, 0x50, 0x6f, 0x6e, 0x67, - 0x10, 0x09, 0x12, 0x1c, 0x0a, 0x18, 0x5f, 0x53, 0x53, 0x5f, 0x57, 0x53, 0x50, 0x5f, 0x53, 0x6f, - 0x63, 0x6b, 0x65, 0x74, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x10, 0x0a, - 0x12, 0x1f, 0x0a, 0x1b, 0x5f, 0x53, 0x53, 0x5f, 0x57, 0x53, 0x50, 0x5f, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x10, - 0x0b, 0x12, 0x1f, 0x0a, 0x1b, 0x5f, 0x53, 0x53, 0x5f, 0x4d, 0x53, 0x5f, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, - 0x10, 0x0c, 0x12, 0x18, 0x0a, 0x14, 0x5f, 0x53, 0x53, 0x5f, 0x46, 0x6f, 0x72, 0x63, 0x65, 0x43, - 0x6c, 0x6f, 0x73, 0x65, 0x53, 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x10, 0x0d, 0x42, 0x06, 0x5a, 0x04, - 0x2e, 0x3b, 0x73, 0x73, + 0x12, 0x02, 0x73, 0x73, 0x2a, 0x63, 0x0a, 0x0d, 0x53, 0x53, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x49, 0x64, 0x5f, 0x65, 0x12, 0x0c, 0x0a, 0x08, 0x5f, 0x53, 0x53, 0x5f, 0x50, 0x69, 0x6e, + 0x67, 0x10, 0x08, 0x12, 0x0c, 0x0a, 0x08, 0x5f, 0x53, 0x53, 0x5f, 0x50, 0x6f, 0x6e, 0x67, 0x10, + 0x09, 0x12, 0x1c, 0x0a, 0x18, 0x5f, 0x53, 0x53, 0x5f, 0x57, 0x53, 0x50, 0x5f, 0x53, 0x6f, 0x63, + 0x6b, 0x65, 0x74, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x10, 0x0a, 0x12, + 0x18, 0x0a, 0x14, 0x5f, 0x53, 0x53, 0x5f, 0x46, 0x6f, 0x72, 0x63, 0x65, 0x43, 0x6c, 0x6f, 0x73, + 0x65, 0x53, 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x10, 0x0d, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x73, + 0x73, } var ( diff --git a/server/imserver/ss/ss_proto.pb.go b/server/imserver/ss/ss_proto.pb.go index eedbe5b3..00901805 100644 --- a/server/imserver/ss/ss_proto.pb.go +++ b/server/imserver/ss/ss_proto.pb.go @@ -134,148 +134,6 @@ func (*SS_WSP_SocketDisconnect) Descriptor() ([]byte, []int) { return file_ss_proto_proto_rawDescGZIP(), []int{2} } -type SS_WSP_RequestTargetServer struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ContextId *int64 `protobuf:"varint,1,opt,name=context_id,json=contextId" json:"context_id,omitempty"` - AccountId *string `protobuf:"bytes,2,opt,name=account_id,json=accountId" json:"account_id,omitempty"` - TeamId *string `protobuf:"bytes,3,opt,name=team_id,json=teamId" json:"team_id,omitempty"` -} - -func (x *SS_WSP_RequestTargetServer) Reset() { - *x = SS_WSP_RequestTargetServer{} - if protoimpl.UnsafeEnabled { - mi := &file_ss_proto_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SS_WSP_RequestTargetServer) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SS_WSP_RequestTargetServer) ProtoMessage() {} - -func (x *SS_WSP_RequestTargetServer) ProtoReflect() protoreflect.Message { - mi := &file_ss_proto_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SS_WSP_RequestTargetServer.ProtoReflect.Descriptor instead. -func (*SS_WSP_RequestTargetServer) Descriptor() ([]byte, []int) { - return file_ss_proto_proto_rawDescGZIP(), []int{3} -} - -func (x *SS_WSP_RequestTargetServer) GetContextId() int64 { - if x != nil && x.ContextId != nil { - return *x.ContextId - } - return 0 -} - -func (x *SS_WSP_RequestTargetServer) GetAccountId() string { - if x != nil && x.AccountId != nil { - return *x.AccountId - } - return "" -} - -func (x *SS_WSP_RequestTargetServer) GetTeamId() string { - if x != nil && x.TeamId != nil { - return *x.TeamId - } - return "" -} - -type SS_MS_ResponseTargetServer struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ErrorCode *int32 `protobuf:"varint,1,opt,name=error_code,json=errorCode" json:"error_code,omitempty"` - ErrorMsg *string `protobuf:"bytes,2,opt,name=error_msg,json=errorMsg" json:"error_msg,omitempty"` - ContextId *int64 `protobuf:"varint,3,opt,name=context_id,json=contextId" json:"context_id,omitempty"` - Host *string `protobuf:"bytes,4,opt,name=host" json:"host,omitempty"` - Port *int32 `protobuf:"varint,5,opt,name=port" json:"port,omitempty"` -} - -func (x *SS_MS_ResponseTargetServer) Reset() { - *x = SS_MS_ResponseTargetServer{} - if protoimpl.UnsafeEnabled { - mi := &file_ss_proto_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SS_MS_ResponseTargetServer) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SS_MS_ResponseTargetServer) ProtoMessage() {} - -func (x *SS_MS_ResponseTargetServer) ProtoReflect() protoreflect.Message { - mi := &file_ss_proto_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SS_MS_ResponseTargetServer.ProtoReflect.Descriptor instead. -func (*SS_MS_ResponseTargetServer) Descriptor() ([]byte, []int) { - return file_ss_proto_proto_rawDescGZIP(), []int{4} -} - -func (x *SS_MS_ResponseTargetServer) GetErrorCode() int32 { - if x != nil && x.ErrorCode != nil { - return *x.ErrorCode - } - return 0 -} - -func (x *SS_MS_ResponseTargetServer) GetErrorMsg() string { - if x != nil && x.ErrorMsg != nil { - return *x.ErrorMsg - } - return "" -} - -func (x *SS_MS_ResponseTargetServer) GetContextId() int64 { - if x != nil && x.ContextId != nil { - return *x.ContextId - } - return 0 -} - -func (x *SS_MS_ResponseTargetServer) GetHost() string { - if x != nil && x.Host != nil { - return *x.Host - } - return "" -} - -func (x *SS_MS_ResponseTargetServer) GetPort() int32 { - if x != nil && x.Port != nil { - return *x.Port - } - return 0 -} - type SS_ForceCloseSocket struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -285,7 +143,7 @@ type SS_ForceCloseSocket struct { func (x *SS_ForceCloseSocket) Reset() { *x = SS_ForceCloseSocket{} if protoimpl.UnsafeEnabled { - mi := &file_ss_proto_proto_msgTypes[5] + mi := &file_ss_proto_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -298,7 +156,7 @@ func (x *SS_ForceCloseSocket) String() string { func (*SS_ForceCloseSocket) ProtoMessage() {} func (x *SS_ForceCloseSocket) ProtoReflect() protoreflect.Message { - mi := &file_ss_proto_proto_msgTypes[5] + mi := &file_ss_proto_proto_msgTypes[3] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -311,7 +169,7 @@ func (x *SS_ForceCloseSocket) ProtoReflect() protoreflect.Message { // Deprecated: Use SS_ForceCloseSocket.ProtoReflect.Descriptor instead. func (*SS_ForceCloseSocket) Descriptor() ([]byte, []int) { - return file_ss_proto_proto_rawDescGZIP(), []int{5} + return file_ss_proto_proto_rawDescGZIP(), []int{3} } var File_ss_proto_proto protoreflect.FileDescriptor @@ -321,26 +179,9 @@ var file_ss_proto_proto_rawDesc = []byte{ 0x12, 0x02, 0x73, 0x73, 0x22, 0x09, 0x0a, 0x07, 0x53, 0x53, 0x5f, 0x50, 0x69, 0x6e, 0x67, 0x22, 0x09, 0x0a, 0x07, 0x53, 0x53, 0x5f, 0x50, 0x6f, 0x6e, 0x67, 0x22, 0x19, 0x0a, 0x17, 0x53, 0x53, 0x5f, 0x57, 0x53, 0x50, 0x5f, 0x53, 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x44, 0x69, 0x73, 0x63, 0x6f, - 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x22, 0x73, 0x0a, 0x1a, 0x53, 0x53, 0x5f, 0x57, 0x53, 0x50, 0x5f, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x53, 0x65, 0x72, - 0x76, 0x65, 0x72, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x5f, 0x69, - 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, - 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x69, 0x64, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, - 0x64, 0x12, 0x17, 0x0a, 0x07, 0x74, 0x65, 0x61, 0x6d, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x06, 0x74, 0x65, 0x61, 0x6d, 0x49, 0x64, 0x22, 0x9f, 0x01, 0x0a, 0x1a, 0x53, - 0x53, 0x5f, 0x4d, 0x53, 0x5f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x54, 0x61, 0x72, - 0x67, 0x65, 0x74, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x12, 0x1d, 0x0a, 0x0a, 0x65, 0x72, 0x72, - 0x6f, 0x72, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x65, - 0x72, 0x72, 0x6f, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x65, 0x72, 0x72, 0x6f, - 0x72, 0x5f, 0x6d, 0x73, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, 0x72, 0x72, - 0x6f, 0x72, 0x4d, 0x73, 0x67, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, - 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x63, 0x6f, 0x6e, 0x74, 0x65, - 0x78, 0x74, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x68, 0x6f, 0x73, 0x74, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x04, 0x68, 0x6f, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x6f, 0x72, 0x74, - 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x22, 0x15, 0x0a, 0x13, - 0x53, 0x53, 0x5f, 0x46, 0x6f, 0x72, 0x63, 0x65, 0x43, 0x6c, 0x6f, 0x73, 0x65, 0x53, 0x6f, 0x63, - 0x6b, 0x65, 0x74, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x73, 0x73, + 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x22, 0x15, 0x0a, 0x13, 0x53, 0x53, 0x5f, 0x46, 0x6f, 0x72, 0x63, + 0x65, 0x43, 0x6c, 0x6f, 0x73, 0x65, 0x53, 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x42, 0x06, 0x5a, 0x04, + 0x2e, 0x3b, 0x73, 0x73, } var ( @@ -355,14 +196,12 @@ func file_ss_proto_proto_rawDescGZIP() []byte { return file_ss_proto_proto_rawDescData } -var file_ss_proto_proto_msgTypes = make([]protoimpl.MessageInfo, 6) +var file_ss_proto_proto_msgTypes = make([]protoimpl.MessageInfo, 4) var file_ss_proto_proto_goTypes = []interface{}{ - (*SS_Ping)(nil), // 0: ss.SS_Ping - (*SS_Pong)(nil), // 1: ss.SS_Pong - (*SS_WSP_SocketDisconnect)(nil), // 2: ss.SS_WSP_SocketDisconnect - (*SS_WSP_RequestTargetServer)(nil), // 3: ss.SS_WSP_RequestTargetServer - (*SS_MS_ResponseTargetServer)(nil), // 4: ss.SS_MS_ResponseTargetServer - (*SS_ForceCloseSocket)(nil), // 5: ss.SS_ForceCloseSocket + (*SS_Ping)(nil), // 0: ss.SS_Ping + (*SS_Pong)(nil), // 1: ss.SS_Pong + (*SS_WSP_SocketDisconnect)(nil), // 2: ss.SS_WSP_SocketDisconnect + (*SS_ForceCloseSocket)(nil), // 3: ss.SS_ForceCloseSocket } var file_ss_proto_proto_depIdxs = []int32{ 0, // [0:0] is the sub-list for method output_type @@ -415,30 +254,6 @@ func file_ss_proto_proto_init() { } } file_ss_proto_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SS_WSP_RequestTargetServer); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_ss_proto_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SS_MS_ResponseTargetServer); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_ss_proto_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*SS_ForceCloseSocket); i { case 0: return &v.state @@ -457,7 +272,7 @@ func file_ss_proto_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_ss_proto_proto_rawDesc, NumEnums: 0, - NumMessages: 6, + NumMessages: 4, NumExtensions: 0, NumServices: 0, }, diff --git a/server/slgserver/go.sum b/server/slgserver/go.sum new file mode 100644 index 00000000..e31bb169 --- /dev/null +++ b/server/slgserver/go.sum @@ -0,0 +1,16 @@ +github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= +github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= +github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= +github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= +github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= +github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= +google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= +google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= +google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= +google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= +google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=