From 2bd0e8a5aa36d4fdd694783a1b394d2c9212d147 Mon Sep 17 00:00:00 2001 From: miteruzo Date: Fri, 30 Jun 2023 08:36:07 +0900 Subject: [PATCH] =?UTF-8?q?HSP=20=E5=81=B4=E3=83=81=E3=83=A3=E3=83=83?= =?UTF-8?q?=E3=83=88=E6=A9=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- android/modules/chat.mod.hsp | 24 ++++++++++++++++++++++++ server/chat.php | 8 ++++++++ server/modules/chat.mod.php | 2 +- 3 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 android/modules/chat.mod.hsp diff --git a/android/modules/chat.mod.hsp b/android/modules/chat.mod.hsp new file mode 100644 index 0000000..c3a464f --- /dev/null +++ b/android/modules/chat.mod.hsp @@ -0,0 +1,24 @@ +#module \ +Chat + +#define URL ("http://miteruzo.ml/goatoh_training/chat.php") + +#defcfunc \ +New \ + int p_id + id.insNum = p_id + + insNum++ + + Return insNum - 1 + +#deffunc \ +Send \ + str p_message + int p_insId + HTTPLoad URL, StrF ("id=%d&text=%s", id.p_insId, p_message) + + Return + +#global + diff --git a/server/chat.php b/server/chat.php index ed07ba8..2bc6225 100644 --- a/server/chat.php +++ b/server/chat.php @@ -2,3 +2,11 @@ require_once './modules/common.mod.php'; + +$db = new Chat; + +$user_id = $_POST['id']; +$chat_message = $_POST['text']; + +$db -> send_chat ($user_id, $chat_message); + diff --git a/server/modules/chat.mod.php b/server/modules/chat.mod.php index b1ff0ba..2e95da4 100644 --- a/server/modules/chat.mod.php +++ b/server/modules/chat.mod.php @@ -20,7 +20,7 @@ Chat } function - sendChat ( + send_chat ( int $user_id, string $text): void