Browse Source

HSP 側チャット機能

main
miteruzo 1 year ago
parent
commit
2bd0e8a5aa
3 changed files with 33 additions and 1 deletions
  1. +24
    -0
      android/modules/chat.mod.hsp
  2. +8
    -0
      server/chat.php
  3. +1
    -1
      server/modules/chat.mod.php

+ 24
- 0
android/modules/chat.mod.hsp View File

@@ -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


+ 8
- 0
server/chat.php View File

@@ -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);


+ 1
- 1
server/modules/chat.mod.php View File

@@ -20,7 +20,7 @@ Chat
}

function
sendChat (
send_chat (
int $user_id,
string $text):
void


Loading…
Cancel
Save