diff --git a/modules/chat/module.go b/modules/chat/module.go index f74070a8b..c90656f72 100644 --- a/modules/chat/module.go +++ b/modules/chat/module.go @@ -121,13 +121,21 @@ func (this *Chat) SendSysChatToWorld(ctype comm.ChatSystemType, appenddata inter Content: fmt.Sprintf(st.Text, agrs...), } if ctype == comm.EquipmentUpgradeNotice { //装备分享 - msg.Ctype = pb.ChatType_EquipmentShare - } - if appenddata != nil { - if jsonStr, err = json.Marshal(appenddata); err != nil { - this.Errorf("err:%v", err) - } else { - msg.AppendStr = string(jsonStr) + msg.Ctype = pb.ChatType_Share + if appenddata != nil { + if jsonStr, err = json.Marshal(appenddata); err != nil { + this.Errorf("err:%v", err) + } else { + data := map[string]interface{}{ + "0": map[string]interface{}{ + "key": "0", + "appendStr": jsonStr, + "itemType": 1, + }, + } + jsonStr, _ = json.Marshal(data) + msg.AppendStr = string(jsonStr) + } } } code = this.modelChat.sendSystemChat(msg) diff --git a/modules/equipment/api_upgrade.go b/modules/equipment/api_upgrade.go index 7b35d95ae..287129aef 100644 --- a/modules/equipment/api_upgrade.go +++ b/modules/equipment/api_upgrade.go @@ -185,13 +185,14 @@ func (this *apiComp) Upgrade(session comm.IUserSession, req *pb.EquipmentUpgrade if user = this.module.ModuleUser.GetUser(session.GetUserId()); user != nil { var color *cfg.GameGameColorData if color, err = this.module.configure.GetColor(conf.Color); err == nil { - this.module.chat.SendSysChatToWorld(comm.EquipmentUpgradeNotice, equipment, equipment.Lv, fmt.Sprintf("[color=%s]%s[/color]", color.Color, user.Name), conf.Name) + this.module.chat.SendSysChatToWorld(comm.EquipmentUpgradeNotice, equipment, equipment.Lv, fmt.Sprintf("[color=%s]%s[/color]", color.Color, user.Name), conf.Name) + } else { + this.module.Errorf("GetColor err:%s", err.Error()) } } else { this.module.Errorf("no found userdata uid:%s", session.GetUserId()) } } - session.SendMsg(string(this.module.GetType()), "upgrade", &pb.EquipmentUpgradeResp{IsSucc: issucc, Equipment: modifyequipments}) return }