McSinyx / brutalmaze

Migrated to https://git.sr.ht/~cnx/brutalmaze
https://pypi.org/project/brutalmaze/
GNU Affero General Public License v3.0
11 stars 3 forks source link

Add c# client #9

Closed nghiaxlee closed 6 years ago

nghiaxlee commented 6 years ago

Hope it's not too ugly :)) (and useful in some ways)

nghiaxlee commented 6 years ago

Sorry, I did't think you will check this early and planned to add some words later. About the connection issue, for me, there isn't any problem with Connect(host, port), I just want to do it this way, also can you change AddressList[0] into [1] or [2] for me and check if it works? IMO, that's the problem. I will also update the code. If I forgot something you want to know, remind me. Btw, OP = overpower and did you use mono?

McSinyx commented 6 years ago

Thank you, merged. This looks perfect to me. I'm not sure about the AddressList thing (I'll experiment w/ it later) but if it need trial to work it's not safe enough I think. Thank you for explaining OP, I thought it was original post. And yes, I do use Mono because it just works out of box on GNU/Linux.

Edit: The problem was that IPv4 and IPv6 addresses are shuffled (at least on my machine) while Brutal Maze only supports IPv4 (should I extend support for IPv6, since there is still IPv4 backward-compatibility?):

$ csharp 
Mono C# Shell, type "help;" for help

Enter statements below.
csharp> using System.Net 
csharp> Dns.GetHostEntry("localhost").AddressList                                                  
{ ::1, 127.0.0.1 }                                                                                 
csharp> Dns.GetHostEntry("debian.org").AddressList                                                 
{ 5.153.231.4, 130.89.148.14, 149.20.4.15, 128.31.0.62, 2001:67c:2564:a119::148:14, 2001:41c8:1000:
21::21:4, 2001:4f8:1:c::15 }

Also I forgot to ask you to specify licensing (if that matters to you) in the header. I even forgot mine in the Python example.

nghiaxlee commented 6 years ago

I have no idea about license... could you help me and show me the meaning of it? Also last time I forgot to mention: command line arguments like "--help" "-c" don't work in cmd/powershell but seem ok in git bash/shell in my machine (Win 8.1). Lastly, if you want to bring this to a competition, I think it's better to make it more user-friendly (provide alternative way for installation, etc...). And thank for informing me about AddressList.

McSinyx commented 6 years ago

I have no idea about license... could you help me and show me the meaning of it?

From what I understand, if you distribute software without specified license, the software would be assumed under copyright of yours with default terms of disallowing any modification and redistribution, i.e. proprietary. In this particular case, that might not be what you want because this is an source template for other people to use. Although there is a AGPLv3 LICENSE file in the root directory of the project, the license doesn't apply to your code because (1) your commit it separate from the codebase and you retain the right on it and (2) licensing should/must be specified in the source file header. Also I would suggest not to use AGPL because it is very strict (requiring source code of modification - I needed it to make sure no one will selfishly benefits from what I grant to the public) - something like BSD or CC0 or even Public Domain would be more suitable in this case.

command line arguments like "--help" "-c" don't work in cmd/powershell

That is definitely a bug. Could you please file an issue on this so we can investigate further?

Lastly, if you want to bring this to a competition, I think it's better to make it more user-friendly (provide alternative way for installation, etc...).

I'm not very good at designing features, I have thought about things like HUD or interactive config, but they would break free resizing, which is the initial point of writing this (funny right, 1500LoC just to experiment with weird screen ratios). About the installation, there is #3 on Windows stand-alone installer, but I really need lots of help on this since I don't use Windows anymore, and seemingly there isn't any freezer can work on python packages (they only work with single source file last time I tried). I have a plan to write a makefile for *nix-like OS with eye-candies like launcher and icon and stuff, but yeah, it's not very user-friendly though.

Again, thank you for your contributions and suggestion. And good luck on your academic path (trust me, everybody needs luck, especially more scholarship oppotunities and such).