|
|
@ -92,8 +92,7 @@ func (d *Dict) updateEntity(id int) error {
|
|
|
|
if e == nil {
|
|
|
|
if e == nil {
|
|
|
|
return fmt.Errorf("update entity %d refused: no such entity", id)
|
|
|
|
return fmt.Errorf("update entity %d refused: no such entity", id)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// e.Read(d.br, d.sr)
|
|
|
|
return fillSlots(e, e.Class.String(), d.sr, d.br)
|
|
|
|
return nil
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func (d *Dict) deleteEntity(id int) error {
|
|
|
|
func (d *Dict) deleteEntity(id int) error {
|
|
|
@ -122,7 +121,9 @@ func (d *Dict) Handle(m proto.Message) {
|
|
|
|
d.syncBaselines()
|
|
|
|
d.syncBaselines()
|
|
|
|
|
|
|
|
|
|
|
|
case *dota.CSVCMsg_PacketEntities:
|
|
|
|
case *dota.CSVCMsg_PacketEntities:
|
|
|
|
d.mergeEntities(v)
|
|
|
|
if err := d.mergeEntities(v); err != nil {
|
|
|
|
|
|
|
|
Debug.Printf("merge entities error: %v", err)
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -133,8 +134,7 @@ func (d *Dict) mergeEntities(m *dota.CSVCMsg_PacketEntities) error {
|
|
|
|
|
|
|
|
|
|
|
|
d.br.SetSource(data)
|
|
|
|
d.br.SetSource(data)
|
|
|
|
id := -1
|
|
|
|
id := -1
|
|
|
|
// for i := 0; i < int(m.GetUpdatedEntries()); i++ {
|
|
|
|
for i := 0; i < int(m.GetUpdatedEntries()); i++ {
|
|
|
|
for i := 0; i < 1; i++ {
|
|
|
|
|
|
|
|
id++
|
|
|
|
id++
|
|
|
|
// there may be a jump indicator, indicating how many id positions
|
|
|
|
// there may be a jump indicator, indicating how many id positions
|
|
|
|
// to skip.
|
|
|
|
// to skip.
|
|
|
|