Patching

Do you want to help out with Freeciv development? Then check out this forum.
jwrober
Posts: 14
Joined: Thu Jul 11, 2019 2:05 pm

Patching

Postby jwrober » Tue Jan 21, 2020 10:03 pm

How does one patch an existing codebase? For example I have a gz of 2.6.1 and want to add these patches to it and test the impact on gameplay. I'm running Debian Linux if it matters.

http://www.hostedredmine.com/issues/683570
http://www.hostedredmine.com/issues/683571

I'm working on an update to mir3x's soundtrack (viewtopic.php?f=11&t=58672) and am working through some music playback issues.

Thanks in advance

Ignatus
Hardened
Posts: 271
Joined: Mon Nov 06, 2017 12:05 pm
Location: St.Petersburg, Russia
Contact:

Re: Patching

Postby Ignatus » Wed Jan 22, 2020 5:37 am

Connect the files to a git repository. If you don't want to download again, there is a way to create a bare repo and copy files there, scan the internet. Then follow git manpages. You can make pull requests or send patches to HRM, see https://freeciv.fandom.com/wiki/How_to_contribute

cazfi
Elite
Posts: 1749
Joined: Tue Jan 29, 2013 6:54 pm

Re: Patching

Postby cazfi » Wed Jan 22, 2020 2:18 pm

Neither of those issues seem to be resolved yet, there's no patches in those tickets (except a partial fix that is part of 2.6.1 already)

jwrober
Posts: 14
Joined: Thu Jul 11, 2019 2:05 pm

Re: Patching

Postby jwrober » Wed Jan 22, 2020 4:48 pm

cazfi wrote:Neither of those issues seem to be resolved yet, there's no patches in those tickets (except a partial fix that is part of 2.6.1 already)


The first one is certainly empty. Whiffed on that. I see patch attachments on the second one and don't see that code in the 2.6.1 in client/audio.c.

The issue I am running into is the client (any of them) only plays one music track in the array and then stops until the mood changes. Every once in a blue moon it will play two, but I have not been able to track down the parameters. I am running 2.6.1 "unpatched". I could manually adjust the files, but figured there was a better way. I will read the webpage provided by Ignatus first.

Thanks

cazfi
Elite
Posts: 1749
Joined: Tue Jan 29, 2013 6:54 pm

Re: Patching

Postby cazfi » Wed Jan 22, 2020 7:36 pm

If you don't use git, the command to use is 'patch -u -p1 -d freeciv < patch_file.patch', where 'freeciv' is the source directory and 'patch_file.patch' is the patch file.

cazfi
Elite
Posts: 1749
Joined: Tue Jan 29, 2013 6:54 pm

Re: Patching

Postby cazfi » Wed Jan 22, 2020 7:41 pm

jwrober wrote:I see patch attachments on the second one and don't see that code in the 2.6.1 in client/audio.c

The first line that the patch changes is replacing old 'bool excluded = FALSE;' line with 'int excluded = -1;'. 2.6.1 most definitely has the new 'int excluded = -1;' line (line 419, later changes have moved the line a bit since that particular patch was created)

jwrober
Posts: 14
Joined: Thu Jul 11, 2019 2:05 pm

Re: Patching

Postby jwrober » Wed Jan 22, 2020 11:19 pm

Thanks for the command. I was able to apply the patches and compile. No change in behavior. What is it that triggers the server to send a play music command to the client besides a change in mood?