Mayor McCheese
Mayor McCheese
Explore posts from servers
CC#
Created by Theos on 4/14/2025 in #help
Issue when deserializing web response
Also don't keep remaking json serializer options, you should be reusing that
23 replies
CC#
Created by Clean Cock on 4/7/2025 in #help
✅ EF Core migrations with Docker
How is that a catch?
22 replies
CC#
Created by ROBERT311 on 4/6/2025 in #help
magic code???
I can't help you understand the dithering component, if it's truly non deterministic then you've got other problems, otherwise I suspect you don't understand the circumstances. It's likely a set of actions that you're taking creating a state where it works the next execution. Without seeing the code it's hard to tell. Is this in a git repo public somewhere?
16 replies
CC#
Created by ROBERT311 on 4/6/2025 in #help
magic code???
There's more advanced strategies, like creating files when they don't exist.
16 replies
CC#
Created by ROBERT311 on 4/6/2025 in #help
magic code???
16 replies
CC#
Created by ROBERT311 on 4/6/2025 in #help
magic code???
You're going to have trouble referencing files like that, generally navigating up .. is a bad idea. It implies a directory structure must exist in a place that isn't under your control. One thing to do is copy the files to the output directory and reference them from the same directory you're executing from Alternatively you can store them in a dedicated well known and configurable location.
16 replies
CC#
Created by ROBERT311 on 4/6/2025 in #help
magic code???
It sounds like what you have going on is you have some csv's in your project that aren't being copied to the output directory so it's not failing to load files that aren't there? This is a wild ass guess, like @Adise said there's not a lot here to go on.
16 replies
CC#
Created by Adise on 4/6/2025 in #help
✅ Class instance reference
/close
55 replies
CC#
Created by Adise on 4/6/2025 in #help
✅ Class instance reference
in your lambda it's looking like you're not capturing the scope, but I could be wrong
55 replies
CC#
Created by Adise on 4/6/2025 in #help
✅ Class instance reference
you're doing the same thing
55 replies
CC#
Created by Adise on 4/6/2025 in #help
✅ Class instance reference
@mtreit that's a closure problem with listener innit?
55 replies
CC#
Created by Adise on 4/6/2025 in #help
✅ Class instance reference
MessageListener<IPayload> wrapper = payload =>
{
if (payload is not null && payload.GetType() == payloadType)
{
// Use reflection to invoke the strongly-typed delegate
listener.DynamicInvoke(payload);
}
else
{
Debug.LogError($"Payload type mismatch for {packetId}. " +
$"Expected {payloadType}, got {payload?.GetType()}");
}
};
MessageListener<IPayload> wrapper = payload =>
{
if (payload is not null && payload.GetType() == payloadType)
{
// Use reflection to invoke the strongly-typed delegate
listener.DynamicInvoke(payload);
}
else
{
Debug.LogError($"Payload type mismatch for {packetId}. " +
$"Expected {payloadType}, got {payload?.GetType()}");
}
};
55 replies
CC#
Created by Adise on 4/6/2025 in #help
✅ Class instance reference
I thought you had an activator for some reason
55 replies
CC#
Created by Adise on 4/6/2025 in #help
✅ Class instance reference
oic what you're saying
55 replies
CC#
Created by Adise on 4/6/2025 in #help
✅ Class instance reference
each listener isn't going to be recreated every usage.
55 replies
CC#
Created by Adise on 4/6/2025 in #help
✅ Class instance reference
lock (_messageListenerslock)
{
if (messageListeners.TryGetValue(packetId, out _)) continue;

messageListeners.Add(packetId, wrapper);
}
lock (_messageListenerslock)
{
if (messageListeners.TryGetValue(packetId, out _)) continue;

messageListeners.Add(packetId, wrapper);
}
wrapper is sitting in a static dictionary
55 replies
CC#
Created by Adise on 4/6/2025 in #help
✅ Class instance reference
I could be reading it wrong, but I'm sorta wondering how'd you'd expect something different than what is happening.
55 replies
CC#
Created by Adise on 4/6/2025 in #help
✅ Class instance reference
I mean based on the code I'm seeing you have a private static method that "registers types", and it's adding to a private static list/dictionary, and in that scenario, when are you calling register handlers?
55 replies
CC#
Created by Adise on 4/6/2025 in #help
✅ Class instance reference
a closure captures scope, if it's intended that's great, if it's not...
55 replies
CC#
Created by Adise on 4/6/2025 in #help
✅ Class instance reference
no
55 replies