Merge branch 'dev' of http://git.legu.cc/liwei_3d/go_dreamfactory into dev
This commit is contained in:
commit
c1c76649d4
@ -13,12 +13,13 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
game_global = "game_global.json" //全局配置表
|
game_global = "game_global.json" //全局配置表
|
||||||
game_initial = "game_initial.json" //初始化表
|
game_initial = "game_initial.json" //初始化表
|
||||||
game_playerlv = "game_playerlv.json" //玩家等级
|
game_gamecolor = "game_gamecolor.json" //颜色表
|
||||||
game_facemod = "game_facemod.json" // 形象配置表
|
game_playerlv = "game_playerlv.json" //玩家等级
|
||||||
game_drop = "game_drop.json" //掉落
|
game_facemod = "game_facemod.json" //形象配置表
|
||||||
game_comatn = "game_comatn.json" //atn配置表
|
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
|
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
|
||||||
|
}
|
||||||
|
@ -2,6 +2,7 @@ package equipment
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"crypto/rand"
|
"crypto/rand"
|
||||||
|
"fmt"
|
||||||
"go_dreamfactory/comm"
|
"go_dreamfactory/comm"
|
||||||
"go_dreamfactory/lego/sys/log"
|
"go_dreamfactory/lego/sys/log"
|
||||||
"go_dreamfactory/pb"
|
"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)
|
this.module.ModuleRtask.SendToRtask(session, comm.Rtype47, 1)
|
||||||
//聊天系统通知
|
//聊天系统通知
|
||||||
if user = this.module.ModuleUser.GetUser(session.GetUserId()); user != nil {
|
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 {
|
} else {
|
||||||
this.module.Errorf("no found userdata uid:%s", session.GetUserId())
|
this.module.Errorf("no found userdata uid:%s", session.GetUserId())
|
||||||
}
|
}
|
||||||
|
@ -1,42 +0,0 @@
|
|||||||
//------------------------------------------------------------------------------
|
|
||||||
// <auto-generated>
|
|
||||||
// This code was generated by a tool.
|
|
||||||
// Changes to this file may cause incorrect behavior and will be lost if
|
|
||||||
// the code is regenerated.
|
|
||||||
// </auto-generated>
|
|
||||||
//------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
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]
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
42
sys/configure/structs/Game.GameColor.go
Normal file
42
sys/configure/structs/Game.GameColor.go
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// This code was generated by a tool.
|
||||||
|
// Changes to this file may cause incorrect behavior and will be lost if
|
||||||
|
// the code is regenerated.
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
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]
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -10,25 +10,25 @@ package cfg
|
|||||||
|
|
||||||
import "errors"
|
import "errors"
|
||||||
|
|
||||||
type GameColorData struct {
|
type GameGameColorData struct {
|
||||||
Star int32
|
Star int32
|
||||||
Color string
|
Color string
|
||||||
}
|
}
|
||||||
|
|
||||||
const TypeId_GameColorData = -608833871
|
const TypeId_GameGameColorData = -304680737
|
||||||
|
|
||||||
func (*GameColorData) GetTypeId() int32 {
|
func (*GameGameColorData) GetTypeId() int32 {
|
||||||
return -608833871
|
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; 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 } }
|
{ var _ok_ bool; if _v.Color, _ok_ = _buf["color"].(string); !_ok_ { err = errors.New("color error"); return } }
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
func DeserializeGameColorData(_buf map[string]interface{}) (*GameColorData, error) {
|
func DeserializeGameGameColorData(_buf map[string]interface{}) (*GameGameColorData, error) {
|
||||||
v := &GameColorData{}
|
v := &GameGameColorData{}
|
||||||
if err := v.Deserialize(_buf); err == nil {
|
if err := v.Deserialize(_buf); err == nil {
|
||||||
return v, nil
|
return v, nil
|
||||||
} else {
|
} else {
|
@ -98,7 +98,7 @@ type Tables struct {
|
|||||||
LibraryFavor *GameLibraryFavor
|
LibraryFavor *GameLibraryFavor
|
||||||
Robot *GameRobot
|
Robot *GameRobot
|
||||||
Ip *GameIp
|
Ip *GameIp
|
||||||
Color *GameColor
|
GameColor *GameGameColor
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewTables(loader JsonLoader) (*Tables, error) {
|
func NewTables(loader JsonLoader) (*Tables, error) {
|
||||||
@ -628,10 +628,10 @@ func NewTables(loader JsonLoader) (*Tables, error) {
|
|||||||
if tables.Ip, err = NewGameIp(buf) ; err != nil {
|
if tables.Ip, err = NewGameIp(buf) ; err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
if buf, err = loader("game_color") ; err != nil {
|
if buf, err = loader("game_gamecolor") ; err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
if tables.Color, err = NewGameColor(buf) ; err != nil {
|
if tables.GameColor, err = NewGameGameColor(buf) ; err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
return tables, nil
|
return tables, nil
|
||||||
|
Loading…
Reference in New Issue
Block a user