public void Deserialize_5(INetDataReader reader) { Username = reader.GetString(); PlayerId = reader.GetUShort(); LocalPlanetId = reader.GetInt(); MechaColors = new Float4[reader.GetInt()]; for (int i = 0; i < MechaColors.Length; i++) { MechaColors[i] = reader.GetFloat4(); } LocalPlanetPosition = reader.GetFloat3(); UPosition = reader.GetDouble3(); Rotation = reader.GetFloat3(); BodyRotation = reader.GetFloat3(); Mecha = new MechaData(); Mecha.Deserialize(reader); bool isAppearancePresent = reader.GetBool(); if (isAppearancePresent) { int len = reader.GetInt(); byte[] data = new byte[len]; reader.GetBytes(data, len); using (MemoryStream ms = new MemoryStream(data)) using (BinaryReader br = new BinaryReader(ms)) { Appearance = new MechaAppearance(); Appearance.Init(); Appearance.Import(br); } } }
public void Deserialize_4(INetDataReader reader) { Username = reader.GetString(); PlayerId = reader.GetUShort(); LocalPlanetId = reader.GetInt(); MechaColors = new Float4[reader.GetInt()]; for (int i = 0; i < MechaColors.Length; i++) { MechaColors[i] = reader.GetFloat4(); } LocalPlanetPosition = reader.GetFloat3(); UPosition = reader.GetDouble3(); Rotation = reader.GetFloat3(); BodyRotation = reader.GetFloat3(); Mecha = new MechaData(); Mecha.Deserialize(reader); }