Example #1
0
        /// <summary>向所有在线家族成员推送</summary>
        public void FamilyMemberAllPush(tg_family_member member, tg_family_log log)
        {
            var _member = view_user_role_family_member.GetEntityByUserId(member.userid);
            var list    = Variable.OnlinePlayer.Select(m => m.Value as TGGSession)
                          .Where(m => m.Player.Family.fid == member.fid).ToList();//同家族

            foreach (var item in list)
            {
                var token = new CancellationTokenSource();
                var obj   = new FamilyLogPushObject
                {
                    session     = item,
                    log         = log,
                    player_name = _member.player_name,
                };
                Task.Factory.StartNew(m =>
                {
                    var _obj = m as FamilyLogPushObject;
                    if (_obj == null)
                    {
                        return;
                    }
                    FAMILY_LOG_PUSH.GetInstance().CommandStart(_obj.session, _obj.log, _obj.player_name);
                }, obj, token.Token);
            }
        }
Example #2
0
 /// <summary> FAMILY_LOG_PUSH单体模式 </summary>
 public static FAMILY_LOG_PUSH GetInstance()
 {
     return(ObjInstance ?? (ObjInstance = new FAMILY_LOG_PUSH()));
 }