Commit c047d94f9b3c650ea88fd3d9b17d0e05abc24cfa

Authored by zhangqijia
1 parent 0358e232

fix: update equipment

Showing 1 changed file with 15 additions and 13 deletions   Show diff stats
models/role.go
... ... @@ -32,12 +32,13 @@ func RoleExistByUid(uid string) *RoleModel {
32 32 }
33 33  
34 34 r := &RoleModel{
35   - ISchema: NewSchema(data.Id, data),
36   - Role: data,
37   - Heros: make(SchemaMap),
38   - Teams: make(SchemaMap),
39   - Prop: new(PropModel),
40   - Items: make(common.IMapString),
  35 + ISchema: NewSchema(data.Id, data),
  36 + Role: data,
  37 + Heros: make(SchemaMap),
  38 + Teams: make(SchemaMap),
  39 + Equipments: make(SchemaMap),
  40 + Prop: new(PropModel),
  41 + Items: make(common.IMapString),
41 42 }
42 43 r.Load()
43 44 r.LoadAll()
... ... @@ -47,12 +48,13 @@ func RoleExistByUid(uid string) *RoleModel {
47 48 func NewRole(id string) *RoleModel {
48 49 data := &pb.Role{Id: id, Incres: make(map[string]uint32)}
49 50 m := &RoleModel{
50   - ISchema: NewSchema(id, data),
51   - Role: data,
52   - Heros: make(SchemaMap),
53   - Teams: make(SchemaMap),
54   - Prop: new(PropModel),
55   - Items: make(common.IMapString),
  51 + ISchema: NewSchema(id, data),
  52 + Role: data,
  53 + Heros: make(SchemaMap),
  54 + Teams: make(SchemaMap),
  55 + Equipments: make(SchemaMap),
  56 + Prop: new(PropModel),
  57 + Items: make(common.IMapString),
56 58 }
57 59 return m
58 60 }
... ... @@ -258,7 +260,7 @@ func (m *RoleModel) SaveRoleData(now int64) {
258 260 }
259 261 }
260 262  
261   - mpObjs := []SchemaMap{m.Heros, m.Teams}
  263 + mpObjs := []SchemaMap{m.Heros, m.Teams, m.Equipments}
262 264 for _, mpObj := range mpObjs {
263 265 for _, v := range mpObj {
264 266 if v != nil {
... ...