コード例 #1
0
ファイル: ExtensionForm.cs プロジェクト: SirJamal/Sulakore
        public ExtensionForm()
        {
            Triggers = new HTriggers(false);
            var extensionAssembly = Assembly.GetCallingAssembly();

            ExtensionInfo extensionInfo =
                Contractor.GetExtensionInfo(extensionAssembly);

            if (IsInstalled = (extensionInfo != null))
            {
                _contractor = extensionInfo.Contractor;

                Hash = extensionInfo.Hash;
                FileLocation = extensionInfo.FileLocation;

                var fileInfo = FileVersionInfo.GetVersionInfo(FileLocation);
                Version = new Version(fileInfo.ProductVersion);
                Identifier = fileInfo.FileDescription;
                Description = fileInfo.Comments;
                Creator = fileInfo.CompanyName;
            }
            else if (IsExternal)
            {
                _contractor = new Contractor();
                var externalContractor = HNode.ConnectAsync("127.0.0.1", 8787).Result;
                
                HMessage initializationMessage = externalContractor.ReceiveAsync().Result;
                _contractor.Hotel = (HHotel)initializationMessage.ReadShort();

                _contractor.GameData = new HGameData(initializationMessage.ReadString());
                _contractor.GameData.UniqueId = initializationMessage.ReadString();

                _contractor.Connection = new ExtensionBridge(externalContractor, this);
            }
        }
コード例 #2
0
ファイル: HConnection.cs プロジェクト: scottstamp/Sulakore
        public HConnection()
        {
            _filters  = new HFilters();
            _triggers = new HTriggers(false);

            _resetHostLock    = new object();
            _disconnectLock   = new object();
            _sendToClientLock = new object();
            _sendToServerLock = new object();
        }
コード例 #3
0
ファイル: HSession.cs プロジェクト: SirJamal/Sulakore
        public HSession(string email, string password, HHotel hotel)
        {
            Email = email;
            Hotel = hotel;
            Password = password;

            Requester = new HRequest();
            Triggers = new HTriggers(false);

            _disconnectLock = new object();
            _hotelUri = new Uri(Hotel.ToUrl(true));
        }
コード例 #4
0
        /// <summary>
        /// Initializes a new instance of the <see cref="HConnection"/> class.
        /// </summary>
        public HConnection()
        {
            _disconnectLock = new object();

            Triggers         = new HTriggers(false);
            BlockedOutgoing  = new List <ushort>();
            BlockedIncoming  = new List <ushort>();
            ReplacedOutgoing = new Dictionary <ushort, byte[]>();
            ReplacedIncoming = new Dictionary <ushort, byte[]>();

            if (!File.Exists(_hostsFile))
            {
                File.Create(_hostsFile).Dispose();
            }

            File.SetAttributes(_hostsFile, FileAttributes.Normal);
        }
コード例 #5
0
ファイル: HConnection.cs プロジェクト: habb0/Sulakore
        /// <summary>
        /// Initializes a new instance of the <see cref="HConnection"/> class.
        /// </summary>
        public HConnection()
        {
            _disconnectLock = new object();

            Triggers = new HTriggers(false);
            BlockedOutgoing = new List<ushort>();
            BlockedIncoming = new List<ushort>();
            ReplacedOutgoing = new Dictionary<ushort, byte[]>();
            ReplacedIncoming = new Dictionary<ushort, byte[]>();

            if (!File.Exists(_hostsFile))
                File.Create(_hostsFile).Dispose();

            File.SetAttributes(_hostsFile, FileAttributes.Normal);
        }
コード例 #6
0
ファイル: HSession.cs プロジェクト: habb0/Sulakore
        public HSession(string email, string password, HHotel hotel)
        {
            Email = email;
            Hotel = hotel;
            Password = password;
            Triggers = new HTriggers(false);
            Cookies = new CookieContainer();

            _disconnectLock = new object();
            _hotelUri = new Uri(Hotel.ToUrl());
        }