diff --git a/bin/json/game_color.json b/bin/json/game_gamecolor.json
similarity index 100%
rename from bin/json/game_color.json
rename to bin/json/game_gamecolor.json
diff --git a/modules/comp_configure.go b/modules/comp_configure.go
index 888547613..241077592 100644
--- a/modules/comp_configure.go
+++ b/modules/comp_configure.go
@@ -13,12 +13,13 @@ import (
)
const (
- game_global = "game_global.json" //全局配置表
- game_initial = "game_initial.json" //初始化表
- game_playerlv = "game_playerlv.json" //玩家等级
- game_facemod = "game_facemod.json" // 形象配置表
- game_drop = "game_drop.json" //掉落
- game_comatn = "game_comatn.json" //atn配置表
+ game_global = "game_global.json" //全局配置表
+ game_initial = "game_initial.json" //初始化表
+ game_gamecolor = "game_gamecolor.json" //颜色表
+ game_playerlv = "game_playerlv.json" //玩家等级
+ game_facemod = "game_facemod.json" //形象配置表
+ game_drop = "game_drop.json" //掉落
+ game_comatn = "game_comatn.json" //atn配置表
)
///配置管理基础组件
@@ -231,3 +232,17 @@ func (this *MCompConfigure) GetDropReward(dropId int32, Items []*cfg.Gameatn) {
return
}
+func (this *MCompConfigure) GetColor(id int32) (item *cfg.GameGameColorData, err error) {
+ var (
+ v interface{}
+ ok bool
+ )
+ if v, err = this.GetConfigure(game_gamecolor); err != nil {
+ return
+ } else {
+ if item, ok = v.(*cfg.GameGameColor).GetDataMap()[id]; !ok {
+ err = fmt.Errorf("on found color:%d", id)
+ }
+ }
+ return
+}
diff --git a/modules/equipment/api_upgrade.go b/modules/equipment/api_upgrade.go
index 9e594f758..7b35d95ae 100644
--- a/modules/equipment/api_upgrade.go
+++ b/modules/equipment/api_upgrade.go
@@ -2,6 +2,7 @@ package equipment
import (
"crypto/rand"
+ "fmt"
"go_dreamfactory/comm"
"go_dreamfactory/lego/sys/log"
"go_dreamfactory/pb"
@@ -182,7 +183,10 @@ func (this *apiComp) Upgrade(session comm.IUserSession, req *pb.EquipmentUpgrade
this.module.ModuleRtask.SendToRtask(session, comm.Rtype47, 1)
//聊天系统通知
if user = this.module.ModuleUser.GetUser(session.GetUserId()); user != nil {
- this.module.chat.SendSysChatToWorld(comm.EquipmentUpgradeNotice, equipment, equipment.Lv, user.Name, conf.Name)
+ 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)
+ }
} else {
this.module.Errorf("no found userdata uid:%s", session.GetUserId())
}
diff --git a/sys/configure/structs/Game.Color.go b/sys/configure/structs/Game.Color.go
deleted file mode 100644
index c56c99427..000000000
--- a/sys/configure/structs/Game.Color.go
+++ /dev/null
@@ -1,42 +0,0 @@
-//------------------------------------------------------------------------------
-//
-// This code was generated by a tool.
-// Changes to this file may cause incorrect behavior and will be lost if
-// the code is regenerated.
-//
-//------------------------------------------------------------------------------
-
-package cfg
-
-type GameColor struct {
- _dataMap map[int32]*GameColorData
- _dataList []*GameColorData
-}
-
-func NewGameColor(_buf []map[string]interface{}) (*GameColor, error) {
- _dataList := make([]*GameColorData, 0, len(_buf))
- dataMap := make(map[int32]*GameColorData)
- for _, _ele_ := range _buf {
- if _v, err2 := DeserializeGameColorData(_ele_); err2 != nil {
- return nil, err2
- } else {
- _dataList = append(_dataList, _v)
- dataMap[_v.Star] = _v
- }
- }
- return &GameColor{_dataList:_dataList, _dataMap:dataMap}, nil
-}
-
-func (table *GameColor) GetDataMap() map[int32]*GameColorData {
- return table._dataMap
-}
-
-func (table *GameColor) GetDataList() []*GameColorData {
- return table._dataList
-}
-
-func (table *GameColor) Get(key int32) *GameColorData {
- return table._dataMap[key]
-}
-
-
diff --git a/sys/configure/structs/Game.GameColor.go b/sys/configure/structs/Game.GameColor.go
new file mode 100644
index 000000000..0941665da
--- /dev/null
+++ b/sys/configure/structs/Game.GameColor.go
@@ -0,0 +1,42 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+package cfg
+
+type GameGameColor struct {
+ _dataMap map[int32]*GameGameColorData
+ _dataList []*GameGameColorData
+}
+
+func NewGameGameColor(_buf []map[string]interface{}) (*GameGameColor, error) {
+ _dataList := make([]*GameGameColorData, 0, len(_buf))
+ dataMap := make(map[int32]*GameGameColorData)
+ for _, _ele_ := range _buf {
+ if _v, err2 := DeserializeGameGameColorData(_ele_); err2 != nil {
+ return nil, err2
+ } else {
+ _dataList = append(_dataList, _v)
+ dataMap[_v.Star] = _v
+ }
+ }
+ return &GameGameColor{_dataList:_dataList, _dataMap:dataMap}, nil
+}
+
+func (table *GameGameColor) GetDataMap() map[int32]*GameGameColorData {
+ return table._dataMap
+}
+
+func (table *GameGameColor) GetDataList() []*GameGameColorData {
+ return table._dataList
+}
+
+func (table *GameGameColor) Get(key int32) *GameGameColorData {
+ return table._dataMap[key]
+}
+
+
diff --git a/sys/configure/structs/Game.ColorData.go b/sys/configure/structs/Game.GameColorData.go
similarity index 70%
rename from sys/configure/structs/Game.ColorData.go
rename to sys/configure/structs/Game.GameColorData.go
index 520da4e3a..ba5249457 100644
--- a/sys/configure/structs/Game.ColorData.go
+++ b/sys/configure/structs/Game.GameColorData.go
@@ -10,25 +10,25 @@ package cfg
import "errors"
-type GameColorData struct {
+type GameGameColorData struct {
Star int32
Color string
}
-const TypeId_GameColorData = -608833871
+const TypeId_GameGameColorData = -304680737
-func (*GameColorData) GetTypeId() int32 {
- return -608833871
+func (*GameGameColorData) GetTypeId() int32 {
+ return -304680737
}
-func (_v *GameColorData)Deserialize(_buf map[string]interface{}) (err error) {
+func (_v *GameGameColorData)Deserialize(_buf map[string]interface{}) (err error) {
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["star"].(float64); !_ok_ { err = errors.New("star error"); return }; _v.Star = int32(_tempNum_) }
{ var _ok_ bool; if _v.Color, _ok_ = _buf["color"].(string); !_ok_ { err = errors.New("color error"); return } }
return
}
-func DeserializeGameColorData(_buf map[string]interface{}) (*GameColorData, error) {
- v := &GameColorData{}
+func DeserializeGameGameColorData(_buf map[string]interface{}) (*GameGameColorData, error) {
+ v := &GameGameColorData{}
if err := v.Deserialize(_buf); err == nil {
return v, nil
} else {
diff --git a/sys/configure/structs/Tables.go b/sys/configure/structs/Tables.go
index 729b17c0b..23d7c30e7 100644
--- a/sys/configure/structs/Tables.go
+++ b/sys/configure/structs/Tables.go
@@ -98,7 +98,7 @@ type Tables struct {
LibraryFavor *GameLibraryFavor
Robot *GameRobot
Ip *GameIp
- Color *GameColor
+ GameColor *GameGameColor
}
func NewTables(loader JsonLoader) (*Tables, error) {
@@ -628,10 +628,10 @@ func NewTables(loader JsonLoader) (*Tables, error) {
if tables.Ip, err = NewGameIp(buf) ; err != nil {
return nil, err
}
- if buf, err = loader("game_color") ; err != nil {
+ if buf, err = loader("game_gamecolor") ; err != nil {
return nil, err
}
- if tables.Color, err = NewGameColor(buf) ; err != nil {
+ if tables.GameColor, err = NewGameGameColor(buf) ; err != nil {
return nil, err
}
return tables, nil