Exemple #1
0
        public static InvitePackage OpenInvite(byte[] decrypted, G2Protocol protocol)
        {
            // if we get down here, opening invite was success

            MemoryStream mem    = new MemoryStream(decrypted);
            PacketStream stream = new PacketStream(mem, protocol, FileAccess.Read);

            InvitePackage package = new InvitePackage();

            G2Header root = null;

            while (stream.ReadPacket(ref root))
            {
                if (root.Name == InvitePacket.Info)
                {
                    package.Info = OneWayInvite.Decode(root);
                }

                if (root.Name == InvitePacket.Contact)
                {
                    package.Contacts.Add(DhtContact.ReadPacket(root));
                }

                if (root.Name == InvitePacket.WebCache)
                {
                    package.Caches.Add(WebCache.Decode(root));
                }
            }

            return(package);
        }
Exemple #2
0
        public void ProcessInvite(InvitePackage invite)
        {
            // add nodes to ipcache in processing
            foreach (DhtContact contact in invite.Contacts)
            {
                Network.Cache.AddContact(contact);
            }

            foreach (WebCache cache in invite.Caches)
            {
                Network.Cache.AddWebCache(cache);
            }
        }
Exemple #3
0
        public CreateUser(AppContext app, InvitePackage invite)
        {
            InitializeComponent();

            App = app;
            Context = app.Context;
            Invite = invite;
            OpName = invite.Info.OpName;
            OpAccess = invite.Info.OpAccess;

            OpNameLabel.Text = OpName;
            TextName.Text = invite.Info.UserName;

            BrowseLink.Text = (Context.Sim == null) ? Application.StartupPath : Context.Sim.Internet.LoadedPath;
        }
Exemple #4
0
        public void ProcessInvite(InvitePackage invite)
        {
            // add nodes to ipcache in processing
            foreach (DhtContact contact in invite.Contacts)
                Network.Cache.AddContact(contact);

            foreach (WebCache cache in invite.Caches)
                Network.Cache.AddWebCache(cache);
        }
Exemple #5
0
        public static InvitePackage OpenInvite(byte[] decrypted, G2Protocol protocol)
        {
            // if we get down here, opening invite was success

            MemoryStream mem = new MemoryStream(decrypted);
            PacketStream stream = new PacketStream(mem, protocol, FileAccess.Read);

            InvitePackage package = new InvitePackage();

            G2Header root = null;
            while (stream.ReadPacket(ref root))
            {
                if (root.Name == InvitePacket.Info)
                    package.Info = OneWayInvite.Decode(root);

                if (root.Name == InvitePacket.Contact)
                    package.Contacts.Add(DhtContact.ReadPacket(root));

                if (root.Name == InvitePacket.WebCache)
                    package.Caches.Add(WebCache.Decode(root));
            }

            return package;
        }