internal static unsafe Vector Invoke(EBoundaryType BoundaryType)
            {
                long *p = stackalloc long[] { 0L, 0L, 0L };
                byte *b = (byte *)p;

                *(b + 0) = (byte)BoundaryType;
                Main.GetProcessEvent(OculusFunctionLibrary.DefaultObject, GetGuardianDimensions_ptr, new IntPtr(p));;
                return(*((Vector *)(b + 4)));
            }
        }
            internal static unsafe GuardianTestResult Invoke(Vector Point, EBoundaryType BoundaryType)
            {
                long *p = stackalloc long[] { 0L, 0L, 0L, 0L, 0L, 0L, 0L };
                byte *b = (byte *)p;

                *((Vector *)(b + 0)) = Point;
                *(b + 12)            = (byte)BoundaryType;
                Main.GetProcessEvent(OculusFunctionLibrary.DefaultObject, GetPointGuardianIntersection_ptr, new IntPtr(p));;
                return(*((GuardianTestResult *)(b + 16)));
            }
        }
            internal static unsafe IReadOnlyCollection <Vector> Invoke(EBoundaryType BoundaryType)
            {
                long *p = stackalloc long[] { 0L, 0L, 0L, 0L };
                byte *b = (byte *)p;

                *(b + 0) = (byte)BoundaryType;
                Main.GetProcessEvent(OculusFunctionLibrary.DefaultObject, GetGuardianPoints_ptr, new IntPtr(p));;
                //TODO: array TArray ReturnValue
                return(UObject.ToUnmangedCollection <Vector>(b + 8));
            }
        }
Exemple #4
0
        public override byte[] ReadLine()
        {
            byte[] collection = new byte[] { 13, 10 };
            if (base.EndOfMessage)
            {
                throw new InvalidOperationException("End of the message was reached");
            }
            int endOfLinePosition = base.GetEndOfLinePosition(this._buffer, 0);

            while (endOfLinePosition == -1)
            {
                bool   flag;
                byte[] buffer3;
                byte[] line = base._sourceReader.ReadLine();
                if (base._sourceReader.EndOfMessage)
                {
                    base._endOfMessage         = true;
                    base._finalBoundaryReached = true;
                    break;
                }
                EBoundaryType type = BoundaryChecker.CheckBoundary(line, base._boundary);
                if (type != EBoundaryType.NotBoundary)
                {
                    base._endOfMessage         = true;
                    base._finalBoundaryReached = type == EBoundaryType.Final;
                    return(this._buffer.ToArray());
                }
                if ((line.Length > 0) && (line[line.Length - 1] == 0x3d))
                {
                    flag    = false;
                    buffer3 = new byte[line.Length - 1];
                    Array.Copy(line, 0, buffer3, 0, line.Length - 1);
                }
                else
                {
                    flag    = true;
                    buffer3 = line;
                }
                byte[] buffer4 = MailMessageRFCDecoder.DecodeFromQuotedPrintable(buffer3);
                this._buffer.AddRange(buffer4);
                if (flag)
                {
                    this._buffer.AddRange(collection);
                }
                int offset = (this._buffer.Count - buffer4.Length) - 1;
                offset           -= flag ? 2 : 0;
                endOfLinePosition = base.GetEndOfLinePosition(this._buffer, offset);
            }
            List <byte> range = this._buffer.GetRange(0, endOfLinePosition);

            this._buffer.RemoveRange(0, endOfLinePosition + 2);
            return(range.ToArray());
        }
Exemple #5
0
        public virtual MultiPart Parse(IMessageReader reader, EContentTransferEncoding contentTransferEncoding, string boundary, string uid, string attachmentDirectory, PopMessage parentMessage, ContentType contentType)
        {
            byte[]    buffer;
            MultiPart part = new MultiPart();
            string    str2 = contentType.Attributes["boundary"];

            this._childrenReachedFinalBoundary = false;
            do
            {
                buffer = reader.ReadLine();
            }while (buffer != null && this._defaultEncoding.GetString(buffer, 0, buffer.Length) != ("--" + str2));
            do
            {
                string     source = Utils.ReadHeaders(reader);
                MIMEHeader header = new MIMEHeaderParser().Parse(source);
                if (reader.EndOfMessage)
                {
                    break;
                }
                IPart part2 = this.ParsePart(reader, header.ContentID, header.ContentType, header.ContentDisposition, header.ContentTransferEncoding, uid, attachmentDirectory, str2, parentMessage);
                part2.Header = header;
                part2.Header.ContentTransferEncoding = header.IsDefaultContentTransferEncoding ? contentTransferEncoding : header.ContentTransferEncoding;
                part.Parts.Add(part2);
            }while (!this._childrenReachedFinalBoundary);
            while (!reader.EndOfMessage)
            {
                buffer = reader.ReadLine();
                if (buffer == null)
                {
                    this.RaiseFinalBoundaryReached();
                    return(part);
                }
                EBoundaryType type = BoundaryChecker.CheckBoundary(buffer, boundary);
                if (type != EBoundaryType.NotBoundary)
                {
                    if (type == EBoundaryType.Final)
                    {
                        this.RaiseFinalBoundaryReached();
                    }
                    return(part);
                }
            }
            return(part);
        }
Exemple #6
0
        public override byte[] ReadLine()
        {
            if (base.EndOfMessage)
            {
                throw new InvalidOperationException("End of the message was reached");
            }
            int endOfLinePosition = base.GetEndOfLinePosition(this._buffer, 0);

            if (this._reachedBoundary == EBoundaryType.NotBoundary)
            {
                while (endOfLinePosition == -1)
                {
                    byte[] line = base._sourceReader.ReadLine();
                    if (base._sourceReader.EndOfMessage)
                    {
                        base._endOfMessage         = true;
                        base._finalBoundaryReached = true;
                        break;
                    }
                    EBoundaryType type = BoundaryChecker.CheckBoundary(line, base._boundary);
                    if (type != EBoundaryType.NotBoundary)
                    {
                        this._reachedBoundary = type;
                        byte[] buffer2 = this._buffer.ToArray();
                        this._buffer.Clear();
                        return(buffer2);
                    }
                    byte[] collection = MailMessageRFCDecoder.DecodeFromBase64(line);
                    this._buffer.AddRange(collection);
                    endOfLinePosition = base.GetEndOfLinePosition(this._buffer, (this._buffer.Count - collection.Length) - 1);
                }
            }
            else
            {
                base._endOfMessage         = true;
                base._finalBoundaryReached = this._reachedBoundary == EBoundaryType.Final;
                return(null);
            }
            List <byte> range = this._buffer.GetRange(0, endOfLinePosition);

            this._buffer.RemoveRange(0, endOfLinePosition + 2);
            return(range.ToArray());
        }
        public override byte[] ReadLine()
        {
            if (base.EndOfMessage)
            {
                throw new InvalidOperationException("End of the message was reached");
            }
            byte[] line = base._sourceReader.ReadLine();
            if (base._sourceReader.EndOfMessage)
            {
                base._endOfMessage         = true;
                base._finalBoundaryReached = true;
                return(null);
            }
            EBoundaryType type = BoundaryChecker.CheckBoundary(line, base._boundary);

            if (type != EBoundaryType.NotBoundary)
            {
                base._finalBoundaryReached = type == EBoundaryType.Final;
                base._endOfMessage         = true;
                return(null);
            }
            return(line);
        }
            internal static unsafe GuardianTestResult Invoke(ETrackedDeviceType DeviceType, EBoundaryType BoundaryType)
            {
                long *p = stackalloc long[] { 0L, 0L, 0L, 0L, 0L, 0L };
                byte *b = (byte *)p;

                *(b + 0) = (byte)DeviceType;
                *(b + 1) = (byte)BoundaryType;
                Main.GetProcessEvent(OculusFunctionLibrary.DefaultObject, GetNodeGuardianIntersection_ptr, new IntPtr(p));;
                return(*((GuardianTestResult *)(b + 4)));
            }
        }
Exemple #9
0
 public Base64MessageReader(IMessageReader sourceReader, string boundary) : base(sourceReader, boundary)
 {
     this._buffer          = new List <byte>();
     this._reachedBoundary = EBoundaryType.NotBoundary;
 }