From 81f5e829e6f94b7ab44bbeb48823c1736b043dbc Mon Sep 17 00:00:00 2001 From: UnknownShadow200 Date: Tue, 3 Nov 2020 22:43:36 +1100 Subject: [PATCH] Add documentation in hosting-webclient.md for how to properly design webpage hosting the webclient for mobile devices --- doc/hosting-webclient.md | 13 +++++++++++++ src/Chat.c | 8 -------- src/Window.c | 26 -------------------------- 3 files changed, 13 insertions(+), 34 deletions(-) diff --git a/doc/hosting-webclient.md b/doc/hosting-webclient.md index f78ef9261..af5eaeb9f 100644 --- a/doc/hosting-webclient.md +++ b/doc/hosting-webclient.md @@ -83,3 +83,16 @@ You are required to have this HTML code somewhere in the page: The links below show implementing a simple website that hosts the web client * [Flask (python webserver)](hosting-flask.md) + +### iOS / Android support + +The webclient is compatible with Android / iOS devices and will show a touch based UI to these devices. + +However, due to the limited screen size available on such devices, you should consider serving a webpage consisting of just the `` to these devices - no header, footer or anything else. + +Additionally, you will likely want to ensure zooming is disabled, viewport width is same as the device's width, and that 'add to device homescreen' is fully supported. You can accomplish that by adding these three HTML tags to the page: +```HTML + + + +``` \ No newline at end of file diff --git a/src/Chat.c b/src/Chat.c index 1d5dc624f..956f6212e 100644 --- a/src/Chat.c +++ b/src/Chat.c @@ -590,14 +590,6 @@ void Chat_Send(const cc_string* text, cc_bool logUsage) { Event_RaiseChat(&ChatEvents.ChatSending, text, 0); if (logUsage) StringsBuffer_Add(&Chat_InputLog, text); -#ifdef CC_BUILD_WEB - if (String_CaselessEqualsConst(text, "/client debug")) { - Chat_AddRaw("DEBUG CANNON ENGAGED"); - extern int Window_Debug; - Window_Debug = true; - } -#endif - if (Commands_IsCommandPrefix(text)) { Commands_Execute(text); } else { diff --git a/src/Window.c b/src/Window.c index 7bbca8c5e..67ac89caa 100644 --- a/src/Window.c +++ b/src/Window.c @@ -3523,33 +3523,7 @@ void Window_Close(void) { UnhookEvents(); } -#include "Chat.h" -static void LogStuff(void) { - char buffer[256]; cc_string str = String_FromArray(buffer); - int width, height; - double css_width, css_height; - - width = GetCanvasWidth(); - height = GetCanvasHeight(); - String_Format2(&str, "Size: %ix%i", &width, &height); - Chat_AddOf(&str, MSG_TYPE_CLIENTSTATUS_1); - str.length = 0; - - width = EM_ASM_INT_V({ return window.innerHeight; }); - height = EM_ASM_INT_V({ return window.outerHeight; }); - String_Format2(&str, "I:%i O:%i", &width, &height); - Chat_AddOf(&str, MSG_TYPE_CLIENTSTATUS_2); - str.length = 0; - - width = GetScreenWidth(); - height = GetScreenHeight(); - String_Format2(&str, "Dims: %ix%i |", &width, &height); - Chat_AddOf(&str, MSG_TYPE_STATUS_3); -} - -int Window_Debug; void Window_ProcessEvents(void) { - if (Window_Debug) LogStuff(); if (!needResize) return; needResize = false; if (!WindowInfo.Exists) return;