Botspot / pi-apps

Raspberry Pi App Store for Open Source Projects
GNU General Public License v3.0
1.95k stars 204 forks source link

DDnet #1093

Closed Kolpixx closed 2 years ago

Kolpixx commented 2 years ago

Is this app installable with sudo apt install?

Yes but the apt Version is outdated.

If you've created a zip file for this app, upload it here DDnet.zip

I did not tested it on x64 but im shure it will also work there. I will try it later today or tomorrow. And when it works i will send a ZIP File with the install script for x64 (i think it's the same as for 32x xD)

Here is the newest Version:

https://github.com/Botspot/pi-apps/issues/1093#issuecomment-955682513

Crilum commented 2 years ago

When I renamed the install-32 to install, it compiled successfully on arm64, which is good, but the desktop file dosen't work. On a armhf container (vdesktop) same thing.

But, DDNet can't connect to the internet because of a firewall or something:

[2021-10-28 08:40:28][engine/mastersrv]: refreshing master server addresses
[2021-10-28 08:40:28][host_lookup]: host='master1.teeworlds.com' port=0 3
[2021-10-28 08:40:28][register]: refreshing ip addresses
[2021-10-28 08:40:28][host_lookup]: host='master2.teeworlds.com' port=0 3
[2021-10-28 08:40:28][host_lookup]: host='master3.teeworlds.com' port=0 3
[2021-10-28 08:40:28][host_lookup]: host='master4.teeworlds.com' port=0 3
[2021-10-28 08:40:29][engine/mastersrv]: saving addresses
[2021-10-28 08:40:29][register]: fetching server counts
[2021-10-28 08:40:30][regsixup]: ERROR: the master server reports that clients can not connect to this server.
[2021-10-28 08:40:30][regsixup]: ERROR: configure your firewall/nat to let through udp on port 8303.
[2021-10-28 08:40:34][register]: chose 'master4.teeworlds.com' as master, sending heartbeats
[2021-10-28 08:40:35][register]: ERROR: the master server reports that clients can not connect to this server.
[2021-10-28 08:40:35][register]: ERROR: configure your firewall/nat to let through udp on port 8303.
[2021-10-28 08:40:45][regsixup]: ERROR: the master server reports that clients can not connect to this server.
[2021-10-28 08:40:45][regsixup]: ERROR: configure your firewall/nat to let through udp on port 8303.
[2021-10-28 08:40:50][register]: ERROR: the master server reports that clients can not connect to this server.
[2021-10-28 08:40:50][register]: ERROR: configure your firewall/nat to let through udp on port 8303.
[2021-10-28 08:41:05][register]: ERROR: the master server reports that clients can not connect to this server.
[2021-10-28 08:41:05][register]: ERROR: configure your firewall/nat to let through udp on port 8303.
[2021-10-28 08:41:06][regsixup]: ERROR: the master server reports that clients can not connect to this server.
[2021-10-28 08:41:06][regsixup]: ERROR: configure your firewall/nat to let through udp on port 8303.
[2021-10-28 08:41:10][regsixup]: WARNING: Master server is not responding, switching master
[2021-10-28 08:41:11][engine/mastersrv]: refreshing master server addresses
[2021-10-28 08:41:11][host_lookup]: host='master1.teeworlds.com' port=0 3

I get that on arm64 and armhf.

I don't think I have a firewall though, unless RPiOS comes with one...

I updated your install scripts with some bug fixes and stuff: DDnet.zip

Crilum commented 2 years ago

It also might be a good idea to add a little bit more information about DDNet in description. I couldn't really tell what it was from the description...

Kolpixx commented 2 years ago

Thank you for fixing Bugs. I updated your File and edited the Description of the App. Also the Problem that you can't connect is a Problem with your Router Settings i think. I found this in the Internet this might help you. https://www.teeworlds.com/forum/viewtopic.php?id=10253

Here is the file: DDnet.zip

Crilum commented 2 years ago

Thanks. I can't do anything about my router at the moment, but thanks anyway! :smile: The description is wayyy better, but this is a server, isn't it? Or is it just the game and I misunderstood the Terminal output.. :+1:

Kolpixx commented 2 years ago

This is the Game and also the Server (it's saved under ~/ddnet/build/DDnet-Server i think i'm currently on my Phone so im Not shure) but i only Made a Desktop entry for the Game Client because i was to lazy to make a Desktop entry for the Server. But i can do it later.

And i only copied the description from their Website hehe 😅

Crilum commented 2 years ago

Well, their website has a good description then! :laughing:

Kolpixx commented 2 years ago

I just tested if the Server works and i had the same problem as you with the Port forwarding but it was a Problem with the Router Settings. I'm doing a Desktop Entry for the Server now.

image

Kolpixx commented 2 years ago

i'm currently fixing some bugs on the install script and adding a Desktop Entry for the Server this might take sometime, because i have some Problems with the building currently.

Kolpixx commented 2 years ago

hmm i have a Problem.

This comes out when i try to install it:

/usr/bin/ld: CMakeFiles/DDNet.dir/src/engine/client/client.cpp.o: in functionCClient::MapDownloadTotalsize() const': client.cpp:(.text._ZNK7CClient20MapDownloadTotalsizeEv[_ZNK7CClient20MapDownloadTotalsizeEv]+0x30): undefined reference to __atomic_load_8' /usr/bin/ld: CMakeFiles/DDNet.dir/src/engine/client/client.cpp.o: in functionCClient::MapDownloadAmount() const': client.cpp:(.text._ZNK7CClient17MapDownloadAmountEv[_ZNK7CClient17MapDownloadAmountEv]+0x30): undefined reference to __atomic_load_8' /usr/bin/ld: CMakeFiles/DDNet.dir/src/engine/client/http.cpp.o: in functionCRequest::ProgressCallback(void*, double, double, double, double)': http.cpp:(.text+0x524): undefined reference to __atomic_store_8' /usr/bin/ld: http.cpp:(.text+0x534): undefined reference to__atomic_store_8' collect2: error: ld returned 1 exit status make[2]: [CMakeFiles/DDNet.dir/build.make:1652: DDNet] Error 1 make[1]: [CMakeFiles/Makefile2:374: CMakeFiles/DDNet.dir/all] Error 2 make: *** [Makefile:152: all] Error 2 Failed at building-2`

image

Kolpixx commented 2 years ago

it also doesn't work with the old script that worked for me i will try it on an other sd card or virtual machine. So i can see if it is a Problem of my Raspberry Pi or if it is a Problem with the installation script

Kolpixx commented 2 years ago

it's also doesn't work with the virtual machine. I try to build it without the script and look if it works.

Kolpixx commented 2 years ago

i cannot build it anymore i don't know why. Does the Script works for someone else?

Edit: If i build it. The Server creates but not the Game Client. And the Server runs fine

Crilum commented 2 years ago

What architecture are you on?

Crilum commented 2 years ago

Well, it built just fine on my arm64 Pi, but I have this error which makes it fail:

tee: /home/pi/pi-apps/apps/DDnet/.local/share/applications/ddnet.desktop: No such file or directory

Fixed with this:

DDnet.zip

I just changed it so it cds into the home dir before making the .desktop files

You might want to read though this.

Crilum commented 2 years ago

Works just fine for me:

2021-10-29-083241_2560x1440_scrot 2021-10-29-083343_2560x1440_scrot

Crilum commented 2 years ago

We should add something about how you have to use port fowarding for the server in the description.

Kolpixx commented 2 years ago

What architecture are you on?

armhf. But it worked before.

Well, it built just fine on my arm64 Pi, but I have this error which makes it fail:

tee: /home/pi/pi-apps/apps/DDnet/.local/share/applications/ddnet.desktop: No such file or directory

Fixed with this:

DDnet.zip

I just changed it so it cds into the home dir before making the .desktop files

You might want to read though this.

Oh Thank you i will take a look at that for my next scripts etc.

We should add something about how you have to use port fowarding for the server in the description.

i'll do this

Kolpixx commented 2 years ago
.o
[ 96%] Building CXX object CMakeFiles/DDNet.dir/src/game/editor/io.cpp.o
[ 96%] Building CXX object CMakeFiles/DDNet.dir/src/game/editor/layer_game.cpp.o
[ 97%] Building CXX object CMakeFiles/DDNet.dir/src/game/editor/layer_quads.cpp.o
[ 97%] Building CXX object CMakeFiles/DDNet.dir/src/game/editor/layer_sounds.cpp.o
[ 97%] Building CXX object CMakeFiles/DDNet.dir/src/game/editor/layer_tiles.cpp.o
[ 98%] Building CXX object CMakeFiles/DDNet.dir/src/game/editor/popups.cpp.o
[ 98%] Building CXX object CMakeFiles/DDNet.dir/src/game/generated/client_data.cpp.o
[100%] Building CXX object CMakeFiles/DDNet.dir/src/game/generated/client_data7.cpp.o
[100%] Linking CXX executable DDNet
/usr/bin/ld: CMakeFiles/DDNet.dir/src/engine/client/client.cpp.o: in function `CClient::MapDownloadTotalsize() const':
client.cpp:(.text._ZNK7CClient20MapDownloadTotalsizeEv[_ZNK7CClient20MapDownloadTotalsizeEv]+0x30): undefined reference to `__atomic_load_8'
/usr/bin/ld: CMakeFiles/DDNet.dir/src/engine/client/client.cpp.o: in function `CClient::MapDownloadAmount() const':
client.cpp:(.text._ZNK7CClient17MapDownloadAmountEv[_ZNK7CClient17MapDownloadAmountEv]+0x30): undefined reference to `__atomic_load_8'
/usr/bin/ld: CMakeFiles/DDNet.dir/src/engine/client/http.cpp.o: in function `CRequest::ProgressCallback(void*, double, double, double, double)':
http.cpp:(.text+0x524): undefined reference to `__atomic_store_8'
/usr/bin/ld: http.cpp:(.text+0x534): undefined reference to `__atomic_store_8'
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/DDNet.dir/build.make:1652: DDNet] Error 1
make[1]: *** [CMakeFiles/Makefile2:374: CMakeFiles/DDNet.dir/all] Error 2
make: *** [Makefile:152: all] Error 2

I still get this error :/

Kolpixx commented 2 years ago

DDnet (4).zip here is the new Zip File with the new Description and i also added a Desktop Entry for the Server. (but i still get this error from above :/ I tried almost everything to fix it. Yesterday it worked fine)

Crilum commented 2 years ago

Are you on twisterOS? I'm using RPiOS. I don't know if it makes a difference..

Kolpixx commented 2 years ago

Im using RPiOs as well and it worked perfectly before as i said but i reinstalled it to test some stuff.

And i also don't want to like reinstall RPiOS.

Crilum commented 2 years ago

You can try vdesktop (also available in Pi Power Tools under Boot in IMG Mode), it lets you run a RPiOS image inside your real OS.

Kolpixx commented 2 years ago

I already tried it with Pi Power Tools but it's also doesn't work there, but vdesktop is also a little bit buggy for me i have 1 sd card left i try it there later.

Crilum commented 2 years ago

Ok. That is really weird. It works for me.

Crilum commented 2 years ago

This might help you.

Crilum commented 2 years ago

@KolpixTV We might need to fork DDNet, and change the cmakelists.txt, or make an issue in their repository.. Look at this.

Kolpixx commented 2 years ago

what we have to change in the cmakelist.txt file?

Crilum commented 2 years ago

The issue in my last comment has a fix to add to the cmakelists.txt.

Hello! I encountered the following linker problem with the recent i2pd sources:

HTTPServer.cpp:(.text+0x7e2c): undefined reference to __atomic_load_8' I2PControl.cpp:(.text+0xddc): undefined reference toatomic_load_8' I2PControl.cpp:(.text+0xe74): undefined reference to `atomic_load_8' NTCPSession.cpp:(.text+0x5a00): undefined reference to __atomic_fetch_add_8' TransitTunnel.cpp:(.text+0x5c): undefined reference to__atomic_fetch_add_8' Transports.cpp:(.text+0x4bc): undefined reference to __atomic_load_8' SSUSession.cpp:(.text+0x370): undefined reference to__atomic_fetch_add_8' and so on. So I had to add the -latomic to the following line in the CMakeLists.txt in order to build the executable:

target_link_libraries( "${PROJECT_NAME}" libi2pd i2pdclient ${DL_LIB} ${Boost_LIBRARIES} ${OPENSSL_LIBRARIES} ${ZLIB_LIBRARY} ${CMAKE_THREAD_LIBS_INIT} ${MINGW_EXTRA} ${DL_LIB} -latomic )

I doubt this is a correct solution -- just reporting the result. This issue looks very similar to another one which was closed some time ago, but for another CPU architecture. So it might be worth making some kind of a universal solution to it.

Crilum commented 2 years ago

That is @v2e's comment from PurpleI2p/i2pd. The above fix is just an example, so for DDNet, we would need something like:

target_link_libraries(${TARGET_CLIENT} ${LIBS_CLIENT} -latomic)
Crilum commented 2 years ago

In uninstall, we should probably tell the user that /home/pi/.teeworlds still exists after uninstall..

Kolpixx commented 2 years ago

DDnet.4.zip The uninstall script here also deletes .teeworlds.

image i will fork that (i never did it but i try it)

Kolpixx commented 2 years ago

i forked it and updated the CMakelist i will update the Install Script now

Kolpixx commented 2 years ago

image also $HOME works but this dirname "§0" does not work.

Here is the new File ddnet.zip .

Crilum commented 2 years ago

Ok, well, $(dirname "$0") should work in the desktop files, because for me, $HOME doesn't work.

Crilum commented 2 years ago

@KolpixTV By the way, does the install script work?

Kolpixx commented 2 years ago

The install script file does work for me now. Idk if §(dirname "$0") works in the Desktop Entry but it does not work where i marked it and also every other. Are you using x64? Maybe $HOME only works on 32bit and we can make an Install script for x64 where $HOME is replaced with $(dirname "$0"). If $(dirname "$0") works for you fine.

Itai-Nelken commented 2 years ago

If $HOME doesn't work, something is very wrong.

Kolpixx commented 2 years ago

If $HOME doesn't work, something is very wrong.

For me its working but Not for him

cycool29 commented 2 years ago

$HOME and $(dirname "$0") won't work if you exactly put it in the desktop file because desktop file can only read absolute path.

Use $HOME and $(dirname "$0") in script to create desktop file should be fine, since when you execute the script the $HOME or $(dirname "$0") will be translated to absolute path.

Are you using x64? Maybe $HOME only works on 32bit and we can make an Install script for x64 where $HOME is replaced with $(dirname "$0"). If $(dirname "$0") works for you fine.

It doesn't matter what architechture.

Kolpixx commented 2 years ago

So If i put $HOME in my Install Script Script its fine right?

cycool29 commented 2 years ago

So If i put $HOME in my Install Script Script its fine right?

Yes.

Kolpixx commented 2 years ago

ok nice. I think the Zip File is now done.

Crilum commented 2 years ago

If $HOME doesn't work, something is very wrong.

$HOME works for me, but not in .desktop files. @cycool29 suggested $(dirname "$0") for making .desktop files, because $HOME didn't work.

cycool29 commented 2 years ago

$HOME and $(dirname "$0") is totally different thing.

$HOME points to the home folder (e.g. /home/pi) and $(dirname "$0") point to the path of the script (e.g. /home/pi/pi-apps/apps/DDnet).

As @Itai-Nelken said, if $HOME doesn't work, something is very wrong.

cycool29 commented 2 years ago

I have simplified the script and add purge-installed, here is the improved zip: DDnet.zip

Tested works for me.

Crilum commented 2 years ago

I should clarify, $HOME works for stuff like this:

xdg-open $HOME/Pictures/Picture.png

But not something like this:

echo "[Desktop Entry]
Name=Temps
Comment=Temps is a modern and minimal menubar application based on Electron with actual weather information and forecast.
GenericName=Weather App
Exec=temps
Icon=$HOME/pi-apps/apps/temps/icon-64.png
StartupNotify=true
Terminal=false
Type=Application
Categories=Utility;" > $HOME/.local/share/applications/Temps.desktop

Sorry for the slightly off topic comment.. 🤷‍♂️

cycool29 commented 2 years ago

But not something like this:

echo "[Desktop Entry]
Name=Temps
Comment=Temps is a modern and minimal menubar application based on Electron with actual weather information and forecast.
GenericName=Weather App
Exec=temps
Icon=$HOME/pi-apps/apps/temps/icon-64.png
StartupNotify=true
Terminal=false
Type=Application
Categories=Utility;" > $HOME/.local/share/applications/Temps.desktop

Sorry for the slightly off topic comment.. 🤷‍♂️

Why not? It works for me.

Crilum commented 2 years ago

But not something like this:

echo "[Desktop Entry]
Name=Temps
Comment=Temps is a modern and minimal menubar application based on Electron with actual weather information and forecast.
GenericName=Weather App
Exec=temps
Icon=$HOME/pi-apps/apps/temps/icon-64.png
StartupNotify=true
Terminal=false
Type=Application
Categories=Utility;" > $HOME/.local/share/applications/Temps.desktop

Sorry for the slightly off topic comment.. man_shrugging

Why not? It works for me.

Directly calling $HOME, doesn't work, but this does:

echo "[Desktop Entry]
Name=Temps
Comment=Temps is a beautiful weather app that resides in your system tray.
GenericName=Weather App
Exec=temps
Icon=$(echo $HOME)/pi-apps/apps/Temps/icon-64.png
StartupNotify=true
Terminal=false
Type=Application
Categories=Utility;
" | sudo tee /usr/share/applications/Temps.desktop
Itai-Nelken commented 2 years ago

Sorry, I accidentally edited @Crilum comments instead of replying to them...

Crilum commented 2 years ago

Sorry, I accidentally edited @Crilum comments instead of replying to them...

Ah, it's ok, haha. :rofl: