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 PlayerData(ushort playerId, int localPlanetId, Float3 color, Float3 localPlanetPosition = new Float3(), Double3 position = new Double3(), Float3 rotation = new Float3(), Float3 bodyRotation = new Float3()) { PlayerId = playerId; LocalPlanetId = localPlanetId; LocalPlanetPosition = localPlanetPosition; Color = color; UPosition = position; Rotation = rotation; BodyRotation = bodyRotation; Mecha = new MechaData(); }
public void Deserialize(NetDataReader reader) { PlayerId = reader.GetUShort(); LocalPlanetId = reader.GetInt(); Color = reader.GetFloat3(); LocalPlanetPosition = reader.GetFloat3(); UPosition = reader.GetDouble3(); Rotation = reader.GetFloat3(); BodyRotation = reader.GetFloat3(); Mecha = new MechaData(); Mecha.Deserialize(reader); }
public PlayerData(ushort playerId, int localPlanetId, Float3 mechaColor, string username = null, Float3 localPlanetPosition = new Float3(), Double3 position = new Double3(), Float3 rotation = new Float3(), Float3 bodyRotation = new Float3()) { PlayerId = playerId; LocalPlanetId = localPlanetId; Username = !string.IsNullOrWhiteSpace(username) ? username : $"Player {playerId}"; LocalPlanetPosition = localPlanetPosition; MechaColor = mechaColor; UPosition = position; Rotation = rotation; BodyRotation = bodyRotation; Mecha = new MechaData(); }
public PlayerData(ushort playerId, int localPlanetId, Float3 color, string username = null, Float3 localPlanetPosition = new Float3(), Double3 position = new Double3(), Float3 rotation = new Float3(), Float3 bodyRotation = new Float3()) { PlayerId = playerId; LocalPlanetId = localPlanetId; Username = username ?? $"Player {playerId}"; LocalPlanetPosition = localPlanetPosition; Color = color; UPosition = position; Rotation = rotation; BodyRotation = bodyRotation; Mecha = new MechaData(); }
public PlayerData(ushort playerId, int localPlanetId, Float4[] mechaColors, string username = null, Float3 localPlanetPosition = new Float3(), Double3 position = new Double3(), Float3 rotation = new Float3(), Float3 bodyRotation = new Float3()) { PlayerId = playerId; LocalPlanetId = localPlanetId; MechaColors = mechaColors; Username = !string.IsNullOrWhiteSpace(username) ? username : $"Player {playerId}"; LocalPlanetPosition = localPlanetPosition; UPosition = position; Rotation = rotation; BodyRotation = bodyRotation; Mecha = new MechaData(); Appearance = null; DIYAppearance = null; DIYItemId = new int[0]; DIYItemValue = new int[0]; }
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); }