Skip to content

Commit ba8b0a9

Browse files
committed
Do not re-encode text SID_ENTERCHAT for chatgw
1 parent c5c92b0 commit ba8b0a9

1 file changed

Lines changed: 11 additions & 3 deletions

File tree

src/Atlasd/Battlenet/Protocols/Game/Messages/SID_ENTERCHAT.cs

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -135,9 +135,17 @@ public override bool Invoke(MessageContext context)
135135
{
136136
if (protocolType.IsChat())
137137
{
138-
using var m = new MemoryStream(Buffer);
139-
using var r = new BinaryReader(m);
140-
return Encoding.UTF8.GetBytes($"{2000 + Id} NAME {Encoding.UTF8.GetString(r.ReadByteString())}{Battlenet.Common.NewLine}");
138+
using var _m = new MemoryStream(Buffer);
139+
using var r = new BinaryReader(_m);
140+
var username = r.ReadByteString();
141+
var statstring = r.ReadByteString();
142+
143+
using var m = new MemoryStream();
144+
using var w = new BinaryWriter(m);
145+
w.Write($"{2000 + Id} NAME ");
146+
w.Write(username);
147+
w.Write(Battlenet.Common.NewLine);
148+
return m.GetBuffer();
141149
}
142150
else
143151
{

0 commit comments

Comments
 (0)