[patch] Clipboard (a/k/a "Copy and Paste")

Forum for technical discussions regarding development. If you have a general suggestion, problem or comment, please use one of the other forums.

Moderator: OpenTTD Developers

McDeffice
Engineer
Engineer
Posts: 10
Joined: 26 May 2012 23:13

Re: [patch] Clipboard (a/k/a "Copy and Paste")

Post by McDeffice »

kamnet wrote: 03 Feb 2020 05:26 You're attempting to apply a patch written for OpenTTD 1.8.0 (over 2 years ago) against OpenTTD 1.9.3 (several months ago). Source code is continually updated. In order to successfully apply this patch you will first need to update the patch to match the changes in the source code. The failed lines will give you a clue as to what's changed. You'll probably need to analyze the 1.8.0 code to figure that out.

Also, if you apply a patch against OpenTTD 1.9.3, it no longer is technically version 1.9.3, and it will not be compatible with other 1.9.3 clients. It's best to apply it against a nightly, so at least you get the benefits of game improvements and bug fixes.
Thank you for your response and this information.
I have some knowledge of English, sorry if I misunderstand or speak poorly. excuse me.
Indeed the code is updated continuously. An OpenTTD version 1.10.0-beta2 is available. https://www.openttd.org/downloads/opent ... sting.html

I understand that if I modify the code - with a patch - The client is that technically it no longer has the same version, an improvement is to be made. does this mean that this version is no longer compatible with other Openttd Clients of the same original version?

I am thinking of communities such as n-ice or btpro which modify the connection interface as well as some aspects of the client side of the game. This client remains recognized as version 1.9.3 and allows connection to servers 1.9.3. No verification of checksums is carried out.


The patch I'm trying to apply is for version 1.8.0 at least two years ago.

In the meantime, some lines that the patch trying to match may have moved or been changed. This explains why the patch does not know how to carry out the insertion of code to implant the clipboard in several files.

Is the solution to look at the lines that the patch can no longer find and modify so that it can return to where the modifications are to be made?

Or is it some more complicated things because between 1.8.0 and 1.9.3 the coding style to change and functionality have been completely replaced? Perhaps dependencies that have evolved and the way of typing to change?
User avatar
jfs
Tycoon
Tycoon
Posts: 1249
Joined: 08 Jan 2003 23:09
Location: Denmark

Re: [patch] Clipboard (a/k/a "Copy and Paste")

Post by jfs »

There's been several changes to code style standards since 1.8, which will make most old patches unable to apply. There's also many new features that have touched files and functions all across the code, which patches will need to be adjusted to. Making it work again might need rewriting large parts of the code.
staale
Engineer
Engineer
Posts: 2
Joined: 30 Apr 2020 16:01

Re: [patch] Clipboard (a/k/a "Copy and Paste")

Post by staale »

I have managed to rebase 1.10.0 on top of the 1.8 version with the clipboard patch, and have pushed this to my own github:

https://github.com/staale/OpenTTD/tree/clipboard-1.10.0

I have just briefly tested this, and it works for me. I will try and play a bit more with it to see if I encounter any more errors. There where about 1300 commits to rebase, and quite a few merge errors. I am not a C++ developer, so I had to make a best effort to fix things. However, everything compiles now, and I have installed it in Manjaro via the openttd-git package there. I will report back if I continue to develop this, or find any issues.
agentw4b
Traffic Manager
Traffic Manager
Posts: 180
Joined: 14 Apr 2017 15:51
Location: Czech Republic

Re: [patch] Clipboard (a/k/a "Copy and Paste")

Post by agentw4b »

staale wrote: 30 Apr 2020 16:07 I have managed to rebase 1.10.0 on top of the 1.8 version with the clipboard patch, and have pushed this to my own github:

https://github.com/staale/OpenTTD/tree/clipboard-1.10.0

I have just briefly tested this, and it works for me. I will try and play a bit more with it to see if I encounter any more errors. There where about 1300 commits to rebase, and quite a few merge errors. I am not a C++ developer, so I had to make a best effort to fix things. However, everything compiles now, and I have installed it in Manjaro via the openttd-git package there. I will report back if I continue to develop this, or find any issues.
Could you make an .exe file for people who can't compile and patch the program?
Owner and admin of servers:Experimental games 01 (92.63.57.152:3979), Experimental games 02 (92.63.57.152:3879), Experimental games 03 (92.63.57.152:3779), Experimental games 04 (92.63.57.152:3679), Experimental games 05 (92.63.57.152:3579).
My heightmaps: Flat Earth Map and United nations logo
My scenarios: Game Fallout 1,2,3 Map scenario
My gamescripts: City Founder GS
staale
Engineer
Engineer
Posts: 2
Joined: 30 Apr 2020 16:01

Re: [patch] Clipboard (a/k/a "Copy and Paste")

Post by staale »

agentw4b wrote: 30 Apr 2020 18:24 Could you make an .exe file for people who can't compile and patch the program?
Unfortunately it crashed pretty quickly once I tried to copy and paste some larger structures.

I will see if I can make an exe - though I am not sure how as I currently play this on linux.
agentw4b
Traffic Manager
Traffic Manager
Posts: 180
Joined: 14 Apr 2017 15:51
Location: Czech Republic

Re: [patch] Clipboard (a/k/a "Copy and Paste")

Post by agentw4b »

staale wrote: 01 May 2020 06:14

Unfortunately it crashed pretty quickly once I tried to copy and paste some larger structures.

I will see if I can make an exe - though I am not sure how as I currently play this on linux.
Eventually I created openttd.exe from your application source, but quite often the game crashes, so it's not completely fixed.
But when I have an almost blank map without industry and few cities, it works and that's enough for me. Thank you and I am putting here to download a compiled program in the form of a ZIP for Windows 10 64bit. But I can't guarantee it will work on all computers because I'm not a programmer and I can't fix these things.
clipboard.zip
(20.05 MiB) Downloaded 51 times
Owner and admin of servers:Experimental games 01 (92.63.57.152:3979), Experimental games 02 (92.63.57.152:3879), Experimental games 03 (92.63.57.152:3779), Experimental games 04 (92.63.57.152:3679), Experimental games 05 (92.63.57.152:3579).
My heightmaps: Flat Earth Map and United nations logo
My scenarios: Game Fallout 1,2,3 Map scenario
My gamescripts: City Founder GS
agentw4b
Traffic Manager
Traffic Manager
Posts: 180
Joined: 14 Apr 2017 15:51
Location: Czech Republic

Re: [patch] Clipboard (a/k/a "Copy and Paste")

Post by agentw4b »

agentw4b wrote: 06 May 2020 09:09
staale wrote: 01 May 2020 06:14

Unfortunately it crashed pretty quickly once I tried to copy and paste some larger structures.

I will see if I can make an exe - though I am not sure how as I currently play this on linux.
Eventually I created openttd.exe from your application source, but quite often the game crashes, so it's not completely fixed.
But when I have an almost blank map without industry and few cities, it works and that's enough for me. Thank you and I am putting here to download a compiled program in the form of a ZIP for Windows 10 64bit. But I can't guarantee it will work on all computers because I'm not a programmer and I can't fix these things.

clipboard.zip
I'm sorry, but this is not a suitable exe. Unfortunately, the game crashes very often. I will probably have to wait for someone to properly adapt the patch to the new versions of OpenTTD :-(
Owner and admin of servers:Experimental games 01 (92.63.57.152:3979), Experimental games 02 (92.63.57.152:3879), Experimental games 03 (92.63.57.152:3779), Experimental games 04 (92.63.57.152:3679), Experimental games 05 (92.63.57.152:3579).
My heightmaps: Flat Earth Map and United nations logo
My scenarios: Game Fallout 1,2,3 Map scenario
My gamescripts: City Founder GS
User avatar
Torben DH
Transport Coordinator
Transport Coordinator
Posts: 291
Joined: 31 Dec 2004 09:09
Location: Denmark

Re: [patch] Clipboard (a/k/a "Copy and Paste")

Post by Torben DH »

agentw4b wrote: 06 May 2020 10:24
agentw4b wrote: 06 May 2020 09:09
staale wrote: 01 May 2020 06:14

Unfortunately it crashed pretty quickly once I tried to copy and paste some larger structures.

I will see if I can make an exe - though I am not sure how as I currently play this on linux.
Eventually I created openttd.exe from your application source, but quite often the game crashes, so it's not completely fixed.
But when I have an almost blank map without industry and few cities, it works and that's enough for me. Thank you and I am putting here to download a compiled program in the form of a ZIP for Windows 10 64bit. But I can't guarantee it will work on all computers because I'm not a programmer and I can't fix these things.

clipboard.zip
I'm sorry, but this is not a suitable exe. Unfortunately, the game crashes very often. I will probably have to wait for someone to properly adapt the patch to the new versions of OpenTTD :-(
I have used this exe for the last couple of weeks and not experiencing many crashes.

But dont copy bridges and tunnels or it will crash.

For some reason ctrl+build station is broken.
TDH
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 18 guests