Contributing?

Post Reply
TubeAlloy
Posts: 141
Joined: Wed Mar 04, 2009 4:07 am
Location: Ireland

Contributing?

Post by TubeAlloy »

Apologies if this is the wrong place to post, I'm going off of the sourceforge support page which directs here.

I'd like to offer a hand with mekwars development. I played on the server 6-7 years ago while I was in college and I'm a fairly experienced developer at this point so I'd like to start giving something back to the project.

I've got the server and client building and my IDE set up to debug. I had a look on sourceforge but I can't find any unassigned issues raised in the last few years. Is there a separate bugzilla or jira server?

If anyone can point me towards a few starter issues or an easy enough feature request I'd be happy to look at it.

Also is there a contributing.md or similar in the code? I can't seem to find anything and I'm wondering about things like java version ( 1.7 is set in build.xml so I assume no streams or lambdas for now ), merge workflow, preferred code formatting and all that sort of stuff.

Spork
Mekwars Developer
Posts: 3901
Joined: Wed Feb 13, 2008 10:23 pm

Re: Contributing?

Post by Spork »

Erm...

Well, the first thing you will find is that the rest of us are *not* experienced developers. I learned java to work on this project.

Pick a bug or a feature that interests you and shoot me a patch.

Code: Select all

Also is there a contributing.md or similar in the code? I can't seem to find anything and I'm wondering about things like java version ( 1.7 is set in build.xml so I assume no streams or lambdas for now ), merge workflow, preferred code formatting and all that sort of stuff.
I don't know what you just typed, except the formatting thing. :)
Never had much, grew up with nothing
But the music, well it was something
Been down and out, I've been on top of the world,
World that keeps on spinning on a turntable.

TubeAlloy
Posts: 141
Joined: Wed Mar 04, 2009 4:07 am
Location: Ireland

Re: Contributing?

Post by TubeAlloy »

Cheers, is it just the list of 25 or so things on sourceforge or is there somewhere else issues are reported? I'm just worried the older issues will not be reproducible.

Once a milestone has been set can I assume it's already assigned even if a dev isn't on the ticket? For example I see two with you as owner but two others set to "working on it" with no owner.

I'm at work and have something on this evening so it will be tomorrow evening before I get started.

Spork
Mekwars Developer
Posts: 3901
Joined: Wed Feb 13, 2008 10:23 pm

Re: Contributing?

Post by Spork »

Bugs are often just reported in the MekWars Support forum here.
Never had much, grew up with nothing
But the music, well it was something
Been down and out, I've been on top of the world,
World that keeps on spinning on a turntable.

TubeAlloy
Posts: 141
Joined: Wed Mar 04, 2009 4:07 am
Location: Ireland

Re: Contributing?

Post by TubeAlloy »

Thanks I'll start looking into viewtopic.php?f=10&t=8811&p=64208#p64208

TubeAlloy
Posts: 141
Joined: Wed Mar 04, 2009 4:07 am
Location: Ireland

Re: Contributing?

Post by TubeAlloy »

Making good progress, it looks like the permission level is reset to 200 after reloading data instead of the 2 that it's at when you initially log in.

Is there any trick to reconnecting to the client after timing out? It keeps going all funny on me if I debug the process for too long.

Also is there any better place to discuss work in progress and options for fixes with other devs?

TubeAlloy
Posts: 141
Joined: Wed Mar 04, 2009 4:07 am
Location: Ireland

Re: Contributing?

Post by TubeAlloy »

As far as I can tell the issue with the linked bug is that the CampaignData constructor using a binary stream does not load the commands so everything defaults to 200 meaning that the user does not have permissions to open the build tables and the caught exception loads it to the misc tab.

I haven't worked with binary streams before, is there a trick to reading them in a debugger? The constructor in question is line 459 of src\common\CampaignData.java

TubeAlloy
Posts: 141
Joined: Wed Mar 04, 2009 4:07 am
Location: Ireland

Re: Contributing?

Post by TubeAlloy »

Ok I've got a fix tested and working for the commands not being populated which fixes the build table issue, I'm a bit worried though as it seems other data isn't being populated by the reload data correctly. Also since I'm loading the commands in the getAllData() they're actually being loaded twice on client start-up.

I've attached a screenshot from my debugger, all of the objects with a 0 next to them are not being loaded by the reloaded data. The fix should be easy enough, the problem is I'm not sure how to test them in the GUI. Would you like me to submit a patch for the build table and raise a separate issue to investigate this stuff or how do you want to sort this?

The get it working now patch is simple, just add 'getAccessLevels(data);' at line 545 of src\client\protocol\DataFetchClient.java, however I think it might be worth untangling and refactoring some of this area to prevent double reads.
Attachments
Data not being populated by the getAllData method
Data not being populated by the getAllData method
DataNotPopulated.JPG (29.15 KiB) Viewed 5647 times

Spork
Mekwars Developer
Posts: 3901
Joined: Wed Feb 13, 2008 10:23 pm

Re: Contributing?

Post by Spork »

ServerBannedAmmo, bannedTargetingSystems, planetOpFlags would not surprise me to be empty, depending on how you have your server configured.

serverConfigs, though...
Never had much, grew up with nothing
But the music, well it was something
Been down and out, I've been on top of the world,
World that keeps on spinning on a turntable.

Spork
Mekwars Developer
Posts: 3901
Joined: Wed Feb 13, 2008 10:23 pm

Re: Contributing?

Post by Spork »

TubeAlloy wrote:Making good progress, it looks like the permission level is reset to 200 after reloading data instead of the 2 that it's at when you initially log in.

Is there any trick to reconnecting to the client after timing out? It keeps going all funny on me if I debug the process for too long.

Also is there any better place to discuss work in progress and options for fixes with other devs?
Hahaha. You said "other devs."

There is me. BarukKhazad has submitted quite a few patches recently.

I'm adding your patch now. Feel free to refactor.

And send me your sourceforge info.
Never had much, grew up with nothing
But the music, well it was something
Been down and out, I've been on top of the world,
World that keeps on spinning on a turntable.

TubeAlloy
Posts: 141
Joined: Wed Mar 04, 2009 4:07 am
Location: Ireland

Re: Contributing?

Post by TubeAlloy »


TubeAlloy
Posts: 141
Joined: Wed Mar 04, 2009 4:07 am
Location: Ireland

Re: Contributing?

Post by TubeAlloy »

I'll be spending some time this weekend getting to know the code and attempting some refactoring around the data loading.

1) Unless I'm missing something it looks like there aren't any unit tests, would you be opposed to the possibility of adding some?
2) Is there some sort of handy test data available that I can invoke to set up an account, some planets, some mechs etc.? If not how do you recommend testing fixes that require a fairly large amount of set-up to reproduce the problem?

TubeAlloy
Posts: 141
Joined: Wed Mar 04, 2009 4:07 am
Location: Ireland

Re: Contributing?

Post by TubeAlloy »

I created some pages in the wiki for future reference and I was starting to refactor the command reloading stuff when I noticed a duplicate code warning. The DataFetchClient for client and for dedicatedhost is nearly identical, do you know is there a reason why dedicatedhost isn't a part of the client code with a different jar generated? It could make things a lot neater if we bring the ded into the client package and have a common client-level package for this kind of stuff.

I also noticed reloadData in MWClient does not seem to reload the access levels so would probably have the same issue when invoked. I'd like to pull all of the data reloading stuff out of MWClient and push it into the datafetcher but I'm worried that since this stuff has not been reloaded to date it could uncover a lot of bugs, aside from the major refactoring involved.

Do we have an experimental branch that I can switch to for refactoring or can we create one if not?

Let me know if we have a chat area or a mailing list so that I can stop polluting the forums :) I signed up for the Mekwars dev mailing list but I don't think that's been approved yet

Spork
Mekwars Developer
Posts: 3901
Joined: Wed Feb 13, 2008 10:23 pm

Re: Contributing?

Post by Spork »

OK, there is now a forum for MW Developers

Server Operators have write, devs have write, the rest of the world has read.

As far as your other questions:

[*]We have no mailing list. There are the ones from Sourceforge, but they predate me and I do not have the passwords to administer them. I am perfectly willing to set one up here, though.
[*]Re: unit tests - yes, they are a great idea. Had I any actual programming education, they would already be set up, but I don't know the first thing about them. Feel free
[*]Re: test branch - go for it. I have given you commit rights at SF.
Never had much, grew up with nothing
But the music, well it was something
Been down and out, I've been on top of the world,
World that keeps on spinning on a turntable.

TubeAlloy
Posts: 141
Joined: Wed Mar 04, 2009 4:07 am
Location: Ireland

Re: Contributing?

Post by TubeAlloy »

Great, thanks for that. I've set up the development branch and I'll start refactoring the loading stuff tomorrow or maybe later tonight if I'm bored. I've no idea how long it will take me but don't expect anything in the next few days :P

Would you like me to send you patches before I commit to the dev branch to review or will I just commit and we can roll back if you don't like something I put into the branch?

Spork
Mekwars Developer
Posts: 3901
Joined: Wed Feb 13, 2008 10:23 pm

Re: Contributing?

Post by Spork »

Just go ahead and do it.
Never had much, grew up with nothing
But the music, well it was something
Been down and out, I've been on top of the world,
World that keeps on spinning on a turntable.

BarukKhazad
MegamekNET Moderator
Posts: 329
Joined: Mon Nov 21, 2011 10:56 pm

Re: Contributing?

Post by BarukKhazad »

Hiya. I have been adding minor patches for bugs I have seen during gameplay. I've written plenty of code over the years but as part of a back office automation group, not as a professional developer, and always in non-object oriented languages. I have the programming concepts but expressing them in Java is difficult.

TubeAlloy
Posts: 141
Joined: Wed Mar 04, 2009 4:07 am
Location: Ireland

Re: Contributing?

Post by TubeAlloy »

Good to meet you :)

Personally I went back to college ~7 years ago after many years in tech support and did a computer science course. I've been working as a web programmer for roughly the last 4 years. My first year was working on Java portlets, the 2 years after that I was on AngularJS and NodeJS and for the past couple of months I've been working with Groovy/Java on a new back-end server.

I'm very familiar with Java but I don't know all of the design patterns. Also I haven't worked with Swing since college since everything was thread based and my file IO and threading is rusty as hell. I'm happy to help out and try to teach what I know while I'm working on stuff and please don't hesitate to ask me about anything I do that you're not sure of in the code. I don't want to start working on the project and commit a lot of stuff that people are uncomfortable with.

BarukKhazad
MegamekNET Moderator
Posts: 329
Joined: Mon Nov 21, 2011 10:56 pm

Re: Contributing?

Post by BarukKhazad »

The worst thing that happens is a reversion or a fix... write code freely and make it right by your standards. :)
I had opinions/That didn't matter/I had a brain/That felt like pancake batter
I got a backyard/With nothing in it/Except a stick/A dog/And a box with something in it
The hardest button to button/ /The hardest button to button/ /The hardest button to button

Post Reply