Asher
Asher
CC#
Created by Big Chungus on 2/4/2025 in #help
Fast regex that takes in a span instead of a string
if you compile this to a DLL what i said should be possible but keep in mind it might be platform specific tho i doubt it, it sounds more complicated than what i make it out to be, this is the signature i think youre looking for though: https://github.com/google/re2/blob/6dcd83d60f7944926bfd308cc13979fc53dd69ca/re2/re2.cc#L423
33 replies
CC#
Created by Big Chungus on 2/4/2025 in #help
Fast regex that takes in a span instead of a string
if it is a DLL i'd assume the function signature is somewhere to be found in the docs
33 replies
CC#
Created by Big Chungus on 2/4/2025 in #help
Fast regex that takes in a span instead of a string
you could in theory import it from a DLL (i don't know if RE2 is a DLL of functions, enlighten me on that one) and convert your span to whatever it uses
33 replies
CC#
Created by Tycho on 12/18/2023 in #help
MonoGame - inheritance implementation.
as for your code, wouldn't change anything but again, not a game dev so take that with a grain of salt
19 replies
CC#
Created by Tycho on 12/18/2023 in #help
MonoGame - inheritance implementation.
and that would give you alot of opportunity to learn how overriding works, how you pass references of a base class and possibly need to convert them to their original type etc etc
19 replies
CC#
Created by Tycho on 12/18/2023 in #help
MonoGame - inheritance implementation.
if it's a base class you'd also add health maybe speed unless they're all stationary
19 replies
CC#
Created by Tycho on 12/18/2023 in #help
MonoGame - inheritance implementation.
interface IEnemy
{
void DoAttack(); // this would be implemented for each enemy with their distinct attack
}
interface IEnemy
{
void DoAttack(); // this would be implemented for each enemy with their distinct attack
}
just to give an example
19 replies
CC#
Created by Tycho on 12/18/2023 in #help
MonoGame - inheritance implementation.
I'm not a game dev but I'd assume most games use some sort of base class system to define for example enemies, maybe an interface that you need to implement
19 replies
CC#
Created by Tycho on 12/18/2023 in #help
MonoGame - inheritance implementation.
in general from what I know most libraries or engines when creating some base class will expect you to override certain functions but if you really want to get a grasp on inheritence I'd argue you should be making the base class with an actual use case
19 replies
CC#
Created by Tycho on 12/18/2023 in #help
MonoGame - inheritance implementation.
is Game a class from a library you're using? or did you create it?
19 replies
CC#
Created by Asher on 12/18/2023 in #help
Unable to cancel async operation using CancellationToken
@xtreit tried this approach, it seems to still hang for some reason, the RecieveAsync itself just completely (but asynchronously) hangs everything
5 replies
CC#
Created by Asher on 12/18/2023 in #help
Unable to cancel async operation using CancellationToken
I am really going crazy trying to cancel this operation if a result is not recieved within 5 seconds, does anyone know why I'm unable to stop this operation?
5 replies
CC#
Created by Asher on 12/18/2023 in #help
Unable to cancel async operation using CancellationToken
This is the code particularly:
CancellationTokenSource cts = new CancellationTokenSource();

ValueTask<int> numBytesReceived = sock.ReceiveAsync(res, SocketFlags.None, cts.Token);
cts.CancelAfter(5000);
await numBytesReceived;
Array.Resize(ref res, numBytesReceived.Result);
CancellationTokenSource cts = new CancellationTokenSource();

ValueTask<int> numBytesReceived = sock.ReceiveAsync(res, SocketFlags.None, cts.Token);
cts.CancelAfter(5000);
await numBytesReceived;
Array.Resize(ref res, numBytesReceived.Result);
5 replies
CC#
Created by occluder on 12/8/2023 in #help
✅ Blazor's @onclick isn't firing
I don't believe you need the preventDefault
21 replies
CC#
Created by Asher on 11/11/2023 in #help
UdpClient doesn't receive data with ReceiveAsync but does with BeginReceive
I might take a look at the .net library source to see exactly how ReceiveAsync works so I might get a clue or try to use Socket instead of UdpClient thats like my other 2 options right now but I can't for the life of me figure out why this hangs
14 replies
CC#
Created by Asher on 11/11/2023 in #help
UdpClient doesn't receive data with ReceiveAsync but does with BeginReceive
I can't run it multiple times though
14 replies
CC#
Created by Asher on 11/11/2023 in #help
UdpClient doesn't receive data with ReceiveAsync but does with BeginReceive
It does, basically the one with BeginReceive & EndReceive is my current working version
14 replies
CC#
Created by Asher on 11/11/2023 in #help
UdpClient doesn't receive data with ReceiveAsync but does with BeginReceive
any knows why this might hang?
14 replies
CC#
Created by Asher on 11/11/2023 in #help
UdpClient doesn't receive data with ReceiveAsync but does with BeginReceive
I find it particularly weird that ReceiveAsync does not take in an endpoint as a parameter like BeginReceive does but there is no overload where it takes such a parameter
14 replies
CC#
Created by Asher on 11/11/2023 in #help
UdpClient doesn't receive data with ReceiveAsync but does with BeginReceive
no exceptions thrown either
14 replies