var sendData = new SocketSendData(new InitialConnectionData(Helpers.GetPCDisplayName(), Helpers.GetIPAddress(), Helpers.GetOSVersion())); var buf = MessagePackSerializer.Serialize(sendData); ClientSocket.Send(buf, 0, buf.Length, SocketFlags.None);
[MessagePackObject] public class InitialConnectionData { [SerializationConstructor] public InitialConnectionData(string pcName, string dnsIpAddr, string osVersion) { PCName = pcName; DnsIpAddr = dnsIpAddr; OSVersion = osVersion; } [Key(0)] public string PCName { get; set; } [Key(1)] public string MachineIPAddr { get; set; } [IgnoreMember] public string DnsIpAddr { get; set; } [IgnoreMember] public Socket LinkedSocket { get; set; } [Key(3)] public string OSVersion { get; set; }
Sequence contains more than one matching element
private static void SendScreen() { MemoryStream ms = new MemoryStream(); ms.Write(Encoding.ASCII.GetBytes("screen:"), 0, Encoding.ASCII.GetBytes("EOF").Length); Helpers.GetScreen().Save(ms, System.Drawing.Imaging.ImageFormat.Bmp); var imageData = ms.ToArray(); var lengthData = BitConverter.GetBytes(imageData.Length); ClientSocket.Send(imageData, 0, imageData.Length, SocketFlags.None); }
List<Effects> effectsList = activePlayerEffects[targetPlayer] ?? new List<Effects>();