void OnClosed(ClientSession session, CloseReason reason) { MainLogger.Info(string.Format("세션 번호 {0} 접속해제: {1}", session.SessionID, reason.ToString())); var packet = ServerPacketData.MakeNTFInConnectOrDisConnectClientPacket(false, session.SessionID, session.SessionIndex); Distribute(packet); session.FreeSessionIndex(session.SessionIndex); }
void OnConnected(ClientSession session) { //옵션의 최대 연결 수를 넘으면 SuperSocket이 바로 접속을 짤라버린다. 즉 이 OnConneted 함수가 호출되지 않는다 session.AllocSessionIndex(); MainLogger.Info(string.Format("세션 번호 {0} 접속", session.SessionID)); var packet = ServerPacketData.MakeNTFInConnectOrDisConnectClientPacket(true, session.SessionID, session.SessionIndex); Distribute(packet); }