|
private_message
This allows a private message to be sent to a specific user.
Parameter |
Type |
Description |
dest_uid |
String |
The receiver's userid |
msg |
String |
Message to be sent |
avatar |
String |
Avatar name in the message( could be "e1" , "e2"
"e32") |
owner_uid |
String |
The sender's userid |
owner_nick |
String |
The sender's nickname |
b |
"1" or "0" |
1 bold font for the message being sent
0 not bold |
i |
"1" or "0" |
1 italic font
0 not italic |
u |
"1" or "0" |
1 underlined font
0 no underline |
color |
Hexadecimal Number |
Color value must begin with "0x", eg: red is "0xFF0000" |
A full sample of this command can be seen below:
<?xml version="1.0" encoding="UTF-8"?><Command group="default" api_pwd="3874-3459-9293-2194" type="private_message" dest_uid="test" msg="hello world" emotion="e2" owner_uid="admin" owner_nick="admin" b="1" i="1" u="1" color="0xff00ff" />
How to use above server APIs with php to send command to chat server, here is the sample code:
<?
$host = "127.0.0.1";
$port = 51127;
$apiCommand = '<?xml version="1.0" encoding="UTF-8"?><Command group="default" api_pwd="3874-3459-9293-2194" type="add_room" name="Chit Chat" owner="Mod" desc="Chit Chat room." max="200" />';
$fp = fsockopen($host, $port, &$errno, &$errstr, 2);
if(!$fp)
{
echo "$errstr ($errno)n";
}
else
{
fputs($fp,$apiCommand." |