STRING* search_str = "/search";
function chat_entry()
{
// if host or client
if (connection == 2 || connection == 3)
{
// if inkey already open return
if (inkey_active) return;
str_cpy(strChatEntry, "#100");
set(txtChatEntry,VISIBLE);
inkey(strChatEntry); // get chat entry
// if entry was empty don't process
if(str_cmp(strChatEntry,""))
//if(str_len(strChatEntry)==0)
{
return;
}
reset(txtChatEntry,VISIBLE);
if(strChatEntry == search_str)
{
str_cpy(strSendChat,player_name); // put players name before entry
str_cat(strSendChat," searches his pockets. ");
}
else
{
str_cpy(strSendChat,player_name); // put players name before entry
str_cat(strSendChat,": ");
str_cat(strSendChat,strChatEntry);
}
// if Host go ahead and do chat manipulation
if (connection == 3)
{
send_string(strSendChat);
str_cpy(strChat0, strChat1);
str_cpy(strChat1, strChat2);
str_cpy(strChat2, strChat3);
str_cpy(strChat3, strChat4);
str_cpy(strChat4, strChat5);
str_cpy(strChat5, strChat6);
str_cpy(strChat6, strChat7);
str_cpy(strChat7, strChat8);
str_cpy(strChat8, strSendChat);
str_cpy(strSendChat,"");
}
else // if client send entry to server for processing
{
send_string(strSendChat);
}
str_cpy(strSendChat,"#100"); // clear the strings for client and
str_cpy(strChatEntry,"#100"); // server called functions
}
}