jetrix-cvs Mailing List for Jetrix TetriNET Server (Page 10)
Brought to you by:
smanux
You can subscribe to this list here.
2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(47) |
Dec
(39) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
(11) |
Feb
(34) |
Mar
(52) |
Apr
(79) |
May
(14) |
Jun
(41) |
Jul
(19) |
Aug
(44) |
Sep
(36) |
Oct
(36) |
Nov
(6) |
Dec
(58) |
2004 |
Jan
(23) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(91) |
2005 |
Jan
(137) |
Feb
(10) |
Mar
(2) |
Apr
(41) |
May
(62) |
Jun
(9) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(10) |
Dec
|
2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(2) |
Sep
|
Oct
|
Nov
|
Dec
|
2008 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(39) |
Sep
(18) |
Oct
|
Nov
(9) |
Dec
|
2009 |
Jan
|
Feb
(27) |
Mar
(4) |
Apr
|
May
|
Jun
(2) |
Jul
|
Aug
|
Sep
(2) |
Oct
|
Nov
|
Dec
|
2010 |
Jan
(3) |
Feb
(14) |
Mar
(3) |
Apr
(10) |
May
(15) |
Jun
|
Jul
|
Aug
(9) |
Sep
(1) |
Oct
|
Nov
|
Dec
|
2011 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
(1) |
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
2012 |
Jan
|
Feb
(4) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Emmanuel B. <sm...@us...> - 2005-05-03 17:30:16
|
Update of /cvsroot/jetrix/jetrix/src/java/net/jetrix/filter In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31103/net/jetrix/filter Modified Files: FloodFilter.java PingFilter.java TetrisFilter.java Log Message: Added a new constructor to PlineMessage Index: TetrisFilter.java =================================================================== RCS file: /cvsroot/jetrix/jetrix/src/java/net/jetrix/filter/TetrisFilter.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** TetrisFilter.java 14 Dec 2004 02:12:55 -0000 1.11 --- TetrisFilter.java 3 May 2005 17:29:48 -0000 1.12 *************** *** 51,55 **** GmsgMessage message = new GmsgMessage(); ! message.setKey("filter.tetris.start_message", new Integer(tetrisLimit)); out.add(m); --- 51,55 ---- GmsgMessage message = new GmsgMessage(); ! message.setKey("filter.tetris.start_message", tetrisLimit); out.add(m); *************** *** 109,113 **** if (leaders.size() == 1) { ! announce.setKey("filter.tetris.lead", leaders.get(0), new Integer(max)); } else --- 109,113 ---- if (leaders.size() == 1) { ! announce.setKey("filter.tetris.lead", leaders.get(0), max); } else Index: FloodFilter.java =================================================================== RCS file: /cvsroot/jetrix/jetrix/src/java/net/jetrix/filter/FloodFilter.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** FloodFilter.java 14 Dec 2004 02:12:55 -0000 1.8 --- FloodFilter.java 3 May 2005 17:29:48 -0000 1.9 *************** *** 82,88 **** { User user = getChannel().getPlayer(slot); ! PlineMessage warning = new PlineMessage(); ! warning.setKey("filter.flood.blocked", user.getName()); ! out.add(warning); lastWarning = now; } --- 82,86 ---- { User user = getChannel().getPlayer(slot); ! out.add(new PlineMessage("filter.flood.blocked", user.getName())); lastWarning = now; } Index: PingFilter.java =================================================================== RCS file: /cvsroot/jetrix/jetrix/src/java/net/jetrix/filter/PingFilter.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** PingFilter.java 11 Jan 2005 00:48:26 -0000 1.10 --- PingFilter.java 3 May 2005 17:29:48 -0000 1.11 *************** *** 47,53 **** long delay = (System.currentTimeMillis() - ((Long) user.getProperty("command.ping.time")).longValue()) >> 1; ! PlineMessage response = new PlineMessage(); ! response.setKey("command.ping.message", new Long(delay)); ! client.send(response); user.setProperty("command.ping", "false"); --- 47,51 ---- long delay = (System.currentTimeMillis() - ((Long) user.getProperty("command.ping.time")).longValue()) >> 1; ! client.send(new PlineMessage("command.ping.message", delay)); user.setProperty("command.ping", "false"); |
From: Emmanuel B. <sm...@us...> - 2005-05-03 17:30:01
|
Update of /cvsroot/jetrix/jetrix/src/java/net/jetrix/messages In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31103/net/jetrix/messages Modified Files: PlineMessage.java Log Message: Added a new constructor to PlineMessage Index: PlineMessage.java =================================================================== RCS file: /cvsroot/jetrix/jetrix/src/java/net/jetrix/messages/PlineMessage.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** PlineMessage.java 8 Dec 2003 00:44:33 -0000 1.3 --- PlineMessage.java 3 May 2005 17:29:48 -0000 1.4 *************** *** 40,42 **** --- 40,50 ---- setText(text); } + + /** + * @since 0.3 + */ + public PlineMessage(String key, Object... params) + { + setKey(key, params); + } } |
From: Emmanuel B. <sm...@us...> - 2005-05-03 17:29:57
|
Update of /cvsroot/jetrix/jetrix/src/java/net/jetrix In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31103/net/jetrix Modified Files: Channel.java Log Message: Added a new constructor to PlineMessage Index: Channel.java =================================================================== RCS file: /cvsroot/jetrix/jetrix/src/java/net/jetrix/Channel.java,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** Channel.java 27 Jan 2005 21:29:25 -0000 1.37 --- Channel.java 3 May 2005 17:29:46 -0000 1.38 *************** *** 300,306 **** { Client client = (Client) m.getSource(); ! PlineMessage message = new PlineMessage(); ! message.setKey("channel.game.paused-by", client.getUser().getName()); ! sendAll(message); } --- 300,304 ---- { Client client = (Client) m.getSource(); ! sendAll(new PlineMessage("channel.game.paused-by", client.getUser().getName())); } *************** *** 316,322 **** { Client client = (Client) m.getSource(); ! PlineMessage message = new PlineMessage(); ! message.setKey("channel.game.resumed-by", client.getUser().getName()); ! sendAll(message); } --- 314,318 ---- { Client client = (Client) m.getSource(); ! sendAll(new PlineMessage("channel.game.resumed-by", client.getUser().getName())); } *************** *** 441,447 **** { Client client = (Client) m.getSource(); ! PlineMessage message = new PlineMessage(); ! message.setKey("channel.game.started-by", client.getUser().getName()); ! sendAll(message); } --- 437,441 ---- { Client client = (Client) m.getSource(); ! sendAll(new PlineMessage("channel.game.started-by", client.getUser().getName())); } *************** *** 496,502 **** { Client client = (Client) m.getSource(); ! PlineMessage message = new PlineMessage(); ! message.setKey("channel.game.stopped-by", client.getUser().getName()); ! sendAll(message); } --- 490,494 ---- { Client client = (Client) m.getSource(); ! sendAll(new PlineMessage("channel.game.stopped-by", client.getUser().getName())); } *************** *** 520,526 **** removeClient(client); ! PlineMessage disconnected = new PlineMessage(); ! disconnected.setKey("channel.disconnected", client.getUser().getName()); ! sendAll(disconnected); } --- 512,516 ---- removeClient(client); ! sendAll(new PlineMessage("channel.disconnected", client.getUser().getName())); } |
From: Emmanuel B. <sm...@us...> - 2005-05-03 17:13:18
|
Update of /cvsroot/jetrix/jetrix/src/java/net/jetrix/clients In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27946/net/jetrix/clients Modified Files: TetrinetClient.java Log Message: documentation Index: TetrinetClient.java =================================================================== RCS file: /cvsroot/jetrix/jetrix/src/java/net/jetrix/clients/TetrinetClient.java,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** TetrinetClient.java 3 May 2005 13:39:26 -0000 1.26 --- TetrinetClient.java 3 May 2005 17:13:00 -0000 1.27 *************** *** 116,119 **** --- 116,120 ---- connectionTime = new Date(); + // get the server configuration if possible Server server = Server.getInstance(); if (server != null) *************** *** 126,130 **** --- 127,134 ---- while (!disconnected && serverConfig.isRunning()) { + // fetch the next message Message message = receive(); + + // discard unknown messages if (message == null) continue; *************** *** 135,138 **** --- 139,143 ---- else if (channel != null) { + // send the message to the channel assigned to this client channel.send(message); } |
From: Emmanuel B. <sm...@us...> - 2005-05-03 17:13:09
|
Update of /cvsroot/jetrix/jetrix/src/java/net/jetrix/listeners In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27831/net/jetrix/listeners Modified Files: TetrinetListener.java Log Message: Do not drop clients with a space in the name without a message Index: TetrinetListener.java =================================================================== RCS file: /cvsroot/jetrix/jetrix/src/java/net/jetrix/listeners/TetrinetListener.java,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** TetrinetListener.java 26 Apr 2005 23:30:00 -0000 1.20 --- TetrinetListener.java 3 May 2005 17:12:28 -0000 1.21 *************** *** 80,88 **** } - if (tokens.size() > 3) - { - return null; - } - TetrinetClient client = new TetrinetClient(); User user = new User(); --- 80,83 ---- *************** *** 91,99 **** client.setUser(user); client.setVersion((String) tokens.get(2)); ! if ((tokens.get(0)).equals("tetrisstart")) { client.setProtocol(protocolManager.getProtocol(TetrinetProtocol.class)); } ! else if ((tokens.get(0)).equals("tetrifaster")) { client.setProtocol(protocolManager.getProtocol(TetrifastProtocol.class)); --- 86,94 ---- client.setUser(user); client.setVersion((String) tokens.get(2)); ! if ((tokens.get(0)).equals(TetrinetProtocol.INIT_TOKEN)) { client.setProtocol(protocolManager.getProtocol(TetrinetProtocol.class)); } ! else if ((tokens.get(0)).equals(TetrifastProtocol.INIT_TOKEN)) { client.setProtocol(protocolManager.getProtocol(TetrifastProtocol.class)); |
From: Emmanuel B. <sm...@us...> - 2005-05-03 17:11:43
|
Update of /cvsroot/jetrix/jetrix/src/java/net/jetrix/commands In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27677/net/jetrix/commands Modified Files: MotdCommand.java Log Message: simplified implementation Index: MotdCommand.java =================================================================== RCS file: /cvsroot/jetrix/jetrix/src/java/net/jetrix/commands/MotdCommand.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** MotdCommand.java 9 Dec 2004 12:35:19 -0000 1.9 --- MotdCommand.java 3 May 2005 17:11:31 -0000 1.10 *************** *** 20,25 **** package net.jetrix.commands; - import java.io.*; - import net.jetrix.*; import net.jetrix.config.*; --- 20,23 ---- *************** *** 42,62 **** { Client client = (Client) m.getSource(); ! ServerConfig conf = Server.getInstance().getConfig(); ! try { ! // send the message of the day line by line ! BufferedReader motd = new BufferedReader(new StringReader(conf.getMessageOfTheDay())); ! String motdline; ! while ((motdline = motd.readLine()) != null) { ! Message response = new PlineMessage("<gray>" + motdline); ! client.send(response); } - motd.close(); - } - catch (IOException e) - { - e.printStackTrace(); } } --- 40,54 ---- { Client client = (Client) m.getSource(); ! ServerConfig config = Server.getInstance().getConfig(); ! // send the message of the day line by line ! if (config.getMessageOfTheDay() != null) { ! String[] lines = config.getMessageOfTheDay().split("\n"); ! ! for (String line : lines) { ! client.send(new PlineMessage("<gray>" + line)); } } } |
From: Emmanuel B. <sm...@us...> - 2005-05-03 17:10:15
|
Update of /cvsroot/jetrix/jetrix/src/java/net/jetrix/protocols In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27254/net/jetrix/protocols Modified Files: TetrifastProtocol.java TetrinetProtocol.java Log Message: Added the init token Index: TetrinetProtocol.java =================================================================== RCS file: /cvsroot/jetrix/jetrix/src/java/net/jetrix/protocols/TetrinetProtocol.java,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** TetrinetProtocol.java 26 Apr 2005 20:23:59 -0000 1.28 --- TetrinetProtocol.java 3 May 2005 17:09:56 -0000 1.29 *************** *** 79,82 **** --- 79,85 ---- } + /** Initialization token */ + public static final String INIT_TOKEN = "tetrisstart"; + /** * Return the name of this protocol *************** *** 872,876 **** { // the first characters from the decoded string ! char[] data = (tetrifast ? "tetrifaste" : "tetrisstar").toCharArray(); // compute the full hash --- 875,879 ---- { // the first characters from the decoded string ! char[] data = (tetrifast ? TetrifastProtocol.INIT_TOKEN : INIT_TOKEN).substring(0, 10).toCharArray(); // compute the full hash *************** *** 914,918 **** // build the string to encode ! char[] data = ((tetrifast ? "tetrifaster " : "tetrisstart ") + nickname + " " + version).toCharArray(); // build the encoded string --- 917,921 ---- // build the string to encode ! char[] data = ((tetrifast ? TetrifastProtocol.INIT_TOKEN : INIT_TOKEN) + " " + nickname + " " + version).toCharArray(); // build the encoded string Index: TetrifastProtocol.java =================================================================== RCS file: /cvsroot/jetrix/jetrix/src/java/net/jetrix/protocols/TetrifastProtocol.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** TetrifastProtocol.java 4 Apr 2005 09:36:17 -0000 1.3 --- TetrifastProtocol.java 3 May 2005 17:09:53 -0000 1.4 *************** *** 30,33 **** --- 30,36 ---- public class TetrifastProtocol extends TetrinetProtocol { + /** Initialization token */ + public static final String INIT_TOKEN = "tetrifaster"; + public String getName() { |
From: Emmanuel B. <sm...@us...> - 2005-05-03 16:56:57
|
Update of /cvsroot/jetrix/jetrix/src/java/net/jetrix/listeners In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23930 Modified Files: ClientListener.java Log Message: New interceptor API to modularize the ClientListener Index: ClientListener.java =================================================================== RCS file: /cvsroot/jetrix/jetrix/src/java/net/jetrix/listeners/ClientListener.java,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** ClientListener.java 3 May 2005 11:45:59 -0000 1.17 --- ClientListener.java 3 May 2005 16:56:47 -0000 1.18 *************** *** 1,5 **** /** * Jetrix TetriNET Server ! * Copyright (C) 2001-2004 Emmanuel Bourg * * This program is free software; you can redistribute it and/or --- 1,5 ---- /** * Jetrix TetriNET Server ! * Copyright (C) 2001-2005 Emmanuel Bourg * * This program is free software; you can redistribute it and/or *************** *** 22,32 **** import java.io.*; import java.net.*; import java.util.logging.*; import net.jetrix.*; - import net.jetrix.services.AbstractService; import net.jetrix.clients.*; import net.jetrix.config.*; import net.jetrix.messages.*; /** --- 22,35 ---- import java.io.*; import java.net.*; + import java.util.*; import java.util.logging.*; + import net.jetrix.*; import net.jetrix.clients.*; import net.jetrix.config.*; + import net.jetrix.listeners.interceptor.*; import net.jetrix.messages.*; + import net.jetrix.services.*; /** *************** *** 99,102 **** --- 102,106 ---- } + // spawn the client verifier processing the interceptors new ClientVerifier(socket).start(); } *************** *** 188,293 **** { Client client = getClient(socket); - User user = client.getUser(); - user.setLocale(serverConfig.getLocale()); ! // check if the server is locked ! if (serverConfig.getStatus() == ServerConfig.STATUS_LOCKED && !(client instanceof QueryClient)) ! { ! log.info("Server locked, client rejected (" + address + ")."); ! Message m = new NoConnectingMessage("The server is locked."); ! client.send(m); ! socket.close(); ! return; ! } ! ! // check if the server is full ! ClientRepository repository = ClientRepository.getInstance(); ! if (repository.getClientCount() >= serverConfig.getMaxPlayers() ! && !(client instanceof QueryClient)) { ! log.info("Server full, client rejected (" + address + ")."); ! Message m = new NoConnectingMessage("Server is full!"); ! client.send(m); ! socket.close(); ! return; ! } ! // test concurrent connections from the same host ! int maxConnections = serverConfig.getMaxConnections(); ! if (maxConnections > 0 && repository.getHostCount(address) >= maxConnections) ! { ! log.info("Too many connections from host, client rejected (" + address + ")."); ! Message m = new NoConnectingMessage("Too many connections from your host!"); ! client.send(m); ! socket.close(); ! return; ! } ! // testing name unicity ! if (repository.getClient(user.getName()) != null) ! { ! Message m = new NoConnectingMessage("Nickname already in use!"); ! client.send(m); ! socket.close(); ! return; ! } ! // validate the name ! String name = user.getName(); ! if (!(client instanceof QueryClient) && (name == null || "server".equals(name.toLowerCase()) || name.indexOf("\u00a0") != -1)) ! { ! Message m = new NoConnectingMessage("Invalid name!"); ! client.send(m); ! socket.close(); ! return; ! } ! log.fine("Client accepted (" + address + ")"); ! socket.setSoTimeout(serverConfig.getTimeout() * 1000); ! if (!(client instanceof QueryClient)) ! { ! // add the client to the repository ! repository.addClient(client); ! // send the message of the day ! if (serverConfig.getMessageOfTheDay() != null) ! { ! BufferedReader motd = new BufferedReader(new StringReader(serverConfig.getMessageOfTheDay())); ! String motdline; ! while ((motdline = motd.readLine()) != null) { ! PlineMessage m = new PlineMessage(); ! m.setText("<gray>" + motdline); ! client.send(m); } - motd.close(); - } - - // display the number of players online - int playerCount = ClientRepository.getInstance().getPlayerCount(); - int spectatorCount = ClientRepository.getInstance().getSpectatorCount(); - - PlineMessage online = new PlineMessage(); - String key = playerCount + spectatorCount > 1 ? "server.users-online" : "server.user-online"; - String pkey = playerCount > 1 ? "key:common.players" : "key:common.player"; - String skey = spectatorCount > 1 ? "key:common.spectators" : "key:common.spectator"; - online.setKey(key, playerCount, pkey, spectatorCount, skey); - - client.send(online); ! // forward the client to the server for channel assignation ! if (client.supportsAutoJoin()) { ! AddPlayerMessage m = new AddPlayerMessage(); ! m.setClient(client); ! Server.getInstance().send(m); } ! // update the server statistics ! serverConfig.getStatistics().increaseConnectionCount(); } - - // start the client - (new Thread(client, "client: " + client.getUser().getName())).start(); } catch (Exception e) --- 192,244 ---- { Client client = getClient(socket); ! if (client != null) { ! User user = client.getUser(); ! user.setLocale(serverConfig.getLocale()); ! // todo move the declaration of the interceptors in the server configuration ! Collection<ClientInterceptor> validators = new ArrayList<ClientInterceptor>(); ! validators.add(new AccessInterceptor()); ! validators.add(new NameCheckInterceptor()); ! // run the validators ! for (ClientInterceptor interceptor : validators) ! { ! interceptor.process(client); ! } ! log.fine("Client accepted (" + address + ")"); ! socket.setSoTimeout(serverConfig.getTimeout() * 1000); ! if (!(client instanceof QueryClient)) ! { ! // add the client to the repository ! ClientRepository repository = ClientRepository.getInstance(); ! repository.addClient(client); ! Collection<ClientInterceptor> interceptors = new ArrayList<ClientInterceptor>(); ! interceptors.add(new MotdInterceptor()); ! interceptors.add(new OnlineUsersInterceptor()); ! interceptors.add(new ServerStatsInterceptor()); ! // run the interceptors ! for (ClientInterceptor interceptor : interceptors) { ! interceptor.process(client); } ! // forward the client to the server for channel assignation ! if (client.supportsAutoJoin()) ! { ! AddPlayerMessage m = new AddPlayerMessage(); ! m.setClient(client); ! Server.getInstance().send(m); ! } } ! // start the client ! (new Thread(client, "client: " + client.getUser().getName())).start(); } } catch (Exception e) *************** *** 304,308 **** ioe.printStackTrace(); } ! e.printStackTrace(); } --- 255,263 ---- ioe.printStackTrace(); } ! ! if (!(e instanceof ClientValidationException)) ! { ! e.printStackTrace(); ! } } |
From: Emmanuel B. <sm...@us...> - 2005-05-03 16:56:56
|
Update of /cvsroot/jetrix/jetrix/src/java/net/jetrix/listeners/interceptor In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23930/interceptor Added Files: AccessInterceptor.java ClientInterceptor.java ClientValidationException.java MotdInterceptor.java NameCheckInterceptor.java OnlineUsersInterceptor.java ServerStatsInterceptor.java Log Message: New interceptor API to modularize the ClientListener --- NEW FILE: ClientValidationException.java --- /** * Jetrix TetriNET Server * Copyright (C) 2005 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.listeners.interceptor; /** * Exception thrown by a ClientInterceptor when the validation fails. * * @since 0.3 * * @author Emmanuel Bourg * @version $Revision: 1.1 $, $Date: 2005/05/03 16:56:48 $ */ public class ClientValidationException extends Exception { public ClientValidationException() { } public ClientValidationException(String message) { super(message); } public ClientValidationException(String message, Throwable cause) { super(message, cause); } public ClientValidationException(Throwable cause) { super(cause); } } --- NEW FILE: OnlineUsersInterceptor.java --- /** * Jetrix TetriNET Server * Copyright (C) 2005 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.listeners.interceptor; import net.jetrix.Client; import net.jetrix.ClientRepository; import net.jetrix.clients.QueryClient; import net.jetrix.messages.PlineMessage; /** * Interceptor displaying the number of players and spectators currently online. * * @since 0.3 * * @author Emmanuel Bourg * @version $Revision: 1.1 $, $Date: 2005/05/03 16:56:48 $ */ public class OnlineUsersInterceptor implements ClientInterceptor { public boolean isValidating() { return false; } public void process(Client client) { if (!(client instanceof QueryClient)) { // display the number of players online int playerCount = ClientRepository.getInstance().getPlayerCount(); int spectatorCount = ClientRepository.getInstance().getSpectatorCount(); PlineMessage online = new PlineMessage(); String key = playerCount + spectatorCount > 1 ? "server.users-online" : "server.user-online"; String pkey = playerCount > 1 ? "key:common.players" : "key:common.player"; String skey = spectatorCount > 1 ? "key:common.spectators" : "key:common.spectator"; online.setKey(key, playerCount, pkey, spectatorCount, skey); client.send(online); } } } --- NEW FILE: MotdInterceptor.java --- /** * Jetrix TetriNET Server * Copyright (C) 2005 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.listeners.interceptor; import net.jetrix.Client; import net.jetrix.Server; import net.jetrix.clients.QueryClient; import net.jetrix.config.ServerConfig; import net.jetrix.messages.PlineMessage; /** * Interceptor displaying the message of the day. * * @since 0.3 * * @author Emmanuel Bourg * @version $Revision: 1.1 $, $Date: 2005/05/03 16:56:48 $ */ public class MotdInterceptor implements ClientInterceptor { public boolean isValidating() { return false; } public void process(Client client) { if (!(client instanceof QueryClient)) { // send the message of the day line by line ServerConfig config = Server.getInstance().getConfig(); if (config.getMessageOfTheDay() != null) { String[] lines = config.getMessageOfTheDay().split("\n"); for (String line : lines) { client.send(new PlineMessage("<gray>" + line)); } } } } } --- NEW FILE: NameCheckInterceptor.java --- /** * Jetrix TetriNET Server * Copyright (C) 2005 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.listeners.interceptor; import net.jetrix.Client; import net.jetrix.ClientRepository; import net.jetrix.Message; import net.jetrix.User; import net.jetrix.clients.QueryClient; import net.jetrix.messages.NoConnectingMessage; /** * Interceptor checking the validity of the name. The client will be rejected * if the name is already in use, empty or equals to "Server". * * @since 0.3 * * @author Emmanuel Bourg * @version $Revision: 1.1 $, $Date: 2005/05/03 16:56:48 $ */ public class NameCheckInterceptor implements ClientInterceptor { public boolean isValidating() { return true; } public void process(Client client) throws ClientValidationException { User user = client.getUser(); // test the name unicity ClientRepository repository = ClientRepository.getInstance(); if (repository.getClient(user.getName()) != null) { Message m = new NoConnectingMessage("Nickname already in use!"); client.send(m); client.disconnect(); throw new ClientValidationException(); } // validate the name String name = user.getName(); if (!(client instanceof QueryClient) && (name == null || "server".equalsIgnoreCase(name) || name.indexOf("\u00a0") != -1)) { Message m = new NoConnectingMessage("Invalid name!"); client.send(m); client.disconnect(); throw new ClientValidationException(); } } } --- NEW FILE: ServerStatsInterceptor.java --- /** * Jetrix TetriNET Server * Copyright (C) 2005 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.listeners.interceptor; import net.jetrix.Client; import net.jetrix.Server; import net.jetrix.clients.QueryClient; import net.jetrix.config.ServerConfig; /** * Interceptor updating the connection stats. * * @since 0.3 * * @author Emmanuel Bourg * @version $Revision: 1.1 $, $Date: 2005/05/03 16:56:48 $ */ public class ServerStatsInterceptor implements ClientInterceptor { public boolean isValidating() { return false; } public void process(Client client) { if (!(client instanceof QueryClient)) { // update the server statistics ServerConfig serverConfig = Server.getInstance().getConfig(); serverConfig.getStatistics().increaseConnectionCount(); } } } --- NEW FILE: AccessInterceptor.java --- /** * Jetrix TetriNET Server * Copyright (C) 2005 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.listeners.interceptor; import net.jetrix.Client; import net.jetrix.ClientRepository; import net.jetrix.Server; import net.jetrix.clients.QueryClient; import net.jetrix.config.ServerConfig; import net.jetrix.messages.NoConnectingMessage; import java.net.InetAddress; import java.util.logging.Logger; /** * Interceptor checking the access to the server. The client will be rejected * if the server is full, locked, or if it has exceeded the maximum number of * concurrent connections. * * @since 0.3 * * @author Emmanuel Bourg * @version $Revision: 1.1 $, $Date: 2005/05/03 16:56:48 $ */ public class AccessInterceptor implements ClientInterceptor { private Logger log = Logger.getLogger("net.jetrix"); public boolean isValidating() { return true; } public void process(Client client) throws ClientValidationException { ServerConfig serverConfig = Server.getInstance().getConfig(); InetAddress address = client.getInetAddress(); // check if the server is locked if (serverConfig.getStatus() == ServerConfig.STATUS_LOCKED && !(client instanceof QueryClient)) { log.info("Server locked, client rejected (" + address + ")."); client.send(new NoConnectingMessage("The server is locked.")); client.disconnect(); return; } // check if the server is full ClientRepository repository = ClientRepository.getInstance(); if (repository.getClientCount() >= serverConfig.getMaxPlayers() && !(client instanceof QueryClient)) { log.info("Server full, client rejected (" + address + ")."); client.send(new NoConnectingMessage("Server is full!")); client.disconnect(); return; } // test concurrent connections from the same host // todo include pending connections int maxConnections = serverConfig.getMaxConnections(); if (maxConnections > 0 && repository.getHostCount(address) >= maxConnections) { log.info("Too many connections from host, client rejected (" + address + ")."); client.send(new NoConnectingMessage("Too many connections from your host!")); client.disconnect(); return; } } } --- NEW FILE: ClientInterceptor.java --- /** * Jetrix TetriNET Server * Copyright (C) 2005 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.listeners.interceptor; import net.jetrix.Client; /** * An interceptor performing a specific process when a client attempts * to log into the server. * * @since 0.3 * * @author Emmanuel Bourg * @version $Revision: 1.1 $, $Date: 2005/05/03 16:56:48 $ */ public interface ClientInterceptor { /** * Indicates if this interceptor validates the client. If the interceptor * is validating, the process method may throw a ClientValidationException * and prevent the client from connecting to the server. */ boolean isValidating(); /** * Process the specified client. */ void process(Client client) throws ClientValidationException; } |
From: Emmanuel B. <sm...@us...> - 2005-05-03 16:54:33
|
Update of /cvsroot/jetrix/jetrix/src/java/net/jetrix/listeners/interceptor In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23252/interceptor Log Message: Directory /cvsroot/jetrix/jetrix/src/java/net/jetrix/listeners/interceptor added to the repository |
From: Emmanuel B. <sm...@us...> - 2005-05-03 13:39:39
|
Update of /cvsroot/jetrix/jetrix/src/java/net/jetrix In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3376/src/java/net/jetrix Modified Files: Client.java Log Message: Renamed Client.receiveMessage() into Client.receive() Index: Client.java =================================================================== RCS file: /cvsroot/jetrix/jetrix/src/java/net/jetrix/Client.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** Client.java 5 Jan 2005 17:16:00 -0000 1.13 --- Client.java 3 May 2005 13:39:25 -0000 1.14 *************** *** 105,110 **** /** * Receive a message sent by the client. */ ! Message receiveMessage() throws IOException; /** --- 105,112 ---- /** * Receive a message sent by the client. + * + * @since 0.3 */ ! Message receive() throws IOException; /** |
From: Emmanuel B. <sm...@us...> - 2005-05-03 13:39:36
|
Update of /cvsroot/jetrix/jetrix/doc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3376/doc Modified Files: changelog.txt Log Message: Renamed Client.receiveMessage() into Client.receive() Index: changelog.txt =================================================================== RCS file: /cvsroot/jetrix/jetrix/doc/changelog.txt,v retrieving revision 1.75 retrieving revision 1.76 diff -C2 -d -r1.75 -r1.76 *** changelog.txt 3 May 2005 11:45:59 -0000 1.75 --- changelog.txt 3 May 2005 13:39:12 -0000 1.76 *************** *** 14,17 **** --- 14,21 ---- - Fixed a bug preventing the modification of the access level of a command when the "access-level" attribute was set on the <command> element + Developer visible changes + - Renamed Client.receiveMessage() into Client.receive() + + Changes in version 0.2 (2005-01-18) ----------------------------------- |
From: Emmanuel B. <sm...@us...> - 2005-05-03 13:39:36
|
Update of /cvsroot/jetrix/jetrix/src/java/net/jetrix/clients In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3376/src/java/net/jetrix/clients Modified Files: ConsoleClient.java QueryClient.java TetrinetClient.java Log Message: Renamed Client.receiveMessage() into Client.receive() Index: TetrinetClient.java =================================================================== RCS file: /cvsroot/jetrix/jetrix/src/java/net/jetrix/clients/TetrinetClient.java,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** TetrinetClient.java 12 Jan 2005 18:43:37 -0000 1.25 --- TetrinetClient.java 3 May 2005 13:39:26 -0000 1.26 *************** *** 126,130 **** while (!disconnected && serverConfig.isRunning()) { ! Message message = receiveMessage(); if (message == null) continue; --- 126,130 ---- while (!disconnected && serverConfig.isRunning()) { ! Message message = receive(); if (message == null) continue; *************** *** 242,246 **** } ! public Message receiveMessage() throws IOException { // read raw message from socket --- 242,246 ---- } ! public Message receive() throws IOException { // read raw message from socket Index: ConsoleClient.java =================================================================== RCS file: /cvsroot/jetrix/jetrix/src/java/net/jetrix/clients/ConsoleClient.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** ConsoleClient.java 5 Jan 2005 01:29:53 -0000 1.11 --- ConsoleClient.java 3 May 2005 13:39:25 -0000 1.12 *************** *** 67,71 **** try { ! Message message = receiveMessage(); if (message != null) --- 67,71 ---- try { ! Message message = receive(); if (message != null) *************** *** 92,96 **** } ! public Message receiveMessage() throws IOException { String line = in.readLine(); --- 92,96 ---- } ! public Message receive() throws IOException { String line = in.readLine(); Index: QueryClient.java =================================================================== RCS file: /cvsroot/jetrix/jetrix/src/java/net/jetrix/clients/QueryClient.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** QueryClient.java 4 Apr 2005 09:36:16 -0000 1.13 --- QueryClient.java 3 May 2005 13:39:26 -0000 1.14 *************** *** 60,64 **** while (!disconnected && serverConfig.isRunning()) { ! process(receiveMessage()); } } --- 60,64 ---- while (!disconnected && serverConfig.isRunning()) { ! process(receive()); } } |
From: Emmanuel B. <sm...@us...> - 2005-05-03 11:46:14
|
Update of /cvsroot/jetrix/jetrix/src/lang In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8313/src/lang Modified Files: jetrix_en.properties jetrix_fr.properties Log Message: display the number of players & spectators online on logging onto the server Index: jetrix_fr.properties =================================================================== RCS file: /cvsroot/jetrix/jetrix/src/lang/jetrix_fr.properties,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** jetrix_fr.properties 15 Dec 2004 10:59:48 -0000 1.23 --- jetrix_fr.properties 3 May 2005 11:46:00 -0000 1.24 *************** *** 27,32 **** --- 27,39 ---- channel.team.none=<brown>*** <b>{0}</b> est seul + server.user-online=<darkBlue><red>{0}</red> {1} et <red>{2}</red> {3} est actuellement en ligne. + server.users-online=<darkBlue><red>{0}</red> {1} et <red>{2}</red> {3} sont actuellement en ligne. + common.yes=oui common.no=non + common.player=joueur + common.players=joueurs + common.spectator=spectateur + common.spectators=spectateurs command.not_implemented=[darkBlue]{0} n\'est pas encore implémenté Index: jetrix_en.properties =================================================================== RCS file: /cvsroot/jetrix/jetrix/src/lang/jetrix_en.properties,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** jetrix_en.properties 15 Dec 2004 10:59:48 -0000 1.25 --- jetrix_en.properties 3 May 2005 11:45:59 -0000 1.26 *************** *** 63,68 **** --- 63,75 ---- channel.team.none=<brown>*** <b>{0}</b> is Now Alone + server.user-online=<darkBlue><red>{0}</red> {1} and <red>{2}</red> {3} is currently online. + server.users-online=<darkBlue><red>{0}</red> {1} and <red>{2}</red> {3} are currently online. + common.yes=yes common.no=no + common.player=player + common.players=players + common.spectator=spectator + common.spectators=spectators command.not_implemented=[darkBlue]{0} is not implemented yet |
From: Emmanuel B. <sm...@us...> - 2005-05-03 11:46:14
|
Update of /cvsroot/jetrix/jetrix/doc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8313/doc Modified Files: changelog.txt todo.txt Log Message: display the number of players & spectators online on logging onto the server Index: changelog.txt =================================================================== RCS file: /cvsroot/jetrix/jetrix/doc/changelog.txt,v retrieving revision 1.74 retrieving revision 1.75 diff -C2 -d -r1.74 -r1.75 *** changelog.txt 29 Apr 2005 16:29:59 -0000 1.74 --- changelog.txt 3 May 2005 11:45:59 -0000 1.75 *************** *** 9,12 **** --- 9,13 ---- - New #survival channel (drop as many blocks as you can before you die) - Implemented the channel operator access level. It's now possible to restrict some commands to the first player in the channel (/move, /start...) + - The number of players and spectators currently online is now displayed on logging in Admin visible changes Index: todo.txt =================================================================== RCS file: /cvsroot/jetrix/jetrix/doc/todo.txt,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** todo.txt 29 Apr 2005 16:29:59 -0000 1.1 --- todo.txt 3 May 2005 11:45:59 -0000 1.2 *************** *** 11,15 **** - game auto start filter (n seconds after the end of the game) - display the team winlist for players with a team, and the player winlist for those with no team - - display the number of players & spectators online on logging onto the server - warn the players before a timeout - store the "time played" and the "time logged" for registered users --- 11,14 ---- *************** *** 17,20 **** --- 16,21 ---- - AliasFilter to replace "gg" by "good game" on the pline - friend list (/friend command + notification system) + - bonus points depending on the skill of the players (i.e intensity level on tnet.org with 5+ players and at least 4 players in the top 100) + - bonus points when the same player wins several games in a row Commands |
From: Emmanuel B. <sm...@us...> - 2005-05-03 11:46:14
|
Update of /cvsroot/jetrix/jetrix/src/java/net/jetrix/listeners In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8313/src/java/net/jetrix/listeners Modified Files: ClientListener.java Log Message: display the number of players & spectators online on logging onto the server Index: ClientListener.java =================================================================== RCS file: /cvsroot/jetrix/jetrix/src/java/net/jetrix/listeners/ClientListener.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** ClientListener.java 18 Dec 2004 00:12:51 -0000 1.16 --- ClientListener.java 3 May 2005 11:45:59 -0000 1.17 *************** *** 265,268 **** --- 265,280 ---- } + // display the number of players online + int playerCount = ClientRepository.getInstance().getPlayerCount(); + int spectatorCount = ClientRepository.getInstance().getSpectatorCount(); + + PlineMessage online = new PlineMessage(); + String key = playerCount + spectatorCount > 1 ? "server.users-online" : "server.user-online"; + String pkey = playerCount > 1 ? "key:common.players" : "key:common.player"; + String skey = spectatorCount > 1 ? "key:common.spectators" : "key:common.spectator"; + online.setKey(key, playerCount, pkey, spectatorCount, skey); + + client.send(online); + // forward the client to the server for channel assignation if (client.supportsAutoJoin()) { |
From: Emmanuel B. <sm...@us...> - 2005-05-03 10:32:23
|
Update of /cvsroot/jetrix/jetrix In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24906 Modified Files: build.xml Log Message: Included the project descriptor in the source distribution Index: build.xml =================================================================== RCS file: /cvsroot/jetrix/jetrix/build.xml,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** build.xml 13 Apr 2005 10:09:11 -0000 1.35 --- build.xml 3 May 2005 10:32:14 -0000 1.36 *************** *** 295,300 **** <zipfileset prefix="jetrix-${version}-src/" dir="."> <include name="build.xml" /> ! <include name="build.properties.sample" /> ! <include name="jetrix.properties" /> </zipfileset> <zipfileset prefix="jetrix-${version}-src/src/" dir="${src}"> --- 295,300 ---- <zipfileset prefix="jetrix-${version}-src/" dir="."> <include name="build.xml" /> ! <include name="project.xml" /> ! <include name="project.properties" /> </zipfileset> <zipfileset prefix="jetrix-${version}-src/src/" dir="${src}"> *************** *** 307,312 **** <tarfileset prefix="jetrix-${version}-src/" dir="."> <include name="build.xml" /> ! <include name="build.properties.sample" /> ! <include name="jetrix.properties" /> </tarfileset> <tarfileset prefix="jetrix-${version}-src/src/" dir="${src}"> --- 307,312 ---- <tarfileset prefix="jetrix-${version}-src/" dir="."> <include name="build.xml" /> ! <include name="project.xml" /> ! <include name="project.properties" /> </tarfileset> <tarfileset prefix="jetrix-${version}-src/src/" dir="${src}"> |
From: Emmanuel B. <sm...@us...> - 2005-05-03 00:01:10
|
Update of /cvsroot/jetrix/jetrix/src/test/net/jetrix/tools In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22196/src/test/net/jetrix/tools Modified Files: ServerDirectoryTest.java Log Message: Changed the return type of getServers() Index: ServerDirectoryTest.java =================================================================== RCS file: /cvsroot/jetrix/jetrix/src/test/net/jetrix/tools/ServerDirectoryTest.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ServerDirectoryTest.java 12 Jan 2005 19:05:07 -0000 1.1 --- ServerDirectoryTest.java 3 May 2005 00:00:57 -0000 1.2 *************** *** 20,28 **** package net.jetrix.tools; - import junit.framework.TestCase; - - import java.util.List; import java.io.IOException; import net.jetrix.agent.QueryAgent; --- 20,27 ---- package net.jetrix.tools; import java.io.IOException; + import java.util.Collection; + import junit.framework.TestCase; import net.jetrix.agent.QueryAgent; *************** *** 35,39 **** public void testGetServers() throws Exception { ! List<String> servers = ServerDirectory.getServers(); assertNotNull("null list", servers); --- 34,38 ---- public void testGetServers() throws Exception { ! Collection<String> servers = ServerDirectory.getServers(); assertNotNull("null list", servers); *************** *** 44,48 **** public void testShowVersions() throws Exception { ! List<String> servers = ServerDirectory.getServers(); for (String server : servers) --- 43,47 ---- public void testShowVersions() throws Exception { ! Collection<String> servers = ServerDirectory.getServers(); for (String server : servers) |
From: Emmanuel B. <sm...@us...> - 2005-05-03 00:00:32
|
Update of /cvsroot/jetrix/jetrix/src/java/net/jetrix/tools In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22063/src/java/net/jetrix/tools Modified Files: ServerDirectory.java Log Message: Can now retrieve the server list from tsrv.com and tetrinet.org Index: ServerDirectory.java =================================================================== RCS file: /cvsroot/jetrix/jetrix/src/java/net/jetrix/tools/ServerDirectory.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ServerDirectory.java 12 Jan 2005 19:05:07 -0000 1.1 --- ServerDirectory.java 3 May 2005 00:00:23 -0000 1.2 *************** *** 21,28 **** import java.io.BufferedReader; import java.io.InputStreamReader; import java.net.URL; ! import java.util.List; ! import java.util.ArrayList; /** --- 21,30 ---- import java.io.BufferedReader; + import java.io.IOException; import java.io.InputStreamReader; import java.net.URL; ! import java.net.MalformedURLException; ! import java.util.Collection; ! import java.util.TreeSet; /** *************** *** 30,37 **** * directories like tetrinet.org and tfast.org. * - * @since 0.2 - * * @author Emmanuel Bourg * @version $Revision$, $Date$ */ public class ServerDirectory --- 32,38 ---- * directories like tetrinet.org and tfast.org. * * @author Emmanuel Bourg * @version $Revision$, $Date$ + * @since 0.2 */ public class ServerDirectory *************** *** 40,61 **** * Return the list of registered servers. */ ! public static List<String> getServers() throws Exception { ! List<String> servers = new ArrayList<String>(); ! URL url = new URL("http://tfast.org/en/servers.php"); ! BufferedReader in = new BufferedReader(new InputStreamReader(url.openStream())); ! String line = null; ! while ((line = in.readLine()) != null) { ! if (line.contains("serv=")) { ! int i = line.indexOf("serv="); ! servers.add(line.substring(i + 5, line.indexOf("\"", i))); } } - - in.close(); // todo finally return servers; --- 41,109 ---- * Return the list of registered servers. */ ! public static Collection<String> getServers() { ! Collection<String> servers = new TreeSet<String>(); ! try ! { ! servers.addAll(extractServers(new URL("http://tfast.org/en/servers.php"), "serv=", "\"")); ! servers.addAll(extractServers(new URL("http://slummy.tetrinet.org/grav/slummy_grav.html"), "<TD><font size=\"+0\"><font face=\"helvetica,arial\">", "<")); ! servers.addAll(extractServers(new URL("http://dieterdhoker.mine.nu:8280/cgi-bin/TSRV/servers.htm"), "serverhost=", "\"")); ! } ! catch (MalformedURLException e) ! { ! e.printStackTrace(); ! } ! return servers; ! } ! ! /** ! * Extract a list of server from a web page. There must be one server by line only ! * ! * @since 0.3 ! * ! * @param url the URL of the page containing the list of servers ! * @param startString the string right before the server name ! * @param endString the string to find right after the server name ! */ ! private static Collection<String> extractServers(URL url, String startString, String endString) ! { ! Collection<String> servers = new TreeSet<String>(); ! BufferedReader in = null; ! ! try { ! in = new BufferedReader(new InputStreamReader(url.openStream())); ! ! String line = null; ! ! while ((line = in.readLine()) != null) { ! if (line.contains(startString)) ! { ! int i = line.indexOf(startString) + startString.length(); ! servers.add(line.substring(i, line.indexOf(endString, i)).toLowerCase()); ! } ! } ! } ! catch (Exception e) ! { ! e.printStackTrace(); ! } ! finally ! { ! if (in != null) ! { ! try ! { ! in.close(); ! } ! catch (IOException e) ! { ! e.printStackTrace(); ! } } } return servers; |
From: Emmanuel B. <sm...@us...> - 2005-05-02 22:11:33
|
Update of /cvsroot/jetrix/jetrix In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27044 Removed Files: build.properties.sample Log Message: no message --- build.properties.sample DELETED --- |
From: Emmanuel B. <sm...@us...> - 2005-05-02 16:30:11
|
Update of /cvsroot/jetrix/jetrix In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18730 Modified Files: project.properties project.xml Log Message: removed the systray4j dependency Index: project.properties =================================================================== RCS file: /cvsroot/jetrix/jetrix/project.properties,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** project.properties 7 Apr 2005 00:12:10 -0000 1.10 --- project.properties 2 May 2005 15:08:58 -0000 1.11 *************** *** 10,14 **** maven.jar.override=on maven.jar.jcrontab=lib/jcrontab-1.4.1-light.jar - maven.jar.systray4j=lib/systray4j-2.4.1.jar maven.javadoc.use=false --- 10,13 ---- Index: project.xml =================================================================== RCS file: /cvsroot/jetrix/jetrix/project.xml,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** project.xml 17 Jan 2005 20:56:45 -0000 1.9 --- project.xml 2 May 2005 15:08:58 -0000 1.10 *************** *** 161,169 **** </dependency> - <dependency> - <id>systray4j</id> - <version>2.4.1</version> - </dependency> - <!-- Needed for testing --> <dependency> --- 161,164 ---- |
From: Emmanuel B. <sm...@us...> - 2005-04-29 16:30:12
|
Update of /cvsroot/jetrix/jetrix/doc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8264 Modified Files: changelog.txt Added Files: todo.txt Log Message: Split the todo list is a separate file Index: changelog.txt =================================================================== RCS file: /cvsroot/jetrix/jetrix/doc/changelog.txt,v retrieving revision 1.73 retrieving revision 1.74 diff -C2 -d -r1.73 -r1.74 *** changelog.txt 27 Jan 2005 21:40:50 -0000 1.73 --- changelog.txt 29 Apr 2005 16:29:59 -0000 1.74 *************** *** 2,39 **** ================ - TODO - ---- - - zip files on the patch server - - /snoop - - /help <command name> - - friend list - - /mute <nick> - - /ban & /unban - - /lfd looking for duel - - run as a service on Windows (using Java Service Wrapper) - - run as a service on Linux (init.d script) - - change dynamically the aliases of a command - - add and remove filters from the administration console - - java web start demo - - feature matrix similar to http://damagecontrol.codehaus.org/Continuous+Integration+Server+Feature+Matrix - - deploy as a web application - - JRobin integration for server and channels statistics - - AliasFilter to replace "gg" by "good game" on the pline - - per channel commands - - winlist management in the admin console - - display the team winlist for players with a team, and the player winlist for those with no team - - display the number of players & spectators online on logging onto the server - - /points to display the score and the rank in the current winlist - - tetris mode, do a tetris as fast as possible (single player). Show intermediate times vs the best player recorded - - warn the players before a timeout - - ip based language detection (using geoip) - - store the "time played" and the "time logged" for registered users - - add a help button on the webadmin redirecting to the SF forum - - game auto start filter (n seconds after the end of the game) - - downstack game mod : start at height 16, the first player to clear 30 lines wins - - partial name matching for /goto - - cheat control: count the specials seen in the field and check the specials sent - - channel reordering from the admin console - - create a channel from the admin console Changes in version 0.3 (2005-??-??) --- 2,5 ---- --- NEW FILE: todo.txt --- Jetrix todo list ================ Want to contribute ? Feel free to pick a task below, but check with me if the task hasn't been assigned already. Gameplay - downstack game mod : start at height 16, the first player to clear 30 lines wins - cheat control: count the specials seen in the field and check the specials sent - tetris mode, do a tetris as fast as possible (single player). Show intermediate times vs the best player recorded - do not update the winlist if the game lasted less than n seconds - game auto start filter (n seconds after the end of the game) - display the team winlist for players with a team, and the player winlist for those with no team - display the number of players & spectators online on logging onto the server - warn the players before a timeout - store the "time played" and the "time logged" for registered users - ip based language detection (using geoip) - AliasFilter to replace "gg" by "good game" on the pline - friend list (/friend command + notification system) Commands - /mute <nick> - /ban & /unban - /lfd looking for duel - /points to display the score and the rank in the current winlist - partial name matching for /goto - /snoop - /help <command name> - change dynamically the aliases of a command - per channel commands Administration - channel reordering from the admin console - create a channel from the admin console - add a help button on the webadmin redirecting to the SF forum - winlist management in the admin console - add and remove filters from the administration console - JRobin integration for server and channels statistics - run as a service on Windows (using Java Service Wrapper) - run as a service on Linux (init.d script) - deploy as a web application Website - feature matrix similar to http://damagecontrol.codehaus.org/Continuous+Integration+Server+Feature+Matrix - automatic generation of the commands documentation - java web start demo - compress the files on the patch server |
From: Emmanuel B. <sm...@us...> - 2005-04-26 23:30:08
|
Update of /cvsroot/jetrix/jetrix/src/java/net/jetrix/listeners In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27471/net/jetrix/listeners Modified Files: TetrinetListener.java Log Message: The listener now sends the client identification request Index: TetrinetListener.java =================================================================== RCS file: /cvsroot/jetrix/jetrix/src/java/net/jetrix/listeners/TetrinetListener.java,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** TetrinetListener.java 12 Jan 2005 18:43:39 -0000 1.19 --- TetrinetListener.java 26 Apr 2005 23:30:00 -0000 1.20 *************** *** 1,5 **** /** * Jetrix TetriNET Server ! * Copyright (C) 2001-2003 Emmanuel Bourg * * This program is free software; you can redistribute it and/or --- 1,5 ---- /** * Jetrix TetriNET Server ! * Copyright (C) 2001-2005 Emmanuel Bourg * * This program is free software; you can redistribute it and/or *************** *** 25,31 **** import net.jetrix.*; - import net.jetrix.protocols.*; import net.jetrix.clients.*; import net.jetrix.messages.*; /** --- 25,31 ---- import net.jetrix.*; import net.jetrix.clients.*; import net.jetrix.messages.*; + import net.jetrix.protocols.*; /** *************** *** 52,56 **** { // read the first line sent by the client ! TetrinetProtocol protocol1 = (TetrinetProtocol) protocolManager.getProtocol(TetrinetProtocol.class); String init = protocol1.readLine(new InputStreamReader(socket.getInputStream())); --- 52,56 ---- { // read the first line sent by the client ! Protocol protocol1 = protocolManager.getProtocol(TetrinetProtocol.class); String init = protocol1.readLine(new InputStreamReader(socket.getInputStream())); *************** *** 88,92 **** User user = new User(); user.setName(tokens.get(1)); ! client.setSocket(socket); client.setUser(user); client.setVersion((String) tokens.get(2)); --- 88,92 ---- User user = new User(); user.setName(tokens.get(1)); ! client.setUser(user); client.setVersion((String) tokens.get(2)); *************** *** 104,107 **** --- 104,109 ---- } + client.setSocket(socket); + if (tokens.size() > 3) { *************** *** 111,114 **** --- 113,119 ---- } + // send the client identification request + client.send(new LevelMessage()); + return client; } |
From: Emmanuel B. <sm...@us...> - 2005-04-26 21:07:45
|
Update of /cvsroot/jetrix/jetrix/src/java/net/jetrix/messages In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10695/java/net/jetrix/messages Modified Files: CommandMessage.java Log Message: CommandMessage now extends TextMessage Index: CommandMessage.java =================================================================== RCS file: /cvsroot/jetrix/jetrix/src/java/net/jetrix/messages/CommandMessage.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** CommandMessage.java 10 Dec 2004 12:40:44 -0000 1.7 --- CommandMessage.java 26 Apr 2005 21:07:36 -0000 1.8 *************** *** 30,34 **** * @version $Revision$, $Date$ */ ! public class CommandMessage extends PlineMessage { private String command; --- 30,34 ---- * @version $Revision$, $Date$ */ ! public class CommandMessage extends TextMessage { private String command; |
From: Emmanuel B. <sm...@us...> - 2005-04-26 20:43:06
|
Update of /cvsroot/jetrix/jetrix/src/test/net/jetrix In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30005/test/net/jetrix Modified Files: ProtocolManagerTest.java Log Message: Changed to use the generified getProtocol method of ProtocolManager Index: ProtocolManagerTest.java =================================================================== RCS file: /cvsroot/jetrix/jetrix/src/test/net/jetrix/ProtocolManagerTest.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ProtocolManagerTest.java 5 Jan 2005 01:29:56 -0000 1.3 --- ProtocolManagerTest.java 26 Apr 2005 20:42:56 -0000 1.4 *************** *** 56,60 **** try { ! manager.getProtocol(Object.class); } catch (Exception e) --- 56,60 ---- try { ! manager.getProtocol(Protocol.class); } catch (Exception e) |