public override void OnExecute(Database refDB) { DBRecordSet dbRecordSet = new DBRecordSet(refDB); if (!ExecuteRepeat(ref dbRecordSet, GetSQL((int)SQL_INDEX.INSERT_LOG_SERVER_MONITORING))) { FileLog.Instance.Write("Failed! DBTaskInsertLogServerMonitoring, {0}", refDB.LastErrorMsg); return; } SetTaskSuccess(); dbRecordSet.Close(); }
public virtual bool GetServerStatusInfo_Sync(int nWorldID, int nServerID, out bool bIsRun, out bool bIsServable, out short nPlayerCount) { string strSQL = "EXEC dbo.USP_RZ_SERVER_GET_STATUS_INFO {0}, {1}"; strSQL = string.Format(strSQL, nWorldID, nServerID); bIsRun = false; bIsServable = false; nPlayerCount = 0; DBRecordSet rs = new DBRecordSet(m_syncDB); if (rs.Open(strSQL) == false) { m_strLastError = m_syncDB.LastErrorMsg; rs.Close(); return(false); } if (rs.HasRows == false) { rs.Close(); return(false); } int nIsRun; if (rs.GetInt32("IS_RUN", out nIsRun) == false) { rs.Close(); return(false); } if (rs.GetBool("SERVABLE", out bIsServable) == false) { rs.Close(); return(false); } bIsRun = (nIsRun == 1 ? true : false); rs.Close(); return(true); }