Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect cgame used on Android #2375

Open
ghost opened this issue Oct 28, 2023 · 8 comments
Open

Incorrect cgame used on Android #2375

ghost opened this issue Oct 28, 2023 · 8 comments
Assignees
Labels
🐞 Bug Something isn't working cat: client Category engine (client, renderer, sdl) P3: Normal Priority 3
Milestone

Comments

@ghost
Copy link

ghost commented Oct 28, 2023

Android app seems to always be using cgame from APK, rather than the one from server the client is connecting to. The correct cgame (that is, the one from pak provided by server) is extracted to the app data folder, but the bundled one actually loads.

I tried with latest snapshot (363-g8c26358) and connected TM server, which currently has 66-g337f962 deployed. The APK snapshot version appeared on the loading screen and shortly after entering the game, I was disconnected with Unknown event: 56, which makes sense, given that I have an incompatible cgame loaded.

@Aranud Aranud added 🐞 Bug Something isn't working P3: Normal Priority 3 cat: client Category engine (client, renderer, sdl) labels Oct 30, 2023
@Aranud Aranud added this to the Android milestone Oct 30, 2023
@rafal1137 rafal1137 self-assigned this Nov 6, 2023
@rafal1137
Copy link
Member

It is issue with overwriting/no properly unpacking cgame ui files.

By Default Android Apk comes with current pk3 file in which is located from AssetManager and copied to the Internal Storage

String etl_pak = new String();
AssetManager assManager = getApplicationContext().getAssets();
try {
for(String file: assManager.list("")) {
if(file.endsWith(".pk3")) {
etl_pak += file;
}
}
} catch (IOException e) {
e.printStackTrace();
}

final File etl_etlegacy = new File(getExternalFilesDir(null), "etlegacy/legacy/".concat(etl_pak));
if (!etl_etlegacy.exists()) {
InputStream is = null;
try {
is = assManager.open(etl_pak);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
copyInputStreamToFile(is, etl_etlegacy);
}

Connecting to any Legacy Server that comes with non current version downloads pk3 files into dlcache dir in which those files should be extracted. but they do not.

obraz

PS: This one may have something to dowith current Android Restrictions.
We either allow some more access to the internal of etlegacy app or we move into another dir outside of Android/data

@x0rnn
Copy link
Contributor

x0rnn commented Nov 6, 2023

Yes, move it. I/we can only access Android/data for reading, can't copy any configs or demos there due to unrooted Android protection.

@rafal1137
Copy link
Member

So yeah it looks like this Android Restricts everything to the Android/data/etlegacy instead of sdcard/legacy
Need to take a deeper look at it.

@rafal1137
Copy link
Member

Just connected to the Hirntot with their more up to date snapshot build and it did worked flaweslly.
It is like older snapshots/releases are not compatible anymore :O

@ghost
Copy link
Author

ghost commented Nov 9, 2023

Hirntot runs on a snapshot built yesterday. The problem occurs once qagame and bundled cgame from APK become incompatible enough. It wouldn't work with a snapshot APK against v2.81.1 cgame and vice-versa.

@rafal1137
Copy link
Member

Hirntot runs on a snapshot built yesterday. The problem occurs once qagame and bundled cgame from APK become incompatible enough. It wouldn't work with a snapshot APK against v2.81.1 cgame and vice-versa.

Yes they did updated to the latest one. but they in fact had previous one before that in which latest apk snapshot worked fine.

@ghost
Copy link
Author

ghost commented Nov 9, 2023

The previous one was fairly recent as well. Anyway, is loading the actual server-provided cgame doable? Using whatever APK is close enough to what the server is running is an option, but only as far as the server runs Legacy mod. If other mods decided to compile for Android, current Legacy client would still try to load the Legacy cgame that came up with it, or at least that's what it does now.

@x0rnn
Copy link
Contributor

x0rnn commented Nov 22, 2023

This will be a problem for our custom freezetag gamemode we will have as an Xmas event on Hirntot. Requires a custom built mod. Not that we expect any/many Android players but it won't be compatible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 Bug Something isn't working cat: client Category engine (client, renderer, sdl) P3: Normal Priority 3
Projects
None yet
Development

No branches or pull requests

3 participants