Skip to content
This repository has been archived by the owner on Nov 25, 2021. It is now read-only.

Commit

Permalink
修复: IM协议对不同长度的TUid进行适配;
Browse files Browse the repository at this point in the history
  • Loading branch information
cyanray committed Mar 3, 2021
1 parent 093ab15 commit fce78fb
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions cx-auto-sign/cxim.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,12 @@ public static string BuildLoginPackage(string TUid, string ImToken)
var timestamp = DateTimeOffset.Now.ToUnixTimeMilliseconds();
MemoryStream s = new MemoryStream();
var bw = new BinaryWriter(s);
bw.Write(new byte[] { 0x08, 0x00, 0x12, 0x3c, 0x0a, 0x0e });
bw.Write(new byte[] { 0x08, 0x00, 0x12 });
bw.Write((byte)(52 + TUid.Length)); // 接下来到 webim_{timestamp} 的内容长度
bw.Write(new byte[] { 0x0a, 0x0e });
bw.Write(Encoding.ASCII.GetBytes("cx-dev#cxstudy"));
bw.Write(new byte[] { 0x12, 0x08 });
bw.Write(new byte[] { 0x12 });
bw.Write((byte)TUid.Length);
bw.Write(Encoding.ASCII.GetBytes(TUid));
bw.Write(new byte[] { 0x1a, 0x0b });
bw.Write(Encoding.ASCII.GetBytes("easemob.com"));
Expand Down

0 comments on commit fce78fb

Please sign in to comment.