File tree Expand file tree Collapse file tree
src/Atlasd/Battlenet/Protocols/Game/Messages Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -47,5 +47,29 @@ public override bool Invoke(MessageContext context)
4747 context . Client . Send ( ToByteArray ( context . Client . ProtocolType ) ) ;
4848 return true ;
4949 }
50+
51+ public new byte [ ] ToByteArray ( ProtocolType protocolType )
52+ {
53+ if ( protocolType . IsChat ( ) )
54+ {
55+ using var _m = new MemoryStream ( Buffer ) ;
56+ using var r = new BinaryReader ( _m ) ;
57+ var style = r . ReadUInt32 ( ) ;
58+ var text = r . ReadByteString ( ) ;
59+ var caption = r . ReadByteString ( ) ;
60+
61+ using var m = new MemoryStream ( ) ;
62+ using var w = new BinaryWriter ( m ) ;
63+ w . Write ( $ "{ 2000 + Id } MESSAGEBOX \" ") ;
64+ w . Write ( text ) ;
65+ w . Write ( '"' ) ;
66+ w . Write ( Battlenet . Common . NewLine ) ;
67+ return m . GetBuffer ( ) ;
68+ }
69+ else
70+ {
71+ return base . ToByteArray ( protocolType ) ;
72+ }
73+ }
5074 }
5175}
You can’t perform that action at this time.
0 commit comments