Esempio n. 1
0
    public ISession CreateSession()
    {
        ++session_id;
        Coder coder = new Coder();

        SSServerSession session = new SSServerSession();

        session.SetSessID(session_id);
        session.SetCoder(coder);
        session.SetSessionFactory(this);
        Log.InfoAf("[SSServerSessionMgr] CreateSession={0}", session.GetSessID());
        return(session);
    }
Esempio n. 2
0
    public void Connect(UInt64 remote_server_id, UInt32 remote_server_type, string remote_server_type_str, string remote_ip, UInt32 remote_port, string remote_token)
    {
        SSServerSession session = (SSServerSession)CreateSession();

        session.SetRemoteServerID(remote_server_id);
        session.SetRemoteServerType(remote_server_type);
        session.SetRemoteServerTypeStr(remote_server_type_str);
        session.SetRemoteToken(remote_token);
        session.SetConnectType();

        ConnectCache cache = new ConnectCache(session.GetSessID(), remote_server_id, remote_server_type, remote_server_type_str, Util.GetMillSecond() + mgr_beat_heart_max_time);

        connect_cache_dict[remote_server_id] = cache;
        Log.InfoAf("[SSServerSessionMgr] ConnectCache Add SessionID={0},ServerID={1}", session.GetSessID(), remote_server_id);

        Net.Instance.Connect(remote_ip, remote_port, session);
    }
Esempio n. 3
0
 public override void OnTerminate(SSServerSession sess)
 {
 }
Esempio n. 4
0
 public override void OnHandlerMsg(SSServerSession sess, uint msgID, byte[] attach_datas, byte[] datas)
 {
 }
Esempio n. 5
0
 public override void OnEstablish(SSServerSession sess)
 {
 }
Esempio n. 6
0
 public abstract void OnTerminate(SSServerSession sess);
Esempio n. 7
0
 public abstract void OnEstablish(SSServerSession sess);
Esempio n. 8
0
 public abstract void SetLogicServer(SSServerSession sess);
Esempio n. 9
0
 public void SetSession(SSServerSession _sess)
 {
     session = _sess;
 }
Esempio n. 10
0
 public abstract void OnHandlerMsg(SSServerSession sess, UInt32 msgID, byte[] attach_datas, byte[] datas);