//-------------------------------------------------------------------------------------------- TSession* TManagerSession::NewSession(TIP_Port& ip_port, INetTransport* pTransport) { mLastID_Session++;// нет проверки на совпадение, unsigned int 4 млрд - слишком много TSession* pSession = new TSession(mTimeLiveSession); pSession->SetTransport(pTransport); pSession->SetInfo(ip_port); pSession->SetID(mLastID_Session); mNavigateSession->Add(pSession); return pSession; }
//-------------------------------------------------------------------------------------------- TSession* TSessionManager::NewSession( TIP_Port& ip_port, INetTransport* pTransport, bool connectTo_elseFrom ) { auto state = connectTo_elseFrom ? TSession::StateWaitConnectTo : TSession::StateWaitLogin; mLastID_Session++;// нет проверки на совпадение, unsigned int 4 млрд - слишком много TSession* pSession = new TSession( state, mTimeLiveSession ); pSession->SetTransport( pTransport ); pSession->SetInfo( ip_port ); pSession->SetID( mLastID_Session ); mNavigateSession->Add( pSession ); return pSession; }