Skip to content

Mac client #5

Open
poma opened this issue Aug 30, 2017 · 16 comments
Open

Mac client #5

poma opened this issue Aug 30, 2017 · 16 comments

Comments

@poma
Copy link
Member

poma commented Aug 30, 2017

Looks like many users are requesting it so this is high priority.

I think it should be a pretty easy task. Main logic is contained in Hotsapi.Uploader.Common and Heroes.ReplayParser which should be converted to .NetStandard projects, they have almost no dependencies so it's unlikely this introduces any errors. Mac client then can be targeting .NET Core, and some UI framework that provides native look in OS (xwt/Eto.Forms or Xamarin.Forms).

UI project is designed to be minimal and handle only OS-specific tasks. Here's responsibilities of windows project:

  • Setup
  • Auto update
  • Tray icon
  • Start with windows
  • Bind to Manager.Files's ObservableCollection and display its contents
  • File storage (NLog config, path to replays.xml, settings storage)
@poma poma mentioned this issue Aug 30, 2017
@idooo
Copy link

idooo commented Sep 16, 2017

Hi, my C# is bad so I can't help here but I quickly wrote my own uploader using Node.js + Electron https://github.com/idooo/hotsapi-electron-uploader

I don't know how relevant is that thing =) but at least for now it can be used by mac users

@poma
Copy link
Member Author

poma commented Sep 16, 2017

Nice, I'll mention it in my next update post. There also a pending pull request to a cross-platform hotslogs uploader eivindveg/HotSUploader#162 to support hotsapi.

@GregAlexJames
Copy link

Quick question, do you have any preferences for UI technologies. Options looks as per follows:

Xamarin.Mac
Pros: Native UI for Mac
Cons: Have to learn another UI paradigm (different to XAML, uses storyboards etc)
Not Cross Platform

Xamarin.Forms
Pros: Cross Platform (but not with WPF)
Similar UI paradigm to XAML
Cons: Still in Beta
Higher risk of issues / Small UI nuances

xwt/Eto.Forms
Pros: Cross Platform (including WPF)
Cons: Different UI paradigm to XAML
Higher risk of issues / small UI nuances

Looking at the existing code the UI portion is very small. Given that you already have a WPF version, I do not see the point of having a cross platform UI. My gut feel is to use Xamarin.Mac for the UI, but the others should be easy enough. Which one that should be used is up to you though, as the biggest thing is that it needs to be something that you can maintain going forward (hence Xamarin.Forms may be better for you as it more closely follows XAML paradigm / databinding etc that it looks like you are experienced with).

Last note, I have experience with Xamarin.Mac, and Xamarin.Forms for iOS / Android. I have no experience with Eto.Forms so do not truely know how good or bad it works.

@koliva8245
Copy link

There's also AvaloniaUI which is a cross platform XAML (like WPF). However it is in alpha.

@poma
Copy link
Member Author

poma commented Sep 24, 2017

I only have a requirement that UI for mac should have native look.

I don't mind learning any new frameworks, our UI is pretty simple so I think I will be able to maintain any framework. I don't have experience with any of them so it's your choice. Probably Xamarin.Mac is the way to go.

@poma
Copy link
Member Author

poma commented Sep 30, 2017

#18 is done

@Sonix
Copy link

Sonix commented Oct 23, 2017

I looked into it this evening and got most things set up. It looks like NLog, which is used in Common, isn't compatible with Xamarin.Mac though. I have to say that I'm more experienced in writing native Mac/iOS-Apps and not very familiar with Mono/Xamarin/Xamarin.Mac so maybe this isn't an issue and i just couldn't figure out which thing I have to press (Visual Studio for Mac is pretty awful). I'll continue tomorrow, but maybe someone has a hint for me?

Is Nlog as a logging framework set in stone or could we maybe migrate to another one if thats really the problem?

@poma
Copy link
Member Author

poma commented Oct 24, 2017

We can migrate to log4net. It's almost the same except configs are less intuitive and I didn't work with it before. Brief googling says that it is supported on Xamarin.Mac (need to check though)

But first let's try to google what's up with NLog, it's a major framework I thought it should support most platforms.

@Sonix
Copy link

Sonix commented Oct 24, 2017

It does support most platforms, but Xamarin.Mac ist curiously missing in the Support section here: http://nlog-project.org/

This StackOverflow-Questions suggests to just use log4net: https://stackoverflow.com/questions/28282850/is-there-any-way-to-use-nlog-or-log4net-in-a-xamarin-mac-project

Maybe this here is an approach that could work? I'm not sure since I don't know enough about that stuff: https://martynnw.wordpress.com/2016/10/16/logging-with-nlog-in-xamarin-forms/

Anyway, will try to work around logging for now (maybe by disabling it for the time being) and try to get a bare bones app to work.

@poma
Copy link
Member Author

poma commented Oct 25, 2017

I found a good way to work around logging compatibility - use Microsoft.Extensions.Logging

@ghost
Copy link

ghost commented Nov 9, 2017

I'm taking a crack at this. I'll post updates on Wednesdays.

@poma
Copy link
Member Author

poma commented Nov 23, 2017

So far 2 people tried to port this on Mac and then disappeared. Is there some common reason for this?

@dcasadevall
Copy link

I am not sure about the reason, but I would be interested in helping. I can develop in native or Xamarin. No real preference. (Though I personally would prefer avoiding locking a project to a third party framework).

@MGatner
Copy link

MGatner commented Jun 8, 2018

I've been working with Heroes Share on a native (Swift) macOS app for multi-provider uploads. This would likely be proprietary but I want to make sure the community edition doesn't die. I checked with eivindveg on plans for multi-provider support (eivindveg/HotSUploader#162), but also curious if anything came from @dcasadevall ?

@rjnienaber
Copy link

rjnienaber commented Dec 1, 2019

Is this still a high priority? It seems like there are other mac alternatives (e.g. Stats of the Storm, though it doesn't monitor the replay folder). Perhaps we should redirect users there?

@poma
Copy link
Member Author

poma commented Dec 1, 2019

Well there are not that many tasks for uploader in general, so compared to other uploader tasks this one is fairly important. The core part that parses and upload replays are pretty well optimized (for CPU and traffic) and it would be cool to see its benefits in OS X too. But yeah probably we need to add a link to some mac alternative to our website until this is implemented.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

8 participants