Iceman228
Iceman228
CC#
Created by oct0202 on 4/22/2024 in #help
Serialization/Deserialization
Have you done a simple json serialize/deserialize? If not, get that to work in your code. There are a bunch of examples and if your approach doesn't work, you can post the code here. If you want to save a game state, it makes sense to make a class specific for this, unless most of the info in other classes is relevant. Then you can have one root class which has them inside which gets serialized
3 replies
CC#
Created by BrytanX on 11/10/2023 in #help
❔ Could u help me plz
And to be honest, telling someone to just delete a line is bad advice, and if it weren't defined, it would be an actual error.
23 replies
CC#
Created by BrytanX on 11/10/2023 in #help
❔ Could u help me plz
It is not an error, it is a warning. Also please post the message in English when asking for help in an English discord. Looks like a null warning though
23 replies
CC#
Created by Iceman228 on 11/29/2022 in #help
TcpClient connection
var certificate = await SSL.GetCertificateAsync(url);



private static readonly RemoteCertificateValidationCallback _certificateValidationCallback = (_, _, _, _) => true;

public static async Task<X509Certificate2?> GetCertificateAsync(string domain, int port = 443)
{
using TcpClient tcpClient = new(domain, port);
using SslStream sslStream = new(tcpClient.GetStream(), leaveInnerStreamOpen: true, _certificateValidationCallback);

await sslStream.AuthenticateAsClientAsync(domain).ConfigureAwait(false);

var serverCertificate = sslStream.RemoteCertificate;
if (serverCertificate != null)
return new X509Certificate2(serverCertificate);

return null;
}
}
var certificate = await SSL.GetCertificateAsync(url);



private static readonly RemoteCertificateValidationCallback _certificateValidationCallback = (_, _, _, _) => true;

public static async Task<X509Certificate2?> GetCertificateAsync(string domain, int port = 443)
{
using TcpClient tcpClient = new(domain, port);
using SslStream sslStream = new(tcpClient.GetStream(), leaveInnerStreamOpen: true, _certificateValidationCallback);

await sslStream.AuthenticateAsClientAsync(domain).ConfigureAwait(false);

var serverCertificate = sslStream.RemoteCertificate;
if (serverCertificate != null)
return new X509Certificate2(serverCertificate);

return null;
}
}
2 replies
CC#
Created by Iceman228 on 10/18/2022 in #help
Remove list element
I am trying to think of one and don't find it. I will test it without.
7 replies
CC#
Created by Iceman228 on 10/18/2022 in #help
Remove list element
Just figured that out as well. Thanks though.
7 replies
CC#
Created by Iceman228 on 9/26/2022 in #help
XML Deserialization Null Exception
set => LoginName = value?.Value;
set => LoginName = value?.Value;
I did this and it is working now.
4 replies
CC#
Created by Iceman228 on 9/26/2022 in #help
XML Deserialization Null Exception
Is there a reason not to and would that change the behavior ?
4 replies
CC#
Created by Iceman228 on 8/30/2022 in #help
Set property based on another
I just really have no idea how to write it.
7 replies
CC#
Created by Iceman228 on 8/30/2022 in #help
Set property based on another
Yes but idk how.
7 replies