From 2ea8e5a11f4db634b915877be8cc7c5fbf0a026a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=AE=B7=E5=8B=87?= Date: Mon, 4 Sep 2023 14:43:01 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/imserver/constant.go | 35 +- server/imserver/cs/cs_proto.pb.go | 776 ++++++++++++++++----------- server/imserver/guild.go | 54 +- server/imserver/guilddbmgr.go | 66 +-- server/imserver/guildmgr.go | 510 +++++++++--------- server/imserver/player.go | 230 ++++---- server/imserver/proto/cs_proto.proto | 72 +-- 7 files changed, 945 insertions(+), 798 deletions(-) diff --git a/server/imserver/constant.go b/server/imserver/constant.go index 1f73e973..5001b86c 100644 --- a/server/imserver/constant.go +++ b/server/imserver/constant.go @@ -45,23 +45,24 @@ const ( // im server guild const ( - RandomGuildCount = 10 - MaxMembers = 10 - MaxPendingReqs = 10 - DefaultLogs = 20 - LogTypeApprove = 1 // 公会日志类型, 批准加入 - LogTypeLeave = 2 - LogTypeDismiss = 3 - LogTypePromote = 4 - LogTypeDemote = 5 - LogTypeDisband = 6 - GuildMemberLevelLeader = 1 // 成员等级, 会长 - GuildMemberLevelViceLeader = 2 // 成员等级, 副会长 - GuildMemberLevelElite = 3 // 成员等级, 精英 - GuildMemberLevelDefault = 3 // 成员等级, 普通成员 - JoinCondDefault = 0 // 加入条件 0 需要审批 - JoinCondFree = 1 // 加入条件 1 可直接加入 - JoinCondStar = 2 // 加入条件 2 满足星星条件 + RandomGuildCount = 10 + MaxMembers = 10 + MaxPendingReqs = 10 + DefaultLogs = 20 + LogTypeApprove = 1 // 公会日志类型, 批准加入 + LogTypeLeave = 2 + LogTypeDismiss = 3 + LogTypePromote = 4 + LogTypeDemote = 5 + LogTypeDisband = 6 + GuildMemberLevelLeader = 1 // 成员等级, 会长 + GuildMemberLevelViceLeader = 2 // 成员等级, 副会长 + GuildMemberLevelElite = 3 // 成员等级, 精英 + GuildMemberLevelDefault = 4 // 成员等级, 普通成员 + JoinCondDefault = 0 // 加入条件 0 需要审批 + JoinCondFree = 1 // 加入条件 1 可直接加入 + JoinCondStar = 2 // 加入条件 2 满足星星条件 + PendingReqIsJoinGuildStatusDefault = 0 // 等待验证请求状态, 0 等待审核 PendingReqIsJoinGuildStatusJoined = 1 // 等待验证请求状态, 1 已加入 PendingReqIsJoinGuildStatusReject = 2 // 等待验证请求状态, 2 拒绝 diff --git a/server/imserver/cs/cs_proto.pb.go b/server/imserver/cs/cs_proto.pb.go index e99ac57a..3cff9580 100644 --- a/server/imserver/cs/cs_proto.pb.go +++ b/server/imserver/cs/cs_proto.pb.go @@ -2624,8 +2624,9 @@ type SMCreateGuild struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - GuildId *int64 `protobuf:"varint,1,opt,name=guild_id,json=guildId" json:"guild_id,omitempty"` + ErrCode *int32 `protobuf:"varint,1,opt,name=err_code,json=errCode" json:"err_code,omitempty"` ErrMsg *string `protobuf:"bytes,2,opt,name=err_msg,json=errMsg" json:"err_msg,omitempty"` + GuildId *int64 `protobuf:"varint,3,opt,name=guild_id,json=guildId" json:"guild_id,omitempty"` } func (x *SMCreateGuild) Reset() { @@ -2660,9 +2661,9 @@ func (*SMCreateGuild) Descriptor() ([]byte, []int) { return file_cs_proto_proto_rawDescGZIP(), []int{47} } -func (x *SMCreateGuild) GetGuildId() int64 { - if x != nil && x.GuildId != nil { - return *x.GuildId +func (x *SMCreateGuild) GetErrCode() int32 { + if x != nil && x.ErrCode != nil { + return *x.ErrCode } return 0 } @@ -2674,6 +2675,13 @@ func (x *SMCreateGuild) GetErrMsg() string { return "" } +func (x *SMCreateGuild) GetGuildId() int64 { + if x != nil && x.GuildId != nil { + return *x.GuildId + } + return 0 +} + // 请求申请加入公会 type CMApplyToGuild struct { state protoimpl.MessageState @@ -2728,7 +2736,8 @@ type SMApplyToGuild struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - ErrMsg *string `protobuf:"bytes,1,opt,name=err_msg,json=errMsg" json:"err_msg,omitempty"` + ErrCode *int32 `protobuf:"varint,1,opt,name=err_code,json=errCode" json:"err_code,omitempty"` + ErrMsg *string `protobuf:"bytes,2,opt,name=err_msg,json=errMsg" json:"err_msg,omitempty"` } func (x *SMApplyToGuild) Reset() { @@ -2763,6 +2772,13 @@ func (*SMApplyToGuild) Descriptor() ([]byte, []int) { return file_cs_proto_proto_rawDescGZIP(), []int{49} } +func (x *SMApplyToGuild) GetErrCode() int32 { + if x != nil && x.ErrCode != nil { + return *x.ErrCode + } + return 0 +} + func (x *SMApplyToGuild) GetErrMsg() string { if x != nil && x.ErrMsg != nil { return *x.ErrMsg @@ -2815,7 +2831,9 @@ type SMApplyList struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - AccountId []string `protobuf:"bytes,1,rep,name=account_id,json=accountId" json:"account_id,omitempty"` + ErrCode *string `protobuf:"bytes,1,opt,name=err_code,json=errCode" json:"err_code,omitempty"` + ErrMsg *string `protobuf:"bytes,2,opt,name=err_msg,json=errMsg" json:"err_msg,omitempty"` + ApplyInfo []*MFApplyInfo `protobuf:"bytes,3,rep,name=apply_info,json=applyInfo" json:"apply_info,omitempty"` } func (x *SMApplyList) Reset() { @@ -2850,27 +2868,95 @@ func (*SMApplyList) Descriptor() ([]byte, []int) { return file_cs_proto_proto_rawDescGZIP(), []int{51} } -func (x *SMApplyList) GetAccountId() []string { +func (x *SMApplyList) GetErrCode() string { + if x != nil && x.ErrCode != nil { + return *x.ErrCode + } + return "" +} + +func (x *SMApplyList) GetErrMsg() string { + if x != nil && x.ErrMsg != nil { + return *x.ErrMsg + } + return "" +} + +func (x *SMApplyList) GetApplyInfo() []*MFApplyInfo { if x != nil { - return x.AccountId + return x.ApplyInfo } return nil } +type MFApplyInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + AccountId *string `protobuf:"bytes,2,opt,name=account_id,json=accountId" json:"account_id,omitempty"` + Status *int32 `protobuf:"varint,3,opt,name=status" json:"status,omitempty"` +} + +func (x *MFApplyInfo) Reset() { + *x = MFApplyInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_cs_proto_proto_msgTypes[52] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MFApplyInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MFApplyInfo) ProtoMessage() {} + +func (x *MFApplyInfo) ProtoReflect() protoreflect.Message { + mi := &file_cs_proto_proto_msgTypes[52] + 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 MFApplyInfo.ProtoReflect.Descriptor instead. +func (*MFApplyInfo) Descriptor() ([]byte, []int) { + return file_cs_proto_proto_rawDescGZIP(), []int{52} +} + +func (x *MFApplyInfo) GetAccountId() string { + if x != nil && x.AccountId != nil { + return *x.AccountId + } + return "" +} + +func (x *MFApplyInfo) GetStatus() int32 { + if x != nil && x.Status != nil { + return *x.Status + } + return 0 +} + // 请求批准申请加入公会 type CMApprove struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - GuildId *int64 `protobuf:"varint,1,opt,name=guild_id,json=guildId" json:"guild_id,omitempty"` - ApplicantAccountId *string `protobuf:"bytes,2,opt,name=applicant_account_id,json=applicantAccountId" json:"applicant_account_id,omitempty"` + ApplicantAccountId *string `protobuf:"bytes,1,opt,name=applicant_account_id,json=applicantAccountId" json:"applicant_account_id,omitempty"` } func (x *CMApprove) Reset() { *x = CMApprove{} if protoimpl.UnsafeEnabled { - mi := &file_cs_proto_proto_msgTypes[52] + mi := &file_cs_proto_proto_msgTypes[53] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2883,7 +2969,7 @@ func (x *CMApprove) String() string { func (*CMApprove) ProtoMessage() {} func (x *CMApprove) ProtoReflect() protoreflect.Message { - mi := &file_cs_proto_proto_msgTypes[52] + mi := &file_cs_proto_proto_msgTypes[53] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2896,14 +2982,7 @@ func (x *CMApprove) ProtoReflect() protoreflect.Message { // Deprecated: Use CMApprove.ProtoReflect.Descriptor instead. func (*CMApprove) Descriptor() ([]byte, []int) { - return file_cs_proto_proto_rawDescGZIP(), []int{52} -} - -func (x *CMApprove) GetGuildId() int64 { - if x != nil && x.GuildId != nil { - return *x.GuildId - } - return 0 + return file_cs_proto_proto_rawDescGZIP(), []int{53} } func (x *CMApprove) GetApplicantAccountId() string { @@ -2919,13 +2998,14 @@ type SMApprove struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - ErrMsg *string `protobuf:"bytes,1,opt,name=err_msg,json=errMsg" json:"err_msg,omitempty"` + ErrCode *int32 `protobuf:"varint,1,opt,name=err_code,json=errCode" json:"err_code,omitempty"` + ErrMsg *string `protobuf:"bytes,2,opt,name=err_msg,json=errMsg" json:"err_msg,omitempty"` } func (x *SMApprove) Reset() { *x = SMApprove{} if protoimpl.UnsafeEnabled { - mi := &file_cs_proto_proto_msgTypes[53] + mi := &file_cs_proto_proto_msgTypes[54] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2938,7 +3018,7 @@ func (x *SMApprove) String() string { func (*SMApprove) ProtoMessage() {} func (x *SMApprove) ProtoReflect() protoreflect.Message { - mi := &file_cs_proto_proto_msgTypes[53] + mi := &file_cs_proto_proto_msgTypes[54] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2951,7 +3031,14 @@ func (x *SMApprove) ProtoReflect() protoreflect.Message { // Deprecated: Use SMApprove.ProtoReflect.Descriptor instead. func (*SMApprove) Descriptor() ([]byte, []int) { - return file_cs_proto_proto_rawDescGZIP(), []int{53} + return file_cs_proto_proto_rawDescGZIP(), []int{54} +} + +func (x *SMApprove) GetErrCode() int32 { + if x != nil && x.ErrCode != nil { + return *x.ErrCode + } + return 0 } func (x *SMApprove) GetErrMsg() string { @@ -2967,14 +3054,13 @@ type CMReject struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - GuildId *int64 `protobuf:"varint,1,opt,name=guild_id,json=guildId" json:"guild_id,omitempty"` - ApplicantAccountId *string `protobuf:"bytes,2,opt,name=applicant_account_id,json=applicantAccountId" json:"applicant_account_id,omitempty"` + ApplicantAccountId *string `protobuf:"bytes,1,opt,name=applicant_account_id,json=applicantAccountId" json:"applicant_account_id,omitempty"` } func (x *CMReject) Reset() { *x = CMReject{} if protoimpl.UnsafeEnabled { - mi := &file_cs_proto_proto_msgTypes[54] + mi := &file_cs_proto_proto_msgTypes[55] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2987,7 +3073,7 @@ func (x *CMReject) String() string { func (*CMReject) ProtoMessage() {} func (x *CMReject) ProtoReflect() protoreflect.Message { - mi := &file_cs_proto_proto_msgTypes[54] + mi := &file_cs_proto_proto_msgTypes[55] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3000,14 +3086,7 @@ func (x *CMReject) ProtoReflect() protoreflect.Message { // Deprecated: Use CMReject.ProtoReflect.Descriptor instead. func (*CMReject) Descriptor() ([]byte, []int) { - return file_cs_proto_proto_rawDescGZIP(), []int{54} -} - -func (x *CMReject) GetGuildId() int64 { - if x != nil && x.GuildId != nil { - return *x.GuildId - } - return 0 + return file_cs_proto_proto_rawDescGZIP(), []int{55} } func (x *CMReject) GetApplicantAccountId() string { @@ -3023,13 +3102,14 @@ type SMReject struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - ErrMsg *string `protobuf:"bytes,1,opt,name=err_msg,json=errMsg" json:"err_msg,omitempty"` + ErrCode *int32 `protobuf:"varint,1,opt,name=err_code,json=errCode" json:"err_code,omitempty"` + ErrMsg *string `protobuf:"bytes,2,opt,name=err_msg,json=errMsg" json:"err_msg,omitempty"` } func (x *SMReject) Reset() { *x = SMReject{} if protoimpl.UnsafeEnabled { - mi := &file_cs_proto_proto_msgTypes[55] + mi := &file_cs_proto_proto_msgTypes[56] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3042,7 +3122,7 @@ func (x *SMReject) String() string { func (*SMReject) ProtoMessage() {} func (x *SMReject) ProtoReflect() protoreflect.Message { - mi := &file_cs_proto_proto_msgTypes[55] + mi := &file_cs_proto_proto_msgTypes[56] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3055,7 +3135,14 @@ func (x *SMReject) ProtoReflect() protoreflect.Message { // Deprecated: Use SMReject.ProtoReflect.Descriptor instead. func (*SMReject) Descriptor() ([]byte, []int) { - return file_cs_proto_proto_rawDescGZIP(), []int{55} + return file_cs_proto_proto_rawDescGZIP(), []int{56} +} + +func (x *SMReject) GetErrCode() int32 { + if x != nil && x.ErrCode != nil { + return *x.ErrCode + } + return 0 } func (x *SMReject) GetErrMsg() string { @@ -3070,14 +3157,12 @@ type CMLeaveGuild struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - - GuildId *int64 `protobuf:"varint,1,opt,name=guild_id,json=guildId" json:"guild_id,omitempty"` } func (x *CMLeaveGuild) Reset() { *x = CMLeaveGuild{} if protoimpl.UnsafeEnabled { - mi := &file_cs_proto_proto_msgTypes[56] + mi := &file_cs_proto_proto_msgTypes[57] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3090,7 +3175,7 @@ func (x *CMLeaveGuild) String() string { func (*CMLeaveGuild) ProtoMessage() {} func (x *CMLeaveGuild) ProtoReflect() protoreflect.Message { - mi := &file_cs_proto_proto_msgTypes[56] + mi := &file_cs_proto_proto_msgTypes[57] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3103,14 +3188,7 @@ func (x *CMLeaveGuild) ProtoReflect() protoreflect.Message { // Deprecated: Use CMLeaveGuild.ProtoReflect.Descriptor instead. func (*CMLeaveGuild) Descriptor() ([]byte, []int) { - return file_cs_proto_proto_rawDescGZIP(), []int{56} -} - -func (x *CMLeaveGuild) GetGuildId() int64 { - if x != nil && x.GuildId != nil { - return *x.GuildId - } - return 0 + return file_cs_proto_proto_rawDescGZIP(), []int{57} } // 回复离开公会 @@ -3119,13 +3197,14 @@ type SMLeaveGuild struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - ErrMsg *string `protobuf:"bytes,1,opt,name=err_msg,json=errMsg" json:"err_msg,omitempty"` + ErrCode *int32 `protobuf:"varint,1,opt,name=err_code,json=errCode" json:"err_code,omitempty"` + ErrMsg *string `protobuf:"bytes,2,opt,name=err_msg,json=errMsg" json:"err_msg,omitempty"` } func (x *SMLeaveGuild) Reset() { *x = SMLeaveGuild{} if protoimpl.UnsafeEnabled { - mi := &file_cs_proto_proto_msgTypes[57] + mi := &file_cs_proto_proto_msgTypes[58] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3138,7 +3217,7 @@ func (x *SMLeaveGuild) String() string { func (*SMLeaveGuild) ProtoMessage() {} func (x *SMLeaveGuild) ProtoReflect() protoreflect.Message { - mi := &file_cs_proto_proto_msgTypes[57] + mi := &file_cs_proto_proto_msgTypes[58] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3151,7 +3230,14 @@ func (x *SMLeaveGuild) ProtoReflect() protoreflect.Message { // Deprecated: Use SMLeaveGuild.ProtoReflect.Descriptor instead. func (*SMLeaveGuild) Descriptor() ([]byte, []int) { - return file_cs_proto_proto_rawDescGZIP(), []int{57} + return file_cs_proto_proto_rawDescGZIP(), []int{58} +} + +func (x *SMLeaveGuild) GetErrCode() int32 { + if x != nil && x.ErrCode != nil { + return *x.ErrCode + } + return 0 } func (x *SMLeaveGuild) GetErrMsg() string { @@ -3167,14 +3253,13 @@ type CMDismissMember struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - GuildId *int64 `protobuf:"varint,1,opt,name=guild_id,json=guildId" json:"guild_id,omitempty"` - DismissAccountId *string `protobuf:"bytes,2,opt,name=dismissAccountId" json:"dismissAccountId,omitempty"` + DismissAccountId *string `protobuf:"bytes,1,opt,name=dismissAccountId" json:"dismissAccountId,omitempty"` } func (x *CMDismissMember) Reset() { *x = CMDismissMember{} if protoimpl.UnsafeEnabled { - mi := &file_cs_proto_proto_msgTypes[58] + mi := &file_cs_proto_proto_msgTypes[59] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3187,7 +3272,7 @@ func (x *CMDismissMember) String() string { func (*CMDismissMember) ProtoMessage() {} func (x *CMDismissMember) ProtoReflect() protoreflect.Message { - mi := &file_cs_proto_proto_msgTypes[58] + mi := &file_cs_proto_proto_msgTypes[59] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3200,14 +3285,7 @@ func (x *CMDismissMember) ProtoReflect() protoreflect.Message { // Deprecated: Use CMDismissMember.ProtoReflect.Descriptor instead. func (*CMDismissMember) Descriptor() ([]byte, []int) { - return file_cs_proto_proto_rawDescGZIP(), []int{58} -} - -func (x *CMDismissMember) GetGuildId() int64 { - if x != nil && x.GuildId != nil { - return *x.GuildId - } - return 0 + return file_cs_proto_proto_rawDescGZIP(), []int{59} } func (x *CMDismissMember) GetDismissAccountId() string { @@ -3223,13 +3301,14 @@ type SMDismissMember struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - ErrMsg *string `protobuf:"bytes,1,opt,name=err_msg,json=errMsg" json:"err_msg,omitempty"` + ErrCode *int32 `protobuf:"varint,1,opt,name=err_code,json=errCode" json:"err_code,omitempty"` + ErrMsg *string `protobuf:"bytes,2,opt,name=err_msg,json=errMsg" json:"err_msg,omitempty"` } func (x *SMDismissMember) Reset() { *x = SMDismissMember{} if protoimpl.UnsafeEnabled { - mi := &file_cs_proto_proto_msgTypes[59] + mi := &file_cs_proto_proto_msgTypes[60] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3242,7 +3321,7 @@ func (x *SMDismissMember) String() string { func (*SMDismissMember) ProtoMessage() {} func (x *SMDismissMember) ProtoReflect() protoreflect.Message { - mi := &file_cs_proto_proto_msgTypes[59] + mi := &file_cs_proto_proto_msgTypes[60] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3255,7 +3334,14 @@ func (x *SMDismissMember) ProtoReflect() protoreflect.Message { // Deprecated: Use SMDismissMember.ProtoReflect.Descriptor instead. func (*SMDismissMember) Descriptor() ([]byte, []int) { - return file_cs_proto_proto_rawDescGZIP(), []int{59} + return file_cs_proto_proto_rawDescGZIP(), []int{60} +} + +func (x *SMDismissMember) GetErrCode() int32 { + if x != nil && x.ErrCode != nil { + return *x.ErrCode + } + return 0 } func (x *SMDismissMember) GetErrMsg() string { @@ -3271,14 +3357,13 @@ type CMPromoteMember struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - GuildId *int64 `protobuf:"varint,1,opt,name=guild_id,json=guildId" json:"guild_id,omitempty"` - PromoteAccountId *string `protobuf:"bytes,2,opt,name=promoteAccountId" json:"promoteAccountId,omitempty"` + PromoteAccountId *string `protobuf:"bytes,1,opt,name=promoteAccountId" json:"promoteAccountId,omitempty"` } func (x *CMPromoteMember) Reset() { *x = CMPromoteMember{} if protoimpl.UnsafeEnabled { - mi := &file_cs_proto_proto_msgTypes[60] + mi := &file_cs_proto_proto_msgTypes[61] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3291,7 +3376,7 @@ func (x *CMPromoteMember) String() string { func (*CMPromoteMember) ProtoMessage() {} func (x *CMPromoteMember) ProtoReflect() protoreflect.Message { - mi := &file_cs_proto_proto_msgTypes[60] + mi := &file_cs_proto_proto_msgTypes[61] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3304,14 +3389,7 @@ func (x *CMPromoteMember) ProtoReflect() protoreflect.Message { // Deprecated: Use CMPromoteMember.ProtoReflect.Descriptor instead. func (*CMPromoteMember) Descriptor() ([]byte, []int) { - return file_cs_proto_proto_rawDescGZIP(), []int{60} -} - -func (x *CMPromoteMember) GetGuildId() int64 { - if x != nil && x.GuildId != nil { - return *x.GuildId - } - return 0 + return file_cs_proto_proto_rawDescGZIP(), []int{61} } func (x *CMPromoteMember) GetPromoteAccountId() string { @@ -3327,13 +3405,14 @@ type SMPromoteMember struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - ErrMsg *string `protobuf:"bytes,1,opt,name=err_msg,json=errMsg" json:"err_msg,omitempty"` + ErrCode *int32 `protobuf:"varint,1,opt,name=err_code,json=errCode" json:"err_code,omitempty"` + ErrMsg *string `protobuf:"bytes,2,opt,name=err_msg,json=errMsg" json:"err_msg,omitempty"` } func (x *SMPromoteMember) Reset() { *x = SMPromoteMember{} if protoimpl.UnsafeEnabled { - mi := &file_cs_proto_proto_msgTypes[61] + mi := &file_cs_proto_proto_msgTypes[62] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3346,7 +3425,7 @@ func (x *SMPromoteMember) String() string { func (*SMPromoteMember) ProtoMessage() {} func (x *SMPromoteMember) ProtoReflect() protoreflect.Message { - mi := &file_cs_proto_proto_msgTypes[61] + mi := &file_cs_proto_proto_msgTypes[62] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3359,7 +3438,14 @@ func (x *SMPromoteMember) ProtoReflect() protoreflect.Message { // Deprecated: Use SMPromoteMember.ProtoReflect.Descriptor instead. func (*SMPromoteMember) Descriptor() ([]byte, []int) { - return file_cs_proto_proto_rawDescGZIP(), []int{61} + return file_cs_proto_proto_rawDescGZIP(), []int{62} +} + +func (x *SMPromoteMember) GetErrCode() int32 { + if x != nil && x.ErrCode != nil { + return *x.ErrCode + } + return 0 } func (x *SMPromoteMember) GetErrMsg() string { @@ -3375,14 +3461,13 @@ type CMDemoteMember struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - GuildId *int64 `protobuf:"varint,1,opt,name=guild_id,json=guildId" json:"guild_id,omitempty"` - DemoteAccountId *string `protobuf:"bytes,2,opt,name=demoteAccountId" json:"demoteAccountId,omitempty"` + DemoteAccountId *string `protobuf:"bytes,1,opt,name=demoteAccountId" json:"demoteAccountId,omitempty"` } func (x *CMDemoteMember) Reset() { *x = CMDemoteMember{} if protoimpl.UnsafeEnabled { - mi := &file_cs_proto_proto_msgTypes[62] + mi := &file_cs_proto_proto_msgTypes[63] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3395,7 +3480,7 @@ func (x *CMDemoteMember) String() string { func (*CMDemoteMember) ProtoMessage() {} func (x *CMDemoteMember) ProtoReflect() protoreflect.Message { - mi := &file_cs_proto_proto_msgTypes[62] + mi := &file_cs_proto_proto_msgTypes[63] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3408,14 +3493,7 @@ func (x *CMDemoteMember) ProtoReflect() protoreflect.Message { // Deprecated: Use CMDemoteMember.ProtoReflect.Descriptor instead. func (*CMDemoteMember) Descriptor() ([]byte, []int) { - return file_cs_proto_proto_rawDescGZIP(), []int{62} -} - -func (x *CMDemoteMember) GetGuildId() int64 { - if x != nil && x.GuildId != nil { - return *x.GuildId - } - return 0 + return file_cs_proto_proto_rawDescGZIP(), []int{63} } func (x *CMDemoteMember) GetDemoteAccountId() string { @@ -3431,13 +3509,14 @@ type SMDemoteMember struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - ErrMsg *string `protobuf:"bytes,1,opt,name=err_msg,json=errMsg" json:"err_msg,omitempty"` + ErrCode *int32 `protobuf:"varint,1,opt,name=err_code,json=errCode" json:"err_code,omitempty"` + ErrMsg *string `protobuf:"bytes,2,opt,name=err_msg,json=errMsg" json:"err_msg,omitempty"` } func (x *SMDemoteMember) Reset() { *x = SMDemoteMember{} if protoimpl.UnsafeEnabled { - mi := &file_cs_proto_proto_msgTypes[63] + mi := &file_cs_proto_proto_msgTypes[64] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3450,7 +3529,7 @@ func (x *SMDemoteMember) String() string { func (*SMDemoteMember) ProtoMessage() {} func (x *SMDemoteMember) ProtoReflect() protoreflect.Message { - mi := &file_cs_proto_proto_msgTypes[63] + mi := &file_cs_proto_proto_msgTypes[64] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3463,7 +3542,14 @@ func (x *SMDemoteMember) ProtoReflect() protoreflect.Message { // Deprecated: Use SMDemoteMember.ProtoReflect.Descriptor instead. func (*SMDemoteMember) Descriptor() ([]byte, []int) { - return file_cs_proto_proto_rawDescGZIP(), []int{63} + return file_cs_proto_proto_rawDescGZIP(), []int{64} +} + +func (x *SMDemoteMember) GetErrCode() int32 { + if x != nil && x.ErrCode != nil { + return *x.ErrCode + } + return 0 } func (x *SMDemoteMember) GetErrMsg() string { @@ -3478,14 +3564,12 @@ type CMDisband struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - - GuildId *int64 `protobuf:"varint,1,opt,name=guild_id,json=guildId" json:"guild_id,omitempty"` } func (x *CMDisband) Reset() { *x = CMDisband{} if protoimpl.UnsafeEnabled { - mi := &file_cs_proto_proto_msgTypes[64] + mi := &file_cs_proto_proto_msgTypes[65] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3498,7 +3582,7 @@ func (x *CMDisband) String() string { func (*CMDisband) ProtoMessage() {} func (x *CMDisband) ProtoReflect() protoreflect.Message { - mi := &file_cs_proto_proto_msgTypes[64] + mi := &file_cs_proto_proto_msgTypes[65] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3511,14 +3595,7 @@ func (x *CMDisband) ProtoReflect() protoreflect.Message { // Deprecated: Use CMDisband.ProtoReflect.Descriptor instead. func (*CMDisband) Descriptor() ([]byte, []int) { - return file_cs_proto_proto_rawDescGZIP(), []int{64} -} - -func (x *CMDisband) GetGuildId() int64 { - if x != nil && x.GuildId != nil { - return *x.GuildId - } - return 0 + return file_cs_proto_proto_rawDescGZIP(), []int{65} } // 回复解散公会 @@ -3527,13 +3604,14 @@ type SMDisband struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - ErrMsg *string `protobuf:"bytes,1,opt,name=err_msg,json=errMsg" json:"err_msg,omitempty"` + ErrCode *int32 `protobuf:"varint,1,opt,name=err_code,json=errCode" json:"err_code,omitempty"` + ErrMsg *string `protobuf:"bytes,2,opt,name=err_msg,json=errMsg" json:"err_msg,omitempty"` } func (x *SMDisband) Reset() { *x = SMDisband{} if protoimpl.UnsafeEnabled { - mi := &file_cs_proto_proto_msgTypes[65] + mi := &file_cs_proto_proto_msgTypes[66] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3546,7 +3624,7 @@ func (x *SMDisband) String() string { func (*SMDisband) ProtoMessage() {} func (x *SMDisband) ProtoReflect() protoreflect.Message { - mi := &file_cs_proto_proto_msgTypes[65] + mi := &file_cs_proto_proto_msgTypes[66] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3559,7 +3637,14 @@ func (x *SMDisband) ProtoReflect() protoreflect.Message { // Deprecated: Use SMDisband.ProtoReflect.Descriptor instead. func (*SMDisband) Descriptor() ([]byte, []int) { - return file_cs_proto_proto_rawDescGZIP(), []int{65} + return file_cs_proto_proto_rawDescGZIP(), []int{66} +} + +func (x *SMDisband) GetErrCode() int32 { + if x != nil && x.ErrCode != nil { + return *x.ErrCode + } + return 0 } func (x *SMDisband) GetErrMsg() string { @@ -3581,7 +3666,7 @@ type CMSearchGuilds struct { func (x *CMSearchGuilds) Reset() { *x = CMSearchGuilds{} if protoimpl.UnsafeEnabled { - mi := &file_cs_proto_proto_msgTypes[66] + mi := &file_cs_proto_proto_msgTypes[67] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3594,7 +3679,7 @@ func (x *CMSearchGuilds) String() string { func (*CMSearchGuilds) ProtoMessage() {} func (x *CMSearchGuilds) ProtoReflect() protoreflect.Message { - mi := &file_cs_proto_proto_msgTypes[66] + mi := &file_cs_proto_proto_msgTypes[67] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3607,7 +3692,7 @@ func (x *CMSearchGuilds) ProtoReflect() protoreflect.Message { // Deprecated: Use CMSearchGuilds.ProtoReflect.Descriptor instead. func (*CMSearchGuilds) Descriptor() ([]byte, []int) { - return file_cs_proto_proto_rawDescGZIP(), []int{66} + return file_cs_proto_proto_rawDescGZIP(), []int{67} } func (x *CMSearchGuilds) GetKeyword() string { @@ -3623,13 +3708,15 @@ type SMSearchGuilds struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Guilds []*MFGuild `protobuf:"bytes,1,rep,name=guilds" json:"guilds,omitempty"` + ErrCode *int32 `protobuf:"varint,1,opt,name=err_code,json=errCode" json:"err_code,omitempty"` + ErrMsg *string `protobuf:"bytes,2,opt,name=err_msg,json=errMsg" json:"err_msg,omitempty"` + Guilds []*MFGuild `protobuf:"bytes,3,rep,name=guilds" json:"guilds,omitempty"` } func (x *SMSearchGuilds) Reset() { *x = SMSearchGuilds{} if protoimpl.UnsafeEnabled { - mi := &file_cs_proto_proto_msgTypes[67] + mi := &file_cs_proto_proto_msgTypes[68] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3642,7 +3729,7 @@ func (x *SMSearchGuilds) String() string { func (*SMSearchGuilds) ProtoMessage() {} func (x *SMSearchGuilds) ProtoReflect() protoreflect.Message { - mi := &file_cs_proto_proto_msgTypes[67] + mi := &file_cs_proto_proto_msgTypes[68] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3655,7 +3742,21 @@ func (x *SMSearchGuilds) ProtoReflect() protoreflect.Message { // Deprecated: Use SMSearchGuilds.ProtoReflect.Descriptor instead. func (*SMSearchGuilds) Descriptor() ([]byte, []int) { - return file_cs_proto_proto_rawDescGZIP(), []int{67} + return file_cs_proto_proto_rawDescGZIP(), []int{68} +} + +func (x *SMSearchGuilds) GetErrCode() int32 { + if x != nil && x.ErrCode != nil { + return *x.ErrCode + } + return 0 +} + +func (x *SMSearchGuilds) GetErrMsg() string { + if x != nil && x.ErrMsg != nil { + return *x.ErrMsg + } + return "" } func (x *SMSearchGuilds) GetGuilds() []*MFGuild { @@ -3682,7 +3783,7 @@ type MFGuild struct { func (x *MFGuild) Reset() { *x = MFGuild{} if protoimpl.UnsafeEnabled { - mi := &file_cs_proto_proto_msgTypes[68] + mi := &file_cs_proto_proto_msgTypes[69] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3695,7 +3796,7 @@ func (x *MFGuild) String() string { func (*MFGuild) ProtoMessage() {} func (x *MFGuild) ProtoReflect() protoreflect.Message { - mi := &file_cs_proto_proto_msgTypes[68] + mi := &file_cs_proto_proto_msgTypes[69] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3708,7 +3809,7 @@ func (x *MFGuild) ProtoReflect() protoreflect.Message { // Deprecated: Use MFGuild.ProtoReflect.Descriptor instead. func (*MFGuild) Descriptor() ([]byte, []int) { - return file_cs_proto_proto_rawDescGZIP(), []int{68} + return file_cs_proto_proto_rawDescGZIP(), []int{69} } func (x *MFGuild) GetAutoId() int64 { @@ -3770,7 +3871,7 @@ type CMGuildLogs struct { func (x *CMGuildLogs) Reset() { *x = CMGuildLogs{} if protoimpl.UnsafeEnabled { - mi := &file_cs_proto_proto_msgTypes[69] + mi := &file_cs_proto_proto_msgTypes[70] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3783,7 +3884,7 @@ func (x *CMGuildLogs) String() string { func (*CMGuildLogs) ProtoMessage() {} func (x *CMGuildLogs) ProtoReflect() protoreflect.Message { - mi := &file_cs_proto_proto_msgTypes[69] + mi := &file_cs_proto_proto_msgTypes[70] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3796,7 +3897,7 @@ func (x *CMGuildLogs) ProtoReflect() protoreflect.Message { // Deprecated: Use CMGuildLogs.ProtoReflect.Descriptor instead. func (*CMGuildLogs) Descriptor() ([]byte, []int) { - return file_cs_proto_proto_rawDescGZIP(), []int{69} + return file_cs_proto_proto_rawDescGZIP(), []int{70} } // 回复公会日志 @@ -3805,13 +3906,15 @@ type SMGuildLogs struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - GuildLogs []*MFGuildLog `protobuf:"bytes,1,rep,name=guildLogs" json:"guildLogs,omitempty"` + ErrCode *int32 `protobuf:"varint,1,opt,name=err_code,json=errCode" json:"err_code,omitempty"` + ErrMsg *string `protobuf:"bytes,2,opt,name=err_msg,json=errMsg" json:"err_msg,omitempty"` + GuildLogs []*MFGuildLog `protobuf:"bytes,3,rep,name=guildLogs" json:"guildLogs,omitempty"` } func (x *SMGuildLogs) Reset() { *x = SMGuildLogs{} if protoimpl.UnsafeEnabled { - mi := &file_cs_proto_proto_msgTypes[70] + mi := &file_cs_proto_proto_msgTypes[71] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3824,7 +3927,7 @@ func (x *SMGuildLogs) String() string { func (*SMGuildLogs) ProtoMessage() {} func (x *SMGuildLogs) ProtoReflect() protoreflect.Message { - mi := &file_cs_proto_proto_msgTypes[70] + mi := &file_cs_proto_proto_msgTypes[71] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3837,7 +3940,21 @@ func (x *SMGuildLogs) ProtoReflect() protoreflect.Message { // Deprecated: Use SMGuildLogs.ProtoReflect.Descriptor instead. func (*SMGuildLogs) Descriptor() ([]byte, []int) { - return file_cs_proto_proto_rawDescGZIP(), []int{70} + return file_cs_proto_proto_rawDescGZIP(), []int{71} +} + +func (x *SMGuildLogs) GetErrCode() int32 { + if x != nil && x.ErrCode != nil { + return *x.ErrCode + } + return 0 +} + +func (x *SMGuildLogs) GetErrMsg() string { + if x != nil && x.ErrMsg != nil { + return *x.ErrMsg + } + return "" } func (x *SMGuildLogs) GetGuildLogs() []*MFGuildLog { @@ -3861,7 +3978,7 @@ type MFGuildLog struct { func (x *MFGuildLog) Reset() { *x = MFGuildLog{} if protoimpl.UnsafeEnabled { - mi := &file_cs_proto_proto_msgTypes[71] + mi := &file_cs_proto_proto_msgTypes[72] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3874,7 +3991,7 @@ func (x *MFGuildLog) String() string { func (*MFGuildLog) ProtoMessage() {} func (x *MFGuildLog) ProtoReflect() protoreflect.Message { - mi := &file_cs_proto_proto_msgTypes[71] + mi := &file_cs_proto_proto_msgTypes[72] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3887,7 +4004,7 @@ func (x *MFGuildLog) ProtoReflect() protoreflect.Message { // Deprecated: Use MFGuildLog.ProtoReflect.Descriptor instead. func (*MFGuildLog) Descriptor() ([]byte, []int) { - return file_cs_proto_proto_rawDescGZIP(), []int{71} + return file_cs_proto_proto_rawDescGZIP(), []int{72} } func (x *MFGuildLog) GetGuildId() int64 { @@ -3924,14 +4041,13 @@ type CMNotice struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - GuildId *int64 `protobuf:"varint,1,opt,name=guild_id,json=guildId" json:"guild_id,omitempty"` - Content *string `protobuf:"bytes,2,opt,name=content" json:"content,omitempty"` + Content *string `protobuf:"bytes,1,opt,name=content" json:"content,omitempty"` } func (x *CMNotice) Reset() { *x = CMNotice{} if protoimpl.UnsafeEnabled { - mi := &file_cs_proto_proto_msgTypes[72] + mi := &file_cs_proto_proto_msgTypes[73] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3944,7 +4060,7 @@ func (x *CMNotice) String() string { func (*CMNotice) ProtoMessage() {} func (x *CMNotice) ProtoReflect() protoreflect.Message { - mi := &file_cs_proto_proto_msgTypes[72] + mi := &file_cs_proto_proto_msgTypes[73] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3957,14 +4073,7 @@ func (x *CMNotice) ProtoReflect() protoreflect.Message { // Deprecated: Use CMNotice.ProtoReflect.Descriptor instead. func (*CMNotice) Descriptor() ([]byte, []int) { - return file_cs_proto_proto_rawDescGZIP(), []int{72} -} - -func (x *CMNotice) GetGuildId() int64 { - if x != nil && x.GuildId != nil { - return *x.GuildId - } - return 0 + return file_cs_proto_proto_rawDescGZIP(), []int{73} } func (x *CMNotice) GetContent() string { @@ -3980,13 +4089,14 @@ type SMNotice struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - ErrMsg *string `protobuf:"bytes,1,opt,name=err_msg,json=errMsg" json:"err_msg,omitempty"` + ErrCode *int32 `protobuf:"varint,1,opt,name=err_code,json=errCode" json:"err_code,omitempty"` + ErrMsg *string `protobuf:"bytes,2,opt,name=err_msg,json=errMsg" json:"err_msg,omitempty"` } func (x *SMNotice) Reset() { *x = SMNotice{} if protoimpl.UnsafeEnabled { - mi := &file_cs_proto_proto_msgTypes[73] + mi := &file_cs_proto_proto_msgTypes[74] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3999,7 +4109,7 @@ func (x *SMNotice) String() string { func (*SMNotice) ProtoMessage() {} func (x *SMNotice) ProtoReflect() protoreflect.Message { - mi := &file_cs_proto_proto_msgTypes[73] + mi := &file_cs_proto_proto_msgTypes[74] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4012,7 +4122,14 @@ func (x *SMNotice) ProtoReflect() protoreflect.Message { // Deprecated: Use SMNotice.ProtoReflect.Descriptor instead. func (*SMNotice) Descriptor() ([]byte, []int) { - return file_cs_proto_proto_rawDescGZIP(), []int{73} + return file_cs_proto_proto_rawDescGZIP(), []int{74} +} + +func (x *SMNotice) GetErrCode() int32 { + if x != nil && x.ErrCode != nil { + return *x.ErrCode + } + return 0 } func (x *SMNotice) GetErrMsg() string { @@ -4249,111 +4366,130 @@ var file_cs_proto_proto_rawDesc = []byte{ 0x52, 0x0c, 0x72, 0x61, 0x6e, 0x64, 0x6f, 0x6d, 0x47, 0x75, 0x69, 0x6c, 0x64, 0x73, 0x22, 0x23, 0x0a, 0x0d, 0x43, 0x4d, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x47, 0x75, 0x69, 0x6c, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, - 0x61, 0x6d, 0x65, 0x22, 0x43, 0x0a, 0x0d, 0x53, 0x4d, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x47, - 0x75, 0x69, 0x6c, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x67, 0x75, 0x69, 0x6c, 0x64, 0x5f, 0x69, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x67, 0x75, 0x69, 0x6c, 0x64, 0x49, 0x64, 0x12, + 0x61, 0x6d, 0x65, 0x22, 0x5e, 0x0a, 0x0d, 0x53, 0x4d, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x47, + 0x75, 0x69, 0x6c, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x65, 0x72, 0x72, 0x5f, 0x63, 0x6f, 0x64, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x65, 0x72, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x65, 0x72, 0x72, 0x5f, 0x6d, 0x73, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x06, 0x65, 0x72, 0x72, 0x4d, 0x73, 0x67, 0x22, 0x2b, 0x0a, 0x0e, 0x43, 0x4d, 0x41, 0x70, - 0x70, 0x6c, 0x79, 0x54, 0x6f, 0x47, 0x75, 0x69, 0x6c, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x67, 0x75, - 0x69, 0x6c, 0x64, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x67, 0x75, - 0x69, 0x6c, 0x64, 0x49, 0x64, 0x22, 0x29, 0x0a, 0x0e, 0x53, 0x4d, 0x41, 0x70, 0x70, 0x6c, 0x79, - 0x54, 0x6f, 0x47, 0x75, 0x69, 0x6c, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x65, 0x72, 0x72, 0x5f, 0x6d, - 0x73, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x65, 0x72, 0x72, 0x4d, 0x73, 0x67, - 0x22, 0x0d, 0x0a, 0x0b, 0x43, 0x4d, 0x41, 0x70, 0x70, 0x6c, 0x79, 0x4c, 0x69, 0x73, 0x74, 0x22, - 0x2c, 0x0a, 0x0b, 0x53, 0x4d, 0x41, 0x70, 0x70, 0x6c, 0x79, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x1d, - 0x0a, 0x0a, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x03, - 0x28, 0x09, 0x52, 0x09, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x64, 0x22, 0x58, 0x0a, - 0x09, 0x43, 0x4d, 0x41, 0x70, 0x70, 0x72, 0x6f, 0x76, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x67, 0x75, - 0x69, 0x6c, 0x64, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x67, 0x75, - 0x69, 0x6c, 0x64, 0x49, 0x64, 0x12, 0x30, 0x0a, 0x14, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, - 0x6e, 0x74, 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x12, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x6e, 0x74, 0x41, 0x63, - 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x64, 0x22, 0x24, 0x0a, 0x09, 0x53, 0x4d, 0x41, 0x70, 0x70, - 0x72, 0x6f, 0x76, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x65, 0x72, 0x72, 0x5f, 0x6d, 0x73, 0x67, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x65, 0x72, 0x72, 0x4d, 0x73, 0x67, 0x22, 0x57, 0x0a, - 0x08, 0x43, 0x4d, 0x52, 0x65, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x67, 0x75, 0x69, - 0x6c, 0x64, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x67, 0x75, 0x69, - 0x6c, 0x64, 0x49, 0x64, 0x12, 0x30, 0x0a, 0x14, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x6e, - 0x74, 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x12, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x6e, 0x74, 0x41, 0x63, 0x63, - 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x64, 0x22, 0x23, 0x0a, 0x08, 0x53, 0x4d, 0x52, 0x65, 0x6a, 0x65, - 0x63, 0x74, 0x12, 0x17, 0x0a, 0x07, 0x65, 0x72, 0x72, 0x5f, 0x6d, 0x73, 0x67, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x06, 0x65, 0x72, 0x72, 0x4d, 0x73, 0x67, 0x22, 0x29, 0x0a, 0x0c, 0x43, - 0x4d, 0x4c, 0x65, 0x61, 0x76, 0x65, 0x47, 0x75, 0x69, 0x6c, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x67, - 0x75, 0x69, 0x6c, 0x64, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x67, - 0x75, 0x69, 0x6c, 0x64, 0x49, 0x64, 0x22, 0x27, 0x0a, 0x0c, 0x53, 0x4d, 0x4c, 0x65, 0x61, 0x76, - 0x65, 0x47, 0x75, 0x69, 0x6c, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x65, 0x72, 0x72, 0x5f, 0x6d, 0x73, - 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x65, 0x72, 0x72, 0x4d, 0x73, 0x67, 0x22, - 0x58, 0x0a, 0x0f, 0x43, 0x4d, 0x44, 0x69, 0x73, 0x6d, 0x69, 0x73, 0x73, 0x4d, 0x65, 0x6d, 0x62, - 0x65, 0x72, 0x12, 0x19, 0x0a, 0x08, 0x67, 0x75, 0x69, 0x6c, 0x64, 0x5f, 0x69, 0x64, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x67, 0x75, 0x69, 0x6c, 0x64, 0x49, 0x64, 0x12, 0x2a, 0x0a, - 0x10, 0x64, 0x69, 0x73, 0x6d, 0x69, 0x73, 0x73, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, - 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x64, 0x69, 0x73, 0x6d, 0x69, 0x73, 0x73, - 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x64, 0x22, 0x2a, 0x0a, 0x0f, 0x53, 0x4d, 0x44, - 0x69, 0x73, 0x6d, 0x69, 0x73, 0x73, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x17, 0x0a, 0x07, - 0x65, 0x72, 0x72, 0x5f, 0x6d, 0x73, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x65, - 0x72, 0x72, 0x4d, 0x73, 0x67, 0x22, 0x58, 0x0a, 0x0f, 0x43, 0x4d, 0x50, 0x72, 0x6f, 0x6d, 0x6f, - 0x74, 0x65, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x19, 0x0a, 0x08, 0x67, 0x75, 0x69, 0x6c, - 0x64, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x67, 0x75, 0x69, 0x6c, - 0x64, 0x49, 0x64, 0x12, 0x2a, 0x0a, 0x10, 0x70, 0x72, 0x6f, 0x6d, 0x6f, 0x74, 0x65, 0x41, 0x63, - 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x70, - 0x72, 0x6f, 0x6d, 0x6f, 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x64, 0x22, - 0x2a, 0x0a, 0x0f, 0x53, 0x4d, 0x50, 0x72, 0x6f, 0x6d, 0x6f, 0x74, 0x65, 0x4d, 0x65, 0x6d, 0x62, - 0x65, 0x72, 0x12, 0x17, 0x0a, 0x07, 0x65, 0x72, 0x72, 0x5f, 0x6d, 0x73, 0x67, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x06, 0x65, 0x72, 0x72, 0x4d, 0x73, 0x67, 0x22, 0x55, 0x0a, 0x0e, 0x43, - 0x4d, 0x44, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x19, 0x0a, - 0x08, 0x67, 0x75, 0x69, 0x6c, 0x64, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, - 0x07, 0x67, 0x75, 0x69, 0x6c, 0x64, 0x49, 0x64, 0x12, 0x28, 0x0a, 0x0f, 0x64, 0x65, 0x6d, 0x6f, - 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x0f, 0x64, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, - 0x49, 0x64, 0x22, 0x29, 0x0a, 0x0e, 0x53, 0x4d, 0x44, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x4d, 0x65, - 0x6d, 0x62, 0x65, 0x72, 0x12, 0x17, 0x0a, 0x07, 0x65, 0x72, 0x72, 0x5f, 0x6d, 0x73, 0x67, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x65, 0x72, 0x72, 0x4d, 0x73, 0x67, 0x22, 0x26, 0x0a, - 0x09, 0x43, 0x4d, 0x44, 0x69, 0x73, 0x62, 0x61, 0x6e, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x67, 0x75, - 0x69, 0x6c, 0x64, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x67, 0x75, - 0x69, 0x6c, 0x64, 0x49, 0x64, 0x22, 0x24, 0x0a, 0x09, 0x53, 0x4d, 0x44, 0x69, 0x73, 0x62, 0x61, - 0x6e, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x65, 0x72, 0x72, 0x5f, 0x6d, 0x73, 0x67, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x06, 0x65, 0x72, 0x72, 0x4d, 0x73, 0x67, 0x22, 0x2a, 0x0a, 0x0e, 0x43, - 0x4d, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x47, 0x75, 0x69, 0x6c, 0x64, 0x73, 0x12, 0x18, 0x0a, - 0x07, 0x6b, 0x65, 0x79, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, - 0x6b, 0x65, 0x79, 0x77, 0x6f, 0x72, 0x64, 0x22, 0x35, 0x0a, 0x0e, 0x53, 0x4d, 0x53, 0x65, 0x61, - 0x72, 0x63, 0x68, 0x47, 0x75, 0x69, 0x6c, 0x64, 0x73, 0x12, 0x23, 0x0a, 0x06, 0x67, 0x75, 0x69, - 0x6c, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x63, 0x73, 0x2e, 0x4d, - 0x46, 0x47, 0x75, 0x69, 0x6c, 0x64, 0x52, 0x06, 0x67, 0x75, 0x69, 0x6c, 0x64, 0x73, 0x22, 0xc1, - 0x01, 0x0a, 0x07, 0x4d, 0x46, 0x47, 0x75, 0x69, 0x6c, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x61, 0x75, - 0x74, 0x6f, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x61, 0x75, 0x74, - 0x6f, 0x49, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x67, 0x75, 0x69, 0x6c, 0x64, 0x5f, 0x69, 0x64, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x67, 0x75, 0x69, 0x6c, 0x64, 0x49, 0x64, 0x12, 0x12, - 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, - 0x6d, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x6c, 0x65, 0x61, 0x64, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6c, 0x65, 0x61, 0x64, 0x65, 0x72, 0x49, 0x64, 0x12, - 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, - 0x52, 0x07, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x6d, 0x61, 0x78, - 0x5f, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, - 0x6d, 0x61, 0x78, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x6e, 0x6f, - 0x74, 0x69, 0x63, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6e, 0x6f, 0x74, 0x69, - 0x63, 0x65, 0x22, 0x0d, 0x0a, 0x0b, 0x43, 0x4d, 0x47, 0x75, 0x69, 0x6c, 0x64, 0x4c, 0x6f, 0x67, - 0x73, 0x22, 0x3b, 0x0a, 0x0b, 0x53, 0x4d, 0x47, 0x75, 0x69, 0x6c, 0x64, 0x4c, 0x6f, 0x67, 0x73, - 0x12, 0x2c, 0x0a, 0x09, 0x67, 0x75, 0x69, 0x6c, 0x64, 0x4c, 0x6f, 0x67, 0x73, 0x18, 0x01, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x63, 0x73, 0x2e, 0x4d, 0x46, 0x47, 0x75, 0x69, 0x6c, 0x64, - 0x4c, 0x6f, 0x67, 0x52, 0x09, 0x67, 0x75, 0x69, 0x6c, 0x64, 0x4c, 0x6f, 0x67, 0x73, 0x22, 0x7b, - 0x0a, 0x0a, 0x4d, 0x46, 0x47, 0x75, 0x69, 0x6c, 0x64, 0x4c, 0x6f, 0x67, 0x12, 0x19, 0x0a, 0x08, - 0x67, 0x75, 0x69, 0x6c, 0x64, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, - 0x67, 0x75, 0x69, 0x6c, 0x64, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x61, 0x63, 0x63, 0x6f, 0x75, + 0x52, 0x06, 0x65, 0x72, 0x72, 0x4d, 0x73, 0x67, 0x12, 0x19, 0x0a, 0x08, 0x67, 0x75, 0x69, 0x6c, + 0x64, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x67, 0x75, 0x69, 0x6c, + 0x64, 0x49, 0x64, 0x22, 0x2b, 0x0a, 0x0e, 0x43, 0x4d, 0x41, 0x70, 0x70, 0x6c, 0x79, 0x54, 0x6f, + 0x47, 0x75, 0x69, 0x6c, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x67, 0x75, 0x69, 0x6c, 0x64, 0x5f, 0x69, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x67, 0x75, 0x69, 0x6c, 0x64, 0x49, 0x64, + 0x22, 0x44, 0x0a, 0x0e, 0x53, 0x4d, 0x41, 0x70, 0x70, 0x6c, 0x79, 0x54, 0x6f, 0x47, 0x75, 0x69, + 0x6c, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x65, 0x72, 0x72, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x65, 0x72, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x17, 0x0a, + 0x07, 0x65, 0x72, 0x72, 0x5f, 0x6d, 0x73, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, + 0x65, 0x72, 0x72, 0x4d, 0x73, 0x67, 0x22, 0x0d, 0x0a, 0x0b, 0x43, 0x4d, 0x41, 0x70, 0x70, 0x6c, + 0x79, 0x4c, 0x69, 0x73, 0x74, 0x22, 0x71, 0x0a, 0x0b, 0x53, 0x4d, 0x41, 0x70, 0x70, 0x6c, 0x79, + 0x4c, 0x69, 0x73, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x65, 0x72, 0x72, 0x5f, 0x63, 0x6f, 0x64, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x65, 0x72, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x12, + 0x17, 0x0a, 0x07, 0x65, 0x72, 0x72, 0x5f, 0x6d, 0x73, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x06, 0x65, 0x72, 0x72, 0x4d, 0x73, 0x67, 0x12, 0x2e, 0x0a, 0x0a, 0x61, 0x70, 0x70, 0x6c, + 0x79, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x63, + 0x73, 0x2e, 0x4d, 0x46, 0x41, 0x70, 0x70, 0x6c, 0x79, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x09, 0x61, + 0x70, 0x70, 0x6c, 0x79, 0x49, 0x6e, 0x66, 0x6f, 0x22, 0x44, 0x0a, 0x0b, 0x4d, 0x46, 0x41, 0x70, + 0x70, 0x6c, 0x79, 0x49, 0x6e, 0x66, 0x6f, 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, 0x19, 0x0a, 0x08, 0x6c, 0x6f, 0x67, 0x5f, 0x74, 0x79, - 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x6c, 0x6f, 0x67, 0x54, 0x79, 0x70, - 0x65, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x22, 0x3f, 0x0a, 0x08, 0x43, - 0x4d, 0x4e, 0x6f, 0x74, 0x69, 0x63, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x67, 0x75, 0x69, 0x6c, 0x64, - 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x67, 0x75, 0x69, 0x6c, 0x64, - 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x22, 0x23, 0x0a, 0x08, - 0x53, 0x4d, 0x4e, 0x6f, 0x74, 0x69, 0x63, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x65, 0x72, 0x72, 0x5f, - 0x6d, 0x73, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x65, 0x72, 0x72, 0x4d, 0x73, - 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, + 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x3d, + 0x0a, 0x09, 0x43, 0x4d, 0x41, 0x70, 0x70, 0x72, 0x6f, 0x76, 0x65, 0x12, 0x30, 0x0a, 0x14, 0x61, + 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x6e, 0x74, 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x12, 0x61, 0x70, 0x70, 0x6c, 0x69, + 0x63, 0x61, 0x6e, 0x74, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x64, 0x22, 0x3f, 0x0a, + 0x09, 0x53, 0x4d, 0x41, 0x70, 0x70, 0x72, 0x6f, 0x76, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x65, 0x72, + 0x72, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x65, 0x72, + 0x72, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x65, 0x72, 0x72, 0x5f, 0x6d, 0x73, 0x67, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x65, 0x72, 0x72, 0x4d, 0x73, 0x67, 0x22, 0x3c, + 0x0a, 0x08, 0x43, 0x4d, 0x52, 0x65, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x30, 0x0a, 0x14, 0x61, 0x70, + 0x70, 0x6c, 0x69, 0x63, 0x61, 0x6e, 0x74, 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x12, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, + 0x61, 0x6e, 0x74, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x64, 0x22, 0x3e, 0x0a, 0x08, + 0x53, 0x4d, 0x52, 0x65, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x65, 0x72, 0x72, 0x5f, + 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x65, 0x72, 0x72, 0x43, + 0x6f, 0x64, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x65, 0x72, 0x72, 0x5f, 0x6d, 0x73, 0x67, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x65, 0x72, 0x72, 0x4d, 0x73, 0x67, 0x22, 0x0e, 0x0a, 0x0c, + 0x43, 0x4d, 0x4c, 0x65, 0x61, 0x76, 0x65, 0x47, 0x75, 0x69, 0x6c, 0x64, 0x22, 0x42, 0x0a, 0x0c, + 0x53, 0x4d, 0x4c, 0x65, 0x61, 0x76, 0x65, 0x47, 0x75, 0x69, 0x6c, 0x64, 0x12, 0x19, 0x0a, 0x08, + 0x65, 0x72, 0x72, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, + 0x65, 0x72, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x65, 0x72, 0x72, 0x5f, 0x6d, + 0x73, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x65, 0x72, 0x72, 0x4d, 0x73, 0x67, + 0x22, 0x3d, 0x0a, 0x0f, 0x43, 0x4d, 0x44, 0x69, 0x73, 0x6d, 0x69, 0x73, 0x73, 0x4d, 0x65, 0x6d, + 0x62, 0x65, 0x72, 0x12, 0x2a, 0x0a, 0x10, 0x64, 0x69, 0x73, 0x6d, 0x69, 0x73, 0x73, 0x41, 0x63, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x64, + 0x69, 0x73, 0x6d, 0x69, 0x73, 0x73, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x64, 0x22, + 0x45, 0x0a, 0x0f, 0x53, 0x4d, 0x44, 0x69, 0x73, 0x6d, 0x69, 0x73, 0x73, 0x4d, 0x65, 0x6d, 0x62, + 0x65, 0x72, 0x12, 0x19, 0x0a, 0x08, 0x65, 0x72, 0x72, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x65, 0x72, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x17, 0x0a, + 0x07, 0x65, 0x72, 0x72, 0x5f, 0x6d, 0x73, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, + 0x65, 0x72, 0x72, 0x4d, 0x73, 0x67, 0x22, 0x3d, 0x0a, 0x0f, 0x43, 0x4d, 0x50, 0x72, 0x6f, 0x6d, + 0x6f, 0x74, 0x65, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x2a, 0x0a, 0x10, 0x70, 0x72, 0x6f, + 0x6d, 0x6f, 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x10, 0x70, 0x72, 0x6f, 0x6d, 0x6f, 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, + 0x75, 0x6e, 0x74, 0x49, 0x64, 0x22, 0x45, 0x0a, 0x0f, 0x53, 0x4d, 0x50, 0x72, 0x6f, 0x6d, 0x6f, + 0x74, 0x65, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x19, 0x0a, 0x08, 0x65, 0x72, 0x72, 0x5f, + 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x65, 0x72, 0x72, 0x43, + 0x6f, 0x64, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x65, 0x72, 0x72, 0x5f, 0x6d, 0x73, 0x67, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x65, 0x72, 0x72, 0x4d, 0x73, 0x67, 0x22, 0x3a, 0x0a, 0x0e, + 0x43, 0x4d, 0x44, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x28, + 0x0a, 0x0f, 0x64, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x64, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x41, + 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x64, 0x22, 0x44, 0x0a, 0x0e, 0x53, 0x4d, 0x44, 0x65, + 0x6d, 0x6f, 0x74, 0x65, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x19, 0x0a, 0x08, 0x65, 0x72, + 0x72, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x65, 0x72, + 0x72, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x65, 0x72, 0x72, 0x5f, 0x6d, 0x73, 0x67, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x65, 0x72, 0x72, 0x4d, 0x73, 0x67, 0x22, 0x0b, + 0x0a, 0x09, 0x43, 0x4d, 0x44, 0x69, 0x73, 0x62, 0x61, 0x6e, 0x64, 0x22, 0x3f, 0x0a, 0x09, 0x53, + 0x4d, 0x44, 0x69, 0x73, 0x62, 0x61, 0x6e, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x65, 0x72, 0x72, 0x5f, + 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x65, 0x72, 0x72, 0x43, + 0x6f, 0x64, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x65, 0x72, 0x72, 0x5f, 0x6d, 0x73, 0x67, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x65, 0x72, 0x72, 0x4d, 0x73, 0x67, 0x22, 0x2a, 0x0a, 0x0e, + 0x43, 0x4d, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x47, 0x75, 0x69, 0x6c, 0x64, 0x73, 0x12, 0x18, + 0x0a, 0x07, 0x6b, 0x65, 0x79, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x07, 0x6b, 0x65, 0x79, 0x77, 0x6f, 0x72, 0x64, 0x22, 0x69, 0x0a, 0x0e, 0x53, 0x4d, 0x53, 0x65, + 0x61, 0x72, 0x63, 0x68, 0x47, 0x75, 0x69, 0x6c, 0x64, 0x73, 0x12, 0x19, 0x0a, 0x08, 0x65, 0x72, + 0x72, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x65, 0x72, + 0x72, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x65, 0x72, 0x72, 0x5f, 0x6d, 0x73, 0x67, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x65, 0x72, 0x72, 0x4d, 0x73, 0x67, 0x12, 0x23, + 0x0a, 0x06, 0x67, 0x75, 0x69, 0x6c, 0x64, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0b, + 0x2e, 0x63, 0x73, 0x2e, 0x4d, 0x46, 0x47, 0x75, 0x69, 0x6c, 0x64, 0x52, 0x06, 0x67, 0x75, 0x69, + 0x6c, 0x64, 0x73, 0x22, 0xc1, 0x01, 0x0a, 0x07, 0x4d, 0x46, 0x47, 0x75, 0x69, 0x6c, 0x64, 0x12, + 0x17, 0x0a, 0x07, 0x61, 0x75, 0x74, 0x6f, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, + 0x52, 0x06, 0x61, 0x75, 0x74, 0x6f, 0x49, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x67, 0x75, 0x69, 0x6c, + 0x64, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x67, 0x75, 0x69, 0x6c, + 0x64, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x6c, 0x65, 0x61, 0x64, 0x65, + 0x72, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6c, 0x65, 0x61, 0x64, + 0x65, 0x72, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x18, + 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x12, 0x1f, + 0x0a, 0x0b, 0x6d, 0x61, 0x78, 0x5f, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x18, 0x06, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x0a, 0x6d, 0x61, 0x78, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x12, + 0x16, 0x0a, 0x06, 0x6e, 0x6f, 0x74, 0x69, 0x63, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x06, 0x6e, 0x6f, 0x74, 0x69, 0x63, 0x65, 0x22, 0x0d, 0x0a, 0x0b, 0x43, 0x4d, 0x47, 0x75, 0x69, + 0x6c, 0x64, 0x4c, 0x6f, 0x67, 0x73, 0x22, 0x6f, 0x0a, 0x0b, 0x53, 0x4d, 0x47, 0x75, 0x69, 0x6c, + 0x64, 0x4c, 0x6f, 0x67, 0x73, 0x12, 0x19, 0x0a, 0x08, 0x65, 0x72, 0x72, 0x5f, 0x63, 0x6f, 0x64, + 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x65, 0x72, 0x72, 0x43, 0x6f, 0x64, 0x65, + 0x12, 0x17, 0x0a, 0x07, 0x65, 0x72, 0x72, 0x5f, 0x6d, 0x73, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x06, 0x65, 0x72, 0x72, 0x4d, 0x73, 0x67, 0x12, 0x2c, 0x0a, 0x09, 0x67, 0x75, 0x69, + 0x6c, 0x64, 0x4c, 0x6f, 0x67, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x63, + 0x73, 0x2e, 0x4d, 0x46, 0x47, 0x75, 0x69, 0x6c, 0x64, 0x4c, 0x6f, 0x67, 0x52, 0x09, 0x67, 0x75, + 0x69, 0x6c, 0x64, 0x4c, 0x6f, 0x67, 0x73, 0x22, 0x7b, 0x0a, 0x0a, 0x4d, 0x46, 0x47, 0x75, 0x69, + 0x6c, 0x64, 0x4c, 0x6f, 0x67, 0x12, 0x19, 0x0a, 0x08, 0x67, 0x75, 0x69, 0x6c, 0x64, 0x5f, 0x69, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x67, 0x75, 0x69, 0x6c, 0x64, 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, + 0x19, 0x0a, 0x08, 0x6c, 0x6f, 0x67, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x07, 0x6c, 0x6f, 0x67, 0x54, 0x79, 0x70, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, + 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e, + 0x74, 0x65, 0x6e, 0x74, 0x22, 0x24, 0x0a, 0x08, 0x43, 0x4d, 0x4e, 0x6f, 0x74, 0x69, 0x63, 0x65, + 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x22, 0x3e, 0x0a, 0x08, 0x53, 0x4d, + 0x4e, 0x6f, 0x74, 0x69, 0x63, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x65, 0x72, 0x72, 0x5f, 0x63, 0x6f, + 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x65, 0x72, 0x72, 0x43, 0x6f, 0x64, + 0x65, 0x12, 0x17, 0x0a, 0x07, 0x65, 0x72, 0x72, 0x5f, 0x6d, 0x73, 0x67, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x06, 0x65, 0x72, 0x72, 0x4d, 0x73, 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 ( @@ -4369,7 +4505,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, 74) +var file_cs_proto_proto_msgTypes = make([]protoimpl.MessageInfo, 75) var file_cs_proto_proto_goTypes = []interface{}{ (ConstantE)(0), // 0: cs.Constant_e (*CMPing)(nil), // 1: cs.CMPing @@ -4424,28 +4560,29 @@ var file_cs_proto_proto_goTypes = []interface{}{ (*SMApplyToGuild)(nil), // 50: cs.SMApplyToGuild (*CMApplyList)(nil), // 51: cs.CMApplyList (*SMApplyList)(nil), // 52: cs.SMApplyList - (*CMApprove)(nil), // 53: cs.CMApprove - (*SMApprove)(nil), // 54: cs.SMApprove - (*CMReject)(nil), // 55: cs.CMReject - (*SMReject)(nil), // 56: cs.SMReject - (*CMLeaveGuild)(nil), // 57: cs.CMLeaveGuild - (*SMLeaveGuild)(nil), // 58: cs.SMLeaveGuild - (*CMDismissMember)(nil), // 59: cs.CMDismissMember - (*SMDismissMember)(nil), // 60: cs.SMDismissMember - (*CMPromoteMember)(nil), // 61: cs.CMPromoteMember - (*SMPromoteMember)(nil), // 62: cs.SMPromoteMember - (*CMDemoteMember)(nil), // 63: cs.CMDemoteMember - (*SMDemoteMember)(nil), // 64: cs.SMDemoteMember - (*CMDisband)(nil), // 65: cs.CMDisband - (*SMDisband)(nil), // 66: cs.SMDisband - (*CMSearchGuilds)(nil), // 67: cs.CMSearchGuilds - (*SMSearchGuilds)(nil), // 68: cs.SMSearchGuilds - (*MFGuild)(nil), // 69: cs.MFGuild - (*CMGuildLogs)(nil), // 70: cs.CMGuildLogs - (*SMGuildLogs)(nil), // 71: cs.SMGuildLogs - (*MFGuildLog)(nil), // 72: cs.MFGuildLog - (*CMNotice)(nil), // 73: cs.CMNotice - (*SMNotice)(nil), // 74: cs.SMNotice + (*MFApplyInfo)(nil), // 53: cs.MFApplyInfo + (*CMApprove)(nil), // 54: cs.CMApprove + (*SMApprove)(nil), // 55: cs.SMApprove + (*CMReject)(nil), // 56: cs.CMReject + (*SMReject)(nil), // 57: cs.SMReject + (*CMLeaveGuild)(nil), // 58: cs.CMLeaveGuild + (*SMLeaveGuild)(nil), // 59: cs.SMLeaveGuild + (*CMDismissMember)(nil), // 60: cs.CMDismissMember + (*SMDismissMember)(nil), // 61: cs.SMDismissMember + (*CMPromoteMember)(nil), // 62: cs.CMPromoteMember + (*SMPromoteMember)(nil), // 63: cs.SMPromoteMember + (*CMDemoteMember)(nil), // 64: cs.CMDemoteMember + (*SMDemoteMember)(nil), // 65: cs.SMDemoteMember + (*CMDisband)(nil), // 66: cs.CMDisband + (*SMDisband)(nil), // 67: cs.SMDisband + (*CMSearchGuilds)(nil), // 68: cs.CMSearchGuilds + (*SMSearchGuilds)(nil), // 69: cs.SMSearchGuilds + (*MFGuild)(nil), // 70: cs.MFGuild + (*CMGuildLogs)(nil), // 71: cs.CMGuildLogs + (*SMGuildLogs)(nil), // 72: cs.SMGuildLogs + (*MFGuildLog)(nil), // 73: cs.MFGuildLog + (*CMNotice)(nil), // 74: cs.CMNotice + (*SMNotice)(nil), // 75: cs.SMNotice } var file_cs_proto_proto_depIdxs = []int32{ 34, // 0: cs.SMSearchUser.users:type_name -> cs.MFUser @@ -4453,15 +4590,16 @@ var file_cs_proto_proto_depIdxs = []int32{ 5, // 2: cs.CMReadMsgAndOpenChatNotify.last_ids:type_name -> cs.MFPair64 44, // 3: cs.SMChatMsgNotify.msg_list:type_name -> cs.MFChatMsg 5, // 4: cs.SMUpdateChatChannelLastId.last_ids:type_name -> cs.MFPair64 - 69, // 5: cs.SMGuildInfo.guild:type_name -> cs.MFGuild - 69, // 6: cs.SMGuildInfo.random_guilds:type_name -> cs.MFGuild - 69, // 7: cs.SMSearchGuilds.guilds:type_name -> cs.MFGuild - 72, // 8: cs.SMGuildLogs.guildLogs:type_name -> cs.MFGuildLog - 9, // [9:9] is the sub-list for method output_type - 9, // [9:9] is the sub-list for method input_type - 9, // [9:9] is the sub-list for extension type_name - 9, // [9:9] is the sub-list for extension extendee - 0, // [0:9] is the sub-list for field type_name + 70, // 5: cs.SMGuildInfo.guild:type_name -> cs.MFGuild + 70, // 6: cs.SMGuildInfo.random_guilds:type_name -> cs.MFGuild + 53, // 7: cs.SMApplyList.apply_info:type_name -> cs.MFApplyInfo + 70, // 8: cs.SMSearchGuilds.guilds:type_name -> cs.MFGuild + 73, // 9: cs.SMGuildLogs.guildLogs:type_name -> cs.MFGuildLog + 10, // [10:10] is the sub-list for method output_type + 10, // [10:10] is the sub-list for method input_type + 10, // [10:10] is the sub-list for extension type_name + 10, // [10:10] is the sub-list for extension extendee + 0, // [0:10] is the sub-list for field type_name } func init() { file_cs_proto_proto_init() } @@ -5095,7 +5233,7 @@ func file_cs_proto_proto_init() { } } file_cs_proto_proto_msgTypes[52].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CMApprove); i { + switch v := v.(*MFApplyInfo); i { case 0: return &v.state case 1: @@ -5107,7 +5245,7 @@ func file_cs_proto_proto_init() { } } file_cs_proto_proto_msgTypes[53].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SMApprove); i { + switch v := v.(*CMApprove); i { case 0: return &v.state case 1: @@ -5119,7 +5257,7 @@ func file_cs_proto_proto_init() { } } file_cs_proto_proto_msgTypes[54].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CMReject); i { + switch v := v.(*SMApprove); i { case 0: return &v.state case 1: @@ -5131,7 +5269,7 @@ func file_cs_proto_proto_init() { } } file_cs_proto_proto_msgTypes[55].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SMReject); i { + switch v := v.(*CMReject); i { case 0: return &v.state case 1: @@ -5143,7 +5281,7 @@ func file_cs_proto_proto_init() { } } file_cs_proto_proto_msgTypes[56].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CMLeaveGuild); i { + switch v := v.(*SMReject); i { case 0: return &v.state case 1: @@ -5155,7 +5293,7 @@ func file_cs_proto_proto_init() { } } file_cs_proto_proto_msgTypes[57].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SMLeaveGuild); i { + switch v := v.(*CMLeaveGuild); i { case 0: return &v.state case 1: @@ -5167,7 +5305,7 @@ func file_cs_proto_proto_init() { } } file_cs_proto_proto_msgTypes[58].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CMDismissMember); i { + switch v := v.(*SMLeaveGuild); i { case 0: return &v.state case 1: @@ -5179,7 +5317,7 @@ func file_cs_proto_proto_init() { } } file_cs_proto_proto_msgTypes[59].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SMDismissMember); i { + switch v := v.(*CMDismissMember); i { case 0: return &v.state case 1: @@ -5191,7 +5329,7 @@ func file_cs_proto_proto_init() { } } file_cs_proto_proto_msgTypes[60].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CMPromoteMember); i { + switch v := v.(*SMDismissMember); i { case 0: return &v.state case 1: @@ -5203,7 +5341,7 @@ func file_cs_proto_proto_init() { } } file_cs_proto_proto_msgTypes[61].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SMPromoteMember); i { + switch v := v.(*CMPromoteMember); i { case 0: return &v.state case 1: @@ -5215,7 +5353,7 @@ func file_cs_proto_proto_init() { } } file_cs_proto_proto_msgTypes[62].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CMDemoteMember); i { + switch v := v.(*SMPromoteMember); i { case 0: return &v.state case 1: @@ -5227,7 +5365,7 @@ func file_cs_proto_proto_init() { } } file_cs_proto_proto_msgTypes[63].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SMDemoteMember); i { + switch v := v.(*CMDemoteMember); i { case 0: return &v.state case 1: @@ -5239,7 +5377,7 @@ func file_cs_proto_proto_init() { } } file_cs_proto_proto_msgTypes[64].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CMDisband); i { + switch v := v.(*SMDemoteMember); i { case 0: return &v.state case 1: @@ -5251,7 +5389,7 @@ func file_cs_proto_proto_init() { } } file_cs_proto_proto_msgTypes[65].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SMDisband); i { + switch v := v.(*CMDisband); i { case 0: return &v.state case 1: @@ -5263,7 +5401,7 @@ func file_cs_proto_proto_init() { } } file_cs_proto_proto_msgTypes[66].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CMSearchGuilds); i { + switch v := v.(*SMDisband); i { case 0: return &v.state case 1: @@ -5275,7 +5413,7 @@ func file_cs_proto_proto_init() { } } file_cs_proto_proto_msgTypes[67].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SMSearchGuilds); i { + switch v := v.(*CMSearchGuilds); i { case 0: return &v.state case 1: @@ -5287,7 +5425,7 @@ func file_cs_proto_proto_init() { } } file_cs_proto_proto_msgTypes[68].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MFGuild); i { + switch v := v.(*SMSearchGuilds); i { case 0: return &v.state case 1: @@ -5299,7 +5437,7 @@ func file_cs_proto_proto_init() { } } file_cs_proto_proto_msgTypes[69].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CMGuildLogs); i { + switch v := v.(*MFGuild); i { case 0: return &v.state case 1: @@ -5311,7 +5449,7 @@ func file_cs_proto_proto_init() { } } file_cs_proto_proto_msgTypes[70].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SMGuildLogs); i { + switch v := v.(*CMGuildLogs); i { case 0: return &v.state case 1: @@ -5323,7 +5461,7 @@ func file_cs_proto_proto_init() { } } file_cs_proto_proto_msgTypes[71].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MFGuildLog); i { + switch v := v.(*SMGuildLogs); i { case 0: return &v.state case 1: @@ -5335,7 +5473,7 @@ func file_cs_proto_proto_init() { } } file_cs_proto_proto_msgTypes[72].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CMNotice); i { + switch v := v.(*MFGuildLog); i { case 0: return &v.state case 1: @@ -5347,6 +5485,18 @@ func file_cs_proto_proto_init() { } } file_cs_proto_proto_msgTypes[73].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CMNotice); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cs_proto_proto_msgTypes[74].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*SMNotice); i { case 0: return &v.state @@ -5365,7 +5515,7 @@ func file_cs_proto_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_cs_proto_proto_rawDesc, NumEnums: 1, - NumMessages: 74, + NumMessages: 75, NumExtensions: 0, NumServices: 0, }, diff --git a/server/imserver/guild.go b/server/imserver/guild.go index 823dc259..bb9a5b36 100644 --- a/server/imserver/guild.go +++ b/server/imserver/guild.go @@ -23,6 +23,7 @@ type Guild struct { ChickenDinners int32 // 单局第一名数 MaxMembers int32 // 公会最大成员数 default 30 Members []*GuildMember + PendingReqs map[string]int32 // pendingAccountId -> status 0,1,2,3 pending, accept, reject, leave } // GuildLog 公会日志 @@ -35,7 +36,8 @@ type GuildLog struct { // PendingReq 待审核请求 type PendingReq struct { - Users map[string]bool + AccountId string + Status int32 // 0 pending, 1 ok, 2 reject, 3 disband } func (g *Guild) GetGuildId() int64 { @@ -53,13 +55,12 @@ func (g *Guild) findMemberIndex(AccountId string) int { } // GetMember 根据 AccountId 获取成员信息 -func (g *Guild) GetMember(accountId string) (*GuildMember, error) { +func (g *Guild) GetMember(accountId string) *GuildMember { index := g.findMemberIndex(accountId) if index == -1 { - return nil, fmt.Errorf("member[%s] not found in the guild[%d]", accountId, g.GuildId) + return nil } - - return g.Members[index], nil + return g.Members[index] } // IsMember 是否是公会成员 @@ -84,22 +85,17 @@ func (g *Guild) AddMember(member *GuildMember) { } // RemoveMember 移除成员 -func (g *Guild) RemoveMember(accountId string) error { +func (g *Guild) RemoveMember(accountId string) { if accountId == g.LeaderId { - return fmt.Errorf("cannot remove leader") + return } - index := g.findMemberIndex(accountId) if index == -1 { - return fmt.Errorf("member not found") + return } - //g.Members = append(g.Members[:index], g.Members[index+1:]...) - // 使用 copy 方法来删除切片中的元素,保证数据一致性 copy(g.Members[index:], g.Members[index+1:]) - g.Members[len(g.Members)-1] = nil // 最后一个元素设置为 nil,帮助 GC + g.Members[len(g.Members)-1] = nil g.Members = g.Members[:len(g.Members)-1] - - return nil } func (g *Guild) SetNotice(notice *string) { @@ -110,26 +106,26 @@ func (g *Guild) GetNotice() string { return g.Notice } -func (p *PendingReq) GetUsers() map[string]bool { - return p.Users +// AddPendingReq 添加等待审核成员 +func (g *Guild) AddPendingReq(p *PendingReq) { + g.PendingReqs[p.AccountId] = p.Status } -func (p *PendingReq) AddUser(accountId string) { - if _, exists := p.Users[accountId]; !exists { - p.Users[accountId] = true - return +func (g *Guild) GetPendingReqStatus(accountId string) int32 { + if pendingReqStatus, exists := g.PendingReqs[accountId]; exists { + if exists { + return pendingReqStatus + } } - p.Users[accountId] = true + return -1 } -func (p *PendingReq) RemoveUser(accountId string) { - delete(p.Users, accountId) +// RemovePendingReq 移除等待审核成员 +func (g *Guild) RemovePendingReq(accountId string) { + delete(g.PendingReqs, accountId) } -func (p *PendingReq) IsInReq(accountId string) bool { - user, exists := p.Users[accountId] - if exists { - return user == true - } - return false +func (g *Guild) IsInReq(accountId string) bool { + pendingStatus, exists := g.PendingReqs[accountId] + return exists && pendingStatus == PendingReqIsJoinGuildStatusJoined } diff --git a/server/imserver/guilddbmgr.go b/server/imserver/guilddbmgr.go index 362246e1..b3420095 100644 --- a/server/imserver/guilddbmgr.go +++ b/server/imserver/guilddbmgr.go @@ -55,8 +55,6 @@ func (gm *GuildMgr) loadGuildFromDBResult(err error, rows *f5.DataSet) { ChickenDinners: q5.ToInt32(*rows.GetByIndex(10)), MaxMembers: q5.ToInt32(*rows.GetByIndex(11)), } - // init pendingReqs - gm.pendingReqs[guildId] = &PendingReq{} } q5.UnSetBitFlag(&gm.loadedFlags, LoadGuildFlag) } @@ -128,10 +126,16 @@ func (gm *GuildMgr) loadPendingReqsFromDBResult(err error, rows *f5.DataSet) { guildId = q5.ToInt64(*rows.GetByIndex(0)) accountId = q5.ToString(*rows.GetByIndex(1)) - pendingReq := &PendingReq{} - pendingReq.Users = make(map[string]bool) - pendingReq.AddUser(accountId) - gm.pendingReqs[guildId] = pendingReq + pendingReq := &PendingReq{ + AccountId: accountId, + Status: PendingReqIsJoinGuildStatusDefault, + } + if guild, ok := gm.guilds[guildId]; ok { + if guild.PendingReqs == nil { + guild.PendingReqs = make(map[string]int32) + } + guild.AddPendingReq(pendingReq) + } } q5.UnSetBitFlag(&gm.loadedFlags, LoadGuildReqFlag) } @@ -220,7 +224,7 @@ func (gm *GuildMgr) createGuildDB(g *Guild) { } // updateGuild 更新公会信息 -func (gm *GuildMgr) updateGuild(g *Guild, fields [][]string) { +func (gm *GuildMgr) updateGuild(g *Guild, fields [][]string, cb func(error)) { where := [][]string{ {"guild_id", q5.ToString(g.GuildId)}, } @@ -229,7 +233,9 @@ func (gm *GuildMgr) updateGuild(g *Guild, fields [][]string) { "t_guild", fields, where, - func(error, int64, int64) {}, + func(err error, lastInsertId int64, rowsAffected int64) { + cb(err) + }, ) } @@ -262,8 +268,8 @@ func (gm *GuildMgr) upsertPendingReqs(guildId int64, accountId string, isJoinGui }) } -// updatePendingReqs 更新所有申请加入公会记录 -func (gm *GuildMgr) updateAllPendingReqs(guildId int64, isJoinGuild int) { +// updateAllPendingReqs 更新所有申请加入公会记录 +func (gm *GuildMgr) updateAllPendingReqs(guildId int64, isJoinGuild int, cb func(error)) { fields := [][]string{ {"is_join_guild", q5.ToString(isJoinGuild)}, } @@ -276,17 +282,13 @@ func (gm *GuildMgr) updateAllPendingReqs(guildId int64, isJoinGuild int) { fields, where, func(err error, lastInsertId int64, rowsAffected int64) { - if err != nil { - f5.GetSysLog().Info("error:%v\n", err) - } - f5.GetSysLog().Info("lastInsertId:%d\n", lastInsertId) - f5.GetSysLog().Info("rowsAffected:%d\n", rowsAffected) + cb(err) }, ) } // updatePendingReqs 更新申请加入公会记录 -func (gm *GuildMgr) updatePendingReqs(guildId int64, accountId string, isJoinGuild int) { +func (gm *GuildMgr) updatePendingReqs(guildId int64, accountId string, isJoinGuild int, cb func(error)) { fields := [][]string{ {"is_join_guild", q5.ToString(isJoinGuild)}, } @@ -300,17 +302,13 @@ func (gm *GuildMgr) updatePendingReqs(guildId int64, accountId string, isJoinGui fields, where, func(err error, lastInsertId int64, rowsAffected int64) { - if err != nil { - f5.GetSysLog().Info("error:%v\n", err) - } - f5.GetSysLog().Info("lastInsertId:%d\n", lastInsertId) - f5.GetSysLog().Info("rowsAffected:%d\n", rowsAffected) + cb(err) }, ) } // insertPendingReqs 添加公会成员 -func (gm *GuildMgr) upsertGuildMember(guildId int64, member *GuildMember) { +func (gm *GuildMgr) upsertGuildMember(guildId int64, member *GuildMember, cb func(error)) { where := [][]string{ {"guild_id", q5.ToString(guildId)}, {"account_id", member.AccountId}, @@ -329,18 +327,14 @@ func (gm *GuildMgr) upsertGuildMember(guildId int64, member *GuildMember) { updateKv, insertKv, func(err error, lastInsertId int64, rowsAffected int64) { - if err != nil { - f5.GetSysLog().Info("error:%v\n", err) - } - f5.GetSysLog().Info("lastInsertId:%d\n", lastInsertId) - f5.GetSysLog().Info("rowsAffected:%d\n", rowsAffected) + cb(err) }, ) } -func (gm *GuildMgr) updateGuildMembers(g *Guild, fields [][]string) { +func (gm *GuildMgr) updateGuildMembers(guildId int64, fields [][]string, cb func(error)) { where := [][]string{ - {"guild_id", q5.ToString(g.GuildId)}, + {"guild_id", q5.ToString(guildId)}, } f5.GetJsStyleDb().Update( FRIEND_DB, @@ -348,17 +342,13 @@ func (gm *GuildMgr) updateGuildMembers(g *Guild, fields [][]string) { fields, where, func(err error, lastInsertId int64, rowsAffected int64) { - if err != nil { - f5.GetSysLog().Info("error:%v\n", err) - } - f5.GetSysLog().Info("lastInsertId:%d\n", lastInsertId) - f5.GetSysLog().Info("rowsAffected:%d\n", rowsAffected) + cb(err) }, ) } // updateGuildMember 更新成员信息 -func (gm *GuildMgr) updateGuildMember(g *Guild, accountId string, fields [][]string) { +func (gm *GuildMgr) updateGuildMember(g *Guild, accountId string, fields [][]string, cb func(error)) { where := [][]string{ {"guild_id", q5.ToString(g.GuildId)}, {"account_id", accountId}, @@ -370,11 +360,7 @@ func (gm *GuildMgr) updateGuildMember(g *Guild, accountId string, fields [][]str fields, where, func(err error, lastInsertId int64, rowsAffected int64) { - if err != nil { - f5.GetSysLog().Info("error:%v\n", err) - } - f5.GetSysLog().Info("lastInsertId:%d\n", lastInsertId) - f5.GetSysLog().Info("rowsAffected:%d\n", rowsAffected) + cb(err) }, ) } diff --git a/server/imserver/guildmgr.go b/server/imserver/guildmgr.go index 194f4025..daabdd01 100644 --- a/server/imserver/guildmgr.go +++ b/server/imserver/guildmgr.go @@ -18,17 +18,15 @@ const ( type GuildMgr struct { cs.MsgHandlerImpl guilds map[int64]*Guild // 公会ID -> 公会列表 - pendingReqs map[int64]*PendingReq // 公会ID -> PendingReq - guildLogs map[int64][]*GuildLog // 公会ID -> 公会日志 + guildLogs map[int64][]*GuildLog // 公会ID -> []公会日志列表 loadedFlags int64 guildIds []int64 // 公会ids } func NewGuildMgr() *GuildMgr { return &GuildMgr{ - guilds: make(map[int64]*Guild), - pendingReqs: make(map[int64]*PendingReq), - guildLogs: make(map[int64][]*GuildLog), + guilds: make(map[int64]*Guild), + guildLogs: make(map[int64][]*GuildLog), } } @@ -58,146 +56,212 @@ func (gm *GuildMgr) loadFromDB() { } // CreateGuild 创建公会 -func (gm *GuildMgr) CreateGuild(name string, leaderId string) (int64, error) { - _, err := gm.checkJoinGuild(leaderId) - if err != nil { - return 0, err +func (gm *GuildMgr) CreateGuild(name string, leaderId string, + cb func(errCode int32, errMsg string, guildId int64)) { + if !gm.checkJoinGuild(leaderId) { + cb(1, "xxx", 0) + return } guildId := f5.GetApp().NewUuid() - if _, exists := gm.guilds[guildId]; exists { - return 0, fmt.Errorf("CreateGuild fail") + if gm.existsGuild(guildId) { + cb(1, "xxx", 0) + return } - guild := &Guild{ - GuildId: guildId, - Name: name, - LeaderId: leaderId, - MaxMembers: MaxMembers, + fields := [][]string{ + {"guild_id", q5.ToString(guildId)}, + {"name", name}, + {"leader_account_id", leaderId}, + {"max_members", q5.ToString(MaxMembers)}, } - - newMember := &GuildMember{AccountId: leaderId, Level: GuildMemberLevelLeader} - guild.Members = append(guild.Members, newMember) - - gm.createGuildDB(guild) - gm.upsertGuildMember(guildId, newMember) - gm.AddGuild(guildId, guild) - - return guildId, nil + f5.GetJsStyleDb().Insert( + FRIEND_DB, + "t_guild", + fields, + func(err error, id int64, affectedRows int64) { + if err != nil { + cb(1, "xxx", 0) + return + } + newMember := &GuildMember{AccountId: leaderId, Level: GuildMemberLevelLeader} + gm.upsertGuildMember(guildId, newMember, + func(err error) { + if err != nil { + cb(1, "xxx", 0) + return + } + guild := &Guild{ + AutoId: id, + GuildId: guildId, + Name: name, + LeaderId: leaderId, + MaxMembers: MaxMembers, + } + guild.Members = append(guild.Members, newMember) + gm.AddGuild(guildId, guild) + }) + }) } // ApplyToGuild 申请加入公会 -func (gm *GuildMgr) ApplyToGuild(guildId int64, applicantAccountId string) error { +func (gm *GuildMgr) ApplyToGuild(guildId int64, applicantAccountId string, cb func(errCode int32, errMsg string)) { guild, err := gm.GetGuild(guildId) if err != nil { - return err + cb(1, "xxx") } // 是否加入其他公会 - _, err = gm.checkJoinGuild(applicantAccountId) - if err != nil { - return err + if !gm.checkJoinGuild(applicantAccountId) { + cb(1, "xxx") } err = guild.IsFull() if err != nil { - return err + cb(1, "xxx") } // 可直接加入 if guild.JoinCond == JoinCondFree { gm.JoinGuild(guild, applicantAccountId) - return nil + cb(0, "") } if guild.JoinCond == JoinCondStar { var userStar int32 = 200 if userStar >= guild.JoinCondValue { gm.JoinGuild(guild, applicantAccountId) - return nil + cb(0, "") } } // IF exists, then replace it fields `isJoinGuild` is 0 - gm.upsertPendingReqs(guildId, applicantAccountId, PendingReqIsJoinGuildStatusDefault) - pendReq, err := gm.GetPendingReq(guildId) - if err != nil { - pendReq = &PendingReq{} + where := [][]string{ + {"guild_id", q5.ToString(guildId)}, + {"account_id", applicantAccountId}, } - pendReq.AddUser(applicantAccountId) + insertKv := [][]string{ + {"guild_id", q5.ToString(guildId)}, + {"account_id", applicantAccountId}, + {"is_join_guild", q5.ToString(PendingReqIsJoinGuildStatusDefault)}, + } + updateKv := [][]string{ + {"is_join_guild", q5.ToString(PendingReqIsJoinGuildStatusDefault)}, + } + f5.GetJsStyleDb().Upsert( + FRIEND_DB, + "t_guild_pending_request", + where, + updateKv, + insertKv, + func(err error, lastInsertId int64, rowsAffected int64) { + if err != nil { + cb(0, "") + return + } + if rowsAffected <= 0 { + return + } - return nil + pendingReq := &PendingReq{ + applicantAccountId, + PendingReqIsJoinGuildStatusDefault, + } + guild.AddPendingReq(pendingReq) + cb(0, "") + }) } // Approve 同意申请者加入公会 -func (gm *GuildMgr) Approve(guildId int64, operatorAccountId, accountId string) error { - guild, err := gm.GetGuild(guildId) - if err != nil { - return err +func (gm *GuildMgr) Approve(operatorAccountId, accountId string, cb func(errCode int32, errMsg string)) { + guild := gm.GetGuildByAccountId(operatorAccountId) + if guild == nil { + cb(1, "XXX") } // 通常默认为审核加入 if guild.JoinCond != JoinCondDefault { - return fmt.Errorf("join cond error") + cb(1, "XXX") } - operatorMember, err := guild.GetMember(operatorAccountId) - if err != nil { - return err + operatorMember := guild.GetMember(operatorAccountId) + if operatorMember == nil { + cb(1, "XXX") } // 公会干部及以上仅可操作 - err = gm.checkOperatorPerm(operatorMember, GuildMemberLevelViceLeader) + err := gm.checkOperatorPerm(operatorMember, GuildMemberLevelViceLeader) if err != nil { - return err + cb(1, "XXX") } // 是否加入其他公会 - _, err = gm.checkJoinGuild(accountId) - if err != nil { - return err + if !gm.checkJoinGuild(accountId) { + cb(1, "XXX") } err = guild.IsFull() if err != nil { - return err + cb(1, "XXX") } + guildId := guild.GuildId // 是否在申请队列中 - pendingReq, err := gm.GetPendingReq(guildId) - if err == nil { - return err - } - - inReq := pendingReq.IsInReq(accountId) - if !inReq { - return fmt.Errorf("no pending applications for this guild") + pendingReqStatus := guild.GetPendingReqStatus(accountId) + if pendingReqStatus < 0 { + cb(1, "XXX") } newMember := &GuildMember{AccountId: accountId, Level: GuildMemberLevelDefault} guild.AddMember(newMember) - gm.upsertGuildMember(guildId, newMember) - gm.updatePendingReqs(guildId, accountId, PendingReqIsJoinGuildStatusJoined) - - logContent := fmt.Sprintf("Approve[operator:%s]", operatorAccountId) - gm.WriteLog(guildId, accountId, LogTypeApprove, logContent) - pendingReq.RemoveUser(accountId) - - return nil + gm.upsertGuildMember(guildId, newMember, func(err error) { + if err != nil { + cb(1, "xxx") + return + } + gm.updatePendingReqs(guildId, accountId, PendingReqIsJoinGuildStatusJoined, func(err error) { + logContent := fmt.Sprintf("Approve[operator:%s]", operatorAccountId) + gm.WriteLog(guildId, accountId, LogTypeApprove, logContent) + guild.RemovePendingReq(accountId) + cb(0, "") + }) + }) } // Reject 拒绝申请者加入公会 -func (gm *GuildMgr) Reject(guildId int64, accountId string) error { - pendingReq, err := gm.GetPendingReq(guildId) - if err == nil { - return err +func (gm *GuildMgr) Reject(operatorAccountId, accountId string, cb func(errCode int32, errMsg string)) { + guild := gm.GetGuildByAccountId(operatorAccountId) + if guild == nil { + cb(1, "XXX") + } + // 通常默认为审核加入 + if guild.JoinCond != JoinCondDefault { + cb(1, "XXX") + } + operatorMember := guild.GetMember(operatorAccountId) + if operatorMember == nil { + cb(1, "XXX") + } + // 公会干部及以上仅可操作 + err := gm.checkOperatorPerm(operatorMember, GuildMemberLevelViceLeader) + if err != nil { + cb(1, "XXX") + } + // 是否加入其他公会 + if !gm.checkJoinGuild(accountId) { + cb(1, "XXX") + } + // 是否在申请队列中 + pendingReqStatus := guild.GetPendingReqStatus(accountId) + if pendingReqStatus < 0 { + cb(1, "XXX") } - gm.updatePendingReqs(guildId, accountId, PendingReqIsJoinGuildStatusReject) - pendingReq.RemoveUser(accountId) - - return nil + gm.updatePendingReqs(guild.GuildId, accountId, PendingReqIsJoinGuildStatusReject, func(err error) { + guild.RemovePendingReq(accountId) + cb(0, "") + }) } // JoinGuild 直接加入公会 @@ -205,225 +269,210 @@ func (gm *GuildMgr) JoinGuild(guild *Guild, accountId string) { newMember := GuildMember{AccountId: accountId, Level: GuildMemberLevelDefault} guild.AddMember(&newMember) guildId := guild.GuildId - gm.upsertGuildMember(guildId, &newMember) + gm.upsertGuildMember(guildId, &newMember, + func(err error) { + }) } // LeaveGuild 离开公会 -func (gm *GuildMgr) LeaveGuild(guildId int64, accountId string) error { - guild, err := gm.GetGuild(guildId) - if err != nil { - return err +func (gm *GuildMgr) LeaveGuild(accountId string, cb func(errCode int32, errMsg string)) { + guild := gm.GetGuildByAccountId(accountId) + if guild == nil { + cb(1, "XXX") } - if guild.LeaderId == accountId { - return fmt.Errorf("leader not leave guild") + cb(1, "XXX") + } + member := guild.GetMember(accountId) + if member == nil { + cb(1, "XXX") } - member, err := guild.GetMember(accountId) - if err != nil { - return fmt.Errorf("member not found in the guild") - } - - _ = guild.RemoveMember(accountId) + guild.RemoveMember(accountId) fields := [][]string{{"is_leave_guild", q5.ToString(1)}} - gm.updateGuildMember(guild, member.AccountId, fields) - - logContent := fmt.Sprintf("LeaveGuild[%d-%s]", guildId, accountId) - gm.WriteLog(guildId, accountId, LogTypeLeave, logContent) - - return nil + gm.updateGuildMember(guild, member.AccountId, fields, + func(err error) { + if err != nil { + logContent := fmt.Sprintf("LeaveGuild[%d-%s]", guild.GuildId, accountId) + gm.WriteLog(guild.GuildId, accountId, LogTypeLeave, logContent) + cb(0, "") + } + }) } // DismissMember 开除成员 踢出 -func (gm *GuildMgr) DismissMember(guildId int64, operatorAccountId, accountId string) error { - guild, err := gm.GetGuild(guildId) - if err != nil { - return err +func (gm *GuildMgr) DismissMember(operatorAccountId, accountId string, cb func(errCode int32, errMsg string)) { + guild := gm.GetGuildByAccountId(operatorAccountId) + if guild == nil { + cb(1, "XXX") } - if accountId == guild.LeaderId { - return fmt.Errorf("cannot dismiss the leader") + if accountId == guild.LeaderId || accountId == operatorAccountId { + cb(1, "XXX") } - if operatorAccountId == accountId { - return fmt.Errorf("cannot dismiss yourself") - } - - operatorMember, err := guild.GetMember(operatorAccountId) - if err != nil { - return err + operatorMember := guild.GetMember(operatorAccountId) + if operatorMember == nil { + cb(1, "XXX") } // 公会干部及以上仅可操作 - err = gm.checkOperatorPerm(operatorMember, GuildMemberLevelViceLeader) + err := gm.checkOperatorPerm(operatorMember, GuildMemberLevelViceLeader) if err != nil { - return err + cb(1, "XXX") } - dismissMember, err := guild.GetMember(accountId) - if err != nil { - return err + dismissMember := guild.GetMember(accountId) + if dismissMember == nil { + cb(1, "XXX") } if dismissMember.Level <= operatorMember.Level { - return fmt.Errorf("no permission") + cb(1, "XXX") } + guild.RemoveMember(accountId) - _ = guild.RemoveMember(accountId) fields := [][]string{{"is_leave_guild", q5.ToString(1)}} - gm.updateGuildMember(guild, dismissMember.AccountId, fields) - - logContent := fmt.Sprintf("DismissMember[%d-%s-%s]", guildId, operatorAccountId, accountId) - gm.WriteLog(guildId, accountId, LogTypeDismiss, logContent) - - return nil + gm.updateGuildMember(guild, dismissMember.AccountId, fields, func(err error) { + logContent := fmt.Sprintf("DismissMember[%d-%s-%s]", guild.GuildId, operatorAccountId, accountId) + gm.WriteLog(guild.GuildId, accountId, LogTypeDismiss, logContent) + cb(0, "") + }) } // PromoteMember 提升成员为干部 -func (gm *GuildMgr) PromoteMember(guildId int64, operatorAccountId, accountId string) error { - guild, err := gm.GetGuild(guildId) - if err != nil { - return err +func (gm *GuildMgr) PromoteMember(operatorAccountId, accountId string, cb func(errCode int32, errMsg string)) { + guild := gm.GetGuildByAccountId(operatorAccountId) + if guild == nil { + cb(1, "XXX") } - if accountId == guild.LeaderId { - return fmt.Errorf("cannot promote the leader") + if accountId == guild.LeaderId || accountId == operatorAccountId { + cb(1, "XXX") } // 仅会长操作 - operatorMember, err := guild.GetMember(operatorAccountId) - if err != nil { - return err - } - err = gm.checkOperatorPerm(operatorMember, GuildMemberLevelLeader) - if err != nil { - return err + operatorMember := guild.GetMember(operatorAccountId) + if operatorMember == nil { + cb(1, "XXX") } if operatorAccountId != guild.LeaderId { - return fmt.Errorf("PromoteMember: No, leader") + cb(1, "XXX") } - member, err := guild.GetMember(accountId) - if err != nil { - return fmt.Errorf("member not found in the guild") + member := guild.GetMember(accountId) + if member == nil { + cb(1, "XXX") } if member.Level == GuildMemberLevelViceLeader { - return nil + cb(1, "XXX") } member.Level = GuildMemberLevelViceLeader fields := [][]string{{"level", q5.ToString(GuildMemberLevelViceLeader)}} - gm.updateGuildMember(guild, member.AccountId, fields) - - logContent := fmt.Sprintf("PromoteMember[%d-%s-%s]", guildId, operatorAccountId, accountId) - gm.WriteLog(guildId, accountId, LogTypePromote, logContent) - - return nil + gm.updateGuildMember(guild, member.AccountId, fields, func(err error) { + logContent := fmt.Sprintf("PromoteMember[%d-%s-%s]", guild.GuildId, operatorAccountId, accountId) + gm.WriteLog(guild.GuildId, accountId, LogTypeDismiss, logContent) + cb(0, "") + }) } // DemoteMember 解除成员干部身份 -func (gm *GuildMgr) DemoteMember(guildId int64, operatorAccountId, accountId string) error { - guild, err := gm.GetGuild(guildId) - if err != nil { - return err +func (gm *GuildMgr) DemoteMember(operatorAccountId, accountId string, cb func(errCode int32, errMsg string)) { + guild := gm.GetGuildByAccountId(operatorAccountId) + if guild == nil { + cb(1, "XXX") } - if accountId == guild.LeaderId { - return fmt.Errorf("cannot demote the leader") - } - - // 仅会长操作 - operatorMember, err := guild.GetMember(operatorAccountId) - if err != nil { - return err - } - err = gm.checkOperatorPerm(operatorMember, GuildMemberLevelLeader) - if err != nil { - return err + if accountId == guild.LeaderId || accountId == operatorAccountId { + cb(1, "XXX") } + // 仅会长可操作 if operatorAccountId != guild.LeaderId { - return fmt.Errorf("PromoteMember: No, leader") + cb(1, "XXX") } - member, err := guild.GetMember(accountId) - if err != nil { - return fmt.Errorf("member not found in the guild") + member := guild.GetMember(accountId) + if member == nil { + cb(1, "XXX") } if member.Level == GuildMemberLevelDefault { - return nil + cb(1, "XXX") } member.Level = GuildMemberLevelDefault fields := [][]string{{"level", q5.ToString(GuildMemberLevelDefault)}} - gm.updateGuildMember(guild, member.AccountId, fields) - - logContent := fmt.Sprintf("DemoteMember[%d-%s-%s]", guildId, operatorAccountId, accountId) - gm.WriteLog(guildId, accountId, LogTypeDemote, logContent) - - return nil + gm.updateGuildMember(guild, member.AccountId, fields, func(err error) { + logContent := fmt.Sprintf("DemoteMember[%d-%s-%s]", guild.GuildId, operatorAccountId, accountId) + gm.WriteLog(guild.GuildId, accountId, LogTypeDismiss, logContent) + cb(0, "") + }) } // Disband 解散公会 -func (gm *GuildMgr) Disband(guildId int64, accountId string) error { - guild, err := gm.GetGuild(guildId) - if err != nil { - return err +func (gm *GuildMgr) Disband(operatorAccountId string, cb func(errCode int32, errMsg string)) { + guild := gm.GetGuildByAccountId(operatorAccountId) + if guild == nil { + cb(1, "XXX") } // 仅会长可操作 - if accountId != guild.LeaderId { - return fmt.Errorf("cannot disband guild") + if operatorAccountId != guild.LeaderId { + cb(1, "XXX") } + guildId := guild.GuildId guildName := guild.Name + // 解散公会 updateFields := [][]string{ {"is_deleted", q5.ToString(1)}, } - gm.updateGuild(guild, updateFields) + gm.updateGuild(guild, updateFields, func(err error) { + fields := [][]string{{"is_leave_guild", q5.ToString(1)}} + gm.updateGuildMembers(guildId, fields, func(err error) { + gm.updateAllPendingReqs(guildId, PendingReqIsJoinGuildStatusDisband, func(err error) { + logContent := fmt.Sprintf("GuildDisbanded[%d-%s]", guildId, guildName) + gm.WriteLog(guildId, operatorAccountId, LogTypeDisband, logContent) - fields := [][]string{{"is_leave_guild", q5.ToString(1)}} - gm.updateGuildMembers(guild, fields) + guild.Members = nil + gm.guilds[guildId] = nil + gm.guildLogs[guildId] = nil - gm.updateAllPendingReqs(guildId, PendingReqIsJoinGuildStatusDisband) + delete(gm.guilds, guildId) + delete(gm.guildLogs, guildId) + gm.RemoveGuild(guildId) + }) + }) + }) - guild.Members = nil - gm.guilds[guildId] = nil - - gm.pendingReqs[guildId] = nil - gm.guildLogs[guildId] = nil - delete(gm.guilds, guildId) - delete(gm.pendingReqs, guildId) - delete(gm.guildLogs, guildId) - gm.RemoveGuildsId(guildId) - - logContent := fmt.Sprintf("GuildDisbanded[%d-%s]", guildId, guildName) - gm.WriteLog(guildId, accountId, LogTypeDisband, logContent) - - return nil } // SetNotice 设置公告 -func (gm *GuildMgr) SetNotice(guildId int64, accountId string, notice *string) error { - guild, err := gm.GetGuild(guildId) - if err != nil { - return err +func (gm *GuildMgr) SetNotice(operatorAccountId string, notice *string, cb func(errCode int32, errMsg string)) { + guild := gm.GetGuildByAccountId(operatorAccountId) + if guild == nil { + cb(1, "XXX") } // 仅会长可操作 - if accountId != guild.LeaderId { - return fmt.Errorf("cannot set guild notices, only leader") + if operatorAccountId != guild.LeaderId { + cb(1, "XXX") } + guild.SetNotice(notice) updateFields := [][]string{ {"notice", *notice}, } - gm.updateGuild(guild, updateFields) - - return nil + gm.updateGuild(guild, updateFields, func(err error) { + if err == nil { + cb(0, "") + } + cb(1, err.Error()) + }) } // WriteLog 记录公会日志 @@ -485,6 +534,11 @@ func (gm *GuildMgr) RandomGuilds() []*Guild { return results } +func (gm *GuildMgr) existsGuild(guildId int64) bool { + _, ok := gm.guilds[guildId] + return ok +} + func (gm *GuildMgr) AddGuild(guildId int64, guild *Guild) { if _, exists := gm.guilds[guildId]; !exists { gm.guilds[guildId] = guild @@ -499,13 +553,6 @@ func (gm *GuildMgr) GetGuild(guildId int64) (*Guild, error) { return nil, fmt.Errorf("guild not found") } -func (gm *GuildMgr) GetPendingReq(guildId int64) (*PendingReq, error) { - if pendingReq, exists := gm.pendingReqs[guildId]; exists { - return pendingReq, nil - } - return nil, fmt.Errorf("pendingReq not found, guildId:%d", guildId) -} - // GetGuildByAccountId 查询我的工会 func (gm *GuildMgr) GetGuildByAccountId(accountId string) *Guild { for _, guild := range gm.guilds { @@ -518,25 +565,6 @@ func (gm *GuildMgr) GetGuildByAccountId(accountId string) *Guild { return nil } -// Info 工会信息 -func (gm *GuildMgr) Info(accountId string) (*Guild, map[string]bool, []*GuildLog) { - guild := gm.GetGuildByAccountId(accountId) - pendingReqs := make(map[string]bool, MaxPendingReqs) - guildLogs := make([]*GuildLog, DefaultLogs) - if guild != nil { - guildId := guild.GuildId - if p, exists := gm.pendingReqs[guildId]; exists { - pendingReqs = p.GetUsers() - } else { - pendingReqs = nil - } - - guildLogs = gm.guildLogs[guildId] - } - - return guild, pendingReqs, guildLogs -} - func (gm *GuildMgr) checkOperatorPerm(operatorMember *GuildMember, level int) error { if operatorMember.Level > level { return fmt.Errorf("checkOperatorPerm: no permission[%s-%d]", operatorMember.AccountId, operatorMember.Level) @@ -544,13 +572,8 @@ func (gm *GuildMgr) checkOperatorPerm(operatorMember *GuildMember, level int) er return nil } -func (gm *GuildMgr) checkJoinGuild(accountId string) (bool, error) { - guild := gm.GetGuildByAccountId(accountId) - if guild != nil { - errMsg := fmt.Sprintf("Player:%s has joined other GuildId:%d", accountId, guild.GuildId) - return true, fmt.Errorf(errMsg) - } - return false, nil +func (gm *GuildMgr) checkJoinGuild(accountId string) bool { + return gm.GetGuildByAccountId(accountId) == nil } func (gm *GuildMgr) GetGuildIdByAccountId(accountId string) int64 { @@ -568,7 +591,7 @@ func (gm *GuildMgr) loadGuildIds() { } } -func (gm *GuildMgr) RemoveGuildsId(guildId int64) { +func (gm *GuildMgr) RemoveGuild(guildId int64) { guildIndex := -1 for i, gId := range gm.guildIds { if gId == guildId { @@ -583,13 +606,6 @@ func (gm *GuildMgr) RemoveGuildsId(guildId int64) { gm.guildIds = gm.guildIds[:len(gm.guildIds)-1] } -func (gm *GuildMgr) GetAllPendingReqs(guildId int64) map[string]bool { - if pendingReq, exists := gm.pendingReqs[guildId]; exists { - return pendingReq.GetUsers() - } - return nil -} - func (gm *GuildMgr) GetGuildLogs(guildId int64) []*GuildLog { if logs, exists := gm.guildLogs[guildId]; exists { return logs diff --git a/server/imserver/player.go b/server/imserver/player.go index 48a3053b..81a48be0 100644 --- a/server/imserver/player.go +++ b/server/imserver/player.go @@ -319,167 +319,169 @@ func (p *Player) CMGuildInfo(hdr *f5.MsgHdr, msg *cs.CMGuildInfo) { // CMCreateGuild 创建公会 func (p *Player) CMCreateGuild(hdr *f5.MsgHdr, msg *cs.CMCreateGuild) { - rspMsg := new(cs.SMCreateGuild) - guildId, err := guildMgr.CreateGuild(*msg.Name, p.accountId) - if err != nil { - errMsg := err.Error() - rspMsg.ErrMsg = &errMsg - f5.GetSysLog().Info("CMCreateGuild err:%s\n", errMsg) - } else { - rspMsg.GuildId = &guildId - } - wspListener.sendProxyMsg(hdr.Conn, hdr.SocketHandle, rspMsg) + guildMgr.CreateGuild(*msg.Name, p.accountId, + func(errCode int32, errMsg string, guildId int64) { + rspMsg := new(cs.SMCreateGuild) + if errCode != 0 { + rspMsg.ErrCode = &errCode + rspMsg.ErrMsg = &errMsg + } else { + rspMsg.GuildId = &guildId + } + wspListener.sendProxyMsg(hdr.Conn, hdr.SocketHandle, rspMsg) + }) } // CMApplyToGuild 申请者加入公会 func (p *Player) CMApplyToGuild(hdr *f5.MsgHdr, msg *cs.CMApplyToGuild) { - rspMsg := new(cs.SMApplyToGuild) - err := guildMgr.ApplyToGuild( - msg.GetGuildId(), - p.accountId, + guildMgr.ApplyToGuild( + msg.GetGuildId(), p.accountId, + func(errCode int32, errMsg string) { + rspMsg := new(cs.SMApplyToGuild) + if errCode != 0 { + rspMsg.ErrCode = &errCode + rspMsg.ErrMsg = &errMsg + } + wspListener.sendProxyMsg(hdr.Conn, hdr.SocketHandle, rspMsg) + }, ) - if err != nil { - errMsg := err.Error() - rspMsg.ErrMsg = &errMsg - - f5.GetSysLog().Info("CMApplyToGuild err:%s\n", errMsg) - } - wspListener.sendProxyMsg(hdr.Conn, hdr.SocketHandle, rspMsg) } // CMApplyList 请求申请者列表 func (p *Player) CMApplyList(hdr *f5.MsgHdr, msg *cs.CMApplyList) { rspMsg := new(cs.SMApplyList) guild := guildMgr.GetGuildByAccountId(p.accountId) - if guild == nil { - wspListener.sendProxyMsg(hdr.Conn, hdr.SocketHandle, rspMsg) - return - } - for accountId, isPending := range guildMgr.GetAllPendingReqs(guild.GetGuildId()) { - if isPending { - rspMsg.AccountId = append(rspMsg.AccountId, accountId) + if guild != nil { + for accountId, status := range guild.PendingReqs { + applyInfo := &cs.MFApplyInfo{ + AccountId: &accountId, + Status: &status, + } + rspMsg.ApplyInfo = append(rspMsg.ApplyInfo, applyInfo) } } + wspListener.sendProxyMsg(hdr.Conn, hdr.SocketHandle, rspMsg) } // CMApprove 同意申请者加入公会 func (p *Player) CMApprove(hdr *f5.MsgHdr, msg *cs.CMApprove) { - rspMsg := new(cs.SMApprove) - applicantAccountId := msg.GetApplicantAccountId() - err := guildMgr.Approve( - msg.GetGuildId(), - p.accountId, - applicantAccountId, + guildMgr.Approve( + p.accountId, msg.GetApplicantAccountId(), + func(errCode int32, errMsg string) { + rspMsg := new(cs.SMApprove) + if errCode != 0 { + rspMsg.ErrCode = &errCode + rspMsg.ErrMsg = &errMsg + } + wspListener.sendProxyMsg(hdr.Conn, hdr.SocketHandle, rspMsg) + }, ) - if err != nil { - errMsg := err.Error() - rspMsg.ErrMsg = &errMsg - f5.GetSysLog().Info("CMApprove err:%s\n", errMsg) - } - - wspListener.sendProxyMsg(hdr.Conn, hdr.SocketHandle, rspMsg) } // CMReject 拒绝申请者加入公会 func (p *Player) CMReject(hdr *f5.MsgHdr, msg *cs.CMReject) { - rspMsg := new(cs.SMReject) - applicantAccountId := msg.GetApplicantAccountId() - err := guildMgr.Reject( - msg.GetGuildId(), - applicantAccountId, + guildMgr.Reject( + p.accountId, msg.GetApplicantAccountId(), + func(errCode int32, errMsg string) { + rspMsg := new(cs.SMReject) + if errCode != 0 { + rspMsg.ErrCode = &errCode + rspMsg.ErrMsg = &errMsg + } + wspListener.sendProxyMsg(hdr.Conn, hdr.SocketHandle, rspMsg) + }, ) - if err != nil { - errMsg := err.Error() - rspMsg.ErrMsg = &errMsg - f5.GetSysLog().Info("CMReject err:%s\n", errMsg) - } - - wspListener.sendProxyMsg(hdr.Conn, hdr.SocketHandle, rspMsg) } // CMLeaveGuild 离开公会 func (p *Player) CMLeaveGuild(hdr *f5.MsgHdr, msg *cs.CMLeaveGuild) { - rspMsg := new(cs.SMLeaveGuild) - - guildId := msg.GetGuildId() - err := guildMgr.LeaveGuild( - guildId, + guildMgr.LeaveGuild( p.accountId, + func(errCode int32, errMsg string) { + rspMsg := new(cs.SMLeaveGuild) + if errCode != 0 { + rspMsg.ErrCode = &errCode + rspMsg.ErrMsg = &errMsg + } + wspListener.sendProxyMsg(hdr.Conn, hdr.SocketHandle, rspMsg) + }, ) - if err != nil { - errMsg := err.Error() - rspMsg.ErrMsg = &errMsg - f5.GetSysLog().Info("CMLeaveGuild err:%s\n", errMsg) - } - - wspListener.sendProxyMsg(hdr.Conn, hdr.SocketHandle, rspMsg) } // CMDismissMember 开除成员 func (p *Player) CMDismissMember(hdr *f5.MsgHdr, msg *cs.CMDismissMember) { - rspMsg := new(cs.SMDismissMember) - err := guildMgr.DismissMember( - msg.GetGuildId(), + guildMgr.DismissMember( p.accountId, msg.GetDismissAccountId(), + func(errCode int32, errMsg string) { + rspMsg := new(cs.SMDismissMember) + if errCode != 0 { + rspMsg.ErrCode = &errCode + rspMsg.ErrMsg = &errMsg + } + wspListener.sendProxyMsg(hdr.Conn, hdr.SocketHandle, rspMsg) + }, ) - if err != nil { - errMsg := err.Error() - rspMsg.ErrMsg = &errMsg - f5.GetSysLog().Info("CMDismissMember err:%s\n", errMsg) - } - - wspListener.sendProxyMsg(hdr.Conn, hdr.SocketHandle, rspMsg) } // CMPromoteMember 提升成员为干部 func (p *Player) CMPromoteMember(hdr *f5.MsgHdr, msg *cs.CMPromoteMember) { - rspMsg := new(cs.SMPromoteMember) - err := guildMgr.PromoteMember( - msg.GetGuildId(), + guildMgr.PromoteMember( p.accountId, msg.GetPromoteAccountId(), - ) - if err != nil { - errMsg := err.Error() - rspMsg.ErrMsg = &errMsg - f5.GetSysLog().Info("CMPromoteMember err:%s\n", errMsg) - } - - wspListener.sendProxyMsg(hdr.Conn, hdr.SocketHandle, rspMsg) + func(errCode int32, errMsg string) { + rspMsg := new(cs.SMPromoteMember) + if errCode != 0 { + rspMsg.ErrCode = &errCode + rspMsg.ErrMsg = &errMsg + } + wspListener.sendProxyMsg(hdr.Conn, hdr.SocketHandle, rspMsg) + }) } // CMDemoteMember 解除成员干部身份 func (p *Player) CMDemoteMember(hdr *f5.MsgHdr, msg *cs.CMDemoteMember) { - rspMsg := new(cs.SMDemoteMember) - err := guildMgr.DemoteMember( - msg.GetGuildId(), + guildMgr.DemoteMember( p.accountId, msg.GetDemoteAccountId(), - ) - if err != nil { - errMsg := err.Error() - rspMsg.ErrMsg = &errMsg - f5.GetSysLog().Info("CMDemoteMember err:%s\n", errMsg) - } - wspListener.sendProxyMsg(hdr.Conn, hdr.SocketHandle, rspMsg) + func(errCode int32, errMsg string) { + rspMsg := new(cs.SMDemoteMember) + if errCode != 0 { + rspMsg.ErrCode = &errCode + rspMsg.ErrMsg = &errMsg + } + wspListener.sendProxyMsg(hdr.Conn, hdr.SocketHandle, rspMsg) + }) } // CMDisband 解散公会 func (p *Player) CMDisband(hdr *f5.MsgHdr, msg *cs.CMDisband) { - rspMsg := new(cs.SMDisband) - err := guildMgr.Disband( - msg.GetGuildId(), + guildMgr.Disband( p.accountId, - ) - if err != nil { - errMsg := err.Error() - rspMsg.ErrMsg = &errMsg - f5.GetSysLog().Info("CMDisband err:%s\n", errMsg) - } + func(errCode int32, errMsg string) { + rspMsg := new(cs.SMDisband) + if errCode != 0 { + rspMsg.ErrCode = &errCode + rspMsg.ErrMsg = &errMsg + } + wspListener.sendProxyMsg(hdr.Conn, hdr.SocketHandle, rspMsg) + }) +} - wspListener.sendProxyMsg(hdr.Conn, hdr.SocketHandle, rspMsg) +// CMSetNotice 设置公告 +func (p *Player) CMSetNotice(hdr *f5.MsgHdr, msg *cs.CMNotice) { + guildMgr.SetNotice( + p.accountId, + msg.Content, + func(errCode int32, errMsg string) { + rspMsg := new(cs.SMNotice) + if errCode != 0 { + rspMsg.ErrCode = &errCode + rspMsg.ErrMsg = &errMsg + } + wspListener.sendProxyMsg(hdr.Conn, hdr.SocketHandle, rspMsg) + }) } // CMSearchGuilds 搜索公会 @@ -510,22 +512,6 @@ func (p *Player) CMGuildLogs(hdr *f5.MsgHdr, msg *cs.CMGuildLogs) { wspListener.sendProxyMsg(hdr.Conn, hdr.SocketHandle, rspMsg) } -// CMSetNotice 设置公告 -func (p *Player) CMSetNotice(hdr *f5.MsgHdr, msg *cs.CMNotice) { - rspMsg := new(cs.SMNotice) - err := guildMgr.SetNotice( - msg.GetGuildId(), - p.accountId, - msg.Content, - ) - if err != nil { - errMsg := err.Error() - rspMsg.ErrMsg = &errMsg - f5.GetSysLog().Info("CMSetNotice err:%s\n", errMsg) - } - wspListener.sendProxyMsg(hdr.Conn, hdr.SocketHandle, rspMsg) -} - // FillGuild 填充公共列表 func (p *Player) FillGuild(guilds []*Guild) []*cs.MFGuild { var resGuilds []*cs.MFGuild diff --git a/server/imserver/proto/cs_proto.proto b/server/imserver/proto/cs_proto.proto index 520c58e4..d84d0a91 100644 --- a/server/imserver/proto/cs_proto.proto +++ b/server/imserver/proto/cs_proto.proto @@ -361,8 +361,9 @@ message CMCreateGuild // 回复创建公会 message SMCreateGuild { - optional int64 guild_id = 1; + optional int32 err_code = 1; optional string err_msg = 2; + optional int64 guild_id = 3; } // 请求申请加入公会 @@ -374,7 +375,8 @@ message CMApplyToGuild // 回复申请加入公会 message SMApplyToGuild { - optional string err_msg = 1; + optional int32 err_code = 1; + optional string err_msg = 2; } // 请求申请者列表 @@ -383,96 +385,102 @@ message CMApplyList{} // 回复申请者列表 message SMApplyList { - repeated string account_id = 1; + optional string err_code = 1; + optional string err_msg = 2; + repeated MFApplyInfo apply_info = 3; +} + +message MFApplyInfo { + optional string account_id = 2; + optional int32 status = 3; } // 请求批准申请加入公会 message CMApprove { - optional int64 guild_id = 1; - optional string applicant_account_id = 2; + optional string applicant_account_id = 1; } // 回复批准申请加入公会 message SMApprove { - optional string err_msg = 1; + optional int32 err_code = 1; + optional string err_msg = 2; } // 请求拒绝加入公会 message CMReject { - optional int64 guild_id = 1; - optional string applicant_account_id = 2; + optional string applicant_account_id = 1; } // 回复拒绝加入公会 message SMReject { - optional string err_msg = 1; + optional int32 err_code = 1; + optional string err_msg = 2; } // 请求离开公会 -message CMLeaveGuild -{ - optional int64 guild_id = 1; -} +message CMLeaveGuild{} // 回复离开公会 message SMLeaveGuild { - optional string err_msg = 1; + optional int32 err_code = 1; + optional string err_msg = 2; } // 请求开除成员 message CMDismissMember { - optional int64 guild_id = 1; - optional string dismissAccountId = 2; + optional string dismissAccountId = 1; } // 回复开除成员 message SMDismissMember { - optional string err_msg = 1; + optional int32 err_code = 1; + optional string err_msg = 2; } // 请求提升成员为干部 message CMPromoteMember { - optional int64 guild_id = 1; - optional string promoteAccountId = 2; + optional string promoteAccountId = 1; } // 回复提升成员为干部 message SMPromoteMember { - optional string err_msg = 1; + optional int32 err_code = 1; + optional string err_msg = 2; } // 请求解除成员干部身份 message CMDemoteMember { - optional int64 guild_id = 1; - optional string demoteAccountId = 2; + optional string demoteAccountId = 1; } // 回复解除成员干部身份 message SMDemoteMember { - optional string err_msg = 1; + optional int32 err_code = 1; + optional string err_msg = 2; } // 请求解散公会 message CMDisband { - optional int64 guild_id = 1; + } // 回复解散公会 message SMDisband { - optional string err_msg = 1; + optional int32 err_code = 1; + optional string err_msg = 2; } // 请求搜索公会 @@ -484,7 +492,9 @@ message CMSearchGuilds // 回复搜索公会 message SMSearchGuilds { - repeated MFGuild guilds = 1; + optional int32 err_code = 1; + optional string err_msg = 2; + repeated MFGuild guilds = 3; } message MFGuild { optional int64 auto_id = 1; @@ -502,7 +512,9 @@ message CMGuildLogs{} // 回复公会日志 message SMGuildLogs { - repeated MFGuildLog guildLogs = 1; + optional int32 err_code = 1; + optional string err_msg = 2; + repeated MFGuildLog guildLogs = 3; } message MFGuildLog { @@ -516,13 +528,13 @@ message MFGuildLog { // 请求设置公告 message CMNotice { - optional int64 guild_id = 1; - optional string content = 2; + optional string content = 1; } // 回复设置公告 message SMNotice { - optional string err_msg = 1; + optional int32 err_code = 1; + optional string err_msg = 2; } \ No newline at end of file