Esempio n. 1
0
            public override Stm ProcessEntryExit1(Stm body)
            {
                Temp.Temp newTemp;
                for (int i = 0; i < 8; ++i)
                {
                    newTemp = new Temp.Temp();
                    body    = new SEQ(new MOVE(new TEMP(newTemp), new TEMP(Reg[16 + i])), body);
                    body    = new SEQ(body, new MOVE(new TEMP(Reg[16 + i]), new TEMP(newTemp)));
                }
                newTemp = new Temp.Temp();
                body    = new SEQ(new MOVE(new TEMP(newTemp), new TEMP(Reg[31])), body);
                body    = new SEQ(body, new MOVE(new TEMP(Reg[31]), new TEMP(newTemp)));

                int count = 0;

                for (AccessList ptr = Formals; ptr != null; ptr = ptr.Tail)
                {
                    if (ptr.Head is InReg)
                    {
                        body = new SEQ(new MOVE(ptr.Head.Exp(null), new TEMP(A(count))), body);
                        ++count;
                    }
                }
                for (; count < 4; count++)
                {
                    body = new SEQ(new MOVE(new TEMP(new Temp.Temp()), new TEMP(A(count))), body);
                }
                return(body);
            }
Esempio n. 2
0
        public List <List <UUID> > CreateAccessListArrayByFlag(AccessList flag)
        {
            List <List <UUID> > list = new List <List <UUID> >();
            int num = 0;

            list.Add(new List <UUID>());

            foreach (
                ParcelManager.ParcelAccessEntry entry in LandData.ParcelAccessList.Where(entry => entry.Flags == flag))
            {
                if (list[num].Count > ParcelManagementModule.LAND_MAX_ENTRIES_PER_PACKET)
                {
                    num++;
                    list.Add(new List <UUID>());
                }
                list[num].Add(entry.AgentID);
            }

            if (list[0].Count == 0)
            {
                list[num].Add(UUID.Zero);
            }

            return(list);
        }
Esempio n. 3
0
            public override Frame.Frame NewFrame(Temp.Label name, BoolList formals)
            {
                MipsFrame ret = new MipsFrame();

                ret.Name = name;
                AccessList ptr   = null;
                int        count = 0;

                for (BoolList f = formals; f != null; f = f.Tail)
                {
                    Access a;
                    if (count < 4 && !f.Head)
                    {
                        a = ret.AllocLocal(false);
                    }
                    else
                    {
                        a = ret.AllocLocal(true);
                    }
                    if (ret.Formals == null)
                    {
                        ptr = ret.Formals = new AccessList(a, null);
                    }
                    else
                    {
                        ptr = ptr.Tail = new AccessList(a, null);
                    }
                }
                AllFrames.Add(ret);
                return(ret);
            }
Esempio n. 4
0
        private void BindData()
        {
            int ForumID = 0;

            CategoryList.DataSource = YAF.Classes.Data.DB.category_list(PageContext.PageBoardID, null);
            CategoryList.DataBind();

            if (Request.QueryString ["f"] != null)
            {
                ForumID = Convert.ToInt32(Request.QueryString ["f"]);
                AccessList.DataSource = YAF.Classes.Data.DB.forumaccess_list(ForumID);
                AccessList.DataBind();
            }

            // Load forum's combo
            BindParentList();

            // Load forum's themes
            ListItem listheader = new ListItem();

            listheader.Text  = "Choose a theme";
            listheader.Value = "";

            AccessMaskID.DataBind();

            ThemeList.DataSource     = YafStaticData.Themes();
            ThemeList.DataTextField  = "Theme";
            ThemeList.DataValueField = "FileName";
            ThemeList.DataBind();
            ThemeList.Items.Insert(0, listheader);
        }
Esempio n. 5
0
        public List <LandAccessEntry> CreateAccessListArrayByFlag(AccessList flag)
        {
            ExpireAccessList();

            List <LandAccessEntry> list = new List <LandAccessEntry>();

            foreach (LandAccessEntry entry in LandData.ParcelAccessList)
            {
                if (entry.Flags == flag)
                {
                    list.Add(entry);
                }
            }
            if (list.Count == 0)
            {
                LandAccessEntry e = new LandAccessEntry();
                e.AgentID = UUID.Zero;
                e.Flags   = 0;
                e.Expires = 0;

                list.Add(e);
            }

            return(list);
        }
Esempio n. 6
0
            Temp.Temp TranslateExpr(CALL expr)
            {
                Call c = new Call();

                c.Name = new Label((expr.Func as NAME).Label);
                TempList args = null, ptr = null;

                for (ExpList exp = expr.Args; exp != null; exp = exp.Tail)
                {
                    Temp.Temp arg = TranslateExpr(exp.Head);
                    if (args == null)
                    {
                        ptr = args = new TempList(arg, null);
                    }
                    else
                    {
                        ptr = ptr.Tail = new TempList(arg, null);
                    }
                }
                c.Param = args;
                MipsFrame t = null;

                foreach (MipsFrame f in MipsFrame.AllFrames)
                {
                    if (c.Name.Lab == f.Name)
                    {
                        t = f;
                        break;
                    }
                }
                if (t == null)
                {
                    int count = 0;
                    for (ptr = c.Param; ptr != null; ptr = ptr.Tail)
                    {
                        InstrList.Add(new Move(Frame.A(count), ptr.Head));
                        ++count;
                    }
                }
                else
                {
                    int count = 0;
                    ptr = c.Param;
                    for (AccessList al = t.Formals; al != null; al = al.Tail, ptr = ptr.Tail)
                    {
                        if (al.Head is InReg)
                        {
                            InstrList.Add(new Move(t.A(count), ptr.Head));
                            ++count;
                        }
                        else
                        {
                            InstrList.Add(new Store(t.SP(), (al.Head as InFrame).Offset, ptr.Head));
                        }
                    }
                }
                InstrList.Add(c);
                return(Frame.RV());
            }
Esempio n. 7
0
        public override void Serialize(GenericWriter writer)
        {
            base.Serialize(writer);
            writer.Write((int)0);

            writer.Write(AccessList.Count);
            AccessList.ForEach(m => writer.Write(m));
        }
Esempio n. 8
0
 private void ClearAccessList()
 {
     if (AccessList != null)
     {
         AccessList.Clear();
         AccessList.TrimExcess();
         AccessList = null;
     }
 }
Esempio n. 9
0
        public override bool OnMoveOver(Mobile m)
        {
            if (Altar == null || m.AccessLevel > AccessLevel.GameMaster)
            {
                return(base.OnMoveOver(m));
            }

            if (AccessList != null && AccessList.Contains(m))
            {
                return(base.OnMoveOver(m));
            }

            return(true);
        }
        private void OpenCategory(AccessList category)
        {
            List <Access> categoryAccesses = category.Accesses;
            int           numberOfAccesses = categoryAccesses.Count;

            CategoryContent.Clear();
            CategoryContent.AddItems(numberOfAccesses);
            int i = 0;

            foreach (var access in categoryAccesses)
            {
                var accessButton = (GUI_AirlockElectronicsEntry)CategoryContent.Entries[i];
                accessButton.SetValues(access, this);
                i++;
            }
        }
Esempio n. 11
0
        public void AddOrUpdateAccess(User user, bool hasAccess)
        {
            if (AccessList.ContainsKey(user.Id))
            {
                AccessList[user.Id] = hasAccess;
            }
            else
            {
                AccessList.Add(user.Id, hasAccess);
            }

            if (hasAccess)
            {
                ServerContext.Current.Chat.AddOrUpdateChannelToUser(user, this, false);
            }
        }
Esempio n. 12
0
        public List <UUID> createAccessListArrayByFlag(AccessList flag)
        {
            List <UUID> list = new List <UUID>();

            foreach (ParcelManager.ParcelAccessEntry entry in landData.ParcelAccessList)
            {
                if (entry.Flags == flag)
                {
                    list.Add(entry.AgentID);
                }
            }
            if (list.Count == 0)
            {
                list.Add(UUID.Zero);
            }

            return(list);
        }
Esempio n. 13
0
        private static int GetContentLength(AccessList accessList)
        {
            int contentLength = 0;

            if (accessList.IsNormalized)
            {
                foreach ((_, IReadOnlySet <UInt256> indexes) in accessList.Data)
                {
                    contentLength += new AccessItemLengths(indexes.Count).SequenceLength;
                }
            }
            else
            {
                IReadOnlyCollection <object> orderQueue = accessList.OrderQueue;
                bool isOpen       = false;
                int  indexCounter = 0;
                foreach (object accessListEntry in orderQueue !)
                {
                    if (accessListEntry is Address)
                    {
                        if (isOpen)
                        {
                            contentLength += new AccessItemLengths(indexCounter).SequenceLength;
                            indexCounter   = 0;
                        }
                        else
                        {
                            isOpen = true;
                        }
                    }
                    else
                    {
                        indexCounter++;
                    }
                }

                if (isOpen)
                {
                    contentLength += new AccessItemLengths(indexCounter).SequenceLength;
                }
            }

            return(contentLength);
        }
Esempio n. 14
0
            public Level(Level p, Label n, BoolList f, bool std)
            {
                Parent  = p;
                Frame   = p.Frame.NewFrame(n, f);
                Formals = null;
                AccessList ptr = null;

                for (Frame.AccessList al = Frame.Formals; al != null; al = al.Tail)
                {
                    if (Formals == null)
                    {
                        ptr = Formals = new AccessList(new Access(this, al.Head), null);
                    }
                    else
                    {
                        ptr = ptr.Tail = new AccessList(new Access(this, al.Head), null);
                    }
                }
            }
Esempio n. 15
0
        private static long AccessListCost(Transaction transaction, IReleaseSpec releaseSpec)
        {
            long accessListCost = 0;

            if (transaction.AccessList is not null)
            {
                AccessList accessList = transaction.AccessList;
                if (releaseSpec.UseTxAccessLists)
                {
                    if (accessList.IsNormalized)
                    {
                        accessListCost += accessList.Data.Count * GasCostOf.AccessAccountListEntry;
                        accessListCost += accessList.Data.Sum(d => d.Value.Count) *
                                          GasCostOf.AccessStorageListEntry;
                    }
                    else
                    {
                        foreach (object o in accessList.OrderQueue !)
                        {
                            if (o is Address)
                            {
                                accessListCost += GasCostOf.AccessAccountListEntry;
                            }
                            else
                            {
                                accessListCost += GasCostOf.AccessStorageListEntry;
                            }
                        }
                    }
                }
                else
                {
                    throw new InvalidDataException(
                              $"Transaction with an access list received within the context of {releaseSpec.Name}");
                }
            }

            return(accessListCost);
        }
Esempio n. 16
0
        public void AddToAccessList(Mobile from)
        {
            if (!AccessList.Contains(from))
            {
                AccessList.Add(from);
            }

            if (ShameAltar.AllowParties)
            {
                Party p = Party.Get(from);

                if (p != null)
                {
                    foreach (PartyMemberInfo info in p.Members.Where(info => !AccessList.Contains(info.Mobile)))
                    {
                        AccessList.Add(info.Mobile);
                    }
                }
            }

            //Timer.DelayCall(TimeSpan.FromMinutes(ShameAltar.CoolDown), ClearAccessList);
        }
Esempio n. 17
0
        private async void Refresh()
        {
            var roleViewModels = await _userService.GetRoles();

            var roles = new List <RoleModel>();

            foreach (var item in roleViewModels)
            {
                var role = new RoleModel
                {
                    Id       = item.Id,
                    RoleName = item.Name,
                };

                roles.Add(role);
            }

            foreach (var item in roles)
            {
                item.IsChecked = AccessList.Contains(item.Id);
            }

            DataSource = new ObservableCollection <RoleModel>(roles);
        }
Esempio n. 18
0
        public List<List<UUID>> CreateAccessListArrayByFlag(AccessList flag)
        {
            List<List<UUID>> list = new List<List<UUID>>();
            int num = 0;
            list.Add(new List<UUID>());
            foreach (ParcelManager.ParcelAccessEntry entry in LandData.ParcelAccessList)
            {
                if (entry.Flags == flag)
                {
                    if (list[num].Count > ParcelManagementModule.LAND_MAX_ENTRIES_PER_PACKET)
                    {
                        num++; 
                        list.Add(new List<UUID>());
                    }
                    list[num].Add(entry.AgentID);
                }
            }
            if (list[0].Count == 0)
            {
                list[num].Add(UUID.Zero);
            }

            return list;
        }
Esempio n. 19
0
        public List<UUID>  CreateAccessListArrayByFlag(AccessList flag)
        {
            List<UUID> list = new List<UUID>();
            foreach (ParcelManager.ParcelAccessEntry entry in LandData.ParcelAccessList)
            {
                if (entry.Flags == flag)
                {
                   list.Add(entry.AgentID);
                }
            }
            if (list.Count == 0)
            {
                list.Add(UUID.Zero);
            }

            return list;
        }
Esempio n. 20
0
        /// <summary>
        /// Request the access list for a single parcel
        /// </summary>
        /// <param name="simulator">Simulator containing the parcel</param>
        /// <param name="localID">Simulator-local ID of the parcel</param>
        /// <param name="sequenceID">An arbitrary integer that will be returned
        /// with the ParcelAccessList reply, useful for distinguishing between
        /// multiple simultaneous requests</param>
        /// <param name="flags"></param>
        public void RequestParcelAccessList(Simulator simulator, int localID, AccessList flags, int sequenceID)
        {
            ParcelAccessListRequestPacket request = new ParcelAccessListRequestPacket();

            request.AgentData.AgentID = Client.Self.AgentID;
            request.AgentData.SessionID = Client.Self.SessionID;
            request.Data.LocalID = localID;
            request.Data.Flags = (uint)flags;
            request.Data.SequenceID = sequenceID;

            Client.Network.SendPacket(request, simulator);
        }
Esempio n. 21
0
        public List<LandAccessEntry>  CreateAccessListArrayByFlag(AccessList flag)
        {
            ExpireAccessList();

            List<LandAccessEntry> list = new List<LandAccessEntry>();
            foreach (LandAccessEntry entry in LandData.ParcelAccessList)
            {
                if (entry.Flags == flag)
                   list.Add(entry);
            }
            if (list.Count == 0)
            {
                LandAccessEntry e = new LandAccessEntry();
                e.AgentID = UUID.Zero;
                e.Flags = 0;
                e.Expires = 0;

                list.Add(e);
            }

            return list;
        }
Esempio n. 22
0
 public AccessList(Access head, AccessList tail)
 {
     Head = head;
     Tail = tail;
 }
Esempio n. 23
0
 public Level(Level p, Label n, BoolList f, bool std)
 {
     Parent = p;
     Frame = p.Frame.NewFrame(n, f);
     Formals = null;
     AccessList ptr = null;
     for (Frame.AccessList al = Frame.Formals; al != null; al = al.Tail)
     {
         if (Formals == null)
             ptr = Formals = new AccessList(new Access(this, al.Head), null);
         else
             ptr = ptr.Tail = new AccessList(new Access(this, al.Head), null);
     }
 }
Esempio n. 24
0
        public static IEnumerable <(string, AccessList)> TestCaseSource()
        {
            yield return("null", null);

            HashSet <UInt256> indexes = new HashSet <UInt256>();
            Dictionary <Address, IReadOnlySet <UInt256> > data = new Dictionary <Address, IReadOnlySet <UInt256> >();

            // yield return ("empty", new AccessList(data)); <-- null and empty are equivalent here
            //
            indexes = new HashSet <UInt256>();
            data    = new Dictionary <Address, IReadOnlySet <UInt256> >();
            data.Add(TestItem.AddressA, indexes);
            yield return("no storage", new AccessList(data));

            indexes = new HashSet <UInt256>();
            data    = new Dictionary <Address, IReadOnlySet <UInt256> >();
            data.Add(TestItem.AddressA, indexes);
            data.Add(TestItem.AddressB, indexes);
            yield return("no storage 2", new AccessList(data));

            indexes = new HashSet <UInt256>();
            data    = new Dictionary <Address, IReadOnlySet <UInt256> >();
            data.Add(TestItem.AddressA, indexes);
            indexes.Add(1);
            yield return("1-1", new AccessList(data));

            indexes = new HashSet <UInt256>();
            data    = new Dictionary <Address, IReadOnlySet <UInt256> >();
            data.Add(TestItem.AddressA, indexes);
            indexes.Add(1);
            indexes.Add(2);
            yield return("1-2", new AccessList(data));

            indexes = new HashSet <UInt256>();
            data    = new Dictionary <Address, IReadOnlySet <UInt256> >();
            indexes.Add(1);
            indexes.Add(2);
            data.Add(TestItem.AddressA, indexes);
            data.Add(TestItem.AddressB, indexes);
            yield return("2-2", new AccessList(data));

            indexes = new HashSet <UInt256>();
            var indexes2 = new HashSet <UInt256>();

            data = new Dictionary <Address, IReadOnlySet <UInt256> >();
            indexes.Add(1);
            indexes2.Add(2);
            data.Add(TestItem.AddressA, indexes);
            data.Add(TestItem.AddressB, indexes2);
            AccessList accessList = new AccessList(data,
                                                   new Queue <object>(new List <object> {
                TestItem.AddressA, (UInt256)1, TestItem.AddressB, (UInt256)2
            }));

            yield return("with order queue", accessList);

            indexes  = new HashSet <UInt256>();
            indexes2 = new HashSet <UInt256>();
            data     = new Dictionary <Address, IReadOnlySet <UInt256> >();
            indexes.Add(1);
            indexes2.Add(2);
            data.Add(TestItem.AddressA, indexes);
            data.Add(TestItem.AddressB, indexes2);
            accessList = new AccessList(data,
                                        new Queue <object>(new List <object> {
                TestItem.AddressA, (UInt256)1, (UInt256)1, TestItem.AddressB, (UInt256)2, TestItem.AddressB, (UInt256)2
            }));
            yield return("with order queue and duplicates", accessList);
        }
Esempio n. 25
0
        private void LoadDoorInf(int aid)
        {
            AccessList_ = new List <AccessModel>();

            try
            {
                string strSQL = "";
                if (aid != 0)
                {
                    strSQL = "select * from  XXCLOUD.dbo.T_MJAPMachineInf where AId='" + aid + "' ";
                }
                else
                {
                    //全部区域
                    strSQL = "select * from  XXCLOUD.dbo.T_MJAPMachineInf  ";
                }
                DataTable myTable = SQLHelper.DTQuery(strSQL);
                if (myTable.Rows.Count > 0)
                {
                    DoorCount = myTable.Rows.Count;//保存总门数

                    for (int i = 0; i < myTable.Rows.Count; i++)
                    {
                        string MSNo       = myTable.Rows[i]["MSNo"].ToString().Trim();
                        string MIPAddress = myTable.Rows[i]["MIPAddress"].ToString();
                        string MCommType  = myTable.Rows[i]["MCommType"].ToString().Trim();
                        uint   MCommPort  = Convert.ToUInt32(myTable.Rows[i]["MCommPort"].ToString().Trim());
                        string MCommPwd   = myTable.Rows[i]["MCommPwd"].ToString().Trim();

                        if (!isExist(MSNo + ""))
                        {
                            UpdateFimware UpdateSys1 = new UpdateFimware();
                            AcsTcpClass   TcpipObj1  = new AcsTcpClass(true);
                            TcpipObj1.OnEventHandler  += XXY_VisitorMJAsst.D_RemoterControlFrm.eventHandler;
                            TcpipObj1.OnStatusHandler += XXY_VisitorMJAsst.D_RemoterControlFrm.statusHandler;
                            TcpipObj1.OnDisconnect    += XXY_VisitorMJAsst.D_RemoterControlFrm.disconnect;
                            //TcpipObj.OnDataDebug += XXY_VisitorMJAsst.D_RemoterControlFrm.showHexMsg;
                            bool blIsActive = TcpipObj1.SetControl(1, 2, false, 0, 10, 180, 5, false, false, "1234578", "ab", "cd", "ef123");

                            var model = new AccessModel()
                            {
                                MSNo      = MSNo + "",
                                IPAddress = myTable.Rows[i]["MIPAddress"].ToString().Trim(),
                                MCommPort = MCommPort + "",
                                MCommPwd  = MCommPwd,
                                MCommType = MCommType,
                                AId       = aid,
                                IsActive  = true,

                                TcpipObj  = TcpipObj1,
                                UpdateSys = UpdateSys1,
                            };

                            if (TcpipObj1.OpenIP(myTable.Rows[i]["MIPAddress"].ToString().Trim(), Convert.ToInt32(myTable.Rows[i]["MCommPort"].ToString().Trim()), MCommPwd) == true)
                            {
                                // MessageBox.Show ("连接成功");
                            }
                            else
                            {
                                // MessageBox.Show("连接失败");
                            }
                            AccessList.Add(model);
                        }
                    }
                }
                else
                {
                    //没有控制器及其门信息
                }
            }
            catch (Exception exp)
            {
                MessageBox.Show(exp.ToString());
            }
        }
Esempio n. 26
0
 public AccessList(Access head, AccessList tail)
 {
     Head = head;
     Tail = tail;
 }
 public TransactionBuilder <T> WithAccessList(AccessList accessList)
 {
     TestObjectInternal.AccessList = accessList;
     TestObjectInternal.ChainId    = TestObjectInternal.Signature?.ChainId ?? TestObjectInternal.ChainId;
     return(this);
 }
Esempio n. 28
0
        public List<List<UUID>> CreateAccessListArrayByFlag(AccessList flag)
        {
            List<List<UUID>> list = new List<List<UUID>>();
            int num = 0;
            list.Add(new List<UUID>());
//#if (!ISWIN)
//            foreach (ParcelManager.ParcelAccessEntry entry in LandData.ParcelAccessList)
 //           {
 //              if (entry.Flags == flag)
 //               {
 //                   if (list[num].Count > ParcelManagementModule.LAND_MAX_ENTRIES_PER_PACKET)
 //                   {
 //                       num++;
 //                       list.Add(new List<UUID>());
 //                   }
 //                   list[num].Add(entry.AgentID);
 //               }
//            }
//#else
            foreach (ParcelManager.ParcelAccessEntry entry in LandData.ParcelAccessList.Where(entry => entry.Flags == flag))
            {
                if (list[num].Count > ParcelManagementModule.LAND_MAX_ENTRIES_PER_PACKET)
                {
                    num++;
                    list.Add(new List<UUID>());
                }
                list[num].Add(entry.AgentID);
            }
//#endif
            if (list[0].Count == 0)
            {
                list[num].Add(UUID.Zero);
            }

            return list;
        }
Esempio n. 29
0
 public static AccessListItemForRpc[] FromAccessList(AccessList accessList) =>
 accessList.Data.Select(kvp => new AccessListItemForRpc(kvp.Key, kvp.Value)).ToArray();