Exemplo n.º 1
0
        public SKoreExtensionView()
        {
            Contractor = new Contractor();
            Contractor.ExtensionAction += Contractor_ExtensionAction;

            _itemByHash = new Dictionary<string, ListViewItem>();
            _extensionByItem = new Dictionary<ListViewItem, ExtensionForm>();

            Contractor.LoadExtensions();
        }
Exemplo n.º 2
0
        public MainFrm()
        {
            InitializeComponent();

            Connection = new HConnection();
            Contractor = new Contractor(Connection);
            Handshaker = new HandshakeManager(this);
            TanjiConnect = new TanjiConnectFrm(this);
            PacketLogger = new PacketLoggerFrm(this);

            Connection.DataIncoming += Connection_DataIncoming;
            Connection.DataOutgoing += Connection_DataOutgoing;
        }
Exemplo n.º 3
0
        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);
            }
        }