C
C#3y ago
Boop

MessagePack erroring

client sending data
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);
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);
class
[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; }
[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; }
Having an issue with messagepack. Getting a Sequence contains more than one matching element error
13 Replies
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
Boop
BoopOP3y ago
sorry forgot to say, it throws at var buf = MessagePackSerializer.Serialize(sendData);
Boop
BoopOP3y ago
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
Boop
BoopOP3y ago
GitHub
GitHub - neuecc/MessagePack-CSharp: Extremely Fast MessagePack Seri...
Extremely Fast MessagePack Serializer for C#(.NET, .NET Core, Unity, Xamarin). / msgpack.org[C#] - GitHub - neuecc/MessagePack-CSharp: Extremely Fast MessagePack Serializer for C#(.NET, .NET Core, ...
Boop
BoopOP3y ago
using the NuGet package
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
Boop
BoopOP3y ago
sorry the what>
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
Boop
BoopOP3y ago
so remove it from the class and create a blank version of it?
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
Boop
BoopOP3y ago
var sendData = new SocketSendData( /*new InitialConnectionData(Helpers.GetPCDisplayName(),
Helpers.GetIPAddress(), Helpers.GetOSVersion())*/ new InitialConnectionData
{
PCName = Helpers.GetPCDisplayName(), MachineIPAddr = Helpers.GetIPAddress(),
OSVersion = Helpers.GetOSVersion()
});
var sendData = new SocketSendData( /*new InitialConnectionData(Helpers.GetPCDisplayName(),
Helpers.GetIPAddress(), Helpers.GetOSVersion())*/ new InitialConnectionData
{
PCName = Helpers.GetPCDisplayName(), MachineIPAddr = Helpers.GetIPAddress(),
OSVersion = Helpers.GetOSVersion()
});
[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; }
[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; }
same error @Thaumanovic @Thaumanovic any ideas?
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
Want results from more Discord servers?
Add your server