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

Add websocket support #51

Merged
merged 21 commits into from
Mar 24, 2023
Merged

Conversation

GameParrot
Copy link
Contributor

@GameParrot GameParrot commented Mar 22, 2023

  • Fixes xbox multiplayer
  • Requires -DUSE_OWN_CURL=true when building

Closes minecraft-linux/mcpelauncher-manifest#798
Closes minecraft-linux/mcpelauncher-manifest#765

@ChristopherHX
Copy link
Member

This error only happens for me on linux, once xbox live login finishs.

20:23:54 Info  [Launcher] Version: client 998d266 / manifest 63bd44d
20:23:54 Info  [Launcher] CPU: GenuineIntel Intel(R) Core(TM) i7-8550U CPU @ 1.80GHz
20:23:54 Info  [Launcher] CPU supports SSSE3: YES
20:23:54 Trace [Launcher] Loading hybris libraries
20:23:54 Trace [REDIRECT] /data/data/com.mojang.minecraftpe to /home/christopher/.local/share/mcpelauncher/
20:23:54 Trace [REDIRECT] /data/data/tmp/.mount_Minecrj9lBfw/usr/proc/7599/cmdline to /home/christopher/.local/share/mcpelauncher/
20:23:54 Trace [REDIRECT] /data/data/tmp/.mount_Minecrj9lBfw/usr/bin/./mcpelauncher-client to /home/christopher/.local/share/mcpelauncher/
20:23:54 Trace [REDIRECT] /data/data to /home/christopher/.local/share/mcpelauncher/
20:23:54 Trace [REDIRECT] . to /home/christopher/.local/share/mcpelauncher/versions/1.19.71.02/assets/
20:23:54 Trace [LinkerUtils] Loaded OS library libm.so.6
20:23:54 Trace [LinkerUtils] Loaded OS library libz.so.1
20:23:54 Trace [LinkerUtils] Loaded OS library /usr/local/share//mcpelauncher/lib/native/x86_64/libfmod.so.12.0
20:23:54 Info  [Launcher] Loading gamepad mappings
20:23:54 Trace [Launcher] Loading gamepad mappings: /tmp/.mount_Minecrj9lBfw/usr/share/mcpelauncher/gamecontrollerdb.txt
20:23:54 Trace [Launcher] Loading gamepad mappings: /usr/share//mcpelauncher/gamecontrollerdb.txt
20:23:54 Trace [Launcher] Loading gamepad mappings: /usr/local/share//mcpelauncher/gamecontrollerdb.txt
20:23:54 Trace [Launcher] Loading gamepad mappings: /home/christopher/.local/share/mcpelauncher/gamecontrollerdb.txt
20:23:54 Info  [Launcher] Creating window
20:23:54 Info  [ModLoader] Loading mods
20:23:54 Info  [ModLoader] Loaded 0 mods
20:23:54 Trace [Launcher] Loading Minecraft library
Found hook: _ZN11AppPlatform16showMousePointerEv @ 0xcd98d0
Found hook: _ZN11AppPlatform16hideMousePointerEv @ 0xcd98a0
20:23:55 Info  [Launcher] Loaded Minecraft library
20:23:55 Debug [Launcher] Minecraft is at offset 0x7F09A6300000
20:23:55 Info  [ModLoader] Loading mods
20:23:55 Info  [ModLoader] Loaded 0 mods
20:23:55 Info  [Launcher] Game version: 0.0.0.0
20:23:55 Info  [Launcher] Applying patches
20:23:55 Debug [CorePatches] Failed to patch, vtable _ZTV21AppPlatform_android23 not found
20:23:55 Info  [Launcher] Initializing JNI
20:23:55 Error [JniSupport] Missing native symbol: Java_com_mojang_minecraftpe_MainActivity_nativeRegisterThis
20:23:55 Error [JniSupport] Missing native symbol: Java_com_mojang_minecraftpe_MainActivity_nativeInitializeWithApplicationContext
20:23:55 Error [JniSupport] Missing native symbol: Java_com_mojang_minecraftpe_MainActivity_nativeUnregisterThis
20:23:55 Error [JniSupport] Missing native symbol: Java_com_mojang_minecraftpe_MainActivity_nativeinitializeLibHttpClient
20:23:55 Error [JniSupport] Missing native symbol: Java_com_microsoft_xal_browser_WebView_urlOperationSucceeded
20:23:55 Error [JniSupport] Missing native symbol: Java_com_mojang_minecraftpe_PlayIntegrity_nativePlayIntegrityComplete
20:23:55 Info  [Launcher] Executing main thread
20:23:55 Trace [Minecraft] Entering JNI_OnLoad 0x7f09d57fa640
20:23:55 Trace [Minecraft] JNI_OnLoad completed
20:23:55 Trace [JniSupport] Invoking nativeRegisterThis
20:23:55 Trace [JniSupport] Invoking ANativeActivity_onCreate
20:23:55 Warn  [Main] Android stub called
20:23:55 Warn  [Main] Android stub called
20:23:55 Warn  [Main] Android stub called
20:23:55 Warn  [Main] Android stub called
20:23:55 Info  [Minecraft] android_main starting. internalDataPath is '/internal', externalDataPath is '/external'
20:23:55 Trace [JniSupport] Invoking start activity callbacks
20:23:55 Error [MCPE] *** setCachedDeviceId(9eeebd4d-ef6b-49a2-894d-0a8848857fc8)
20:23:55 Info  [Bedrock] configureBreakpad with directory: /crash, sessionid is: 38dc02f0-ec5a-430e-b80c-9d72d991036d
20:23:55 Info  [Bedrock] configureBreakpad called, directory is: /crash, sessionid is: 38dc02f0-ec5a-430e-b80c-9d72d991036d
20:23:55 Info  [Minecraft] NO LOG FILE! - AppPlatform_android::setStorageDirectory - using External dir (NEW) - CurrentFileStoragePath is now '/home/christopher/.local/share/mcpelauncher/'
20:23:55 Warn  [Minecraft] NO LOG FILE! - [Graphics] The graphics context was gained
20:23:55 Warn  [Minecraft] NO LOG FILE! - [Graphics] The graphics context was gained
20:23:55 Warn  [Minecraft] MinecraftGame::init && MinecraftGame::setSize!
20:23:55 Warn  [FakeEGL] eglQueryString 308d
20:23:55 Warn  [Main] Android stub called
20:23:55 Warn  [Main] Android stub called
20:23:55 Warn  [Minecraft] NO LOG FILE! - [Graphics] The graphics context was gained
20:23:55 Warn  [Main] Android stub called
20:23:55 Debug [HttpCallStaticGlue] Successfully registerered HttpCall methods
20:23:55 Debug [XboxLiveAppConfig] Successfully registerered XboxLiveAppConfig methods
20:23:55 Debug [XSAPI.Android] Successfully registerered HttpCall tcuiMethods
20:23:57 Info  [Minecraft] NO LOG FILE! - Time played notifier not required for 'en'
20:24:02 Error [HTTPClientWebSocket] websocket connection closed with an error
20:24:03 Error [HTTPClientWebSocket] websocket connection closed with an error
Signal 11 received
Backtrace elements: 10
#0 /tmp/.mount_Minecrj9lBfw/usr/bin/./mcpelauncher-client(_ZN12CrashHandler12handleSignalEiPv+0x156) [0xcfb856]
#1 /lib/x86_64-linux-gnu/libc.so.6(+0x42520) [0x7f09e801a520]
#2 /tmp/.mount_Minecrj9lBfw/usr/bin/./mcpelauncher-client() [0xdb591c]
#3 /tmp/.mount_Minecrj9lBfw/usr/bin/./mcpelauncher-client(_ZN19HttpClientWebSocket11sendMessageENSt3__110shared_ptrIN5jnivm6StringEEE+0xb0) [0xce73e0]
#4 /tmp/.mount_Minecrj9lBfw/usr/bin/./mcpelauncher-client(_ZN5jnivm3ObjIRKM19HttpClientWebSocketFhNSt3__110shared_ptrINS_6StringEEEEJEE12InstanceBaseINS2_16integer_sequenceImJLm0EEEEE14InstanceInvokeES9_PNS_3ENVEP8_jobjectPK6jvalue+0xb9) [0xbdd3c9]
#5 /tmp/.mount_Minecrj9lBfw/usr/bin/./mcpelauncher-client(_ZN5jnivm11BaseWrapperIRKM19HttpClientWebSocketFhNSt3__110shared_ptrINS_6StringEEEELNS_12FunctionTypeE1EJEE14InstanceInvokeEPNS_3ENVEP8_jobjectPK6jvalue+0x30) [0xbdd300]
#6 /tmp/.mount_Minecrj9lBfw/usr/bin/./mcpelauncher-client(_ZN5jnivm4WrapIRKM19HttpClientWebSocketFhNSt3__110shared_ptrINS_6StringEEEEJEE14WrapperClassesINS_11BaseWrapperIS9_LNS_12FunctionTypeE1EJEEEhE16InstanceFunction14InstanceInvokeEPNS_3ENVEP8_jobjectPK6jvalueNS_4impl16MethodHandleBaseIhEE+0x42) [0xbdd1d2]
#7 /tmp/.mount_Minecrj9lBfw/usr/bin/./mcpelauncher-client(_ZN5jnivm14MDispatchBase2IhE10CallMethodEP7_JNIEnvP8_jobjectP10_jmethodIDP6jvalue+0x1ed) [0xec38fd]
#8 /tmp/.mount_Minecrj9lBfw/usr/bin/./mcpelauncher-client(_ZN5jnivm13MDispatchBaseIhJP8_jobjectEE10CallMethodEP7_JNIEnvS2_P10_jmethodIDP13__va_list_tag+0x95) [0xec3d65]
#9 LINKER (null)+0x7f09acb6124a in /home/christopher/.var/app/io.mrarm.mcpelauncher/data/mcpelauncher/versions/1.19.71.02/lib/x86_64/libminecraftpe.so+0x0x686124a [0x0x7f09acb6124a]
Dumping stack...
#347 LINKER (null)+0x7f09acb6124a in /home/christopher/.var/app/io.mrarm.mcpelauncher/data/mcpelauncher/versions/1.19.71.02/lib/x86_64/libminecraftpe.so+0x686124a [0x7f09acb6124a]
#375 LINKER HttpClientWebSocket::SendMessage(std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > const&) const+0xcc in /home/christopher/.var/app/io.mrarm.mcpelauncher/data/mcpelauncher/versions/1.19.71.02/lib/x86_64/libminecraftpe.so+0xd1ffd3c [0x7f09b34ffd3c]
#383 LINKER okhttp_websocket_impl::SendMessageAsync(char const*, XAsyncBlock*) const::'lambda'(XAsyncOp, XAsyncProviderData const*)::operator()(XAsyncOp, XAsyncProviderData const*) const+0xb5 in /home/christopher/.var/app/io.mrarm.mcpelauncher/data/mcpelauncher/versions/1.19.71.02/lib/x86_64/libminecraftpe.so+0xd1ffc09 [0x7f09b34ffc09]
#385 LINKER LocklessQueue<TaskQueuePortImpl::QueueEntry>::List::push_range(LocklessQueue<TaskQueuePortImpl::QueueEntry>::Address, LocklessQueue<TaskQueuePortImpl::QueueEntry>::Address)+0x43 in /home/christopher/.var/app/io.mrarm.mcpelauncher/data/mcpelauncher/versions/1.19.71.02/lib/x86_64/libminecraftpe.so+0xd1f452f [0x7f09b34f452f]
#389 LINKER (null)+0x7f09b34f055f in /home/christopher/.var/app/io.mrarm.mcpelauncher/data/mcpelauncher/versions/1.19.71.02/lib/x86_64/libminecraftpe.so+0xd1f055f [0x7f09b34f055f]
#391 LINKER (null)+0x7f09b34f05e6 in /home/christopher/.var/app/io.mrarm.mcpelauncher/data/mcpelauncher/versions/1.19.71.02/lib/x86_64/libminecraftpe.so+0xd1f05e6 [0x7f09b34f05e6]
#393 LINKER LocklessQueue<TaskQueuePortImpl::QueueEntry>::pop_front(TaskQueuePortImpl::QueueEntry&)+0x7a in /home/christopher/.var/app/io.mrarm.mcpelauncher/data/mcpelauncher/versions/1.19.71.02/lib/x86_64/libminecraftpe.so+0xd1f22ee [0x7f09b34f22ee]
#398 LINKER (null)+0x7f09b34f055f in /home/christopher/.var/app/io.mrarm.mcpelauncher/data/mcpelauncher/versions/1.19.71.02/lib/x86_64/libminecraftpe.so+0xd1f055f [0x7f09b34f055f]
#399 LINKER TaskQueuePortImpl::DrainOneItem()+0x58 in /home/christopher/.var/app/io.mrarm.mcpelauncher/data/mcpelauncher/versions/1.19.71.02/lib/x86_64/libminecraftpe.so+0xd1f2210 [0x7f09b34f2210]
#403 LINKER (null)+0x7f09b34f055f in /home/christopher/.var/app/io.mrarm.mcpelauncher/data/mcpelauncher/versions/1.19.71.02/lib/x86_64/libminecraftpe.so+0xd1f055f [0x7f09b34f055f]
#411 LINKER (null)+0x70 in /home/christopher/.var/app/io.mrarm.mcpelauncher/data/mcpelauncher/versions/1.19.71.02/lib/x86_64/libminecraftpe.so+0xd1f3884 [0x7f09b34f3884]
#419 LINKER (null)+0x7f09ac5a050a in /home/christopher/.var/app/io.mrarm.mcpelauncher/data/mcpelauncher/versions/1.19.71.02/lib/x86_64/libminecraftpe.so+0x62a050a [0x7f09ac5a050a]
#425 LINKER TaskDetails::BackgroundTaskDetails<TaskResult, void, void>::_invoke()+0x13 in /home/christopher/.var/app/io.mrarm.mcpelauncher/data/mcpelauncher/versions/1.19.71.02/lib/x86_64/libminecraftpe.so+0xcd49783 [0x7f09b3049783]
#427 LINKER BackgroundTask<TaskResult, void>::run(ITaskExecutionContext const*)+0xd4 in /home/christopher/.var/app/io.mrarm.mcpelauncher/data/mcpelauncher/versions/1.19.71.02/lib/x86_64/libminecraftpe.so+0xcd316c4 [0x7f09b30316c4]
#449 LINKER BackgroundWorker::_runOneTask()+0x9e in /home/christopher/.var/app/io.mrarm.mcpelauncher/data/mcpelauncher/versions/1.19.71.02/lib/x86_64/libminecraftpe.so+0xcd4b76e [0x7f09b304b76e]
#461 LINKER BackgroundWorker::_processNextTask()+0x20 in /home/christopher/.var/app/io.mrarm.mcpelauncher/data/mcpelauncher/versions/1.19.71.02/lib/x86_64/libminecraftpe.so+0xcd4b390 [0x7f09b304b390]
#465 LINKER (null)+0x7f09b3076d18 in /home/christopher/.var/app/io.mrarm.mcpelauncher/data/mcpelauncher/versions/1.19.71.02/lib/x86_64/libminecraftpe.so+0xcd76d18 [0x7f09b3076d18]
program failed with unix signal number: 11

Process exited with unexpected exit code: 11

I'm going to test HEAD~2 of this PR.

I don't had this issue on my macOS test dev.

@GameParrot
Copy link
Contributor Author

GameParrot commented Mar 24, 2023

Maybe add a small delay before calling onOpen
Added usleep(500000); on line 146

Copy link
Member

@ChristopherHX ChristopherHX left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you rollback to 80149f0 I merge it.

Maybe add a small delay before calling onOpen
Added usleep(500000); on line 146

I don't like to workaround a problem via sleep calls.

The crash I posted happens frequently on my end.
The fist two times I opened it => crash
Then it worked once
Then crashed the next time opened it
....

@GameParrot
Copy link
Contributor Author

If you rollback to 80149f0 I merge it.

Maybe add a small delay before calling onOpen
Added usleep(500000); on line 146

I don't like to workaround a problem via sleep calls.

The crash I posted happens frequently on my end. The fist two times I opened it => crash Then it worked once Then crashed the next time opened it ....

Reverted it

@ChristopherHX ChristopherHX merged commit 4b4d8b0 into minecraft-linux:master Mar 24, 2023
@AlexLexusYTXD
Copy link

what do you do here

@AlexLexusYTXD
Copy link

wheres the download

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

MICROSOFT ACCOUNT DISCONNECTED EVERY TIME Unable to join friends' games, and they are unable to join mine
3 participants