Exemplo n.º 1
0
 // 新增一个用户账户到在线客户端
 private void AddOnLine(NetAccount item)
 {
     lock (obj_lock)
     {
         all_accounts.Add(item);
     }
     UpdateOnlineClients();
 }
Exemplo n.º 2
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);
        }