示例#1
0
文件: GGEngine.cs 项目: DamiaX/shgg
 private void ForwardMessage(stMsg outMsg, stMsgRecs outRecs, int[] recs, stMsgRich outMsgRich, List <stMsgRichFormat> outRichList, int listLength)
 {
     outMsg.Header.Size = 13 + (uint)outMsg.Message.Length;
     if (outRichList.Count > 0)
     {
         outMsg.Header.Size += (uint)listLength + 3;
     }
     if (recs.Length > 0)
     {
         outMsg.Header.Size += (uint)(5 + (4 * recs.Length));
     }
     ForwardData(RawSerialize(outMsg), 21 + outMsg.Message.Length);
     if (recs.Length > 0)
     {
         ForwardData(RawSerialize(outRecs), 5);
         for (int i = 0; i < recs.Length; i++)
         {
             ForwardData(RawSerialize(recs[i]));
         }
     }
     if (outRichList.Count > 0)
     {
         ForwardData(RawSerialize(outMsgRich), 3);
         outRichList.ForEach(delegate(stMsgRichFormat formatItem) {
             int rgbOffset = (formatItem.RGB != null) ? 6 : 3;
             ForwardData(RawSerialize(formatItem), rgbOffset);
         });
     }
     return;
 }
示例#2
0
文件: GGEngine.cs 项目: DamiaX/shgg
        private stMsgRich BuildRichInfo(int listLength)
        {
            stMsgRich outMsgRich = new stMsgRich();

            outMsgRich.Flag   = OUT_MESSAGE_RICH_FLAG;
            outMsgRich.Length = (short)listLength;
            return(outMsgRich);
        }
示例#3
0
文件: GGEngine.cs 项目: DamiaX/shgg
        private void BuildImage(int recNum, string msg, int imgPos, int[] recs, SortedDictionary <short, string> msgFormat, bool conference, byte[] bin, string path)
        {
            stMsg                  outMsg      = BuildMsgInfo((uint)recs[recNum], msg);
            stMsgImage             outMsgImage = BuildImageQuery(bin, outMsg.Recipient, path);
            int                    listLength;
            List <stMsgRichFormat> outMsgRichFormat = BuildRichImg(out listLength, imgPos);
            stMsgRich              outMsgRich       = BuildRichInfo(listLength);

            if (!conference)
            {
                ForwardImageRequest(outMsg, outMsgRich, outMsgRichFormat, listLength, outMsgImage);
            }
        }
示例#4
0
文件: GGEngine.cs 项目: DamiaX/shgg
        private void BuildMessage(int recNum, string msg, int[] recs, SortedDictionary <short, string> msgFormat, bool conference)
        {
            stMsg     outMsg     = BuildMsgInfo((uint)recs[recNum], msg);
            stMsgRecs outMsgRecs = BuildRecipientsInfo(recs.Length);
            int       listLength;
            List <stMsgRichFormat> outMsgRichFormat = BuildRichText(ref msgFormat, out listLength);
            stMsgRich outMsgRich = BuildRichInfo(listLength);

            if (!conference)
            {
                ForwardMessage(outMsg, new stMsgRecs(), new int[0], outMsgRich, outMsgRichFormat, listLength);
            }
            else
            {
                ForwardMessage(outMsg, outMsgRecs, recs, outMsgRich, outMsgRichFormat, listLength);
            }
        }
示例#5
0
文件: GGEngine.cs 项目: DamiaX/shgg
 private void ForwardImageRequest(stMsg outMsg, stMsgRich outMsgRich, List <stMsgRichFormat> outRichList, int listLength, stMsgImage image)
 {
     outMsg.Header.Size = 13 + (uint)outMsg.Message.Length;
     if (outRichList.Count > 0)
     {
         outMsg.Header.Size += (uint)listLength + 3;
     }
     ForwardData(RawSerialize(outMsg), 21 + outMsg.Message.Length);
     if (outRichList.Count > 0)
     {
         ForwardData(RawSerialize(outMsgRich), 3);
         outRichList.ForEach(delegate(stMsgRichFormat formatItem) {
             ForwardData(RawSerialize(formatItem), 3);
             ForwardData(RawSerialize(image), 10);
         });
     }
     return;
 }