13 #include "../../bscript/berror.h" 14 #include "../../bscript/bobject.h" 15 #include "../../bscript/impstr.h" 16 #include "../../clib/clib_endian.h" 17 #include "../../clib/logfacility.h" 18 #include "../accounts/account.h" 19 #include "../item/item.h" 20 #include "../mobile/charactr.h" 21 #include "../network/cgdata.h" 22 #include "../network/client.h" 23 #include "../network/packethelper.h" 24 #include "../network/packets.h" 25 #include "../pktboth.h" 26 #include "../pktdef.h" 28 #include "../unicode.h" 29 #include "../uoexec.h" 36 using namespace Network;
42 msg->Write<
u32>( serial );
43 msg->Write<
u32>( serial );
51 if ( uniemod ==
nullptr )
55 sizeof( msg->
wtext[0] ) );
61 msg->
wtext[textlen] = 0x0000;
73 valstack =
new BObject(
new BError(
"Malformed return-packet from client" ) );
78 memcpy( lang, msg->
lang, 4 );
84 for ( i = 0; i < textlen; i++ )
87 if ( wc < (
u16)0x20 || wc == (
u16)0x7F )
95 << ( ( client->
acct !=
nullptr ) ? client->
acct->
name() :
"unknown" )
96 <<
") sent invalid unicode control characters (RequestInputUC)\n";
110 retval->addMember(
"uc_text", uc_text.
copy() );
126 using namespace Module;
139 using namespace Bscript;
145 prompt_chr( nullptr )
165 unsigned short color;
166 unsigned short requiredCmdLevel;
172 size_t textlen = oText->
ref_arr.size();
174 return new BError(
"Unicode array exceeds maximum size." );
175 if ( lang->
length() != 3 )
176 return new BError(
"langcode must be a 3-character code." );
179 return new BError(
"Invalid value in Unicode array." );
182 return new BLong( 1 );
186 return new BError(
"A parameter was invalid" );
196 unsigned short color;
202 size_t textlen = oText->
ref_arr.size();
204 return new BError(
"Unicode array exceeds maximum size." );
205 if ( lang->
length() != 3 )
206 return new BError(
"langcode must be a 3-character code." );
208 return new BError(
"Invalid value in Unicode array." );
215 return new BError(
"A parameter was invalid" );
226 unsigned short color;
231 size_t textlen = oText->
ref_arr.size();
233 return new BError(
"Unicode array exceeds maximum size." );
234 if ( lang->
length() != 3 )
235 return new BError(
"langcode must be a 3-character code." );
238 return new BError(
"Invalid value in Unicode array." );
245 return new BError(
"A parameter was invalid" );
260 return new BError(
"No client attached" );
265 return new BError(
"Another script has an active prompt" );
268 size_t textlen = oPrompt->
ref_arr.size();
270 return new BError(
"Unicode array exceeds maximum size." );
271 if ( lang->
length() != 3 )
272 return new BError(
"langcode must be a 3-character code." );
274 return new BError(
"Invalid value in Unicode array." );
279 <<
"\tCall to function Unicode::RequestInputUC():\n" 280 <<
"\tThe execution of this script can't be blocked!\n";
291 return new BLong( 0 );
295 return new BError(
"A parameter was invalid" );
305 unsigned short color;
312 size_t textlen = oText->
ref_arr.size();
314 return new BError(
"Unicode array exceeds maximum size." );
315 if ( lang->
length() != 3 )
316 return new BError(
"langcode must be a 3-character code." );
319 return new BError(
"Invalid value in Unicode array." );
323 return new BLong( 1 );
327 return new BError(
"Mobile has no active client" );
332 return new BError(
"Invalid parameter type" );
341 return new BError(
"Function not implimented" );
void broadcast(const char *text, unsigned short font, unsigned short color, unsigned short requiredCmdLevel)
bool getItemParam(unsigned param, Items::Item *&itemptr)
const std::string & value() const
u16 gwtext[(SPEECH_MAX_LEN+1)]
bool has_active_prompt() const
ValueStackCont ValueStack
UnicodeExecutorModule(Core::UOExecutor &exec)
Core::UOExecutor & uoexec
bool getParam(unsigned param, int &value)
bool has_active_client() const
Bscript::BObjectImp * mf_BroadcastUC()
virtual BObjectImp * copy() const POL_OVERRIDE
Bscript::BObjectImp * mf_SendTextEntryGumpUC()
bool private_say_above(Character *chr, const UObject *obj, const char *text, unsigned short font, unsigned short color, unsigned int journal_print)
bool convertArrayToUC(Bscript::ObjArray *&in_text, u16 *out_wtext, size_t textlen, bool ConvToBE, bool nullterm)
void Send(Client *client, int len=-1) const
const char * name() const
Module::UnicodeExecutorModule * prompt_uniemod
const std::string & scriptname() const
Bscript::BObjectImp * mf_RequestInputUC()
const String * getStringParam(unsigned param)
void handle_unicode_prompt(Client *client, Core::PKTBI_C2 *msg)
Bscript::BObjectImp * mf_SendSysMessageUC()
Bscript::BObjectImp * mf_PrintTextAboveUC()
void addElement(BObjectImp *imp)
void send_unicode_prompt(Client *client, u32 serial)
bool getObjArrayParam(unsigned param, ObjArray *&pobjarr)
bool getCharacterParam(unsigned param, Mobile::Character *&chrptr)
std::string strupper(const std::string &str)
bool getUObjectParam(unsigned param, Core::UObject *&objptr)
Bscript::BObjectImp * mf_PrivateTextAboveUC()
bool say_above(const UObject *obj, const char *text, unsigned short font, unsigned short color, unsigned int journal_print)
Mobile::Character * prompt_chr
void send_sysmessage(Network::Client *client, const char *text, unsigned short font, unsigned short color)
Module::OSExecutorModule * os_module