profile
viewpoint

startedNeoAxis/NeoAxisEngine

started time in a day

CommitCommentEvent

Pull request review commentNexusForever/NexusForever

Entity/Core: Vitals, Spell Costing, Dash implementation

 public StatAttribute GetStatAttribute(Stat stat)         {             return statAttributes.TryGetValue(stat, out StatAttribute value) ? value : null;         }++        /// <summary>+        /// Return <see cref="VitalSetHandler"/> for supplied <see cref="Vital"/>.+        /// </summary>+        public VitalSetHandler GetVitalSetter(Vital vital)+        {+            if (!vitalSetters.TryGetValue(vital, out VitalSetHandler vitalProp))+            {+                log.Trace($"Unhandled Vital: {vital}");

Just a personal preference but using return null here is not required. vitalProp is null by default.

kirmmin

comment created time in 16 days

PullRequestReviewEvent

Pull request review commentNexusForever/NexusForever

Entity/Core: Vitals, Spell Costing, Dash implementation

 private void CalculateEntityAreaData()             log.Info($"Calculated area information for {entities.Count} {(entities.Count == 1 ? "entity" : "entities")}.");         } +        private void InitialiseEntityVitals()+        {+            var setterBuilder = ImmutableDictionary.CreateBuilder<Vital, VitalSetHandler>();+            var getterBuilder = ImmutableDictionary.CreateBuilder<Vital, VitalGetHandler>();++            foreach (PropertyInfo property in typeof(WorldEntity).GetProperties())+            {+                IEnumerable<VitalAttribute> vitalAttributes = property.GetCustomAttributes<VitalAttribute>();+                if (vitalAttributes.Count() == 0)+                    continue;++                VitalSetHandler @setterDelegate = (VitalSetHandler)Delegate.CreateDelegate(typeof(VitalSetHandler), null, property.GetSetMethod());

You should use names like vitalSetterDelegate or something like that. Only use @ stuff if it's really required.

kirmmin

comment created time in 16 days

PullRequestReviewEvent

Pull request review commentNexusForever/NexusForever

Entity/Core: Vitals, Spell Costing, Dash implementation

 public sealed class AssetManager : Singleton<AssetManager>         private ImmutableDictionary</*zoneId*/uint, /*tutorialId*/uint> zoneTutorials;         private ImmutableDictionary</*creatureId*/uint, /*targetGroupIds*/ImmutableList<uint>> creatureAssociatedTargetGroups; +        private Dictionary<DashDirection, uint /*spell4Id*/> dashSpells = new Dictionary<DashDirection, uint>+        {+            { DashDirection.Forward, 25295 },

Not sure if we love magic numbers?

kirmmin

comment created time in 16 days

PullRequestReviewEvent

Pull request review commentNexusForever/NexusForever

Entity/Core: Vitals, Spell Costing, Dash implementation

 private void InitialiseSpellEffectHandlers()             }         } +        private void InitialiseVitalCastResults()+        {+            var builder = ImmutableDictionary.CreateBuilder<Vital, CastResult>();++            foreach (FieldInfo field in typeof(CastResult).GetFields())+            {+                IEnumerable<CastResultVitalAttribute> attributes = field.GetCustomAttributes<CastResultVitalAttribute>();+                if (attributes.Count() == 0)

That check is not required, It won't loop through it there is nothing anyways.

kirmmin

comment created time in 16 days

PullRequestReviewEvent

issue commentdotnet/runtime

How to get single file extraction path in .NET 5.0?

This doesn't solve the issue of being able to cleanup data on app updates tho.

Why not? It's not automatically cleaned up for you, but it's a file like any other. You can delete it if you want.

What tom said!!!111!

tomrus88

comment created time in 20 days

issue commentdotnet/wpf

WPF apps, published with dotnet publish with arguments -p:PublishTrimmed=true or /p:IncludeAllContentInSingleFile=true fails to run

I'm seeing the same thing with RC1: image

It wasnt merged at the release of RC1. Try https://dotnetcli.blob.core.windows.net/dotnet/Sdk/release/5.0.1xx/dotnet-sdk-latest-win-x64.exe or any other later version than RC1

Gigas002

comment created time in 21 days

issue commentdotnet/runtime

How to get single file extraction path in .NET 5.0?

I want to include some data file (I need to have read/write access to this file, so resources is not an option) with my app and bundle in into single file

Our recommendation here is that you should write that file yourself to a temporary folder. This is much more robust and portable.

This doesn't solve the issue of being able to cleanup data on app updates tho.

tomrus88

comment created time in 21 days

issue commentdotnet/runtime

How to get single file extraction path in .NET 5.0?

there is NO reason to not implement loading native binaries from memory

Do you have pointers on how to do that? Windows doesn't have APIs for this. .NET 5 no longer extracts on Linux because there it's possible.

Handwritten PE loaders, while appearing to sort-of-work don't play well with the rest of Windows so things end up being broken in subtle and hard to troubleshoot ways (from unimportant things like the module not being visible in tools like Process Explorer, through not being able to debug the module with native debuggers, etc.).

I'm sure that mirroring LoadLibrary from in C# is no issue nowadays and works fine if implemented correctly. And that part would only be required for the actual native library that is shipped. All other native libraries that are required (like kernel32 etc.) for doing this can still be loaded with calls like LoadLibrary. I think there are already a bunch of libraries that even support doing that. Another way is to do it as runtime support with a c(++) implementation of course.

tomrus88

comment created time in 21 days

issue commentdotnet/runtime

How to get single file extraction path in .NET 5.0?

Related comment #43014 (comment)

https://github.com/dotnet/designs/blob/main/accepted/2020/single-file/design.md in .NET 5 anything except managed code will not be bundled in the application and should be left next to the main .exe.

It's only half related to that imo. Having native binaries not bundled into a bundle is really stupid design and there is NO reason to not implement loading native binaries from memory. It's possible, not hard to do and works fine. It's probably not even much effort to implement it in the current bundle process.

tomrus88

comment created time in 21 days

issue commentdotnet/roslyn

Wrong behavior when using records with primary constructors and inheritance?

To come back to the old Primary constructor behavior: is it possible to overwrite a auto constructor constructor in records. Something like this worked with old primary constructors (using an abstract class as base though):


public record IServerPacket(int netMessage)
{
    public Packet Packet { get; private set; }

    // Execute some code here...
    protected IServerPacket(int netMessage)
    {
        Packet = new Packet(netMessage, false);
    }

    public virtual void Write() { }
}

public record AuthResponse() : IServerPacket(1)
{
    public int Result { get; set; }

    public override void Write()
    {
        Console.WriteLine(Result);
    }
}```
Fabi

comment created time in 22 days

issue commentdotnet/runtime

How to get single file extraction path in .NET 5.0?

By default, in 5.0 the binaries are not extracted at all, so there is no extraction directory.

Native binaries are ALWAYS extracted.

tomrus88

comment created time in 22 days

Pull request review commentNexusForever/NexusForever

Combat/Threat: Threat Manager implementation

+using NexusForever.WorldServer.Game.Entity;+using System;+using System.Collections.Generic;+using System.Text;++namespace NexusForever.WorldServer.Game.Combat+{+    public class HostileEntity+    {+        public WorldEntity HaterOwner { get; private set; }+        public uint HatedTargetUnitId { get; private set; }+        public uint Threat { get; private set; }++        /// <summary>+        /// Create a new <see cref="HostileEntity"/> for the given <see cref="WorldEntity"/>.+        /// </summary>+        public HostileEntity(WorldEntity hater, WorldEntity target)+        {+            HaterOwner = hater;+            HatedTargetUnitId = target.Guid;+        }++        /// <summary>+        /// Modify this <see cref="HostileEntity"/> threat by the given amount.+        /// </summary>+        /// <remarks>+        /// Value is a delta, if a negative value is supplied it will be deducted from the existing threat if any.+        /// </remarks>+        public void AdjustThreat(int threatDelta)+        {+            Threat = (uint)Math.Clamp(Threat + threatDelta, 0u, uint.MaxValue);+        }++        /// <summary>+        /// Returns the <see cref="WorldEntity"/> that this <see cref="HostileEntity"/> is associated with.+        /// </summary>+        public WorldEntity GetEntity(WorldEntity requester)+        {+            if (requester == null || requester.Map == null)+                return null;++            return requester.Map.GetEntity<WorldEntity>(HatedTargetUnitId);

Don't listen to Max. He doesn't know what's good

kirmmin

comment created time in 23 days

PullRequestReviewEvent

issue commentdotnet/roslyn

Wrong behavior when using records with primary constructors and inheritance?

Just tested it. works through .NET 5 RC2 command line building but not in Visual Studio Preview.

Fabi

comment created time in 25 days

issue commentdotnet/roslyn

Wrong behavior when using records with primary constructors and inheritance?

When you use record R2() : R1(1), it will give you Error CS8850 A positional record must have a non-empty parameter list

Yea thats what I ment with Currently it seems that R2 that R1 got an empty constructor defined and R1 expects R2 to have an argument list that matches the given one.

() would be old behavior too tho

Fabi

comment created time in 25 days

issue openeddotnet/roslyn

Wrong behavior when using records with primary constructors and inheritance?

In the latest .NET 5 preview I played around with records and noticed a for me unexpected behavior.

Given 2 records

record R1(int P1);
record R2 : R1(1);

This will result in image and image

My expectation would have been that the old behavior of the first version of primary constructors would still work here. Old behavior = It would call the constructor of R1 with the value 1 and creates R2 with the default ctor call.

Currently it seems that R2 that R1 got an empty constructor defined and R1 expects R2 to have an argument list that matches the given one.

record R1(int P1);
record R2(int P1) : R1(1);

would work but this actually doesn't make any sense for me.

created time in 25 days

issue commentdotnet/runtime

.NET 5 Linux Trimming Error

Yea that's pretty annoying that's true.

jjxtra

comment created time in a month

issue commentdotnet/runtime

.NET 5 Linux Trimming Error

The file version is 0.0.0.0. It is not part of any of my nuget packages that I can tell. How would I go about excluding this? It feels like a phantom file given the version...

Is this working? I got similar problems using that and stuff like that fixed many issues for me

<ItemGroup>
      <TrimmerRootAssembly Include="mscorlib" />
      <TrimmerRootAssembly Include="netstandard" />
</ItemGroup>
jjxtra

comment created time in a month

issue commentdotnet/runtime

.NET 5 Linux Trimming Error

Publishing my app to Ubuntu with Linux-x64 platform using .NET 5 RC 1. Trimming is ON, single file is off.

Upon startup, I get this error:

Error Exception: System.IO.FileNotFoundException: Could not load file or assembly 'System.Runtime, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'. The system cannot find the file specified.

File name: 'System.Runtime, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'
   at Microsoft.Extensions.Hosting.GenericHostWebHostBuilderExtensions.ConfigureWebHost(IHostBuilder builder, Action`1 configure)

This error does not happen with .net core 3.1 with trimming enabled.

Exclude that file from trimming

jjxtra

comment created time in a month

issue commentdotnet/roslyn

Roslyn produces wrong code for huge switch expression

Declaring (1, 1, 1, 1, 1, 1, 1, 1) in a new variable and switching into it actually works 🤔

sys27

comment created time in a month

CommitCommentEvent

issue commentdotnet/installer

Broken assets for WPF

Please try with RC1 and VS preview 3 when available as we believe we fixed it.

RC1 and VS preview 3 are not available yet. So why this bug is closed?

They are :D

VassilSanych

comment created time in a month

issue commentdotnet/wpf

WPF apps, published with dotnet publish with arguments -p:PublishTrimmed=true or /p:IncludeAllContentInSingleFile=true fails to run

WPF apps in the latest preview fail in general for me when I publish them. This issue comes up as soon as you enable single file publish or trimming. Error:

CoreCLR Version: 5.0.20.40711 .NET Version: 5.0.0-preview.8.20407.11 Description: The process was terminated due to an unhandled exception. Exception Info: System.TypeInitializationException: The type initializer for 'System.Windows.Threading.Dispatcher' threw an exception. ---> System.IO.FileNotFoundException: The system cannot find the file specified. (0x80070002) at System.Reflection.RuntimeModule.GetFullyQualifiedName(QCallModule module, StringHandleOnStack retString) at System.Reflection.RuntimeModule.GetFullyQualifiedName() at System.Reflection.RuntimeModule.get_Name() at System.Windows.WpfDllVerifier.VerifyWpfDllSet(String[] additionalDlls) at System.Windows.Threading.Dispatcher..cctor() --- End of inner exception stack trace --- at System.Windows.Threading.Dispatcher.get_CurrentDispatcher() at System.Windows.Threading.DispatcherObject..ctor() at System.Windows.Application..ctor() at Arctium.App.Installer.App..ctor() at Arctium.App.Installer.App.Main()

Gigas002

comment created time in 2 months

push eventArctium/Lappa-ORM

Fabian

commit sha cbdc2efa48354ac8a3873118747e207bf5ce6ce0

Don't prepare statements before all parameters have been added. Update package references.

view details

push time in 2 months

issue commentdotnet/installer

Broken assets for WPF

Can confirm that (probably wrong repo for the issue tho?)

VassilSanych

comment created time in 2 months

more