public ZActor(ZContext context, ZAction action, params object[] args) : this(context, default(string), action, args) { var rnd0 = new byte[8]; using (var rng = new System.Security.Cryptography.RNGCryptoServiceProvider()) rng.GetNonZeroBytes(rnd0); this.Endpoint = string.Format("inproc://{0}", ZContext.Encoding.GetString(rnd0)); }
public ZActor(ZContext context, ZAction action, params object[] args) : this(context, default(string), action, args) { var rnd0 = new byte[8]; using (var rng = new RNGCryptoServiceProvider()) rng.GetBytes(rnd0); this.Endpoint = string.Format("inproc://{0}", ZContext.Encoding.GetString(rnd0)); }
public ZActor(ZContext context, ZAction action, params object[] args) : this(context, default(string), action, args) { var rnd0 = new byte[8]; new System.Security.Cryptography.RNGCryptoServiceProvider().GetNonZeroBytes(rnd0); this.Endpoint = string.Format("inproc://{0}", ZContext.Encoding.GetString(rnd0)); }
public ZActor(ZContext context, ZAction action, params object[] args) : this(context, default(string), action, args) { var rnd0 = new byte[8]; using (var rng = new System.Security.Cryptography.RNGCryptoServiceProvider()) rng.GetNonZeroBytes(rnd0); Endpoint = $"inproc://{ZContext.Encoding.GetString(rnd0)}"; }
public ZAction GetLastAction() { if (_lastAction != null && _lastAction.IsComplete()) { _lastAction = null; } return(_lastAction); }
public ZActor(ZContext context, string endpoint, ZAction action, params object[] args) { Context = context; Endpoint = endpoint; Action = action; Arguments = args; }
public void ResetActions() { foreach (var action in _actionsList) { action.End(); } _actionsList.Clear(); _lastAction = null; }
public ZActor(ZContext context, string endpoint, ZAction action, params object[] args) : base() { this.Context = context; this.Endpoint = endpoint; this.Action = action; this.Arguments = args; }
public ZAction AddAction(ZAction ta) { ZAction last = GetLastAction(); if (last != null) { last.AddAction(ta); } else { AddParalelAction(ta); } _lastAction = ta; return(ta); }
public void UpdateActions(float dt) { int index = 0; while (index < _actionsList.Count) { ZAction action = _actionsList[index]; if (action.IsComplete()) { action.End(); foreach (var actionChild in action.GetAAction()) { AddParalelAction(actionChild); } _actionsList.Remove(action); } else { index++; action.Update(dt); } } }
public override void Unload() { ZAction.UnloadAction(); }
public ZAction AddAction(ZAction ta) { _aAction.Add(ta); return(ta); }
public ZActionWorker() { _actionsList = new List <ZAction>(); _lastAction = null; }
public ZActor(string endpoint, ZAction action, params object[] args) : this(ZContext.Current, endpoint, action, args) { }
public ZActor(ZAction action, params object[] args) : this(ZContext.Current, action, args) { }
public ZAction AddParalelAction(ZAction ta) { ta.Start(); _actionsList.Add(ta); return(ta); }
public override void Load() { ZAction.LoadAction(); }
public ZEROWORLD() { Instance = this; ZAction.Initialize(); }
/// <summary> /// Lấy tất cả các quyền (chức năng) của người dùng /// </summary> /// <param name="userId">Id người dùng đăng nhập</param> /// <returns>Danh sách các quyền (chức năng)</returns> public List<ZAction> GetRights(Guid userId) { try { var a = from s in _db.Pol_UserRights join u in _db.Pol_Users on s.Pol_UserId equals u.Id join r in _db.Pol_Rights on s.Pol_RightId equals r.Id where s.Pol_UserId == userId select new { RightCode = r.Code, RightName = r.Name, RightDescript = r.Descript, s.Add, s.Edit, s.Delete, s.Default, s.Print, s.Access, s.Full, s.None }; var b = from s in _db.Pol_RoleRights join r in _db.Pol_Rights on s.Pol_RightId equals r.Id join ur in _db.Pol_UserRoles on s.Pol_RoleId equals ur.Pol_RoleId join u in _db.Pol_Users on ur.Pol_UserId equals u.Id where ur.Pol_User.Id == userId select new { RightCode = r.Code, RightName = r.Name, RightDescript = r.Descript, s.Add, s.Edit, s.Delete, s.Default, s.Print, s.Access, s.Full, s.None }; var tmp = a.Union(b); var lst = new List<ZAction>(); foreach (var res in tmp) { var z = new ZAction() { Code = res.RightCode, Add = res.Add, Edit = res.Edit, Delete = res.Delete, Default = res.Default, Print = res.Print, Access = res.Access, Full = res.Full, None = res.None }; lst.Add(z); } return lst; } catch { return null; } }