Thread: [jetrix-cvs] SF.net SVN: jetrix:[729] monitor/trunk
Brought to you by:
smanux
From: <sm...@us...> - 2008-08-18 16:37:07
|
Revision: 729 http://jetrix.svn.sourceforge.net/jetrix/?rev=729&view=rev Author: smanux Date: 2008-08-18 16:35:43 +0000 (Mon, 18 Aug 2008) Log Message: ----------- New project: Jetrix Monitor Added Paths: ----------- monitor/trunk/lib/ monitor/trunk/lib/geoip-1.2.2.jar monitor/trunk/pom.xml monitor/trunk/src/ monitor/trunk/src/main/ monitor/trunk/src/main/java/ monitor/trunk/src/main/java/net/ monitor/trunk/src/main/java/net/jetrix/ monitor/trunk/src/main/java/net/jetrix/monitor/ monitor/trunk/src/main/java/net/jetrix/monitor/NetworkUtils.java monitor/trunk/src/main/java/net/jetrix/monitor/ServerInfo.java monitor/trunk/src/main/java/net/jetrix/monitor/ServerStats.java monitor/trunk/src/main/java/net/jetrix/monitor/StyleUtils.java monitor/trunk/src/main/java/net/jetrix/monitor/dao/ monitor/trunk/src/main/java/net/jetrix/monitor/dao/IpToCountryDao.java monitor/trunk/src/main/java/net/jetrix/monitor/dao/ServerInfoDao.java monitor/trunk/src/main/java/net/jetrix/monitor/dao/ServerStatsDao.java monitor/trunk/src/main/java/net/jetrix/monitor/job/ monitor/trunk/src/main/java/net/jetrix/monitor/job/GraphGenerationJob.java monitor/trunk/src/main/java/net/jetrix/monitor/job/ServerSurveyJob.java monitor/trunk/src/main/java/net/jetrix/monitor/job/TransactionalQuartzJob.java monitor/trunk/src/main/resources/ monitor/trunk/src/main/resources/GeoIP.dat monitor/trunk/src/main/resources/applicationContext.xml monitor/trunk/src/main/resources/hibernate-mapping.xml monitor/trunk/src/main/resources/hibernate.cfg.xml monitor/trunk/src/main/resources/quartzContext.xml monitor/trunk/src/main/webapp/ monitor/trunk/src/main/webapp/META-INF/ monitor/trunk/src/main/webapp/META-INF/context.xml monitor/trunk/src/main/webapp/WEB-INF/ monitor/trunk/src/main/webapp/WEB-INF/classes/ monitor/trunk/src/main/webapp/WEB-INF/classes/logging.properties monitor/trunk/src/main/webapp/WEB-INF/lib/ monitor/trunk/src/main/webapp/WEB-INF/web.xml monitor/trunk/src/main/webapp/favicon.ico monitor/trunk/src/main/webapp/images/ monitor/trunk/src/main/webapp/images/flags/ monitor/trunk/src/main/webapp/images/flags/24/ monitor/trunk/src/main/webapp/images/flags/24/ASEAN.png monitor/trunk/src/main/webapp/images/flags/24/Afghanistan.png monitor/trunk/src/main/webapp/images/flags/24/African Union(OAS).png monitor/trunk/src/main/webapp/images/flags/24/Albania.png monitor/trunk/src/main/webapp/images/flags/24/Algeria.png monitor/trunk/src/main/webapp/images/flags/24/American Samoa.png monitor/trunk/src/main/webapp/images/flags/24/Andorra.png monitor/trunk/src/main/webapp/images/flags/24/Angola.png monitor/trunk/src/main/webapp/images/flags/24/Anguilla.png monitor/trunk/src/main/webapp/images/flags/24/Antarctica.png monitor/trunk/src/main/webapp/images/flags/24/Antigua & Barbuda.png monitor/trunk/src/main/webapp/images/flags/24/Arab League.png monitor/trunk/src/main/webapp/images/flags/24/Argentina.png monitor/trunk/src/main/webapp/images/flags/24/Armenia.png monitor/trunk/src/main/webapp/images/flags/24/Aruba.png monitor/trunk/src/main/webapp/images/flags/24/Australia.png monitor/trunk/src/main/webapp/images/flags/24/Austria.png monitor/trunk/src/main/webapp/images/flags/24/Azerbaijan.png monitor/trunk/src/main/webapp/images/flags/24/Bahamas.png monitor/trunk/src/main/webapp/images/flags/24/Bahrain.png monitor/trunk/src/main/webapp/images/flags/24/Bangladesh.png monitor/trunk/src/main/webapp/images/flags/24/Barbados.png monitor/trunk/src/main/webapp/images/flags/24/Belarus.png monitor/trunk/src/main/webapp/images/flags/24/Belgium.png monitor/trunk/src/main/webapp/images/flags/24/Belize.png monitor/trunk/src/main/webapp/images/flags/24/Benin.png monitor/trunk/src/main/webapp/images/flags/24/Bermuda.png monitor/trunk/src/main/webapp/images/flags/24/Bhutan.png monitor/trunk/src/main/webapp/images/flags/24/Bolivia.png monitor/trunk/src/main/webapp/images/flags/24/Bosnia & Herzegovina.png monitor/trunk/src/main/webapp/images/flags/24/Botswana.png monitor/trunk/src/main/webapp/images/flags/24/Brazil.png monitor/trunk/src/main/webapp/images/flags/24/Brunei.png monitor/trunk/src/main/webapp/images/flags/24/Bulgaria.png monitor/trunk/src/main/webapp/images/flags/24/Burkina Faso.png monitor/trunk/src/main/webapp/images/flags/24/Burundi.png monitor/trunk/src/main/webapp/images/flags/24/CARICOM.png monitor/trunk/src/main/webapp/images/flags/24/CIS.png monitor/trunk/src/main/webapp/images/flags/24/Cambodja.png monitor/trunk/src/main/webapp/images/flags/24/Cameroon.png monitor/trunk/src/main/webapp/images/flags/24/Canada.png monitor/trunk/src/main/webapp/images/flags/24/Cape Verde.png monitor/trunk/src/main/webapp/images/flags/24/Cayman Islands.png monitor/trunk/src/main/webapp/images/flags/24/Central African Republic.png monitor/trunk/src/main/webapp/images/flags/24/Chad.png monitor/trunk/src/main/webapp/images/flags/24/Chile.png monitor/trunk/src/main/webapp/images/flags/24/China.png monitor/trunk/src/main/webapp/images/flags/24/Colombia.png monitor/trunk/src/main/webapp/images/flags/24/Commonwealth.png monitor/trunk/src/main/webapp/images/flags/24/Comoros.png monitor/trunk/src/main/webapp/images/flags/24/Congo-Brazzaville.png monitor/trunk/src/main/webapp/images/flags/24/Congo-Kinshasa.png monitor/trunk/src/main/webapp/images/flags/24/Cook Islands.png monitor/trunk/src/main/webapp/images/flags/24/Costa Rica.png monitor/trunk/src/main/webapp/images/flags/24/Cote d'Ivoire.png monitor/trunk/src/main/webapp/images/flags/24/Croatia.png monitor/trunk/src/main/webapp/images/flags/24/Cuba.png monitor/trunk/src/main/webapp/images/flags/24/Cyprus.png monitor/trunk/src/main/webapp/images/flags/24/Czech Republic.png monitor/trunk/src/main/webapp/images/flags/24/Denmark.png monitor/trunk/src/main/webapp/images/flags/24/Djibouti.png monitor/trunk/src/main/webapp/images/flags/24/Dominica.png monitor/trunk/src/main/webapp/images/flags/24/Dominican Republic.png monitor/trunk/src/main/webapp/images/flags/24/East Timor.png monitor/trunk/src/main/webapp/images/flags/24/Egypt.png monitor/trunk/src/main/webapp/images/flags/24/El Salvador.png monitor/trunk/src/main/webapp/images/flags/24/England.png monitor/trunk/src/main/webapp/images/flags/24/Equador.png monitor/trunk/src/main/webapp/images/flags/24/Equatorial Guinea.png monitor/trunk/src/main/webapp/images/flags/24/Eritrea.png monitor/trunk/src/main/webapp/images/flags/24/Estonia.png monitor/trunk/src/main/webapp/images/flags/24/Ethiopia.png monitor/trunk/src/main/webapp/images/flags/24/European Union.png monitor/trunk/src/main/webapp/images/flags/24/Faroes.png monitor/trunk/src/main/webapp/images/flags/24/Fiji.png monitor/trunk/src/main/webapp/images/flags/24/Finland.png monitor/trunk/src/main/webapp/images/flags/24/France.png monitor/trunk/src/main/webapp/images/flags/24/Gabon.png monitor/trunk/src/main/webapp/images/flags/24/Gambia.png monitor/trunk/src/main/webapp/images/flags/24/Georgia.png monitor/trunk/src/main/webapp/images/flags/24/Germany.png monitor/trunk/src/main/webapp/images/flags/24/Ghana.png monitor/trunk/src/main/webapp/images/flags/24/Gibraltar.png monitor/trunk/src/main/webapp/images/flags/24/Greece.png monitor/trunk/src/main/webapp/images/flags/24/Greenland.png monitor/trunk/src/main/webapp/images/flags/24/Grenada.png monitor/trunk/src/main/webapp/images/flags/24/Guadeloupe.png monitor/trunk/src/main/webapp/images/flags/24/Guam.png monitor/trunk/src/main/webapp/images/flags/24/Guatemala.png monitor/trunk/src/main/webapp/images/flags/24/Guernsey.png monitor/trunk/src/main/webapp/images/flags/24/Guinea-Bissau.png monitor/trunk/src/main/webapp/images/flags/24/Guinea.png monitor/trunk/src/main/webapp/images/flags/24/Guyana.png monitor/trunk/src/main/webapp/images/flags/24/Haiti.png monitor/trunk/src/main/webapp/images/flags/24/Honduras.png monitor/trunk/src/main/webapp/images/flags/24/Hong Kong.png monitor/trunk/src/main/webapp/images/flags/24/Hungary.png monitor/trunk/src/main/webapp/images/flags/24/Iceland.png monitor/trunk/src/main/webapp/images/flags/24/India.png monitor/trunk/src/main/webapp/images/flags/24/Indonesia.png monitor/trunk/src/main/webapp/images/flags/24/Iran.png monitor/trunk/src/main/webapp/images/flags/24/Iraq.png monitor/trunk/src/main/webapp/images/flags/24/Ireland.png monitor/trunk/src/main/webapp/images/flags/24/Islamic Conference.png monitor/trunk/src/main/webapp/images/flags/24/Israel.png monitor/trunk/src/main/webapp/images/flags/24/Italy.png monitor/trunk/src/main/webapp/images/flags/24/Jamaica.png monitor/trunk/src/main/webapp/images/flags/24/Jersey.png monitor/trunk/src/main/webapp/images/flags/24/Jordan.png monitor/trunk/src/main/webapp/images/flags/24/Kazakhstan.png monitor/trunk/src/main/webapp/images/flags/24/Kenya.png monitor/trunk/src/main/webapp/images/flags/24/Kiribati.png monitor/trunk/src/main/webapp/images/flags/24/Kosovo.png monitor/trunk/src/main/webapp/images/flags/24/Kuwait.png monitor/trunk/src/main/webapp/images/flags/24/Kyrgyzstan.png monitor/trunk/src/main/webapp/images/flags/24/Laos.png monitor/trunk/src/main/webapp/images/flags/24/Latvia.png monitor/trunk/src/main/webapp/images/flags/24/Lebanon.png monitor/trunk/src/main/webapp/images/flags/24/Lesotho.png monitor/trunk/src/main/webapp/images/flags/24/Liberia.png monitor/trunk/src/main/webapp/images/flags/24/Libya.png monitor/trunk/src/main/webapp/images/flags/24/Liechtenstein.png monitor/trunk/src/main/webapp/images/flags/24/Lithuania.png monitor/trunk/src/main/webapp/images/flags/24/Luxembourg.png monitor/trunk/src/main/webapp/images/flags/24/Macao.png monitor/trunk/src/main/webapp/images/flags/24/Macedonia.png monitor/trunk/src/main/webapp/images/flags/24/Madagascar.png monitor/trunk/src/main/webapp/images/flags/24/Malawi.png monitor/trunk/src/main/webapp/images/flags/24/Malaysia.png monitor/trunk/src/main/webapp/images/flags/24/Maldives.png monitor/trunk/src/main/webapp/images/flags/24/Mali.png monitor/trunk/src/main/webapp/images/flags/24/Malta.png monitor/trunk/src/main/webapp/images/flags/24/Marshall Islands.png monitor/trunk/src/main/webapp/images/flags/24/Martinique.png monitor/trunk/src/main/webapp/images/flags/24/Mauritania.png monitor/trunk/src/main/webapp/images/flags/24/Mauritius.png monitor/trunk/src/main/webapp/images/flags/24/Mexico.png monitor/trunk/src/main/webapp/images/flags/24/Micronesia.png monitor/trunk/src/main/webapp/images/flags/24/Moldova.png monitor/trunk/src/main/webapp/images/flags/24/Monaco.png monitor/trunk/src/main/webapp/images/flags/24/Mongolia.png monitor/trunk/src/main/webapp/images/flags/24/Montenegro.png monitor/trunk/src/main/webapp/images/flags/24/Montserrat.png monitor/trunk/src/main/webapp/images/flags/24/Morocco.png monitor/trunk/src/main/webapp/images/flags/24/Mozambique.png monitor/trunk/src/main/webapp/images/flags/24/Myanmar(Burma).png monitor/trunk/src/main/webapp/images/flags/24/NATO.png monitor/trunk/src/main/webapp/images/flags/24/Namibia.png monitor/trunk/src/main/webapp/images/flags/24/Nauru.png monitor/trunk/src/main/webapp/images/flags/24/Nepal.png monitor/trunk/src/main/webapp/images/flags/24/Netherlands Antilles.png monitor/trunk/src/main/webapp/images/flags/24/Netherlands.png monitor/trunk/src/main/webapp/images/flags/24/New Caledonia.png monitor/trunk/src/main/webapp/images/flags/24/New Zealand.png monitor/trunk/src/main/webapp/images/flags/24/Nicaragua.png monitor/trunk/src/main/webapp/images/flags/24/Niger.png monitor/trunk/src/main/webapp/images/flags/24/Nigeria.png monitor/trunk/src/main/webapp/images/flags/24/North Korea.png monitor/trunk/src/main/webapp/images/flags/24/Northern Cyprus.png monitor/trunk/src/main/webapp/images/flags/24/Northern Ireland.png monitor/trunk/src/main/webapp/images/flags/24/Norway.png monitor/trunk/src/main/webapp/images/flags/24/OPEC.png monitor/trunk/src/main/webapp/images/flags/24/Olimpic Movement.png monitor/trunk/src/main/webapp/images/flags/24/Oman.png monitor/trunk/src/main/webapp/images/flags/24/Pakistan.png monitor/trunk/src/main/webapp/images/flags/24/Palau.png monitor/trunk/src/main/webapp/images/flags/24/Palestine.png monitor/trunk/src/main/webapp/images/flags/24/Panama.png monitor/trunk/src/main/webapp/images/flags/24/Papua New Guinea.png monitor/trunk/src/main/webapp/images/flags/24/Paraguay.png monitor/trunk/src/main/webapp/images/flags/24/Peru.png monitor/trunk/src/main/webapp/images/flags/24/Philippines.png monitor/trunk/src/main/webapp/images/flags/24/Poland.png monitor/trunk/src/main/webapp/images/flags/24/Portugal.png monitor/trunk/src/main/webapp/images/flags/24/Puerto Rico.png monitor/trunk/src/main/webapp/images/flags/24/Qatar.png monitor/trunk/src/main/webapp/images/flags/24/Red Cross.png monitor/trunk/src/main/webapp/images/flags/24/Reunion.png monitor/trunk/src/main/webapp/images/flags/24/Romania.png monitor/trunk/src/main/webapp/images/flags/24/Russia.png monitor/trunk/src/main/webapp/images/flags/24/Rwanda.png monitor/trunk/src/main/webapp/images/flags/24/Saint Lucia.png monitor/trunk/src/main/webapp/images/flags/24/Samoa.png monitor/trunk/src/main/webapp/images/flags/24/San Marino.png monitor/trunk/src/main/webapp/images/flags/24/Sao Tome & Principe.png monitor/trunk/src/main/webapp/images/flags/24/Saudi Arabia.png monitor/trunk/src/main/webapp/images/flags/24/Scotland.png monitor/trunk/src/main/webapp/images/flags/24/Senegal.png monitor/trunk/src/main/webapp/images/flags/24/Serbia(Yugoslavia).png monitor/trunk/src/main/webapp/images/flags/24/Seyshelles.png monitor/trunk/src/main/webapp/images/flags/24/Sierra Leone.png monitor/trunk/src/main/webapp/images/flags/24/Singapore.png monitor/trunk/src/main/webapp/images/flags/24/Slovakia.png monitor/trunk/src/main/webapp/images/flags/24/Slovenia.png monitor/trunk/src/main/webapp/images/flags/24/Solomon Islands.png monitor/trunk/src/main/webapp/images/flags/24/Somalia.png monitor/trunk/src/main/webapp/images/flags/24/Somaliland.png monitor/trunk/src/main/webapp/images/flags/24/South Africa.png monitor/trunk/src/main/webapp/images/flags/24/South Korea.png monitor/trunk/src/main/webapp/images/flags/24/Spain.png monitor/trunk/src/main/webapp/images/flags/24/Sri Lanka.png monitor/trunk/src/main/webapp/images/flags/24/St Kitts & Nevis.png monitor/trunk/src/main/webapp/images/flags/24/St Vincent & the Grenadines.png monitor/trunk/src/main/webapp/images/flags/24/Sudan.png monitor/trunk/src/main/webapp/images/flags/24/Suriname.png monitor/trunk/src/main/webapp/images/flags/24/Swaziland.png monitor/trunk/src/main/webapp/images/flags/24/Sweden.png monitor/trunk/src/main/webapp/images/flags/24/Switzerland.png monitor/trunk/src/main/webapp/images/flags/24/Syria.png monitor/trunk/src/main/webapp/images/flags/24/Tahiti(French Polinesia).png monitor/trunk/src/main/webapp/images/flags/24/Taiwan.png monitor/trunk/src/main/webapp/images/flags/24/Tajikistan.png monitor/trunk/src/main/webapp/images/flags/24/Tanzania.png monitor/trunk/src/main/webapp/images/flags/24/Thailand.png monitor/trunk/src/main/webapp/images/flags/24/Thumbs.db monitor/trunk/src/main/webapp/images/flags/24/Timor-Leste.png monitor/trunk/src/main/webapp/images/flags/24/Togo.png monitor/trunk/src/main/webapp/images/flags/24/Tonga.png monitor/trunk/src/main/webapp/images/flags/24/Trinidad & Tobago.png monitor/trunk/src/main/webapp/images/flags/24/Tunisia.png monitor/trunk/src/main/webapp/images/flags/24/Turkey.png monitor/trunk/src/main/webapp/images/flags/24/Turkmenistan.png monitor/trunk/src/main/webapp/images/flags/24/Turks and Caicos Islands.png monitor/trunk/src/main/webapp/images/flags/24/Tuvalu.png monitor/trunk/src/main/webapp/images/flags/24/Uganda.png monitor/trunk/src/main/webapp/images/flags/24/Ukraine.png monitor/trunk/src/main/webapp/images/flags/24/United Arab Emirates.png monitor/trunk/src/main/webapp/images/flags/24/United Kingdom(Great Britain).png monitor/trunk/src/main/webapp/images/flags/24/United Nations.png monitor/trunk/src/main/webapp/images/flags/24/United States.png monitor/trunk/src/main/webapp/images/flags/24/Uruguay.png monitor/trunk/src/main/webapp/images/flags/24/Uzbekistan.png monitor/trunk/src/main/webapp/images/flags/24/Vanuatu.png monitor/trunk/src/main/webapp/images/flags/24/Vatican City.png monitor/trunk/src/main/webapp/images/flags/24/Venezuela.png monitor/trunk/src/main/webapp/images/flags/24/Viet Nam.png monitor/trunk/src/main/webapp/images/flags/24/Virgin Islands British.png monitor/trunk/src/main/webapp/images/flags/24/Virgin Islands US.png monitor/trunk/src/main/webapp/images/flags/24/Wales.png monitor/trunk/src/main/webapp/images/flags/24/Western Sahara.png monitor/trunk/src/main/webapp/images/flags/24/Yemen.png monitor/trunk/src/main/webapp/images/flags/24/Zambia.png monitor/trunk/src/main/webapp/images/flags/24/Zimbabwe.png monitor/trunk/src/main/webapp/images/flags/24/japan.png monitor/trunk/src/main/webapp/images/flags/NOTICE.txt monitor/trunk/src/main/webapp/index.jsp monitor/trunk/src/main/webapp/scripts/ monitor/trunk/src/main/webapp/scripts/sortable.js monitor/trunk/src/main/webapp/server-add.jsp monitor/trunk/src/main/webapp/server.jsp monitor/trunk/src/main/webapp/servers-xml.jsp monitor/trunk/src/main/webapp/stylesheets/ monitor/trunk/src/main/webapp/stylesheets/style.css monitor/trunk/src/test/ monitor/trunk/src/test/java/ monitor/trunk/src/test/java/net/ monitor/trunk/src/test/java/net/jetrix/ monitor/trunk/src/test/java/net/jetrix/monitor/ monitor/trunk/src/test/java/net/jetrix/monitor/SpringTestCase.java monitor/trunk/src/test/java/net/jetrix/monitor/StyleUtilsTest.java monitor/trunk/src/test/java/net/jetrix/monitor/dao/ monitor/trunk/src/test/java/net/jetrix/monitor/dao/IpToCountryDaoTest.java monitor/trunk/src/test/java/net/jetrix/monitor/dao/ServerInfoDaoTest.java monitor/trunk/src/test/java/net/jetrix/monitor/job/ monitor/trunk/src/test/java/net/jetrix/monitor/job/GraphGenerationJobTest.java monitor/trunk/src/test/resources/ monitor/trunk/src/test/resources/testContext.xml Property Changed: ---------------- monitor/trunk/ Property changes on: monitor/trunk ___________________________________________________________________ Added: svn:ignore + target Property changes on: monitor/trunk/lib/geoip-1.2.2.jar ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: monitor/trunk/pom.xml =================================================================== --- monitor/trunk/pom.xml (rev 0) +++ monitor/trunk/pom.xml 2008-08-18 16:35:43 UTC (rev 729) @@ -0,0 +1,273 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + <modelVersion>4.0.0</modelVersion> + <groupId>jetrix</groupId> + <artifactId>monitor</artifactId> + <name>Jetrix Monitor</name> + <version>1.0-SNAPSHOT</version> + <packaging>war</packaging> + + <inceptionYear>2001</inceptionYear> + + <description> + Jetrix monitor is a service monitoring the state of online TetriNET servers. + </description> + <url>http://jetrix.sourceforge.net</url> + + <licenses> + <license> + <name>GNU General Public License v2</name> + <url>http://www.gnu.org/licenses/gpl-2.0.txt</url> + <distribution>manual</distribution> + </license> + </licenses> + + <scm> + <connection>scm:svn:https://jetrix.svn.sourceforge.net/svnroot/jetrix/monitor/trunk/</connection> + <developerConnection>scm:svn:https://jetrix.svn.sourceforge.net/svnroot/jetrix/monitor/trunk/</developerConnection> + <url>http://jetrix.svn.sourceforge.net/viewvc/jetrix/monitor/trunk</url> + </scm> + + <mailingLists> + <mailingList> + <name>Jetrix Commits</name> + <subscribe>http://lists.sourceforge.net/lists/listinfo/jetrix-cvs</subscribe> + <unsubscribe>http://lists.sourceforge.net/lists/listinfo/jetrix-cvs</unsubscribe> + <archive>https://sourceforge.net/mailarchive/forum.php?forum_id=12998</archive> + </mailingList> + </mailingLists> + + <developers> + <developer> + <id>smanux</id> + <name>Emmanuel Bourg</name> + <email>eb...@ap...</email> + <timezone>+1</timezone> + </developer> + </developers> + + <repositories> + <repository> + <id>java.net</id> + <url>http://download.java.net/maven/2/</url> + <snapshots> + <enabled>false</enabled> + </snapshots> + </repository> + <repository> + <id>opennms-repo</id> + <name>OpenNMS Repository</name> + <url>http://repo.opennms.org/maven2</url> + <snapshots> + <enabled>false</enabled> + </snapshots> + </repository> + </repositories> + + <dependencies> + <dependency> + <groupId>org.hibernate</groupId> + <artifactId>hibernate</artifactId> + <version>3.2.6.ga</version> + </dependency> + + <dependency> + <groupId>org.springframework </groupId> + <artifactId>spring</artifactId> + <version>2.5.5</version> + </dependency> + + <dependency> + <groupId>opensymphony</groupId> + <artifactId>quartz</artifactId> + <version>1.6.0</version> + </dependency> + + <dependency> + <groupId>commons-lang</groupId> + <artifactId>commons-lang</artifactId> + <version>2.3</version> + </dependency> + + <dependency> + <groupId>commons-collections</groupId> + <artifactId>commons-collections</artifactId> + <version>3.2.1</version> + </dependency> + + <dependency> + <groupId>maxmind</groupId> + <artifactId>geoip</artifactId> + <version>1.2.2</version> + </dependency> + + <dependency> + <groupId>org.jrobin</groupId> + <artifactId>jrobin</artifactId> + <version>1.5.8</version> + </dependency> + + <dependency> + <groupId>jetrix</groupId> + <artifactId>jetrix</artifactId> + <version>0.3-SNAPSHOT</version> + </dependency> + + <dependency> + <groupId>javax.servlet</groupId> + <artifactId>servlet-api</artifactId> + <version>2.4</version> + <scope>provided</scope> + </dependency> + + <dependency> + <groupId>javax.servlet.jsp</groupId> + <artifactId>jsp-api</artifactId> + <version>2.1</version> + <scope>provided</scope> + </dependency> + + <!-- Needed for testing --> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <version>3.8.2</version> + <scope>test</scope> + </dependency> + + <dependency> + <groupId>mysql</groupId> + <artifactId>mysql-connector-java</artifactId> + <version>5.1.6</version> + <scope>test</scope> + </dependency> + </dependencies> + + <build> + <sourceDirectory>src/main/java</sourceDirectory> + <testSourceDirectory>src/test/java</testSourceDirectory> + + <plugins> + <plugin> + <artifactId>maven-compiler-plugin</artifactId> + <configuration> + <source>1.5</source> + <target>1.5</target> + </configuration> + </plugin> + <plugin> + <artifactId>maven-surefire-plugin</artifactId> + <configuration> + <includes> + <include>**/*Test.java</include> + </includes> + <excludes> + <exclude>**/Abstract*</exclude> + </excludes> + <testFailureIgnore>true</testFailureIgnore> + <skip>false</skip> + </configuration> + </plugin> + <plugin> + <artifactId>maven-install-plugin</artifactId> + <configuration> + <file>lib/geoip-1.2.2.jar</file> + <groupId>maxmind</groupId> + <artifactId>geoip</artifactId> + <version>1.2.2</version> + <packaging>jar</packaging> + <generatePom>true</generatePom> + <createChecksum>true</createChecksum> + </configuration> + <executions> + <execution> + <phase>validate</phase> + <goals> + <goal>install-file</goal> + </goals> + </execution> + </executions> + </plugin> + </plugins> + </build> + + <reporting> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-javadoc-plugin</artifactId> + <configuration> + <linksource>true</linksource> + <links> + <link>http://java.sun.com/javase/6/docs/api</link> + </links> + <quiet>true</quiet> + </configuration> + <reportSets> + <reportSet> + <reports> + <report>javadoc</report> + </reports> + </reportSet> + </reportSets> + </plugin> + <plugin> + <artifactId>maven-pmd-plugin</artifactId> + <configuration> + <targetJdk>1.5</targetJdk> + </configuration> + </plugin> + <plugin> + <artifactId>maven-project-info-reports-plugin</artifactId> + <reportSets> + <reportSet> + <reports> + <report>project-team</report> + <report>dependencies</report> + <report>license</report> + <report>scm</report> + </reports> + </reportSet> + </reportSets> + </plugin> + <plugin> + <artifactId>maven-surefire-report-plugin</artifactId> + <version>2.0</version> + </plugin> + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>jxr-maven-plugin</artifactId> + </plugin> + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>cobertura-maven-plugin</artifactId> + </plugin> + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>taglist-maven-plugin</artifactId> + <version>2.0</version> + <configuration> + <tags> + <tag>todo</tag> + </tags> + </configuration> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-changelog-plugin</artifactId> + <configuration> + <range>365</range> + </configuration> + <reportSets> + <reportSet> + <reports> + <report>changelog</report> + <report>file-activity</report> + </reports> + </reportSet> + </reportSets> + </plugin> + </plugins> + </reporting> + +</project> Property changes on: monitor/trunk/pom.xml ___________________________________________________________________ Added: svn:keywords + Date Author Id Revision HeadURL Added: svn:eol-style + native Added: monitor/trunk/src/main/java/net/jetrix/monitor/NetworkUtils.java =================================================================== --- monitor/trunk/src/main/java/net/jetrix/monitor/NetworkUtils.java (rev 0) +++ monitor/trunk/src/main/java/net/jetrix/monitor/NetworkUtils.java 2008-08-18 16:35:43 UTC (rev 729) @@ -0,0 +1,78 @@ +/** + * Jetrix TetriNET Server + * Copyright (C) 2008 Emmanuel Bourg + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +package net.jetrix.monitor; + +import java.io.IOException; +import java.net.InetAddress; +import java.net.InetSocketAddress; +import java.net.Socket; +import java.net.UnknownHostException; + +/** + * @author Emmanuel Bourg + * @version $Revision$, $Date$ + */ +public class NetworkUtils +{ + public static boolean isPortOpen(String address, int port) + { + try + { + return isPortOpen(InetAddress.getByName(address), port); + } + catch (UnknownHostException e) + { + return false; + } + } + + /** + * Check if the specified port is open. + * + * @param address + * @param port + */ + public static boolean isPortOpen(InetAddress address, int port) + { + Socket socket = new Socket(); + + try + { + socket.connect(new InetSocketAddress(address, port), 5000); + socket.close(); + return true; + } + catch (IOException e) + { + return false; + } + finally + { + try + { + socket.close(); + } + catch (IOException e) + { + e.printStackTrace(); + } + } + } +} Property changes on: monitor/trunk/src/main/java/net/jetrix/monitor/NetworkUtils.java ___________________________________________________________________ Added: svn:keywords + Date Author Id Revision HeadURL Added: svn:eol-style + native Added: monitor/trunk/src/main/java/net/jetrix/monitor/ServerInfo.java =================================================================== --- monitor/trunk/src/main/java/net/jetrix/monitor/ServerInfo.java (rev 0) +++ monitor/trunk/src/main/java/net/jetrix/monitor/ServerInfo.java 2008-08-18 16:35:43 UTC (rev 729) @@ -0,0 +1,252 @@ +/** + * Jetrix TetriNET Server + * Copyright (C) 2008 Emmanuel Bourg + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +package net.jetrix.monitor; + +import java.util.Collection; +import java.util.Date; +import java.util.List; + +import net.jetrix.agent.ChannelInfo; +import net.jetrix.agent.PlayerInfo; + +/** + * Information about a TetriNET server. + * + * @author Emmanuel Bourg + * @version $Revision$, $Date$ + */ +public class ServerInfo +{ + private long id; + private String hostname; + private String IP; + private String version; + private String description; + private boolean spectate; + private String country; + private String website; + + private Date dateAdded; + private Date lastChecked; + private Date lastOnline; + + private ServerStats stats = new ServerStats(); + + private int maxPlayerCount; + private Date maxPlayerDate; + + private int maxActivePlayerCount; + private Date maxActivePlayerDate; + + private List<ChannelInfo> channels; + private List<PlayerInfo> players; + + private Collection<String> aliases; + + public long getId() + { + return id; + } + + public void setId(long id) + { + this.id = id; + } + + public String getHostname() + { + return hostname; + } + + public void setHostname(String hostname) + { + this.hostname = hostname; + } + + public String getIP() + { + return IP; + } + + public void setIP(String IP) + { + this.IP = IP; + } + + public String getVersion() + { + return version; + } + + public void setVersion(String version) + { + this.version = version; + } + + public String getDescription() + { + return description; + } + + public void setDescription(String description) + { + this.description = description; + } + + public boolean isSpectate() + { + return spectate; + } + + public void setSpectate(boolean spectate) + { + this.spectate = spectate; + } + + public String getCountry() + { + return country; + } + + public void setCountry(String country) + { + this.country = country; + } + + public String getWebsite() + { + return website; + } + + public void setWebsite(String website) + { + this.website = website; + } + + public Date getDateAdded() + { + return dateAdded; + } + + public void setDateAdded(Date dateAdded) + { + this.dateAdded = dateAdded; + } + + public Date getLastChecked() + { + return lastChecked; + } + + public void setLastChecked(Date lastChecked) + { + this.lastChecked = lastChecked; + } + + public Date getLastOnline() + { + return lastOnline; + } + + public void setLastOnline(Date lastOnline) + { + this.lastOnline = lastOnline; + } + + public ServerStats getStats() + { + return stats; + } + + public void setStats(ServerStats stats) + { + this.stats = stats; + } + + public int getMaxPlayerCount() + { + return maxPlayerCount; + } + + public void setMaxPlayerCount(int maxPlayerCount) + { + this.maxPlayerCount = maxPlayerCount; + } + + public Date getMaxPlayerDate() + { + return maxPlayerDate; + } + + public void setMaxPlayerDate(Date maxPlayerDate) + { + this.maxPlayerDate = maxPlayerDate; + } + + public int getMaxActivePlayerCount() + { + return maxActivePlayerCount; + } + + public void setMaxActivePlayerCount(int maxActivePlayerCount) + { + this.maxActivePlayerCount = maxActivePlayerCount; + } + + public Date getMaxActivePlayerDate() + { + return maxActivePlayerDate; + } + + public void setMaxActivePlayerDate(Date maxActivePlayerDate) + { + this.maxActivePlayerDate = maxActivePlayerDate; + } + + public List<ChannelInfo> getChannels() + { + return channels; + } + + public void setChannels(List<ChannelInfo> channels) + { + this.channels = channels; + } + + public List<PlayerInfo> getPlayers() + { + return players; + } + + public void setPlayers(List<PlayerInfo> players) + { + this.players = players; + } + + public Collection<String> getAliases() + { + return aliases; + } + + public void setAliases(Collection<String> aliases) + { + this.aliases = aliases; + } +} Property changes on: monitor/trunk/src/main/java/net/jetrix/monitor/ServerInfo.java ___________________________________________________________________ Added: svn:keywords + Date Author Id Revision HeadURL Added: svn:eol-style + native Added: monitor/trunk/src/main/java/net/jetrix/monitor/ServerStats.java =================================================================== --- monitor/trunk/src/main/java/net/jetrix/monitor/ServerStats.java (rev 0) +++ monitor/trunk/src/main/java/net/jetrix/monitor/ServerStats.java 2008-08-18 16:35:43 UTC (rev 729) @@ -0,0 +1,168 @@ +/** + * Jetrix TetriNET Server + * Copyright (C) 2008 Emmanuel Bourg + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +package net.jetrix.monitor; + +import java.util.Date; + +import net.jetrix.agent.ChannelInfo; +import net.jetrix.agent.PlayerInfo; +import net.jetrix.agent.QueryInfo; + +/** + * Server stats at a given time. + * + * @author Emmanuel Bourg + * @version $Revision$, $Date$ + */ +public class ServerStats +{ + private long id; + private long serverId; + private Date date; + private int ping; + private int playerCount; + private int activePlayerCount; + private int channelCount; + private int activeChannelCount; + + public void update(QueryInfo info) + { + date = new Date(); + ping = (int) info.getPing(); + playerCount = info.getPlayers().size(); + channelCount = info.getChannels().size(); + + int activePlayerCount = 0; + int activeChannelCount = 0; + + for (PlayerInfo player : info.getPlayers()) + { + if (player.isPlaying()) + { + activePlayerCount++; + } + } + + for (ChannelInfo channel : info.getChannels()) + { + if (channel.isPlaying()) + { + activeChannelCount++; + } + } + + this.activePlayerCount = activePlayerCount; + this.activeChannelCount = activeChannelCount; + } + + /** + * Merge the best player/channel count into the current ServerStat instance. + * + * @param stats + */ + public void merge(ServerStats stats) + { + playerCount = Math.max(playerCount, stats.playerCount); + activePlayerCount = Math.max(activePlayerCount, stats.activePlayerCount); + + channelCount = Math.max(channelCount, stats.channelCount); + activeChannelCount = Math.max(activeChannelCount, stats.activeChannelCount); + } + + public long getId() + { + return id; + } + + public void setId(long id) + { + this.id = id; + } + + public long getServerId() + { + return serverId; + } + + public void setServerId(long serverId) + { + this.serverId = serverId; + } + + public Date getDate() + { + return date; + } + + public void setDate(Date date) + { + this.date = date; + } + + public int getPing() + { + return ping; + } + + public void setPing(int ping) + { + this.ping = ping; + } + + public int getPlayerCount() + { + return playerCount; + } + + public void setPlayerCount(int playerCount) + { + this.playerCount = playerCount; + } + + public int getActivePlayerCount() + { + return activePlayerCount; + } + + public void setActivePlayerCount(int activePlayerCount) + { + this.activePlayerCount = activePlayerCount; + } + + public int getChannelCount() + { + return channelCount; + } + + public void setChannelCount(int channelCount) + { + this.channelCount = channelCount; + } + + public int getActiveChannelCount() + { + return activeChannelCount; + } + + public void setActiveChannelCount(int activeChannelCount) + { + this.activeChannelCount = activeChannelCount; + } +} Property changes on: monitor/trunk/src/main/java/net/jetrix/monitor/ServerStats.java ___________________________________________________________________ Added: svn:keywords + Date Author Id Revision HeadURL Added: svn:eol-style + native Added: monitor/trunk/src/main/java/net/jetrix/monitor/StyleUtils.java =================================================================== --- monitor/trunk/src/main/java/net/jetrix/monitor/StyleUtils.java (rev 0) +++ monitor/trunk/src/main/java/net/jetrix/monitor/StyleUtils.java 2008-08-18 16:35:43 UTC (rev 729) @@ -0,0 +1,92 @@ +/** + * Jetrix TetriNET Server + * Copyright (C) 2008 Emmanuel Bourg + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +package net.jetrix.monitor; + +import java.util.ArrayDeque; +import java.util.Deque; +import java.util.Map; +import java.util.HashMap; + +/** + * @author Emmanuel Bourg + * @version $Revision$, $Date$ + */ +public class StyleUtils +{ + /** TetriNET to CSS style mapping */ + private static final Map<Character, String> STYLES = new HashMap<Character, String>(); + static + { + STYLES.put('\u0014', "color: red"); + STYLES.put('\u0004', "color: black"); + STYLES.put('\u000c', "color: green"); + STYLES.put('\u000e', "color: lightgreen"); + STYLES.put('\u0011', "color: darkblue"); + STYLES.put('\u0005', "color: blue"); + STYLES.put('\u0003', "color: cyan"); + STYLES.put('\u0017', "color: aqua"); + STYLES.put('\u0019', "color: yellow"); + STYLES.put('\u0012', "color: kaki"); + STYLES.put('\u0010', "color: brown"); + STYLES.put('\u000f', "color: lightgray"); + STYLES.put('\u0006', "color: gray"); + STYLES.put('\u0008', "color: magenta"); + STYLES.put('\u0013', "color: purple"); + STYLES.put('\u0002', "font-weight: bold"); + STYLES.put('\u0016', "font-style: italic"); + STYLES.put('\u001f', "text-decoration: underlined"); + STYLES.put('\u0018', "color: white"); + } + + public static String toHTML(String text) + { + StringBuilder result = new StringBuilder(); + + Deque<Character> styleStack = new ArrayDeque<Character>(); + + for (char c : text.toCharArray()) + { + if (STYLES.keySet().contains(c)) + { + if (styleStack.isEmpty() || styleStack.peek().charValue() != c) + { + styleStack.push(c); + result.append("<span style=\"" + STYLES.get(c) + "\">"); + } + else + { + styleStack.pop(); + result.append("</span>"); + } + } + else + { + result.append(c); + } + } + + while (styleStack.pollFirst() != null) + { + result.append("</span>"); + } + + return result.toString(); + } +} Property changes on: monitor/trunk/src/main/java/net/jetrix/monitor/StyleUtils.java ___________________________________________________________________ Added: svn:keywords + Date Author Id Revision HeadURL Added: svn:eol-style + native Added: monitor/trunk/src/main/java/net/jetrix/monitor/dao/IpToCountryDao.java =================================================================== --- monitor/trunk/src/main/java/net/jetrix/monitor/dao/IpToCountryDao.java (rev 0) +++ monitor/trunk/src/main/java/net/jetrix/monitor/dao/IpToCountryDao.java 2008-08-18 16:35:43 UTC (rev 729) @@ -0,0 +1,61 @@ +/** + * Jetrix TetriNET Server + * Copyright (C) 2008 Emmanuel Bourg + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +package net.jetrix.monitor.dao; + +import java.io.IOException; +import java.io.File; +import java.net.InetAddress; +import java.net.URL; + +import com.maxmind.geoip.Country; +import com.maxmind.geoip.LookupService; +import static com.maxmind.geoip.LookupService.GEOIP_CHECK_CACHE; +import static com.maxmind.geoip.LookupService.GEOIP_MEMORY_CACHE; + +/** + * @author Emmanuel Bourg + * @version $Revision$, $Date$ + */ +public class IpToCountryDao +{ + private LookupService service; + + public IpToCountryDao() throws Exception + { + URL url = getClass().getResource("/GeoIP.dat"); + File file = new File(url.toURI()); + String fileName = file.getAbsolutePath(); + + this.service = new LookupService(fileName, GEOIP_MEMORY_CACHE | GEOIP_CHECK_CACHE); + } + + /** + * Returns the country code matching this address, or null if the country can't be found. + * + * @param address + */ + public String getCountry(InetAddress address) + { + Country country = service.getCountry(address); + + return country != null && !"--".equals(country.getCode()) ? country.getCode() : null; + } + +} Property changes on: monitor/trunk/src/main/java/net/jetrix/monitor/dao/IpToCountryDao.java ___________________________________________________________________ Added: svn:keywords + Date Author Id Revision HeadURL Added: svn:eol-style + native Added: monitor/trunk/src/main/java/net/jetrix/monitor/dao/ServerInfoDao.java =================================================================== --- monitor/trunk/src/main/java/net/jetrix/monitor/dao/ServerInfoDao.java (rev 0) +++ monitor/trunk/src/main/java/net/jetrix/monitor/dao/ServerInfoDao.java 2008-08-18 16:35:43 UTC (rev 729) @@ -0,0 +1,78 @@ +/** + * Jetrix TetriNET Server + * Copyright (C) 2008 Emmanuel Bourg + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +package net.jetrix.monitor.dao; + +import java.util.List; + +import org.hibernate.Query; +import org.springframework.orm.hibernate3.support.HibernateDaoSupport; + +import net.jetrix.monitor.ServerInfo; + +/** + * @author Emmanuel Bourg + * @version $Revision$, $Date$ + */ +public class ServerInfoDao extends HibernateDaoSupport +{ + public ServerInfo getServer(long id) + { + return (ServerInfo) getSession().get(ServerInfo.class, id); + } + + public ServerInfo getServer(String hostname) + { + Query query = getSession().createQuery("FROM ServerInfo WHERE hostname = :hostname"); + query.setParameter("hostname", hostname); + + return (ServerInfo) query.uniqueResult(); + } + + public List<ServerInfo> getServers() + { + return getSession().createQuery("FROM ServerInfo ORDER BY stats.playerCount DESC, hostname").list(); + } + + public void save(ServerInfo server) + { + getSession().saveOrUpdate(server); + } + + public void remove(long id) + { + Object server = getSession().load(ServerInfo.class, id); + getSession().delete(server); + } + + /** + * Check if the hostname or IP address of the specified server already exist in the database. + * + * @param server + */ + public boolean exists(ServerInfo server) + { + Query query = getSession().createQuery("FROM ServerInfo WHERE IP = :ip OR hostname = :name"); + query.setParameter("ip", server.getIP()); + query.setParameter("name", server.getHostname()); + List result = query.list(); + + return !result.isEmpty(); + } +} Property changes on: monitor/trunk/src/main/java/net/jetrix/monitor/dao/ServerInfoDao.java ___________________________________________________________________ Added: svn:keywords + Date Author Id Revision HeadURL Added: svn:eol-style + native Added: monitor/trunk/src/main/java/net/jetrix/monitor/dao/ServerStatsDao.java =================================================================== --- monitor/trunk/src/main/java/net/jetrix/monitor/dao/ServerStatsDao.java (rev 0) +++ monitor/trunk/src/main/java/net/jetrix/monitor/dao/ServerStatsDao.java 2008-08-18 16:35:43 UTC (rev 729) @@ -0,0 +1,47 @@ +/** + * Jetrix TetriNET Server + * Copyright (C) 2008 Emmanuel Bourg + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +package net.jetrix.monitor.dao; + +import java.util.List; + +import org.hibernate.Query; +import org.springframework.orm.hibernate3.support.HibernateDaoSupport; + +import net.jetrix.monitor.ServerStats; + +/** + * @author Emmanuel Bourg + * @version $Revision$, $Date$ + */ +public class ServerStatsDao extends HibernateDaoSupport +{ + public List<ServerStats> getStats(long serverId) + { + Query query = getSession().createQuery("FROM ServerStats WHERE serverId=:id ORDER BY date"); + query.setParameter("id", serverId); + + return (List<ServerStats>) query.list(); + } + + public void save(ServerStats stats) + { + getSession().saveOrUpdate(stats); + } +} Property changes on: monitor/trunk/src/main/java/net/jetrix/monitor/dao/ServerStatsDao.java ___________________________________________________________________ Added: svn:keywords + Date Author Id Revision HeadURL Added: svn:eol-style + native Added: monitor/trunk/src/main/java/net/jetrix/monitor/job/GraphGenerationJob.java =================================================================== --- monitor/trunk/src/main/java/net/jetrix/monitor/job/GraphGenerationJob.java (rev 0) +++ monitor/trunk/src/main/java/net/jetrix/monitor/job/GraphGenerationJob.java 2008-08-18 16:35:43 UTC (rev 729) @@ -0,0 +1,213 @@ +/** + * Jetrix TetriNET Server + * Copyright (C) 2008 Emmanuel Bourg + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +package net.jetrix.monitor.job; + +import java.awt.Color; +import java.io.File; +import java.io.IOException; +import java.util.Date; +import java.util.List; +import java.util.logging.Level; +import javax.servlet.ServletContext; + +import org.jrobin.core.RrdDb; +import org.jrobin.core.RrdDef; +import org.jrobin.core.RrdException; +import org.jrobin.core.Sample; +import org.jrobin.core.Util; +import org.jrobin.graph.RrdGraph; +import org.jrobin.graph.RrdGraphDef; +import org.quartz.JobExecutionContext; +import org.quartz.JobExecutionException; +import org.springframework.context.ApplicationContext; +import org.springframework.web.context.ContextLoader; + +import net.jetrix.monitor.ServerInfo; +import net.jetrix.monitor.ServerStats; +import net.jetrix.monitor.dao.ServerInfoDao; +import net.jetrix.monitor.dao.ServerStatsDao; + +/** + * @author Emmanuel Bourg + * @version $Revision$, $Date$ + */ +public class GraphGenerationJob extends TransactionalQuartzJob +{ + public static final String DEFAULT_DATAPATH = System.getProperty("user.home") + "/.jetrix"; + + private String dataPath = DEFAULT_DATAPATH; + private String outpoutPath = DEFAULT_DATAPATH; + + public void setDataPath(String dataPath) + { + this.dataPath = dataPath; + } + + public void setOutpoutPath(String outpoutPath) + { + this.outpoutPath = outpoutPath; + } + + protected void executeTransactional(JobExecutionContext jobExecutionContext) throws JobExecutionException + { + log.info("Generating graphs..."); + + ApplicationContext context = (ApplicationContext) jobExecutionContext.getMergedJobDataMap().get("applicationContext"); + + ServletContext servletContext = ContextLoader.getCurrentWebApplicationContext().getServletContext(); + setOutpoutPath(servletContext.getRealPath("/images/graphs")); + + ServerInfoDao serverInfoDao = (ServerInfoDao) context.getBean("serverInfoDao"); + ServerStatsDao serverStatsDao = (ServerStatsDao) context.getBean("serverStatsDao"); + + List<ServerInfo> servers = serverInfoDao.getServers(); + + for (ServerInfo server : servers) + { + try + { + List<ServerStats> stats = serverStatsDao.getStats(server.getId()); + generateGraph(server, stats); + } + catch (Exception e) + { + log.log(Level.WARNING, "Unable to draw the activity graph for " + server.getHostname() + " (" + server.getId() + ")", e); + } + } + } + + private File getRRDFile(ServerInfo server) + { + return new File(dataPath, "server-" + server.getId() + ".rrd"); + } + + protected void generateGraph(ServerInfo server, List<ServerStats> stats) throws RrdException, IOException + { + boolean update= updateDatabase(server,stats); + if (update) + { + generateGraph(server, 1); + } + } + + private boolean updateDatabase(ServerInfo server, List<ServerStats> stats) throws IOException, RrdException + { + if (stats.isEmpty()) + { + return false; + } + + File file = getRRDFile(server); + if (!file.exists()) + { + createDatabase(server, stats.get(0).getDate()); + } + + RrdDb rrdDb = new RrdDb(file.getAbsolutePath()); + + try + { + Sample sample = rrdDb.createSample(); + for (ServerStats stat : stats) + { + long timestamp = Util.getTimestamp(stat.getDate()); + if (timestamp > rrdDb.getLastUpdateTime()) + { + sample.setTime(timestamp); + sample.setValue("players", stat.getPlayerCount()); + sample.setValue("activePlayers", stat.getActivePlayerCount()); + sample.update(); + } + } + } + finally + { + rrdDb.close(); + } + + return true; + } + + private void createDatabase(ServerInfo server, Date startDate) throws IOException, RrdException + { + File file = getRRDFile(server); + file.getParentFile().mkdirs(); + + RrdDef def = new RrdDef(file.getAbsolutePath()); + def.setStartTime(Util.getTimestamp(startDate) - 1); + def.setStep(300); + + def.addDatasource("players", "GAUGE", 600, 0, Double.NaN); + def.addDatasource("activePlayers", "GAUGE", 600, 0, Double.NaN); + def.addArchive("AVERAGE", 0.5, 1, 1000000); + + RrdDb rrdDb = new RrdDb(def); + rrdDb.close(); + } + + private void generateGraph(ServerInfo server, int days) throws IOException, RrdException + { + RrdGraphDef graph = new RrdGraphDef(); + + // scale + graph.setStartTime(System.currentTimeMillis() / 1000 - days * 24 * 3600); + graph.setEndTime(System.currentTimeMillis() / 1000); + graph.setMinValue(0); + if (server.getMaxPlayerCount() < 10) + { + graph.setValueAxis(1, 1); + graph.setMaxValue(10); + } + + // data + File file = getRRDFile(server); + graph.datasource("players", file.getAbsolutePath(), "players", "AVERAGE"); + graph.datasource("activePlayers", file.getAbsolutePath(), "activePlayers", "AVERAGE"); + graph.area("players", new Color(141, 255, 141), "Players"); + graph.area("activePlayers", Color.GREEN, "Active Players"); + graph.hrule(server.getMaxPlayerCount(), Color.RED, "Max players"); + + // style + //graph.setTitle(server.getHostname().toUpperCase()); + graph.setVerticalLabel("Players"); + graph.setUnitsLength(7); + graph.setAntiAliasing(true); + graph.setShowSignature(false); + graph.setSignature(server.getHostname()); + graph.setNoLegend(true); + graph.setColor(RrdGraph.COLOR_SHADEA, Color.WHITE); + graph.setColor(RrdGraph.COLOR_SHADEB, Color.WHITE); + graph.setColor(RrdGraph.COLOR_BACK, Color.WHITE); + graph.setColor(RrdGraph.COLOR_ARROW, Color.WHITE); + + // output + File gfile = new File(outpoutPath, "server-" + server.getId() + ".png"); + gfile.getParentFile().mkdirs(); + graph.setWidth(400); + graph.setHeight(300); + graph.setFilename(gfile.getAbsolutePath()); + graph.setImageFormat("png"); + graph.setPoolUsed(false); + + new RrdGraph(graph); + + log.fine("Done generating " + gfile); + } +} Property changes on: monitor/trunk/src/main/java/net/jetrix/monitor/job/GraphGenerationJob.java ___________________________________________________________________ Added: svn:keywords + Date Author Id Revision HeadURL Added: svn:eol-style + native Added: monitor/trunk/src/main/java/net/jetrix/monitor/job/ServerSurveyJob.java ==... [truncated message content] |
From: <sm...@us...> - 2008-11-16 23:47:49
|
Revision: 778 http://jetrix.svn.sourceforge.net/jetrix/?rev=778&view=rev Author: smanux Date: 2008-11-16 23:47:28 +0000 (Sun, 16 Nov 2008) Log Message: ----------- Internationalization support and french translation Modified Paths: -------------- monitor/trunk/pom.xml monitor/trunk/src/main/webapp/WEB-INF/web.xml monitor/trunk/src/main/webapp/index.jsp monitor/trunk/src/main/webapp/player.jsp monitor/trunk/src/main/webapp/server-add.jsp monitor/trunk/src/main/webapp/server.jsp monitor/trunk/src/main/webapp/spec.jsp Added Paths: ----------- monitor/trunk/src/main/webapp/WEB-INF/classes/messages.properties monitor/trunk/src/main/webapp/WEB-INF/classes/messages_fr.properties Modified: monitor/trunk/pom.xml =================================================================== --- monitor/trunk/pom.xml 2008-11-16 21:29:26 UTC (rev 777) +++ monitor/trunk/pom.xml 2008-11-16 23:47:28 UTC (rev 778) @@ -127,6 +127,18 @@ <scope>provided</scope> </dependency> + <dependency> + <groupId>taglibs</groupId> + <artifactId>standard</artifactId> + <version>1.1.2</version> + </dependency> + + <dependency> + <groupId>jstl</groupId> + <artifactId>jstl</artifactId> + <version>1.1.2</version> + </dependency> + <!-- Needed for testing --> <dependency> <groupId>junit</groupId> Added: monitor/trunk/src/main/webapp/WEB-INF/classes/messages.properties =================================================================== --- monitor/trunk/src/main/webapp/WEB-INF/classes/messages.properties (rev 0) +++ monitor/trunk/src/main/webapp/WEB-INF/classes/messages.properties 2008-11-16 23:47:28 UTC (rev 778) @@ -0,0 +1,48 @@ +word.server = Server +word.country = Country +word.player = Player +word.players = Players +word.channel = Channel +word.channels = Channels +word.version = Version +word.team = Team +word.nick = Nick +word.status = Status +word.action = Action +word.name = Name +word.description = Description +word.website = Website +word.unknown = Unknown +word.ping = Ping +word.add = Add +word.yes = Yes +word.no = No +word.peak = Peak +word.date-added = Date Added +word.last-online = Last Online +word.never = Never +word.tetrinet-client = Client +word.slot = Slot +word.last-seen = Last Seen +word.last-played = Last Played +word.first-seen = First Seen +word.active = active +word.tspec-access= TSpec Access +word.playing = Playing +word.idle = Idle +word.ingame = INGAME +word.activity-graph = Activity Graph + +message.intro = This is a list of the public TetriNET servers. The list is refreshed every {0} minutes. Feel free to add your favorite server if it's not in the list. This list is also available in <a href="servers-xml.jsp">XML</a> and can be freely integrated with an application or a website. Feedback and suggestions can be mailed to <a href="mailto:{1}">{1}</a>. +message.global-status = There are currently <b>{0}</b> players online on <b>{1}</b> servers. +message.last-checked = The servers were last checked on {0}. +message.add-server = Add a new server +message.back-to-servers = Back to the server list +message.back-to-server-info = Back to the server info +message.peak.players = {0} players reached on {1} +message.peak.active-players = {0} active players reached on {1} + +title.servers = TetriNET Servers Listing +title.server = TetriNET Server - {0} +title.player = TetriNET Player - {0} +title.channel = TetriNET Channel - {0} on {1} Property changes on: monitor/trunk/src/main/webapp/WEB-INF/classes/messages.properties ___________________________________________________________________ Added: svn:keywords + Date Author Id Revision HeadURL Added: svn:eol-style + native Added: monitor/trunk/src/main/webapp/WEB-INF/classes/messages_fr.properties =================================================================== --- monitor/trunk/src/main/webapp/WEB-INF/classes/messages_fr.properties (rev 0) +++ monitor/trunk/src/main/webapp/WEB-INF/classes/messages_fr.properties 2008-11-16 23:47:28 UTC (rev 778) @@ -0,0 +1,48 @@ +word.server = Serveur +word.country = Pays +word.player = Joueur +word.players = Joueurs +word.channel = Channel +word.channels = Channels +word.version = Version +word.team = \xC9quipe +word.nick = Pseudo +word.status = Statut +word.action = Action +word.name = Nom +word.description = Description +word.website = Site web +word.unknown = Inconnu +word.ping = Latence +word.add = Ajouter +word.yes = Oui +word.no = Non +word.peak = Pointe +word.date-added = Date d'ajout +word.last-online = Derniere V\xE9rification +word.never = Jamais +word.tetrinet-client = Client +word.slot = Place +word.last-seen = Derni\xE8re Apparition +word.last-played = Derni\xE8re Partie +word.first-seen = Premi\xE8re Apparition +word.active = actifs +word.tspec-access= Acc\xE8s Spectateur +word.playing = En jeu +word.idle = En attente +word.ingame = EN COURS +word.activity-graph = Graphique d'activit\xE9 + +message.intro = Voici la liste des serveurs TetriNET publics. Cette liste est actualis\xE9e toutes les {0} minutes. N''h\xE9sitez pas \xE0 ajouter votre serveur pr\xE9f\xE9r\xE9 s''il n''apparait pas dans la liste. Cette liste est \xE9galement disponible au format <a href="servers-xml.jsp">XML</a> et peut \xEAtre librement int\xE9gr\xE9e dans une application ou un site internet. Envoyez vos commentaires et suggestions \xE0 <a href="mailto:{1}">{1}</a>. +message.global-status = Il y a actuellement <b>{0}</b> joueurs en ligne sur <b>{1}</b> serveurs. +message.last-checked = Les serveurs ont \xE9t\xE9 v\xE9rifi\xE9s pour la derni\xE8re fois le {0}. +message.add-server = Ajouter un serveur +message.back-to-servers = Retour \xE0 la liste des serveurs +message.back-to-server-info = Retour aux infos du serveur +message.peak.players = {0} joueurs atteints le {1} +message.peak.active-players = {0} joueurs actifs atteints le {1} + +title.servers = Liste des serveurs TetriNET +title.server = Serveur TetriNET - {0} +title.player = Joueur TetriNET - {0} +title.channel = Channel TetriNET - {0} sur {1} Property changes on: monitor/trunk/src/main/webapp/WEB-INF/classes/messages_fr.properties ___________________________________________________________________ Added: svn:keywords + Date Author Id Revision HeadURL Added: svn:eol-style + native Modified: monitor/trunk/src/main/webapp/WEB-INF/web.xml =================================================================== --- monitor/trunk/src/main/webapp/WEB-INF/web.xml 2008-11-16 21:29:26 UTC (rev 777) +++ monitor/trunk/src/main/webapp/WEB-INF/web.xml 2008-11-16 23:47:28 UTC (rev 778) @@ -12,6 +12,11 @@ <param-value>/WEB-INF/classes/*Context.xml</param-value> </context-param> + <context-param> + <param-name>javax.servlet.jsp.jstl.fmt.localizationContext</param-name> + <param-value>messages</param-value> + </context-param> + <listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener> Modified: monitor/trunk/src/main/webapp/index.jsp =================================================================== --- monitor/trunk/src/main/webapp/index.jsp 2008-11-16 21:29:26 UTC (rev 777) +++ monitor/trunk/src/main/webapp/index.jsp 2008-11-16 23:47:28 UTC (rev 778) @@ -1,3 +1,4 @@ +<%@ taglib uri="http://java.sun.com/jstl/fmt" prefix="fmt" %> <%@ page import="java.util.Date" %> <%@ page import="java.util.List" %> <%@ page import="java.util.Locale" %> @@ -25,37 +26,47 @@ lastChecked = server.getLastChecked(); } } - %> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> - <title>TetriNET Servers Listing</title> + <title><fmt:message key="title.servers"/></title> <link rel="stylesheet" type="text/css" href="stylesheets/style.css"> <link rel="Shorcut Icon" href="favicon.ico"> <script type="text/javascript" src="scripts/sortable.js"></script> </head> <body> -<h1>TetriNET Servers Listing</h1> +<h1><fmt:message key="title.servers"/></h1> -<p>This is a list of the public TetriNET servers. The list is refreshed every 5 minutes. Feel free to add your favorite -server if it's not in the list.</p> +<p> +<fmt:message key="message.intro"> + <fmt:param>5</fmt:param> + <fmt:param>sm...@lf...</fmt:param> +</fmt:message> +</p> -<p>There are currently <b><%= totalPlayerCount %></b> players online on <b><%= serverCount %></b> servers. The -servers were last checked on <%= lastChecked %>.</p> +<p> +<fmt:message key="message.global-status"> + <fmt:param><%= totalPlayerCount %></fmt:param> + <fmt:param><%= serverCount %></fmt:param> +</fmt:message> +<fmt:message key="message.last-checked"> + <fmt:param><%= lastChecked %></fmt:param> +</fmt:message> +</p> <table class="thin sortable" id="serverlist" border="1" align="center"> <thead> <tr> - <th>Server</th> - <th>Country</th> - <th>Players</th> - <th>Channels</th> - <th>Version</th> - <th>Ping <small>(ms)</small></th> - <th>Spec</th> + <th><fmt:message key="word.server"/></th> + <th><fmt:message key="word.country"/></th> + <th><fmt:message key="word.players"/></th> + <th><fmt:message key="word.channels"/></th> + <th><fmt:message key="word.version"/></th> + <th><fmt:message key="word.ping"/> <small>(ms)</small></th> + <th>TSpec</th> </tr> </thead> <tbody> @@ -72,10 +83,11 @@ <% Locale locale = new Locale("en", server.getCountry()); String countryName = locale.getDisplayCountry(Locale.ENGLISH); + String localizedCountryName = locale.getDisplayCountry(request.getLocale()); %> - <img src="images/flags/24/<%= countryName %>.png" alt="<%= countryName%>" title="<%= countryName%>"> + <img src="images/flags/24/<%= countryName %>.png" alt="<%= localizedCountryName%>" title="<%= localizedCountryName%>"> <% } else { %> - <img src="images/flags/24/United Nations.png" alt="Unknown" title="Unknown"> + <img src="images/flags/24/United Nations.png" alt="<fmt:message key="word.unknown"/>" title="<fmt:message key="word.unknown"/>"> <% } %> </td> <td align="right" style="font-weight: bold; <%= server.getStats().getActivePlayerCount() > 0 ? "color: green" : "" %>"> @@ -84,28 +96,36 @@ <td align="right"><%= server.getStats().getChannelCount() %></td> <td><%= server.getVersion() != null ? server.getVersion() : "" %></td> <td align="right"><%= server.getStats().getPing() %></td> - <td align="center" style="color: <%= server.isSpectate() ? "green" : "red" %>"><%= server.isSpectate() ? "Yes" : "No" %></td> + <td align="center" style="color: <%= server.isSpectate() ? "green" : "red" %>"> + <% if (server.isSpectate()) { %> + <fmt:message key="word.yes"/> + <% } else { %> + <fmt:message key="word.no"/> + <% } %> + </td> </tr> <% } %> </tbody> </table> <fieldset style="margin: 1em auto; width: 200px; -moz-border-radius: 6px"> - <legend>Add a new server</legend> + <legend><fmt:message key="message.add-server"/></legend> <form action="server-add.jsp"> <input type="text" name="hostname"> - <input type="submit" value="Add"> + <input type="submit" value="<fmt:message key="word.add"/>"> <br> - (<tt>tetrinet.fr</tt> or <tt>194.117.194.68</tt>) + (i.e. <tt>tetrinet.fr</tt>, <tt>194.117.194.68</tt>) </form> </fieldset> <hr> -<p>This list is also available in <a href="servers-xml.jsp">XML</a> and can be freely integrated with an application -or a website. Flags icons are made by www.icondrawer.com.</p> +<div style="font-size: smaller; float: left"> + Powered by <a href="http://jetrix.sourceforge.net">Jetrix Monitor</a><br> +</div> +<div style="font-size: smaller; text-align: right"> + Flags icons are made by <a href="http://www.icondrawer.com">www.icondrawer.com</a> +</div> -<p>Feedback and suggestions can be mailed to <a href="mailto:sm...@lf...">sm...@lf...</a></p> - </body> </html> Modified: monitor/trunk/src/main/webapp/player.jsp =================================================================== --- monitor/trunk/src/main/webapp/player.jsp 2008-11-16 21:29:26 UTC (rev 777) +++ monitor/trunk/src/main/webapp/player.jsp 2008-11-16 23:47:28 UTC (rev 778) @@ -1,3 +1,4 @@ +<%@ taglib uri="http://java.sun.com/jstl/fmt" prefix="fmt" %> <%@ page import="org.springframework.web.context.ContextLoader" %> <%@ page import="org.springframework.web.context.WebApplicationContext" %> <%@ page import="net.jetrix.monitor.PlayerStats" %> @@ -13,37 +14,47 @@ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> - <title>TetriNET Player - <%= StyleUtils.strip(player.getName()) %></title> + <title> + <fmt:message key="title.player"> + <fmt:param><%= StyleUtils.strip(player.getName()) %></fmt:param> + </fmt:message> + </title> <link rel="stylesheet" type="text/css" href="stylesheets/style.css"> <link rel="Shorcut Icon" href="favicon.ico"> </head> <body> -<h1>TetriNET Player - <%= StyleUtils.strip(player.getName()) %></h1> + +<h1> + <fmt:message key="title.player"> + <fmt:param><%= StyleUtils.strip(player.getName()) %></fmt:param> + </fmt:message> +</h1> + <table class="thin" border="1" cellspacing="0" style="min-width: 40%"> <tr> - <th width="25%">First Seen</th> + <th width="25%"><fmt:message key="word.first-seen"/></th> <td><%= player.getFirstSeen() %></td> </tr> <tr> - <th>Last Seen</th> + <th><fmt:message key="word.last-seen"/></th> <td><%= player.getLastSeen() %></td> </tr> <tr> - <th>Last Played</th> + <th><fmt:message key="word.last-played"/></th> <td><%= player.getLastPlayed() != null ? player.getLastPlayed() : "-" %></td> </tr> <tr> - <th>Server</th> + <th><fmt:message key="word.server"/></th> <td><a href="server.jsp?id=<%= player.getLastServer().getId() %>"><%= player.getLastServer().getHostname() %></a></td> </tr> <tr> - <th>Channel</th> + <th><fmt:message key="word.channel"/></th> <td><%= player.getChannel() != null ? player.getChannel() : "" %></td> </tr> <tr> - <th>Team</th> + <th><fmt:message key="word.team"/></th> <td><%= player.getTeam() != null ? player.getTeam() : "" %></td> </tr> </table> Modified: monitor/trunk/src/main/webapp/server-add.jsp =================================================================== --- monitor/trunk/src/main/webapp/server-add.jsp 2008-11-16 21:29:26 UTC (rev 777) +++ monitor/trunk/src/main/webapp/server-add.jsp 2008-11-16 23:47:28 UTC (rev 778) @@ -3,8 +3,6 @@ <%@ page import="java.net.InetSocketAddress" %> <%@ page import="java.net.Socket" %> <%@ page import="java.util.Date" %> -<%@ page import="java.util.List" %> -<%@ page import="java.util.Locale" %> <%@ page import="org.springframework.web.context.ContextLoader" %> <%@ page import="org.springframework.web.context.WebApplicationContext" %> <%@ page import="net.jetrix.monitor.ServerInfo" %> Modified: monitor/trunk/src/main/webapp/server.jsp =================================================================== --- monitor/trunk/src/main/webapp/server.jsp 2008-11-16 21:29:26 UTC (rev 777) +++ monitor/trunk/src/main/webapp/server.jsp 2008-11-16 23:47:28 UTC (rev 778) @@ -1,3 +1,4 @@ +<%@ taglib uri="http://java.sun.com/jstl/fmt" prefix="fmt" %> <%@ page import="java.util.Locale" %> <%@ page import="org.springframework.web.context.ContextLoader" %> <%@ page import="org.springframework.web.context.WebApplicationContext" %> @@ -14,11 +15,13 @@ ServerInfo server = dao.getServer(Long.parseLong(request.getParameter("id"))); String countryName = "Unknown"; + String localizedCountryName = "Unknown"; String countryFlag = "United Nations"; if (server.getCountry() != null) { Locale locale = new Locale("en", server.getCountry()); countryName = locale.getDisplayCountry(Locale.ENGLISH); + localizedCountryName = locale.getDisplayCountry(request.getLocale()); countryFlag = countryName; } @@ -27,24 +30,32 @@ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> - <title>TetriNET Server - <%= server.getHostname() %></title> + <title> + <fmt:message key="title.server"> + <fmt:param><%= server.getHostname() %></fmt:param> + </fmt:message> + </title> <link rel="stylesheet" type="text/css" href="stylesheets/style.css"> <link rel="Shorcut Icon" href="favicon.ico"> <script type="text/javascript" src="scripts/sortable.js"></script> </head> <body> -<h1>TetriNET Server - <%= server.getHostname() %></h1> +<h1> + <fmt:message key="title.server"> + <fmt:param><%= server.getHostname() %></fmt:param> + </fmt:message> +</h1> <% if (server.getMaxPlayerCount() > 0) { %> <div style="float: right"> - <img src="images/graphs/server-<%= server.getId() %>.png" alt="Activity graph"> + <img src="images/graphs/server-<%= server.getId() %>.png" alt="<fmt:message key="word.activity-graph"/>"> </div> <% } %> <table class="thin" border="1" cellspacing="0" style="min-width: 40%"> <tr> - <th width="25%">Website</th> + <th width="25%"><fmt:message key="word.website"/></th> <td> <% if (server.getWebsite() != null) { %> <a href="<%= server.getWebsite() %>"><%= server.getWebsite() %></a> @@ -52,81 +63,100 @@ </td> </tr> <tr> - <th>Description</th> + <th><fmt:message key="word.description"/></th> <td><%= server.getDescription() != null ? server.getDescription() : "" %></td> </tr> <tr> - <th>Version</th> + <th><fmt:message key="word.version"/></th> <td><%= server.getVersion() != null ? server.getVersion() : "" %></td> </tr> <tr> - <th>Country</th> + <th><fmt:message key="word.country"/></th> <td> <table border="0" cellpadding="0" cellspacing="0"> <tr> - <td><img src="images/flags/24/<%= countryFlag %>.png" alt="<%= countryName%>" title="<%= countryName%>"></td> - <td><%= countryName%></td> + <td><img src="images/flags/24/<%= countryFlag %>.png" alt="<%= localizedCountryName%>"></td> + <td><%= localizedCountryName%></td> </tr> </table> </td> </tr> <tr> - <th>Players</th> + <th><fmt:message key="word.players"/></th> <td> <%= server.getStats().getPlayerCount() %> <% if (server.getStats().getActivePlayerCount() > 0) { %> - (<%= server.getStats().getActivePlayerCount() %> active) + (<%= server.getStats().getActivePlayerCount() %> <fmt:message key="word.active"/>) <% } %> </td> </tr> <% if (server.getMaxPlayerCount() != 0 && server.getMaxActivePlayerCount() != 0) { %> <tr> - <th>Peak</th> + <th><fmt:message key="word.peak"/></th> <td> - <%= server.getMaxPlayerCount() %> players reached on <%= server.getMaxPlayerDate() %><br> - <%= server.getMaxActivePlayerCount() %> active players reached on <%= server.getMaxActivePlayerDate() %> + <fmt:message key="message.peak.players"> + <fmt:param><%= server.getMaxPlayerCount() %></fmt:param> + <fmt:param><%= server.getMaxPlayerDate() %></fmt:param> + </fmt:message> + <br> + <fmt:message key="message.peak.active-players"> + <fmt:param><%= server.getMaxActivePlayerCount() %></fmt:param> + <fmt:param><%= server.getMaxActivePlayerDate() %></fmt:param> + </fmt:message> </td> </tr> <% } %> <tr> - <th>Channels</th> + <th><fmt:message key="word.channels"/></th> <td><%= server.getStats().getChannelCount() %></td> </tr> <tr> - <th>TSpec Access</th> - <td style="color: <%= server.isSpectate() ? "green" : "red" %>"><%= server.isSpectate() ? "Yes" : "No" %></td> + <th><fmt:message key="word.tspec-access"/></th> + <td style="color: <%= server.isSpectate() ? "green" : "red" %>"> + <% if (server.isSpectate()) { %> + <fmt:message key="word.yes"/> + <% } else { %> + <fmt:message key="word.no"/> + <% } %> + </td> </tr> <tr> - <th>Ping</th> + <th><fmt:message key="word.ping"/></th> <td><%= server.getStats().getPing() %> ms</td> </tr> <tr> - <th>Date Added</th> + <th><fmt:message key="word.date-added"/></th> <td><%= server.getDateAdded() %></td> </tr> <tr> - <th>Last Online</th> - <td><%= server.getLastOnline() != null ? server.getLastOnline() : "Never" %></td> + <th><fmt:message key="word.last-online"/></th> + <td> + <% if (server.getLastOnline() != null) { %> + <%= server.getLastOnline() %> + <% } else { %> + <fmt:message key="word.never"/> + <% } %> + </td> </tr> </table> -<p><a href="<%= request.getContextPath() %>/">Back to the server list</a></p> +<p><a href="<%= request.getContextPath() %>/"><fmt:message key="message.back-to-servers"/></a></p> <div style="clear: both;"></div> <% if (!server.getPlayers().isEmpty()) { %> -<h2>Players</h2> +<h2><fmt:message key="word.players"/></h2> <table class="thin sortable" id="players" border="1" style="min-width: 40%"> <thead> <tr> - <th>Nick</th> - <th>Team</th> - <th>Channel</th> - <th>Slot</th> - <th>Status</th> - <th>Client</th> + <th><fmt:message key="word.nick"/></th> + <th><fmt:message key="word.team"/></th> + <th><fmt:message key="word.channel"/></th> + <th><fmt:message key="word.slot"/></th> + <th><fmt:message key="word.status"/></th> + <th><fmt:message key="word.tetrinet-client"/></th> </tr> </thead> <tbody> @@ -136,7 +166,13 @@ <td><%= StyleUtils.toHTML(player.getTeam()) %></td> <td><%= player.getChannel() %></td> <td><%= player.getSlot() %></td> - <td style="color: <%= player.isPlaying() ? "green" : "inherit" %>"><%= player.isPlaying() ? "Playing" : "Idle" %></td> + <td style="color: <%= player.isPlaying() ? "green" : "inherit" %>"> + <% if (player.isPlaying()) { %> + <fmt:message key="word.playing"/> + <% } else { %> + <fmt:message key="word.idle"/> + <% } %> + </td> <td><%= player.getVersion() %></td> </tr> <% } %> @@ -148,17 +184,17 @@ <% if (!server.getChannels().isEmpty()) { %> -<h2>Channels</h2> +<h2><fmt:message key="word.channels"/></h2> <table class="thin sortable" id="channels" border="1" style="min-width: 40%"> <thead> <tr> - <th>Name</th> - <th>Description</th> - <th>Players</th> - <th>Status</th> + <th><fmt:message key="word.name"/></th> + <th><fmt:message key="word.description"/></th> + <th><fmt:message key="word.players"/></th> + <th><fmt:message key="word.status"/></th> <% if (viewable) { %> - <th>Action</th> + <th><fmt:message key="word.action"/></th> <% } %> </tr> </thead> @@ -168,7 +204,11 @@ <td><%= channel.getName() %></td> <td><%= StyleUtils.toHTML(channel.getDescription()) %></td> <td><%= channel.getPlayernum() %> / <%= channel.getPlayermax() %></td> - <td style="color: green; font-weight: bold"><%= channel.isPlaying() ? "INGAME" : "" %></td> + <td style="color: green; font-weight: bold"> + <% if (channel.isPlaying()) { %> + <fmt:message key="word.ingame"/> + <% } %> + </td> <% if (viewable) { %> <td align="center"> <% if (channel.getPlayernum() > 0) { %> Modified: monitor/trunk/src/main/webapp/spec.jsp =================================================================== --- monitor/trunk/src/main/webapp/spec.jsp 2008-11-16 21:29:26 UTC (rev 777) +++ monitor/trunk/src/main/webapp/spec.jsp 2008-11-16 23:47:28 UTC (rev 778) @@ -1,8 +1,6 @@ +<%@ taglib uri="http://java.sun.com/jstl/fmt" prefix="fmt" %> <%@ page import="org.springframework.web.context.ContextLoader" %> <%@ page import="org.springframework.web.context.WebApplicationContext" %> -<%@ page import="net.jetrix.monitor.PlayerStats" %> -<%@ page import="net.jetrix.monitor.dao.PlayerStatsDao" %> -<%@ page import="net.jetrix.monitor.StyleUtils" %> <%@ page import="net.jetrix.monitor.dao.ServerInfoDao" %> <%@ page import="net.jetrix.monitor.ServerInfo" %> <% @@ -16,13 +14,23 @@ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> - <title>TetriNET Player - <%= channel %> on <%= server.getHostname() %></title> + <title> + <fmt:message key="title.channel"> + <fmt:param><%= channel %></fmt:param> + <fmt:param><%= server.getHostname() %></fmt:param> + </fmt:message> + </title> <link rel="stylesheet" type="text/css" href="stylesheets/style.css"> <link rel="Shorcut Icon" href="favicon.ico"> </head> <body> -<h1>TetriNET Player - <%= channel %> on <%= server.getHostname() %></h1> +<h1> + <fmt:message key="title.channel"> + <fmt:param><%= channel %></fmt:param> + <fmt:param><%= server.getHostname() %></fmt:param> + </fmt:message> +</h1> <div align="center"> <applet code="net.jetrix.spectator.SpectatorApplet" archive="webspec-0.1-SNAPSHOT.jar,jetrix-0.3-SNAPSHOT.jar" width="640" height="480"> @@ -33,7 +41,7 @@ </applet> </div> -<a href="server.jsp?id=<%= server.getId() %>">Back to the server info</a> +<a href="server.jsp?id=<%= server.getId() %>"><fmt:message key="message.back-to-server-info"/></a> </body> </html> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sm...@us...> - 2010-02-22 14:34:30
|
Revision: 818 http://jetrix.svn.sourceforge.net/jetrix/?rev=818&view=rev Author: smanux Date: 2010-02-22 12:46:29 +0000 (Mon, 22 Feb 2010) Log Message: ----------- Updated the GeoIP database Modified Paths: -------------- monitor/trunk/pom.xml monitor/trunk/src/main/java/net/jetrix/monitor/dao/IpToCountryDao.java monitor/trunk/src/main/resources/GeoIP.dat Removed Paths: ------------- monitor/trunk/lib/geoip-1.2.2.jar Deleted: monitor/trunk/lib/geoip-1.2.2.jar =================================================================== (Binary files differ) Modified: monitor/trunk/pom.xml =================================================================== --- monitor/trunk/pom.xml 2010-02-05 11:42:19 UTC (rev 817) +++ monitor/trunk/pom.xml 2010-02-22 12:46:29 UTC (rev 818) @@ -96,9 +96,9 @@ </dependency> <dependency> - <groupId>maxmind</groupId> - <artifactId>geoip</artifactId> - <version>1.2.2</version> + <groupId>org.dspace.dependencies</groupId> + <artifactId>dspace-geoip</artifactId> + <version>1.2.3</version> </dependency> <dependency> @@ -180,26 +180,6 @@ <skip>false</skip> </configuration> </plugin> - <plugin> - <artifactId>maven-install-plugin</artifactId> - <configuration> - <file>lib/geoip-1.2.2.jar</file> - <groupId>maxmind</groupId> - <artifactId>geoip</artifactId> - <version>1.2.2</version> - <packaging>jar</packaging> - <generatePom>true</generatePom> - <createChecksum>true</createChecksum> - </configuration> - <executions> - <execution> - <phase>validate</phase> - <goals> - <goal>install-file</goal> - </goals> - </execution> - </executions> - </plugin> </plugins> </build> Modified: monitor/trunk/src/main/java/net/jetrix/monitor/dao/IpToCountryDao.java =================================================================== --- monitor/trunk/src/main/java/net/jetrix/monitor/dao/IpToCountryDao.java 2010-02-05 11:42:19 UTC (rev 817) +++ monitor/trunk/src/main/java/net/jetrix/monitor/dao/IpToCountryDao.java 2010-02-22 12:46:29 UTC (rev 818) @@ -19,7 +19,6 @@ package net.jetrix.monitor.dao; -import java.io.IOException; import java.io.File; import java.net.InetAddress; import java.net.URL; Modified: monitor/trunk/src/main/resources/GeoIP.dat =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sm...@us...> - 2010-02-24 00:36:30
|
Revision: 828 http://jetrix.svn.sourceforge.net/jetrix/?rev=828&view=rev Author: smanux Date: 2010-02-24 00:36:21 +0000 (Wed, 24 Feb 2010) Log Message: ----------- Added an atom feed with the latest servers submitted Modified Paths: -------------- monitor/trunk/pom.xml monitor/trunk/src/main/java/net/jetrix/monitor/dao/ServerInfoDao.java monitor/trunk/src/main/webapp/WEB-INF/classes/messages.properties monitor/trunk/src/main/webapp/WEB-INF/classes/messages_fr.properties monitor/trunk/src/main/webapp/index.jsp Added Paths: ----------- monitor/trunk/src/main/webapp/feed-servers.jsp Modified: monitor/trunk/pom.xml =================================================================== --- monitor/trunk/pom.xml 2010-02-24 00:33:46 UTC (rev 827) +++ monitor/trunk/pom.xml 2010-02-24 00:36:21 UTC (rev 828) @@ -133,6 +133,12 @@ <version>1.2</version> </dependency> + <dependency> + <groupId>rome</groupId> + <artifactId>rome</artifactId> + <version>0.9</version> + </dependency> + <!-- Needed for testing --> <dependency> <groupId>junit</groupId> Modified: monitor/trunk/src/main/java/net/jetrix/monitor/dao/ServerInfoDao.java =================================================================== --- monitor/trunk/src/main/java/net/jetrix/monitor/dao/ServerInfoDao.java 2010-02-24 00:33:46 UTC (rev 827) +++ monitor/trunk/src/main/java/net/jetrix/monitor/dao/ServerInfoDao.java 2010-02-24 00:36:21 UTC (rev 828) @@ -50,6 +50,17 @@ return getSession().createQuery("FROM ServerInfo ORDER BY stats.playerCount DESC, hostname").list(); } + /** + * Returns the latest servers added. + */ + public List<ServerInfo> getLatestServers(int n) + { + Query query = getSession().createQuery("FROM ServerInfo WHERE lastOnline != null ORDER BY dateAdded DESC"); + query.setMaxResults(n); + + return query.list(); + } + public void save(ServerInfo server) { getSession().saveOrUpdate(server); Modified: monitor/trunk/src/main/webapp/WEB-INF/classes/messages.properties =================================================================== --- monitor/trunk/src/main/webapp/WEB-INF/classes/messages.properties 2010-02-24 00:33:46 UTC (rev 827) +++ monitor/trunk/src/main/webapp/WEB-INF/classes/messages.properties 2010-02-24 00:36:21 UTC (rev 828) @@ -48,3 +48,6 @@ title.server = TetriNET Server - {0} title.player = TetriNET Player - {0} title.channel = TetriNET Channel - {0} on {1} + +feed.title = Latest TetriNET Servers +feed.description = The latest TetriNET servers submitted to the directory Modified: monitor/trunk/src/main/webapp/WEB-INF/classes/messages_fr.properties =================================================================== --- monitor/trunk/src/main/webapp/WEB-INF/classes/messages_fr.properties 2010-02-24 00:33:46 UTC (rev 827) +++ monitor/trunk/src/main/webapp/WEB-INF/classes/messages_fr.properties 2010-02-24 00:36:21 UTC (rev 828) @@ -48,3 +48,6 @@ title.server = Serveur TetriNET - {0} title.player = Joueur TetriNET - {0} title.channel = Channel TetriNET - {0} sur {1} + +feed.title = Les derniers serveurs TetriNET +feed.description = Les derniers serveurs TetriNET ajout\xE9s \xE0 la liste Added: monitor/trunk/src/main/webapp/feed-servers.jsp =================================================================== --- monitor/trunk/src/main/webapp/feed-servers.jsp (rev 0) +++ monitor/trunk/src/main/webapp/feed-servers.jsp 2010-02-24 00:36:21 UTC (rev 828) @@ -0,0 +1,45 @@ +<%@ page contentType="application/atom+xml" %> +<%@ page import="java.util.*" %> +<%@ page import="com.sun.syndication.feed.synd.*" %> +<%@ page import="com.sun.syndication.io.SyndFeedOutput" %> +<%@ page import="org.springframework.web.context.ContextLoader" %> +<%@ page import="org.springframework.web.context.WebApplicationContext" %> +<%@ page import="net.jetrix.monitor.ServerInfo" %> +<%@ page import="net.jetrix.monitor.dao.ServerInfoDao" %> +<% + WebApplicationContext context = ContextLoader.getCurrentWebApplicationContext(); + ServerInfoDao dao = (ServerInfoDao) context.getBean("serverInfoDao"); + + ResourceBundle bundle = ResourceBundle.getBundle("messages", request.getLocale()); + + String basePath = request.getRequestURI().substring(0, request.getRequestURI().lastIndexOf('/')); + + List<ServerInfo> servers = dao.getLatestServers(10); + + SyndFeed feed = new SyndFeedImpl(); + feed.setFeedType("atom_1.0"); + feed.setTitle(bundle.getString("feed.title")); + feed.setLink(basePath); + feed.setDescription(bundle.getString("feed.description")); + + List<SyndEntry> entries = new ArrayList<SyndEntry>(); + for (ServerInfo server : servers) { + SyndEntry entry = new SyndEntryImpl(); + entry.setTitle(server.getHostname()); + entry.setLink(basePath + "/server/" + server.getHostname()); + entry.setPublishedDate(server.getDateAdded()); + + SyndContent description = new SyndContentImpl(); + description.setType("text/plain"); + description.setValue(server.getVersion()); + + entry.setDescription(description); + entries.add(entry); + } + + feed.setEntries(entries); + + SyndFeedOutput output = new SyndFeedOutput(); + output.output(feed,response.getWriter()); + response.getWriter().flush(); +%> \ No newline at end of file Modified: monitor/trunk/src/main/webapp/index.jsp =================================================================== --- monitor/trunk/src/main/webapp/index.jsp 2010-02-24 00:33:46 UTC (rev 827) +++ monitor/trunk/src/main/webapp/index.jsp 2010-02-24 00:36:21 UTC (rev 828) @@ -35,6 +35,7 @@ <link rel="stylesheet" type="text/css" href="stylesheets/style.css"> <link rel="Shorcut Icon" href="favicon.ico"> <link rel="alternate" type="text/xml" title="Servers XML summary" href="servers.xml"> + <link rel="alternate" type="application/atom+xml" title="Latest TetriNET Servers" href="feed-servers.jsp" /> <script type="text/javascript" src="scripts/sortable.js"></script> </head> <body> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |