public static void Serialize(Stream stream, PhotonServerLoadView instance) { using (var bytes = new MemoryStream()) { SingleProxy.Serialize(bytes, instance.MaxPlayerCount); Int32Proxy.Serialize(bytes, instance.PeersConnected); Int32Proxy.Serialize(bytes, instance.PlayersConnected); Int32Proxy.Serialize(bytes, instance.RoomsCreated); bytes.WriteTo(stream); } }
// Token: 0x060013D5 RID: 5077 RVA: 0x00023510 File Offset: 0x00021710 private byte[] Serialize(T obj) { byte[] result; using (MemoryStream memoryStream = new MemoryStream()) { Type typeFromHandle = typeof(T); if (typeFromHandle == typeof(int)) { Int32Proxy.Serialize(memoryStream, (int)((object)obj)); } else if (typeFromHandle == typeof(float)) { SingleProxy.Serialize(memoryStream, (float)((object)obj)); } else if (typeFromHandle == typeof(string)) { StringProxy.Serialize(memoryStream, (string)((object)obj)); } result = memoryStream.ToArray(); } return(result); }
public static void Serialize(Stream stream, DamageEventView instance) { int mask = 0; using (var bytes = new MemoryStream()) { ByteProxy.Serialize(bytes, instance.BodyPartFlag); if (instance.Damage != null) { DictionaryProxy <byte, byte> .Serialize(bytes, instance.Damage, ByteProxy.Serialize, ByteProxy.Serialize); } else { mask |= 1; } Int32Proxy.Serialize(bytes, instance.DamageEffectFlag); SingleProxy.Serialize(bytes, instance.DamgeEffectValue); Int32Proxy.Serialize(stream, ~mask); bytes.WriteTo(stream); } }
// Token: 0x060013AE RID: 5038 RVA: 0x0000D655 File Offset: 0x0000B855 public void Serialize(MemoryStream stream) { StringProxy.Serialize(stream, this._axis); SingleProxy.Serialize(stream, this._deadRange); EnumProxy <AxisInputChannel.AxisReadingMethod> .Serialize(stream, this._axisReading); }