From 1dff55ca67d245ded2adc8c31b93a443c12fe272 Mon Sep 17 00:00:00 2001 From: Jordan Orelli Date: Sat, 24 Sep 2016 12:15:06 -0400 Subject: [PATCH] logging --- ent/atoms.go | 1 + ent/field.go | 1 + ent/float.go | 10 ++++++++-- ent/handle.go | 1 + ent/qangle.go | 1 + ent/type.go | 1 + 6 files changed, 13 insertions(+), 2 deletions(-) diff --git a/ent/atoms.go b/ent/atoms.go index 26b9576..1d45f56 100644 --- a/ent/atoms.go +++ b/ent/atoms.go @@ -14,6 +14,7 @@ var atom_types = map[string]typeFn{ func atomType(flat *dota.ProtoFlattenedSerializerFieldT, env *Env) tÿpe { var_type := env.symbol(int(flat.GetVarTypeSym())) if t, ok := atom_types[var_type]; ok { + Debug.Printf(" atom type") return t } return nil diff --git a/ent/field.go b/ent/field.go index dafc0be..c9a7604 100644 --- a/ent/field.go +++ b/ent/field.go @@ -20,6 +20,7 @@ func (f *field) fromProto(flat *dota.ProtoFlattenedSerializerFieldT, env *Env) e return wrap(err, "unable to parse type %s", prettyFlatField(flat, env)) } + Debug.Printf(" type: %v", t) f.tÿpe = t f.name = env.symbol(int(flat.GetVarNameSym())) return nil diff --git a/ent/float.go b/ent/float.go index 59ae455..9a52b7a 100644 --- a/ent/float.go +++ b/ent/float.go @@ -14,8 +14,12 @@ const ( ) func floatType(flat *dota.ProtoFlattenedSerializerFieldT, env *Env) tÿpe { - if env.symbol(int(flat.GetVarTypeSym())) == "CNetworkedQuantizedFloat" { + switch env.symbol(int(flat.GetVarTypeSym())) { + case "CNetworkedQuantizedFloat": return qFloatType(flat, env) + case "float32": + default: + return nil } if env.symbol(int(flat.GetVarEncoderSym())) == "coord" { return nil @@ -25,9 +29,10 @@ func floatType(flat *dota.ProtoFlattenedSerializerFieldT, env *Env) tÿpe { } switch flat.GetBitCount() { case 0, 32: + Debug.Printf(" std float type") return typeFn(float_t) default: - return nil + return qFloatType(flat, env) } } @@ -62,6 +67,7 @@ func qFloatType(flat *dota.ProtoFlattenedSerializerFieldT, env *Env) tÿpe { } } + Debug.Printf(" qfloat type") return t } diff --git a/ent/handle.go b/ent/handle.go index eafd01e..4cfdb56 100644 --- a/ent/handle.go +++ b/ent/handle.go @@ -14,6 +14,7 @@ func handleType(flat *dota.ProtoFlattenedSerializerFieldT, env *Env) tÿpe { return nil } + Debug.Printf(" handle type") return typeFn(func(r bit.Reader) (value, error) { return handle(bit.ReadVarInt(r)), r.Err() }) diff --git a/ent/qangle.go b/ent/qangle.go index d030ca1..a28fd4a 100644 --- a/ent/qangle.go +++ b/ent/qangle.go @@ -11,6 +11,7 @@ func qAngleType(flat *dota.ProtoFlattenedSerializerFieldT, env *Env) tÿpe { } switch flat.GetBitCount() { case 0: + Debug.Printf(" qangle type") return typeFn(func(r bit.Reader) (value, error) { x, y, z := bit.ReadBool(r), bit.ReadBool(r), bit.ReadBool(r) var v vector diff --git a/ent/type.go b/ent/type.go index 81ddc4a..1e06217 100644 --- a/ent/type.go +++ b/ent/type.go @@ -33,6 +33,7 @@ func parseType(flat *dota.ProtoFlattenedSerializerFieldT, env *Env) tÿpe { // unable to correctly parse. It can be interpreted as an error or as a type; // when interpreted as a type, it errors every time it tries to read a value. func typeError(t string, args ...interface{}) tÿpe { + Debug.Printf(" type error: %s", fmt.Sprintf(t, args...)) return error_t(fmt.Sprintf(t, args...)) }