示例#1
0
 // 新增一个用户账户到在线客户端
 private void AddOnLine(NetAccount item)
 {
     lock (obj_lock)
     {
         all_accounts.Add(item);
     }
     UpdateOnlineClients( );
 }
示例#2
0
        private void NetComplex_ClientOnline(AsyncStateOne object1)
        {
            // 回发一条初始化数据的信息
            netComplex.Send(object1, 2, GetHistory( ));
            // 有客户端上限时触发方法
            NetAccount account = new NetAccount( )
            {
                Guid       = object1.ClientUniqueID,
                Ip         = object1.IpAddress,
                Name       = object1.LoginAlias,
                OnlineTime = DateTime.Now,
            };

            AddOnLine(account);
        }
示例#3
0
        private void NetComplex_ClientOnline(AppSession session)
        {
            // 回发一条初始化数据的信息
            netComplex.Send(session, 2, GetHistory( ));
            // 有客户端上限时触发方法
            NetAccount account = new NetAccount( )
            {
                Guid       = session.ClientUniqueID,
                Ip         = session.IpAddress,
                Name       = session.LoginAlias,
                OnlineTime = DateTime.Now,
            };

            AddOnLine(account);
        }