示例#1
0
        /// <summary>
        /// Opens UO.dll and attaches to specified Client instance.
        /// </summary>
        /// <returns>true if Open, false if wrong version or failure</returns>
        public bool Open(int CliNr)
        {
            UOHandle = UODLL.Open();
            var ver = UODLL.Version();

            if (ver != 3)
            {
                Console.WriteLine("Warning Unsupported DLL!");
            }
            UODLL.SetTop(UOHandle, 0);
            UODLL.PushStrVal(UOHandle, "Set");
            UODLL.PushStrVal(UOHandle, "CliNr");
            UODLL.PushInteger(UOHandle, CliNr);
            if (UODLL.Execute(UOHandle) != 0)
            {
                return(false);
            }
            ;
            return(true);
        }
示例#2
0
        /// <summary>
        /// Opens UO.dll and attaches to first Client instance.
        /// </summary>
        /// <returns>true if Open, false if wrong version or failure</returns>
        public bool Open()
        {
            UOHandle = UODLL.Open();
            var ver = UODLL.Version();

            if (ver != 3)
            {
                return(false);
            }
            UODLL.SetTop(UOHandle, 0);
            UODLL.PushStrVal(UOHandle, "Set");
            UODLL.PushStrVal(UOHandle, "CliNr");
            UODLL.PushInteger(UOHandle, 1);
            if (UODLL.Execute(UOHandle) != 0)
            {
                return(false);
            }
            ;
            return(true);
        }