Today we are going to talk about built-in-GM-chat (yes, there is such client-side feature).
I think, this feature must be implemented in core, it makes pol more user-friendly.
There are 2 packet modifications.
This packet is used to enable Client-Side GMChat (server -> client):
Code: Select all
var strr := "Hello, mortal (Chat Opened)";
var newpacket := CreatePacket( 0xae, -1 );
newpacket.setInt16(1, 48+1+len(strr)*2);
newpacket.SetInt32(3, targ.serial);
newpacket.SetInt16(7, 0xFFFF); // As far as i know graphic must be FFFF here
newpacket.SetInt8(9, 0x0F); // This byte here is a command to start Chat.
newpacket.SetInt16(10, 0x35);
newpacket.SetInt16(12, 3);
newpacket.SetString(14, "rus", 1);
newpacket.SetString(18, CStr(who.name), 0);
newpacket.SetUnicodeString(48, text_to_uc(strr), 0);
newpacket.SendPacket( targ );
Code: Select all
- 000103259+1357 --- client Unicode Client Talk
0000: ad 00 26 0f 00 34 00 03 52 55 53 00 00 48 00 45 : ..&..4..RUS..H.E
0010: 00 4c 00 4c 00 4f 00 20 00 47 00 4d 00 21 00 21 : .L.L.O. .G.M.!.!
0020: 00 21 00 21 00 00 -- -- -- -- -- -- -- -- -- -- : .!.!..
uuconvert: HELLO GM!!!!
Code: Select all
ad - BYTE[1] cmd
00 26 - BYTE[2] length
0f - BYTE[1] Type !!!!!!!!!!!!!!!!!!!!!
00 34 - BYTE[2] Color
00 03 - BYTE[2] Font
52 55 53 00 - BYTE[4] Language (Null Terminated)
........
Code: Select all
var strr := "Chat Closed.";
var newpacket := CreatePacket( 0xae, -1 );
newpacket.setInt16(1, 48+1+len(strr)*2);
newpacket.SetInt32(3, targ.serial);
newpacket.SetInt16(7, 0xFFFF); // As far as i know graphic must be FFFF here
newpacket.SetInt8(9, 0x10); // This byte here is a command to Stop GM Chat
newpacket.SetInt16(10, 0x35);
newpacket.SetInt16(12, 3);
newpacket.SetString(14, "rus", 1);
newpacket.SetString(18, CStr(who.name), 0);
newpacket.SetUnicodeString(48, text_to_uc(strr), 0);
newpacket.SendPacket( targ );
So, the main problem here:
when the chat was started we should store objref (serial) of GM that opened a chat, and when client sends 0xAD packet with type 0x0F we must filter it and resend this packet only to GM that opened this chat (at the moment it works like standart speech, and everyone in 'line of sight' becomes this message)
It must also work in both directions: player -> gm and gm -> player
Patently it should be controlled when GM or Player is logged off etc...
Good luck.
ps. I hope pol-devs would not forget about Unicode Users this time