助战英雄
This commit is contained in:
parent
91e60bd283
commit
60a36c51b7
@ -154,7 +154,7 @@ type (
|
||||
// 获取好友列表
|
||||
GetFriendList(uid string) []string
|
||||
// 使用好友助战英雄 好友ID:friendId
|
||||
UseAssistHero(uid, nickName, friendId string) (*pb.DBHero, error)
|
||||
UseAssistHero(uid, friendId string) (*pb.DBHero, error)
|
||||
}
|
||||
|
||||
//聊天系统
|
||||
|
@ -78,7 +78,7 @@ func (this *Friend) GetFriendList(uid string) (uids []string) {
|
||||
}
|
||||
|
||||
// 使用好友助战英雄
|
||||
func (this *Friend) UseAssistHero(uid, nickName, friendId string) (*pb.DBHero, error) {
|
||||
func (this *Friend) UseAssistHero(uid, friendId string) (*pb.DBHero, error) {
|
||||
//指定好友
|
||||
friend := this.modelFriend.GetFriend(friendId)
|
||||
|
||||
@ -88,7 +88,7 @@ func (this *Friend) UseAssistHero(uid, nickName, friendId string) (*pb.DBHero, e
|
||||
//更新助战记录和助战分数
|
||||
friend.ZhuzhanScore++
|
||||
friend.Record = append(friend.Record, &pb.ZhuZhanRecord{
|
||||
Name: nickName,
|
||||
Uid: uid,
|
||||
Zhuzhantime: time.Now().Unix(),
|
||||
})
|
||||
update := map[string]interface{}{
|
||||
|
@ -161,7 +161,7 @@ type ZhuZhanRecord struct {
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name" bson:"name"` //好友昵称
|
||||
Uid string `protobuf:"bytes,1,opt,name=uid,proto3" json:"uid" bson:"uid"` //好友Id
|
||||
Zhuzhantime int64 `protobuf:"varint,2,opt,name=zhuzhantime,proto3" json:"zhuzhantime" bson:"zhuzhanTime"` //上次助战时间
|
||||
}
|
||||
|
||||
@ -197,9 +197,9 @@ func (*ZhuZhanRecord) Descriptor() ([]byte, []int) {
|
||||
return file_friend_friend_db_proto_rawDescGZIP(), []int{1}
|
||||
}
|
||||
|
||||
func (x *ZhuZhanRecord) GetName() string {
|
||||
func (x *ZhuZhanRecord) GetUid() string {
|
||||
if x != nil {
|
||||
return x.Name
|
||||
return x.Uid
|
||||
}
|
||||
return ""
|
||||
}
|
||||
@ -240,12 +240,12 @@ var file_friend_friend_db_proto_rawDesc = []byte{
|
||||
0x75, 0x7a, 0x68, 0x61, 0x6e, 0x53, 0x63, 0x6f, 0x72, 0x65, 0x12, 0x26, 0x0a, 0x06, 0x72, 0x65,
|
||||
0x63, 0x6f, 0x72, 0x64, 0x18, 0x0c, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x5a, 0x68, 0x75,
|
||||
0x5a, 0x68, 0x61, 0x6e, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x06, 0x72, 0x65, 0x63, 0x6f,
|
||||
0x72, 0x64, 0x22, 0x45, 0x0a, 0x0d, 0x5a, 0x68, 0x75, 0x5a, 0x68, 0x61, 0x6e, 0x52, 0x65, 0x63,
|
||||
0x6f, 0x72, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28,
|
||||
0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x7a, 0x68, 0x75, 0x7a, 0x68,
|
||||
0x61, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x7a, 0x68,
|
||||
0x75, 0x7a, 0x68, 0x61, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70,
|
||||
0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
0x72, 0x64, 0x22, 0x43, 0x0a, 0x0d, 0x5a, 0x68, 0x75, 0x5a, 0x68, 0x61, 0x6e, 0x52, 0x65, 0x63,
|
||||
0x6f, 0x72, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09,
|
||||
0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x20, 0x0a, 0x0b, 0x7a, 0x68, 0x75, 0x7a, 0x68, 0x61, 0x6e,
|
||||
0x74, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x7a, 0x68, 0x75, 0x7a,
|
||||
0x68, 0x61, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62,
|
||||
0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
|
Loading…
Reference in New Issue
Block a user