Compare commits

..
116 changed files with 1859 additions and 2510 deletions

No files matched your search

@@ -60,6 +60,35 @@ private fun BottomPanelBar() = PreviewHost {
@DroidDeckPreviews @Composable private fun SessionMenuDockedDisplayPreview() = DockedMenu(SessionDrawerPage.DISPLAY)
@DroidDeckPreviews @Composable private fun BottomPanelBarPreview() = BottomPanelBar()
/** The Stardew Valley companion page, fed with the mod's messages. */
@Composable
private fun BottomStardew() = PreviewHost {
val S = com.droiddeck.launcher.companion.StardewCompanion
val state = listOf(
"""{"type":"game_info","saveName":"Sunny Farm"}""",
"""{"type":"sdv_day","season":"spring","day":5,"year":1,"weekday":"Fri","timeOfDay":1330,"weatherToday":"Sunny","gold":12500,"energy":200,"maxEnergy":270,"health":90,"maxHealth":100,"location":"Farm"}""",
"""{"type":"sdv_inventory","selected":2,"items":[{"slot":0,"id":"(T)Axe","name":"Axe"},{"slot":1,"id":"(T)Hoe","name":"Hoe"},{"slot":2,"id":"(O)24","name":"Parsnip","count":15},{"slot":4,"id":"(O)388","name":"Wood","count":99}]}""",
"""{"type":"sdv_villagers","villagers":[{"name":"Haley","birthdayIn":0},{"name":"Abigail","birthdayIn":3}]}""",
"""{"type":"sdv_quests","quests":[{"title":"Introductions","objective":"Meet 28 people (12 of 28)"},{"title":"How To Win Friends","objective":"Give a gift to someone"}]}""",
).fold(com.droiddeck.launcher.companion.StardewCompanion.State()) { st, m -> S.reduce(st, m) }
androidx.compose.foundation.layout.Box(Modifier.size(640.dp, 420.dp).background(androidx.compose.material3.MaterialTheme.colorScheme.background)) { StardewPanel(state) {} }
}
@DroidDeckPreviews @Composable private fun BottomStardewPreview() = BottomStardew()
/** The Fallout 4 companion page, fed with a Thor Pip-Boy data message. */
@Composable
private fun BottomPipBoy() = PreviewHost {
val rpg = com.droiddeck.launcher.companion.RpgCompanion
val state = rpg.reduce(rpg.FALLOUT_4, com.droiddeck.launcher.companion.RpgCompanion.State(), """{"type":"data","id":"droiddeck","data":{
"player.stats":{"level":23,"hp":245,"hpMax":310,"ap":88,"apMax":105,"rads":65,"caps":1834,"weight":187.4,"weightMax":260},
"player.inventory":[{"id":"0x102","name":"Service Pistol","count":1,"equipped":true,"fav":1},{"id":"0x236","name":"Med Kit","count":7,"fav":0},
{"id":"0x303","name":"Clean Water","count":4,"fav":2}],"radio":{"enabled":true}}}""")
androidx.compose.foundation.layout.Box(Modifier.size(640.dp, 420.dp).background(androidx.compose.material3.MaterialTheme.colorScheme.background)) { RpgPanel(state, {}, {}) }
}
@DroidDeckPreviews @Composable private fun BottomPipBoyPreview() = BottomPipBoy()
/** The Library and Stores tabs read store accounts, which load on a background thread. */
private val storesLoaded = { com.droiddeck.launcher.stores.StoresState.accountsLoaded }
@@ -80,4 +109,6 @@ internal val previewCases: List<PreviewCase> = listOf(
PreviewCase("session-menu-docked") { DockedMenu(SessionDrawerPage.CONTROLLER) },
PreviewCase("session-menu-docked-display") { DockedMenu(SessionDrawerPage.DISPLAY) },
PreviewCase("bottom-panel-bar") { BottomPanelBar() },
PreviewCase("bottom-companion-stardew") { BottomStardew() },
PreviewCase("bottom-companion-pipboy") { BottomPipBoy() },
)
+8 -41
View File
@@ -25,7 +25,6 @@
#include <gnu/lib-names.h>
#endif
#include <fcntl.h>
#include <linux/futex.h>
#include <linux/input.h>
#include <linux/joystick.h>
#include <linux/uinput.h>
@@ -712,19 +711,6 @@ ring_header_is_valid(const FakeInputRingHeader *ring) {
ring->capacity == FAKE_INPUT_RING_CAPACITY;
}
__attribute__((visibility("hidden"))) static int ring_wait(const FakeInputRingHeader *ring, uint64_t seen, long ns) {
struct timespec wait = {0, ns};
if (syscall(SYS_futex, &ring->write_seq, FUTEX_WAIT, static_cast<uint32_t>(seen), &wait, nullptr, 0) == 0 ||
errno == EAGAIN || errno == ETIMEDOUT)
return 0;
if (errno == EINTR) return -1;
return nanosleep(&wait, nullptr);
}
__attribute__((visibility("hidden"))) static void ring_wake(const FakeInputRingHeader *ring) {
syscall(SYS_futex, &ring->write_seq, FUTEX_WAKE, INT_MAX, nullptr, nullptr, 0);
}
struct SnapshotState {
uint64_t sequence = 0;
uint64_t write_seq = 0;
@@ -1181,7 +1167,6 @@ __attribute__((visibility("hidden"))) static void flush_uinput(UinputWriter &w)
__atomic_thread_fence(__ATOMIC_RELEASE);
__atomic_store_n(&ring->snapshot_seq, sequence + 2, __ATOMIC_RELEASE);
__atomic_store_n(&ring->write_seq, write_seq, __ATOMIC_RELEASE);
ring_wake(ring);
}
__attribute__((visibility("hidden"))) static ssize_t
@@ -1555,12 +1540,6 @@ __attribute__((visibility("hidden"))) static void sleep_us(int us) {
nanosleep(&interval, nullptr);
}
__attribute__((visibility("hidden"))) static void
report_wait(const FakeInputRingHeader *ring, bool fresh, uint64_t seen, int us) {
if (fresh) ring_wait(ring, seen, us * 1000L);
else sleep_us(us);
}
__attribute__((visibility("hidden"))) static uint64_t monotonic_us() {
struct timespec now;
clock_gettime(CLOCK_MONOTONIC, &now);
@@ -1733,8 +1712,7 @@ __attribute__((visibility("hidden"))) static void *deck_report_thread(void *arg)
int32_t axes[8] = {};
DeckExtras extras;
while (live_pad_type() == PAD_TYPE_DECK) {
bool fresh = read_snapshot(self->ring, snap);
if (fresh && snap.generation == ring_generation(self->ring)) {
if (read_snapshot(self->ring, snap) && snap.generation == ring_generation(self->ring)) {
buttons = snap.buttons;
memcpy(axes, snap.axes, sizeof(axes));
}
@@ -1744,7 +1722,7 @@ __attribute__((visibility("hidden"))) static void *deck_report_thread(void *arg)
if (send(self->peer, report, sizeof(report), MSG_DONTWAIT | MSG_NOSIGNAL) < 0 &&
errno != EAGAIN && errno != EWOULDBLOCK)
break;
report_wait(self->ring, fresh, snap.write_seq, controller_report_interval_us(DECK_REPORT_INTERVAL_US));
sleep_us(controller_report_interval_us(DECK_REPORT_INTERVAL_US));
}
syscall(SYS_close, self->peer);
munmap(self->ring, self->mapping_size);
@@ -1850,8 +1828,7 @@ __attribute__((visibility("hidden"))) static void *sony_report_thread(void *arg)
SonyTouch touch;
const uint64_t start_us = monotonic_us();
while (live_pad_type() == type) {
bool fresh = read_snapshot(self->ring, snap);
if (fresh && snap.generation == ring_generation(self->ring)) {
if (read_snapshot(self->ring, snap) && snap.generation == ring_generation(self->ring)) {
buttons = snap.buttons;
memcpy(axes, snap.axes, sizeof(axes));
}
@@ -1861,7 +1838,7 @@ __attribute__((visibility("hidden"))) static void *sony_report_thread(void *arg)
if (send(self->peer, report, sizeof(report), MSG_DONTWAIT | MSG_NOSIGNAL) < 0 &&
errno != EAGAIN && errno != EWOULDBLOCK)
break;
report_wait(self->ring, fresh, snap.write_seq, controller_report_interval_us(DECK_REPORT_INTERVAL_US));
sleep_us(controller_report_interval_us(DECK_REPORT_INTERVAL_US));
}
syscall(SYS_close, self->peer);
munmap(self->ring, self->mapping_size);
@@ -2060,8 +2037,7 @@ __attribute__((visibility("hidden"))) static void *triton_pad_thread(void *arg)
DeckExtras extras;
const uint64_t start_us = monotonic_us();
while (live_pad_type() == PAD_TYPE_STEAM) {
bool fresh = read_snapshot(self->ring, snap);
if (fresh && snap.generation == ring_generation(self->ring)) {
if (read_snapshot(self->ring, snap) && snap.generation == ring_generation(self->ring)) {
buttons = snap.buttons;
memcpy(axes, snap.axes, sizeof(axes));
}
@@ -2072,7 +2048,7 @@ __attribute__((visibility("hidden"))) static void *triton_pad_thread(void *arg)
if (send(self->peer, report, sizeof(report), MSG_DONTWAIT | MSG_NOSIGNAL) < 0 &&
errno != EAGAIN && errno != EWOULDBLOCK)
break;
report_wait(self->ring, fresh, snap.write_seq, controller_report_interval_us(TRITON_REPORT_INTERVAL_US));
sleep_us(controller_report_interval_us(TRITON_REPORT_INTERVAL_US));
}
syscall(SYS_close, self->peer);
munmap(self->ring, self->mapping_size);
@@ -4040,7 +4016,6 @@ static ssize_t read_input(int fd, void *buf, size_t count) {
errno = ENODEV;
return -1;
}
bool idle = false;
for (int attempt = 0; attempt < 8; ++attempt) {
size_t requested = count / sizeof(struct input_event);
if (fake.keyframe_remaining == 0) {
@@ -4062,10 +4037,7 @@ static ssize_t read_input(int fd, void *buf, size_t count) {
capture_keyframe(fake, snap);
} else {
size_t events = std::min<uint64_t>(requested, snap.write_seq - fake.read_seq);
if (events == 0) {
idle = true;
break;
}
if (events == 0) break;
const uint8_t *ring_events = reinterpret_cast<const uint8_t *>(fake.ring) +
FAKE_INPUT_RING_HEADER_SIZE;
std::vector<struct input_event> input_events(events);
@@ -4111,14 +4083,9 @@ static ssize_t read_input(int fd, void *buf, size_t count) {
errno = EAGAIN;
return -1;
}
const FakeInputRingHeader *ring = fake.ring;
uint64_t seen = fake.read_seq;
guard.unlock();
#ifdef __GLIBC__
pthread_testcancel();
#endif
struct timespec sleep_time = {0, backoff_ns};
int result = idle ? ring_wait(ring, seen, backoff_ns) : nanosleep(&sleep_time, nullptr);
int result = nanosleep(&sleep_time, nullptr);
guard.lock();
if (result < 0) return -1;
if (low_latency(LATENCY_CONTROLLER)) backoff_ns = kLowLatencyRingWaitUs * 1000;
-10
View File
@@ -1,9 +1,6 @@
#include <errno.h>
#include <jni.h>
#include <limits.h>
#include <linux/futex.h>
#include <stdatomic.h>
#include <stdint.h>
#include <sys/syscall.h>
#include <unistd.h>
@@ -14,13 +11,6 @@ Java_com_droiddeck_launcher_input_FakeInputWriter_nativeStoreFence(JNIEnv *env,
atomic_thread_fence(memory_order_release);
}
JNIEXPORT void JNICALL
Java_com_droiddeck_launcher_input_FakeInputWriter_nativeWake(JNIEnv *env, jclass clazz, jobject buffer, jint offset) {
(void)clazz;
uint8_t *base = (*env)->GetDirectBufferAddress(env, buffer);
if (base) syscall(SYS_futex, base + offset, FUTEX_WAKE, INT_MAX, NULL, NULL, 0);
}
JNIEXPORT jint JNICALL
Java_com_droiddeck_launcher_session_ThreadSignals_tgkill(JNIEnv *env, jclass clazz, jint tgid, jint tid, jint signal) {
(void)env;
@@ -133,24 +133,6 @@ static void objects_destroy(void) {
g_dsl = VK_NULL_HANDLE; g_sampler = VK_NULL_HANDLE;
}
void blendp_destroy(void) {
if (g_dev) {
for (int i = 0; i < NSRC; i++) src_release(i);
for (int i = 0; i < NDST; i++) dst_release(i);
for (int i = 0; i < NFMT; i++) {
if (g_out[i].pipe) g_vk.DestroyPipeline(g_dev, g_out[i].pipe, NULL);
if (g_out[i].rp) g_vk.DestroyRenderPass(g_dev, g_out[i].rp, NULL);
}
objects_destroy();
}
memset(g_src, 0, sizeof(g_src));
memset(g_dst, 0, sizeof(g_dst));
memset(g_out, 0, sizeof(g_out));
g_ready = 0;
g_frame = 1;
g_dev = VK_NULL_HANDLE;
}
static int objects_ensure(void) {
if (g_ready) return g_ready == 1 ? 0 : -1;
g_ready = -1;
@@ -4,7 +4,6 @@
#include <vulkan/vulkan.h>
void blendp_bind_device(VkDevice dev);
void blendp_destroy(void);
void blendp_forget_image(VkImage img);
void blendp_begin_frame(void);
@@ -311,16 +311,6 @@ static void objects_destroy(void) {
g_dsl = VK_NULL_HANDLE; g_sampler = VK_NULL_HANDLE; g_rp = VK_NULL_HANDLE;
}
void vkp_cardboard_destroy(void) {
if (g_dev) objects_destroy();
g_dev = VK_NULL_HANDLE;
g_ready = 0;
memset(&g_t, 0, sizeof(g_t));
memset(g_src, 0, sizeof(g_src));
g_nsrc = 0;
memset(&g_mp, 0, sizeof(g_mp));
}
static int objects_ensure(void) {
if (g_ready) return g_ready == 1 ? 0 : -1;
if (!g_dev || !g_vk.CreateGraphicsPipelines) goto fail;
@@ -26,7 +26,6 @@ void vkp_cardboard_set_pose_file(const char *path);
void vkp_cardboard_set_render_height(int height);
void vkp_cardboard_bind_device(VkDevice dev, const VkPhysicalDeviceMemoryProperties *memprops);
void vkp_cardboard_destroy(void);
int vkp_cardboard_active(void);
int vkp_cardboard_source(void);
int vkp_cardboard_pose_changed(void);
@@ -194,31 +194,7 @@ void vkp_framegen_device_ready(VkDevice dev, VkQueue queue, uint32_t qfam, int f
fge_caps_ok(VKP_FG_ENGINE_DDFG) ? "available" : "unavailable");
}
void vkp_framegen_device_lost(void) {
atomic_store(&g_dev_lost, 1);
atomic_store(&g_dev_ready, 0);
fge_device_lost();
if (g_dev) {
for (uint32_t i = 0; i < g_ring_n; i++) {
if (g_ring[i].view && vk.DestroyImageView) vk.DestroyImageView(g_dev, g_ring[i].view, NULL);
if (g_ring[i].img && vk.DestroyImage) vk.DestroyImage(g_dev, g_ring[i].img, NULL);
if (g_ring[i].mem && vk.FreeMemory) vk.FreeMemory(g_dev, g_ring[i].mem, NULL);
}
}
memset(g_ring, 0, sizeof(g_ring));
g_ring_n = g_ring_w = g_ring_h = 0;
g_ring_fmt = VK_FORMAT_UNDEFINED;
g_engine_ok = 0;
g_engine_kind = -1;
g_engine_cache_gen = -1;
g_built_w = g_built_h = 0;
g_built_fmt = VK_FORMAT_UNDEFINED;
g_planned = 0;
memset(&vk, 0, sizeof(vk));
g_dev = VK_NULL_HANDLE;
g_queue = VK_NULL_HANDLE;
g_qfam = 0;
}
void vkp_framegen_device_lost(void) { atomic_store(&g_dev_lost, 1); }
static void destroy_ring(void) {
@@ -126,23 +126,6 @@ void fge_device_ready(PFN_vkGetInstanceProcAddr gipa, VkInstance inst, VkPhysica
(int)g_caps.storageOnSwapchainFormat);
}
void fge_device_lost(void) {
g_lsfg.reset();
g_ddfg.reset();
g_kind = -1;
g_dev = VK_NULL_HANDLE;
g_queue = VK_NULL_HANDLE;
g_pd = VK_NULL_HANDLE;
g_qfam = 0;
g_ready = false;
g_probed = false;
g_table = {};
g_caps = {};
g_v12 = {};
g_f2 = {};
g_build[0] = 0;
}
int fge_caps_ok(int kind) {
if (!g_ready) return 0;
if (kind == 1) return g_caps.storageOnSwapchainFormat ? 1 : 0;
@@ -12,7 +12,6 @@ extern "C" {
const void *fge_probe(PFN_vkGetInstanceProcAddr gipa, VkInstance inst, VkPhysicalDevice pd,
VkFormat ring_fmt);
void fge_device_lost(void);
void fge_device_ready(PFN_vkGetInstanceProcAddr gipa, VkInstance inst, VkPhysicalDevice pd,
VkDevice dev, VkQueue queue, uint32_t qfam, int features_enabled);
int fge_caps_ok(int kind);
@@ -9,7 +9,6 @@ void fge_device_ready(PFN_vkGetInstanceProcAddr gipa, VkInstance inst, VkPhysica
VkDevice dev, VkQueue queue, uint32_t qfam, int features_enabled) {
(void)gipa; (void)inst; (void)pd; (void)dev; (void)queue; (void)qfam; (void)features_enabled;
}
void fge_device_lost(void) {}
int fge_caps_ok(int kind) { (void)kind; return 0; }
const char *fge_caps_reason(void) { return "frame-generation engines not built into this compositor"; }
int fge_format_ok(VkFormat fmt) { (void)fmt; return 0; }
@@ -73,19 +73,8 @@ void vkp_gpu_busy_device(VkPhysicalDevice pd, VkDevice dev, uint32_t family) {
}
void vkp_gpu_busy_device_lost(void) {
pthread_mutex_lock(&g_lock);
atomic_store(&g_lost, 1);
atomic_store(&g_timing, 0);
if (g_v.device) {
gpuload_ring_release(&g_ring, &g_v);
g_ring.state = 0;
}
if (g_vk.QueueSubmit == timed_submit && g_submit) g_vk.QueueSubmit = g_submit;
g_submit = NULL;
memset(&g_v, 0, sizeof(g_v));
g_family = g_bits = 0;
g_was_on = 0;
pthread_mutex_unlock(&g_lock);
}
JNIEXPORT jlong JNICALL Java_com_droiddeck_launcher_wayland_WaylandCompositor_nativeGpuBusyNs(JNIEnv *env, jclass cls) {
+3 -3
View File
@@ -15,9 +15,9 @@
X(GetPhysicalDeviceImageFormatProperties2) X(GetPhysicalDeviceProperties2)
#define VK_DEVICE_FUNCS(X) \
X(DestroyDevice) X(GetDeviceQueue) X(CreateSwapchainKHR) X(DestroySwapchainKHR) X(GetSwapchainImagesKHR) \
X(CreateCommandPool) X(DestroyCommandPool) X(AllocateCommandBuffers) X(CreateSemaphore) X(CreateFence) \
X(DeviceWaitIdle) X(DestroyFence) X(CreateImage) X(GetImageMemoryRequirements) X(AllocateMemory) \
X(GetDeviceQueue) X(CreateSwapchainKHR) X(DestroySwapchainKHR) X(GetSwapchainImagesKHR) \
X(CreateCommandPool) X(AllocateCommandBuffers) X(CreateSemaphore) X(CreateFence) \
X(DeviceWaitIdle) X(CreateImage) X(GetImageMemoryRequirements) X(AllocateMemory) \
X(BindImageMemory) X(DestroyImage) X(FreeMemory) X(AcquireNextImageKHR) \
X(ResetCommandBuffer) X(BeginCommandBuffer) X(CmdPipelineBarrier) X(CmdBlitImage) \
X(EndCommandBuffer) X(ResetFences) X(QueueSubmit) X(QueuePresentKHR) X(WaitForFences) \
+15 -290
View File
@@ -31,15 +31,6 @@
#define LOGE(...) droiddeck_log("error", __VA_ARGS__)
#define MOD_INVALID VKP_MOD_INVALID
enum vkp_image_source {
VKP_IMAGE_SOURCE_NONE = 0,
VKP_IMAGE_SOURCE_DMABUF,
VKP_IMAGE_SOURCE_AHB_WLEGL,
VKP_IMAGE_SOURCE_AHB_SOURCE,
VKP_IMAGE_SOURCE_AHB_TARGET,
VKP_IMAGE_SOURCE_SHM
};
struct vkp_image {
VkImage image;
VkDeviceMemory mem;
@@ -56,61 +47,14 @@ struct vkp_image {
VkBuffer linear_buf;
VkDeviceMemory linear_mem;
VkBufferImageCopy linear_copy;
enum vkp_image_source source_type;
int source_fd;
uint32_t source_drm_format, source_stride, source_offset;
uint64_t source_modifier;
uint8_t *recovery_pixels;
struct vkp_image *next;
};
static struct vkp_image *g_client_images;
static struct vkp_image *g_rb;
static int g_recovery_attempted;
static void image_register(struct vkp_image *img) {
if (!img) return;
img->next = g_client_images;
g_client_images = img;
}
static void image_unregister(struct vkp_image *img) {
struct vkp_image **p = &g_client_images;
while (*p && *p != img) p = &(*p)->next;
if (*p) *p = img->next;
if (img) img->next = NULL;
}
static void image_track_dmabuf(struct vkp_image *img, int fd, uint32_t drm_format,
uint64_t modifier, uint32_t stride, uint32_t offset) {
img->source_fd = dup(fd);
img->source_type = img->source_fd >= 0 ? VKP_IMAGE_SOURCE_DMABUF : VKP_IMAGE_SOURCE_NONE;
img->source_drm_format = drm_format;
img->source_modifier = modifier;
img->source_stride = stride;
img->source_offset = offset;
image_register(img);
if (img->source_type == VKP_IMAGE_SOURCE_NONE)
droiddeck_log("gpu", "device recovery unavailable for one DMA-BUF: source FD could not be retained");
}
static void image_track_ahb(struct vkp_image *img, AHardwareBuffer *buffer,
enum vkp_image_source source_type) {
AHardwareBuffer_acquire(buffer);
img->android_buffer = buffer;
img->source_type = source_type;
image_register(img);
}
static void destroy_image_objects(struct vkp_image *img);
static ANativeWindow *g_window;
static int g_ahb_import;
static int g_drm_modifiers;
static char *g_driver_path, *g_library_name, *g_native_lib_dir;
static int g_allow_driver_fallback;
static int g_dev_state;
static int dev_init(void);
static void device_lost(const char *where);
static const char *vk_result_name(VkResult r);
@@ -574,7 +518,7 @@ static void log_display_driver(void) {
g_library_name);
}
static int dev_init_once(void) {
static int dev_init(void) {
if (g_dev_state != 0) return g_dev_state == 1 ? 0 : -1;
if (vk_loader_open(g_driver_path, g_library_name, g_native_lib_dir) != 0) {
@@ -776,189 +720,6 @@ static int dev_init_once(void) {
return 0;
}
static void suspend_client_images(void) {
for (struct vkp_image *img = g_client_images; img; img = img->next) {
if (img->source_type == VKP_IMAGE_SOURCE_SHM && !img->recovery_pixels)
img->source_type = VKP_IMAGE_SOURCE_NONE;
if (img->map && g_vk.UnmapMemory && g_dev) g_vk.UnmapMemory(g_dev, img->mem);
img->map = NULL;
destroy_image_objects(img);
}
}
static int restore_client_image(struct vkp_image *img) {
if (!img || img->source_type == VKP_IMAGE_SOURCE_NONE) return -1;
struct vkp_image *replacement = NULL;
switch (img->source_type) {
case VKP_IMAGE_SOURCE_DMABUF:
if (img->source_fd >= 0)
replacement = vkp_image_import_dmabuf(img->source_fd, img->source_drm_format, img->source_modifier,
img->w, img->h, img->source_stride, img->source_offset,
img->blit_dst);
break;
case VKP_IMAGE_SOURCE_AHB_WLEGL:
replacement = vkp_image_from_android_buffer(img->android_buffer);
break;
case VKP_IMAGE_SOURCE_AHB_SOURCE:
replacement = vkp_image_from_ahb(img->android_buffer);
break;
case VKP_IMAGE_SOURCE_AHB_TARGET:
replacement = vkp_image_import_ahb(img->android_buffer, NULL, 0);
break;
case VKP_IMAGE_SOURCE_SHM:
replacement = vkp_image_create_shm(img->w, img->h);
break;
default:
break;
}
if (!replacement) return -1;
struct vkp_image *next = img->next;
const enum vkp_image_source old_type = img->source_type;
const int old_fd = img->source_fd;
AHardwareBuffer *old_ahb = img->android_buffer;
uint8_t *pixels = img->recovery_pixels;
image_unregister(replacement);
*img = *replacement;
img->next = next;
free(replacement);
if (old_type == VKP_IMAGE_SOURCE_DMABUF && old_fd >= 0) close(old_fd);
if (old_ahb) AHardwareBuffer_release(old_ahb);
if (old_type == VKP_IMAGE_SOURCE_SHM && pixels && img->map) {
const size_t row_bytes = (size_t)img->w * 4;
for (int y = 0; y < img->h; y++)
memcpy((uint8_t *)img->map + img->offset + (size_t)y * img->row_pitch,
pixels + (size_t)y * row_bytes, row_bytes);
img->recovery_pixels = pixels;
pixels = NULL;
}
free(pixels);
return 0;
}
static int restore_client_images(void) {
int failed = 0;
for (struct vkp_image *img = g_client_images; img; ) {
struct vkp_image *next = img->next;
if (restore_client_image(img) != 0) {
failed++;
droiddeck_log("error", "GPU recovery: could not re-import a retained %dx%d client buffer",
img->w, img->h);
}
img = next;
}
return failed ? -1 : 0;
}
static void release_lost_device(void) {
vkp_pass_abort();
blendp_destroy();
vkp_effects_destroy();
hdrc_destroy();
vkp_cardboard_destroy();
vkp_framegen_device_lost();
vkp_gpu_busy_device_lost();
suspend_client_images();
if (g_rb) {
vkp_image_destroy(g_rb);
g_rb = NULL;
}
if (g_scene.img) g_vk.DestroyImage(g_dev, g_scene.img, NULL);
if (g_scene.mem) g_vk.FreeMemory(g_dev, g_scene.mem, NULL);
memset(&g_scene, 0, sizeof(g_scene));
struct vkp_img_slot *slots[] = {&g_mixed, &g_hdrscene, &g_fgscene};
for (size_t i = 0; i < sizeof(slots) / sizeof(slots[0]); i++) {
if (slots[i]->img) g_vk.DestroyImage(g_dev, slots[i]->img, NULL);
if (slots[i]->mem) g_vk.FreeMemory(g_dev, slots[i]->mem, NULL);
memset(slots[i], 0, sizeof(*slots[i]));
}
if (g_black_img) g_vk.DestroyImage(g_dev, g_black_img, NULL);
if (g_black_mem) g_vk.FreeMemory(g_dev, g_black_mem, NULL);
g_black_img = VK_NULL_HANDLE;
g_black_mem = VK_NULL_HANDLE;
g_black_state = 0;
for (int i = 0; i < MAX_PRESENTS; i++) {
if (g_acqs[i]) g_vk.DestroySemaphore(g_dev, g_acqs[i], NULL);
if (g_rnds[i]) g_vk.DestroySemaphore(g_dev, g_rnds[i], NULL);
g_acqs[i] = g_rnds[i] = VK_NULL_HANDLE;
}
if (g_wait_sem) g_vk.DestroySemaphore(g_dev, g_wait_sem, NULL);
g_wait_sem = VK_NULL_HANDLE;
if (g_fence) g_vk.DestroyFence(g_dev, g_fence, NULL);
g_fence = VK_NULL_HANDLE;
if (g_pool) g_vk.DestroyCommandPool(g_dev, g_pool, NULL);
g_pool = VK_NULL_HANDLE;
memset(g_cmds, 0, sizeof(g_cmds));
if (g_swapchain) g_vk.DestroySwapchainKHR(g_dev, g_swapchain, NULL);
g_swapchain = VK_NULL_HANDLE;
free(g_images);
g_images = NULL;
g_nimg = 0;
if (g_surface) g_vk.DestroySurfaceKHR(g_inst, g_surface, NULL);
g_surface = VK_NULL_HANDLE;
if (g_dev) g_vk.DestroyDevice(g_dev, NULL);
g_dev = VK_NULL_HANDLE;
if (g_inst) g_vk.DestroyInstance(g_inst, NULL);
g_inst = VK_NULL_HANDLE;
vk_loader_close();
g_pd = VK_NULL_HANDLE;
g_queue = VK_NULL_HANDLE;
g_qfam = 0;
memset(&g_memprops, 0, sizeof(g_memprops));
memset(&g_map, 0, sizeof(g_map));
memset(&g_extent, 0, sizeof(g_extent));
memset(&g_caps_extent, 0, sizeof(g_caps_extent));
g_surface_transform_known = 0;
g_surface_checked_ns = 0;
g_ahb_import = 0;
g_drm_modifiers = 0;
g_colorspace_ext = 0;
g_import_sem_fd = NULL;
g_ahb_properties = NULL;
g_set_hdr_metadata = NULL;
g_swap_extra = 0;
g_swap_is_hdr = 0;
g_swap_fmt = VK_FORMAT_UNDEFINED;
g_swap_md_identity = 0;
g_swap_retry_at_ns = 0;
g_swap_fail_logged = 0;
g_base_black = 0;
g_dev_state = 0;
}
static int dev_init(void) {
if (g_dev_state != -2) return dev_init_once();
if (g_recovery_attempted) return -1;
g_recovery_attempted = 1;
droiddeck_log("gpu", "VK_ERROR_DEVICE_LOST: attempting one in-process compositor recovery");
release_lost_device();
if (dev_init_once() != 0) {
if (g_dev_state == -3) {
droiddeck_log("error", "GPU recovery initialization left completion unknown; retaining resources");
return -1;
}
release_lost_device();
g_dev_state = -2;
droiddeck_log("error", "GPU recovery failed while recreating the Vulkan device; restart the session");
set_fault("the display GPU was lost and in-process recovery failed");
return -1;
}
if (restore_client_images() != 0) {
release_lost_device();
g_dev_state = -2;
droiddeck_log("error", "GPU recovery could not restore every client buffer; restart the session");
set_fault("the display GPU was lost and some client buffers could not be restored");
return -1;
}
g_recovery_attempted = 0;
droiddeck_log("gpu", "Vulkan device and retained client buffers recovered");
return 0;
}
int vkp_ready(void) { return dev_init(); }
static int swap_init_locked(void);
@@ -1455,8 +1216,6 @@ struct vkp_image *vkp_image_from_android_buffer(AHardwareBuffer *buffer) {
if (result != VK_SUCCESS) goto fail;
AHardwareBuffer_acquire(buffer);
img->android_buffer = buffer;
img->source_type = VKP_IMAGE_SOURCE_AHB_WLEGL;
image_register(img);
return img;
fail:
LOGE("android_wlegl: Vulkan buffer import failed: %s", vk_result_name(result));
@@ -1608,7 +1367,6 @@ struct vkp_image *vkp_image_import_dmabuf(int fd, uint32_t drm_format, uint64_t
if (linear_size && import_linear_dmabuf(img, fd, &linear_copy, linear_size) == 0) {
if (padded_target) droiddeck_log("gpu", "linear layer target %dx%d writes at pitch %u via DMA-BUF",
w, h, stride);
image_track_dmabuf(img, fd, drm_format, modifier, stride, offset);
return img;
}
if (padded_target) { free(img); return NULL; }
@@ -1678,12 +1436,11 @@ struct vkp_image *vkp_image_import_dmabuf(int fd, uint32_t drm_format, uint64_t
g_vk.FreeMemory(g_dev, img->mem, NULL); g_vk.DestroyImage(g_dev, img->image, NULL);
free(img); return NULL;
}
image_track_dmabuf(img, fd, drm_format, modifier, stride, offset);
return img;
}
void vkp_wait_idle(void) {
if (g_dev_state == 1 && g_dev && g_vk.DeviceWaitIdle) g_vk.DeviceWaitIdle(g_dev);
if (g_dev && g_vk.DeviceWaitIdle) g_vk.DeviceWaitIdle(g_dev);
}
struct vkp_image *vkp_image_from_ahb(AHardwareBuffer *ahb) {
@@ -1733,7 +1490,6 @@ struct vkp_image *vkp_image_from_ahb(AHardwareBuffer *ahb) {
if (img->mem) g_vk.FreeMemory(g_dev, img->mem, NULL);
g_vk.DestroyImage(g_dev, img->image, NULL); free(img); return NULL;
}
image_track_ahb(img, ahb, VKP_IMAGE_SOURCE_AHB_SOURCE);
return img;
}
@@ -1829,7 +1585,6 @@ struct vkp_image *vkp_image_import_ahb(struct AHardwareBuffer *ahb, char *info,
if (info && info_n)
snprintf(info, info_n, "VkFormat %d, %llu bytes, memory type %d of memoryTypeBits %#x", (int)fp.format,
(unsigned long long)hp.allocationSize, idx, hp.memoryTypeBits);
image_track_ahb(img, ahb, VKP_IMAGE_SOURCE_AHB_TARGET);
return img;
}
@@ -1883,34 +1638,13 @@ struct vkp_image *vkp_image_create_shm(int w, int h) {
if (g_vk.MapMemory(g_dev, img->mem, 0, req.size, 0, &img->map) != VK_SUCCESS) {
vkp_image_destroy(img); return NULL;
}
img->source_type = VKP_IMAGE_SOURCE_SHM;
image_register(img);
return img;
}
void vkp_image_upload_shm(struct vkp_image *img, const void *data, int stride) {
if (!img || !data || img->w <= 0 || img->h <= 0 || stride <= 0 ||
(size_t)img->w > SIZE_MAX / 4)
return;
const size_t full_rowbytes = (size_t)img->w * 4;
size_t rowbytes = full_rowbytes;
if (g_dev_state != 1 || !img || !img->map || !data) return;
size_t rowbytes = (size_t)img->w * 4;
if ((size_t)stride < rowbytes) rowbytes = (size_t)stride;
if (img->source_type == VKP_IMAGE_SOURCE_SHM && !img->recovery_pixels) {
if ((size_t)img->h <= SIZE_MAX / full_rowbytes) {
const size_t bytes = full_rowbytes * (size_t)img->h;
img->recovery_pixels = calloc(1, bytes);
}
if (!img->recovery_pixels) img->source_type = VKP_IMAGE_SOURCE_NONE;
}
if (img->source_type == VKP_IMAGE_SOURCE_SHM && img->recovery_pixels) {
for (int y = 0; y < img->h; y++)
memcpy(img->recovery_pixels + (size_t)y * full_rowbytes,
(const uint8_t *)data + (size_t)y * stride, rowbytes);
}
if (g_dev_state != 1 || !img->map) return;
for (int y = 0; y < img->h; y++)
memcpy((uint8_t *)img->map + img->offset + (size_t)y * img->row_pitch,
(const uint8_t *)data + (size_t)y * stride, rowbytes);
@@ -1927,10 +1661,7 @@ void vkp_image_destroy(struct vkp_image *img) {
if (img->map) g_vk.UnmapMemory(g_dev, img->mem);
destroy_image_objects(img);
}
image_unregister(img);
if (img->source_type == VKP_IMAGE_SOURCE_DMABUF && img->source_fd >= 0) close(img->source_fd);
if (img->android_buffer) AHardwareBuffer_release(img->android_buffer);
free(img->recovery_pixels);
free(img);
}
@@ -2194,23 +1925,14 @@ static int compose_hdr(VkCommandBuffer cmd, const struct vkp_draw *draws, int n,
}
static void device_lost(const char *where) {
if (g_dev_state == -2 || g_dev_state == -3) return;
if (g_dev_state == 1) {
VkResult idle = g_vk.DeviceWaitIdle ? g_vk.DeviceWaitIdle(g_dev) : VK_ERROR_UNKNOWN;
if (idle != VK_SUCCESS && idle != VK_ERROR_DEVICE_LOST) {
quarantine_pending_work(idle, "device-loss idle");
return;
}
}
if (g_dev_state == -2) return;
g_dev_state = -2;
g_base_black = 0;
vkp_framegen_device_lost();
vkp_gpu_busy_device_lost();
droiddeck_log("error", "GPU device lost (VK_ERROR_DEVICE_LOST in %s): the compositor will try one in-process recovery",
where);
set_fault("the display GPU was lost (VK_ERROR_DEVICE_LOST in %s); recovery pending", where);
droiddeck_log("error", "GPU device lost (VK_ERROR_DEVICE_LOST in %s): the compositor has stopped presenting; "
"restart the session", where);
set_fault("the display GPU was lost (VK_ERROR_DEVICE_LOST in %s)", where);
for (uint32_t i = 0; i < g_nimg; i++) blendp_forget_image(g_images[i]);
if (g_swapchain) g_vk.DestroySwapchainKHR(g_dev, g_swapchain, NULL);
g_swapchain = VK_NULL_HANDLE;
@@ -2435,10 +2157,11 @@ static void send_hdr_metadata(const struct droiddeck_color *c) {
static int render_impl(int scene_w, int scene_h, const struct vkp_draw *draws, int n,
const struct vkp_hdr_frame *hf, int *how) {
if (how) *how = 0;
if (g_dev_state == -1 || g_dev_state == -3) return -1;
if (g_dev_state < 0) return -1;
vkp_apply_window_request();
sc_layer_hide_base();
check_surface_changed();
if (g_dev_state == -2) return -1;
if (dev_init() != 0 || !g_window || scene_w <= 0 || scene_h <= 0) return -1;
if (g_swapchain && vkp_framegen_extra_images() != g_swap_extra) {
@@ -2783,7 +2506,7 @@ void vkp_signal_first_frame(void) {
}
int vkp_update_map(int scene_w, int scene_h) {
if (dev_init() != 0 || !g_window || scene_w <= 0 || scene_h <= 0) return -1;
if (g_dev_state == -2 || dev_init() != 0 || !g_window || scene_w <= 0 || scene_h <= 0) return -1;
if (vkp_quest_layer_presentation()) {
int w = ANativeWindow_getWidth(g_window), h = ANativeWindow_getHeight(g_window);
if (w <= 0 || h <= 0) return -1;
@@ -2857,7 +2580,7 @@ static void blit_to_layer(VkCommandBuffer cmd, VkImage src, VkImageLayout src_la
}
int vkp_blit_image(struct vkp_image *src, struct vkp_image *dst, int wait_fd) {
if (!src || src->blit_dst || !dst || !dst->blit_dst || dev_init() != 0) {
if (!src || src->blit_dst || !dst || !dst->blit_dst || g_dev_state == -2 || dev_init() != 0) {
if (wait_fd >= 0) close(wait_fd);
return -1;
}
@@ -2920,9 +2643,11 @@ int vkp_blit_image(struct vkp_image *src, struct vkp_image *dst, int wait_fd) {
static struct vkp_image *g_rb;
int vkp_image_readback(struct vkp_image *src, uint32_t *out, int max_px) {
if (!src || src->blit_dst || !out || src->w <= 0 || src->h <= 0 || src->w * src->h > max_px ||
dev_init() != 0)
g_dev_state == -2 || dev_init() != 0)
return -1;
if (g_rb && (g_rb->w != src->w || g_rb->h != src->h)) { vkp_image_destroy(g_rb); g_rb = NULL; }
if (!g_rb) {
@@ -6960,7 +6960,9 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
if (!hasFocus && ::padMouse.isInitialized) padMouse.reset()
if (runtimeRemovalBlocked) return
if (!hasFocus) {
cancelTouchGestures()
if (::touchscreenGestures.isInitialized) touchscreenGestures.cancel()
if (::touchpad.isInitialized) touchpad.cancel()
if (::scrollTouch.isInitialized) scrollTouch.cancel()
releaseHeldGuestInput()
}
if (hasFocus && !pipUi) {
@@ -0,0 +1,69 @@
package com.droiddeck.launcher.companion
import com.droiddeck.launcher.session.LoopbackWebSocket
import kotlinx.coroutines.currentCoroutineContext
import kotlinx.coroutines.delay
import kotlinx.coroutines.ensureActive
import kotlinx.coroutines.isActive
import kotlinx.coroutines.suspendCancellableCoroutine
import java.util.concurrent.atomic.AtomicReference
import kotlin.concurrent.thread
import kotlin.coroutines.resume
class CompanionLink(private val port: Int, private val path: String = "/") {
private val socket = AtomicReference<LoopbackWebSocket?>(null)
val connected: Boolean get() = socket.get() != null
private val sender = java.util.concurrent.Executors.newSingleThreadExecutor { r -> Thread(r, "companion-send-$port").apply { isDaemon = true } }
fun send(text: String): Boolean {
val ws = socket.get() ?: return false
sender.execute { runCatching { ws.send(text) } }
return true
}
fun close() {
sender.shutdown()
}
suspend fun run(onConnected: (Boolean) -> Unit, onText: (String) -> Unit, hello: String? = null) {
while (currentCoroutineContext().isActive) {
val ws = runCatching { LoopbackWebSocket(port, path) }.getOrNull()
if (ws == null) {
delay(RETRY_MS)
continue
}
socket.set(ws)
onConnected(true)
try {
hello?.let { runCatching { ws.send(it) } }
readUntilClosed(ws, onText)
} finally {
socket.set(null)
runCatching { ws.close() }
onConnected(false)
}
currentCoroutineContext().ensureActive()
delay(RETRY_MS)
}
}
private suspend fun readUntilClosed(ws: LoopbackWebSocket, onText: (String) -> Unit) = suspendCancellableCoroutine { cont ->
val reader = thread(name = "companion-$port", isDaemon = true) {
try {
while (true) onText(ws.receive() ?: break)
} catch (_: Exception) {
}
if (cont.isActive) cont.resume(Unit)
}
cont.invokeOnCancellation {
runCatching { ws.close() }
reader.interrupt()
}
}
private companion object {
const val RETRY_MS = 3_000L
}
}
@@ -0,0 +1,99 @@
package com.droiddeck.launcher.companion
import org.json.JSONArray
import org.json.JSONObject
/** Vitals and quick slots read from SkyrimWebSocket (Skyrim) or Thor Pip-Boy (Fallout 4), which share a subscribe protocol. */
object RpgCompanion {
const val SKYRIM_SE = 489830L
const val FALLOUT_4 = 377160L
const val SKYRIM_PORT = 8765
const val PIPBOY_PORT = 8767
data class Bar(val key: String, val value: Float, val max: Float)
data class Slot(val key: String, val label: String, val detail: String, val active: Boolean)
data class State(
val bars: List<Bar> = emptyList(),
val level: Int? = null,
val facts: List<Pair<String, String>> = emptyList(),
val slots: List<Slot> = emptyList(),
val radio: Boolean? = null,
)
fun port(appId: Long): Int = if (appId == FALLOUT_4) PIPBOY_PORT else SKYRIM_PORT
fun subscribe(appId: Long): String = if (appId == FALLOUT_4) {
JSONObject().put("type", "subscribe").put("id", SUB).put("settings", JSONObject().put("frequency", 500))
.put("fields", JSONArray(listOf("player.stats", "player.inventory", "radio"))).toString()
} else {
val fields = JSONObject()
for ((alias, key) in SKYRIM_FIELDS) fields.put(alias, key)
JSONObject().put("type", "subscribe").put("id", SUB)
.put("settings", JSONObject().put("frequency", 500).put("sendOnChange", true)).put("fields", fields).toString()
}
fun reduce(appId: Long, state: State, text: String): State {
val m = runCatching { JSONObject(text) }.getOrNull() ?: return state
if (m.optString("type") != "data" || m.optString("id") != SUB) return state
return if (appId == FALLOUT_4) pipBoy(state, m.optJSONObject("data") ?: return state)
else skyrim(state, m.optJSONObject("fields") ?: return state)
}
fun trigger(appId: Long, slot: Slot, seq: Int): String = if (appId == FALLOUT_4) {
JSONObject().put("type", "command").put("id", "dd-$seq").put("command", "toggle")
.put("params", JSONObject().put("id", slot.key)).toString()
} else {
JSONObject().put("type", "command").put("id", "dd-$seq").put("command", "hotkey_trigger").put("slot", slot.key.toInt()).toString()
}
fun radio(on: Boolean, seq: Int): String =
JSONObject().put("type", "command").put("id", "dd-$seq").put("command", "radio").put("params", JSONObject().put("enable", on)).toString()
private fun skyrim(state: State, f: JSONObject): State {
fun bar(key: String) = if (f.has(key) && f.has("$key.max")) Bar(key, f.optDouble(key).toFloat(), f.optDouble("$key.max").toFloat()) else null
val bars = listOfNotNull(bar("health"), bar("magicka"), bar("stamina")).ifEmpty { state.bars }
val slots = f.optJSONArray("hotkeys")?.let { arr ->
List(arr.length()) { arr.optJSONObject(it) }.filterNotNull().filter { it.optBoolean("bound") }.map {
Slot(it.optInt("slot").toString(), it.optString("name"), it.optString("school").ifEmpty { it.optString("categoryType") }, false)
}
} ?: state.slots
val facts = buildList {
if (f.has("weight") && f.has("carry")) add("weight" to "%.0f / %.0f".format(f.optDouble("weight"), f.optDouble("carry")))
}.ifEmpty { state.facts }
return state.copy(bars = bars, level = if (f.has("level")) f.optInt("level") else state.level, facts = facts, slots = slots)
}
private fun pipBoy(state: State, d: JSONObject): State {
var next = state
d.optJSONObject("player.stats")?.let { s ->
next = next.copy(
bars = listOf(Bar("hp", s.optDouble("hp").toFloat(), s.optDouble("hpMax").toFloat()),
Bar("ap", s.optDouble("ap").toFloat(), s.optDouble("apMax").toFloat())),
level = s.optInt("level"),
facts = listOf("caps" to s.optInt("caps").toString(), "rads" to s.optInt("rads").toString(),
"weight" to "%.0f / %.0f".format(s.optDouble("weight"), s.optDouble("weightMax"))),
)
}
d.optJSONArray("player.inventory")?.let { inv ->
next = next.copy(slots = List(inv.length()) { inv.optJSONObject(it) }.filterNotNull()
.filter { it.has("fav") && it.optInt("fav", -1) >= 0 }
.sortedBy { it.optInt("fav") }
.map { Slot(it.optString("id"), it.optString("name"), countText(it), it.optBoolean("equipped")) })
}
d.optJSONObject("radio")?.let { next = next.copy(radio = it.optBoolean("enabled")) }
return next
}
private fun countText(item: JSONObject): String = item.optInt("count", 1).let { if (it > 1) "×$it" else "" }
private const val SUB = "droiddeck"
private val SKYRIM_FIELDS = listOf(
"health" to "ActorValue::kHealth", "health.max" to "ActorValue::kHealth::Permanent",
"magicka" to "ActorValue::kMagicka", "magicka.max" to "ActorValue::kMagicka::Permanent",
"stamina" to "ActorValue::kStamina", "stamina.max" to "ActorValue::kStamina::Permanent",
"level" to "Player::Level", "weight" to "Player::InventoryWeight", "carry" to "Player::CarryWeight",
"hotkeys" to "Hotkey::Items",
)
}
@@ -0,0 +1,86 @@
package com.droiddeck.launcher.companion
import org.json.JSONArray
import org.json.JSONObject
object StardewCompanion {
const val APP_ID = 413150L
const val PORT = 7786
const val HOTBAR = 12
data class Day(
val season: String, val day: Int, val year: Int, val weekday: String, val time: Int,
val weather: String, val weatherTomorrow: String, val gold: Long,
val energy: Int, val maxEnergy: Int, val health: Int, val maxHealth: Int, val location: String,
)
data class Item(val slot: Int, val id: String, val name: String, val count: Int, val quality: Int)
data class Quest(val title: String, val objective: String, val daysLeft: Int, val complete: Boolean)
data class Birthday(val name: String, val npc: String, val days: Int)
data class State(
val save: String? = null,
val day: Day? = null,
val selected: Int = 0,
val items: List<Item> = emptyList(),
val quests: List<Quest> = emptyList(),
val birthdays: List<Birthday> = emptyList(),
val sprites: Map<String, String> = emptyMap(),
) {
val inGame: Boolean get() = !save.isNullOrEmpty()
val hotbar: List<Item?> get() = List(HOTBAR) { slot -> items.firstOrNull { it.slot == slot && it.id.isNotEmpty() } }
}
fun reduce(state: State, text: String): State {
val m = runCatching { JSONObject(text) }.getOrNull() ?: return state
return when (m.optString("type")) {
"game_info" -> state.copy(save = m.optString("saveName"))
"sdv_day" -> state.copy(day = Day(
m.optString("season"), m.optInt("day"), m.optInt("year"), m.optString("weekday"), m.optInt("timeOfDay"),
m.optString("weatherToday"), m.optString("weatherTomorrow"), m.optLong("gold"),
m.optInt("energy"), m.optInt("maxEnergy"), m.optInt("health"), m.optInt("maxHealth"), m.optString("location"),
))
"sdv_inventory" -> state.copy(selected = m.optInt("selected"), items = objects(m.optJSONArray("items")).map {
Item(it.optInt("slot"), it.optString("id"), it.optString("name"), it.optInt("count", 1), it.optInt("quality"))
})
"sdv_quests" -> state.copy(quests = objects(m.optJSONArray("quests")).map {
Quest(it.optString("title"), it.optString("objective"), it.optInt("daysLeft", -1), flag(it, "complete"))
})
"sdv_villagers" -> state.copy(birthdays = objects(m.optJSONArray("villagers"))
.filter { it.has("birthdayIn") && it.optInt("birthdayIn", -1) in 0..7 }
.map { Birthday(it.optString("name"), it.optString("npc"), it.optInt("birthdayIn")) }
.sortedBy { it.days })
"sdv_sprite" -> {
val id = m.optString("id")
val png = m.optString("png")
if (id.isEmpty() || png.isEmpty()) state else state.copy(sprites = state.sprites + (id to png))
}
else -> state
}
}
fun selectSlot(slot: Int): String = JSONObject().put("type", "select_slot").put("slot", slot).toString()
fun refresh(): String = JSONObject().put("type", "refresh").toString()
/** 610 is 6:10 am; the game's clock runs past midnight up to 2600. */
fun clock(time: Int, twelveHour: Boolean): String {
val hours = time / 100 % 24
val minutes = time % 100
if (!twelveHour) return "%d:%02d".format(hours, minutes)
val h = if (hours % 12 == 0) 12 else hours % 12
return "%d:%02d %s".format(h, minutes, if (hours < 12) "am" else "pm")
}
private fun flag(o: JSONObject, name: String): Boolean = when (val v = o.opt(name)) {
is Boolean -> v
is Number -> v.toInt() != 0
is String -> v == "1" || v.equals("true", true)
else -> false
}
private fun objects(array: JSONArray?): List<JSONObject> =
if (array == null) emptyList() else List(array.length()) { array.optJSONObject(it) }.filterNotNull()
}
@@ -233,14 +233,14 @@ object AddedGames {
if (folder.name.lowercase() in steamInstalls || isSteamLibraryFolder(folder.name)) continue
if (folder.path in removed) continue
if (folder.name == "Games" && StoreInstallRoot.roots(context).any { it.absolutePath == folder.absolutePath }) continue
timed(folder) { for (game in expand(folder, entries, reuse = true)) if (game.path !in removed) scanGame(context, game, out, reuse = true) }
for (game in expand(folder, entries, reuse = true)) if (game.path !in removed) scanGame(context, game, out, reuse = true)
}
}
for (entry in AddedExes.list(context)) {
val folder = File(entry.folder)
if (folder.path in removed || !folder.isDirectory) continue
if (StoreGameSidecar.read(folder)?.isInstalled == false) continue
timed(folder) { scanGame(context, folder, out, single = entry, reuse = true) }
scanGame(context, folder, out, single = entry, reuse = true)
}
for (folder in libraryDepotInstalls(context)) if (folder.path !in removed) scanGame(context, folder, out, reuse = true)
for (folder in StoreInstallRoot.gameFolders(context)) if (StoreInstallRoot.isFinished(folder)) scanGame(context, folder, out, reuse = true)
@@ -250,15 +250,6 @@ object AddedGames {
return out.distinctBy { it.folder.canonicalPath }
}
private const val SLOW_FOLDER_MS = 1_000L
private inline fun timed(folder: File, block: () -> Unit) {
val began = android.os.SystemClock.elapsedRealtime()
block()
val took = android.os.SystemClock.elapsedRealtime() - began
if (took >= SLOW_FOLDER_MS) Log.i(TAG, "games: scanning ${folder.path} took ${took}ms")
}
fun single(context: Context, folderPath: String, reuse: Boolean = false): Game? {
val folder = File(folderPath)
if (!folder.isDirectory || folderPath in SessionPrefs.removedAddedGames(context)) return null
@@ -573,10 +564,8 @@ object AddedGames {
class Listed(val appId: Long, val name: String, val launchOptions: String)
fun listingFile(context: Context): File = File(context.filesDir, "session/added-games.json")
fun listed(context: Context): List<Listed>? = runCatching {
val file = listingFile(context)
val file = File(context.filesDir, "session/added-games.json")
if (!file.isFile) return null
val entries = org.json.JSONArray(file.readText())
(0 until entries.length()).mapNotNull { i ->
@@ -586,7 +575,7 @@ object AddedGames {
fun writeListing(context: Context, games: List<Game>,
extra: List<JSONObject> = listOfNotNull(com.droiddeck.launcher.stores.epic.EpicClient.steamListing(context))): File {
val file = listingFile(context).apply { parentFile?.mkdirs() }
val file = File(context.filesDir, "session/added-games.json").apply { parentFile?.mkdirs() }
val json = StringBuilder("[")
games.forEachIndexed { i, g ->
if (i > 0) json.append(',')
@@ -607,24 +596,10 @@ object AddedGames {
if (games.isNotEmpty() || i > 0) json.append(',')
json.append(entry.toString())
}
val text = json.append(']').toString()
synchronized(listing) {
val partial = File(file.parentFile, file.name + ".part")
try {
partial.writeText(text)
java.nio.file.Files.move(partial.toPath(), file.toPath(),
java.nio.file.StandardCopyOption.ATOMIC_MOVE, java.nio.file.StandardCopyOption.REPLACE_EXISTING)
} catch (e: java.io.IOException) {
Log.w(TAG, "games: listing not replaced: ${e.message}")
partial.delete()
if (!file.isFile) file.writeText(text)
}
}
file.writeText(json.append(']').toString())
return file
}
private val listing = Any()
private fun artGuestPath(context: Context, file: File): String? {
val files = context.filesDir.absolutePath
if (file.absolutePath.startsWith("$files/")) return file.absolutePath
@@ -1,31 +1,17 @@
package com.droiddeck.launcher.frontend
import android.content.Context
import android.os.SystemClock
import android.util.Log
import androidx.annotation.VisibleForTesting
import com.droiddeck.launcher.session.SessionPhase
import com.droiddeck.launcher.session.SessionPrefs
import com.droiddeck.launcher.session.SessionState
import com.droiddeck.launcher.stores.SteamLiveShortcuts
import java.io.File
import java.util.concurrent.Callable
import java.util.concurrent.Executors
object AddedGamesPublisher {
private const val TAG = "AddedGamesPublisher"
private const val CLIENT_WAIT_MS = 600_000L
private const val POLL_MS = 1_000L
private const val RETRY_MS = 5_000L
@VisibleForTesting
@Volatile
internal var now = false
@VisibleForTesting
@Volatile
internal var live: (Context, List<AddedGames.Game>, (AddedGames.Game) -> Boolean) -> Boolean = SteamLiveShortcuts::sync
private val worker = Executors.newSingleThreadExecutor { r -> Thread(r, "added-games-publish") }
fun later(context: Context, live: () -> Unit = {}) {
@@ -37,56 +23,10 @@ object AddedGamesPublisher {
if (now) work.run() else worker.execute(work)
}
fun republish(context: Context): List<AddedGames.Game> {
fun republish(context: Context) {
val games = AddedGames.scan(context)
AddedGames.writeListing(context, games)
val arch = SessionPrefs.activeSteamClientArch(context)
val arch = com.droiddeck.launcher.session.SessionPrefs.activeSteamClientArch(context)
LibraryCache.save(context, Library.launchableGames(context, added = games, arch = arch), arch == "x86_64")
return games
}
fun sessionListing(context: Context): File {
val app = context.applicationContext
val started = AddedGames.listed(app)?.map { it.appId }?.toSet()
?: return AddedGames.writeListing(app, AddedGames.scan(app).also { log(it) })
val session = SessionState.sessionId
val work = Runnable {
try {
val began = SystemClock.elapsedRealtime()
val games = serial { republish(app) }
Log.i(TAG, "session refresh: ${games.size} game(s) in ${SystemClock.elapsedRealtime() - began} ms")
log(games)
val fresh = games.filter { (it.appId and 0xFFFFFFFFL) !in started }
if (fresh.isNotEmpty()) deliver(app, session, fresh)
} catch (e: Exception) {
Log.w(TAG, "session refresh: ${e.message}")
}
}
if (now) work.run() else Thread(work, "added-games-refresh").apply { priority = Thread.MIN_PRIORITY }.start()
return AddedGames.listingFile(app)
}
internal fun log(games: List<AddedGames.Game>) {
if (games.isNotEmpty()) Log.i(TAG, "added games: " + games.joinToString { "${it.name} (${it.exe.name})" })
}
private fun deliver(app: Context, session: String?, games: List<AddedGames.Game>) {
val until = SystemClock.uptimeMillis() + CLIENT_WAIT_MS
while (current(session)) {
val ready = SessionState.phase == SessionPhase.READY
if (ready && serial { !current(session) || (SessionState.phase == SessionPhase.READY && syncUnremoved(app, games)) }) return
if (now || SystemClock.uptimeMillis() >= until) return
Thread.sleep(if (ready) RETRY_MS else POLL_MS)
}
}
private fun current(session: String?): Boolean =
SessionState.running && !SessionState.stopRequested && SessionState.sessionId == session
private fun syncUnremoved(app: Context, games: List<AddedGames.Game>): Boolean {
val removed = SessionPrefs.removedAddedGames(app).toSet()
return live(app, games) { it.folder.path !in removed }
}
private fun <T> serial(block: () -> T): T = if (now) block() else worker.submit(Callable { block() }).get()
}
@@ -51,12 +51,11 @@ object GameExePicker {
val entries = dir.listFiles()?.sortedBy { it.name.lowercase() } ?: continue
for (f in entries) {
if (visited >= WALK_BUDGET) break@walk
val attrs = attributes(f) ?: continue
if (attrs.isSymbolicLink) continue
if (attrs.isDirectory) {
if (isLink(f)) continue
if (f.isDirectory) {
visited++
if (depth < MAX_DEPTH && !skipDir(f, f.relativeTo(folder).invariantSeparatorsPath)) next.add(f)
} else if (attrs.isRegularFile && f.name.endsWith(".exe", ignoreCase = true)) {
} else if (f.isFile && f.name.endsWith(".exe", ignoreCase = true)) {
visited++
if (!JUNK_EXE_RE.matches(f.nameWithoutExtension)) found.add(f to depth)
}
@@ -99,9 +98,7 @@ object GameExePicker {
return SKIP_PATHS.any { rel == it || rel.endsWith("/$it") }
}
private fun attributes(f: File): java.nio.file.attribute.BasicFileAttributes? = runCatching {
java.nio.file.Files.readAttributes(f.toPath(), java.nio.file.attribute.BasicFileAttributes::class.java, java.nio.file.LinkOption.NOFOLLOW_LINKS)
}.getOrNull()
private fun isLink(f: File): Boolean = runCatching { java.nio.file.Files.isSymbolicLink(f.toPath()) }.getOrDefault(false)
private fun key(s: String) = s.lowercase().filter { it.isLetterOrDigit() }
}
@@ -2,7 +2,6 @@ package com.droiddeck.launcher.input
import android.os.Handler
import android.os.Looper
import android.os.SystemClock
import android.view.MotionEvent
import kotlin.math.abs
@@ -25,7 +24,6 @@ class DirectTouchHold(
private var delayMs = 0L
private var holdBehavior = TouchGestureConfig.MOUSE_BEHAVIOR_CLICK
private var forwarded = false
private var forwardedAt = 0L
private var held = false
private var pressing = false
private var upX = 0f
@@ -127,11 +125,8 @@ class DirectTouchHold(
upX = event.x
upY = event.y
liftId = event.getPointerId(event.actionIndex)
val wait = MIN_PRESS_MS - (SystemClock.uptimeMillis() - forwardedAt)
if (wait > 0L) {
liftPending = true
handler.postDelayed(lift, wait)
} else lift.run()
liftPending = true
handler.postDelayed(lift, LIFT_MS)
}
MotionEvent.ACTION_CANCEL -> cancel()
}
@@ -141,10 +136,9 @@ class DirectTouchHold(
private fun forwardDown() {
touch.down(downId, downX, downY)
forwarded = true
forwardedAt = SystemClock.uptimeMillis()
}
private companion object {
const val MIN_PRESS_MS = 50L
const val LIFT_MS = 50L
}
}
@@ -149,8 +149,6 @@ public class FakeInputWriter {
private static native void nativeStoreFence();
private static native void nativeWake(ByteBuffer ring, int offset);
public static void storeFence() {
nativeStoreFence();
}
@@ -457,7 +455,6 @@ public class FakeInputWriter {
writeSnapshotLocked(ring);
nativeStoreFence();
ring.putLong(RING_WRITE_SEQ_OFFSET, writeSeq);
nativeWake(ring, RING_WRITE_SEQ_OFFSET);
}
return true;
}
@@ -17,11 +17,12 @@ enum class SecondScreenMode(val id: String, @StringRes val label: Int, val bindi
DASHBOARD("dashboard", R.string.second_mode_dashboard),
GUIDES("guides", R.string.bottom_page_guides),
MIRROR("mirror", R.string.bottom_page_mirror),
COMPANION("companion", R.string.bottom_page_companion),
STEAM_QAM("steam-qam", R.string.bottom_qam_title),
ART("art", R.string.bottom_art_title),
DESKTOP("desktop", R.string.second_mode_desktop);
val sessionPanel: Boolean get() = this == GUIDES || this == MIRROR || this == STEAM_QAM || this == ART
val sessionPanel: Boolean get() = this == GUIDES || this == MIRROR || this == COMPANION || this == STEAM_QAM || this == ART
val controls: Boolean get() = this == CUSTOM_CONTROLS || bindings != null
@@ -13,7 +13,6 @@ object GameEnvironmentStore {
private const val TAG = "GameEnvironmentStore"
private const val SETTINGS = "game-environment.json"
private const val GUEST_FILE = "root/.config/droiddeck/game-environment.json"
private const val GAME_CORES_FILE = "root/.config/droiddeck/game-cores"
const val DXVK_CONFIG = "dxvkConfig"
const val DXVK_CONFIG_GAMES = "dxvkConfigGames"
const val GAME_DEBUG_LOGS = "gameDebugLogs"
@@ -109,12 +108,10 @@ object GameEnvironmentStore {
@Synchronized
fun publish(
context: Context,
config: GameEnvironment.Config? = null,
config: GameEnvironment.Config = read(context),
gameDebugLogsOverride: Boolean? = null,
) {
publishGameCores(context)
val stored = config ?: read(context)
val resolved = stored.copy(shared = GameEnvironment.defaults(SessionPrefs.fexPreset(context), SessionPrefs.forceSsbs(context)) + stored.shared)
val resolved = config.copy(shared = GameEnvironment.defaults(SessionPrefs.fexPreset(context), SessionPrefs.forceSsbs(context)) + config.shared)
val json = encode(resolved)
val dxvk = TextureFiltering.dxvkOptions(
SessionPrefs.textureAnisotropy(context), SessionPrefs.textureLodBias(context),
@@ -143,26 +140,6 @@ object GameEnvironmentStore {
write(File(LinuxRuntime.rootDir(context), GUEST_FILE), json.toString())
}
@Synchronized
fun publishGameCores(context: Context) {
val file = File(LinuxRuntime.rootDir(context), GAME_CORES_FILE)
val pending = File(file.path + ".new")
try {
check(file.parentFile!!.isDirectory || file.parentFile!!.mkdirs())
java.io.FileOutputStream(pending).use {
it.write((com.droiddeck.launcher.core.CpuCores.restrictionOrEmpty(SessionPrefs.gameCpus(context)) + "\n").toByteArray(Charsets.UTF_8))
it.fd.sync()
}
java.nio.file.Files.move(
pending.toPath(), file.toPath(),
java.nio.file.StandardCopyOption.ATOMIC_MOVE, java.nio.file.StandardCopyOption.REPLACE_EXISTING,
)
} catch (error: Exception) {
Log.e(TAG, "Could not update game cores", error)
if (!file.delete() && file.exists()) Log.e(TAG, "Could not remove outdated game cores")
}
}
private fun write(file: File, text: String) {
check(file.parentFile!!.isDirectory || file.parentFile!!.mkdirs())
val atomic = AtomicFile(file)
@@ -1008,7 +1008,6 @@ object SessionPrefs {
fun setGameCpus(context: Context, list: String) {
prefs(context).edit().putString("gameCpus", list).apply()
GameEnvironmentStore.publishGameCores(context)
}
fun noXalia(context: Context): Boolean = prefs(context).getBoolean("noXalia", true)
@@ -1735,7 +1734,6 @@ object SessionPrefs {
signal = p.getInt("customThemeSignal", defaults.signal),
good = p.getInt("customThemeGood", defaults.good),
error = p.getInt("customThemeError", defaults.error),
warning = p.getInt("customThemeWarning", defaults.warning),
)
}
@@ -1756,7 +1754,6 @@ object SessionPrefs {
.putInt("customThemeSignal", colors.signal)
.putInt("customThemeGood", colors.good)
.putInt("customThemeError", colors.error)
.putInt("customThemeWarning", colors.warning)
.apply()
}
@@ -693,14 +693,12 @@ class SessionService : Service() {
.onFailure { Log.w(TAG, "Epic install directory setup failed", it) }
}
if (steamHere || noSteamGame) {
val listing = if (steamHere) SessionEvents.step("added-games-listing") { com.droiddeck.launcher.frontend.AddedGamesPublisher.sessionListing(this) } else {
val added = SessionEvents.step("added-games-scan") { com.droiddeck.launcher.frontend.AddedGames.scan(this) }
com.droiddeck.launcher.frontend.AddedGamesPublisher.log(added)
SessionEvents.step("added-games-listing") { com.droiddeck.launcher.frontend.AddedGames.writeListing(this, added) }
}
val added = SessionEvents.step("added-games-scan") { com.droiddeck.launcher.frontend.AddedGames.scan(this) }
val listing = SessionEvents.step("added-games-listing") { com.droiddeck.launcher.frontend.AddedGames.writeListing(this, added) }
guest.add("DD_ADDED_GAMES=" + listing.path)
if (OfflineMode.active(this)) guest.add("DD_STEAM_OFFLINE=1")
if (com.droiddeck.launcher.gpu.Lossless.owned(this)) guest.add("DD_LOSSLESS_OWNED=1")
if (added.isNotEmpty()) Log.i(TAG, "added games: " + added.joinToString { "${it.name} (${it.exe.name})" })
}
guest.add("DD_LAUNCH_DIR=" + sessionRoot.path)
// Proton builds up to 11.12 report X11 text fields under this name.
@@ -19,33 +19,25 @@ object SteamLiveShortcuts {
private const val EVAL_TIMEOUT_MS = 20_000L
private const val THAW_WAIT_MS = 15_000L
fun sync(context: Context, games: List<AddedGames.Game>, include: (AddedGames.Game) -> Boolean = { it.source != Library.ADDED }): Boolean {
fun sync(context: Context, games: List<AddedGames.Game>, include: (AddedGames.Game) -> Boolean = { it.source != Library.ADDED }) {
val wanted = games.filter(include)
if (wanted.isEmpty()) return true
if (!clientRunning()) return false
if (wanted.isEmpty() || !clientRunning()) return
val list = JSONArray()
for (g in wanted) list.put(JSONObject().put("name", g.name).put("exe", g.guestExe).put("dir", g.guestDir).put("appid", g.appId and 0xFFFFFFFFL).put("launch", g.launchOptions))
val js = """
(async () => {
const want = ${list};
let added = 0, missed = 0;
let added = 0;
for (const w of want) {
if (await ${KNOWN}(w.appid, w.name, w.exe)) continue;
if (await ${ADD}(w.name, w.exe, w.dir, true, ${JSONObject.quote(compatTool(context))}, w.launch)) added++; else missed++;
if (await ${ADD}(w.name, w.exe, w.dir, true, ${JSONObject.quote(compatTool(context))}, w.launch)) added++;
}
return JSON.stringify({ added, missed });
return added;
})()
""".trimIndent()
return synced(evaluate(context, js))
}
internal fun synced(result: String?): Boolean {
val counts = result?.let { runCatching { JSONObject(it) }.getOrNull() } ?: return false
val added = counts.optInt("added")
val missed = counts.optInt("missed")
Log.i(TAG, "live shortcuts: $added added" + if (missed > 0) ", $missed not added" else "")
if (added > 0) StoresState.logLine("Steam: $added shortcut(s) added to the running client")
return missed == 0
val result = evaluate(context, js) ?: return
Log.i(TAG, "live shortcuts: $result added")
if (result != "0") StoresState.logLine("Steam: $result shortcut(s) added to the running client")
}
fun ensure(context: Context, name: String, exe: String, dir: String, compat: Boolean, appId: Long? = null): Long? {
@@ -122,16 +122,10 @@ object StoreInstalls {
fun discard(context: Context, folder: File, caches: List<File>) {
val app = context.applicationContext
inBackground(folder) { discardNow(app, folder, caches) }
}
fun deleteLater(dir: File) = inBackground(dir) { deleteTree(dir) }
private fun inBackground(folder: File, work: () -> Unit) {
beginDiscard(folder)
val worker = Thread({
try {
work()
discardNow(app, folder, caches)
} finally {
endDiscard(folder)
}
@@ -318,7 +318,7 @@ object StoresState {
val key = "${game.sidecar.store.id}:${game.sidecar.id}"
uninstalling[key] = 0f
background("stores-uninstall", onFailure = { main.post { uninstalling.remove(key); onDone() } }) {
if (!com.droiddeck.launcher.stores.download.DownloadQueue.stopForRemoval(app, key)) {
if (!com.droiddeck.launcher.stores.download.DownloadQueue.holdForRemovalWhenFree(key)) {
logLine("kept \"${game.sidecar.title}\": its download or update is still running")
main.post { uninstalling.remove(key); onDone() }
return@background
@@ -9,7 +9,6 @@ import java.util.concurrent.atomic.AtomicBoolean
object DownloadQueue {
private const val TAG = "StoreDownloads"
private const val REMOVAL_WAIT_MS = 30_000L
interface DownloadJob {
fun run(handle: JobHandle): String?
@@ -121,24 +120,17 @@ object DownloadQueue {
fun releaseRemoval(key: String) { synchronized(lock) { removing.remove(key); (lock as Object).notifyAll() } }
fun stopForRemoval(context: Context, key: String): Boolean {
if (synchronized(lock) { busyLocked(key) }) cancel(context, key)
val deadline = android.os.SystemClock.uptimeMillis() + REMOVAL_WAIT_MS
return synchronized(lock) {
while (true) {
val busy = busyLocked(key)
if (!busy && key !in cleaningUp && key !in removing) break
val left = deadline - android.os.SystemClock.uptimeMillis()
if (busy && left <= 0) return@synchronized false
(lock as Object).wait(if (busy) left else 0L)
}
removing.add(key)
true
fun holdForRemovalWhenFree(key: String): Boolean = synchronized(lock) {
while (true) {
val item = items[key]
if (item?.entry?.isActive == true || item?.job != null) return@synchronized false
if (key !in cleaningUp && key !in removing) break
(lock as Object).wait()
}
removing.add(key)
true
}
private fun busyLocked(key: String): Boolean = items[key].let { it?.entry?.isActive == true || it?.job != null }
private fun beginCleanup(key: String): Boolean = synchronized(lock) {
if (key in removing) return@synchronized false
cleaningUp.merge(key, 1, Int::plus)
@@ -420,7 +412,6 @@ object DownloadQueue {
}
item.job = null
publishLocked()
(lock as Object).notifyAll()
}
when (item.entry.state) {
DownloadState.INSTALLED -> {
@@ -73,72 +73,35 @@ object EaLaunch {
/** Answers the guest's request right before an EA game starts: session, licence and the LSX endpoint. */
fun prepare(context: Context, request: JSONObject): JSONObject {
val app = context.applicationContext
request.optJSONObject("steam")?.let { return prepareSteam(app, request, it) }
val id = request.optString("id")
val (folder, recorded) = installed(app, id) ?: return JSONObject().put("ok", false).put("reason", "not-installed")
val reply = JSONObject().put("ok", false)
val (folder, recorded) = installed(app, id) ?: return reply.put("reason", "not-installed")
val sidecar = backfill(folder, recorded)
runCatching { com.droiddeck.launcher.stores.StoreLaunch.refreshLauncher(folder, sidecar) }
File(folder, ENV_FILE).delete()
val known = (sidecar.extra["contentIds"].orEmpty().split(',') + sidecar.extra["multiplayerId"].orEmpty()).map { it.trim() }.filter { it.isNotEmpty() }.toSet()
val game = Started(folder, id, sidecar.extra["contentId"].orEmpty(), known, sidecar.extra["contentIds"].orEmpty().split(','),
sidecar.title, sidecar.installVersion, sidecar.extra["locale"].orEmpty().ifEmpty { "en_US" }, sidecar.exe)
val (reply, env) = start(app, game, request)
if (env != null) {
val tmp = File(folder, "$ENV_FILE.tmp")
tmp.writeText(env.entries.joinToString("\r\n", postfix = "\r\n") { "${it.key}=${it.value}" })
tmp.renameTo(File(folder, ENV_FILE))
}
return reply
}
private val OFFER = Regex("Origin\\.OFR\\.[0-9]+\\.[0-9]+")
private val CONTENT = Regex("[A-Za-z0-9._-]{1,64}")
/** Steam's copy of an EA game, which Steam would hand to the EA app; the env comes back in the reply. */
private fun prepareSteam(app: Context, request: JSONObject, steam: JSONObject): JSONObject {
val failed = JSONObject().put("ok", false)
val root = com.droiddeck.launcher.runtime.LinuxRuntime.rootDir(app).canonicalFile
val folder = File(root, steam.optString("folder").removePrefix("/")).canonicalFile
if (!folder.path.startsWith(root.path + File.separator) || !folder.isDirectory) return failed.put("reason", "no-folder")
fun strings(name: String, pattern: Regex) = steam.optJSONArray(name)?.let { a -> (0 until a.length()).map { a.optString(it) } }
.orEmpty().filter { pattern.matches(it) }.distinct()
val offers = strings("offers", OFFER)
val contents = strings("contentIds", CONTENT)
if (offers.isEmpty() || contents.isEmpty()) return failed.put("reason", "no-offer")
val game = Started(folder, offers.first(), contents.first(), contents.toSet(), contents, steam.optString("title").ifEmpty { folder.name },
steam.optString("version"), steam.optString("locale").ifEmpty { "en_US" }, steam.optString("exe"))
val (reply, env) = start(app, game, request)
if (env != null) reply.put("id", game.offerId).put("env", JSONObject(env.toMap()))
return reply
}
private class Started(
val folder: File, val offerId: String, val contentId: String, val contentIds: Set<String>, val licenceIds: List<String>,
val title: String, val version: String, val locale: String, val exe: String,
)
private fun start(app: Context, game: Started, request: JSONObject): Pair<JSONObject, LinkedHashMap<String, String>?> {
val reply = JSONObject().put("ok", false)
val id = game.offerId
val account = EaAuth.load(app) ?: return reply.put("reason", "signed-out") to null
val access = EaAuth.accessToken(app) ?: return reply.put("reason", "sign-in-expired") to null
val contentId = game.contentId
val locale = game.locale
val core = EaOoa.coreDir(game.folder, game.exe)
val account = EaAuth.load(app) ?: return reply.put("reason", "signed-out")
val access = EaAuth.accessToken(app) ?: return reply.put("reason", "sign-in-expired")
val contentId = sidecar.extra["contentId"].orEmpty()
val locale = sidecar.extra["locale"].orEmpty().ifEmpty { "en_US" }
val core = EaOoa.coreDir(folder, sidecar.exe)
val hashVersion = core?.let(EaOoa::activationVersion) ?: 1
val hardware = request.optJSONObject("hardware")?.let(EaOoa.Hardware::fromJson)?.takeIf { it.complete(hashVersion) }
val legacy = EaOoa.legacyCore(core)
val lifetime = if (legacy) 14400 else 550
val opaque = EaAuth.mint(app, EaAuth.CLIENT_ID, "token", EaAuth.OPAQUE_SCOPES, "OPAQUE", lifetime).orEmpty()
val lsx = EaLsx.start(app, EaLsx.Game(id, contentId, game.title, game.version, locale, hardware, hashVersion, opaque,
System.currentTimeMillis() + (lifetime - 30) * 1000L, game.contentIds))
val known = (sidecar.extra["contentIds"].orEmpty().split(',') + sidecar.extra["multiplayerId"].orEmpty()).map { it.trim() }.filter { it.isNotEmpty() }.toSet()
val lsx = EaLsx.start(app, EaLsx.Game(id, contentId, sidecar.title, sidecar.installVersion, locale, hardware, hashVersion, opaque,
System.currentTimeMillis() + (lifetime - 30) * 1000L, known))
val env = environment(id, contentId, locale, if (legacy && opaque.isNotEmpty()) opaque else access, access, opaque, EaAuth.load(app) ?: account)
val tmp = File(folder, "$ENV_FILE.tmp")
tmp.writeText(env.entries.joinToString("\r\n", postfix = "\r\n") { "${it.key}=${it.value}" })
tmp.renameTo(File(folder, ENV_FILE))
val licenses = JSONArray()
val notes = ArrayList<String>()
if (core != null) {
val ids = (listOf(contentId) + game.licenceIds).map { it.trim() }.filter { it.isNotEmpty() }.distinct()
val ids = (listOf(contentId) + sidecar.extra["contentIds"].orEmpty().split(',')).map { it.trim() }.filter { it.isNotEmpty() }.distinct()
if (hardware == null) notes += "no-hardware" else {
val hash = EaOoa.machineHash(hardware, hashVersion)
for (content in ids) {
@@ -162,7 +125,7 @@ object EaLaunch {
}
val licenseNote = if (core == null) "none-needed" else "v$hashVersion " + notes.joinToString(",")
Log.i(TAG, "prepared $id lsx=$lsx legacy=$legacy opaque=${opaque.isNotEmpty()} licence=$licenseNote")
return reply.put("ok", true).put("lsx", lsx).put("license", licenseNote).put("licenses", licenses) to env
return reply.put("ok", true).put("lsx", lsx).put("license", licenseNote).put("licenses", licenses)
}
}
@@ -5,7 +5,6 @@ import com.droiddeck.launcher.R
import com.droiddeck.launcher.runtime.GuestCommand
import com.droiddeck.launcher.runtime.LinuxRuntime
import com.droiddeck.launcher.stores.StoreInstallRoot
import com.droiddeck.launcher.stores.StoreInstalls
import com.droiddeck.launcher.stores.download.DownloadQueue
import com.droiddeck.launcher.stores.download.DownloadStage
import com.droiddeck.launcher.stores.formatBytes
@@ -216,7 +215,7 @@ internal class EpicClientInstaller(private val app: Context) : DownloadQueue.Dow
val before = EpicClient.read(app)
val needApp = !(before.version == launcher.version && File(state, "app/${launcher.version}/.droiddeck-ready").isFile)
val needRuntime = !(before.runtimeVersion == runtime.version && File(state, "runtime/${runtime.version}/.droiddeck-ready").isFile)
val dir = EpicClient.downloadsDir(app).also { StoreInstalls.awaitDiscard(it) }.apply { mkdirs() }
val dir = EpicClient.downloadsDir(app).apply { mkdirs() }
val gles = EpicClientSources.gles()
val appPart = if (needApp) Part(listOf(launcher.url), File(dir, "${launcher.version}-${EpicClientSources.LAUNCHER_FILE}"), null, true) else null
val desktopParts = if (needApp) EpicClientSources.DESKTOP.map { Part(it.urls, File(dir, it.file), it.sha256, false, it.size) } else emptyList()
@@ -266,7 +265,7 @@ internal class EpicClientInstaller(private val app: Context) : DownloadQueue.Dow
override fun cancel(deleteFiles: Boolean) {
cancelled.set(true)
runCatching { connection?.disconnect() }
if (deleteFiles) StoreInstalls.deleteLater(EpicClient.downloadsDir(app))
if (deleteFiles) EpicClient.downloadsDir(app).deleteRecursively()
}
private fun length(url: String): Long {
@@ -282,7 +282,7 @@ internal object SteamStore {
if (key in StoresState.uninstalling) return
StoresState.uninstalling[key] = 0f
Thread({
if (!DownloadQueue.stopForRemoval(app, key)) {
if (!DownloadQueue.holdForRemovalWhenFree(key)) {
StoresState.logLine("Steam: kept $appId, its download is still running")
StoresState.post { StoresState.uninstalling.remove(key); onDone() }
return@Thread
@@ -137,7 +137,7 @@ internal class XboxInstaller(private val app: Context, private val item: Catalog
delete = deleteFiles
val process = child
if (process == null) {
if (deleteFiles && !item.extra["baseId"].isNullOrBlank()) StoreInstalls.deleteLater(folder)
if (deleteFiles && !item.extra["baseId"].isNullOrBlank()) StoreInstalls.deleteTree(folder)
else if (deleteFiles) StoreInstalls.discard(app, folder, emptyList())
return
}
@@ -0,0 +1,241 @@
package com.droiddeck.launcher.ui
import android.graphics.BitmapFactory
import android.text.format.DateFormat
import android.util.Base64
import androidx.compose.foundation.Image
import androidx.compose.foundation.background
import androidx.compose.foundation.border
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.aspectRatio
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxHeight
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.foundation.verticalScroll
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.DisposableEffect
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.graphics.FilterQuality
import androidx.compose.ui.graphics.ImageBitmap
import androidx.compose.ui.graphics.asImageBitmap
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.platform.testTag
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.semantics.Role
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import com.droiddeck.launcher.R
import androidx.compose.ui.graphics.Color
import androidx.compose.foundation.layout.width
import com.droiddeck.launcher.companion.CompanionLink
import com.droiddeck.launcher.companion.RpgCompanion
import com.droiddeck.launcher.companion.StardewCompanion
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.delay
import kotlinx.coroutines.isActive
import kotlinx.coroutines.withContext
private const val GAME_POLL_MS = 2_000L
internal fun companionFor(appId: Long?): Long? =
appId?.takeIf { it == StardewCompanion.APP_ID || it == RpgCompanion.SKYRIM_SE || it == RpgCompanion.FALLOUT_4 }
@Composable
internal fun CompanionPanel(runningGame: () -> String?) {
var appId by remember { mutableStateOf(runningGame()?.toLongOrNull()) }
LaunchedEffect(Unit) {
while (isActive) {
appId = runningGame()?.toLongOrNull()
delay(GAME_POLL_MS)
}
}
when (companionFor(appId)) {
StardewCompanion.APP_ID -> StardewLive()
RpgCompanion.SKYRIM_SE, RpgCompanion.FALLOUT_4 -> RpgLive(appId!!)
else -> PanelNote(stringResource(R.string.bottom_companion_none))
}
}
@Composable
private fun StardewLive() {
val link = remember { CompanionLink(StardewCompanion.PORT) }
var state by remember { mutableStateOf(StardewCompanion.State()) }
var connected by remember { mutableStateOf(false) }
DisposableEffect(link) { onDispose { link.close() } }
val off = BottomScreenLight.current.value == BottomScreenLight.OFF
LaunchedEffect(link, off) {
// The Stardew mod hides the game's HUD while a client is connected, so a dark bottom screen must not stay connected.
if (off) return@LaunchedEffect
withContext(Dispatchers.IO) {
link.run(
onConnected = { connected = it },
onText = { text -> state = StardewCompanion.reduce(state, text) },
hello = StardewCompanion.refresh(),
)
}
}
when {
!connected -> PanelNote(stringResource(R.string.bottom_companion_stardew_missing))
!state.inGame -> PanelNote(stringResource(R.string.bottom_companion_title_screen))
else -> StardewPanel(state) { slot -> link.send(StardewCompanion.selectSlot(slot)) }
}
}
@Composable
internal fun StardewPanel(state: StardewCompanion.State, onSlot: (Int) -> Unit) {
val pal = LocalPalette.current
val colors = MaterialTheme.colorScheme
val twelveHour = !DateFormat.is24HourFormat(LocalContext.current)
val sprites = remember(state.sprites) { state.sprites.mapValues { (_, png) -> decode(png) } }
Row(Modifier.fillMaxSize().padding(horizontal = 14.dp, vertical = 6.dp), horizontalArrangement = Arrangement.spacedBy(14.dp)) {
Column(Modifier.weight(1f).fillMaxHeight().verticalScroll(rememberScrollState())) {
state.day?.let { d ->
SettingsGroup(stringResource(R.string.bottom_companion_today)) {
PanelRow("${d.weekday} · ${d.season.replaceFirstChar { it.uppercase() }} ${d.day}", listOf(d.location, d.weather).filter { it.isNotEmpty() }.joinToString(" · "),
trailing = { PanelValue(StardewCompanion.clock(d.time, twelveHour)) })
PanelRow(stringResource(R.string.bottom_companion_gold), trailing = { PanelValue("%,d".format(d.gold), CompanionGold) })
MeterRow(stringResource(R.string.bottom_companion_energy), d.energy, d.maxEnergy, pal.good)
MeterRow(stringResource(R.string.bottom_companion_health), d.health, d.maxHealth, colors.error)
}
}
SettingsGroup(stringResource(R.string.bottom_companion_hotbar)) {
for (row in state.hotbar.withIndex().chunked(6)) Row(Modifier.fillMaxWidth().padding(horizontal = 8.dp, vertical = 4.dp),
horizontalArrangement = Arrangement.spacedBy(6.dp)) {
for ((slot, item) in row) {
val selected = slot == state.selected
Box(
Modifier.weight(1f).aspectRatio(1f).clip(RoundedCornerShape(8.dp))
.background(if (selected) pal.signal.copy(alpha = 0.18f) else colors.surfaceVariant)
.border(1.dp, if (selected) pal.signal else pal.line2, RoundedCornerShape(8.dp))
.clickable(role = Role.Button) { onSlot(slot) }.testTag("stardew-slot-$slot"),
contentAlignment = Alignment.Center,
) {
val sprite = item?.let { sprites[it.id] }
if (sprite != null) Image(sprite, item.name, Modifier.fillMaxSize().padding(5.dp), filterQuality = FilterQuality.None)
else if (item != null) Text(item.name.take(3), fontSize = 10.sp, color = colors.onSurfaceVariant)
if (item != null && item.count > 1) Text("${item.count}", fontSize = 10.sp, fontWeight = FontWeight.Bold,
color = colors.onBackground, modifier = Modifier.align(Alignment.BottomEnd).padding(3.dp))
}
}
}
}
}
Column(Modifier.weight(1f).fillMaxHeight().verticalScroll(rememberScrollState())) {
if (state.birthdays.isNotEmpty()) SettingsGroup(stringResource(R.string.bottom_companion_birthdays)) {
for (b in state.birthdays) PanelRow(b.name,
trailing = { PanelValue(if (b.days == 0) stringResource(R.string.bottom_companion_today) else stringResource(R.string.bottom_companion_in_days, b.days),
if (b.days == 0) pal.signal else colors.onSurfaceVariant) })
}
if (state.quests.isNotEmpty()) SettingsGroup(stringResource(R.string.bottom_companion_quests)) {
for (q in state.quests) PanelRow(q.title, q.objective, selected = q.complete)
}
}
}
}
@Composable
private fun RpgLive(appId: Long) {
val link = remember(appId) { CompanionLink(RpgCompanion.port(appId)) }
var state by remember(appId) { mutableStateOf(RpgCompanion.State()) }
var connected by remember(appId) { mutableStateOf(false) }
var seq by remember { mutableStateOf(0) }
DisposableEffect(link) { onDispose { link.close() } }
val off = BottomScreenLight.current.value == BottomScreenLight.OFF
LaunchedEffect(link, off) {
if (off) return@LaunchedEffect
withContext(Dispatchers.IO) {
link.run(
onConnected = { connected = it },
onText = { text -> state = RpgCompanion.reduce(appId, state, text) },
hello = RpgCompanion.subscribe(appId),
)
}
}
if (!connected) {
PanelNote(stringResource(if (appId == RpgCompanion.FALLOUT_4) R.string.bottom_companion_pipboy_missing else R.string.bottom_companion_skyrim_missing))
return
}
RpgPanel(state,
onSlot = { slot -> link.send(RpgCompanion.trigger(appId, slot, ++seq)) },
onRadio = { on -> link.send(RpgCompanion.radio(on, ++seq)) })
}
@Composable
internal fun RpgPanel(state: RpgCompanion.State, onSlot: (RpgCompanion.Slot) -> Unit, onRadio: (Boolean) -> Unit) {
val pal = LocalPalette.current
val colors = MaterialTheme.colorScheme
Row(Modifier.fillMaxSize().padding(horizontal = 14.dp, vertical = 6.dp), horizontalArrangement = Arrangement.spacedBy(14.dp)) {
Column(Modifier.weight(1f).fillMaxHeight().verticalScroll(rememberScrollState())) {
SettingsGroup(stringResource(R.string.bottom_companion_character), detail = state.level?.let { stringResource(R.string.bottom_companion_level, it) }) {
for (bar in state.bars) {
val (label, color) = when (bar.key) {
"hp", "health" -> stringResource(R.string.bottom_companion_health) to colors.error
"magicka" -> stringResource(R.string.bottom_companion_magicka) to pal.primary
"stamina" -> stringResource(R.string.bottom_companion_stamina) to pal.good
else -> stringResource(R.string.bottom_companion_action_points) to pal.good
}
MeterRow(label, bar.value.toInt(), bar.max.toInt(), color)
}
for ((key, value) in state.facts) PanelRow(
when (key) {
"caps" -> stringResource(R.string.bottom_companion_caps)
"rads" -> stringResource(R.string.bottom_companion_rads)
else -> stringResource(R.string.bottom_companion_weight)
},
trailing = { PanelValue(value) },
)
}
state.radio?.let { on ->
SettingsGroup(stringResource(R.string.bottom_companion_radio)) {
SettingsRow(stringResource(R.string.bottom_companion_radio), null) { ToggleSwitch(on, label = stringResource(R.string.bottom_companion_radio)) { onRadio(it) } }
}
}
}
Column(Modifier.weight(1f).fillMaxHeight().verticalScroll(rememberScrollState())) {
if (state.slots.isNotEmpty()) SettingsGroup(stringResource(R.string.bottom_companion_favorites)) {
for (slot in state.slots) PanelRow(slot.label, slot.detail.ifEmpty { null }, tag = "rpg-slot-${slot.key}", selected = slot.active,
onClick = { onSlot(slot) })
}
}
}
}
@Composable
private fun MeterRow(label: String, value: Int, max: Int, color: Color) {
val pal = LocalPalette.current
PanelRow(label, trailing = {
Row(verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(8.dp)) {
Box(Modifier.width(72.dp).height(6.dp).clip(RoundedCornerShape(3.dp)).background(pal.line2)) {
Box(Modifier.fillMaxWidth(if (max > 0) (value.toFloat() / max).coerceIn(0f, 1f) else 0f).fillMaxHeight().background(color))
}
PanelValue("$value / $max")
}
})
}
private val CompanionGold = Color(0xFFE2B33C)
private fun decode(png: String): ImageBitmap? = runCatching {
val bytes = Base64.decode(png, Base64.DEFAULT)
BitmapFactory.decodeByteArray(bytes, 0, bytes.size)?.asImageBitmap()
}.getOrNull()
@@ -243,6 +243,7 @@ internal val SecondScreenMode.icon: ImageVector get() = when (this) {
SecondScreenMode.DASHBOARD -> Icons.Outlined.Dashboard
SecondScreenMode.GUIDES -> Icons.Outlined.MenuBook
SecondScreenMode.MIRROR -> Icons.Outlined.CropFree
SecondScreenMode.COMPANION -> Icons.Outlined.Extension
SecondScreenMode.STEAM_QAM -> Icons.Outlined.ViewSidebar
SecondScreenMode.ART -> Icons.Outlined.Wallpaper
SecondScreenMode.DESKTOP -> Icons.Outlined.DesktopWindows
@@ -35,6 +35,7 @@ internal fun BottomSessionPanel(mode: SecondScreenMode, actions: BottomPageActio
when (mode) {
SecondScreenMode.GUIDES -> GuidesPanel(actions.runningGame)
SecondScreenMode.MIRROR -> MirrorPanel(actions)
SecondScreenMode.COMPANION -> CompanionPanel(actions.runningGame)
SecondScreenMode.STEAM_QAM -> SteamQamPanel()
SecondScreenMode.ART -> ArtPanel(actions.runningGame)
else -> Unit
@@ -15,7 +15,7 @@ import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.rememberUpdatedState
import androidx.compose.runtime.setValue
import androidx.compose.runtime.withFrameNanos
import androidx.compose.runtime.withFrameMillis
import androidx.compose.ui.Modifier
import androidx.compose.ui.geometry.CornerRadius
import androidx.compose.ui.geometry.Offset
@@ -99,7 +99,7 @@ private fun rememberMarkClock(avoid: Rect?): MarkClock {
var vx = speed * 0.8f
var vy = -speed * 0.6f
while (true) {
if (clock.page == Size.Zero) { withFrameNanos { }; continue }
if (clock.page == Size.Zero) { withFrameMillis { }; continue }
val f = MarkFrame(clock.page, Offset.Zero)
if (clock.at == Offset.Unspecified) clock.at = Offset(clock.page.width * 0.64f, clock.page.height * 0.42f)
if (Motion.scale == 0f) {
@@ -108,13 +108,8 @@ private fun rememberMarkClock(avoid: Rect?): MarkClock {
clock.wall = 0f
return@LaunchedEffect
}
withFrameNanos { nanos ->
val scale = Motion.scale
if (scale == 0f) return@withFrameNanos
val settled = clock.intro >= END && clock.ball >= IMPACT + REVEAL_MS && !clock.poked
if (settled && last >= 0 && !IdleFrames.due(nanos)) return@withFrameNanos
val now = nanos / 1_000_000L
val dt = if (last < 0) 0f else min(50f, (now - last).toFloat()) / scale.coerceAtLeast(0.01f)
withFrameMillis { now ->
val dt = if (last < 0) 0f else min(50f, (now - last) / Motion.scale)
last = now
clock.intro += dt
clock.wall += dt
@@ -122,41 +117,34 @@ private fun rememberMarkClock(avoid: Rect?): MarkClock {
val before = clock.ball
clock.ball += dt
var x = clock.at.x
var y = clock.at.y
var x = clock.at.x + vx * dt / 1000f
var y = clock.at.y + vy * dt / 1000f
val hw = f.ball
val hh = f.ball
var left = dt
do {
val step = min(50f, left)
left -= step
x += vx * step / 1000f
y += vy * step / 1000f
if (x - hw < 0f) { x = hw; vx = abs(vx) }
if (x + hw > clock.page.width) { x = clock.page.width - hw; vx = -abs(vx) }
if (y - hh < 0f) { y = hh; vy = abs(vy) }
if (y + hh > clock.page.height) { y = clock.page.height - hh; vy = -abs(vy) }
keepOff?.inflate(clearance)?.let { r ->
val nearX = x.coerceIn(r.left, r.right)
val nearY = y.coerceIn(r.top, r.bottom)
val gapX = x - nearX
val gapY = y - nearY
val gap = hypot(gapX, gapY)
if (gap in 0.0001f..f.ball) {
val nx = gapX / gap
val ny = gapY / gap
x = nearX + nx * f.ball
y = nearY + ny * f.ball
val into = vx * nx + vy * ny
if (into < 0f) { vx -= 2f * into * nx; vy -= 2f * into * ny }
} else if (gap <= 0.0001f) {
val outX = if (x < r.center.x) r.left - f.ball - x else r.right + f.ball - x
val outY = if (y < r.center.y) r.top - f.ball - y else r.bottom + f.ball - y
if (abs(outX) < abs(outY)) { x += outX; vx = if (outX < 0) -abs(vx) else abs(vx) }
else { y += outY; vy = if (outY < 0) -abs(vy) else abs(vy) }
}
if (x - hw < 0f) { x = hw; vx = abs(vx) }
if (x + hw > clock.page.width) { x = clock.page.width - hw; vx = -abs(vx) }
if (y - hh < 0f) { y = hh; vy = abs(vy) }
if (y + hh > clock.page.height) { y = clock.page.height - hh; vy = -abs(vy) }
keepOff?.inflate(clearance)?.let { r ->
val nearX = x.coerceIn(r.left, r.right)
val nearY = y.coerceIn(r.top, r.bottom)
val gapX = x - nearX
val gapY = y - nearY
val gap = hypot(gapX, gapY)
if (gap in 0.0001f..f.ball) {
val nx = gapX / gap
val ny = gapY / gap
x = nearX + nx * f.ball
y = nearY + ny * f.ball
val into = vx * nx + vy * ny
if (into < 0f) { vx -= 2f * into * nx; vy -= 2f * into * ny }
} else if (gap <= 0.0001f) {
val outX = if (x < r.center.x) r.left - f.ball - x else r.right + f.ball - x
val outY = if (y < r.center.y) r.top - f.ball - y else r.bottom + f.ball - y
if (abs(outX) < abs(outY)) { x += outX; vx = if (outX < 0) -abs(vx) else abs(vx) }
else { y += outY; vy = if (outY < 0) -abs(vy) else abs(vy) }
}
} while (left > 0f)
}
clock.at = Offset(x, y)
if (before < IMPACT && clock.ball >= IMPACT) {
@@ -25,7 +25,6 @@ import androidx.compose.material.icons.filled.Close
import androidx.compose.material.icons.outlined.Folder
import androidx.compose.material.icons.outlined.Image
import androidx.compose.material.icons.outlined.InsertDriveFile
import androidx.compose.material.icons.outlined.Lock
import androidx.compose.material.icons.outlined.SdCard
import androidx.compose.material.icons.outlined.Smartphone
import androidx.compose.material.icons.outlined.Visibility
@@ -34,11 +33,9 @@ import androidx.compose.material3.Icon
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.DisposableEffect
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.getValue
import androidx.compose.runtime.key
import androidx.compose.runtime.mutableIntStateOf
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
@@ -53,7 +50,6 @@ import androidx.compose.ui.layout.onSizeChanged
import androidx.compose.ui.platform.LocalConfiguration
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.platform.LocalDensity
import androidx.compose.ui.platform.LocalLifecycleOwner
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.semantics.Role
import androidx.compose.ui.semantics.contentDescription
@@ -63,10 +59,7 @@ import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import androidx.lifecycle.Lifecycle
import androidx.lifecycle.LifecycleEventObserver
import com.droiddeck.launcher.R
import com.droiddeck.launcher.files.AllFilesAccess
import com.droiddeck.launcher.files.StorageRoot
import com.droiddeck.launcher.files.StorageRoots
import com.droiddeck.launcher.stores.formatBytes
@@ -125,15 +118,7 @@ internal fun ExePickerDialog(
val back = { if (dir == null) close() else up() }
val first = remember(dir) { FocusRequester() }
LaunchedEffect(dir) { focusWithinFrames({ false }) { first } }
var resumed by remember { mutableIntStateOf(0) }
val lifecycle = LocalLifecycleOwner.current.lifecycle
DisposableEffect(lifecycle) {
val observer = LifecycleEventObserver { _, event -> if (event == Lifecycle.Event.ON_RESUME) resumed++ }
lifecycle.addObserver(observer)
onDispose { lifecycle.removeObserver(observer) }
}
val accessMissing = remember(resumed) { AllFilesAccess.missing() }
val listing = remember(dir, showHidden, resumed) { dir?.let { pickListing(it, kind, showHidden) } }
val listing = remember(dir, showHidden) { dir?.let { pickListing(it, kind, showHidden) } }
var locked by remember { mutableStateOf<Dp?>(null) }
AppDialog(
shown, close, "filePicker", wide = false, maxWidth = 520.dp, width = locked, fitContent = locked == null, back = back,
@@ -169,9 +154,6 @@ internal fun ExePickerDialog(
} else {
val shownListing = listing ?: PickListing(emptyList(), emptyList())
PickerRow(Icons.AutoMirrored.Outlined.ArrowBack, "..", null, focus = first, onClick = up)
if (accessMissing && volume != null) {
PickerRow(Icons.Outlined.Lock, stringResource(R.string.fm_drive_access_title, volume.label), null, accent = true) { AllFilesAccess.open(ctx) }
}
if (onAddAll != null && shownListing.folders.any { it.readable }) {
PickerRow(Icons.Filled.Add, stringResource(R.string.games_add_all), null, accent = true) { onAddAll(dir!!, showHidden); close() }
}
@@ -96,7 +96,8 @@ import androidx.compose.ui.layout.onGloballyPositioned
import androidx.compose.ui.layout.onPlaced
import com.droiddeck.launcher.core.PhantomProcessLimit
internal val AttentionAmber: Color @Composable get() = LocalPalette.current.warning
internal val AttentionAmber = Color(0xFFFFB547)
@Composable
internal fun BottomBar(
@@ -307,7 +308,7 @@ private fun RailItem(
}
if (badge) Box(
modifier = Modifier.align(Alignment.TopEnd).padding(top = if (iconOnly) 7.dp else 8.dp, end = if (iconOnly) 9.dp else 18.dp)
.size(8.dp).clip(CircleShape).background(pal.warning),
.size(8.dp).clip(CircleShape).background(AttentionAmber),
)
if (count > 0) Text(
if (count > 9) "9+" else count.toString(),
@@ -1254,7 +1254,6 @@ private fun CustomColorRows() {
Triple("signal", stringResource(R.string.theme_custom_signal), colors.signal),
Triple("good", stringResource(R.string.theme_custom_good), colors.good),
Triple("error", stringResource(R.string.theme_custom_error), colors.error),
Triple("warning", stringResource(R.string.theme_custom_warning), colors.warning),
)
rows.forEach { (key, label, argb) ->
@@ -305,6 +305,7 @@ class SecondScreenPresentation(
private fun light(state: BottomScreenLight) {
screen = state
BottomScreenLight.current.value = state
sleepView.visibility = if (state == BottomScreenLight.OFF) View.VISIBLE else View.GONE
sleepView.alpha = 1f
val w = window ?: return
@@ -401,7 +402,7 @@ class SecondScreenPresentation(
attachKeyboard()
}
SecondScreenMode.DASHBOARD -> renderDashboard()
SecondScreenMode.GUIDES, SecondScreenMode.MIRROR, SecondScreenMode.STEAM_QAM, SecondScreenMode.ART -> renderPanel(mode)
SecondScreenMode.GUIDES, SecondScreenMode.MIRROR, SecondScreenMode.COMPANION, SecondScreenMode.STEAM_QAM, SecondScreenMode.ART -> renderPanel(mode)
SecondScreenMode.DESKTOP -> {
root.addView(BottomDesktopPanel(context, onClose, onMenu,
(onSteamMenu to onQam).takeIf { SessionState.mode == SessionService.MODE_STEAM }, onSwap,
@@ -454,7 +455,7 @@ class SecondScreenPresentation(
MirrorOptions.open.value = !MirrorOptions.open.value
}) + extras)
SecondScreenMode.DASHBOARD, SecondScreenMode.CUSTOM_CONTROLS, SecondScreenMode.GUIDES,
SecondScreenMode.ART -> model(extras)
SecondScreenMode.COMPANION, SecondScreenMode.ART -> model(extras)
SecondScreenMode.TERMINAL -> model(listOf(BarExtra(context.getString(R.string.drawer_keyboard), icon = R.drawable.ic_bottom_keyboard,
tag = "bottom-keyboard") { terminalPanel?.showKeyboard() }) + extras)
else -> null
@@ -540,6 +541,9 @@ internal enum class BottomScreenLight(val brightness: Float) {
companion object {
const val DIM_AFTER_MS = 60_000L
/** The bottom screen's light, so panels can drop live connections while it is off. */
val current = androidx.compose.runtime.mutableStateOf(ON)
fun autoDims(mode: SecondScreenMode) = mode == SecondScreenMode.DASHBOARD
}
}
@@ -1439,7 +1439,7 @@ internal fun secondScreenModes(none: Boolean, deckPad: Boolean, dashboard: Boole
(if (deckPad) listOf(SecondScreenMode.DECK_CONTROLS) else emptyList()) + listOf(SecondScreenMode.CUSTOM_CONTROLS) +
(if (dashboard) listOf(SecondScreenMode.DASHBOARD) else emptyList()) +
(if (dashboard && steam) listOf(SecondScreenMode.STEAM_QAM, SecondScreenMode.ART) else emptyList()) +
(if (dashboard) listOf(SecondScreenMode.GUIDES, SecondScreenMode.MIRROR) else emptyList()) +
(if (dashboard) listOf(SecondScreenMode.GUIDES, SecondScreenMode.MIRROR, SecondScreenMode.COMPANION) else emptyList()) +
(if (desktop) listOf(SecondScreenMode.DESKTOP) else emptyList())
private val DRAWER_MIN_WIDTH = 300.dp
@@ -82,18 +82,7 @@ import kotlinx.coroutines.withContext
private const val WALL_MIN_GAMES = 4
private const val WALL_DISTINCT = 40
private const val IDLE_FRAME_NS = 30_000_000L
internal object IdleFrames {
private var shown = 0L
fun due(nanos: Long): Boolean {
if (nanos == shown) return true
if (nanos - shown < IDLE_FRAME_NS) return false
shown = nanos
return true
}
}
private const val DRIFT_STEP_NS = 15_000_000L
@Composable
internal fun SteamHome(s: FrontEndState, a: FrontEndActions, modifier: Modifier) {
@@ -292,7 +281,7 @@ internal fun TiltedWall(
var shown = 0L
while (true) withFrameNanos { now ->
if (shown == 0L) shown = now
else if (IdleFrames.due(now)) {
else if (now - shown >= DRIFT_STEP_NS) {
drift.floatValue = ((drift.floatValue + (now - shown) / (period.value * 1_000_000.0 * Motion.scale)) % 1.0).toFloat()
shown = now
}
@@ -38,7 +38,7 @@ class Palette(
val background: Color, val surface: Color, val surfaceVariant: Color, val line: Color, val line2: Color,
val onBackground: Color, val onSurfaceVariant: Color,
val primary: Color, val primary2: Color, val onPrimary: Color, val signal: Color,
val good: Color, val error: Color = Color(0xFFFF8A80), val warning: Color = Color(0xFFFFB547),
val good: Color, val error: Color = Color(0xFFFF8A80),
)
data class CustomThemeColors(
@@ -54,7 +54,6 @@ data class CustomThemeColors(
val signal: Int = 0xFF1A9FFF.toInt(),
val good: Int = 0xFF4CD37F.toInt(),
val error: Int = 0xFFFF8A80.toInt(),
val warning: Int = 0xFFFFB547.toInt(),
)
object Themes {
@@ -145,7 +144,6 @@ object Themes {
"signal" -> current.copy(signal = color)
"good" -> current.copy(good = color)
"error" -> current.copy(error = color)
"warning" -> current.copy(warning = color)
else -> return
}
setCustomColors(context, updated)
@@ -166,7 +164,6 @@ object Themes {
signal = Color(colors.signal),
good = Color(colors.good),
error = Color(colors.error),
warning = Color(colors.warning),
)
fun current(context: Context): Palette {
@@ -232,9 +229,7 @@ val Palette.onSignal: Color get() = if (signal.luminance() > 0.18f) Color(0xFF03
@Composable
fun DroidDeckTheme(theme: String? = null, appScale: Int = AppUiPrefs.DEFAULT_SCALE, content: @Composable () -> Unit) {
val context = LocalContext.current
remember(context) { Themes.loadGradient(context) }
val id = theme ?: SessionPrefs.theme(context)
val id = theme ?: SessionPrefs.theme(LocalContext.current)
if (id == Themes.INNER_GAMER) InnerGamerHue(Themes.rgbSpeed)
val p = Themes.byId(id)
val scheme = darkColorScheme(
+24 -1
View File
@@ -2187,6 +2187,23 @@
<string name="bottom_guides_continue">متابعة القراءة</string>
<string name="bottom_guides_empty">لا توجد أدلة Steam لهذه اللعبة بعد.</string>
<string name="bottom_guides_failed">تعذّر تحميل أدلة Steam. عد عندما تكون متصلًا.</string>
<string name="bottom_page_companion">المرافق</string>
<string name="bottom_companion_none">لا توجد صفحة مرافقة لهذه اللعبة بعد. توجد واحدة للعبة Stardew Valley.</string>
<string name="bottom_companion_stardew_missing">ثبّت تعديل الشاشة المزدوجة للعبة Stardew Valley عبر SMAPI لترى مزرعتك هنا.</string>
<string name="bottom_companion_title_screen">حمّل حفظًا لترى مزرعتك هنا.</string>
<string name="bottom_companion_energy">الطاقة</string>
<string name="bottom_companion_health">الصحة</string>
<string name="bottom_companion_birthdays">أعياد الميلاد هذا الأسبوع</string>
<string name="bottom_companion_quests">المهام</string>
<string name="bottom_companion_skyrim_missing">ثبّت إضافة SkyrimWebSocket لـ SKSE لترى شخصيتك هنا.</string>
<string name="bottom_companion_pipboy_missing">ثبّت إضافة Thor Pip-Boy لـ F4SE لترى Pip-Boy هنا.</string>
<string name="bottom_companion_level">المستوى %1$d</string>
<string name="bottom_companion_magicka">السحر</string>
<string name="bottom_companion_stamina">القدرة على التحمل</string>
<string name="bottom_companion_action_points">نقاط الحركة</string>
<string name="bottom_companion_caps">الأغطية</string>
<string name="bottom_companion_rads">الإشعاع</string>
<string name="bottom_companion_favorites">المفضلة</string>
<string name="bottom_page_mirror">المرآة</string>
<string name="bottom_mirror_pick">اسحب فوق جزء اللعبة الذي تريد عرضه هنا، مثل الخريطة المصغّرة.</string>
<string name="bottom_mirror_save">احفظ المنطقة</string>
@@ -2224,6 +2241,13 @@
<string name="bottom_mirror_region">المنطقة</string>
<string name="bottom_mirror_top">الشاشة العلوية</string>
<string name="bottom_mirror_scaling">التحجيم</string>
<string name="bottom_companion_today">اليوم</string>
<string name="bottom_companion_gold">الذهب</string>
<string name="bottom_companion_hotbar">شريط الأدوات</string>
<string name="bottom_companion_in_days">بعد %1$d أيام</string>
<string name="bottom_companion_character">الشخصية</string>
<string name="bottom_companion_weight">الحمولة</string>
<string name="bottom_companion_radio">الراديو</string>
<string name="bottom_qam_title">الوصول السريع</string>
<string name="bottom_qam_layout">التخطيط: %1$s</string>
<string name="bottom_qam_layout_full">العرض الكامل</string>
@@ -4299,7 +4323,6 @@
<string name="theme_custom_signal">الإبرازات</string>
<string name="theme_custom_good">نجاح</string>
<string name="theme_custom_error">خطأ</string>
<string name="theme_custom_warning">تحذير</string>
<string name="hud_only_during_game">عرض HUD أثناء اللعب فقط</string>
<string name="hud_only_during_game_hint">إخفاء HUD عند عدم اكتشاف إطارات اللعبة.</string>
<string name="steam_store_close_steam">أغلق Steam أولاً</string>
+24 -1
View File
@@ -2182,6 +2182,23 @@
<string name="bottom_guides_continue">Seguir leyendo</string>
<string name="bottom_guides_empty">Este juego aún no tiene guías de Steam.</string>
<string name="bottom_guides_failed">No se pudieron cargar las guías de Steam. Vuelve a intentarlo cuando tengas conexión.</string>
<string name="bottom_page_companion">Compañero</string>
<string name="bottom_companion_none">Este juego aún no tiene página de compañero. Stardew Valley sí tiene una.</string>
<string name="bottom_companion_stardew_missing">Instala el mod de doble pantalla de Stardew Valley para SMAPI para ver tu granja aquí.</string>
<string name="bottom_companion_title_screen">Carga una partida para ver tu granja aquí.</string>
<string name="bottom_companion_energy">Energía</string>
<string name="bottom_companion_health">Salud</string>
<string name="bottom_companion_birthdays">Cumpleaños de esta semana</string>
<string name="bottom_companion_quests">Misiones</string>
<string name="bottom_companion_skyrim_missing">Instala el plugin SkyrimWebSocket para SKSE para ver tu personaje aquí.</string>
<string name="bottom_companion_pipboy_missing">Instala el plugin Thor Pip-Boy para F4SE para ver tu Pip-Boy aquí.</string>
<string name="bottom_companion_level">Nivel %1$d</string>
<string name="bottom_companion_magicka">Magia</string>
<string name="bottom_companion_stamina">Aguante</string>
<string name="bottom_companion_action_points">Puntos de acción</string>
<string name="bottom_companion_caps">Chapas</string>
<string name="bottom_companion_rads">Radiación</string>
<string name="bottom_companion_favorites">Favoritos</string>
<string name="bottom_page_mirror">Espejo</string>
<string name="bottom_mirror_pick">Arrastra sobre la parte del juego que quieras ver aquí, como el minimapa.</string>
<string name="bottom_mirror_save">Guardar región</string>
@@ -2219,6 +2236,13 @@
<string name="bottom_mirror_region">Región</string>
<string name="bottom_mirror_top">Pantalla superior</string>
<string name="bottom_mirror_scaling">Escalado</string>
<string name="bottom_companion_today">Hoy</string>
<string name="bottom_companion_gold">Oro</string>
<string name="bottom_companion_hotbar">Barra rápida</string>
<string name="bottom_companion_in_days">En %1$d días</string>
<string name="bottom_companion_character">Personaje</string>
<string name="bottom_companion_weight">Peso cargado</string>
<string name="bottom_companion_radio">Radio</string>
<string name="bottom_qam_title">Acceso rápido</string>
<string name="bottom_qam_layout">Diseño: %1$s</string>
<string name="bottom_qam_layout_full">Ancho completo</string>
@@ -4179,7 +4203,6 @@
<string name="theme_custom_signal">Destacados</string>
<string name="theme_custom_good">Éxito</string>
<string name="theme_custom_error">Error</string>
<string name="theme_custom_warning">Advertencia</string>
<string name="hud_only_during_game">Mostrar el HUD solo durante una partida</string>
<string name="hud_only_during_game_hint">Ocultar el HUD cuando no se detecten fotogramas del juego.</string>
<string name="steam_store_close_steam">Cierra Steam primero</string>
+24 -1
View File
@@ -2087,6 +2087,23 @@
<string name="bottom_guides_continue">Продължи четенето</string>
<string name="bottom_guides_empty">Все още няма ръководства в Steam за тази игра.</string>
<string name="bottom_guides_failed">Ръководствата в Steam не се заредиха. Опитайте отново, когато сте онлайн.</string>
<string name="bottom_page_companion">Придружител</string>
<string name="bottom_companion_none">Все още няма страница-придружител за тази игра. Stardew Valley има.</string>
<string name="bottom_companion_stardew_missing">Инсталирайте мода за два екрана на Stardew Valley за SMAPI, за да виждате фермата си тук.</string>
<string name="bottom_companion_title_screen">Заредете запис, за да видите фермата си тук.</string>
<string name="bottom_companion_energy">Енергия</string>
<string name="bottom_companion_health">Здраве</string>
<string name="bottom_companion_birthdays">Рождени дни тази седмица</string>
<string name="bottom_companion_quests">Задачи</string>
<string name="bottom_companion_skyrim_missing">Инсталирайте приставката SkyrimWebSocket за SKSE, за да виждате героя си тук.</string>
<string name="bottom_companion_pipboy_missing">Инсталирайте приставката Thor Pip-Boy за F4SE, за да виждате своя Pip-Boy тук.</string>
<string name="bottom_companion_level">Ниво %1$d</string>
<string name="bottom_companion_magicka">Магия</string>
<string name="bottom_companion_stamina">Издръжливост</string>
<string name="bottom_companion_action_points">Точки за действие</string>
<string name="bottom_companion_caps">Капачки</string>
<string name="bottom_companion_rads">Радиация</string>
<string name="bottom_companion_favorites">Любими</string>
<string name="bottom_page_mirror">Огледало</string>
<string name="bottom_mirror_pick">Плъзнете върху частта от играта, която да се показва тук, например мини картата.</string>
<string name="bottom_mirror_save">Запази областта</string>
@@ -2124,6 +2141,13 @@
<string name="bottom_mirror_region">Област</string>
<string name="bottom_mirror_top">Горен екран</string>
<string name="bottom_mirror_scaling">Мащабиране</string>
<string name="bottom_companion_today">Днес</string>
<string name="bottom_companion_gold">Злато</string>
<string name="bottom_companion_hotbar">Лента с предмети</string>
<string name="bottom_companion_in_days">След %1$d дни</string>
<string name="bottom_companion_character">Герой</string>
<string name="bottom_companion_weight">Товар</string>
<string name="bottom_companion_radio">Радио</string>
<string name="bottom_qam_title">Бърз достъп</string>
<string name="bottom_qam_layout">Оформление: %1$s</string>
<string name="bottom_qam_layout_full">Цяла ширина</string>
@@ -4139,7 +4163,6 @@
<string name="theme_custom_signal">Акценти</string>
<string name="theme_custom_good">Успех</string>
<string name="theme_custom_error">Грешка</string>
<string name="theme_custom_warning">Предупреждение</string>
<string name="hud_only_during_game">Показвай HUD само по време на игра</string>
<string name="hud_only_during_game_hint">Скривай HUD, когато не се засичат кадри от играта.</string>
<string name="steam_store_close_steam">Първо затворете Steam</string>
+24 -1
View File
@@ -2137,6 +2137,23 @@
<string name="bottom_guides_continue">Pokračovat ve čtení</string>
<string name="bottom_guides_empty">Pro tuto hru zatím nejsou žádné návody na Steamu.</string>
<string name="bottom_guides_failed">Návody ze Steamu se nepodařilo načíst. Zkuste to znovu, až budete online.</string>
<string name="bottom_page_companion">Společník</string>
<string name="bottom_companion_none">Pro tuto hru zatím není stránka společníka. Stardew Valley ji má.</string>
<string name="bottom_companion_stardew_missing">Nainstalujte mód dvou obrazovek pro Stardew Valley (SMAPI) a uvidíte zde svou farmu.</string>
<string name="bottom_companion_title_screen">Načtěte uloženou hru a uvidíte zde svou farmu.</string>
<string name="bottom_companion_energy">Energie</string>
<string name="bottom_companion_health">Zdraví</string>
<string name="bottom_companion_birthdays">Narozeniny tento týden</string>
<string name="bottom_companion_quests">Úkoly</string>
<string name="bottom_companion_skyrim_missing">Nainstalujte plugin SkyrimWebSocket pro SKSE a uvidíte zde svou postavu.</string>
<string name="bottom_companion_pipboy_missing">Nainstalujte plugin Thor Pip-Boy pro F4SE a uvidíte zde svůj Pip-Boy.</string>
<string name="bottom_companion_level">Úroveň %1$d</string>
<string name="bottom_companion_magicka">Magie</string>
<string name="bottom_companion_stamina">Výdrž</string>
<string name="bottom_companion_action_points">Akční body</string>
<string name="bottom_companion_caps">Víčka</string>
<string name="bottom_companion_rads">Radiace</string>
<string name="bottom_companion_favorites">Oblíbené</string>
<string name="bottom_page_mirror">Zrcadlo</string>
<string name="bottom_mirror_pick">Táhnutím označte část hry, která se tu má zobrazit, například minimapu.</string>
<string name="bottom_mirror_save">Uložit oblast</string>
@@ -2174,6 +2191,13 @@
<string name="bottom_mirror_region">Oblast</string>
<string name="bottom_mirror_top">Horní obrazovka</string>
<string name="bottom_mirror_scaling">Škálování</string>
<string name="bottom_companion_today">Dnes</string>
<string name="bottom_companion_gold">Zlato</string>
<string name="bottom_companion_hotbar">Lišta</string>
<string name="bottom_companion_in_days">Za %1$d dní</string>
<string name="bottom_companion_character">Postava</string>
<string name="bottom_companion_weight">Nosnost</string>
<string name="bottom_companion_radio">Rádio</string>
<string name="bottom_qam_title">Rychlý přístup</string>
<string name="bottom_qam_layout">Rozložení: %1$s</string>
<string name="bottom_qam_layout_full">Plná šířka</string>
@@ -4219,7 +4243,6 @@
<string name="theme_custom_signal">Zvýraznění</string>
<string name="theme_custom_good">Úspěch</string>
<string name="theme_custom_error">Chyba</string>
<string name="theme_custom_warning">Varování</string>
<string name="hud_only_during_game">Zobrazovat HUD pouze během hry</string>
<string name="hud_only_during_game_hint">Skrýt HUD, když nejsou detekovány snímky hry.</string>
<string name="steam_store_close_steam">Nejprve zavřete Steam</string>
+24 -1
View File
@@ -2087,6 +2087,23 @@
<string name="bottom_guides_continue">Læs videre</string>
<string name="bottom_guides_empty">Der er endnu ingen Steam-guides til dette spil.</string>
<string name="bottom_guides_failed">Kunne ikke hente Steam-guides. Prøv igen, når du er online.</string>
<string name="bottom_page_companion">Ledsager</string>
<string name="bottom_companion_none">Der er endnu ingen ledsagerside til dette spil. Stardew Valley har en.</string>
<string name="bottom_companion_stardew_missing">Installer Stardew Valleys dobbeltskærms-mod til SMAPI for at se din gård her.</string>
<string name="bottom_companion_title_screen">Indlæs et gemt spil for at se din gård her.</string>
<string name="bottom_companion_energy">Energi</string>
<string name="bottom_companion_health">Helbred</string>
<string name="bottom_companion_birthdays">Fødselsdage denne uge</string>
<string name="bottom_companion_quests">Opgaver</string>
<string name="bottom_companion_skyrim_missing">Installer SkyrimWebSocket-pluginnet til SKSE for at se din figur her.</string>
<string name="bottom_companion_pipboy_missing">Installer Thor Pip-Boy-pluginnet til F4SE for at se din Pip-Boy her.</string>
<string name="bottom_companion_level">Niveau %1$d</string>
<string name="bottom_companion_magicka">Magika</string>
<string name="bottom_companion_stamina">Udholdenhed</string>
<string name="bottom_companion_action_points">Handlingspoint</string>
<string name="bottom_companion_caps">Kapsler</string>
<string name="bottom_companion_rads">Stråling</string>
<string name="bottom_companion_favorites">Favoritter</string>
<string name="bottom_page_mirror">Spejl</string>
<string name="bottom_mirror_pick">Træk hen over den del af spillet, der skal vises her, f.eks. minikortet.</string>
<string name="bottom_mirror_save">Gem område</string>
@@ -2124,6 +2141,13 @@
<string name="bottom_mirror_region">Område</string>
<string name="bottom_mirror_top">Øverste skærm</string>
<string name="bottom_mirror_scaling">Skalering</string>
<string name="bottom_companion_today">I dag</string>
<string name="bottom_companion_gold">Guld</string>
<string name="bottom_companion_hotbar">Værktøjslinje</string>
<string name="bottom_companion_in_days">Om %1$d dage</string>
<string name="bottom_companion_character">Figur</string>
<string name="bottom_companion_weight">Bæreevne</string>
<string name="bottom_companion_radio">Radio</string>
<string name="bottom_qam_title">Hurtig adgang</string>
<string name="bottom_qam_layout">Layout: %1$s</string>
<string name="bottom_qam_layout_full">Fuld bredde</string>
@@ -4139,7 +4163,6 @@
<string name="theme_custom_signal">Fremhævninger</string>
<string name="theme_custom_good">Succes</string>
<string name="theme_custom_error">Fejl</string>
<string name="theme_custom_warning">Advarsel</string>
<string name="hud_only_during_game">Vis kun HUD under spil</string>
<string name="hud_only_during_game_hint">Skjul HUD, når der ikke registreres spilbilleder.</string>
<string name="steam_store_close_steam">Luk Steam først</string>
+24 -1
View File
@@ -2079,6 +2079,23 @@
<string name="bottom_guides_continue">Weiterlesen</string>
<string name="bottom_guides_empty">Für dieses Spiel gibt es noch keine Steam-Anleitungen.</string>
<string name="bottom_guides_failed">Steam-Anleitungen konnten nicht geladen werden. Versuche es erneut, sobald du online bist.</string>
<string name="bottom_page_companion">Begleiter</string>
<string name="bottom_companion_none">Für dieses Spiel gibt es noch keine Begleitseite. Stardew Valley hat eine.</string>
<string name="bottom_companion_stardew_missing">Installiere die Dual-Screen-Mod für Stardew Valley (SMAPI), um hier deinen Hof zu sehen.</string>
<string name="bottom_companion_title_screen">Lade einen Spielstand, um hier deinen Hof zu sehen.</string>
<string name="bottom_companion_energy">Energie</string>
<string name="bottom_companion_health">Gesundheit</string>
<string name="bottom_companion_birthdays">Geburtstage diese Woche</string>
<string name="bottom_companion_quests">Quests</string>
<string name="bottom_companion_skyrim_missing">Installiere das SKSE-Plugin SkyrimWebSocket, um hier deinen Charakter zu sehen.</string>
<string name="bottom_companion_pipboy_missing">Installiere das F4SE-Plugin Thor Pip-Boy, um hier deinen Pip-Boy zu sehen.</string>
<string name="bottom_companion_level">Stufe %1$d</string>
<string name="bottom_companion_magicka">Magicka</string>
<string name="bottom_companion_stamina">Ausdauer</string>
<string name="bottom_companion_action_points">Aktionspunkte</string>
<string name="bottom_companion_caps">Kronkorken</string>
<string name="bottom_companion_rads">Strahlung</string>
<string name="bottom_companion_favorites">Favoriten</string>
<string name="bottom_page_mirror">Spiegel</string>
<string name="bottom_mirror_pick">Ziehe über den Teil des Spiels, der hier erscheinen soll, etwa die Minikarte.</string>
<string name="bottom_mirror_save">Bereich speichern</string>
@@ -2116,6 +2133,13 @@
<string name="bottom_mirror_region">Bereich</string>
<string name="bottom_mirror_top">Oberer Bildschirm</string>
<string name="bottom_mirror_scaling">Skalierung</string>
<string name="bottom_companion_today">Heute</string>
<string name="bottom_companion_gold">Gold</string>
<string name="bottom_companion_hotbar">Werkzeugleiste</string>
<string name="bottom_companion_in_days">In %1$d Tagen</string>
<string name="bottom_companion_character">Charakter</string>
<string name="bottom_companion_weight">Traglast</string>
<string name="bottom_companion_radio">Radio</string>
<string name="bottom_qam_title">Schnellzugriff</string>
<string name="bottom_qam_layout">Layout: %1$s</string>
<string name="bottom_qam_layout_full">Volle Breite</string>
@@ -4139,7 +4163,6 @@
<string name="theme_custom_signal">Hervorhebungen</string>
<string name="theme_custom_good">Erfolg</string>
<string name="theme_custom_error">Fehler</string>
<string name="theme_custom_warning">Warnung</string>
<string name="hud_only_during_game">HUD nur während eines Spiels anzeigen</string>
<string name="hud_only_during_game_hint">HUD ausblenden, wenn keine Spielframes erkannt werden.</string>
<string name="steam_store_close_steam">Schließe zuerst Steam</string>
+24 -1
View File
@@ -2087,6 +2087,23 @@
<string name="bottom_guides_continue">Συνέχεια ανάγνωσης</string>
<string name="bottom_guides_empty">Δεν υπάρχουν ακόμη οδηγοί Steam για αυτό το παιχνίδι.</string>
<string name="bottom_guides_failed">Δεν ήταν δυνατή η φόρτωση των οδηγών Steam. Δοκιμάστε ξανά όταν είστε online.</string>
<string name="bottom_page_companion">Συνοδός</string>
<string name="bottom_companion_none">Δεν υπάρχει ακόμη σελίδα συνοδού για αυτό το παιχνίδι. Το Stardew Valley έχει.</string>
<string name="bottom_companion_stardew_missing">Εγκαταστήστε το mod διπλής οθόνης του Stardew Valley για SMAPI για να βλέπετε εδώ τη φάρμα σας.</string>
<string name="bottom_companion_title_screen">Φορτώστε μια αποθήκευση για να δείτε εδώ τη φάρμα σας.</string>
<string name="bottom_companion_energy">Ενέργεια</string>
<string name="bottom_companion_health">Υγεία</string>
<string name="bottom_companion_birthdays">Γενέθλια αυτή την εβδομάδα</string>
<string name="bottom_companion_quests">Αποστολές</string>
<string name="bottom_companion_skyrim_missing">Εγκαταστήστε το πρόσθετο SkyrimWebSocket για SKSE για να βλέπετε εδώ τον χαρακτήρα σας.</string>
<string name="bottom_companion_pipboy_missing">Εγκαταστήστε το πρόσθετο Thor Pip-Boy για F4SE για να βλέπετε εδώ το Pip-Boy σας.</string>
<string name="bottom_companion_level">Επίπεδο %1$d</string>
<string name="bottom_companion_magicka">Μαγεία</string>
<string name="bottom_companion_stamina">Αντοχή</string>
<string name="bottom_companion_action_points">Πόντοι δράσης</string>
<string name="bottom_companion_caps">Καπάκια</string>
<string name="bottom_companion_rads">Ακτινοβολία</string>
<string name="bottom_companion_favorites">Αγαπημένα</string>
<string name="bottom_page_mirror">Καθρέφτης</string>
<string name="bottom_mirror_pick">Σύρετε πάνω από το μέρος του παιχνιδιού που θέλετε να εμφανίζεται εδώ, όπως ο μικρός χάρτης.</string>
<string name="bottom_mirror_save">Αποθήκευση περιοχής</string>
@@ -2124,6 +2141,13 @@
<string name="bottom_mirror_region">Περιοχή</string>
<string name="bottom_mirror_top">Πάνω οθόνη</string>
<string name="bottom_mirror_scaling">Κλιμάκωση</string>
<string name="bottom_companion_today">Σήμερα</string>
<string name="bottom_companion_gold">Χρυσός</string>
<string name="bottom_companion_hotbar">Γραμμή εργαλείων</string>
<string name="bottom_companion_in_days">Σε %1$d ημέρες</string>
<string name="bottom_companion_character">Χαρακτήρας</string>
<string name="bottom_companion_weight">Φορτίο</string>
<string name="bottom_companion_radio">Ραδιόφωνο</string>
<string name="bottom_qam_title">Γρήγορη πρόσβαση</string>
<string name="bottom_qam_layout">Διάταξη: %1$s</string>
<string name="bottom_qam_layout_full">Πλήρες πλάτος</string>
@@ -4139,7 +4163,6 @@
<string name="theme_custom_signal">Επισημάνσεις</string>
<string name="theme_custom_good">Επιτυχία</string>
<string name="theme_custom_error">Σφάλμα</string>
<string name="theme_custom_warning">Προειδοποίηση</string>
<string name="hud_only_during_game">Εμφάνιση HUD μόνο κατά τη διάρκεια παιχνιδιού</string>
<string name="hud_only_during_game_hint">Απόκρυψη HUD όταν δεν ανιχνεύονται καρέ παιχνιδιού.</string>
<string name="steam_store_close_steam">Κλείστε πρώτα το Steam</string>
+24 -1
View File
@@ -2112,6 +2112,23 @@
<string name="bottom_guides_continue">Seguir leyendo</string>
<string name="bottom_guides_empty">Este juego aún no tiene guías de Steam.</string>
<string name="bottom_guides_failed">No se han podido cargar las guías de Steam. Vuelve a intentarlo cuando tengas conexión.</string>
<string name="bottom_page_companion">Compañero</string>
<string name="bottom_companion_none">Este juego aún no tiene página de compañero. Stardew Valley sí tiene una.</string>
<string name="bottom_companion_stardew_missing">Instala el mod de doble pantalla de Stardew Valley para SMAPI para ver tu granja aquí.</string>
<string name="bottom_companion_title_screen">Carga una partida para ver tu granja aquí.</string>
<string name="bottom_companion_energy">Energía</string>
<string name="bottom_companion_health">Salud</string>
<string name="bottom_companion_birthdays">Cumpleaños de esta semana</string>
<string name="bottom_companion_quests">Misiones</string>
<string name="bottom_companion_skyrim_missing">Instala el plugin SkyrimWebSocket para SKSE para ver tu personaje aquí.</string>
<string name="bottom_companion_pipboy_missing">Instala el plugin Thor Pip-Boy para F4SE para ver tu Pip-Boy aquí.</string>
<string name="bottom_companion_level">Nivel %1$d</string>
<string name="bottom_companion_magicka">Magia</string>
<string name="bottom_companion_stamina">Aguante</string>
<string name="bottom_companion_action_points">Puntos de acción</string>
<string name="bottom_companion_caps">Chapas</string>
<string name="bottom_companion_rads">Radiación</string>
<string name="bottom_companion_favorites">Favoritos</string>
<string name="bottom_page_mirror">Espejo</string>
<string name="bottom_mirror_pick">Arrastra sobre la parte del juego que quieras ver aquí, como el minimapa.</string>
<string name="bottom_mirror_save">Guardar región</string>
@@ -2149,6 +2166,13 @@
<string name="bottom_mirror_region">Región</string>
<string name="bottom_mirror_top">Pantalla superior</string>
<string name="bottom_mirror_scaling">Escalado</string>
<string name="bottom_companion_today">Hoy</string>
<string name="bottom_companion_gold">Oro</string>
<string name="bottom_companion_hotbar">Barra rápida</string>
<string name="bottom_companion_in_days">En %1$d días</string>
<string name="bottom_companion_character">Personaje</string>
<string name="bottom_companion_weight">Peso cargado</string>
<string name="bottom_companion_radio">Radio</string>
<string name="bottom_qam_title">Acceso rápido</string>
<string name="bottom_qam_layout">Diseño: %1$s</string>
<string name="bottom_qam_layout_full">Ancho completo</string>
@@ -4179,7 +4203,6 @@
<string name="theme_custom_signal">Destacados</string>
<string name="theme_custom_good">Éxito</string>
<string name="theme_custom_error">Error</string>
<string name="theme_custom_warning">Advertencia</string>
<string name="hud_only_during_game">Mostrar el HUD solo durante una partida</string>
<string name="hud_only_during_game_hint">Ocultar el HUD cuando no se detecten fotogramas del juego.</string>
<string name="steam_store_close_steam">Cierra Steam primero</string>
+24 -1
View File
@@ -2087,6 +2087,23 @@
<string name="bottom_guides_continue">Jatka lukemista</string>
<string name="bottom_guides_empty">Tälle pelille ei ole vielä Steam-oppaita.</string>
<string name="bottom_guides_failed">Steam-oppaiden lataus epäonnistui. Yritä uudelleen, kun olet verkossa.</string>
<string name="bottom_page_companion">Kumppani</string>
<string name="bottom_companion_none">Tälle pelille ei ole vielä kumppanisivua. Stardew Valleylla on.</string>
<string name="bottom_companion_stardew_missing">Asenna Stardew Valleyn kaksoisnäyttömodi SMAPIlle nähdäksesi tilasi täällä.</string>
<string name="bottom_companion_title_screen">Lataa tallennus nähdäksesi tilasi täällä.</string>
<string name="bottom_companion_energy">Energia</string>
<string name="bottom_companion_health">Terveys</string>
<string name="bottom_companion_birthdays">Syntymäpäivät tällä viikolla</string>
<string name="bottom_companion_quests">Tehtävät</string>
<string name="bottom_companion_skyrim_missing">Asenna SKSE:n SkyrimWebSocket-liitännäinen nähdäksesi hahmosi täällä.</string>
<string name="bottom_companion_pipboy_missing">Asenna F4SE:n Thor Pip-Boy -liitännäinen nähdäksesi Pip-Boysi täällä.</string>
<string name="bottom_companion_level">Taso %1$d</string>
<string name="bottom_companion_magicka">Taikavoima</string>
<string name="bottom_companion_stamina">Kestävyys</string>
<string name="bottom_companion_action_points">Toimintapisteet</string>
<string name="bottom_companion_caps">Korkit</string>
<string name="bottom_companion_rads">Säteily</string>
<string name="bottom_companion_favorites">Suosikit</string>
<string name="bottom_page_mirror">Peili</string>
<string name="bottom_mirror_pick">Vedä sen pelin osan yli, joka näytetään täällä, kuten minikartan.</string>
<string name="bottom_mirror_save">Tallenna alue</string>
@@ -2124,6 +2141,13 @@
<string name="bottom_mirror_region">Alue</string>
<string name="bottom_mirror_top">Ylänäyttö</string>
<string name="bottom_mirror_scaling">Skaalaus</string>
<string name="bottom_companion_today">Tänään</string>
<string name="bottom_companion_gold">Kulta</string>
<string name="bottom_companion_hotbar">Pikapalkki</string>
<string name="bottom_companion_in_days">%1$d päivän päästä</string>
<string name="bottom_companion_character">Hahmo</string>
<string name="bottom_companion_weight">Kantokyky</string>
<string name="bottom_companion_radio">Radio</string>
<string name="bottom_qam_title">Pikavalikko</string>
<string name="bottom_qam_layout">Asettelu: %1$s</string>
<string name="bottom_qam_layout_full">Koko leveys</string>
@@ -4139,7 +4163,6 @@
<string name="theme_custom_signal">Korostukset</string>
<string name="theme_custom_good">Onnistuminen</string>
<string name="theme_custom_error">Virhe</string>
<string name="theme_custom_warning">Varoitus</string>
<string name="hud_only_during_game">Näytä HUD vain pelin aikana</string>
<string name="hud_only_during_game_hint">Piilota HUD, kun pelin ruutuja ei havaita.</string>
<string name="steam_store_close_steam">Sulje Steam ensin</string>
+24 -1
View File
@@ -2111,6 +2111,23 @@
<string name="bottom_guides_continue">Reprendre la lecture</string>
<string name="bottom_guides_empty">Ce jeu n’a pas encore de guides Steam.</string>
<string name="bottom_guides_failed">Impossible de charger les guides Steam. Réessayez une fois en ligne.</string>
<string name="bottom_page_companion">Compagnon</string>
<string name="bottom_companion_none">Ce jeu n’a pas encore de page compagnon. Stardew Valley en a une.</string>
<string name="bottom_companion_stardew_missing">Installez le mod double écran de Stardew Valley pour SMAPI pour voir votre ferme ici.</string>
<string name="bottom_companion_title_screen">Chargez une partie pour voir votre ferme ici.</string>
<string name="bottom_companion_energy">Énergie</string>
<string name="bottom_companion_health">Santé</string>
<string name="bottom_companion_birthdays">Anniversaires de la semaine</string>
<string name="bottom_companion_quests">Quêtes</string>
<string name="bottom_companion_skyrim_missing">Installez le plugin SKSE SkyrimWebSocket pour voir votre personnage ici.</string>
<string name="bottom_companion_pipboy_missing">Installez le plugin F4SE Thor Pip-Boy pour voir votre Pip-Boy ici.</string>
<string name="bottom_companion_level">Niveau %1$d</string>
<string name="bottom_companion_magicka">Magie</string>
<string name="bottom_companion_stamina">Vigueur</string>
<string name="bottom_companion_action_points">Points d’action</string>
<string name="bottom_companion_caps">Capsules</string>
<string name="bottom_companion_rads">Radiations</string>
<string name="bottom_companion_favorites">Favoris</string>
<string name="bottom_page_mirror">Miroir</string>
<string name="bottom_mirror_pick">Faites glisser sur la partie du jeu à afficher ici, comme la mini-carte.</string>
<string name="bottom_mirror_save">Enregistrer la zone</string>
@@ -2148,6 +2165,13 @@
<string name="bottom_mirror_region">Zone</string>
<string name="bottom_mirror_top">Écran du haut</string>
<string name="bottom_mirror_scaling">Mise à l’échelle</string>
<string name="bottom_companion_today">Aujourd’hui</string>
<string name="bottom_companion_gold">Or</string>
<string name="bottom_companion_hotbar">Barre d’outils</string>
<string name="bottom_companion_in_days">Dans %1$d jours</string>
<string name="bottom_companion_character">Personnage</string>
<string name="bottom_companion_weight">Charge</string>
<string name="bottom_companion_radio">Radio</string>
<string name="bottom_qam_title">Accès rapide</string>
<string name="bottom_qam_layout">Disposition : %1$s</string>
<string name="bottom_qam_layout_full">Pleine largeur</string>
@@ -4178,7 +4202,6 @@
<string name="theme_custom_signal">Mises en évidence</string>
<string name="theme_custom_good">Succès</string>
<string name="theme_custom_error">Erreur</string>
<string name="theme_custom_warning">Avertissement</string>
<string name="hud_only_during_game">Afficher le HUD uniquement pendant une partie</string>
<string name="hud_only_during_game_hint">Masquer le HUD lorsqu’aucune image du jeu n’est détectée.</string>
<string name="steam_store_close_steam">Fermez d\'abord Steam</string>
+24 -1
View File
@@ -2087,6 +2087,23 @@
<string name="bottom_guides_continue">पढ़ना जारी रखें</string>
<string name="bottom_guides_empty">इस गेम के लिए अभी कोई Steam गाइड नहीं है।</string>
<string name="bottom_guides_failed">Steam गाइड लोड नहीं हो सके। ऑनलाइन होने पर फिर देखें।</string>
<string name="bottom_page_companion">साथी</string>
<string name="bottom_companion_none">इस गेम के लिए अभी कोई साथी पेज नहीं है। Stardew Valley के लिए है।</string>
<string name="bottom_companion_stardew_missing">अपना फ़ार्म यहाँ देखने के लिए SMAPI के लिए Stardew Valley का डुअल-स्क्रीन मॉड इंस्टॉल करें।</string>
<string name="bottom_companion_title_screen">अपना फ़ार्म यहाँ देखने के लिए कोई सेव लोड करें।</string>
<string name="bottom_companion_energy">ऊर्जा</string>
<string name="bottom_companion_health">स्वास्थ्य</string>
<string name="bottom_companion_birthdays">इस हफ़्ते के जन्मदिन</string>
<string name="bottom_companion_quests">क्वेस्ट</string>
<string name="bottom_companion_skyrim_missing">अपना किरदार यहाँ देखने के लिए SKSE का SkyrimWebSocket प्लगइन इंस्टॉल करें।</string>
<string name="bottom_companion_pipboy_missing">अपना Pip-Boy यहाँ देखने के लिए F4SE का Thor Pip-Boy प्लगइन इंस्टॉल करें।</string>
<string name="bottom_companion_level">लेवल %1$d</string>
<string name="bottom_companion_magicka">मैजिका</string>
<string name="bottom_companion_stamina">स्टैमिना</string>
<string name="bottom_companion_action_points">एक्शन पॉइंट</string>
<string name="bottom_companion_caps">कैप्स</string>
<string name="bottom_companion_rads">रेडिएशन</string>
<string name="bottom_companion_favorites">पसंदीदा</string>
<string name="bottom_page_mirror">मिरर</string>
<string name="bottom_mirror_pick">गेम का वह हिस्सा चुनने के लिए खींचें जो यहाँ दिखे, जैसे मिनीमैप।</string>
<string name="bottom_mirror_save">क्षेत्र सहेजें</string>
@@ -2124,6 +2141,13 @@
<string name="bottom_mirror_region">क्षेत्र</string>
<string name="bottom_mirror_top">ऊपर की स्क्रीन</string>
<string name="bottom_mirror_scaling">स्केलिंग</string>
<string name="bottom_companion_today">आज</string>
<string name="bottom_companion_gold">सोना</string>
<string name="bottom_companion_hotbar">हॉटबार</string>
<string name="bottom_companion_in_days">%1$d दिन में</string>
<string name="bottom_companion_character">किरदार</string>
<string name="bottom_companion_weight">वज़न क्षमता</string>
<string name="bottom_companion_radio">रेडियो</string>
<string name="bottom_qam_title">क्विक एक्सेस</string>
<string name="bottom_qam_layout">लेआउट: %1$s</string>
<string name="bottom_qam_layout_full">पूरी चौड़ाई</string>
@@ -4139,7 +4163,6 @@
<string name="theme_custom_signal">हाइलाइट</string>
<string name="theme_custom_good">सफलता</string>
<string name="theme_custom_error">त्रुटि</string>
<string name="theme_custom_warning">चेतावनी</string>
<string name="hud_only_during_game">HUD केवल गेम के दौरान दिखाएँ</string>
<string name="hud_only_during_game_hint">गेम के फ़्रेम का पता न चलने पर HUD छिपाएँ।</string>
<string name="steam_store_close_steam">पहले Steam बंद करें</string>
+24 -1
View File
@@ -2087,6 +2087,23 @@
<string name="bottom_guides_continue">Olvasás folytatása</string>
<string name="bottom_guides_empty">Ehhez a játékhoz még nincs Steam-útmutató.</string>
<string name="bottom_guides_failed">Nem sikerült betölteni a Steam-útmutatókat. Próbáld újra, ha online vagy.</string>
<string name="bottom_page_companion">Társ</string>
<string name="bottom_companion_none">Ehhez a játékhoz még nincs társoldal. A Stardew Valley-hez van.</string>
<string name="bottom_companion_stardew_missing">Telepítsd a Stardew Valley kétképernyős modját (SMAPI), hogy itt lásd a farmodat.</string>
<string name="bottom_companion_title_screen">Tölts be egy mentést, hogy itt lásd a farmodat.</string>
<string name="bottom_companion_energy">Energia</string>
<string name="bottom_companion_health">Életerő</string>
<string name="bottom_companion_birthdays">E heti születésnapok</string>
<string name="bottom_companion_quests">Küldetések</string>
<string name="bottom_companion_skyrim_missing">Telepítsd a SkyrimWebSocket SKSE-bővítményt, hogy itt lásd a karakteredet.</string>
<string name="bottom_companion_pipboy_missing">Telepítsd a Thor Pip-Boy F4SE-bővítményt, hogy itt lásd a Pip-Boyodat.</string>
<string name="bottom_companion_level">%1$d. szint</string>
<string name="bottom_companion_magicka">Mágia</string>
<string name="bottom_companion_stamina">Állóképesség</string>
<string name="bottom_companion_action_points">Akciópontok</string>
<string name="bottom_companion_caps">Kupakok</string>
<string name="bottom_companion_rads">Sugárzás</string>
<string name="bottom_companion_favorites">Kedvencek</string>
<string name="bottom_page_mirror">Tükör</string>
<string name="bottom_mirror_pick">Húzd át a játék azon részét, amelyet itt szeretnél látni, például a minitérképet.</string>
<string name="bottom_mirror_save">Terület mentése</string>
@@ -2124,6 +2141,13 @@
<string name="bottom_mirror_region">Terület</string>
<string name="bottom_mirror_top">Felső képernyő</string>
<string name="bottom_mirror_scaling">Méretezés</string>
<string name="bottom_companion_today">Ma</string>
<string name="bottom_companion_gold">Arany</string>
<string name="bottom_companion_hotbar">Gyorssáv</string>
<string name="bottom_companion_in_days">%1$d nap múlva</string>
<string name="bottom_companion_character">Karakter</string>
<string name="bottom_companion_weight">Teherbírás</string>
<string name="bottom_companion_radio">Rádió</string>
<string name="bottom_qam_title">Gyorselérés</string>
<string name="bottom_qam_layout">Elrendezés: %1$s</string>
<string name="bottom_qam_layout_full">Teljes szélesség</string>
@@ -4139,7 +4163,6 @@
<string name="theme_custom_signal">Kiemelések</string>
<string name="theme_custom_good">Siker</string>
<string name="theme_custom_error">Hiba</string>
<string name="theme_custom_warning">Figyelmeztetés</string>
<string name="hud_only_during_game">HUD megjelenítése csak játék közben</string>
<string name="hud_only_during_game_hint">HUD elrejtése, ha nem észlelhetők játék képkockái.</string>
<string name="steam_store_close_steam">Előbb zárd be a Steamet</string>
+24 -1
View File
@@ -2063,6 +2063,23 @@
<string name="bottom_guides_continue">Lanjutkan membaca</string>
<string name="bottom_guides_empty">Belum ada panduan Steam untuk game ini.</string>
<string name="bottom_guides_failed">Tidak dapat memuat panduan Steam. Coba lagi saat Anda online.</string>
<string name="bottom_page_companion">Pendamping</string>
<string name="bottom_companion_none">Belum ada halaman pendamping untuk game ini. Stardew Valley sudah punya.</string>
<string name="bottom_companion_stardew_missing">Pasang mod layar ganda Stardew Valley untuk SMAPI agar pertanian Anda tampil di sini.</string>
<string name="bottom_companion_title_screen">Muat simpanan untuk melihat pertanian Anda di sini.</string>
<string name="bottom_companion_energy">Energi</string>
<string name="bottom_companion_health">Kesehatan</string>
<string name="bottom_companion_birthdays">Ulang tahun minggu ini</string>
<string name="bottom_companion_quests">Misi</string>
<string name="bottom_companion_skyrim_missing">Pasang plugin SKSE SkyrimWebSocket untuk melihat karakter Anda di sini.</string>
<string name="bottom_companion_pipboy_missing">Pasang plugin F4SE Thor Pip-Boy untuk melihat Pip-Boy Anda di sini.</string>
<string name="bottom_companion_level">Level %1$d</string>
<string name="bottom_companion_magicka">Magicka</string>
<string name="bottom_companion_stamina">Stamina</string>
<string name="bottom_companion_action_points">Poin aksi</string>
<string name="bottom_companion_caps">Tutup botol</string>
<string name="bottom_companion_rads">Radiasi</string>
<string name="bottom_companion_favorites">Favorit</string>
<string name="bottom_page_mirror">Cermin</string>
<string name="bottom_mirror_pick">Seret di atas bagian game yang ingin ditampilkan di sini, seperti peta mini.</string>
<string name="bottom_mirror_save">Simpan area</string>
@@ -2100,6 +2117,13 @@
<string name="bottom_mirror_region">Area</string>
<string name="bottom_mirror_top">Layar atas</string>
<string name="bottom_mirror_scaling">Penskalaan</string>
<string name="bottom_companion_today">Hari ini</string>
<string name="bottom_companion_gold">Emas</string>
<string name="bottom_companion_hotbar">Hotbar</string>
<string name="bottom_companion_in_days">Dalam %1$d hari</string>
<string name="bottom_companion_character">Karakter</string>
<string name="bottom_companion_weight">Beban</string>
<string name="bottom_companion_radio">Radio</string>
<string name="bottom_qam_title">Akses Cepat</string>
<string name="bottom_qam_layout">Tata letak: %1$s</string>
<string name="bottom_qam_layout_full">Lebar penuh</string>
@@ -4109,7 +4133,6 @@
<string name="theme_custom_signal">Sorotan</string>
<string name="theme_custom_good">Berhasil</string>
<string name="theme_custom_error">Kesalahan</string>
<string name="theme_custom_warning">Peringatan</string>
<string name="hud_only_during_game">Tampilkan HUD hanya saat bermain</string>
<string name="hud_only_during_game_hint">Sembunyikan HUD saat tidak ada frame game yang terdeteksi.</string>
<string name="steam_store_close_steam">Tutup Steam terlebih dahulu</string>
+24 -1
View File
@@ -2103,6 +2103,23 @@
<string name="bottom_guides_continue">Continua a leggere</string>
<string name="bottom_guides_empty">Non ci sono ancora guide di Steam per questo gioco.</string>
<string name="bottom_guides_failed">Impossibile caricare le guide di Steam. Riprova quando sei online.</string>
<string name="bottom_page_companion">Compagno</string>
<string name="bottom_companion_none">Questo gioco non ha ancora una pagina compagno. Stardew Valley ne ha una.</string>
<string name="bottom_companion_stardew_missing">Installa la mod a doppio schermo di Stardew Valley per SMAPI per vedere qui la tua fattoria.</string>
<string name="bottom_companion_title_screen">Carica un salvataggio per vedere qui la tua fattoria.</string>
<string name="bottom_companion_energy">Energia</string>
<string name="bottom_companion_health">Salute</string>
<string name="bottom_companion_birthdays">Compleanni della settimana</string>
<string name="bottom_companion_quests">Missioni</string>
<string name="bottom_companion_skyrim_missing">Installa il plugin SKSE SkyrimWebSocket per vedere qui il tuo personaggio.</string>
<string name="bottom_companion_pipboy_missing">Installa il plugin F4SE Thor Pip-Boy per vedere qui il tuo Pip-Boy.</string>
<string name="bottom_companion_level">Livello %1$d</string>
<string name="bottom_companion_magicka">Magicka</string>
<string name="bottom_companion_stamina">Vigore</string>
<string name="bottom_companion_action_points">Punti azione</string>
<string name="bottom_companion_caps">Tappi</string>
<string name="bottom_companion_rads">Radiazioni</string>
<string name="bottom_companion_favorites">Preferiti</string>
<string name="bottom_page_mirror">Specchio</string>
<string name="bottom_mirror_pick">Trascina sulla parte del gioco da mostrare qui, come la minimappa.</string>
<string name="bottom_mirror_save">Salva area</string>
@@ -2140,6 +2157,13 @@
<string name="bottom_mirror_region">Area</string>
<string name="bottom_mirror_top">Schermo superiore</string>
<string name="bottom_mirror_scaling">Scalatura</string>
<string name="bottom_companion_today">Oggi</string>
<string name="bottom_companion_gold">Oro</string>
<string name="bottom_companion_hotbar">Barra rapida</string>
<string name="bottom_companion_in_days">Tra %1$d giorni</string>
<string name="bottom_companion_character">Personaggio</string>
<string name="bottom_companion_weight">Peso trasportato</string>
<string name="bottom_companion_radio">Radio</string>
<string name="bottom_qam_title">Accesso rapido</string>
<string name="bottom_qam_layout">Layout: %1$s</string>
<string name="bottom_qam_layout_full">Larghezza piena</string>
@@ -4178,7 +4202,6 @@
<string name="theme_custom_signal">Evidenziazioni</string>
<string name="theme_custom_good">Successo</string>
<string name="theme_custom_error">Errore</string>
<string name="theme_custom_warning">Avviso</string>
<string name="hud_only_during_game">Mostra l’HUD solo durante il gioco</string>
<string name="hud_only_during_game_hint">Nascondi l’HUD quando non vengono rilevati fotogrammi del gioco.</string>
<string name="steam_store_close_steam">Chiudi prima Steam</string>
+24 -1
View File
@@ -2063,6 +2063,23 @@
<string name="bottom_guides_continue">続きを読む</string>
<string name="bottom_guides_empty">このゲームの Steam ガイドはまだありません。</string>
<string name="bottom_guides_failed">Steam ガイドを読み込めませんでした。オンラインになってから再度お試しください。</string>
<string name="bottom_page_companion">コンパニオン</string>
<string name="bottom_companion_none">このゲームのコンパニオンページはまだありません。Stardew Valley には対応しています。</string>
<string name="bottom_companion_stardew_missing">農場をここに表示するには、SMAPI 用の Stardew Valley デュアルスクリーン MOD をインストールしてください。</string>
<string name="bottom_companion_title_screen">セーブデータを読み込むと、ここに農場が表示されます。</string>
<string name="bottom_companion_energy">スタミナ</string>
<string name="bottom_companion_health">体力</string>
<string name="bottom_companion_birthdays">今週の誕生日</string>
<string name="bottom_companion_quests">クエスト</string>
<string name="bottom_companion_skyrim_missing">キャラクターをここに表示するには、SKSE プラグイン SkyrimWebSocket をインストールしてください。</string>
<string name="bottom_companion_pipboy_missing">Pip-Boy をここに表示するには、F4SE プラグイン Thor Pip-Boy をインストールしてください。</string>
<string name="bottom_companion_level">レベル %1$d</string>
<string name="bottom_companion_magicka">マジカ</string>
<string name="bottom_companion_stamina">スタミナ</string>
<string name="bottom_companion_action_points">アクションポイント</string>
<string name="bottom_companion_caps">キャップ</string>
<string name="bottom_companion_rads">放射線</string>
<string name="bottom_companion_favorites">お気に入り</string>
<string name="bottom_page_mirror">ミラー</string>
<string name="bottom_mirror_pick">ミニマップなど、ここに表示したいゲーム画面の部分をドラッグで選びます。</string>
<string name="bottom_mirror_save">範囲を保存</string>
@@ -2100,6 +2117,13 @@
<string name="bottom_mirror_region">範囲</string>
<string name="bottom_mirror_top">上画面</string>
<string name="bottom_mirror_scaling">スケーリング</string>
<string name="bottom_companion_today">今日</string>
<string name="bottom_companion_gold">ゴールド</string>
<string name="bottom_companion_hotbar">ホットバー</string>
<string name="bottom_companion_in_days">%1$d 日後</string>
<string name="bottom_companion_character">キャラクター</string>
<string name="bottom_companion_weight">所持重量</string>
<string name="bottom_companion_radio">ラジオ</string>
<string name="bottom_qam_title">クイックアクセス</string>
<string name="bottom_qam_layout">レイアウト: %1$s</string>
<string name="bottom_qam_layout_full">全幅</string>
@@ -4109,7 +4133,6 @@
<string name="theme_custom_signal">強調表示</string>
<string name="theme_custom_good">成功</string>
<string name="theme_custom_error">エラー</string>
<string name="theme_custom_warning">警告</string>
<string name="hud_only_during_game">ゲーム中のみHUDを表示</string>
<string name="hud_only_during_game_hint">ゲームのフレームが検出されないときはHUDを非表示にする。</string>
<string name="steam_store_close_steam">先に Steam を閉じてください</string>
+24 -1
View File
@@ -2063,6 +2063,23 @@
<string name="bottom_guides_continue">이어서 읽기</string>
<string name="bottom_guides_empty">이 게임에는 아직 Steam 가이드가 없습니다.</string>
<string name="bottom_guides_failed">Steam 가이드를 불러오지 못했습니다. 온라인 상태에서 다시 확인하세요.</string>
<string name="bottom_page_companion">컴패니언</string>
<string name="bottom_companion_none">이 게임에는 아직 컴패니언 페이지가 없습니다. Stardew Valley는 지원합니다.</string>
<string name="bottom_companion_stardew_missing">농장을 여기에서 보려면 SMAPI용 Stardew Valley 듀얼 스크린 모드를 설치하세요.</string>
<string name="bottom_companion_title_screen">저장 파일을 불러오면 여기에 농장이 표시됩니다.</string>
<string name="bottom_companion_energy">기력</string>
<string name="bottom_companion_health">체력</string>
<string name="bottom_companion_birthdays">이번 주 생일</string>
<string name="bottom_companion_quests">퀘스트</string>
<string name="bottom_companion_skyrim_missing">캐릭터를 여기에서 보려면 SKSE 플러그인 SkyrimWebSocket을 설치하세요.</string>
<string name="bottom_companion_pipboy_missing">Pip-Boy를 여기에서 보려면 F4SE 플러그인 Thor Pip-Boy를 설치하세요.</string>
<string name="bottom_companion_level">레벨 %1$d</string>
<string name="bottom_companion_magicka">매지카</string>
<string name="bottom_companion_stamina">지구력</string>
<string name="bottom_companion_action_points">액션 포인트</string>
<string name="bottom_companion_caps">캡</string>
<string name="bottom_companion_rads">방사능</string>
<string name="bottom_companion_favorites">즐겨찾기</string>
<string name="bottom_page_mirror">미러</string>
<string name="bottom_mirror_pick">미니맵처럼 여기에 표시할 게임 화면 부분을 드래그하세요.</string>
<string name="bottom_mirror_save">영역 저장</string>
@@ -2100,6 +2117,13 @@
<string name="bottom_mirror_region">영역</string>
<string name="bottom_mirror_top">위 화면</string>
<string name="bottom_mirror_scaling">스케일링</string>
<string name="bottom_companion_today">오늘</string>
<string name="bottom_companion_gold">골드</string>
<string name="bottom_companion_hotbar">단축 바</string>
<string name="bottom_companion_in_days">%1$d일 후</string>
<string name="bottom_companion_character">캐릭터</string>
<string name="bottom_companion_weight">소지 무게</string>
<string name="bottom_companion_radio">라디오</string>
<string name="bottom_qam_title">빠른 메뉴</string>
<string name="bottom_qam_layout">레이아웃: %1$s</string>
<string name="bottom_qam_layout_full">전체 너비</string>
@@ -4109,7 +4133,6 @@
<string name="theme_custom_signal">강조 표시</string>
<string name="theme_custom_good">성공</string>
<string name="theme_custom_error">오류</string>
<string name="theme_custom_warning">경고</string>
<string name="hud_only_during_game">게임 중에만 HUD 표시</string>
<string name="hud_only_during_game_hint">게임 프레임이 감지되지 않으면 HUD 숨기기.</string>
<string name="steam_store_close_steam">먼저 Steam을 닫으세요</string>
+24 -1
View File
@@ -2063,6 +2063,23 @@
<string name="bottom_guides_continue">Sambung membaca</string>
<string name="bottom_guides_empty">Belum ada panduan Steam untuk permainan ini.</string>
<string name="bottom_guides_failed">Tidak dapat memuatkan panduan Steam. Cuba lagi apabila anda dalam talian.</string>
<string name="bottom_page_companion">Peneman</string>
<string name="bottom_companion_none">Belum ada halaman peneman untuk permainan ini. Stardew Valley ada.</string>
<string name="bottom_companion_stardew_missing">Pasang mod dwi-skrin Stardew Valley untuk SMAPI untuk melihat ladang anda di sini.</string>
<string name="bottom_companion_title_screen">Muatkan simpanan untuk melihat ladang anda di sini.</string>
<string name="bottom_companion_energy">Tenaga</string>
<string name="bottom_companion_health">Kesihatan</string>
<string name="bottom_companion_birthdays">Hari jadi minggu ini</string>
<string name="bottom_companion_quests">Misi</string>
<string name="bottom_companion_skyrim_missing">Pasang pemalam SKSE SkyrimWebSocket untuk melihat watak anda di sini.</string>
<string name="bottom_companion_pipboy_missing">Pasang pemalam F4SE Thor Pip-Boy untuk melihat Pip-Boy anda di sini.</string>
<string name="bottom_companion_level">Tahap %1$d</string>
<string name="bottom_companion_magicka">Magicka</string>
<string name="bottom_companion_stamina">Stamina</string>
<string name="bottom_companion_action_points">Mata tindakan</string>
<string name="bottom_companion_caps">Penutup botol</string>
<string name="bottom_companion_rads">Radiasi</string>
<string name="bottom_companion_favorites">Kegemaran</string>
<string name="bottom_page_mirror">Cermin</string>
<string name="bottom_mirror_pick">Seret ke atas bahagian permainan yang mahu dipaparkan di sini, seperti peta mini.</string>
<string name="bottom_mirror_save">Simpan kawasan</string>
@@ -2100,6 +2117,13 @@
<string name="bottom_mirror_region">Kawasan</string>
<string name="bottom_mirror_top">Skrin atas</string>
<string name="bottom_mirror_scaling">Penskalaan</string>
<string name="bottom_companion_today">Hari ini</string>
<string name="bottom_companion_gold">Emas</string>
<string name="bottom_companion_hotbar">Bar alat</string>
<string name="bottom_companion_in_days">Dalam %1$d hari</string>
<string name="bottom_companion_character">Watak</string>
<string name="bottom_companion_weight">Beban</string>
<string name="bottom_companion_radio">Radio</string>
<string name="bottom_qam_title">Akses Pantas</string>
<string name="bottom_qam_layout">Susun atur: %1$s</string>
<string name="bottom_qam_layout_full">Lebar penuh</string>
@@ -4109,7 +4133,6 @@
<string name="theme_custom_signal">Sorotan</string>
<string name="theme_custom_good">Berjaya</string>
<string name="theme_custom_error">Ralat</string>
<string name="theme_custom_warning">Amaran</string>
<string name="hud_only_during_game">Paparkan HUD hanya semasa bermain</string>
<string name="hud_only_during_game_hint">Sembunyikan HUD apabila bingkai permainan tidak dikesan.</string>
<string name="steam_store_close_steam">Tutup Steam dahulu</string>
+24 -1
View File
@@ -2087,6 +2087,23 @@
<string name="bottom_guides_continue">Fortsett å lese</string>
<string name="bottom_guides_empty">Det finnes ingen Steam-guider for dette spillet ennå.</string>
<string name="bottom_guides_failed">Kunne ikke laste Steam-guider. Prøv igjen når du er på nett.</string>
<string name="bottom_page_companion">Følgesvenn</string>
<string name="bottom_companion_none">Det finnes ingen følgesvennside for dette spillet ennå. Stardew Valley har en.</string>
<string name="bottom_companion_stardew_missing">Installer Stardew Valleys tosjermsmod for SMAPI for å se gården din her.</string>
<string name="bottom_companion_title_screen">Last inn en lagring for å se gården din her.</string>
<string name="bottom_companion_energy">Energi</string>
<string name="bottom_companion_health">Helse</string>
<string name="bottom_companion_birthdays">Bursdager denne uken</string>
<string name="bottom_companion_quests">Oppdrag</string>
<string name="bottom_companion_skyrim_missing">Installer SKSE-tillegget SkyrimWebSocket for å se figuren din her.</string>
<string name="bottom_companion_pipboy_missing">Installer F4SE-tillegget Thor Pip-Boy for å se Pip-Boyen din her.</string>
<string name="bottom_companion_level">Nivå %1$d</string>
<string name="bottom_companion_magicka">Magika</string>
<string name="bottom_companion_stamina">Utholdenhet</string>
<string name="bottom_companion_action_points">Handlingspoeng</string>
<string name="bottom_companion_caps">Korker</string>
<string name="bottom_companion_rads">Stråling</string>
<string name="bottom_companion_favorites">Favoritter</string>
<string name="bottom_page_mirror">Speil</string>
<string name="bottom_mirror_pick">Dra over den delen av spillet som skal vises her, for eksempel minikartet.</string>
<string name="bottom_mirror_save">Lagre område</string>
@@ -2124,6 +2141,13 @@
<string name="bottom_mirror_region">Område</string>
<string name="bottom_mirror_top">Øvre skjerm</string>
<string name="bottom_mirror_scaling">Skalering</string>
<string name="bottom_companion_today">I dag</string>
<string name="bottom_companion_gold">Gull</string>
<string name="bottom_companion_hotbar">Verktøylinje</string>
<string name="bottom_companion_in_days">Om %1$d dager</string>
<string name="bottom_companion_character">Figur</string>
<string name="bottom_companion_weight">Bæreevne</string>
<string name="bottom_companion_radio">Radio</string>
<string name="bottom_qam_title">Hurtigtilgang</string>
<string name="bottom_qam_layout">Oppsett: %1$s</string>
<string name="bottom_qam_layout_full">Full bredde</string>
@@ -4139,7 +4163,6 @@
<string name="theme_custom_signal">Uthevinger</string>
<string name="theme_custom_good">Suksess</string>
<string name="theme_custom_error">Feil</string>
<string name="theme_custom_warning">Advarsel</string>
<string name="hud_only_during_game">Vis HUD bare mens du spiller</string>
<string name="hud_only_during_game_hint">Skjul HUD når ingen spillbilder registreres.</string>
<string name="steam_store_close_steam">Lukk Steam først</string>
+24 -1
View File
@@ -2087,6 +2087,23 @@
<string name="bottom_guides_continue">Verder lezen</string>
<string name="bottom_guides_empty">Er zijn nog geen Steam-handleidingen voor deze game.</string>
<string name="bottom_guides_failed">Kan Steam-handleidingen niet laden. Probeer het opnieuw wanneer je online bent.</string>
<string name="bottom_page_companion">Metgezel</string>
<string name="bottom_companion_none">Er is nog geen metgezelpagina voor deze game. Stardew Valley heeft er een.</string>
<string name="bottom_companion_stardew_missing">Installeer de dual-screen-mod voor Stardew Valley (SMAPI) om hier je boerderij te zien.</string>
<string name="bottom_companion_title_screen">Laad een opgeslagen spel om hier je boerderij te zien.</string>
<string name="bottom_companion_energy">Energie</string>
<string name="bottom_companion_health">Gezondheid</string>
<string name="bottom_companion_birthdays">Verjaardagen deze week</string>
<string name="bottom_companion_quests">Opdrachten</string>
<string name="bottom_companion_skyrim_missing">Installeer de SKSE-plugin SkyrimWebSocket om hier je personage te zien.</string>
<string name="bottom_companion_pipboy_missing">Installeer de F4SE-plugin Thor Pip-Boy om hier je Pip-Boy te zien.</string>
<string name="bottom_companion_level">Niveau %1$d</string>
<string name="bottom_companion_magicka">Magicka</string>
<string name="bottom_companion_stamina">Uithoudingsvermogen</string>
<string name="bottom_companion_action_points">Actiepunten</string>
<string name="bottom_companion_caps">Doppen</string>
<string name="bottom_companion_rads">Straling</string>
<string name="bottom_companion_favorites">Favorieten</string>
<string name="bottom_page_mirror">Spiegel</string>
<string name="bottom_mirror_pick">Sleep over het deel van de game dat hier moet verschijnen, zoals de minikaart.</string>
<string name="bottom_mirror_save">Gebied opslaan</string>
@@ -2124,6 +2141,13 @@
<string name="bottom_mirror_region">Gebied</string>
<string name="bottom_mirror_top">Bovenste scherm</string>
<string name="bottom_mirror_scaling">Schalen</string>
<string name="bottom_companion_today">Vandaag</string>
<string name="bottom_companion_gold">Goud</string>
<string name="bottom_companion_hotbar">Werkbalk</string>
<string name="bottom_companion_in_days">Over %1$d dagen</string>
<string name="bottom_companion_character">Personage</string>
<string name="bottom_companion_weight">Draaggewicht</string>
<string name="bottom_companion_radio">Radio</string>
<string name="bottom_qam_title">Snelle toegang</string>
<string name="bottom_qam_layout">Indeling: %1$s</string>
<string name="bottom_qam_layout_full">Volledige breedte</string>
@@ -4139,7 +4163,6 @@
<string name="theme_custom_signal">Accenten</string>
<string name="theme_custom_good">Geslaagd</string>
<string name="theme_custom_error">Fout</string>
<string name="theme_custom_warning">Waarschuwing</string>
<string name="hud_only_during_game">HUD alleen tijdens een game weergeven</string>
<string name="hud_only_during_game_hint">Verberg de HUD wanneer er geen gameframes worden gedetecteerd.</string>
<string name="steam_store_close_steam">Sluit eerst Steam</string>
+24 -1
View File
@@ -2137,6 +2137,23 @@
<string name="bottom_guides_continue">Czytaj dalej</string>
<string name="bottom_guides_empty">Ta gra nie ma jeszcze poradników na Steam.</string>
<string name="bottom_guides_failed">Nie udało się wczytać poradników ze Steam. Spróbuj ponownie, gdy będziesz online.</string>
<string name="bottom_page_companion">Towarzysz</string>
<string name="bottom_companion_none">Ta gra nie ma jeszcze strony towarzysza. Stardew Valley ma.</string>
<string name="bottom_companion_stardew_missing">Zainstaluj mod dwóch ekranów do Stardew Valley (SMAPI), aby widzieć tu swoją farmę.</string>
<string name="bottom_companion_title_screen">Wczytaj zapis, aby zobaczyć tu swoją farmę.</string>
<string name="bottom_companion_energy">Energia</string>
<string name="bottom_companion_health">Zdrowie</string>
<string name="bottom_companion_birthdays">Urodziny w tym tygodniu</string>
<string name="bottom_companion_quests">Zadania</string>
<string name="bottom_companion_skyrim_missing">Zainstaluj wtyczkę SKSE SkyrimWebSocket, aby widzieć tu swoją postać.</string>
<string name="bottom_companion_pipboy_missing">Zainstaluj wtyczkę F4SE Thor Pip-Boy, aby widzieć tu swojego Pip-Boya.</string>
<string name="bottom_companion_level">Poziom %1$d</string>
<string name="bottom_companion_magicka">Magia</string>
<string name="bottom_companion_stamina">Wytrzymałość</string>
<string name="bottom_companion_action_points">Punkty akcji</string>
<string name="bottom_companion_caps">Kapsle</string>
<string name="bottom_companion_rads">Promieniowanie</string>
<string name="bottom_companion_favorites">Ulubione</string>
<string name="bottom_page_mirror">Lustro</string>
<string name="bottom_mirror_pick">Przeciągnij po fragmencie gry, który ma się tu wyświetlać, np. minimapie.</string>
<string name="bottom_mirror_save">Zapisz obszar</string>
@@ -2174,6 +2191,13 @@
<string name="bottom_mirror_region">Obszar</string>
<string name="bottom_mirror_top">Górny ekran</string>
<string name="bottom_mirror_scaling">Skalowanie</string>
<string name="bottom_companion_today">Dziś</string>
<string name="bottom_companion_gold">Złoto</string>
<string name="bottom_companion_hotbar">Pasek</string>
<string name="bottom_companion_in_days">Za %1$d dni</string>
<string name="bottom_companion_character">Postać</string>
<string name="bottom_companion_weight">Udźwig</string>
<string name="bottom_companion_radio">Radio</string>
<string name="bottom_qam_title">Szybki dostęp</string>
<string name="bottom_qam_layout">Układ: %1$s</string>
<string name="bottom_qam_layout_full">Pełna szerokość</string>
@@ -4219,7 +4243,6 @@
<string name="theme_custom_signal">Wyróżnienia</string>
<string name="theme_custom_good">Sukces</string>
<string name="theme_custom_error">Błąd</string>
<string name="theme_custom_warning">Ostrzeżenie</string>
<string name="hud_only_during_game">Pokazuj HUD tylko podczas gry</string>
<string name="hud_only_during_game_hint">Ukryj HUD, gdy nie wykryto klatek gry.</string>
<string name="steam_store_close_steam">Najpierw zamknij Steam</string>
+24 -1
View File
@@ -1812,7 +1812,6 @@
<string name="theme_custom_signal">Destaques e indicadores</string>
<string name="theme_custom_good">Sucesso</string>
<string name="theme_custom_error">Erro</string>
<string name="theme_custom_warning">Aviso</string>
<string name="pckb_key_esc">Esc</string>
<string name="pckb_key_ins">Ins</string>
<string name="pckb_key_del">Del</string>
@@ -2118,6 +2117,23 @@
<string name="bottom_guides_continue">Continuar a ler</string>
<string name="bottom_guides_empty">Ainda não há guias Steam para este jogo.</string>
<string name="bottom_guides_failed">Não foi possível carregar os guias Steam. Tente novamente quando estiver online.</string>
<string name="bottom_page_companion">Companheiro</string>
<string name="bottom_companion_none">Este jogo ainda não tem página de companheiro. Stardew Valley tem.</string>
<string name="bottom_companion_stardew_missing">Instale o mod de ecrã duplo do Stardew Valley para SMAPI para ver aqui a sua quinta.</string>
<string name="bottom_companion_title_screen">Carregue um jogo guardado para ver aqui a sua quinta.</string>
<string name="bottom_companion_energy">Energia</string>
<string name="bottom_companion_health">Saúde</string>
<string name="bottom_companion_birthdays">Aniversários da semana</string>
<string name="bottom_companion_quests">Missões</string>
<string name="bottom_companion_skyrim_missing">Instale o plugin SKSE SkyrimWebSocket para ver aqui a sua personagem.</string>
<string name="bottom_companion_pipboy_missing">Instale o plugin F4SE Thor Pip-Boy para ver aqui o seu Pip-Boy.</string>
<string name="bottom_companion_level">Nível %1$d</string>
<string name="bottom_companion_magicka">Magia</string>
<string name="bottom_companion_stamina">Vigor</string>
<string name="bottom_companion_action_points">Pontos de ação</string>
<string name="bottom_companion_caps">Caricas</string>
<string name="bottom_companion_rads">Radiação</string>
<string name="bottom_companion_favorites">Favoritos</string>
<string name="bottom_page_mirror">Espelho</string>
<string name="bottom_mirror_pick">Arraste sobre a parte do jogo que deve aparecer aqui, como o minimapa.</string>
<string name="bottom_mirror_save">Guardar região</string>
@@ -2155,6 +2171,13 @@
<string name="bottom_mirror_region">Região</string>
<string name="bottom_mirror_top">Ecrã superior</string>
<string name="bottom_mirror_scaling">Escala</string>
<string name="bottom_companion_today">Hoje</string>
<string name="bottom_companion_gold">Ouro</string>
<string name="bottom_companion_hotbar">Barra rápida</string>
<string name="bottom_companion_in_days">Dentro de %1$d dias</string>
<string name="bottom_companion_character">Personagem</string>
<string name="bottom_companion_weight">Peso transportado</string>
<string name="bottom_companion_radio">Rádio</string>
<string name="bottom_qam_title">Acesso rápido</string>
<string name="bottom_qam_layout">Esquema: %1$s</string>
<string name="bottom_qam_layout_full">Largura total</string>
+24 -1
View File
@@ -1820,7 +1820,6 @@
<string name="theme_custom_signal">Destaques e indicadores</string>
<string name="theme_custom_good">Sucesso</string>
<string name="theme_custom_error">Erro</string>
<string name="theme_custom_warning">Aviso</string>
<string name="pckb_key_esc">Esc</string>
<string name="pckb_key_ins">Ins</string>
<string name="pckb_key_del">Del</string>
@@ -2126,6 +2125,23 @@
<string name="bottom_guides_continue">Continuar lendo</string>
<string name="bottom_guides_empty">Ainda não há guias Steam para este jogo.</string>
<string name="bottom_guides_failed">Não foi possível carregar os guias Steam. Tente de novo quando estiver online.</string>
<string name="bottom_page_companion">Companheiro</string>
<string name="bottom_companion_none">Este jogo ainda não tem página de companheiro. Stardew Valley tem.</string>
<string name="bottom_companion_stardew_missing">Instale o mod de tela dupla do Stardew Valley para SMAPI para ver sua fazenda aqui.</string>
<string name="bottom_companion_title_screen">Carregue um save para ver sua fazenda aqui.</string>
<string name="bottom_companion_energy">Energia</string>
<string name="bottom_companion_health">Saúde</string>
<string name="bottom_companion_birthdays">Aniversários da semana</string>
<string name="bottom_companion_quests">Missões</string>
<string name="bottom_companion_skyrim_missing">Instale o plugin SKSE SkyrimWebSocket para ver seu personagem aqui.</string>
<string name="bottom_companion_pipboy_missing">Instale o plugin F4SE Thor Pip-Boy para ver seu Pip-Boy aqui.</string>
<string name="bottom_companion_level">Nível %1$d</string>
<string name="bottom_companion_magicka">Magia</string>
<string name="bottom_companion_stamina">Vigor</string>
<string name="bottom_companion_action_points">Pontos de ação</string>
<string name="bottom_companion_caps">Tampinhas</string>
<string name="bottom_companion_rads">Radiação</string>
<string name="bottom_companion_favorites">Favoritos</string>
<string name="bottom_page_mirror">Espelho</string>
<string name="bottom_mirror_pick">Arraste sobre a parte do jogo que deve aparecer aqui, como o minimapa.</string>
<string name="bottom_mirror_save">Salvar região</string>
@@ -2163,6 +2179,13 @@
<string name="bottom_mirror_region">Região</string>
<string name="bottom_mirror_top">Tela superior</string>
<string name="bottom_mirror_scaling">Escala</string>
<string name="bottom_companion_today">Hoje</string>
<string name="bottom_companion_gold">Ouro</string>
<string name="bottom_companion_hotbar">Barra rápida</string>
<string name="bottom_companion_in_days">Em %1$d dias</string>
<string name="bottom_companion_character">Personagem</string>
<string name="bottom_companion_weight">Peso carregado</string>
<string name="bottom_companion_radio">Rádio</string>
<string name="bottom_qam_title">Acesso rápido</string>
<string name="bottom_qam_layout">Layout: %1$s</string>
<string name="bottom_qam_layout_full">Largura total</string>
+24 -1
View File
@@ -2112,6 +2112,23 @@
<string name="bottom_guides_continue">Continuă lectura</string>
<string name="bottom_guides_empty">Încă nu există ghiduri Steam pentru acest joc.</string>
<string name="bottom_guides_failed">Ghidurile Steam nu s-au putut încărca. Încearcă din nou când ești online.</string>
<string name="bottom_page_companion">Însoțitor</string>
<string name="bottom_companion_none">Acest joc nu are încă o pagină de însoțitor. Stardew Valley are.</string>
<string name="bottom_companion_stardew_missing">Instalează modul cu ecran dublu pentru Stardew Valley (SMAPI) ca să-ți vezi ferma aici.</string>
<string name="bottom_companion_title_screen">Încarcă o salvare ca să-ți vezi ferma aici.</string>
<string name="bottom_companion_energy">Energie</string>
<string name="bottom_companion_health">Sănătate</string>
<string name="bottom_companion_birthdays">Zile de naștere săptămâna aceasta</string>
<string name="bottom_companion_quests">Misiuni</string>
<string name="bottom_companion_skyrim_missing">Instalează pluginul SKSE SkyrimWebSocket ca să-ți vezi personajul aici.</string>
<string name="bottom_companion_pipboy_missing">Instalează pluginul F4SE Thor Pip-Boy ca să-ți vezi Pip-Boy-ul aici.</string>
<string name="bottom_companion_level">Nivelul %1$d</string>
<string name="bottom_companion_magicka">Magie</string>
<string name="bottom_companion_stamina">Rezistență</string>
<string name="bottom_companion_action_points">Puncte de acțiune</string>
<string name="bottom_companion_caps">Capace</string>
<string name="bottom_companion_rads">Radiații</string>
<string name="bottom_companion_favorites">Favorite</string>
<string name="bottom_page_mirror">Oglindă</string>
<string name="bottom_mirror_pick">Trage peste partea din joc care să apară aici, de exemplu minimapa.</string>
<string name="bottom_mirror_save">Salvează zona</string>
@@ -2149,6 +2166,13 @@
<string name="bottom_mirror_region">Zonă</string>
<string name="bottom_mirror_top">Ecranul de sus</string>
<string name="bottom_mirror_scaling">Scalare</string>
<string name="bottom_companion_today">Azi</string>
<string name="bottom_companion_gold">Aur</string>
<string name="bottom_companion_hotbar">Bara rapidă</string>
<string name="bottom_companion_in_days">Peste %1$d zile</string>
<string name="bottom_companion_character">Personaj</string>
<string name="bottom_companion_weight">Greutate purtată</string>
<string name="bottom_companion_radio">Radio</string>
<string name="bottom_qam_title">Acces rapid</string>
<string name="bottom_qam_layout">Aspect: %1$s</string>
<string name="bottom_qam_layout_full">Lățime completă</string>
@@ -4179,7 +4203,6 @@
<string name="theme_custom_signal">Evidențieri</string>
<string name="theme_custom_good">Succes</string>
<string name="theme_custom_error">Eroare</string>
<string name="theme_custom_warning">Avertisment</string>
<string name="hud_only_during_game">Afișează HUD-ul doar în timpul jocului</string>
<string name="hud_only_during_game_hint">Ascunde HUD-ul când nu sunt detectate cadre ale jocului.</string>
<string name="steam_store_close_steam">Închide mai întâi Steam</string>
+24 -1
View File
@@ -2138,6 +2138,23 @@
<string name="bottom_guides_continue">Продолжить чтение</string>
<string name="bottom_guides_empty">Для этой игры пока нет руководств Steam.</string>
<string name="bottom_guides_failed">Не удалось загрузить руководства Steam. Попробуйте снова, когда будете в сети.</string>
<string name="bottom_page_companion">Компаньон</string>
<string name="bottom_companion_none">Для этой игры пока нет страницы-компаньона. Для Stardew Valley есть.</string>
<string name="bottom_companion_stardew_missing">Установите мод двух экранов для Stardew Valley (SMAPI), чтобы видеть здесь свою ферму.</string>
<string name="bottom_companion_title_screen">Загрузите сохранение, чтобы увидеть здесь свою ферму.</string>
<string name="bottom_companion_energy">Энергия</string>
<string name="bottom_companion_health">Здоровье</string>
<string name="bottom_companion_birthdays">Дни рождения на этой неделе</string>
<string name="bottom_companion_quests">Задания</string>
<string name="bottom_companion_skyrim_missing">Установите плагин SKSE SkyrimWebSocket, чтобы видеть здесь своего персонажа.</string>
<string name="bottom_companion_pipboy_missing">Установите плагин F4SE Thor Pip-Boy, чтобы видеть здесь свой Pip-Boy.</string>
<string name="bottom_companion_level">Уровень %1$d</string>
<string name="bottom_companion_magicka">Магия</string>
<string name="bottom_companion_stamina">Запас сил</string>
<string name="bottom_companion_action_points">Очки действия</string>
<string name="bottom_companion_caps">Крышки</string>
<string name="bottom_companion_rads">Радиация</string>
<string name="bottom_companion_favorites">Избранное</string>
<string name="bottom_page_mirror">Зеркало</string>
<string name="bottom_mirror_pick">Проведите по части игры, которую нужно показывать здесь, например по мини-карте.</string>
<string name="bottom_mirror_save">Сохранить область</string>
@@ -2175,6 +2192,13 @@
<string name="bottom_mirror_region">Область</string>
<string name="bottom_mirror_top">Верхний экран</string>
<string name="bottom_mirror_scaling">Масштабирование</string>
<string name="bottom_companion_today">Сегодня</string>
<string name="bottom_companion_gold">Золото</string>
<string name="bottom_companion_hotbar">Панель</string>
<string name="bottom_companion_in_days">Через %1$d дн.</string>
<string name="bottom_companion_character">Персонаж</string>
<string name="bottom_companion_weight">Переносимый вес</string>
<string name="bottom_companion_radio">Радио</string>
<string name="bottom_qam_title">Быстрый доступ</string>
<string name="bottom_qam_layout">Макет: %1$s</string>
<string name="bottom_qam_layout_full">Во всю ширину</string>
@@ -4220,7 +4244,6 @@
<string name="theme_custom_signal">Выделения</string>
<string name="theme_custom_good">Успех</string>
<string name="theme_custom_error">Ошибка</string>
<string name="theme_custom_warning">Предупреждение</string>
<string name="hud_only_during_game">Показывать HUD только во время игры</string>
<string name="hud_only_during_game_hint">Скрывать HUD, когда кадры игры не обнаруживаются.</string>
<string name="steam_store_close_steam">Сначала закройте Steam</string>
+24 -1
View File
@@ -2087,6 +2087,23 @@
<string name="bottom_guides_continue">Fortsätt läsa</string>
<string name="bottom_guides_empty">Det finns inga Steam-guider för det här spelet ännu.</string>
<string name="bottom_guides_failed">Det gick inte att läsa in Steam-guider. Försök igen när du är online.</string>
<string name="bottom_page_companion">Följeslagare</string>
<string name="bottom_companion_none">Det finns ingen följeslagarsida för det här spelet ännu. Stardew Valley har en.</string>
<string name="bottom_companion_stardew_missing">Installera Stardew Valleys tvåskärmsmod för SMAPI för att se din gård här.</string>
<string name="bottom_companion_title_screen">Läs in ett sparat spel för att se din gård här.</string>
<string name="bottom_companion_energy">Energi</string>
<string name="bottom_companion_health">Hälsa</string>
<string name="bottom_companion_birthdays">Födelsedagar den här veckan</string>
<string name="bottom_companion_quests">Uppdrag</string>
<string name="bottom_companion_skyrim_missing">Installera SKSE-tillägget SkyrimWebSocket för att se din karaktär här.</string>
<string name="bottom_companion_pipboy_missing">Installera F4SE-tillägget Thor Pip-Boy för att se din Pip-Boy här.</string>
<string name="bottom_companion_level">Nivå %1$d</string>
<string name="bottom_companion_magicka">Magicka</string>
<string name="bottom_companion_stamina">Uthållighet</string>
<string name="bottom_companion_action_points">Handlingspoäng</string>
<string name="bottom_companion_caps">Kapsyler</string>
<string name="bottom_companion_rads">Strålning</string>
<string name="bottom_companion_favorites">Favoriter</string>
<string name="bottom_page_mirror">Spegel</string>
<string name="bottom_mirror_pick">Dra över den del av spelet som ska visas här, till exempel minikartan.</string>
<string name="bottom_mirror_save">Spara område</string>
@@ -2124,6 +2141,13 @@
<string name="bottom_mirror_region">Område</string>
<string name="bottom_mirror_top">Övre skärm</string>
<string name="bottom_mirror_scaling">Skalning</string>
<string name="bottom_companion_today">I dag</string>
<string name="bottom_companion_gold">Guld</string>
<string name="bottom_companion_hotbar">Snabbfält</string>
<string name="bottom_companion_in_days">Om %1$d dagar</string>
<string name="bottom_companion_character">Karaktär</string>
<string name="bottom_companion_weight">Bärvikt</string>
<string name="bottom_companion_radio">Radio</string>
<string name="bottom_qam_title">Snabbåtkomst</string>
<string name="bottom_qam_layout">Layout: %1$s</string>
<string name="bottom_qam_layout_full">Full bredd</string>
@@ -4139,7 +4163,6 @@
<string name="theme_custom_signal">Markeringar</string>
<string name="theme_custom_good">Lyckades</string>
<string name="theme_custom_error">Fel</string>
<string name="theme_custom_warning">Varning</string>
<string name="hud_only_during_game">Visa HUD endast under spel</string>
<string name="hud_only_during_game_hint">Dölj HUD när inga spelbildrutor upptäcks.</string>
<string name="steam_store_close_steam">Stäng Steam först</string>
+24 -1
View File
@@ -2063,6 +2063,23 @@
<string name="bottom_guides_continue">อ่านต่อ</string>
<string name="bottom_guides_empty">ยังไม่มีคู่มือ Steam สำหรับเกมนี้</string>
<string name="bottom_guides_failed">โหลดคู่มือ Steam ไม่ได้ ลองอีกครั้งเมื่อออนไลน์</string>
<string name="bottom_page_companion">คู่หู</string>
<string name="bottom_companion_none">ยังไม่มีหน้าคู่หูสำหรับเกมนี้ Stardew Valley มีแล้ว</string>
<string name="bottom_companion_stardew_missing">ติดตั้งม็อดจอคู่ของ Stardew Valley สำหรับ SMAPI เพื่อดูฟาร์มของคุณที่นี่</string>
<string name="bottom_companion_title_screen">โหลดเซฟเพื่อดูฟาร์มของคุณที่นี่</string>
<string name="bottom_companion_energy">พลังงาน</string>
<string name="bottom_companion_health">พลังชีวิต</string>
<string name="bottom_companion_birthdays">วันเกิดสัปดาห์นี้</string>
<string name="bottom_companion_quests">เควสต์</string>
<string name="bottom_companion_skyrim_missing">ติดตั้งปลั๊กอิน SKSE SkyrimWebSocket เพื่อดูตัวละครของคุณที่นี่</string>
<string name="bottom_companion_pipboy_missing">ติดตั้งปลั๊กอิน F4SE Thor Pip-Boy เพื่อดู Pip-Boy ของคุณที่นี่</string>
<string name="bottom_companion_level">เลเวล %1$d</string>
<string name="bottom_companion_magicka">มานา</string>
<string name="bottom_companion_stamina">สตามินา</string>
<string name="bottom_companion_action_points">แอ็กชันพอยต์</string>
<string name="bottom_companion_caps">ฝาขวด</string>
<string name="bottom_companion_rads">รังสี</string>
<string name="bottom_companion_favorites">รายการโปรด</string>
<string name="bottom_page_mirror">กระจก</string>
<string name="bottom_mirror_pick">ลากครอบส่วนของเกมที่ต้องการแสดงที่นี่ เช่น มินิแมป</string>
<string name="bottom_mirror_save">บันทึกพื้นที่</string>
@@ -2100,6 +2117,13 @@
<string name="bottom_mirror_region">พื้นที่</string>
<string name="bottom_mirror_top">จอบน</string>
<string name="bottom_mirror_scaling">การปรับขนาด</string>
<string name="bottom_companion_today">วันนี้</string>
<string name="bottom_companion_gold">ทอง</string>
<string name="bottom_companion_hotbar">แถบเครื่องมือ</string>
<string name="bottom_companion_in_days">อีก %1$d วัน</string>
<string name="bottom_companion_character">ตัวละคร</string>
<string name="bottom_companion_weight">น้ำหนักที่แบก</string>
<string name="bottom_companion_radio">วิทยุ</string>
<string name="bottom_qam_title">เข้าถึงด่วน</string>
<string name="bottom_qam_layout">เลย์เอาต์: %1$s</string>
<string name="bottom_qam_layout_full">เต็มความกว้าง</string>
@@ -4109,7 +4133,6 @@
<string name="theme_custom_signal">จุดเน้น</string>
<string name="theme_custom_good">สำเร็จ</string>
<string name="theme_custom_error">ข้อผิดพลาด</string>
<string name="theme_custom_warning">คำเตือน</string>
<string name="hud_only_during_game">แสดง HUD เฉพาะขณะเล่นเกม</string>
<string name="hud_only_during_game_hint">ซ่อน HUD เมื่อไม่พบเฟรมของเกม</string>
<string name="steam_store_close_steam">ปิด Steam ก่อน</string>
+24 -1
View File
@@ -2079,6 +2079,23 @@
<string name="bottom_guides_continue">Okumaya devam et</string>
<string name="bottom_guides_empty">Bu oyun için henüz Steam rehberi yok.</string>
<string name="bottom_guides_failed">Steam rehberleri yüklenemedi. Çevrimiçi olduğunuzda tekrar deneyin.</string>
<string name="bottom_page_companion">Yardımcı</string>
<string name="bottom_companion_none">Bu oyun için henüz bir yardımcı sayfası yok. Stardew Valley için var.</string>
<string name="bottom_companion_stardew_missing">Çiftliğinizi burada görmek için Stardew Valley çift ekran modunu (SMAPI) kurun.</string>
<string name="bottom_companion_title_screen">Çiftliğinizi burada görmek için bir kayıt yükleyin.</string>
<string name="bottom_companion_energy">Enerji</string>
<string name="bottom_companion_health">Sağlık</string>
<string name="bottom_companion_birthdays">Bu haftaki doğum günleri</string>
<string name="bottom_companion_quests">Görevler</string>
<string name="bottom_companion_skyrim_missing">Karakterinizi burada görmek için SKSE eklentisi SkyrimWebSocket\'i kurun.</string>
<string name="bottom_companion_pipboy_missing">Pip-Boy\'unuzu burada görmek için F4SE eklentisi Thor Pip-Boy\'u kurun.</string>
<string name="bottom_companion_level">Seviye %1$d</string>
<string name="bottom_companion_magicka">Büyü</string>
<string name="bottom_companion_stamina">Dayanıklılık</string>
<string name="bottom_companion_action_points">Aksiyon puanı</string>
<string name="bottom_companion_caps">Kapaklar</string>
<string name="bottom_companion_rads">Radyasyon</string>
<string name="bottom_companion_favorites">Favoriler</string>
<string name="bottom_page_mirror">Ayna</string>
<string name="bottom_mirror_pick">Burada gösterilecek oyun bölümünün üzerinden sürükleyin, örneğin mini harita.</string>
<string name="bottom_mirror_save">Bölgeyi kaydet</string>
@@ -2116,6 +2133,13 @@
<string name="bottom_mirror_region">Bölge</string>
<string name="bottom_mirror_top">Üst ekran</string>
<string name="bottom_mirror_scaling">Ölçekleme</string>
<string name="bottom_companion_today">Bugün</string>
<string name="bottom_companion_gold">Altın</string>
<string name="bottom_companion_hotbar">Kısayol çubuğu</string>
<string name="bottom_companion_in_days">%1$d gün sonra</string>
<string name="bottom_companion_character">Karakter</string>
<string name="bottom_companion_weight">Taşıma ağırlığı</string>
<string name="bottom_companion_radio">Radyo</string>
<string name="bottom_qam_title">Hızlı Erişim</string>
<string name="bottom_qam_layout">Düzen: %1$s</string>
<string name="bottom_qam_layout_full">Tam genişlik</string>
@@ -4139,7 +4163,6 @@
<string name="theme_custom_signal">Vurgular</string>
<string name="theme_custom_good">Başarılı</string>
<string name="theme_custom_error">Hata</string>
<string name="theme_custom_warning">Uyarı</string>
<string name="hud_only_during_game">HUD\'yi yalnızca oyun sırasında göster</string>
<string name="hud_only_during_game_hint">Oyun kareleri algılanmadığında HUD\'yi gizle.</string>
<string name="steam_store_close_steam">Önce Steam\'i kapatın</string>
+24 -1
View File
@@ -2137,6 +2137,23 @@
<string name="bottom_guides_continue">Продовжити читання</string>
<string name="bottom_guides_empty">Для цієї гри ще немає посібників Steam.</string>
<string name="bottom_guides_failed">Не вдалося завантажити посібники Steam. Спробуйте знову, коли будете онлайн.</string>
<string name="bottom_page_companion">Компаньйон</string>
<string name="bottom_companion_none">Для цієї гри ще немає сторінки-компаньйона. Для Stardew Valley є.</string>
<string name="bottom_companion_stardew_missing">Встановіть мод двох екранів для Stardew Valley (SMAPI), щоб бачити тут свою ферму.</string>
<string name="bottom_companion_title_screen">Завантажте збереження, щоб побачити тут свою ферму.</string>
<string name="bottom_companion_energy">Енергія</string>
<string name="bottom_companion_health">Здоров’я</string>
<string name="bottom_companion_birthdays">Дні народження цього тижня</string>
<string name="bottom_companion_quests">Завдання</string>
<string name="bottom_companion_skyrim_missing">Встановіть плагін SKSE SkyrimWebSocket, щоб бачити тут свого персонажа.</string>
<string name="bottom_companion_pipboy_missing">Встановіть плагін F4SE Thor Pip-Boy, щоб бачити тут свій Pip-Boy.</string>
<string name="bottom_companion_level">Рівень %1$d</string>
<string name="bottom_companion_magicka">Магія</string>
<string name="bottom_companion_stamina">Витривалість</string>
<string name="bottom_companion_action_points">Очки дії</string>
<string name="bottom_companion_caps">Кришки</string>
<string name="bottom_companion_rads">Радіація</string>
<string name="bottom_companion_favorites">Вибране</string>
<string name="bottom_page_mirror">Дзеркало</string>
<string name="bottom_mirror_pick">Проведіть по частині гри, яку треба показувати тут, наприклад по мінікарті.</string>
<string name="bottom_mirror_save">Зберегти область</string>
@@ -2174,6 +2191,13 @@
<string name="bottom_mirror_region">Область</string>
<string name="bottom_mirror_top">Верхній екран</string>
<string name="bottom_mirror_scaling">Масштабування</string>
<string name="bottom_companion_today">Сьогодні</string>
<string name="bottom_companion_gold">Золото</string>
<string name="bottom_companion_hotbar">Панель</string>
<string name="bottom_companion_in_days">Через %1$d дн.</string>
<string name="bottom_companion_character">Персонаж</string>
<string name="bottom_companion_weight">Вага ноші</string>
<string name="bottom_companion_radio">Радіо</string>
<string name="bottom_qam_title">Швидкий доступ</string>
<string name="bottom_qam_layout">Макет: %1$s</string>
<string name="bottom_qam_layout_full">На всю ширину</string>
@@ -4219,7 +4243,6 @@
<string name="theme_custom_signal">Виділення</string>
<string name="theme_custom_good">Успіх</string>
<string name="theme_custom_error">Помилка</string>
<string name="theme_custom_warning">Попередження</string>
<string name="hud_only_during_game">Показувати HUD лише під час гри</string>
<string name="hud_only_during_game_hint">Приховувати HUD, коли кадри гри не виявляються.</string>
<string name="steam_store_close_steam">Спочатку закрийте Steam</string>
+24 -1
View File
@@ -2063,6 +2063,23 @@
<string name="bottom_guides_continue">Đọc tiếp</string>
<string name="bottom_guides_empty">Trò chơi này chưa có hướng dẫn Steam nào.</string>
<string name="bottom_guides_failed">Không tải được hướng dẫn Steam. Hãy thử lại khi bạn trực tuyến.</string>
<string name="bottom_page_companion">Đồng hành</string>
<string name="bottom_companion_none">Trò chơi này chưa có trang đồng hành. Stardew Valley đã có.</string>
<string name="bottom_companion_stardew_missing">Cài mod hai màn hình của Stardew Valley cho SMAPI để xem nông trại của bạn tại đây.</string>
<string name="bottom_companion_title_screen">Tải một bản lưu để xem nông trại của bạn tại đây.</string>
<string name="bottom_companion_energy">Năng lượng</string>
<string name="bottom_companion_health">Máu</string>
<string name="bottom_companion_birthdays">Sinh nhật tuần này</string>
<string name="bottom_companion_quests">Nhiệm vụ</string>
<string name="bottom_companion_skyrim_missing">Cài plugin SKSE SkyrimWebSocket để xem nhân vật của bạn tại đây.</string>
<string name="bottom_companion_pipboy_missing">Cài plugin F4SE Thor Pip-Boy để xem Pip-Boy của bạn tại đây.</string>
<string name="bottom_companion_level">Cấp %1$d</string>
<string name="bottom_companion_magicka">Ma lực</string>
<string name="bottom_companion_stamina">Thể lực</string>
<string name="bottom_companion_action_points">Điểm hành động</string>
<string name="bottom_companion_caps">Nắp chai</string>
<string name="bottom_companion_rads">Phóng xạ</string>
<string name="bottom_companion_favorites">Yêu thích</string>
<string name="bottom_page_mirror">Phản chiếu</string>
<string name="bottom_mirror_pick">Kéo qua phần trò chơi muốn hiển thị ở đây, chẳng hạn bản đồ nhỏ.</string>
<string name="bottom_mirror_save">Lưu vùng</string>
@@ -2100,6 +2117,13 @@
<string name="bottom_mirror_region">Vùng</string>
<string name="bottom_mirror_top">Màn hình trên</string>
<string name="bottom_mirror_scaling">Thu phóng</string>
<string name="bottom_companion_today">Hôm nay</string>
<string name="bottom_companion_gold">Vàng</string>
<string name="bottom_companion_hotbar">Thanh công cụ</string>
<string name="bottom_companion_in_days">Sau %1$d ngày</string>
<string name="bottom_companion_character">Nhân vật</string>
<string name="bottom_companion_weight">Trọng lượng mang</string>
<string name="bottom_companion_radio">Radio</string>
<string name="bottom_qam_title">Truy cập nhanh</string>
<string name="bottom_qam_layout">Bố cục: %1$s</string>
<string name="bottom_qam_layout_full">Toàn chiều rộng</string>
@@ -4109,7 +4133,6 @@
<string name="theme_custom_signal">Điểm nhấn</string>
<string name="theme_custom_good">Thành công</string>
<string name="theme_custom_error">Lỗi</string>
<string name="theme_custom_warning">Cảnh báo</string>
<string name="hud_only_during_game">Chỉ hiển thị HUD khi đang chơi</string>
<string name="hud_only_during_game_hint">Ẩn HUD khi không phát hiện khung hình trò chơi.</string>
<string name="steam_store_close_steam">Hãy đóng Steam trước</string>
+24 -1
View File
@@ -2140,6 +2140,23 @@
<string name="bottom_guides_continue">继续阅读</string>
<string name="bottom_guides_empty">此游戏还没有 Steam 指南。</string>
<string name="bottom_guides_failed">无法加载 Steam 指南。请在联网后重试。</string>
<string name="bottom_page_companion">伴侣页</string>
<string name="bottom_companion_none">此游戏还没有伴侣页。Stardew Valley 已支持。</string>
<string name="bottom_companion_stardew_missing">安装 Stardew Valley 的 SMAPI 双屏模组,即可在这里查看你的农场。</string>
<string name="bottom_companion_title_screen">载入存档后,这里会显示你的农场。</string>
<string name="bottom_companion_energy">体力</string>
<string name="bottom_companion_health">生命值</string>
<string name="bottom_companion_birthdays">本周生日</string>
<string name="bottom_companion_quests">任务</string>
<string name="bottom_companion_skyrim_missing">安装 SKSE 插件 SkyrimWebSocket,即可在这里查看你的角色。</string>
<string name="bottom_companion_pipboy_missing">安装 F4SE 插件 Thor Pip-Boy,即可在这里查看你的 Pip-Boy。</string>
<string name="bottom_companion_level">等级 %1$d</string>
<string name="bottom_companion_magicka">法力</string>
<string name="bottom_companion_stamina">耐力</string>
<string name="bottom_companion_action_points">行动点数</string>
<string name="bottom_companion_caps">瓶盖</string>
<string name="bottom_companion_rads">辐射</string>
<string name="bottom_companion_favorites">收藏</string>
<string name="bottom_page_mirror">镜像</string>
<string name="bottom_mirror_pick">拖动框选要在这里显示的游戏区域,例如小地图。</string>
<string name="bottom_mirror_save">保存区域</string>
@@ -2177,6 +2194,13 @@
<string name="bottom_mirror_region">区域</string>
<string name="bottom_mirror_top">上屏</string>
<string name="bottom_mirror_scaling">缩放</string>
<string name="bottom_companion_today">今天</string>
<string name="bottom_companion_gold">金币</string>
<string name="bottom_companion_hotbar">快捷栏</string>
<string name="bottom_companion_in_days">%1$d 天后</string>
<string name="bottom_companion_character">角色</string>
<string name="bottom_companion_weight">负重</string>
<string name="bottom_companion_radio">收音机</string>
<string name="bottom_qam_title">快速访问</string>
<string name="bottom_qam_layout">布局:%1$s</string>
<string name="bottom_qam_layout_full">全宽</string>
@@ -4109,7 +4133,6 @@
<string name="theme_custom_signal">高亮</string>
<string name="theme_custom_good">成功</string>
<string name="theme_custom_error">错误</string>
<string name="theme_custom_warning">警告</string>
<string name="hud_only_during_game">仅在游戏期间显示 HUD</string>
<string name="hud_only_during_game_hint">未检测到游戏帧时隐藏 HUD。</string>
<string name="steam_store_close_steam">请先关闭 Steam</string>
+24 -1
View File
@@ -2062,6 +2062,23 @@
<string name="bottom_guides_continue">繼續閱讀</string>
<string name="bottom_guides_empty">此遊戲暫時沒有 Steam 指南。</string>
<string name="bottom_guides_failed">無法載入 Steam 指南。請在連線後再試。</string>
<string name="bottom_page_companion">伴侶頁</string>
<string name="bottom_companion_none">此遊戲暫時沒有伴侶頁。Stardew Valley 已支援。</string>
<string name="bottom_companion_stardew_missing">安裝 Stardew Valley 的 SMAPI 雙屏模組,即可在這裡查看你的農場。</string>
<string name="bottom_companion_title_screen">載入存檔後,這裡會顯示你的農場。</string>
<string name="bottom_companion_energy">體力</string>
<string name="bottom_companion_health">生命值</string>
<string name="bottom_companion_birthdays">本週生日</string>
<string name="bottom_companion_quests">任務</string>
<string name="bottom_companion_skyrim_missing">安裝 SKSE 插件 SkyrimWebSocket,即可在這裡查看你的角色。</string>
<string name="bottom_companion_pipboy_missing">安裝 F4SE 插件 Thor Pip-Boy,即可在這裡查看你的 Pip-Boy。</string>
<string name="bottom_companion_level">等級 %1$d</string>
<string name="bottom_companion_magicka">魔力</string>
<string name="bottom_companion_stamina">耐力</string>
<string name="bottom_companion_action_points">行動點數</string>
<string name="bottom_companion_caps">瓶蓋</string>
<string name="bottom_companion_rads">輻射</string>
<string name="bottom_companion_favorites">最愛</string>
<string name="bottom_page_mirror">鏡像</string>
<string name="bottom_mirror_pick">拖曳框選要在這裡顯示的遊戲區域,例如小地圖。</string>
<string name="bottom_mirror_save">儲存區域</string>
@@ -2099,6 +2116,13 @@
<string name="bottom_mirror_region">區域</string>
<string name="bottom_mirror_top">上屏</string>
<string name="bottom_mirror_scaling">縮放</string>
<string name="bottom_companion_today">今天</string>
<string name="bottom_companion_gold">金幣</string>
<string name="bottom_companion_hotbar">快捷列</string>
<string name="bottom_companion_in_days">%1$d 天後</string>
<string name="bottom_companion_character">角色</string>
<string name="bottom_companion_weight">負重</string>
<string name="bottom_companion_radio">收音機</string>
<string name="bottom_qam_title">快速存取</string>
<string name="bottom_qam_layout">版面配置:%1$s</string>
<string name="bottom_qam_layout_full">全寬</string>
@@ -4109,7 +4133,6 @@
<string name="theme_custom_signal">重點標示</string>
<string name="theme_custom_good">成功</string>
<string name="theme_custom_error">錯誤</string>
<string name="theme_custom_warning">警告</string>
<string name="hud_only_during_game">只在遊戲期間顯示 HUD</string>
<string name="hud_only_during_game_hint">未偵測到遊戲畫面時隱藏 HUD。</string>
<string name="steam_store_close_steam">請先關閉 Steam</string>
+24 -1
View File
@@ -2062,6 +2062,23 @@
<string name="bottom_guides_continue">繼續閱讀</string>
<string name="bottom_guides_empty">此遊戲尚無 Steam 指南。</string>
<string name="bottom_guides_failed">無法載入 Steam 指南。請在連線後再試。</string>
<string name="bottom_page_companion">夥伴頁</string>
<string name="bottom_companion_none">此遊戲尚無夥伴頁。Stardew Valley 已支援。</string>
<string name="bottom_companion_stardew_missing">安裝 Stardew Valley 的 SMAPI 雙螢幕模組,即可在這裡查看你的農場。</string>
<string name="bottom_companion_title_screen">載入存檔後,這裡會顯示你的農場。</string>
<string name="bottom_companion_energy">體力</string>
<string name="bottom_companion_health">生命值</string>
<string name="bottom_companion_birthdays">本週生日</string>
<string name="bottom_companion_quests">任務</string>
<string name="bottom_companion_skyrim_missing">安裝 SKSE 外掛 SkyrimWebSocket,即可在這裡查看你的角色。</string>
<string name="bottom_companion_pipboy_missing">安裝 F4SE 外掛 Thor Pip-Boy,即可在這裡查看你的 Pip-Boy。</string>
<string name="bottom_companion_level">等級 %1$d</string>
<string name="bottom_companion_magicka">魔力</string>
<string name="bottom_companion_stamina">耐力</string>
<string name="bottom_companion_action_points">行動點數</string>
<string name="bottom_companion_caps">瓶蓋</string>
<string name="bottom_companion_rads">輻射</string>
<string name="bottom_companion_favorites">最愛</string>
<string name="bottom_page_mirror">鏡像</string>
<string name="bottom_mirror_pick">拖曳框選要在這裡顯示的遊戲區域,例如小地圖。</string>
<string name="bottom_mirror_save">儲存區域</string>
@@ -2099,6 +2116,13 @@
<string name="bottom_mirror_region">區域</string>
<string name="bottom_mirror_top">上螢幕</string>
<string name="bottom_mirror_scaling">縮放</string>
<string name="bottom_companion_today">今天</string>
<string name="bottom_companion_gold">金幣</string>
<string name="bottom_companion_hotbar">快捷列</string>
<string name="bottom_companion_in_days">%1$d 天後</string>
<string name="bottom_companion_character">角色</string>
<string name="bottom_companion_weight">負重</string>
<string name="bottom_companion_radio">收音機</string>
<string name="bottom_qam_title">快速存取</string>
<string name="bottom_qam_layout">版面配置:%1$s</string>
<string name="bottom_qam_layout_full">全寬</string>
@@ -4109,7 +4133,6 @@
<string name="theme_custom_signal">醒目標示</string>
<string name="theme_custom_good">成功</string>
<string name="theme_custom_error">錯誤</string>
<string name="theme_custom_warning">警告</string>
<string name="hud_only_during_game">僅在遊戲期間顯示 HUD</string>
<string name="hud_only_during_game_hint">未偵測到遊戲畫面時隱藏 HUD。</string>
<string name="steam_store_close_steam">請先關閉 Steam</string>
+24 -1
View File
@@ -2028,7 +2028,6 @@
<string name="theme_custom_signal">Highlights</string>
<string name="theme_custom_good">Success</string>
<string name="theme_custom_error">Error</string>
<string name="theme_custom_warning">Warning</string>
<string name="pckb_key_esc">Esc</string>
<string name="pckb_key_ins">Ins</string>
<string name="pckb_key_del">Del</string>
@@ -2359,6 +2358,23 @@
<string name="bottom_guides_continue">Continue reading</string>
<string name="bottom_guides_empty">There are no Steam guides for this game yet.</string>
<string name="bottom_guides_failed">Could not load Steam guides. Check back once you are online.</string>
<string name="bottom_page_companion">Companion</string>
<string name="bottom_companion_none">There is no companion page for this game yet. Stardew Valley has one.</string>
<string name="bottom_companion_stardew_missing">Install the Stardew Valley dual-screen mod for SMAPI to see your farm here.</string>
<string name="bottom_companion_title_screen">Load a save to see your farm here.</string>
<string name="bottom_companion_energy">Energy</string>
<string name="bottom_companion_health">Health</string>
<string name="bottom_companion_birthdays">Birthdays this week</string>
<string name="bottom_companion_quests">Quests</string>
<string name="bottom_companion_skyrim_missing">Install the SkyrimWebSocket SKSE plugin to see your character here.</string>
<string name="bottom_companion_pipboy_missing">Install the Thor Pip-Boy F4SE plugin to see your Pip-Boy here.</string>
<string name="bottom_companion_level">Level %1$d</string>
<string name="bottom_companion_magicka">Magicka</string>
<string name="bottom_companion_stamina">Stamina</string>
<string name="bottom_companion_action_points">Action points</string>
<string name="bottom_companion_caps">Caps</string>
<string name="bottom_companion_rads">Rads</string>
<string name="bottom_companion_favorites">Favorites</string>
<string name="bottom_page_mirror">Mirror</string>
<string name="bottom_mirror_pick">Drag over the part of the game to show here, such as the minimap.</string>
<string name="bottom_mirror_save">Save region</string>
@@ -2407,6 +2423,13 @@
<string name="bottom_mirror_region">Region</string>
<string name="bottom_mirror_top">Top screen</string>
<string name="bottom_mirror_scaling">Scaling</string>
<string name="bottom_companion_today">Today</string>
<string name="bottom_companion_gold">Gold</string>
<string name="bottom_companion_hotbar">Hotbar</string>
<string name="bottom_companion_in_days">In %1$d days</string>
<string name="bottom_companion_character">Character</string>
<string name="bottom_companion_weight">Carry weight</string>
<string name="bottom_companion_radio">Radio</string>
<string name="bottom_qam_title">Quick Access</string>
<string name="bottom_qam_layout">Layout: %1$s</string>
<string name="bottom_qam_layout_full">Full width</string>
+7 -17
View File
@@ -5,6 +5,7 @@
use std::collections::{HashMap, HashSet};
use std::fs::{self, File, OpenOptions};
use std::io::{Read, Write};
use std::os::unix::fs::FileExt;
use std::path::{Path, PathBuf};
use std::sync::atomic::{AtomicBool, AtomicU64, AtomicUsize, Ordering};
use std::sync::Mutex;
@@ -17,7 +18,6 @@ use super::net;
use super::zip::{self, Entry};
use crate::amazon::install::check::{free_bytes, space_problem};
use crate::amazon::install::{Events, ReplaceGate, Stop};
use crate::grow_write::{holes_supported, is_cancel, GrowFront};
use crate::fetch_core::{distinct_host_count, run_fetch, FetchItem, FetchOptions, FetchSink, SinkError};
pub const LEDGER: &str = ".droiddeck-ea-files";
@@ -37,7 +37,6 @@ struct Split {
file: Mutex<Option<File>>,
received: Vec<AtomicU64>,
left: AtomicUsize,
front: GrowFront,
}
#[derive(Clone, Copy)]
@@ -484,16 +483,9 @@ impl Placer<'_> {
let old = split.received[part].swap(0, Ordering::Relaxed);
self.in_flight.fetch_sub(old, Ordering::Relaxed);
}
split
.front
.write_all_at(handle, start + offset, data, self.stop)
.map_err(|e| {
if is_cancel(&e) {
SinkError::Retry(format!("{}: cancelled", job.path))
} else {
SinkError::Fatal(self.fail(format!("Could not write {}: {e}", job.path)))
}
})?;
handle
.write_all_at(data, start + offset)
.map_err(|e| SinkError::Fatal(self.fail(format!("Could not write {}: {e}", job.path))))?;
drop(file);
split.received[part].fetch_add(data.len() as u64, Ordering::Relaxed);
self.in_flight.fetch_add(data.len() as u64, Ordering::Relaxed);
@@ -706,7 +698,6 @@ pub fn run(req: &Request, cancel: &AtomicBool, ev: &dyn Events) -> Result<Finish
let host = origin(&req.url);
let works = works(&remote, req.part_bytes);
let holes = holes_supported(&req.game_dir);
let splits: Vec<Option<Split>> = remote
.iter()
.enumerate()
@@ -720,7 +711,6 @@ pub fn run(req: &Request, cancel: &AtomicBool, ev: &dyn Events) -> Result<Finish
file: Mutex::new(None),
received: (0..parts).map(|_| AtomicU64::new(0)).collect(),
left: AtomicUsize::new(parts),
front: GrowFront::new(holes),
}
})
})
@@ -807,13 +797,13 @@ pub fn run(req: &Request, cancel: &AtomicBool, ev: &dyn Events) -> Result<Finish
return Err(Stop::Failed(message));
}
if !placed_all {
if cancel.load(Ordering::SeqCst) {
return Err(Stop::Cancelled);
}
if let Some(error) = outcome.as_ref().and_then(|o| o.error.clone()) {
ev.log(&format!("download failed: {error}"));
return Err(Stop::Failed("A file failed to download".into()));
}
if cancel.load(Ordering::SeqCst) {
return Err(Stop::Cancelled);
}
return Err(Stop::Failed("The download ended before every file was written".into()));
}
@@ -21,14 +21,7 @@ fn rejects_third_party_managed_install_before_manifest_parsing() {
}
}
#[derive(Default)]
struct Misses {
seen: AtomicUsize,
cancel_at: usize,
cancel: Arc<AtomicBool>,
}
fn serve(files: HashMap<String, Vec<u8>>, hits: Arc<AtomicUsize>, misses: Arc<Misses>) -> String {
fn serve(files: HashMap<String, Vec<u8>>, hits: Arc<AtomicUsize>) -> String {
let listener = TcpListener::bind("127.0.0.1:0").unwrap();
let addr = listener.local_addr().unwrap();
let files = Arc::new(files);
@@ -37,14 +30,13 @@ fn serve(files: HashMap<String, Vec<u8>>, hits: Arc<AtomicUsize>, misses: Arc<Mi
let Ok(stream) = stream else { continue };
let files = Arc::clone(&files);
let hits = Arc::clone(&hits);
let misses = Arc::clone(&misses);
std::thread::spawn(move || answer(stream, &files, &hits, &misses));
std::thread::spawn(move || answer(stream, &files, &hits));
}
});
format!("http://{addr}")
}
fn answer(mut stream: TcpStream, files: &HashMap<String, Vec<u8>>, hits: &AtomicUsize, misses: &Misses) {
fn answer(mut stream: TcpStream, files: &HashMap<String, Vec<u8>>, hits: &AtomicUsize) {
let mut reader = BufReader::new(stream.try_clone().unwrap());
let mut first = String::new();
if reader.read_line(&mut first).is_err() {
@@ -62,13 +54,7 @@ fn answer(mut stream: TcpStream, files: &HashMap<String, Vec<u8>>, hits: &Atomic
hits.fetch_add(1, Ordering::Relaxed);
let (status, body) = match files.get(&path) {
Some(b) => ("200 OK", b.clone()),
None => {
if misses.seen.fetch_add(1, Ordering::SeqCst) + 1 == misses.cancel_at {
std::thread::sleep(std::time::Duration::from_millis(300));
misses.cancel.store(true, Ordering::SeqCst);
}
("404 Not Found", Vec::new())
}
None => ("404 Not Found", Vec::new()),
};
let head = format!("HTTP/1.1 {status}\r\nContent-Length: {}\r\nConnection: close\r\n\r\n", body.len());
let _ = stream.write_all(head.as_bytes());
@@ -120,10 +106,6 @@ fn pattern(seed: u8, len: usize) -> Vec<u8> {
}
fn fixture() -> Fixture {
fixture_missing(false, Arc::new(Misses::default()))
}
fn fixture_missing(last_chunk: bool, misses: Arc<Misses>) -> Fixture {
let mut c1 = chunk(1, 4096);
let mut c2 = chunk(2, 2048);
let mut c3 = chunk(3, 1000);
@@ -186,13 +168,10 @@ fn fixture_missing(last_chunk: bool, misses: Arc<Misses>) -> Fixture {
let mut served = HashMap::new();
served.insert("/Builds/x/test.manifest".to_string(), manifest_bytes);
for (info, data) in [(&c1, &d1), (&c2, &d2), (&c3, &d3)] {
if last_chunk && info.guid == c3.guid {
continue;
}
served.insert(format!("/Builds/x/{}", parsed.chunk_path(info)), encode(data, true));
}
let hits = Arc::new(AtomicUsize::new(0));
let base = serve(served, Arc::clone(&hits), misses);
let base = serve(served, Arc::clone(&hits));
Fixture {
base,
hits,
@@ -294,40 +273,6 @@ fn a_cancelled_run_reports_cancel() {
let _ = fs::remove_dir_all(&game);
}
fn kept_c(fx: &Fixture, game: &Path) -> bool {
let c = &fx.expected[1].1;
let partial = game.join(staging::DIR_NAME).join(staging::partial_name("b/c.bin", c.len() as u64, Some(Sha1::digest(c).into())));
partial.is_file() && staging::list_path(&partial).is_file()
}
#[test]
fn a_chunk_that_cannot_be_fetched_fails_and_keeps_written_parts() {
let misses = Arc::new(Misses::default());
let fx = fixture_missing(true, Arc::clone(&misses));
let game = temp_game("fetch-fail");
let cancel = AtomicBool::new(false);
let err = run(&request(&fx, &game), &cancel, &Recorder::default()).unwrap_err();
assert!(matches!(&err, Stop::Failed(m) if m.starts_with("Download failed: ")), "{err:?}");
assert_eq!(misses.seen.load(Ordering::SeqCst), crate::fetch_core::MAX_ITEM_ATTEMPTS as usize);
assert!(kept_c(&fx, &game));
let _ = fs::remove_dir_all(&game);
}
#[test]
fn a_cancel_during_the_last_fetch_attempt_reports_cancel_and_keeps_written_parts() {
let cancel = Arc::new(AtomicBool::new(false));
let last = crate::fetch_core::MAX_ITEM_ATTEMPTS as usize;
let misses = Arc::new(Misses { seen: AtomicUsize::new(0), cancel_at: last, cancel: Arc::clone(&cancel) });
let fx = fixture_missing(true, Arc::clone(&misses));
let game = temp_game("fetch-cancel");
let events = Recorder::default();
assert_eq!(run(&request(&fx, &game), &cancel, &events).unwrap_err(), Stop::Cancelled);
assert_eq!(misses.seen.load(Ordering::SeqCst), last);
assert!(events.logs.lock().unwrap().iter().any(|l| l.contains(&format!("failed after {last} attempts"))));
assert!(kept_c(&fx, &game));
let _ = fs::remove_dir_all(&game);
}
fn place_partial(fx: &Fixture, game: &Path, data: &[u8], list: &str) -> PathBuf {
let stage = staging::recover(game).unwrap();
let a = &fx.expected[0].1;
@@ -8,7 +8,6 @@ use std::time::{Duration, Instant};
use sha1::{Digest, Sha1};
use super::cache;
use crate::grow_write::{holes_supported, is_cancel, GrowFront};
use super::schedule::{PlanPart, Schedule, NONE};
use super::{staging, Events, Stop};
use crate::epic::chunk;
@@ -81,7 +80,6 @@ struct Coord {
struct Engine<'a> {
input: &'a EngineInput<'a>,
slots: Vec<Mutex<Slot>>,
fronts: Vec<GrowFront>,
coord: Mutex<Coord>,
wake: Condvar,
admitted: AtomicUsize,
@@ -97,17 +95,6 @@ struct Engine<'a> {
total_bytes: u64,
}
enum Halt {
Cancelled,
Failed(String),
}
impl From<String> for Halt {
fn from(message: String) -> Self {
Halt::Failed(message)
}
}
enum Source<'d> {
Memory(&'d [u8]),
Cache(PathBuf),
@@ -125,13 +112,6 @@ impl<'a> Engine<'a> {
message
}
fn sink_error(&self, halt: Halt) -> SinkError {
match halt {
Halt::Cancelled => SinkError::Retry("cancelled".into()),
Halt::Failed(message) => SinkError::Fatal(self.fail(message)),
}
}
fn cache_path(&self, producer: usize) -> PathBuf {
let p = &self.input.schedule.producers[producer];
let info = &self.input.manifest.chunks[p.chunk as usize];
@@ -178,7 +158,7 @@ impl<'a> Engine<'a> {
self.input.schedule.producers[fetch[at] as usize].anchor as usize + 1
}
fn write_use(&self, u: usize, source: &Source<'_>) -> Result<(), Halt> {
fn write_use(&self, u: usize, source: &Source<'_>) -> Result<(), String> {
let schedule = &self.input.schedule;
let f = schedule.use_file[u] as usize;
let j = u - schedule.file_start[f] as usize;
@@ -195,22 +175,16 @@ impl<'a> Engine<'a> {
let start = part.chunk_offset as usize;
let end = start + part.size as usize;
if end > data.len() {
return Err(format!("A chunk is too short for {}", file.path).into());
return Err(format!("A chunk is too short for {}", file.path));
}
let piece = &data[start..end];
let handle = self.slots[f].lock().expect("slot lock").file.clone();
let Some(handle) = handle else {
return Err(format!("internal: {} is not open", file.path).into());
return Err(format!("internal: {} is not open", file.path));
};
self.fronts[f]
.write_all_at(&handle, part.file_offset, piece, self.stop)
.map_err(|e| {
if is_cancel(&e) {
Halt::Cancelled
} else {
Halt::Failed(format!("Could not assemble or atomically replace {}: {e}", file.path))
}
})?;
handle
.write_all_at(piece, part.file_offset)
.map_err(|e| format!("Could not assemble or atomically replace {}: {e}", file.path))?;
self.written.fetch_add(piece.len() as u64, Ordering::Relaxed);
let complete = {
@@ -369,18 +343,14 @@ impl<'a> Engine<'a> {
}
};
let Some(f) = candidate else { continue };
match self.admit(f) {
Ok(()) => {}
Err(Halt::Cancelled) => return,
Err(Halt::Failed(e)) => {
self.fail(e);
return;
}
if let Err(e) = self.admit(f) {
self.fail(e);
return;
}
}
}
fn admit(&self, f: usize) -> Result<(), Halt> {
fn admit(&self, f: usize) -> Result<(), String> {
self.open_stage(f)?;
let schedule = &self.input.schedule;
let file = &self.input.files[f];
@@ -445,7 +415,7 @@ impl<'a> Engine<'a> {
out
};
for u in claims {
self.write_use(u, &Source::Memory(&data)).map_err(|h| self.sink_error(h))?;
self.write_use(u, &Source::Memory(&data)).map_err(|e| SinkError::Fatal(self.fail(e)))?;
}
Ok(0)
}
@@ -476,10 +446,8 @@ pub fn run(input: &EngineInput<'_>, stop: &AtomicBool, events: &dyn Events) -> R
cached[i] = true;
}
}
let holes = holes_supported(&input.stage_dir);
let engine = Engine {
input,
fronts: input.files.iter().map(|_| GrowFront::new(holes)).collect(),
slots: input
.files
.iter()
@@ -564,7 +532,7 @@ pub fn run(input: &EngineInput<'_>, stop: &AtomicBool, events: &dyn Events) -> R
}
ready
};
let (outcome, cancelled) = std::thread::scope(|scope| {
let outcome = std::thread::scope(|scope| {
let admitter = std::thread::Builder::new()
.name("epic-admit".into())
.spawn_scoped(scope, || {
@@ -573,7 +541,7 @@ pub fn run(input: &EngineInput<'_>, stop: &AtomicBool, events: &dyn Events) -> R
});
if let Err(e) = admitter {
engine.fail(format!("could not start the install thread: {e}"));
return (None, false);
return None;
}
let outcome = if items.is_empty() {
None
@@ -584,9 +552,11 @@ pub fn run(input: &EngineInput<'_>, stop: &AtomicBool, events: &dyn Events) -> R
let mut c = engine.coord.lock().expect("coord lock");
c.fetch_done = true;
}
let cancelled = settle(outcome.as_ref().is_some_and(|o| !o.ok()), stop);
if outcome.as_ref().is_some_and(|o| !o.ok()) {
stop.store(true, Ordering::SeqCst);
}
engine.wake.notify_all();
(outcome, cancelled)
outcome
});
let failure = engine.failure.lock().expect("failure lock").take().filter(|m| !m.is_empty());
@@ -623,35 +593,16 @@ fetches={} refetches={} peak_cache_mib={} hosts={}",
hosts.join(","),
));
ending(failure, complete, fetch_error, cancelled, stop.load(Ordering::SeqCst))?;
Ok(Stats { bytes_written: written, files_written: input.files.len() })
}
fn settle(fetch_failed: bool, stop: &AtomicBool) -> bool {
let cancelled = stop.load(Ordering::SeqCst);
if fetch_failed {
stop.store(true, Ordering::SeqCst);
}
cancelled
}
fn ending(
failure: Option<String>,
complete: bool,
fetch_error: Option<String>,
cancelled: bool,
stopped: bool,
) -> Result<(), Stop> {
if let Some(message) = failure {
return Err(Stop::Failed(message));
}
if complete {
return Ok(());
return Ok(Stats { bytes_written: written, files_written: input.files.len() });
}
if let Some(message) = fetch_error.filter(|_| !cancelled) {
if let Some(message) = fetch_error {
return Err(Stop::Failed(format!("Download failed: {}", tidy_fetch_error(&message))));
}
if stopped {
if stop.load(Ordering::SeqCst) {
return Err(Stop::Cancelled);
}
Err(Stop::Failed("The download ended before every file was written".into()))
@@ -753,37 +704,4 @@ mod tests {
assert_eq!(fs::read_to_string(staging::list_path(&kept)).unwrap(), "10\n20\n");
let _ = fs::remove_dir_all(&dir);
}
fn end(fetch_error: Option<&str>, stop: &AtomicBool) -> Result<(), Stop> {
let cancelled = settle(fetch_error.is_some(), stop);
ending(None, false, fetch_error.map(str::to_string), cancelled, stop.load(Ordering::SeqCst))
}
#[test]
fn a_cancel_during_the_last_fetch_attempt_ends_as_cancelled() {
let stop = AtomicBool::new(true);
assert!(matches!(end(Some("timed out"), &stop), Err(Stop::Cancelled)));
assert!(matches!(end(None, &stop), Err(Stop::Cancelled)));
}
#[test]
fn a_fetch_failure_without_a_cancel_ends_as_failed() {
let stop = AtomicBool::new(false);
match end(Some("timed out"), &stop) {
Err(Stop::Failed(message)) => assert!(message.starts_with("Download failed: ")),
_ => panic!("a fetch failure must be reported"),
}
assert!(stop.load(Ordering::SeqCst));
let idle = AtomicBool::new(false);
assert!(matches!(end(None, &idle), Err(Stop::Failed(_))));
}
#[test]
fn a_write_failure_or_a_finished_install_wins_over_a_cancel() {
assert!(matches!(
ending(Some("disk full".into()), false, None, true, true),
Err(Stop::Failed(message)) if message == "disk full"
));
assert!(ending(None, true, Some("late".into()), true, true).is_ok());
}
}
-293
View File
@@ -1,293 +0,0 @@
use std::fs::{self, File, OpenOptions};
use std::io;
use std::os::unix::fs::{FileExt, MetadataExt, OpenOptionsExt};
use std::path::Path;
use std::sync::atomic::{AtomicBool, AtomicU64, Ordering};
use std::sync::Mutex;
pub const FILL_STEP: usize = 4 * 1024 * 1024;
pub const DIRECT_GAP: u64 = 4 * 1024 * 1024;
const PROBE_GAP: u64 = 1024 * 1024;
static PROBE_SEQ: AtomicU64 = AtomicU64::new(0);
const PROBE_PREFIX: &str = ".droiddeck-hole-probe-";
pub fn is_cancel(err: &io::Error) -> bool {
err.kind() == io::ErrorKind::Interrupted
}
pub fn holes_supported(dir: &Path) -> bool {
let probe = dir.join(format!(
"{PROBE_PREFIX}{}-{}",
std::process::id(),
PROBE_SEQ.fetch_add(1, Ordering::Relaxed)
));
let Ok(file) = OpenOptions::new()
.write(true)
.create_new(true)
.custom_flags(libc::O_NOFOLLOW)
.open(&probe)
else {
return true;
};
let written = file.write_all_at(&[0u8], PROBE_GAP - 1);
drop(file);
let measured = written.and_then(|_| fs::symlink_metadata(&probe));
let _ = fs::remove_file(&probe);
measured
.map(|meta| meta.blocks().saturating_mul(512) < PROBE_GAP)
.unwrap_or(true)
}
pub struct GrowFront {
holes: bool,
size: AtomicU64,
known: AtomicBool,
fill: Mutex<()>,
}
impl GrowFront {
pub fn new(holes: bool) -> Self {
GrowFront {
holes,
size: AtomicU64::new(0),
known: AtomicBool::new(false),
fill: Mutex::new(()),
}
}
pub fn reset(&self) {
let _guard = self.fill.lock().unwrap_or_else(|e| e.into_inner());
self.known.store(false, Ordering::Release);
self.size.store(0, Ordering::Release);
}
pub fn write_all_at(
&self,
file: &File,
offset: u64,
data: &[u8],
cancel: &AtomicBool,
) -> io::Result<()> {
let end = offset.saturating_add(data.len() as u64);
if self.holes
|| (self.known.load(Ordering::Acquire) && end <= self.size.load(Ordering::Acquire))
{
return file.write_all_at(data, offset);
}
let _guard = self.fill.lock().unwrap_or_else(|e| e.into_inner());
let mut size = self.current(file)?;
if offset > size.saturating_add(DIRECT_GAP) {
self.fill_to(file, &mut size, offset - DIRECT_GAP, cancel)?;
}
if let Err(err) = file.write_all_at(data, offset) {
self.known.store(false, Ordering::Release);
return Err(err);
}
self.publish(size.max(end));
Ok(())
}
pub fn extend_to(&self, file: &File, len: u64, cancel: &AtomicBool) -> io::Result<()> {
if self.holes {
return file.set_len(len);
}
let _guard = self.fill.lock().unwrap_or_else(|e| e.into_inner());
let mut size = self.current(file)?;
if size < len {
self.fill_to(file, &mut size, len, cancel)?;
}
Ok(())
}
fn current(&self, file: &File) -> io::Result<u64> {
if self.known.load(Ordering::Acquire) {
Ok(self.size.load(Ordering::Acquire))
} else {
Ok(file.metadata()?.len())
}
}
fn fill_to(
&self,
file: &File,
size: &mut u64,
target: u64,
cancel: &AtomicBool,
) -> io::Result<()> {
let zeros = vec![0u8; FILL_STEP];
while *size < target {
if cancel.load(Ordering::Relaxed) {
self.publish(*size);
return Err(io::Error::new(io::ErrorKind::Interrupted, "cancelled"));
}
let step = ((target - *size) as usize).min(FILL_STEP);
if let Err(err) = file.write_all_at(&zeros[..step], *size) {
self.known.store(false, Ordering::Release);
return Err(err);
}
*size += step as u64;
self.publish(*size);
}
Ok(())
}
fn publish(&self, size: u64) {
self.size.store(size, Ordering::Release);
self.known.store(true, Ordering::Release);
}
}
#[cfg(test)]
mod tests {
use super::*;
use std::sync::Arc;
fn temp_dir(tag: &str) -> std::path::PathBuf {
let dir = std::env::temp_dir().join(format!(
"grow-write-{tag}-{}-{}",
std::process::id(),
PROBE_SEQ.fetch_add(1, Ordering::Relaxed)
));
fs::create_dir_all(&dir).unwrap();
dir
}
fn open(path: &Path) -> File {
OpenOptions::new()
.create(true)
.read(true)
.write(true)
.truncate(false)
.open(path)
.unwrap()
}
#[test]
fn far_write_fills_the_gap_in_bounded_steps_and_keeps_data() {
let dir = temp_dir("far");
let path = dir.join("f.bin");
let file = open(&path);
let front = GrowFront::new(false);
let cancel = AtomicBool::new(false);
front.write_all_at(&file, 0, b"head", &cancel).unwrap();
let far = 3 * FILL_STEP as u64 + 123;
front.write_all_at(&file, far, b"tail", &cancel).unwrap();
front.write_all_at(&file, 100, b"mid", &cancel).unwrap();
let bytes = fs::read(&path).unwrap();
assert_eq!(bytes.len() as u64, far + 4);
assert_eq!(&bytes[0..4], b"head");
assert_eq!(&bytes[100..103], b"mid");
assert_eq!(&bytes[far as usize..], b"tail");
assert!(bytes[103..far as usize].iter().all(|b| *b == 0));
fs::remove_file(&path).unwrap();
fs::remove_dir(&dir).unwrap();
}
#[test]
fn cancel_stops_a_gap_fill_between_steps() {
let dir = temp_dir("cancel");
let path = dir.join("f.bin");
let file = open(&path);
let front = GrowFront::new(false);
let cancel = AtomicBool::new(true);
let err = front
.write_all_at(&file, 8 * FILL_STEP as u64, b"x", &cancel)
.unwrap_err();
assert_eq!(err.kind(), io::ErrorKind::Interrupted);
assert_eq!(fs::metadata(&path).unwrap().len(), 0);
cancel.store(false, Ordering::Relaxed);
front.write_all_at(&file, 10, b"ok", &cancel).unwrap();
assert_eq!(&fs::read(&path).unwrap()[10..], b"ok");
fs::remove_file(&path).unwrap();
fs::remove_dir(&dir).unwrap();
}
#[test]
fn concurrent_writers_never_lose_data_to_the_fill() {
let dir = temp_dir("race");
let path = dir.join("f.bin");
let file = Arc::new(open(&path));
let front = Arc::new(GrowFront::new(false));
let piece = 64 * 1024u64;
let count = 256u64;
let mut order: Vec<u64> = (0..count).collect();
order.reverse();
let lanes: Vec<Vec<u64>> = (0..4)
.map(|lane| order.iter().copied().filter(|i| i % 4 == lane).collect())
.collect();
let handles: Vec<_> = lanes
.into_iter()
.map(|lane| {
let file = Arc::clone(&file);
let front = Arc::clone(&front);
std::thread::spawn(move || {
let cancel = AtomicBool::new(false);
for i in lane {
let data = vec![(i % 251) as u8 + 1; piece as usize];
front.write_all_at(&file, i * piece, &data, &cancel).unwrap();
}
})
})
.collect();
for handle in handles {
handle.join().unwrap();
}
let bytes = fs::read(&path).unwrap();
assert_eq!(bytes.len() as u64, piece * count);
for i in 0..count {
let start = (i * piece) as usize;
assert!(bytes[start..start + piece as usize]
.iter()
.all(|b| *b == (i % 251) as u8 + 1));
}
fs::remove_file(&path).unwrap();
fs::remove_dir(&dir).unwrap();
}
#[test]
fn extend_to_grows_in_steps_and_never_shrinks() {
let dir = temp_dir("extend");
let path = dir.join("f.bin");
let file = open(&path);
let front = GrowFront::new(false);
let cancel = AtomicBool::new(false);
front.write_all_at(&file, 0, b"data", &cancel).unwrap();
let len = 2 * FILL_STEP as u64 + 7;
front.extend_to(&file, len, &cancel).unwrap();
front.extend_to(&file, 2, &cancel).unwrap();
let bytes = fs::read(&path).unwrap();
assert_eq!(bytes.len() as u64, len);
assert_eq!(&bytes[0..4], b"data");
assert!(bytes[4..].iter().all(|b| *b == 0));
fs::remove_file(&path).unwrap();
fs::remove_dir(&dir).unwrap();
}
#[test]
fn hole_capable_storage_writes_directly() {
let dir = temp_dir("holes");
let path = dir.join("f.bin");
let file = open(&path);
let front = GrowFront::new(true);
let cancel = AtomicBool::new(true);
front
.write_all_at(&file, 8 * FILL_STEP as u64, b"x", &cancel)
.unwrap();
assert_eq!(fs::metadata(&path).unwrap().len(), 8 * FILL_STEP as u64 + 1);
fs::remove_file(&path).unwrap();
fs::remove_dir(&dir).unwrap();
}
#[test]
fn probe_leaves_nothing_behind() {
let dir = temp_dir("probe");
let other = dir.join(format!("{PROBE_PREFIX}game-file"));
fs::write(&other, b"kept").unwrap();
let _ = holes_supported(&dir);
assert_eq!(fs::read_dir(&dir).unwrap().count(), 1);
assert_eq!(fs::read(&other).unwrap(), b"kept");
fs::remove_file(&other).unwrap();
fs::remove_dir(&dir).unwrap();
}
}
-1
View File
@@ -9,7 +9,6 @@ pub mod epic;
pub mod fetch_core;
pub mod fetch_tuning;
pub mod gog;
pub mod grow_write;
pub mod md5_small;
pub mod priority;
pub mod steam;
@@ -9,7 +9,6 @@
//! read back and checked before anything is fetched.
use crate::fetch_core::{run_fetch, FetchItem, FetchOptions, FetchSink, SinkError};
use crate::grow_write::{holes_supported, GrowFront};
use crate::steam::cdn;
use crate::steam::content_manifest::{ChunkData, ContentManifest};
use crate::steam::depot_chunk::{process_depot_chunk, steam_adler_hash};
@@ -111,7 +110,6 @@ struct FileSlot {
size: u64,
path: PathBuf,
mode: u32,
front: GrowFront,
}
struct DepotFiles {
@@ -157,23 +155,17 @@ impl DepotFiles {
}
}
fn write(
&self,
file_idx: usize,
offset: u64,
data: &[u8],
cancel: &AtomicBool,
) -> Result<(), String> {
fn write(&self, file_idx: usize, offset: u64, data: &[u8]) -> Result<(), String> {
let file = self.acquire(file_idx)?;
let slot = &self.slots[file_idx];
slot.front.write_all_at(&file, offset, data, cancel).map_err(|err| {
pwrite_all_at(&file, offset, data).map_err(|err| {
format!(
"write '{}' at {offset}: {err}",
self.slots[file_idx].path.display()
)
})?;
let slot = &self.slots[file_idx];
if slot.remaining.fetch_sub(1, Ordering::AcqRel) == 1 {
finalize(&file, slot, cancel)?;
finalize(&file, slot)?;
drop(file);
self.release(file_idx);
} else if self.open_count.load(Ordering::Relaxed) > MAX_OPEN_FILES {
@@ -184,7 +176,7 @@ impl DepotFiles {
}
/// Files with nothing left to fetch (zero chunks, or every chunk already correct on disk).
fn finalize_untouched(&self, idx: usize, cancel: &AtomicBool) -> Result<(), String> {
fn finalize_untouched(&self, idx: usize) -> Result<(), String> {
let slot = &self.slots[idx];
make_parent_dirs(&self.root, &slot.path)?;
check_file_target(&self.root, &slot.path)?;
@@ -196,11 +188,6 @@ impl DepotFiles {
.map_err(|err| format!("open '{}': {err}", slot.path.display()))?;
set_file_mode(&file, &slot.path, slot.mode)?;
let current = file.metadata().map(|m| m.len()).unwrap_or(u64::MAX);
if current < slot.size {
slot.front
.extend_to(&file, slot.size, cancel)
.map_err(|err| format!("extend '{}': {err}", slot.path.display()))?;
}
if current != slot.size {
file.set_len(slot.size)
.map_err(|err| format!("set_len '{}': {err}", slot.path.display()))?;
@@ -209,10 +196,7 @@ impl DepotFiles {
}
}
fn finalize(file: &File, slot: &FileSlot, cancel: &AtomicBool) -> Result<(), String> {
slot.front
.extend_to(file, slot.size, cancel)
.map_err(|err| format!("extend '{}': {err}", slot.path.display()))?;
fn finalize(file: &File, slot: &FileSlot) -> Result<(), String> {
file.set_len(slot.size)
.map_err(|err| format!("set_len '{}': {err}", slot.path.display()))?;
file.sync_all()
@@ -223,7 +207,6 @@ struct ChunkSink<'a> {
chunks: &'a [UniqueChunk],
files: &'a DepotFiles,
depot_key: &'a [u8],
cancel: &'a AtomicBool,
}
impl FetchSink for ChunkSink<'_> {
@@ -242,12 +225,7 @@ impl FetchSink for ChunkSink<'_> {
let mut credited = 0u64;
for target in &chunk.targets {
self.files
.write(
target.file_idx as usize,
target.offset,
&processed.data,
self.cancel,
)
.write(target.file_idx as usize, target.offset, &processed.data)
.map_err(SinkError::Fatal)?;
credited += processed.data.len() as u64;
}
@@ -298,7 +276,6 @@ fn prepare(
}
};
let holes = holes_supported(&root);
let mut slots = Vec::with_capacity(manifest.files.len());
let mut existing = Vec::with_capacity(manifest.files.len());
for file in &manifest.files {
@@ -320,7 +297,6 @@ fn prepare(
} else {
0o644
},
front: GrowFront::new(holes),
});
}
@@ -378,10 +354,7 @@ fn prepare(
continue;
}
let mut remaining = 0usize;
let mut by_offset: Vec<usize> = (0..file.chunks.len()).collect();
by_offset.sort_by_key(|&idx| file.chunks[idx].offset);
for chunk_idx in by_offset {
let chunk = &file.chunks[chunk_idx];
for (chunk_idx, chunk) in file.chunks.iter().enumerate() {
if verified[file_idx].get(chunk_idx).copied().unwrap_or(false) {
bytes_verified += chunk.cb_original as u64;
continue;
@@ -420,13 +393,7 @@ fn prepare(
if is_regular(file.flags, &file.linktarget)
&& files.slots[idx].remaining.load(Ordering::Relaxed) == 0
{
if let Err(err) = files.finalize_untouched(idx, cancel) {
if cancel.load(Ordering::Relaxed) {
return Err(DepotWriteOutcome {
cancelled: true,
..Default::default()
});
}
if let Err(err) = files.finalize_untouched(idx) {
return Err(DepotWriteOutcome::fail(err));
}
}
@@ -482,7 +449,6 @@ pub fn write_depot(
chunks: &chunks,
files: &files,
depot_key: request.depot_key,
cancel,
};
let depot_id = manifest.metadata.depot_id;
let done_before = AtomicU64::new(bytes_verified);
@@ -710,6 +676,12 @@ fn set_file_mode(_file: &File, _path: &Path, _mode: u32) -> Result<(), String> {
Ok(())
}
#[cfg(unix)]
fn pwrite_all_at(file: &File, offset: u64, data: &[u8]) -> std::io::Result<()> {
use std::os::unix::fs::FileExt;
file.write_all_at(data, offset)
}
#[cfg(unix)]
fn pread_exact_at(file: &File, offset: u64, buf: &mut [u8]) -> std::io::Result<()> {
use std::os::unix::fs::FileExt;
@@ -794,7 +766,6 @@ mod tests {
size: 10,
path: path.clone(),
mode: 0o644,
front: GrowFront::new(true),
}];
let root = fs::canonicalize(&dir).unwrap();
let flags = verify_existing(&manifest, &slots, &[10], &root, 2, &AtomicBool::new(false));
@@ -837,44 +808,6 @@ mod tests {
}
}
#[test]
fn queues_each_files_chunks_in_offset_order() {
let dir = std::env::temp_dir().join(format!(
"droiddeck_steam_order_{}",
std::time::SystemTime::now()
.duration_since(std::time::UNIX_EPOCH)
.unwrap()
.as_nanos()
));
let key = [5u8; 32];
let manifest = ContentManifest {
files: vec![FileMapping {
filename: "big.pak".into(),
size: 15,
chunks: vec![chunk(b"three", 10), chunk(b"first", 0), chunk(b"other", 5)],
..Default::default()
}],
..Default::default()
};
let request = DepotWriteRequest {
manifest: &manifest,
depot_key: &key,
servers: &[],
target_dir: &dir,
ca_bundle_path: "",
max_workers: 1,
process_workers: 1,
};
let prepared = prepare(&request, &AtomicBool::new(false)).unwrap();
let offsets: Vec<u64> = prepared
.chunks
.iter()
.map(|c| c.targets[0].offset)
.collect();
assert_eq!(offsets, vec![0, 5, 10]);
let _ = fs::remove_dir_all(&dir);
}
#[test]
fn writes_in_place_dedupes_chunks_and_resumes_from_disk() {
let dir = std::env::temp_dir().join(format!(
@@ -934,7 +867,6 @@ mod tests {
chunks: &prepared.chunks,
files: &prepared.files,
depot_key: &key,
cancel: &cancel,
};
let item = |id: u64| FetchItem {
id,
@@ -954,7 +886,6 @@ mod tests {
chunks: &wrong,
files: &prepared.files,
depot_key: &key,
cancel: &cancel,
};
assert!(matches!(
wrong_sink.process(&item(0), encrypted_chunk(&key, b"HELLO")),
@@ -0,0 +1,75 @@
package com.droiddeck.launcher.companion
import org.json.JSONObject
import org.junit.Assert.assertEquals
import org.junit.Assert.assertNull
import org.junit.Assert.assertTrue
import org.junit.Test
import org.junit.runner.RunWith
import org.robolectric.RobolectricTestRunner
import org.robolectric.annotation.Config
@RunWith(RobolectricTestRunner::class)
@Config(sdk = [33])
class RpgCompanionTest {
@Test
fun pipBoyStatsFavoritesAndRadio() {
val data = """{"type":"data","id":"droiddeck","data":{
"player.stats":{"level":23,"hp":245,"hpMax":310,"ap":88,"apMax":105,"rads":65,"caps":1834,"weight":187.4,"weightMax":260},
"player.inventory":[
{"id":"0x101","name":"Old Laser Rifle","type":"weapon","count":1,"equipped":true},
{"id":"0x102","name":"Service Pistol","type":"weapon","count":1,"equipped":false,"fav":1},
{"id":"0x236","name":"Med Kit","type":"aid","count":7,"equipped":false,"fav":0}],
"radio":{"enabled":true}}}"""
val s = RpgCompanion.reduce(RpgCompanion.FALLOUT_4, RpgCompanion.State(), data)
assertEquals(23, s.level)
assertEquals(listOf("hp", "ap"), s.bars.map { it.key })
assertEquals(310f, s.bars[0].max)
assertEquals(listOf("Med Kit", "Service Pistol"), s.slots.map { it.label })
assertEquals("×7", s.slots[0].detail)
assertEquals(true, s.radio)
assertEquals("1834", s.facts.toMap()["caps"])
val toggle = JSONObject(RpgCompanion.trigger(RpgCompanion.FALLOUT_4, s.slots[1], 3))
assertEquals("toggle", toggle.getString("command"))
assertEquals("0x102", toggle.getJSONObject("params").getString("id"))
assertEquals(false, JSONObject(RpgCompanion.radio(false, 4)).getJSONObject("params").getBoolean("enable"))
}
@Test
fun skyrimVitalsAndHotkeys() {
val data = """{"type":"data","id":"droiddeck","ts":1,"fields":{
"health":320.5,"health.max":400,"magicka":180,"magicka.max":200,"stamina":99.25,"stamina.max":150,
"level":31,"weight":210.2,"carry":300,
"hotkeys":[{"slot":1,"bound":true,"kind":"spell","name":"Flames","school":"Destruction"},{"slot":2,"bound":false},
{"slot":3,"bound":true,"kind":"item","name":"Iron Sword","categoryType":"Weapon"}]}}"""
val s = RpgCompanion.reduce(RpgCompanion.SKYRIM_SE, RpgCompanion.State(), data)
assertEquals(listOf("health", "magicka", "stamina"), s.bars.map { it.key })
assertEquals(31, s.level)
assertEquals(listOf("1", "3"), s.slots.map { it.key })
assertEquals("Destruction", s.slots[0].detail)
assertEquals("210 / 300", s.facts.toMap()["weight"])
assertNull(s.radio)
val partial = RpgCompanion.reduce(RpgCompanion.SKYRIM_SE, s, """{"type":"data","id":"droiddeck","fields":{"level":32}}""")
assertEquals(32, partial.level)
assertEquals(3, partial.bars.size)
val hotkey = JSONObject(RpgCompanion.trigger(RpgCompanion.SKYRIM_SE, s.slots[1], 9))
assertEquals("hotkey_trigger", hotkey.getString("command"))
assertEquals(3, hotkey.getInt("slot"))
}
@Test
fun subscriptionsAndForeignMessages() {
val skyrim = JSONObject(RpgCompanion.subscribe(RpgCompanion.SKYRIM_SE))
assertEquals("Hotkey::Items", skyrim.getJSONObject("fields").getString("hotkeys"))
assertTrue(skyrim.getJSONObject("settings").getBoolean("sendOnChange"))
assertEquals("player.stats", JSONObject(RpgCompanion.subscribe(RpgCompanion.FALLOUT_4)).getJSONArray("fields").getString(0))
val s = RpgCompanion.State(level = 5)
assertEquals(s, RpgCompanion.reduce(RpgCompanion.FALLOUT_4, s, """{"type":"hello","server":"ThorPipBoy"}"""))
assertEquals(s, RpgCompanion.reduce(RpgCompanion.FALLOUT_4, s, """{"type":"data","id":"other","data":{}}"""))
assertEquals(8767, RpgCompanion.port(RpgCompanion.FALLOUT_4))
assertEquals(8765, RpgCompanion.port(RpgCompanion.SKYRIM_SE))
}
}
@@ -0,0 +1,114 @@
package com.droiddeck.launcher.companion
import com.droiddeck.launcher.session.LoopbackWebSocket
import org.junit.Assert.assertEquals
import org.junit.Assert.assertFalse
import org.junit.Assert.assertNull
import org.junit.Assert.assertTrue
import org.junit.Test
import org.junit.runner.RunWith
import org.robolectric.RobolectricTestRunner
import org.robolectric.annotation.Config
import java.io.DataInputStream
import java.net.ServerSocket
import java.security.MessageDigest
import java.util.Base64
import kotlin.concurrent.thread
@RunWith(RobolectricTestRunner::class)
@Config(sdk = [33])
class StardewCompanionTest {
@Test
fun reducesTheModsMessages() {
var s = StardewCompanion.State()
assertFalse(s.inGame)
s = StardewCompanion.reduce(s, """{"type":"game_info","gameId":"stardew","saveName":"Sunny Farm"}""")
s = StardewCompanion.reduce(s, """{"type":"sdv_day","season":"spring","day":5,"year":1,"weekday":"Fri","timeOfDay":1330,
"weatherToday":"sunny","weatherTomorrow":"rain","gold":12500,"energy":200,"maxEnergy":270,"health":90,"maxHealth":100,"location":"Farm"}""")
s = StardewCompanion.reduce(s, """{"type":"sdv_inventory","selected":2,"capacity":36,"items":[
{"slot":0,"id":"(T)Axe","name":"Axe","count":1,"quality":0},
{"slot":2,"id":"(O)24","name":"Parsnip","count":15,"quality":1},
{"slot":3,"id":"","name":"","count":0},
{"slot":20,"id":"(O)388","name":"Wood","count":99}]}""")
s = StardewCompanion.reduce(s, """{"type":"sdv_quests","quests":[{"index":0,"title":"Introductions","objective":"Meet 28 people","daysLeft":-1,"complete":"0"}]}""")
s = StardewCompanion.reduce(s, """{"type":"sdv_villagers","villagers":[
{"name":"Abigail","npc":"Abigail","birthdayIn":3},{"name":"Haley","npc":"Haley","birthdayIn":0},{"name":"Sam","npc":"Sam","birthdayIn":20}]}""")
s = StardewCompanion.reduce(s, """{"type":"sdv_sprite","id":"(O)24","png":"iVBORw0KGgo="}""")
s = StardewCompanion.reduce(s, "not json")
s = StardewCompanion.reduce(s, """{"type":"sdv_mines","deepest":40}""")
assertTrue(s.inGame)
assertEquals("Sunny Farm", s.save)
assertEquals(1330, s.day!!.time)
assertEquals(12500L, s.day!!.gold)
assertEquals(2, s.selected)
assertEquals(12, s.hotbar.size)
assertEquals("Axe", s.hotbar[0]!!.name)
assertNull(s.hotbar[1])
assertEquals(15, s.hotbar[2]!!.count)
assertNull(s.hotbar[3])
assertEquals(listOf("Haley", "Abigail"), s.birthdays.map { it.name })
assertFalse(s.quests.single().complete)
assertEquals("iVBORw0KGgo=", s.sprites["(O)24"])
assertFalse(StardewCompanion.reduce(s, """{"type":"game_info","saveName":""}""").inGame)
}
@Test
fun commandsAndClock() {
assertEquals("""{"type":"select_slot","slot":4}""", StardewCompanion.selectSlot(4))
assertEquals("6:10 am", StardewCompanion.clock(610, true))
assertEquals("12:00 pm", StardewCompanion.clock(1200, true))
assertEquals("1:30 am", StardewCompanion.clock(2530, true))
assertEquals("18:40", StardewCompanion.clock(1840, false))
}
@Test
fun talksToALoopbackWebSocketServer() {
val server = ServerSocket(0)
var received: String? = null
val worker = thread {
server.accept().use { client ->
val input = DataInputStream(client.getInputStream())
val headers = generateSequence { readLine(input) }.takeWhile { it.isNotEmpty() }.toList()
val key = headers.first { it.startsWith("Sec-WebSocket-Key:") }.substringAfter(':').trim()
val accept = Base64.getEncoder().encodeToString(
MessageDigest.getInstance("SHA-1").digest((key + "258EAFA5-E914-47DA-95CA-C5AB0DC85B11").toByteArray()))
val out = client.getOutputStream()
out.write("HTTP/1.1 101 Switching Protocols\r\nUpgrade: websocket\r\nConnection: Upgrade\r\nSec-WebSocket-Accept: $accept\r\n\r\n".toByteArray())
val big = "x".repeat(300)
for (text in listOf("""{"type":"game_info","saveName":"A"}""", big)) {
val bytes = text.toByteArray()
out.write(0x81)
if (bytes.size < 126) out.write(bytes.size) else { out.write(126); out.write(bytes.size shr 8); out.write(bytes.size and 0xFF) }
out.write(bytes)
}
out.flush()
val b0 = input.read()
val len = input.read() and 0x7F
val mask = ByteArray(4).also(input::readFully)
val payload = ByteArray(len).also(input::readFully)
for (i in payload.indices) payload[i] = (payload[i].toInt() xor mask[i % 4].toInt()).toByte()
if (b0 == 0x81) received = String(payload)
}
}
LoopbackWebSocket(server.localPort).use { ws ->
assertEquals("""{"type":"game_info","saveName":"A"}""", ws.receive())
assertEquals(300, ws.receive()!!.length)
ws.send(StardewCompanion.refresh())
}
worker.join(5_000)
server.close()
assertEquals("""{"type":"refresh"}""", received)
}
private fun readLine(input: DataInputStream): String? {
val sb = StringBuilder()
while (true) {
val c = input.read()
if (c < 0) return null
if (c == '\n'.code) return sb.toString().trimEnd('\r')
sb.append(c.toChar())
}
}
}
@@ -145,15 +145,4 @@ class AddedGamesCandidatesTest {
SessionPrefs.setAddedGamesDirs(app, listOf(games.path))
assertEquals("My Game [Repack]", AddedGames.scan(app).single().name)
}
@Test fun linksAndFoldersNamedLikeAnExeAreNotCandidates() {
val elsewhere = tmp.newFolder("Elsewhere")
exe(elsewhere, "Other.exe")
val game = tmp.newFolder("Linked")
exe(game, "bin/Linked.exe")
File(game, "Folder.exe").mkdirs()
java.nio.file.Files.createSymbolicLink(File(game, "other").toPath(), elsewhere.toPath())
java.nio.file.Files.createSymbolicLink(File(game, "Alias.exe").toPath(), File(elsewhere, "Other.exe").toPath())
assertEquals(listOf("bin/Linked.exe"), names(game))
}
}
@@ -1,213 +0,0 @@
package com.droiddeck.launcher.frontend
import com.droiddeck.launcher.session.SessionPhase
import com.droiddeck.launcher.session.SessionPrefs
import com.droiddeck.launcher.session.SessionState
import com.droiddeck.launcher.stores.SteamLiveShortcuts
import java.io.File
import java.util.Collections
import java.util.concurrent.CountDownLatch
import java.util.concurrent.TimeUnit
import org.junit.After
import org.junit.Assert.assertEquals
import org.junit.Assert.assertFalse
import org.junit.Assert.assertTrue
import org.junit.Rule
import org.junit.Test
import org.junit.rules.TemporaryFolder
import org.junit.runner.RunWith
import org.robolectric.RobolectricTestRunner
import org.robolectric.RuntimeEnvironment
import org.robolectric.annotation.Config
@RunWith(RobolectricTestRunner::class)
@Config(sdk = [33])
class AddedGamesSessionListingTest {
private val app get() = RuntimeEnvironment.getApplication()
@get:Rule val tmp = TemporaryFolder()
@After fun restore() {
AddedGamesPublisher.now = false
AddedGamesPublisher.live = SteamLiveShortcuts::sync
SessionState.running = false
SessionState.stopRequested = false
SessionState.sessionId = null
SessionState.phase = SessionPhase.IDLE
}
private val stale = """[{"name":"Old","exe":"/root/Games/Old/Old.exe","folder":"/root/Games/Old","dir":"/root/Games/Old","appid":2147483649,"seen":0}]"""
private fun gamesFolder(vararg names: String): File {
val games = tmp.newFolder("PC")
for (n in names) File(games, "$n/$n.exe").apply { parentFile!!.mkdirs() }.writeText("game")
SessionPrefs.setGameStorage(app, SessionPrefs.GAME_STORAGE_OFF, "")
SessionPrefs.setAddedGamesDirs(app, listOf(games.path))
return games
}
private fun session(phase: SessionPhase) {
SessionState.sessionId = "session-test"
SessionState.stopRequested = false
SessionState.phase = phase
SessionState.running = true
}
private fun until(what: String, check: () -> Boolean) {
val end = System.currentTimeMillis() + 30_000
while (!check()) {
assertTrue(what, System.currentTimeMillis() < end)
Thread.sleep(20)
}
}
private fun scanLock(): Any =
AddedGames::class.java.getDeclaredField("scanning").apply { isAccessible = true }.get(null)!!
private fun refreshes() = Thread.getAllStackTraces().keys.filter { it.name == "added-games-refresh" }
@Test fun aSessionStartsFromTheLastListingWhileTheLibraryScanHoldsTheLock() {
gamesFolder("Alpha")
val listing = AddedGames.listingFile(app).apply { parentFile!!.mkdirs(); writeText(stale) }
val done = CountDownLatch(1)
var returned: File? = null
var seen = ""
synchronized(scanLock()) {
Thread {
returned = AddedGamesPublisher.sessionListing(app)
seen = listing.readText()
done.countDown()
}.start()
assertTrue("the session start waited for the library scan", done.await(5, TimeUnit.SECONDS))
}
assertEquals(listing.path, returned!!.path)
assertEquals(stale, seen)
refreshes().forEach { it.join(30_000) }
assertTrue(refreshes().isEmpty())
val fresh = listing.readText()
assertTrue(fresh.contains("\"Alpha\""))
assertFalse(fresh.contains("\"Old\""))
assertFalse(File(listing.parentFile, listing.name + ".part").exists())
}
@Test fun aFirstSessionScansBeforeStarting() {
gamesFolder("Alpha")
AddedGamesPublisher.now = false
val listing = AddedGames.listingFile(app)
listing.delete()
assertEquals(listing.path, AddedGamesPublisher.sessionListing(app).path)
assertTrue(listing.readText().contains("\"Alpha\""))
assertTrue(refreshes().isEmpty())
assertFalse(File(listing.parentFile, listing.name + ".part").exists())
}
@Test fun aListingThatCannotBeReplacedKeepsTheOldOne() {
val listing = AddedGames.listingFile(app).apply { parentFile?.mkdirs() }
listing.writeText("[]")
val blocked = File(listing.parentFile, listing.name + ".part").apply { mkdirs() }
gamesFolder("Alpha")
AddedGames.writeListing(app, AddedGames.scan(app))
assertEquals("[]", listing.readText())
assertFalse(blocked.exists())
}
@Test fun anUnreadableListingIsRescannedBeforeStarting() {
gamesFolder("Alpha")
AddedGamesPublisher.now = false
val listing = AddedGames.listingFile(app).apply { parentFile!!.mkdirs(); writeText("[{\"name\":") }
AddedGamesPublisher.sessionListing(app)
assertTrue(listing.readText().contains("\"Alpha\""))
assertTrue(refreshes().isEmpty())
}
@Test fun aGameRemovedWhileTheClientStartsIsNotAddedToIt() {
val games = gamesFolder("Alpha", "Beta")
val listing = AddedGames.listingFile(app).apply { parentFile!!.mkdirs(); writeText(stale) }
val delivered = Collections.synchronizedList(ArrayList<String>())
AddedGamesPublisher.live = { _, found, include -> delivered.addAll(found.filter(include).map { it.name }); true }
session(SessionPhase.STARTING_STEAM)
AddedGamesPublisher.sessionListing(app)
until("the refresh did not write the listing") { listing.readText().contains("\"Beta\"") }
SessionPrefs.setAddedGameRemoved(app, File(games, "Beta").path, true)
SessionState.phase = SessionPhase.READY
refreshes().forEach { it.join(30_000) }
assertTrue(refreshes().isEmpty())
assertEquals(listOf("Alpha"), delivered.toList())
}
@Test fun aDeliveryTheClientRefusesIsRetriedUntilItIsTaken() {
gamesFolder("Alpha")
AddedGames.listingFile(app).apply { parentFile!!.mkdirs(); writeText(stale) }
val attempts = Collections.synchronizedList(ArrayList<List<String>>())
AddedGamesPublisher.live = { _, found, include -> attempts.add(found.filter(include).map { it.name }); attempts.size > 1 }
session(SessionPhase.READY)
AddedGamesPublisher.sessionListing(app)
refreshes().forEach { it.join(30_000) }
assertTrue(refreshes().isEmpty())
assertEquals(listOf(listOf("Alpha"), listOf("Alpha")), attempts.toList())
}
@Test fun anEndedSessionStopsTheRetries() {
gamesFolder("Alpha")
AddedGames.listingFile(app).apply { parentFile!!.mkdirs(); writeText(stale) }
val attempts = Collections.synchronizedList(ArrayList<String>())
AddedGamesPublisher.live = { _, found, _ -> attempts.addAll(found.map { it.name }); SessionState.running = false; false }
session(SessionPhase.READY)
AddedGamesPublisher.sessionListing(app)
refreshes().forEach { it.join(30_000) }
assertTrue(refreshes().isEmpty())
assertEquals(listOf("Alpha"), attempts.toList())
}
@Test fun aDeliveryQueuedForAnEndedSessionIsNotSentToTheNextOne() {
gamesFolder("Alpha")
AddedGames.listingFile(app).apply { parentFile!!.mkdirs(); writeText(stale) }
val delivered = Collections.synchronizedList(ArrayList<String>())
AddedGamesPublisher.live = { _, found, include -> delivered.addAll(found.filter(include).map { it.name }); true }
session(SessionPhase.READY)
val first = CountDownLatch(1)
val firstHeld = CountDownLatch(1)
val second = CountDownLatch(1)
val secondHeld = CountDownLatch(1)
AddedGamesPublisher.later(app) { firstHeld.countDown(); first.await() }
try {
assertTrue(firstHeld.await(30, TimeUnit.SECONDS))
AddedGamesPublisher.sessionListing(app)
val refresh = refreshes().single()
until("the refresh did not wait for its scan") { refresh.state == Thread.State.WAITING }
AddedGamesPublisher.later(app) { secondHeld.countDown(); second.await() }
first.countDown()
assertTrue(secondHeld.await(30, TimeUnit.SECONDS))
until("the refresh did not queue its delivery") {
refresh.state == Thread.State.WAITING && refresh.stackTrace.any { it.methodName == "deliver" }
}
SessionState.sessionId = "session-next"
} finally {
first.countDown()
second.countDown()
}
refreshes().forEach { it.join(30_000) }
assertTrue(refreshes().isEmpty())
assertTrue(delivered.isEmpty())
}
@Test fun theRefreshWaitsForEarlierPublicationsBeforeWriting() {
gamesFolder("Alpha")
val listing = AddedGames.listingFile(app).apply { parentFile!!.mkdirs(); writeText(stale) }
val hold = CountDownLatch(1)
val holding = CountDownLatch(1)
AddedGamesPublisher.later(app) { holding.countDown(); hold.await() }
try {
assertTrue(holding.await(30, TimeUnit.SECONDS))
AddedGamesPublisher.sessionListing(app)
val refresh = refreshes().single()
until("the refresh neither finished nor waited") { refresh.state == Thread.State.WAITING || !refresh.isAlive }
assertTrue("the refresh wrote while an earlier publication was running", refresh.isAlive)
assertEquals(stale, listing.readText())
} finally {
hold.countDown()
}
refreshes().forEach { it.join(30_000) }
assertTrue(refreshes().isEmpty())
assertTrue(listing.readText().contains("\"Alpha\""))
}
}
@@ -201,25 +201,6 @@ class DirectTouchHoldTest {
)
}
@Test fun aDragLiftsAtOnce() {
touch(MotionEvent.ACTION_DOWN)
touch(MotionEvent.ACTION_MOVE, 80f)
advance(80)
touches.clear()
touch(MotionEvent.ACTION_UP, 80f)
assertEquals(listOf("up 0 at 80.0,30.0"), touches)
}
@Test fun aTapStaysPressedLongEnoughToBeSeen() {
touch(MotionEvent.ACTION_DOWN)
advance(10)
touch(MotionEvent.ACTION_UP)
advance(49)
assertEquals(listOf("down 0 at 40.0,30.0"), touches)
advance(1)
assertEquals(listOf("down 0 at 40.0,30.0", "up 0 at 40.0,30.0"), touches)
}
private fun advance(ms: Long) = shadowOf(Looper.getMainLooper()).idleFor(Duration.ofMillis(ms))
private fun touch(action: Int, x: Float = 40f): Boolean {
val event = MotionEvent.obtain(0, 0, action, x, 30f, 0)
@@ -36,43 +36,7 @@ class GameEnvironmentStoreTest {
context.getSharedPreferences("session", Context.MODE_PRIVATE).edit()
.remove("logs")
.remove("gameDebugLogsEnabled")
.remove("gameCpus")
.commit()
listOf("game-environment.json.new", "game-cores.new").forEach { File(guest.parentFile, it).delete() }
}
@Test fun gameCoresChangedInSettingsReachTheGuestAtOnce() {
val live = File(LinuxRuntime.rootDir(context), "root/.config/droiddeck/game-cores")
val all = com.droiddeck.launcher.core.CpuCores.all
SessionPrefs.setGameCpus(context, all.last().toString())
assertEquals("${all.last()}\n", live.readText())
SessionPrefs.setGameCpus(context, com.droiddeck.launcher.core.CpuCores.format(all.toSet()))
assertEquals("\n", live.readText())
}
@Config(sdk = [34])
@Test fun gameCoresStillReachTheGuestWhenTheRestOfTheEnvironmentCannotBeWritten() {
val dir = File(LinuxRuntime.rootDir(context), "root/.config/droiddeck")
val last = com.droiddeck.launcher.core.CpuCores.all.last()
assertTrue(File(dir, "game-environment.json.new").mkdirs())
context.getSharedPreferences("session", Context.MODE_PRIVATE).edit().putString("gameCpus", last.toString()).commit()
assertTrue(runCatching { GameEnvironmentStore.publish(context) }.isFailure)
assertEquals("$last\n", File(dir, "game-cores").readText())
}
@Test fun gameCoresThatCannotBeWrittenLeaveNoOlderValueForTheGuest() {
val dir = File(LinuxRuntime.rootDir(context), "root/.config/droiddeck")
val all = com.droiddeck.launcher.core.CpuCores.all
SessionPrefs.setGameCpus(context, all.last().toString())
assertTrue(File(dir, "game-cores.new").mkdirs())
SessionPrefs.setGameCpus(context, all.first().toString())
assertFalse(File(dir, "game-cores").exists())
}
@Test fun gameDebugLogsAreOffByDefault() {
@@ -1,27 +0,0 @@
package com.droiddeck.launcher.stores
import org.junit.Assert.assertFalse
import org.junit.Assert.assertTrue
import org.junit.Test
import org.junit.runner.RunWith
import org.robolectric.RobolectricTestRunner
import org.robolectric.annotation.Config
@RunWith(RobolectricTestRunner::class)
@Config(sdk = [33])
class SteamLiveShortcutsSyncTest {
@Test fun everyGameKnownOrAddedIsDelivered() {
assertTrue(SteamLiveShortcuts.synced("""{"added":2,"missed":0}"""))
assertTrue(SteamLiveShortcuts.synced("""{"added":0,"missed":0}"""))
}
@Test fun aGameTheClientRefusedIsNotDelivered() {
assertFalse(SteamLiveShortcuts.synced("""{"added":1,"missed":1}"""))
assertFalse(SteamLiveShortcuts.synced("""{"added":0,"missed":3}"""))
}
@Test fun noAnswerIsNotDelivered() {
assertFalse(SteamLiveShortcuts.synced(null))
assertFalse(SteamLiveShortcuts.synced("1"))
}
}
@@ -188,34 +188,6 @@ class DownloadQueueRemovalTest {
assertFalse(folder.exists())
}
@Test fun uninstallStopsARunningDownloadThenRemovesTheGame() {
val running = CountDownLatch(1)
val cancels = AtomicInteger()
val entry = DownloadEntry(Store.GOG, "uninstall-while-running", "Running")
DownloadQueue.enqueue(app, entry) {
object : DownloadQueue.DownloadJob {
override fun run(handle: DownloadQueue.JobHandle): String? {
running.countDown()
val until = System.nanoTime() + TimeUnit.SECONDS.toNanos(10)
while (!handle.isCancelled && System.nanoTime() < until) Thread.sleep(10)
return null
}
override fun cancel(deleteFiles: Boolean) { cancels.incrementAndGet() }
}
}
assertTrue(running.await(5, TimeUnit.SECONDS))
val folder = File(app.filesDir, "uninstall-while-running").apply { mkdirs() }
File(folder, "game.bin").writeText("x")
val game = InstalledStoreGame(StoreGameSidecar(Store.GOG, "uninstall-while-running", "Running", exe = "game.bin"), folder)
assertEquals(entry.key, game.key)
val done = CountDownLatch(1)
StoresState.uninstall(app, game) { done.countDown() }
assertTrue(idleUntil { done.count == 0L })
assertEquals(1, cancels.get())
assertTrue(DownloadQueue.entry(entry.key)?.state.let { it == null || it == DownloadState.CANCELLED })
assertFalse(folder.exists())
}
private fun blockDiscards(): CountDownLatch {
val release = CountDownLatch(1)
StoreInstalls.beforeDiscard = { release.await(5, TimeUnit.SECONDS) }
@@ -1,51 +0,0 @@
package com.droiddeck.launcher.ui
import android.os.Environment
import android.provider.Settings
import androidx.compose.ui.test.onNodeWithText
import androidx.compose.ui.test.performClick
import com.droiddeck.launcher.R
import org.junit.Assert.assertEquals
import org.junit.Rule
import org.junit.Test
import org.junit.runner.RunWith
import org.robolectric.RobolectricTestRunner
import org.robolectric.RuntimeEnvironment
import org.robolectric.Shadows.shadowOf
import org.robolectric.annotation.Config
import org.robolectric.shadows.ShadowEnvironment
import java.io.File
@RunWith(RobolectricTestRunner::class)
@Config(sdk = [34], qualifiers = "w1200dp-h752dp-land", application = android.app.Application::class)
class ExePickerAccessTest {
@get:Rule val compose = createRobolectricComposeRule()
private val ctx get() = RuntimeEnvironment.getApplication()
private val allowRow get() = ctx.getString(R.string.fm_drive_access_title, ctx.getString(R.string.games_internal))
private fun gameFolder(): File =
File(Environment.getExternalStorageDirectory(), "Rom/Game").apply {
mkdirs()
File(this, "game.exe").writeText("x")
}
private fun showPicker(start: File) {
compose.setContent { ExePickerDialog("Add", start = start, onPick = {}, onDismiss = {}) }
compose.waitForIdle()
}
@Test fun withoutAllFilesAccessThePickerOffersToOpenTheSetting() {
ShadowEnvironment.setIsExternalStorageManager(false)
showPicker(gameFolder())
compose.onNodeWithText(allowRow).performClick()
compose.waitForIdle()
assertEquals(Settings.ACTION_MANAGE_APP_ALL_FILES_ACCESS_PERMISSION, shadowOf(ctx).nextStartedActivity?.action)
}
@Test fun withAllFilesAccessThePickerListsTheExeWithoutTheAccessRow() {
ShadowEnvironment.setIsExternalStorageManager(true)
showPicker(gameFolder())
compose.onNodeWithText("game.exe").assertExists()
compose.onNodeWithText(allowRow).assertDoesNotExist()
}
}
@@ -1,19 +0,0 @@
package com.droiddeck.launcher.ui
import org.junit.Assert.assertEquals
import org.junit.Test
class IdleFramesTest {
@Test
fun idleLoopsDrawThirtyFramesASecondAndShareEachOne() {
val start = 5_000_000_000L
val frame = 8_333_333L
val drawn = (0 until 120).count { IdleFrames.due(start + it * frame) }
assertEquals(30, drawn)
val later = start + 1_000_000_000L
assertEquals(listOf(true, true, true), List(3) { IdleFrames.due(later) })
assertEquals(listOf(false, false), List(2) { IdleFrames.due(later + frame) })
assertEquals(listOf(true, true), List(2) { IdleFrames.due(later + 4 * frame) })
}
}
@@ -0,0 +1,137 @@
# Bottom screen: companion API for PC games
Part of the [bottom screen research](bottom-screen.md). Researched 2026-11-26 against `main` at `d788afc12`. Phase 1 has started (Stardew, Skyrim and Fallout 4 adapters); see the status in the overview.
Let games and mods running in the Linux and Proton session drive pages on DroidDeck's bottom screen: live state (health, money, map position, inventory, quests) and touch commands back into the game.
## Use cases
- **RPGs**: a Pip-Boy for Fallout 4, inventory and quests for Skyrim and Fallout: New Vegas, equipment swaps by touch.
- **Sims and management**: Stardew Valley's day, bag, bundles and calendar; RimWorld colonists and alerts; Project Zomboid's status.
- **Open world**: GTA's radio, weapons, wanted level and GPS-to-blip.
- **Racing and flight**: the telemetry dashboards DroidDeck already has.
- **Speedrunning**: LiveSplit splits for any game with an auto-splitter.
## Companions people already use
Several Thor companions already run against PC games in Wine, and two document DroidDeck as a supported launcher. Each is a separate Android app paired with a game-side mod that serves state on loopback.
| Companion | Game-side piece | Transport |
| --- | --- | --- |
| [Thor Pip-Boy](https://github.com/harmssi/thor-pipboy) (Fallout 4, **targets DroidDeck**) | F4SE plugin | WebSocket on `127.0.0.1:8767`, protocol copied from SkyrimWebSocket; commands `toggle`, `equip`, `use`, `radio`; raw access to the game's Pip-Boy data |
| [Grand Theft Companion](https://github.com/BrianJr03/GrandTheftCompanion) (GTA IV and V, **documents DroidDeck setup**) | `.asi` via Ultimate ASI Loader (IV) or ScriptHookV (V); needs `WINEDLLOVERRIDES=dinput8=n,b` in Steam launch options | JSON on `127.0.0.1:47801` at 20 Hz with a hello frame; radio, weapon, GPS and cheat commands. Its map page is a crop of the minimap |
| [AYN Thor dual-screen mods](https://github.com/JoeCorrell/AYN-Thor-Dualscreen-Mods) (Stardew Valley, for WEMU) | SMAPI mod | Hand-written RFC 6455 WebSocket on `127.0.0.1:7786` (".NET's WebSocket server wraps Windows components Wine does not implement"). No auth. Replays the latest message of each kind on connect, computes nothing without a client, hides the game HUD while one is attached. Sprites sent once as base64 PNG with nine-patch insets. Commands: `select_slot`, `move_item`, `eat_slot`, `sort_bag`, `shift_toolbar`, `craft_recipe` and others. Optional UDP beacon on 7787. The [Barry client](https://github.com/project-barry/stardew-dual-screen/blob/main/docs/protocol.md) documents the schema and ships a mock server |
| [SkyrimWebSocket](https://github.com/andreyvelsk/SkyrimWebSocket) + SkyrimWebMonitor | SKSE plugin | WebSocket on `127.0.0.1:8765`. Client-driven `subscribe` with frequency, send-on-change and aliased fields; `query`, `heartbeat`, `command` → `commandResult` ([protocol](https://github.com/andreyvelsk/SkyrimWebSocket/blob/main/PROTOCOL.md)). Client is a web app |
| [SkyrimSE-DualScreen](https://github.com/Plus-Cloud/SkyrimSE-DualScreen) | `SkyrimAYN.dll` | A 384 KiB memory-mapped file with a seqlock header ([layout](https://github.com/Plus-Cloud/SkyrimSE-DualScreen/blob/main/native/shared-memory.md)). Only works with its own bundled Wine |
| FNVDS (Fallout: New Vegas) | xNVSE plugin | TCP on `127.0.0.1:47888` |
| FFXII Companion | LUA Script Loader script reading memory, gated on the game build | JSON files in shared storage; commands as request files |
| [ZomboidDS](https://github.com/Space001000/ZomboidDS) (Project Zomboid on a Java port) | Lua and Java mod | WebSocket `ws://127.0.0.1:7786/ws` (**the same port as the Stardew mod**), envelope `{v,type,seq,data}`, hello first, full-state topics replayed on connect, `command_result`, `capabilities[]`, icons over HTTP ([protocol](https://github.com/Space001000/ZomboidDS/blob/main/protocol/PROTOCOL.md)) |
Lessons:
- Every project invents its own port and schema; two already collide on 7786.
- Each needs its own Android app on the bottom screen. Thor Pip-Boy warns that bringing it to the front "lowers DroidDeck's priority and could get the game killed" while Fallout 4 is loading. Pages drawn inside DroidDeck's own bottom-screen Presentation avoid that.
- The good protocols share a shape: hello with capabilities, complete state per topic replayed on connect, commands with ids and results, assets sent once and cached.
- Mods should do no work while nobody is watching (the Stardew mod and SkyrimWebSocket both do this).
## Game-side APIs a companion could consume
| Source | Protocol | Works in Proton on ARM? |
| --- | --- | --- |
| SKSE, F4SE, xNVSE plugins | Any socket from a Windows DLL | Yes, proven by the companions above |
| ScriptHookV / ASI plugins | Any socket | Yes, proven |
| [RIMAPI](https://github.com/IlyaChichkov/RIMAPI) (RimWorld) | REST and SSE on `localhost:8765`, 120+ endpoints, extensible by other mods | Likely (Unity, Mono) |
| [Hollow Knight tracker](https://github.com/kingkiller39/HollowKnightRandomizerTracker2.8) | WebSocket on `localhost:11420` | Likely |
| [Ficsit Remote Monitoring](https://docs.ficsit.app/ficsitremotemonitoring/latest/webserver.html) (Satisfactory) | HTTP and WebSocket on 8080 | The game is heavy for ARM |
| [Valheim WebMap](https://github.com/kylepaulsen/ValheimWebMap) | BepInEx, HTTP and WebSocket on 3000 | Server-side mod |
| Cyberpunk 2077 | CET plus RedSocket, used by [Crowd Control](https://crowdcontrol.live/guides/cyberpunk2077/) | Unknown; heavy |
| Fallout 4 Pip-Boy app protocol | UDP 28000 discovery, binary stream on TCP 27000 ([reverse-engineered](https://github.com/luckydonald/JavaPipBoyServer/blob/master/PROTOCOL.md)) | Broken in the current game build per Thor Pip-Boy |
| CS2 / Dota 2 Game State Integration | The game POSTs JSON to a URI declared in a cfg file | Protocol is a good model; the games are unrealistic on ARM |
| ETS2 / ATS telemetry SDK | Shared memory; needs an in-Wine relay such as [Funbit's server](https://github.com/Funbit/ets2-telemetry-server) | With a relay |
| [LiveSplit server](https://github.com/LiveSplit/LiveSplit.Server) | Text commands on TCP 16834 | Yes |
| Discord Rich Presence | Named pipe `\\.\pipe\discord-ipc-0` with JSON frames | A Wine-side pipe sink would give presence data for any game that integrates Discord |
| Racing UDP, War Thunder, Elite Dangerous | Already consumed by DroidDeck (below) | Yes |
Generic memory readers that publish JSON are another model: [tosu](https://github.com/KotRikD/tosu) serves osu! state on a WebSocket, and LiveSplit's ASL and [WASM auto-splitters](https://github.com/alexknauth/hollowknight-autosplit-wasm) are per-game pointer descriptions that a Rust runtime (livesplit-core) evaluates.
## What DroidDeck already has
Paths are under [`app/src/main/java/com/droiddeck/launcher/`](../../app/src/main/java/com/droiddeck/launcher/).
- **Shared loopback.** proot creates no network namespace and the bwrap shim ignores `--unshare-net`, so the guest's `127.0.0.1` is the app's `127.0.0.1` ([`core/NetworkReport.kt`](../../app/src/main/java/com/droiddeck/launcher/core/NetworkReport.kt), `tools/linuxfs/overlay/usr/local/bin/droiddeck-bwrap`). A Windows game in Proton can connect to a socket the app opens, and the app can connect to a socket a mod opens.
- **Telemetry template.** [`session/GameTelemetry.kt`](../../app/src/main/java/com/droiddeck/launcher/session/GameTelemetry.kt) parses Codemasters (UDP 20777), Forza (5300) and OutGauge (4444) packets, War Thunder's `http://127.0.0.1:8111/state` and Elite Dangerous's `Status.json` read straight from the Proton prefix. [`ui/BottomTelemetryPage.kt`](../../app/src/main/java/com/droiddeck/launcher/ui/BottomTelemetryPage.kt) runs one listener per source, marks data stale after 3 s, reports busy ports and unknown formats, and draws dashboards. [`session/TelemetryOutput.kt`](../../app/src/main/java/com/droiddeck/launcher/session/TelemetryOutput.kt) edits a game's config in its prefix (with a backup) to turn telemetry on. This is the first version of the companion API: built-in adapters for known games.
- **Agent channel.** `droiddeck-agent` in the guest and [`agent/AgentGuest.kt`](../../app/src/main/java/com/droiddeck/launcher/agent/AgentGuest.kt) talk through request and response files in a shared directory, plus watched state files (`focus.json` and others). `steamEval` reaches Steam's UI over the DevTools port.
- **Installing mods.** [`session/WinComponents.kt`](../../app/src/main/java/com/droiddeck/launcher/session/WinComponents.kt) installs per-game components from the [DroidDeck-Components](https://github.com/Droid-Deck/DroidDeck-Components) catalog: download, extract, copy DLLs and files, DLL overrides, registration. That covers the DLL side of SKSE, F4SE, ScriptHookV, ASI Loader and BepInEx. It stages files only under `system32` or `syswow64`, so mods that live in the game's own folder (Thor Pip-Boy's F4SE plugin and F4SE itself) need a game-directory install step, and F4SE also needs the launch option that starts `f4se_loader.exe`. Per-game environment overrides ([`session/GameEnvironmentStore.kt`](../../app/src/main/java/com/droiddeck/launcher/session/GameEnvironmentStore.kt)) reach the game through the `steam-compatibility` wrapper, including `WINEDLLOVERRIDES`. There is no SMAPI or BepInEx installer yet.
- **A second guest on the bottom screen.** The bottom KDE desktop is a second compositor in its own process with its own `/run/droiddeck`, so the main guest cannot see its Wayland socket. A debug-gated run queue in [`droiddeck-desktop`](../../tools/linuxfs/desktop/droiddeck-desktop) runs scripts there with `WAYLAND_DISPLAY=wayland-1 DISPLAY=:1`, which is a seed for a "run on bottom" command.
## Proposed design
### Phase 1: adapters for existing companions
DroidDeck connects as a client to the servers mods already open and draws their pages natively in the bottom-screen Presentation:
- Stardew (port 7786, WEMU protocol), Skyrim and Fallout 4 (SkyrimWebSocket protocol on 8765 and Thor Pip-Boy on 8767), GTA (47801), RIMAPI, the Hollow Knight tracker, LiveSplit.
- Probe only the ports known for the focused app id, so a busy port never confuses two games.
- Offer the mod itself through the components catalog, so setup is one toggle in the game's settings. This needs two installer additions first: copying into the game's directory, and setting the game's launch option to the script extender's loader.
This gives working showcases without writing any mods, and a reason to define the shared state model first.
### Phase 2: DroidDeck's own protocol
For new mods, DroidDeck is the server and mods are clients:
- **Transport.** WebSocket at `ws://127.0.0.1:<port>/companion/v1`, and newline-delimited JSON over raw TCP on the same port (detected from the first bytes). Clients are trivial under Wine; servers inside Wine are not (the Stardew mod had to hand-write one). Several mods or games can attach at once.
- **Discovery.** DroidDeck sets `DROIDDECK_COMPANION_URL`, `DROIDDECK_COMPANION_TOKEN` (random per launch) and `DROIDDECK_APPID` in the game's environment through the existing game-environment path, and writes the same values to a known file in the prefix for processes that lose the environment.
- **Security.** Any Android app can reach loopback, so the token is required in `hello` within about 2 s or the connection closes. No remote bind. Commands that change the game need a per-mod user toggle. Limits on frame and asset sizes.
- **Envelope.** `{"v":1,"type":…,"seq":n,…}`.
| Direction | Message | Purpose |
| --- | --- | --- |
| game → DroidDeck | `hello{token, game{appid, build}, mod{id, version}, capabilities[]}` | Identify and authenticate |
| | `declare{states{key: {type, unit, min, max}}}` | Describe the state keys the mod publishes |
| | `state{topic, data}` | Complete value of a topic, never a diff; DroidDeck keeps the latest and replays it when a page opens |
| | `asset{id: sha256, mime, nine_patch, filter}` + binary frame | Art sent once and cached across sessions by content hash |
| | `event{toast \| haptic \| sound}` | Notifications |
| | `result{id, ok, error}` | Command outcome |
| DroidDeck → game | `welcome{session, screen{w, h}}` | Accept the connection |
| | `visibility{visible, topics[], hz}` | Tell the mod what is on screen so it computes nothing else |
| | `command{id, name, args}` | Touch actions |
| | `input{button}` | Pass L/R or similar when a page claims them |
| | `ping` | Liveness |
A small C header and a C# client file would let SKSE, F4SE, ASI and BepInEx/SMAPI authors adopt it in an afternoon.
### Phase 3: pages
- **Declarative pages** in a `.ddpage` zip (`manifest.json` plus assets), modelled on Eden Duo's [package format](https://github.com/igawa6/eden-duo-companions/blob/main/docs/PACKAGE_FORMAT.md) but drawn with DroidDeck's own components:
- `pages[]` of widgets (`label`, `value`, `bar`, `grid`, `list`, `image`, `map`, `button`) bound to state keys, with `repeat` over arrays;
- actions `command`, `page` and `input` on tap, hold and swipe;
- a settings page backed by the mod's options;
- host values (`@device.*`, `@perf.*`) so pages can mix game and device data.
- **Normalized core keys**, the lesson from SimHub, whose dashboards work across many games because readers map them onto one property tree: `player.health`, `player.money`, `location.name`, `map.{x,y,heading}`, `inventory[]`, `quests[]`, `game.time`. A generic RPG page then works for any mod that provides them.
- **WebView escape hatch** for richer pages, in the style of EmuLnk's [theme API](https://github.com/EmuLnk/emulnk-repo/wiki/Theme-API): `window.droiddeck.onState` and `.send`. This also hosts existing web clients like SkyrimWebMonitor unchanged.
- Pages ship inside the mod, or from a catalog repository like the components catalog.
### Phase 4: run on bottom
A `droiddeck-run-bottom -- <cmd>` command, like Armada's `armada-run-bottom`, that opens a guest program on the bottom screen with touch. Kanto Gear's separate-window mode and second-monitor mods would then work as they are. Unity games could render to `Display.displays[1]` (the Silksong Android approach) if the bottom panel is exposed as a second output to the guest. Builds on the bottom desktop's run queue, or on binding its runtime directory into the main guest.
### Phase 5: memory profiles (only if demand)
Per-game JSON pointer profiles, gated on the Steam build id, evaluated on the Android side against the game process, in the style of Eden Duo or LiveSplit's auto-splitters. Strict version gating with a "needs build X" page, as Eden Duo does. Highest maintenance cost; only for popular games without mod support.
## Open questions
- Whether a single port and token for every game is enough, or each session gets its own port.
- How pages and mods are versioned together, and what happens when a mod is newer than the page.
- Which component installs belong in the catalog (SKSE, F4SE, ScriptHookV, ASI Loader, SMAPI, BepInEx) and how they interact with Steam updates of the game.
- Asking the authors of Thor Pip-Boy, Grand Theft Companion and the Stardew mod whether they would also speak DroidDeck's protocol.
- Touch commands that change game state while the game is paused or loading.
## Milestones
1. Stardew adapter (port 7786) with a native page, and the SMAPI mod offered through components.
2. Skyrim and Fallout 4 adapters (SkyrimWebSocket protocol), GTA adapter.
3. DroidDeck protocol server, C and C# clients, `.ddpage` renderer, normalized keys.
4. Run on bottom.
5. Memory profiles.
+4 -2
View File
@@ -1,6 +1,6 @@
# Bottom screen: research and proposals
Researched 2026-11-26 against `main` at `d788afc12` (0.7.11). This document records what other dual-screen Android projects put on the second screen, how they get their data, where DroidDeck stood at that commit, and the features we want to build. "DroidDeck today" is that researched baseline; each proposal's **Status** line says what has been built since, and proposals without one are not scheduled. Two proposals have their own documents: [region mirror](bottom-screen-region-mirror.md) and [guides tab](bottom-screen-guides.md).
Researched 2026-11-26 against `main` at `d788afc12` (0.7.11). This document records what other dual-screen Android projects put on the second screen, how they get their data, where DroidDeck stood at that commit, and the features we want to build. "DroidDeck today" is that researched baseline; each proposal's **Status** line says what has been built since, and proposals without one are not scheduled. Three proposals have their own documents: [region mirror](bottom-screen-region-mirror.md), [guides tab](bottom-screen-guides.md) and [companion API](bottom-screen-companion-api.md).
The starting point was WULFF DEN's survey video [Dual screen Android apps are getting crazy](https://youtu.be/dAiuG2A-wkc) (2026-11-26). It covers the AYN Thor and Retroid Pocket Duo, and most of its apps come from the [GAFT list](https://andreyvelsk.github.io/GAFT) of Thor apps.
@@ -167,10 +167,12 @@ Details: [bottom-screen-guides.md](bottom-screen-guides.md).
### 8. Companion API for PC games
**Status:** not built here; the first adapters (Stardew Valley, Skyrim SE, Fallout 4) follow in their own change.
**Status:** phase 1 started, as its own bottom-screen panel (Companion in the panel picker), drawn with the settings groups and rows. It connects over loopback only while shown and while the bottom screen is lit: Stardew Valley (the dual-screen SMAPI mod on 7786: day, gold, energy, health, a tappable hotbar, birthdays, quests), Skyrim SE (SkyrimWebSocket on 8765) and Fallout 4 (Thor Pip-Boy on 8767: vitals, caps, rads, carry weight, favorites to equip or use, radio). Code: [`companion/`](../../app/src/main/java/com/droiddeck/launcher/companion/), [`ui/BottomCompanionPage.kt`](../../app/src/main/java/com/droiddeck/launcher/ui/BottomCompanionPage.kt).
Let mods running in Proton drive native bottom-screen pages over loopback. Thor Pip-Boy (Fallout 4) and Grand Theft Companion (GTA) already run against DroidDeck as separate apps, and the Stardew, Skyrim and RimWorld ecosystems have servers we can adapt to. Plan: adapters for those first, then DroidDeck's own token-authenticated protocol with declarative pages and normalized state keys, then "run on bottom", then memory profiles only if needed. The existing racing, War Thunder and Elite Dangerous telemetry is the first set of built-in adapters.
Details: [bottom-screen-companion-api.md](bottom-screen-companion-api.md).
### 9. Steam's Quick Access menu on the bottom screen
**Status:** built as its own panel (Quick Access in the panel picker, Steam sessions only) and checked on a Retroid Pocket Duo Lite Plus in Big Picture and in a game. The bottom screen shows Steam's real Quick Access menu: notifications, friends and chat, quick settings, performance, soundtracks and help, plus Decky Loader's tab and its plugins when Decky is enabled. Taps, drags and scrolling go to it; the controller stays on the top screen, so the d-pad drives the library or the game while the menu stays open. Code: [`session/SteamQam.kt`](../../app/src/main/java/com/droiddeck/launcher/session/SteamQam.kt), [`ui/BottomSteamQamPanel.kt`](../../app/src/main/java/com/droiddeck/launcher/ui/BottomSteamQamPanel.kt), [`droiddeck-qam-relay`](../../tools/linuxfs/overlay/usr/local/bin/droiddeck-qam-relay).
+1 -1
View File
@@ -13,7 +13,6 @@ EA games install, update and start without the EA app. The research behind it is
| Downloads | Rust `src/ea/` in `libdroiddeckstores.so`, `EaInstaller.kt` | A build is one ZIP on EA's CDN. The engine reads its central directory with ranged reads, keeps files whose size and CRC match, and streams every other entry through inflate into place. `.droiddeck-ea-files` records what it placed, so a resume or update does not re-hash those files; files a new build drops are removed. |
| Updates | `EaUpdates` in `EaBackend.kt` | The game page compares the installed version with the offer's live `gameVersion` (every 30 minutes at most). Update runs the same install, which only fetches changed files. |
| Launch, guest | `droiddeck-store-launch` (`prepare_ea`) | Creates the prefix, reads the machine as Wine reports it (`wmic`, `vol`, `hostname`; cached in `pfx/.droiddeck-ea-hw.json`), writes EA app presence keys and the game's `Install Dir` keys in both registry views, runs the build's Touchup once per installed build, then asks the app for the session and writes any licence files. |
| Launch, Steam copy | `prepare_steam_ea` in `droiddeck-store-launch`, the Proton wrapper | Steam starts its EA titles with `steam2ea://`, which only the EA app handles, and the EA app does not install here. When the prefix has no EA app, the hook reads the game's `__Installer/installerdata.xml` and its offers (`__Installer/LOC/Origin.OFR.*.dat`), runs `prepare_ea` with a `steam` request (the app answers with the launch environment instead of a sidecar file), and writes `droiddeck-ea-steam.bat` in the game's compatdata. The wrapper runs that launcher in place of the link. Writing the EA app presence keys also satisfies the install script, so Steam stops running the EA app installer. |
| Launch, app | `EaLaunch.kt`, `EaOoa.kt`, `EaLsx.kt` | Answers `ea-prepare`: starts the LSX endpoint on `127.0.0.1:3216`, mints the short-lived opaque token, writes `.droiddeck-ea-env` (read once and deleted by the launcher `.bat`), and for games with a `Core` folder requests an online-activation licence for the machine hash. |
| LSX | `EaLsx.kt` | The local endpoint EA's SDK talks to instead of the EA app: challenge, AES session key, config, profile, settings, game info, auth codes for the game's own client ids, licences with Denuvo tokens, entitlements. Friends, presence and the overlay answer empty. |
@@ -27,5 +26,6 @@ WMI does not expose, so those use `00000000` unless the probe learns it.
## Not done yet
- Cloud saves (`cloudsync.juno.ea.com`).
- Steam copies of EA games still install the EA app (#2036).
- Pre-DiP games (no `installerdata.xml`) fall back to the exe picker.
- Javelin anti-cheat games do not run under Proton.
Binary file not shown.

After

Width:  |  Height:  |  Size: 57 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 70 KiB

Loaded 100 of 116 files, more files were not shown because too many files have changed in this diff. Show more