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); }
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); }
public override void OnTerminate(SSServerSession sess) { }
public override void OnHandlerMsg(SSServerSession sess, uint msgID, byte[] attach_datas, byte[] datas) { }
public override void OnEstablish(SSServerSession sess) { }
public abstract void OnTerminate(SSServerSession sess);
public abstract void OnEstablish(SSServerSession sess);
public abstract void SetLogicServer(SSServerSession sess);
public void SetSession(SSServerSession _sess) { session = _sess; }
public abstract void OnHandlerMsg(SSServerSession sess, UInt32 msgID, byte[] attach_datas, byte[] datas);