lobby-svn Mailing List for Lobby (Page 41)
Brought to you by:
yuranet
You can subscribe to this list here.
2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(9) |
Jun
(3) |
Jul
|
Aug
(2) |
Sep
|
Oct
|
Nov
|
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2007 |
Jan
|
Feb
(8) |
Mar
(10) |
Apr
(2) |
May
(96) |
Jun
(33) |
Jul
(113) |
Aug
(24) |
Sep
(35) |
Oct
(17) |
Nov
(36) |
Dec
(1) |
2008 |
Jan
(10) |
Feb
|
Mar
(35) |
Apr
(14) |
May
(2) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2010 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2012 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(6) |
Aug
(23) |
Sep
(19) |
Oct
(13) |
Nov
(59) |
Dec
(42) |
2013 |
Jan
(7) |
Feb
(10) |
Mar
(29) |
Apr
(10) |
May
(28) |
Jun
(3) |
Jul
(7) |
Aug
(5) |
Sep
|
Oct
|
Nov
|
Dec
(9) |
2014 |
Jan
(7) |
Feb
(1) |
Mar
(11) |
Apr
|
May
|
Jun
|
Jul
(3) |
Aug
(3) |
Sep
|
Oct
|
Nov
(1) |
Dec
(3) |
2015 |
Jan
(10) |
Feb
|
Mar
(5) |
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
(2) |
Oct
(1) |
Nov
(1) |
Dec
(1) |
2016 |
Jan
(2) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
2017 |
Jan
(3) |
Feb
(1) |
Mar
(1) |
Apr
|
May
|
Jun
(2) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2018 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
(3) |
Sep
(7) |
Oct
(4) |
Nov
|
Dec
(16) |
2019 |
Jan
(2) |
Feb
(3) |
Mar
(4) |
Apr
|
May
|
Jun
(2) |
Jul
(2) |
Aug
|
Sep
(3) |
Oct
(8) |
Nov
(3) |
Dec
(6) |
2020 |
Jan
|
Feb
|
Mar
(4) |
Apr
(11) |
May
(12) |
Jun
(12) |
Jul
(8) |
Aug
(10) |
Sep
(3) |
Oct
(11) |
Nov
(7) |
Dec
|
2021 |
Jan
|
Feb
|
Mar
(5) |
Apr
(7) |
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(19) |
Dec
(15) |
2022 |
Jan
(2) |
Feb
(2) |
Mar
|
Apr
|
May
(3) |
Jun
(2) |
Jul
(2) |
Aug
(1) |
Sep
|
Oct
(2) |
Nov
(1) |
Dec
(3) |
2023 |
Jan
(1) |
Feb
|
Mar
|
Apr
(5) |
May
(4) |
Jun
(4) |
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2024 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
(3) |
2025 |
Jan
|
Feb
(1) |
Mar
(1) |
Apr
(3) |
May
(7) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <air...@us...> - 2007-02-26 04:04:40
|
Revision: 25 http://svn.sourceforge.net/slac/?rev=25&view=rev Author: airpizza Date: 2007-02-25 20:04:37 -0800 (Sun, 25 Feb 2007) Log Message: ----------- Might help to add the serveradministrator class to the commit Added Paths: ----------- trunk/src/org/slac/server/ServerAdministrator.java Added: trunk/src/org/slac/server/ServerAdministrator.java =================================================================== --- trunk/src/org/slac/server/ServerAdministrator.java (rev 0) +++ trunk/src/org/slac/server/ServerAdministrator.java 2007-02-26 04:04:37 UTC (rev 25) @@ -0,0 +1,33 @@ +package org.slac.server; + +//Administrative things can go here too +public class ServerAdministrator implements Runnable +{ + public static boolean running = true; + private static ServerAdministrator me; //Needed to keep from garbage collected?? + /** + * @param args + */ + public static void main(String[] args) { + + me = new ServerAdministrator(); + new Thread(me).start(); + } + public void run() + { + Server theServer = new Server(1964,100); + /*while(running) + { +// TODO Add administrative things + try + { + wait(); + } + catch(InterruptedException e) + { + e.printStackTrace(); + } + }*/ + } + +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <air...@us...> - 2007-02-26 04:03:33
|
Revision: 24 http://svn.sourceforge.net/slac/?rev=24&view=rev Author: airpizza Date: 2007-02-25 20:03:31 -0800 (Sun, 25 Feb 2007) Log Message: ----------- FIX:Critical Bugs with Initial Commit ENH:ServerAdministrator class (previously serverloader) is now runnable instead of the Server class. ServerAdministrator currently does not do anything but start the server, in the future though it will hold the GUI/CLI administration to the server Modified Paths: -------------- trunk/DOCUMENTATION/allclasses-frame.html trunk/DOCUMENTATION/allclasses-noframe.html trunk/DOCUMENTATION/constant-values.html trunk/DOCUMENTATION/deprecated-list.html trunk/DOCUMENTATION/help-doc.html trunk/DOCUMENTATION/index-all.html trunk/DOCUMENTATION/index.html trunk/DOCUMENTATION/org/slac/server/ChatLobby.html trunk/DOCUMENTATION/org/slac/server/ClientThread.html trunk/DOCUMENTATION/org/slac/server/GameLobby.html trunk/DOCUMENTATION/org/slac/server/Lobby.html trunk/DOCUMENTATION/org/slac/server/Server.html trunk/DOCUMENTATION/org/slac/server/package-frame.html trunk/DOCUMENTATION/org/slac/server/package-summary.html trunk/DOCUMENTATION/org/slac/server/package-tree.html trunk/DOCUMENTATION/overview-tree.html trunk/src/org/slac/server/ChatLobby.java trunk/src/org/slac/server/ClientThread.java trunk/src/org/slac/server/GameLobby.java trunk/src/org/slac/server/Lobby.java trunk/src/org/slac/server/Server.java Added Paths: ----------- trunk/src/org/slac/server/AcceptConnections.java Removed Paths: ------------- trunk/src/org/slac/server/ServerLoader.java Modified: trunk/DOCUMENTATION/allclasses-frame.html =================================================================== --- trunk/DOCUMENTATION/allclasses-frame.html 2007-02-25 23:36:41 UTC (rev 23) +++ trunk/DOCUMENTATION/allclasses-frame.html 2007-02-26 04:03:31 UTC (rev 24) @@ -2,7 +2,7 @@ <!--NewPage--> <HTML> <HEAD> -<!-- Generated by javadoc (build 1.6.0) on Sun Feb 25 16:31:15 EST 2007 --> +<!-- Generated by javadoc (build 1.6.0) on Sun Feb 25 22:57:13 EST 2007 --> <TITLE> All Classes </TITLE> @@ -21,17 +21,21 @@ <TABLE BORDER="0" WIDTH="100%" SUMMARY=""> <TR> -<TD NOWRAP><FONT CLASS="FrameItemFont"><A HREF="org/slac/server/ChatLobby.html" title="class in org.slac.server" target="classFrame">ChatLobby</A> +<TD NOWRAP><FONT CLASS="FrameItemFont"><A HREF="org/slac/server/AcceptConnections.html" title="class in org.slac.server" target="classFrame">AcceptConnections</A> <BR> +<A HREF="org/slac/server/ChatLobby.html" title="class in org.slac.server" target="classFrame">ChatLobby</A> +<BR> <A HREF="org/slac/server/ClientThread.html" title="class in org.slac.server" target="classFrame">ClientThread</A> <BR> <A HREF="org/slac/server/GameLobby.html" title="class in org.slac.server" target="classFrame">GameLobby</A> <BR> <A HREF="org/slac/server/Lobby.html" title="interface in org.slac.server" target="classFrame"><I>Lobby</I></A> <BR> +<A HREF="org/slac/server/Protocol.html" title="enum in org.slac.server" target="classFrame">Protocol</A> +<BR> <A HREF="org/slac/server/Server.html" title="class in org.slac.server" target="classFrame">Server</A> <BR> -<A HREF="org/slac/server/ServerLoader.html" title="class in org.slac.server" target="classFrame">ServerLoader</A> +<A HREF="org/slac/server/ServerAdministrator.html" title="class in org.slac.server" target="classFrame">ServerAdministrator</A> <BR> </FONT></TD> </TR> Modified: trunk/DOCUMENTATION/allclasses-noframe.html =================================================================== --- trunk/DOCUMENTATION/allclasses-noframe.html 2007-02-25 23:36:41 UTC (rev 23) +++ trunk/DOCUMENTATION/allclasses-noframe.html 2007-02-26 04:03:31 UTC (rev 24) @@ -2,7 +2,7 @@ <!--NewPage--> <HTML> <HEAD> -<!-- Generated by javadoc (build 1.6.0) on Sun Feb 25 16:31:15 EST 2007 --> +<!-- Generated by javadoc (build 1.6.0) on Sun Feb 25 22:57:13 EST 2007 --> <TITLE> All Classes </TITLE> @@ -21,17 +21,21 @@ <TABLE BORDER="0" WIDTH="100%" SUMMARY=""> <TR> -<TD NOWRAP><FONT CLASS="FrameItemFont"><A HREF="org/slac/server/ChatLobby.html" title="class in org.slac.server">ChatLobby</A> +<TD NOWRAP><FONT CLASS="FrameItemFont"><A HREF="org/slac/server/AcceptConnections.html" title="class in org.slac.server">AcceptConnections</A> <BR> +<A HREF="org/slac/server/ChatLobby.html" title="class in org.slac.server">ChatLobby</A> +<BR> <A HREF="org/slac/server/ClientThread.html" title="class in org.slac.server">ClientThread</A> <BR> <A HREF="org/slac/server/GameLobby.html" title="class in org.slac.server">GameLobby</A> <BR> <A HREF="org/slac/server/Lobby.html" title="interface in org.slac.server"><I>Lobby</I></A> <BR> +<A HREF="org/slac/server/Protocol.html" title="enum in org.slac.server">Protocol</A> +<BR> <A HREF="org/slac/server/Server.html" title="class in org.slac.server">Server</A> <BR> -<A HREF="org/slac/server/ServerLoader.html" title="class in org.slac.server">ServerLoader</A> +<A HREF="org/slac/server/ServerAdministrator.html" title="class in org.slac.server">ServerAdministrator</A> <BR> </FONT></TD> </TR> Modified: trunk/DOCUMENTATION/constant-values.html =================================================================== --- trunk/DOCUMENTATION/constant-values.html 2007-02-25 23:36:41 UTC (rev 23) +++ trunk/DOCUMENTATION/constant-values.html 2007-02-26 04:03:31 UTC (rev 24) @@ -2,7 +2,7 @@ <!--NewPage--> <HTML> <HEAD> -<!-- Generated by javadoc (build 1.6.0) on Sun Feb 25 16:31:15 EST 2007 --> +<!-- Generated by javadoc (build 1.6.0) on Sun Feb 25 22:57:13 EST 2007 --> <TITLE> Constant Field Values </TITLE> Modified: trunk/DOCUMENTATION/deprecated-list.html =================================================================== --- trunk/DOCUMENTATION/deprecated-list.html 2007-02-25 23:36:41 UTC (rev 23) +++ trunk/DOCUMENTATION/deprecated-list.html 2007-02-26 04:03:31 UTC (rev 24) @@ -2,7 +2,7 @@ <!--NewPage--> <HTML> <HEAD> -<!-- Generated by javadoc (build 1.6.0) on Sun Feb 25 16:31:15 EST 2007 --> +<!-- Generated by javadoc (build 1.6.0) on Sun Feb 25 22:57:13 EST 2007 --> <TITLE> Deprecated List </TITLE> Modified: trunk/DOCUMENTATION/help-doc.html =================================================================== --- trunk/DOCUMENTATION/help-doc.html 2007-02-25 23:36:41 UTC (rev 23) +++ trunk/DOCUMENTATION/help-doc.html 2007-02-26 04:03:31 UTC (rev 24) @@ -2,7 +2,7 @@ <!--NewPage--> <HTML> <HEAD> -<!-- Generated by javadoc (build 1.6.0) on Sun Feb 25 16:31:15 EST 2007 --> +<!-- Generated by javadoc (build 1.6.0) on Sun Feb 25 22:57:13 EST 2007 --> <TITLE> API Help </TITLE> Modified: trunk/DOCUMENTATION/index-all.html =================================================================== --- trunk/DOCUMENTATION/index-all.html 2007-02-25 23:36:41 UTC (rev 23) +++ trunk/DOCUMENTATION/index-all.html 2007-02-26 04:03:31 UTC (rev 24) @@ -2,7 +2,7 @@ <!--NewPage--> <HTML> <HEAD> -<!-- Generated by javadoc (build 1.6.0) on Sun Feb 25 16:31:15 EST 2007 --> +<!-- Generated by javadoc (build 1.6.0) on Sun Feb 25 22:57:13 EST 2007 --> <TITLE> Index </TITLE> @@ -76,11 +76,11 @@ <A NAME="skip-navbar_top"></A> <!-- ========= END OF TOP NAVBAR ========= --> -<A HREF="#_A_">A</A> <A HREF="#_C_">C</A> <A HREF="#_G_">G</A> <A HREF="#_I_">I</A> <A HREF="#_K_">K</A> <A HREF="#_L_">L</A> <A HREF="#_M_">M</A> <A HREF="#_N_">N</A> <A HREF="#_O_">O</A> <A HREF="#_P_">P</A> <A HREF="#_R_">R</A> <A HREF="#_S_">S</A> <HR> +<A HREF="#_A_">A</A> <A HREF="#_C_">C</A> <A HREF="#_G_">G</A> <A HREF="#_I_">I</A> <A HREF="#_K_">K</A> <A HREF="#_L_">L</A> <A HREF="#_M_">M</A> <A HREF="#_N_">N</A> <A HREF="#_O_">O</A> <A HREF="#_P_">P</A> <A HREF="#_R_">R</A> <A HREF="#_S_">S</A> <A HREF="#_V_">V</A> <HR> <A NAME="_A_"><!-- --></A><H2> <B>A</B></H2> <DL> -<DT><A HREF="./org/slac/server/ChatLobby.html#addUser(org.slac.server.ClientThread, java.util.UUID, java.lang.String)"><B>addUser(ClientThread, UUID, String)</B></A> - +<DT><A HREF="./org/slac/server/AcceptConnections.html" title="class in org.slac.server"><B>AcceptConnections</B></A> - Class in <A HREF="./org/slac/server/package-summary.html">org.slac.server</A><DD> <DT><A HREF="./org/slac/server/ChatLobby.html#addUser(org.slac.server.ClientThread, java.util.UUID, java.lang.String)"><B>addUser(ClientThread, UUID, String)</B></A> - Method in class org.slac.server.<A HREF="./org/slac/server/ChatLobby.html" title="class in org.slac.server">ChatLobby</A> <DD> <DT><A HREF="./org/slac/server/Lobby.html#addUser(org.slac.server.ClientThread, java.util.UUID, java.lang.String)"><B>addUser(ClientThread, UUID, String)</B></A> - @@ -100,24 +100,24 @@ <DT><A HREF="./org/slac/server/Lobby.html#canJoin()"><B>canJoin()</B></A> - Method in interface org.slac.server.<A HREF="./org/slac/server/Lobby.html" title="interface in org.slac.server">Lobby</A> <DD> -<DT><A HREF="./org/slac/server/ClientThread.html#changeLobbies(java.lang.String, boolean)"><B>changeLobbies(String, boolean)</B></A> - +<DT><A HREF="./org/slac/server/ClientThread.html#changeLobbies(java.lang.String, java.lang.Boolean)"><B>changeLobbies(String, Boolean)</B></A> - Method in class org.slac.server.<A HREF="./org/slac/server/ClientThread.html" title="class in org.slac.server">ClientThread</A> <DD>Can Only be called by server Updates the client with lobbies that have been added or deleted -<DT><A HREF="./org/slac/server/ClientThread.html#changeUserClass(java.lang.String, boolean)"><B>changeUserClass(String, boolean)</B></A> - +<DT><A HREF="./org/slac/server/ClientThread.html#changeUserClass(java.lang.String, java.lang.Boolean)"><B>changeUserClass(String, Boolean)</B></A> - Method in class org.slac.server.<A HREF="./org/slac/server/ClientThread.html" title="class in org.slac.server">ClientThread</A> <DD> -<DT><A HREF="./org/slac/server/ClientThread.html#changeUsers(java.lang.String, boolean)"><B>changeUsers(String, boolean)</B></A> - +<DT><A HREF="./org/slac/server/ClientThread.html#changeUsers(java.lang.String, java.lang.Boolean)"><B>changeUsers(String, Boolean)</B></A> - Method in class org.slac.server.<A HREF="./org/slac/server/ClientThread.html" title="class in org.slac.server">ClientThread</A> <DD>Can only be called by server Updates the client with users that have been added or deleted -<DT><A HREF="./org/slac/server/ClientThread.html#changeUsersLobby(java.lang.String, boolean)"><B>changeUsersLobby(String, boolean)</B></A> - +<DT><A HREF="./org/slac/server/ClientThread.html#changeUsersLobby(java.lang.String, java.lang.Boolean)"><B>changeUsersLobby(String, Boolean)</B></A> - Method in class org.slac.server.<A HREF="./org/slac/server/ClientThread.html" title="class in org.slac.server">ClientThread</A> <DD>Can only be called by the server -<DT><A HREF="./org/slac/server/ClientThread.html#chat(java.lang.String, boolean)"><B>chat(String, boolean)</B></A> - +<DT><A HREF="./org/slac/server/ClientThread.html#chat(java.lang.String, java.lang.Boolean)"><B>chat(String, Boolean)</B></A> - Method in class org.slac.server.<A HREF="./org/slac/server/ClientThread.html" title="class in org.slac.server">ClientThread</A> <DD> -<DT><A HREF="./org/slac/server/ChatLobby.html" title="class in org.slac.server"><B>ChatLobby</B></A> - Class in <A HREF="./org/slac/server/package-summary.html">org.slac.server</A><DD> <DT><A HREF="./org/slac/server/ChatLobby.html#ChatLobby(java.lang.String, org.slac.server.Server, int, boolean, java.lang.String)"><B>ChatLobby(String, Server, int, boolean, String)</B></A> - +<DT><A HREF="./org/slac/server/ChatLobby.html" title="class in org.slac.server"><B>ChatLobby</B></A> - Class in <A HREF="./org/slac/server/package-summary.html">org.slac.server</A><DD> <DT><A HREF="./org/slac/server/ChatLobby.html#ChatLobby(java.lang.String, org.slac.server.Server, int, java.lang.String)"><B>ChatLobby(String, Server, int, String)</B></A> - Constructor for class org.slac.server.<A HREF="./org/slac/server/ChatLobby.html" title="class in org.slac.server">ChatLobby</A> <DD> <DT><A HREF="./org/slac/server/ChatLobby.html#ChatLobby(java.lang.String, org.slac.server.Server, int)"><B>ChatLobby(String, Server, int)</B></A> - @@ -134,7 +134,7 @@ <DT><A HREF="./org/slac/server/GameLobby.html" title="class in org.slac.server"><B>GameLobby</B></A> - Class in <A HREF="./org/slac/server/package-summary.html">org.slac.server</A><DD> <DT><A HREF="./org/slac/server/GameLobby.html#GameLobby(java.lang.String, org.slac.server.Server, int)"><B>GameLobby(String, Server, int)</B></A> - Constructor for class org.slac.server.<A HREF="./org/slac/server/GameLobby.html" title="class in org.slac.server">GameLobby</A> <DD> -<DT><A HREF="./org/slac/server/GameLobby.html#GameLobby(java.lang.String, org.slac.server.Server, int, java.lang.String, boolean, java.lang.String)"><B>GameLobby(String, Server, int, String, boolean, String)</B></A> - +<DT><A HREF="./org/slac/server/GameLobby.html#GameLobby(java.lang.String, org.slac.server.Server, int, java.lang.String, java.lang.String)"><B>GameLobby(String, Server, int, String, String)</B></A> - Constructor for class org.slac.server.<A HREF="./org/slac/server/GameLobby.html" title="class in org.slac.server">GameLobby</A> <DD> <DT><A HREF="./org/slac/server/ChatLobby.html#getLobbyName()"><B>getLobbyName()</B></A> - @@ -149,6 +149,9 @@ <DT><A HREF="./org/slac/server/Lobby.html#getLobbyType()"><B>getLobbyType()</B></A> - Method in interface org.slac.server.<A HREF="./org/slac/server/Lobby.html" title="interface in org.slac.server">Lobby</A> <DD> +<DT><A HREF="./org/slac/server/Server.html#getMaxClass(java.util.UUID)"><B>getMaxClass(UUID)</B></A> - +Method in class org.slac.server.<A HREF="./org/slac/server/Server.html" title="class in org.slac.server">Server</A> +<DD> <DT><A HREF="./org/slac/server/ChatLobby.html#getUsers()"><B>getUsers()</B></A> - Method in class org.slac.server.<A HREF="./org/slac/server/ChatLobby.html" title="class in org.slac.server">ChatLobby</A> <DD> @@ -177,10 +180,10 @@ <A NAME="_K_"><!-- --></A><H2> <B>K</B></H2> <DL> -<DT><A HREF="./org/slac/server/ClientThread.html#kickUser(java.lang.String, boolean)"><B>kickUser(String, boolean)</B></A> - +<DT><A HREF="./org/slac/server/ClientThread.html#kickUser(java.lang.String, java.lang.Boolean)"><B>kickUser(String, Boolean)</B></A> - Method in class org.slac.server.<A HREF="./org/slac/server/ClientThread.html" title="class in org.slac.server">ClientThread</A> <DD> -<DT><A HREF="./org/slac/server/ClientThread.html#kickUserGame(java.lang.String, boolean)"><B>kickUserGame(String, boolean)</B></A> - +<DT><A HREF="./org/slac/server/ClientThread.html#kickUserGame(java.lang.String, java.lang.Boolean)"><B>kickUserGame(String, Boolean)</B></A> - Method in class org.slac.server.<A HREF="./org/slac/server/ClientThread.html" title="class in org.slac.server">ClientThread</A> <DD> </DL> @@ -188,19 +191,26 @@ <A NAME="_L_"><!-- --></A><H2> <B>L</B></H2> <DL> -<DT><A HREF="./org/slac/server/Lobby.html" title="interface in org.slac.server"><B>Lobby</B></A> - Interface in <A HREF="./org/slac/server/package-summary.html">org.slac.server</A><DD> <DT><A HREF="./org/slac/server/ClientThread.html#login(java.lang.String, boolean)"><B>login(String, boolean)</B></A> - +<DT><A HREF="./org/slac/server/ChatLobby.html#leaveLobby(java.util.UUID)"><B>leaveLobby(UUID)</B></A> - +Method in class org.slac.server.<A HREF="./org/slac/server/ChatLobby.html" title="class in org.slac.server">ChatLobby</A> +<DD> +<DT><A HREF="./org/slac/server/Lobby.html#leaveLobby(java.util.UUID)"><B>leaveLobby(UUID)</B></A> - +Method in interface org.slac.server.<A HREF="./org/slac/server/Lobby.html" title="interface in org.slac.server">Lobby</A> +<DD> +<DT><A HREF="./org/slac/server/Lobby.html" title="interface in org.slac.server"><B>Lobby</B></A> - Interface in <A HREF="./org/slac/server/package-summary.html">org.slac.server</A><DD> <DT><A HREF="./org/slac/server/ClientThread.html#login(java.lang.String, java.lang.Boolean)"><B>login(String, Boolean)</B></A> - Method in class org.slac.server.<A HREF="./org/slac/server/ClientThread.html" title="class in org.slac.server">ClientThread</A> <DD>Can't be called by the server <DT><A HREF="./org/slac/server/Server.html#login(java.lang.String, java.util.UUID)"><B>login(String, UUID)</B></A> - Method in class org.slac.server.<A HREF="./org/slac/server/Server.html" title="class in org.slac.server">Server</A> -<DD> -<DT><A HREF="./org/slac/server/ClientThread.html#loginFailed(java.lang.String, boolean)"><B>loginFailed(String, boolean)</B></A> - +<DD>This implementation will change once we proceede to setup a database with usernames + and passwords +<DT><A HREF="./org/slac/server/ClientThread.html#loginFailed(java.lang.String, java.lang.Boolean)"><B>loginFailed(String, Boolean)</B></A> - Method in class org.slac.server.<A HREF="./org/slac/server/ClientThread.html" title="class in org.slac.server">ClientThread</A> <DD>Can only be called by the server -<DT><A HREF="./org/slac/server/ClientThread.html#loginOk(java.lang.String, boolean)"><B>loginOk(String, boolean)</B></A> - +<DT><A HREF="./org/slac/server/ClientThread.html#loginOk(java.lang.String, java.lang.Boolean)"><B>loginOk(String, Boolean)</B></A> - Method in class org.slac.server.<A HREF="./org/slac/server/ClientThread.html" title="class in org.slac.server">ClientThread</A> <DD>Can only be called by the server -<DT><A HREF="./org/slac/server/ClientThread.html#logout(java.lang.String, boolean)"><B>logout(String, boolean)</B></A> - +<DT><A HREF="./org/slac/server/ClientThread.html#logout(java.lang.String, java.lang.Boolean)"><B>logout(String, Boolean)</B></A> - Method in class org.slac.server.<A HREF="./org/slac/server/ClientThread.html" title="class in org.slac.server">ClientThread</A> <DD>Tells either the client or the server that they are disconnecting </DL> @@ -208,8 +218,8 @@ <A NAME="_M_"><!-- --></A><H2> <B>M</B></H2> <DL> -<DT><A HREF="./org/slac/server/ServerLoader.html#main(java.lang.String[])"><B>main(String[])</B></A> - -Static method in class org.slac.server.<A HREF="./org/slac/server/ServerLoader.html" title="class in org.slac.server">ServerLoader</A> +<DT><A HREF="./org/slac/server/ServerAdministrator.html#main(java.lang.String[])"><B>main(String[])</B></A> - +Static method in class org.slac.server.<A HREF="./org/slac/server/ServerAdministrator.html" title="class in org.slac.server">ServerAdministrator</A> <DD> <DT><A HREF="./org/slac/server/ChatLobby.html#maxUsers()"><B>maxUsers()</B></A> - Method in class org.slac.server.<A HREF="./org/slac/server/ChatLobby.html" title="class in org.slac.server">ChatLobby</A> @@ -217,7 +227,7 @@ <DT><A HREF="./org/slac/server/Lobby.html#maxUsers()"><B>maxUsers()</B></A> - Method in interface org.slac.server.<A HREF="./org/slac/server/Lobby.html" title="interface in org.slac.server">Lobby</A> <DD> -<DT><A HREF="./org/slac/server/ClientThread.html#motd(java.lang.String, boolean)"><B>motd(String, boolean)</B></A> - +<DT><A HREF="./org/slac/server/ClientThread.html#motd(java.lang.String, java.lang.Boolean)"><B>motd(String, Boolean)</B></A> - Method in class org.slac.server.<A HREF="./org/slac/server/ClientThread.html" title="class in org.slac.server">ClientThread</A> <DD>Can only be called by server </DL> @@ -225,13 +235,13 @@ <A NAME="_N_"><!-- --></A><H2> <B>N</B></H2> <DL> -<DT><A HREF="./org/slac/server/Server.html#newChatLobby(java.lang.String, int, boolean, java.lang.String)"><B>newChatLobby(String, int, boolean, String)</B></A> - +<DT><A HREF="./org/slac/server/Server.html#newChatLobby(java.lang.String, int, java.lang.String)"><B>newChatLobby(String, int, String)</B></A> - Method in class org.slac.server.<A HREF="./org/slac/server/Server.html" title="class in org.slac.server">Server</A> <DD> -<DT><A HREF="./org/slac/server/ClientThread.html#newGame(java.lang.String, boolean)"><B>newGame(String, boolean)</B></A> - +<DT><A HREF="./org/slac/server/ClientThread.html#newGame(java.lang.String, java.lang.Boolean)"><B>newGame(String, Boolean)</B></A> - Method in class org.slac.server.<A HREF="./org/slac/server/ClientThread.html" title="class in org.slac.server">ClientThread</A> -<DD> -<DT><A HREF="./org/slac/server/Server.html#newGameLobby(java.lang.String, int, java.lang.String, boolean, java.lang.String)"><B>newGameLobby(String, int, String, boolean, String)</B></A> - +<DD>TODO Setup a format for the message to be able to parse it +<DT><A HREF="./org/slac/server/Server.html#newGameLobby(java.lang.String, int, java.lang.String, java.lang.String)"><B>newGameLobby(String, int, String, String)</B></A> - Method in class org.slac.server.<A HREF="./org/slac/server/Server.html" title="class in org.slac.server">Server</A> <DD> <DT><A HREF="./org/slac/server/ChatLobby.html#numberUsers()"><B>numberUsers()</B></A> - @@ -245,7 +255,7 @@ <A NAME="_O_"><!-- --></A><H2> <B>O</B></H2> <DL> -<DT><A HREF="./org/slac/server/ClientThread.html#oldProtocol(java.lang.String, boolean)"><B>oldProtocol(String, boolean)</B></A> - +<DT><A HREF="./org/slac/server/ClientThread.html#oldProtocol(java.lang.String, java.lang.Boolean)"><B>oldProtocol(String, Boolean)</B></A> - Method in class org.slac.server.<A HREF="./org/slac/server/ClientThread.html" title="class in org.slac.server">ClientThread</A> <DD>Can only be called by the server <DT><A HREF="./org/slac/server/package-summary.html"><B>org.slac.server</B></A> - package org.slac.server<DD> </DL> @@ -253,10 +263,10 @@ <A NAME="_P_"><!-- --></A><H2> <B>P</B></H2> <DL> -<DT><A HREF="./org/slac/server/ClientThread.html#privateMessage(java.lang.String, boolean)"><B>privateMessage(String, boolean)</B></A> - +<DT><A HREF="./org/slac/server/ClientThread.html#privateMessage(java.lang.String, java.lang.Boolean)"><B>privateMessage(String, Boolean)</B></A> - Method in class org.slac.server.<A HREF="./org/slac/server/ClientThread.html" title="class in org.slac.server">ClientThread</A> <DD> -</DL> +<DT><A HREF="./org/slac/server/Protocol.html" title="enum in org.slac.server"><B>Protocol</B></A> - Enum in <A HREF="./org/slac/server/package-summary.html">org.slac.server</A><DD> </DL> <HR> <A NAME="_R_"><!-- --></A><H2> <B>R</B></H2> @@ -266,20 +276,25 @@ <DD> <DT><A HREF="./org/slac/server/Server.html#requestLobbyChange(java.lang.String, java.lang.String, java.util.UUID)"><B>requestLobbyChange(String, String, UUID)</B></A> - Method in class org.slac.server.<A HREF="./org/slac/server/Server.html" title="class in org.slac.server">Server</A> -<DD>This implementation will change once we proceede to setup a database with usernames - and passwords -<DT><A HREF="./org/slac/server/Server.html#requestLobbyChange(java.lang.String)"><B>requestLobbyChange(String)</B></A> - +<DD>NOT IMPLEMENTED WILL RETURN FALSE ALWAYS +<DT><A HREF="./org/slac/server/Server.html#requestLobbyChange(java.lang.String, java.util.UUID)"><B>requestLobbyChange(String, UUID)</B></A> - Method in class org.slac.server.<A HREF="./org/slac/server/Server.html" title="class in org.slac.server">Server</A> <DD> +<DT><A HREF="./org/slac/server/AcceptConnections.html#run()"><B>run()</B></A> - +Method in class org.slac.server.<A HREF="./org/slac/server/AcceptConnections.html" title="class in org.slac.server">AcceptConnections</A> +<DD> <DT><A HREF="./org/slac/server/ChatLobby.html#run()"><B>run()</B></A> - Method in class org.slac.server.<A HREF="./org/slac/server/ChatLobby.html" title="class in org.slac.server">ChatLobby</A> <DD> <DT><A HREF="./org/slac/server/ClientThread.html#run()"><B>run()</B></A> - Method in class org.slac.server.<A HREF="./org/slac/server/ClientThread.html" title="class in org.slac.server">ClientThread</A> <DD> -<DT><A HREF="./org/slac/server/Server.html#run()"><B>run()</B></A> - -Method in class org.slac.server.<A HREF="./org/slac/server/Server.html" title="class in org.slac.server">Server</A> +<DT><A HREF="./org/slac/server/ServerAdministrator.html#run()"><B>run()</B></A> - +Method in class org.slac.server.<A HREF="./org/slac/server/ServerAdministrator.html" title="class in org.slac.server">ServerAdministrator</A> <DD> +<DT><A HREF="./org/slac/server/ServerAdministrator.html#running"><B>running</B></A> - +Static variable in class org.slac.server.<A HREF="./org/slac/server/ServerAdministrator.html" title="class in org.slac.server">ServerAdministrator</A> +<DD> </DL> <HR> <A NAME="_S_"><!-- --></A><H2> @@ -294,15 +309,30 @@ <DT><A HREF="./org/slac/server/Server.html" title="class in org.slac.server"><B>Server</B></A> - Class in <A HREF="./org/slac/server/package-summary.html">org.slac.server</A><DD> <DT><A HREF="./org/slac/server/Server.html#Server(int, int)"><B>Server(int, int)</B></A> - Constructor for class org.slac.server.<A HREF="./org/slac/server/Server.html" title="class in org.slac.server">Server</A> <DD> -<DT><A HREF="./org/slac/server/ServerLoader.html" title="class in org.slac.server"><B>ServerLoader</B></A> - Class in <A HREF="./org/slac/server/package-summary.html">org.slac.server</A><DD> <DT><A HREF="./org/slac/server/ServerLoader.html#ServerLoader()"><B>ServerLoader()</B></A> - -Constructor for class org.slac.server.<A HREF="./org/slac/server/ServerLoader.html" title="class in org.slac.server">ServerLoader</A> +<DT><A HREF="./org/slac/server/ServerAdministrator.html" title="class in org.slac.server"><B>ServerAdministrator</B></A> - Class in <A HREF="./org/slac/server/package-summary.html">org.slac.server</A><DD> <DT><A HREF="./org/slac/server/ServerAdministrator.html#ServerAdministrator()"><B>ServerAdministrator()</B></A> - +Constructor for class org.slac.server.<A HREF="./org/slac/server/ServerAdministrator.html" title="class in org.slac.server">ServerAdministrator</A> <DD> -<DT><A HREF="./org/slac/server/ClientThread.html#switchLobby(java.lang.String, boolean)"><B>switchLobby(String, boolean)</B></A> - +<DT><A HREF="./org/slac/server/Server.html#spawnClientThread(java.net.Socket)"><B>spawnClientThread(Socket)</B></A> - +Method in class org.slac.server.<A HREF="./org/slac/server/Server.html" title="class in org.slac.server">Server</A> +<DD> +<DT><A HREF="./org/slac/server/ClientThread.html#switchLobby(java.lang.String, java.lang.Boolean)"><B>switchLobby(String, Boolean)</B></A> - Method in class org.slac.server.<A HREF="./org/slac/server/ClientThread.html" title="class in org.slac.server">ClientThread</A> <DD> </DL> <HR> -<A HREF="#_A_">A</A> <A HREF="#_C_">C</A> <A HREF="#_G_">G</A> <A HREF="#_I_">I</A> <A HREF="#_K_">K</A> <A HREF="#_L_">L</A> <A HREF="#_M_">M</A> <A HREF="#_N_">N</A> <A HREF="#_O_">O</A> <A HREF="#_P_">P</A> <A HREF="#_R_">R</A> <A HREF="#_S_">S</A> +<A NAME="_V_"><!-- --></A><H2> +<B>V</B></H2> +<DL> +<DT><A HREF="./org/slac/server/Protocol.html#valueOf(java.lang.String)"><B>valueOf(String)</B></A> - +Static method in enum org.slac.server.<A HREF="./org/slac/server/Protocol.html" title="enum in org.slac.server">Protocol</A> +<DD>Returns the enum constant of this type with the specified name. +<DT><A HREF="./org/slac/server/Protocol.html#values()"><B>values()</B></A> - +Static method in enum org.slac.server.<A HREF="./org/slac/server/Protocol.html" title="enum in org.slac.server">Protocol</A> +<DD>Returns an array containing the constants of this enum type, in +the order they are declared. +</DL> +<HR> +<A HREF="#_A_">A</A> <A HREF="#_C_">C</A> <A HREF="#_G_">G</A> <A HREF="#_I_">I</A> <A HREF="#_K_">K</A> <A HREF="#_L_">L</A> <A HREF="#_M_">M</A> <A HREF="#_N_">N</A> <A HREF="#_O_">O</A> <A HREF="#_P_">P</A> <A HREF="#_R_">R</A> <A HREF="#_S_">S</A> <A HREF="#_V_">V</A> <!-- ======= START OF BOTTOM NAVBAR ====== --> <A NAME="navbar_bottom"><!-- --></A> Modified: trunk/DOCUMENTATION/index.html =================================================================== --- trunk/DOCUMENTATION/index.html 2007-02-25 23:36:41 UTC (rev 23) +++ trunk/DOCUMENTATION/index.html 2007-02-26 04:03:31 UTC (rev 24) @@ -2,7 +2,7 @@ <!--NewPage--> <HTML> <HEAD> -<!-- Generated by javadoc on Sun Feb 25 16:31:15 EST 2007--> +<!-- Generated by javadoc on Sun Feb 25 22:57:13 EST 2007--> <TITLE> Generated Documentation (Untitled) </TITLE> Modified: trunk/DOCUMENTATION/org/slac/server/ChatLobby.html =================================================================== --- trunk/DOCUMENTATION/org/slac/server/ChatLobby.html 2007-02-25 23:36:41 UTC (rev 23) +++ trunk/DOCUMENTATION/org/slac/server/ChatLobby.html 2007-02-26 04:03:31 UTC (rev 24) @@ -2,7 +2,7 @@ <!--NewPage--> <HTML> <HEAD> -<!-- Generated by javadoc (build 1.6.0) on Sun Feb 25 16:31:14 EST 2007 --> +<!-- Generated by javadoc (build 1.6.0) on Sun Feb 25 22:57:12 EST 2007 --> <TITLE> ChatLobby </TITLE> @@ -53,7 +53,7 @@ <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - PREV CLASS + <A HREF="../../../org/slac/server/AcceptConnections.html" title="class in org.slac.server"><B>PREV CLASS</B></A> <A HREF="../../../org/slac/server/ClientThread.html" title="class in org.slac.server"><B>NEXT CLASS</B></A></FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../index.html?org/slac/server/ChatLobby.html" target="_top"><B>FRAMES</B></A> @@ -130,10 +130,9 @@ </TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> -<TD><CODE><B><A HREF="../../../org/slac/server/ChatLobby.html#ChatLobby(java.lang.String, org.slac.server.Server, int, boolean, java.lang.String)">ChatLobby</A></B>(java.lang.String lobbyName, +<TD><CODE><B><A HREF="../../../org/slac/server/ChatLobby.html#ChatLobby(java.lang.String, org.slac.server.Server, int, java.lang.String)">ChatLobby</A></B>(java.lang.String lobbyName, <A HREF="../../../org/slac/server/Server.html" title="class in org.slac.server">Server</A> theServer, int maxUsers, - boolean priv, java.lang.String password)</CODE> <BR> @@ -201,6 +200,14 @@ </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> +<CODE> void</CODE></FONT></TD> +<TD><CODE><B><A HREF="../../../org/slac/server/ChatLobby.html#leaveLobby(java.util.UUID)">leaveLobby</A></B>(java.util.UUID uuid)</CODE> + +<BR> + </TD> +</TR> +<TR BGCOLOR="white" CLASS="TableRowColor"> +<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> int</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../org/slac/server/ChatLobby.html#maxUsers()">maxUsers</A></B>()</CODE> @@ -254,17 +261,16 @@ </TR> </TABLE> -<A NAME="ChatLobby(java.lang.String, org.slac.server.Server, int, boolean, java.lang.String)"><!-- --></A><H3> +<A NAME="ChatLobby(java.lang.String, org.slac.server.Server, int, java.lang.String)"><!-- --></A><H3> ChatLobby</H3> <PRE> public <B>ChatLobby</B>(java.lang.String lobbyName, <A HREF="../../../org/slac/server/Server.html" title="class in org.slac.server">Server</A> theServer, int maxUsers, - boolean priv, java.lang.String password)</PRE> <DL> <DL> -<DT><B>Parameters:</B><DD><CODE>lobbyName</CODE> - The name of this lobby<DD><CODE>theServer</CODE> - The server that created this lobby<DD><CODE>maxUsers</CODE> - The maxiumum number of users allowed, 0 for Integer.MAXNUMBER (more than 2bil)<DD><CODE>priv</CODE> - True if it is private<DD><CODE>password</CODE> - The password for the lobby</DL> +<DT><B>Parameters:</B><DD><CODE>lobbyName</CODE> - The name of this lobby<DD><CODE>theServer</CODE> - The server that created this lobby<DD><CODE>maxUsers</CODE> - The maxiumum number of users allowed, 0 for Integer.MAXNUMBER (more than 2bil)<DD><CODE>password</CODE> - The password for the lobby</DL> </DL> <HR> @@ -434,6 +440,20 @@ <DT><B>Returns:</B><DD>true if a password is required to join</DL> </DD> </DL> +<HR> + +<A NAME="leaveLobby(java.util.UUID)"><!-- --></A><H3> +leaveLobby</H3> +<PRE> +public void <B>leaveLobby</B>(java.util.UUID uuid)</PRE> +<DL> +<DD><DL> +<DT><B>Specified by:</B><DD><CODE><A HREF="../../../org/slac/server/Lobby.html#leaveLobby(java.util.UUID)">leaveLobby</A></CODE> in interface <CODE><A HREF="../../../org/slac/server/Lobby.html" title="interface in org.slac.server">Lobby</A></CODE></DL> +</DD> +<DD><DL> +<DT><B>Parameters:</B><DD><CODE>uuid</CODE> - The uuid of the user leaving</DL> +</DD> +</DL> <!-- ========= END OF CLASS DATA ========= --> <HR> @@ -463,7 +483,7 @@ <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> - PREV CLASS + <A HREF="../../../org/slac/server/AcceptConnections.html" title="class in org.slac.server"><B>PREV CLASS</B></A> <A HREF="../../../org/slac/server/ClientThread.html" title="class in org.slac.server"><B>NEXT CLASS</B></A></FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../index.html?org/slac/server/ChatLobby.html" target="_top"><B>FRAMES</B></A> Modified: trunk/DOCUMENTATION/org/slac/server/ClientThread.html =================================================================== --- trunk/DOCUMENTATION/org/slac/server/ClientThread.html 2007-02-25 23:36:41 UTC (rev 23) +++ trunk/DOCUMENTATION/org/slac/server/ClientThread.html 2007-02-26 04:03:31 UTC (rev 24) @@ -2,7 +2,7 @@ <!--NewPage--> <HTML> <HEAD> -<!-- Generated by javadoc (build 1.6.0) on Sun Feb 25 16:31:14 EST 2007 --> +<!-- Generated by javadoc (build 1.6.0) on Sun Feb 25 22:57:12 EST 2007 --> <TITLE> ClientThread </TITLE> @@ -143,8 +143,8 @@ <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>protected void</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../org/slac/server/ClientThread.html#changeLobbies(java.lang.String, boolean)">changeLobbies</A></B>(java.lang.String message, - boolean calledByServer)</CODE> +<TD><CODE><B><A HREF="../../../org/slac/server/ClientThread.html#changeLobbies(java.lang.String, java.lang.Boolean)">changeLobbies</A></B>(java.lang.String message, + java.lang.Boolean calledByServer)</CODE> <BR> Can Only be called by server @@ -153,8 +153,8 @@ <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>protected void</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../org/slac/server/ClientThread.html#changeUserClass(java.lang.String, boolean)">changeUserClass</A></B>(java.lang.String message, - boolean calledByServer)</CODE> +<TD><CODE><B><A HREF="../../../org/slac/server/ClientThread.html#changeUserClass(java.lang.String, java.lang.Boolean)">changeUserClass</A></B>(java.lang.String message, + java.lang.Boolean calledByServer)</CODE> <BR> </TD> @@ -162,8 +162,8 @@ <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>protected void</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../org/slac/server/ClientThread.html#changeUsers(java.lang.String, boolean)">changeUsers</A></B>(java.lang.String message, - boolean calledByServer)</CODE> +<TD><CODE><B><A HREF="../../../org/slac/server/ClientThread.html#changeUsers(java.lang.String, java.lang.Boolean)">changeUsers</A></B>(java.lang.String message, + java.lang.Boolean calledByServer)</CODE> <BR> Can only be called by server @@ -172,8 +172,8 @@ <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>protected void</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../org/slac/server/ClientThread.html#changeUsersLobby(java.lang.String, boolean)">changeUsersLobby</A></B>(java.lang.String message, - boolean calledByServer)</CODE> +<TD><CODE><B><A HREF="../../../org/slac/server/ClientThread.html#changeUsersLobby(java.lang.String, java.lang.Boolean)">changeUsersLobby</A></B>(java.lang.String message, + java.lang.Boolean calledByServer)</CODE> <BR> Can only be called by the server</TD> @@ -181,8 +181,8 @@ <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>protected void</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../org/slac/server/ClientThread.html#chat(java.lang.String, boolean)">chat</A></B>(java.lang.String message, - boolean calledByServer)</CODE> +<TD><CODE><B><A HREF="../../../org/slac/server/ClientThread.html#chat(java.lang.String, java.lang.Boolean)">chat</A></B>(java.lang.String message, + java.lang.Boolean calledByServer)</CODE> <BR> </TD> @@ -198,8 +198,8 @@ <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>protected void</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../org/slac/server/ClientThread.html#kickUser(java.lang.String, boolean)">kickUser</A></B>(java.lang.String message, - boolean calledByServer)</CODE> +<TD><CODE><B><A HREF="../../../org/slac/server/ClientThread.html#kickUser(java.lang.String, java.lang.Boolean)">kickUser</A></B>(java.lang.String message, + java.lang.Boolean calledByServer)</CODE> <BR> </TD> @@ -207,8 +207,8 @@ <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>protected void</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../org/slac/server/ClientThread.html#kickUserGame(java.lang.String, boolean)">kickUserGame</A></B>(java.lang.String message, - boolean calledByServer)</CODE> +<TD><CODE><B><A HREF="../../../org/slac/server/ClientThread.html#kickUserGame(java.lang.String, java.lang.Boolean)">kickUserGame</A></B>(java.lang.String message, + java.lang.Boolean calledByServer)</CODE> <BR> </TD> @@ -216,8 +216,8 @@ <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>protected void</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../org/slac/server/ClientThread.html#login(java.lang.String, boolean)">login</A></B>(java.lang.String message, - boolean calledByServer)</CODE> +<TD><CODE><B><A HREF="../../../org/slac/server/ClientThread.html#login(java.lang.String, java.lang.Boolean)">login</A></B>(java.lang.String message, + java.lang.Boolean calledByServer)</CODE> <BR> Can't be called by the server</TD> @@ -225,8 +225,8 @@ <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>protected void</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../org/slac/server/ClientThread.html#loginFailed(java.lang.String, boolean)">loginFailed</A></B>(java.lang.String message, - boolean calledByServer)</CODE> +<TD><CODE><B><A HREF="../../../org/slac/server/ClientThread.html#loginFailed(java.lang.String, java.lang.Boolean)">loginFailed</A></B>(java.lang.String message, + java.lang.Boolean calledByServer)</CODE> <BR> Can only be called by the server</TD> @@ -234,8 +234,8 @@ <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>protected void</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../org/slac/server/ClientThread.html#loginOk(java.lang.String, boolean)">loginOk</A></B>(java.lang.String message, - boolean calledByServer)</CODE> +<TD><CODE><B><A HREF="../../../org/slac/server/ClientThread.html#loginOk(java.lang.String, java.lang.Boolean)">loginOk</A></B>(java.lang.String message, + java.lang.Boolean calledByServer)</CODE> <BR> Can only be called by the server</TD> @@ -243,8 +243,8 @@ <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>protected void</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../org/slac/server/ClientThread.html#logout(java.lang.String, boolean)">logout</A></B>(java.lang.String messsage, - boolean calledByServer)</CODE> +<TD><CODE><B><A HREF="../../../org/slac/server/ClientThread.html#logout(java.lang.String, java.lang.Boolean)">logout</A></B>(java.lang.String messsage, + java.lang.Boolean calledByServer)</CODE> <BR> Tells either the client or the server that they are disconnecting</TD> @@ -252,8 +252,8 @@ <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>protected void</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../org/slac/server/ClientThread.html#motd(java.lang.String, boolean)">motd</A></B>(java.lang.String message, - boolean calledByServer)</CODE> +<TD><CODE><B><A HREF="../../../org/slac/server/ClientThread.html#motd(java.lang.String, java.lang.Boolean)">motd</A></B>(java.lang.String message, + java.lang.Boolean calledByServer)</CODE> <BR> Can only be called by server</TD> @@ -261,17 +261,17 @@ <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>protected void</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../org/slac/server/ClientThread.html#newGame(java.lang.String, boolean)">newGame</A></B>(java.lang.String message, - boolean calledByServer)</CODE> +<TD><CODE><B><A HREF="../../../org/slac/server/ClientThread.html#newGame(java.lang.String, java.lang.Boolean)">newGame</A></B>(java.lang.String message, + java.lang.Boolean calledByServer)</CODE> <BR> - </TD> + TODO Setup a format for the message to be able to parse it</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>protected void</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../org/slac/server/ClientThread.html#oldProtocol(java.lang.String, boolean)">oldProtocol</A></B>(java.lang.String message, - boolean calledByServer)</CODE> +<TD><CODE><B><A HREF="../../../org/slac/server/ClientThread.html#oldProtocol(java.lang.String, java.lang.Boolean)">oldProtocol</A></B>(java.lang.String message, + java.lang.Boolean calledByServer)</CODE> <BR> Can only be called by the server</TD> @@ -279,8 +279,8 @@ <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>protected void</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../org/slac/server/ClientThread.html#privateMessage(java.lang.String, boolean)">privateMessage</A></B>(java.lang.String message, - boolean calledByServer)</CODE> +<TD><CODE><B><A HREF="../../../org/slac/server/ClientThread.html#privateMessage(java.lang.String, java.lang.Boolean)">privateMessage</A></B>(java.lang.String message, + java.lang.Boolean calledByServer)</CODE> <BR> </TD> @@ -296,8 +296,8 @@ <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>protected void</CODE></FONT></TD> -<TD><CODE><B><A HREF="../../../org/slac/server/ClientThread.html#switchLobby(java.lang.String, boolean)">switchLobby</A></B>(java.lang.String message, - boolean calledByServer)</CODE> +<TD><CODE><B><A HREF="../../../org/slac/server/ClientThread.html#switchLobby(java.lang.String, java.lang.Boolean)">switchLobby</A></B>(java.lang.String message, + java.lang.Boolean calledByServer)</CODE> <BR> </TD> @@ -333,7 +333,7 @@ java.util.UUID uuid)</PRE> <DL> <DL> -<DT><B>Parameters:</B><DD><CODE>parent</CODE> - The Server that started the thread<DD><CODE>sock</CODE> - The Socket to communicate with the client<DD><CODE>UUID</CODE> - The Unique User ID<DT><B>Since:</B></DT> +<DT><B>Parameters:</B><DD><CODE>parent</CODE> - The Server that started the thread<DD><CODE>sock</CODE> - The Socket to communicate with the client<DD><CODE>uuid</CODE> - The Unique User ID<DT><B>Since:</B></DT> <DD>0.0</DD> </DL> </DL> @@ -379,11 +379,11 @@ </DL> <HR> -<A NAME="chat(java.lang.String, boolean)"><!-- --></A><H3> +<A NAME="chat(java.lang.String, java.lang.Boolean)"><!-- --></A><H3> chat</H3> <PRE> protected void <B>chat</B>(java.lang.String message, - boolean calledByServer)</PRE> + java.lang.Boolean calledByServer)</PRE> <DL> <DD><DL> </DL> @@ -394,11 +394,11 @@ </DL> <HR> -<A NAME="changeUsers(java.lang.String, boolean)"><!-- --></A><H3> +<A NAME="changeUsers(java.lang.String, java.lang.Boolean)"><!-- --></A><H3> changeUsers</H3> <PRE> protected void <B>changeUsers</B>(java.lang.String message, - boolean calledByServer)</PRE> + java.lang.Boolean calledByServer)</PRE> <DL> <DD>Can only be called by server Updates the client with users that have been added or deleted @@ -412,11 +412,11 @@ </DL> <HR> -<A NAME="changeLobbies(java.lang.String, boolean)"><!-- --></A><H3> +<A NAME="changeLobbies(java.lang.String, java.lang.Boolean)"><!-- --></A><H3> changeLobbies</H3> <PRE> protected void <B>changeLobbies</B>(java.lang.String message, - boolean calledByServer)</PRE> + java.lang.Boolean calledByServer)</PRE> <DL> <DD>Can Only be called by server Updates the client with lobbies that have been added or deleted @@ -425,16 +425,16 @@ </DL> </DD> <DD><DL> -<DT><B>Parameters:</B><DD><CODE>messsage</CODE> - <DD><CODE>calledByServer</CODE> - </DL> +<DT><B>Parameters:</B><DD><CODE>message</CODE> - <DD><CODE>calledByServer</CODE> - </DL> </DD> </DL> <HR> -<A NAME="privateMessage(java.lang.String, boolean)"><!-- --></A><H3> +<A NAME="privateMessage(java.lang.String, java.lang.Boolean)"><!-- --></A><H3> privateMessage</H3> <PRE> protected void <B>privateMessage</B>(java.lang.String message, - boolean calledByServer)</PRE> + java.lang.Boolean calledByServer)</PRE> <DL> <DD><DL> </DL> @@ -445,11 +445,11 @@ </DL> <HR> -<A NAME="logout(java.lang.String, boolean)"><!-- --></A><H3> +<A NAME="logout(java.lang.String, java.lang.Boolean)"><!-- --></A><H3> logout</H3> <PRE> protected void <B>logout</B>(java.lang.String messsage, - boolean calledByServer)</PRE> + java.lang.Boolean calledByServer)</PRE> <DL> <DD>Tells either the client or the server that they are disconnecting <P> @@ -462,11 +462,11 @@ </DL> <HR> -<A NAME="motd(java.lang.String, boolean)"><!-- --></A><H3> +<A NAME="motd(java.lang.String, java.lang.Boolean)"><!-- --></A><H3> motd</H3> <PRE> protected void <B>motd</B>(java.lang.String message, - boolean calledByServer)</PRE> + java.lang.Boolean calledByServer)</PRE> <DL> <DD>Can only be called by server <P> @@ -479,11 +479,11 @@ </DL> <HR> -<A NAME="switchLobby(java.lang.String, boolean)"><!-- --></A><H3> +<A NAME="switchLobby(java.lang.String, java.lang.Boolean)"><!-- --></A><H3> switchLobby</H3> <PRE> protected void <B>switchLobby</B>(java.lang.String message, - boolean calledByServer)</PRE> + java.lang.Boolean calledByServer)</PRE> <DL> <DD><DL> </DL> @@ -494,11 +494,11 @@ </DL> <HR> -<A NAME="kickUserGame(java.lang.String, boolean)"><!-- --></A><H3> +<A NAME="kickUserGame(java.lang.String, java.lang.Boolean)"><!-- --></A><H3> kickUserGame</H3> <PRE> protected void <B>kickUserGame</B>(java.lang.String message, - boolean calledByServer)</PRE> + java.lang.Boolean calledByServer)</PRE> <DL> <DD><DL> </DL> @@ -509,12 +509,14 @@ </DL> <HR> -<A NAME="newGame(java.lang.String, boolean)"><!-- --></A><H3> +<A NAME="newGame(java.lang.String, java.lang.Boolean)"><!-- --></A><H3> newGame</H3> <PRE> protected void <B>newGame</B>(java.lang.String message, - boolean calledByServer)</PRE> + java.lang.Boolean calledByServer)</PRE> <DL> +<DD>TODO Setup a format for the message to be able to parse it +<P> <DD><DL> </DL> </DD> @@ -524,11 +526,11 @@ </DL> <HR> -<A NAME="changeUsersLobby(java.lang.String, boolean)"><!-- --></A><H3> +<A NAME="changeUsersLobby(java.lang.String, java.lang.Boolean)"><!-- --></A><H3> changeUsersLobby</H3> <PRE> protected void <B>changeUsersLobby</B>(java.lang.String message, - boolean calledByServer)</PRE> + java.lang.Boolean calledByServer)</PRE> <DL> <DD>Can only be called by the server <P> @@ -541,11 +543,11 @@ </DL> <HR> -<A NAME="login(java.lang.String, boolean)"><!-- --></A><H3> +<A NAME="login(java.lang.String, java.lang.Boolean)"><!-- --></A><H3> login</H3> <PRE> protected void <B>login</B>(java.lang.String message, - boolean calledByServer)</PRE> + java.lang.Boolean calledByServer)</PRE> <DL> <DD>Can't be called by the server <P> @@ -559,11 +561,11 @@ </DL> <HR> -<A NAME="loginOk(java.lang.String, boolean)"><!-- --></A><H3> +<A NAME="loginOk(java.lang.String, java.lang.Boolean)"><!-- --></A><H3> loginOk</H3> <PRE> protected void <B>loginOk</B>(java.lang.String message, - boolean calledByServer)</PRE> + java.lang.Boolean calledByServer)</PRE> <DL> <DD>Can only be called by the server <P> @@ -576,11 +578,11 @@ </DL> <HR> -<A NAME="loginFailed(java.lang.String, boolean)"><!-- --></A><H3> +<A NAME="loginFailed(java.lang.String, java.lang.Boolean)"><!-- --></A><H3> loginFailed</H3> <PRE> protected void <B>loginFailed</B>(java.lang.String message, - boolean calledByServer)</PRE> + java.lang.Boolean calledByServer)</PRE> <DL> <DD>Can only be called by the server <P> @@ -593,11 +595,11 @@ </DL> <HR> -<A NAME="oldProtocol(java.lang.String, boolean)"><!-- --></A><H3> +<A NAME="oldProtocol(java.lang.String, java.lang.Boolean)"><!-- --></A><H3> oldProtocol</H3> <PRE> protected void <B>oldProtocol</B>(java.lang.String message, - boolean calledByServer)</PRE> + java.lang.Boolean calledByServer)</PRE> <DL> <DD>Can only be called by the server <P> @@ -610,11 +612,11 @@ </DL> <HR> -<A NAME="kickUser(java.lang.String, boolean)"><!-- --></A><H3> +<A NAME="kickUser(java.lang.String, java.lang.Boolean)"><!-- --></A><H3> kickUser</H3> <PRE> protected void <B>kickUser</B>(java.lang.String message, - boolean calledByServer)</PRE> + java.lang.Boolean calledByServer)</PRE> <DL> <DD><DL> </DL> @@ -625,11 +627,11 @@ </DL> <HR> -<A NAME="changeUserClass(java.lang.String, boolean)"><!-- --></A><H3> +<A NAME="changeUserClass(java.lang.String, java.lang.Boolean)"><!-- --></A><H3> changeUserClass</H3> <PRE> protected void <B>changeUserClass</B>(java.lang.String message, - boolean calledByServer)</PRE> + java.lang.Boolean calledByServer)</PRE> <DL> <DD><DL> </DL> Modified: trunk/DOCUMENTATION/org/slac/server/GameLobby.html =================================================================== --- trunk/DOCUMENTATION/org/slac/server/GameLobby.html 2007-02-25 23:36:41 UTC (rev 23) +++ trunk/DOCUMENTATION/org/slac/server/GameLobby.html 2007-02-26 04:03:31 UTC (rev 24) @@ -2,7 +2,7 @@ <!--NewPage--> <HTML> <HEAD> -<!-- Generated by javadoc (build 1.6.0) on Sun Feb 25 16:31:14 EST 2007 --> +<!-- Generated by javadoc (build 1.6.0) on Sun Feb 25 22:57:12 EST 2007 --> <TITLE> GameLobby </TITLE> @@ -124,11 +124,10 @@ </TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> -<TD><CODE><B><A HREF="../../../org/slac/server/GameLobby.html#GameLobby(java.lang.String, org.slac.server.Server, int, java.lang.String, boolean, java.lang.String)">GameLobby</A></B>(java.lang.String lobbyName, +<TD><CODE><B><A HREF="../../../org/slac/server/GameLobby.html#GameLobby(java.lang.String, org.slac.server.Server, int, java.lang.String, java.lang.String)">GameLobby</A></B>(java.lang.String lobbyName, <A HREF="../../../org/slac/server/Server.html" title="class in org.slac.server">Server</A> theServer, int maxUsers, java.lang.String gameType, - boolean priv, java.lang.String password)</CODE> <BR> @@ -151,7 +150,7 @@ <TH ALIGN="left"><B>Methods inherited from class org.slac.server.<A HREF="../../../org/slac/server/ChatLobby.html" title="class in org.slac.server">ChatLobby</A></B></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> -<TD><CODE><A HREF="../../../org/slac/server/ChatLobby.html#addUser(org.slac.server.ClientThread, java.util.UUID, java.lang.String)">addUser</A>, <A HREF="../../../org/slac/server/ChatLobby.html#canJoin()">canJoin</A>, <A HREF="../../../org/slac/server/ChatLobby.html#getLobbyName()">getLobbyName</A>, <A HREF="../../../org/slac/server/ChatLobby.html#getLobbyType()">getLobbyType</A>, <A HREF="../../../org/slac/server/ChatLobby.html#getUsers()">getUsers</A>, <A HREF="../../../org/slac/server/ChatLobby.html#isPrivate()">isPrivate</A>, <A HREF="../../../org/slac/server/ChatLobby.html#maxUsers()">maxUsers</A>, <A HREF="../../../org/slac/server/ChatLobby.html#numberUsers()">numberUsers</A>, <A HREF="../../../org/slac/server/ChatLobby.html#run()">run</A>, <A HREF="../../../org/slac/server/ChatLobby.html#sendChat(java.lang.String)">sendChat</A></CODE></TD> +<TD><CODE><A HREF="../../../org/slac/server/ChatLobby.html#addUser(org.slac.server.ClientThread, java.util.UUID, java.lang.String)">addUser</A>, <A HREF="../../../org/slac/server/ChatLobby.html#canJoin()">canJoin</A>, <A HREF="../../../org/slac/server/ChatLobby.html#getLobbyName()">getLobbyName</A>, <A HREF="../../../org/slac/server/ChatLobby.html#getLobbyType()">getLobbyType</A>, <A HREF="../../../org/slac/server/ChatLobby.html#getUsers()">getUsers</A>, <A HREF="../../../org/slac/server/ChatLobby.html#isPrivate()">isPrivate</A>, <A HREF="../../../org/slac/server/ChatLobby.html#leaveLobby(java.util.UUID)">leaveLobby</A>, <A HREF="../../../org/slac/server/ChatLobby.html#maxUsers()">maxUsers</A>, <A HREF="../../../org/slac/server/ChatLobby.html#numberUsers()">numberUsers</A>, <A HREF="../../../org/slac/server/ChatLobby.html#run()">run</A>, <A HREF="../../../org/slac/server/ChatLobby.html#sendChat(java.lang.String)">sendChat</A></CODE></TD> </TR> </TABLE> <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A> @@ -186,14 +185,13 @@ </DL> <HR> -<A NAME="GameLobby(java.lang.String, org.slac.server.Server, int, java.lang.String, boolean, java.lang.String)"><!-- --></A><H3> +<A NAME="GameLobby(java.lang.String, org.slac.server.Server, int, java.lang.String, java.lang.String)"><!-- --></A><H3> GameLobby</H3> <PRE> public <B>GameLobby</B>(java.lang.String lobbyName, <A HREF="../../../org/slac/server/Server.html" title="class in org.slac.server">Server</A> theServer, int maxUsers, java.lang.String gameType, - boolean priv, java.lang.String password)</PRE> <DL> </DL> Modified: trunk/DOCUMENTATION/org/slac/server/Lobby.html =================================================================== --- trunk/DOCUMENTATION/org/slac/server/Lobby.html 2007-02-25 23:36:41 UTC (rev 23) +++ trunk/DOCUMENTATION/org/slac/server/Lobby.html 2007-02-26 04:03:31 UTC (rev 24) @@ -2,7 +2,7 @@ <!--NewPage--> <HTML> <HEAD> -<!-- Generated by javadoc (build 1.6.0) on Sun Feb 25 16:31:14 EST 2007 --> +<!-- Generated by javadoc (build 1.6.0) on Sun Feb 25 22:57:13 EST 2007 --> <TITLE> Lobby </TITLE> @@ -54,7 +54,7 @@ <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../org/slac/server/GameLobby.html" title="class in org.slac.server"><B>PREV CLASS</B></A> - <A HREF="../../../org/slac/server/Server.html" title="class in org.slac.server"><B>NEXT CLASS</B></A></FONT></TD> + <A HREF="../../../org/slac/server/Protocol.html" title="enum in org.slac.server"><B>NEXT CLASS</B></A></FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../index.html?org/slac/server/Lobby.html" target="_top"><B>FRAMES</B></A> <A HREF="Lobby.html" target="_top"><B>NO FRAMES</B></A> @@ -166,6 +166,14 @@ </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> +<CODE> void</CODE></FONT></TD> +<TD><CODE><B><A HREF="../../../org/slac/server/Lobby.html#leaveLobby(java.util.UUID)">leaveLobby</A></B>(java.util.UUID uuid)</CODE> + +<BR> + </TD> +</TR> +<TR BGCOLOR="white" CLASS="TableRowColor"> +<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> int</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../org/slac/server/Lobby.html#maxUsers()">maxUsers</A></B>()</CODE> @@ -312,6 +320,17 @@ <DT><B>Returns:</B><DD>True if maxUsers()-currentUsers() > 0</DL> </DD> </DL> +<HR> + +<A NAME="leaveLobby(java.util.UUID)"><!-- --></A><H3> +leaveLobby</H3> +<PRE> +void <B>leaveLobby</B>(java.util.UUID uuid)</PRE> +<DL> +<DD><DL> +<DT><B>Parameters:</B><DD><CODE>uuid</CODE> - The uuid of the user leaving</DL> +</DD> +</DL> <!-- ========= END OF CLASS DATA ========= --> <HR> @@ -342,7 +361,7 @@ <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../org/slac/server/GameLobby.html" title="class in org.slac.server"><B>PREV CLASS</B></A> - <A HREF="../../../org/slac/server/Server.html" title="class in org.slac.server"><B>NEXT CLASS</B></A></FONT></TD> + <A HREF="../../../org/slac/server/Protocol.html" title="enum in org.slac.server"><B>NEXT CLASS</B></A></FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../index.html?org/slac/server/Lobby.html" target="_top"><B>FRAMES</B></A> <A HREF="Lobby.html" target="_top"><B>NO FRAMES</B></A> Modified: trunk/DOCUMENTATION/org/slac/server/Server.html =================================================================== --- trunk/DOCUMENTATION/org/slac/server/Server.html 2007-02-25 23:36:41 UTC (rev 23) +++ trunk/DOCUMENTATION/org/slac/server/Server.html 2007-02-26 04:03:31 UTC (rev 24) @@ -2,7 +2,7 @@ <!--NewPage--> <HTML> <HEAD> -<!-- Generated by j... [truncated message content] |
From: <air...@us...> - 2007-02-25 23:36:43
|
Revision: 23 http://svn.sourceforge.net/slac/?rev=23&view=rev Author: airpizza Date: 2007-02-25 15:36:41 -0800 (Sun, 25 Feb 2007) Log Message: ----------- Including the source in the commit might help! Added Paths: ----------- trunk/src/org/ trunk/src/org/slac/ trunk/src/org/slac/client/ trunk/src/org/slac/server/ trunk/src/org/slac/server/ChatLobby.java trunk/src/org/slac/server/ClientThread.java trunk/src/org/slac/server/GameLobby.java trunk/src/org/slac/server/Lobby.java trunk/src/org/slac/server/Protocol.java trunk/src/org/slac/server/Server.java trunk/src/org/slac/server/ServerLoader.java Added: trunk/src/org/slac/server/ChatLobby.java =================================================================== --- trunk/src/org/slac/server/ChatLobby.java (rev 0) +++ trunk/src/org/slac/server/ChatLobby.java 2007-02-25 23:36:41 UTC (rev 23) @@ -0,0 +1,139 @@ +package org.slac.server; +import java.util.TreeMap; +import java.util.UUID; +/** + * + * @author Mike Chaten + * @since 0.0 + * @version 0.0 + * This class controls the lobbies that do not deal with games + */ +public class ChatLobby implements Lobby,Runnable { + private String lobbyName; + private static Server server = null; + private TreeMap<UUID,ClientThread> users; + private int maxUsers; + private final String LOBBYTYPE; + private final boolean PRIV; + private final String PASSWORD; + /** + * + * @param lobbyName The name of this lobby + * @param theServer The server that created this lobby + * @param maxUsers The maxiumum number of users allowed, 0 for Integer.MAXNUMBER (more than 2bil) + * @param priv True if it is private + * @param password The password for the lobby + */ + public ChatLobby(String lobbyName,Server theServer,int maxUsers,boolean priv,String password) + { + this.lobbyName = lobbyName; + this.LOBBYTYPE = "chat"; + this.PRIV = true; + this.PASSWORD = password; + + if (server == null) + { + server = theServer; + } + if(maxUsers <= 0) + { + this.maxUsers = Integer.MAX_VALUE; + } + else + { + this.maxUsers = maxUsers; + } + } + public ChatLobby(String lobbyName,Server theServer,int maxUsers) + { + this.PRIV = false; + this.PASSWORD = null; + this.lobbyName = lobbyName; + this.LOBBYTYPE = "chat"; + if (server == null) + { + server = theServer; + } + if(maxUsers <= 0) + { + this.maxUsers = Integer.MAX_VALUE; + } + else + { + this.maxUsers = maxUsers; + } + + } + ChatLobby(String lobbyName,Server theServer,int maxUsers,String lobbyType,boolean priv,String password) + { + this.PRIV = priv; + this.PASSWORD = password; + this.lobbyName = lobbyName; + this.LOBBYTYPE = lobbyType; + if (server == null) + { + server = theServer; + } + if(maxUsers <= 0) + { + this.maxUsers = Integer.MAX_VALUE; + } + else + { + this.maxUsers = maxUsers; + } + + } + public synchronized void addUser(ClientThread client, UUID uuid,String password) { + // TODO Auto-generated method stub + if(password == this.PASSWORD) + { + users.put(uuid,client); + } + } + public TreeMap<UUID,ClientThread> getUsers() { + + return users; + } + public synchronized void sendChat(String message) + { + ClientThread[] usersArray = users.values().toArray(new ClientThread[users.size()]); + for (ClientThread i : usersArray) + { + i.chat(message,true); //Todo: Make an Enum of the protocol and use it here + } + } + public int numberUsers() + { + // TODO Auto-generated method stub + return users.size(); + } + public String getLobbyName() + { + return lobbyName; + } + public boolean canJoin() + { + if(maxUsers()-numberUsers()==0) + { + return false; + } + return true; + } + public int maxUsers() + { + return maxUsers; + } + public void run() + { + + } + public String getLobbyType() { + // TODO Auto-generated method stub + return LOBBYTYPE; + } + public boolean isPrivate() + { + return PRIV; + } +} Added: trunk/src/org/slac/server/ClientThread.java =================================================================== --- trunk/src/org/slac/server/ClientThread.java (rev 0) +++ trunk/src/org/slac/server/ClientThread.java 2007-02-25 23:36:41 UTC (rev 23) @@ -0,0 +1,441 @@ +package org.slac.server; +import java.net.*; +import java.io.*; +import java.util.*; +import java.lang.reflect.Method; + +/** + * This class does the general work related to a single client + * @author Mike Chaten + * @since 0.0 + * @version 0.0 + */ +public class ClientThread implements Runnable { + + private Lobby currentLobby; + private PrintWriter toClient; + private BufferedReader fromClient; + private UUID uuid; + private Socket sock; + private static Server theServer = null; + private short maxUserClass = 0; + private static final short MAXCLASS = 3; + private static final Class<?>[] PROTOPARAMS = {new String().getClass(),new Boolean("false").getClass()}; + private static final String[][] METHODNAMES = {{"login","loginOk","loginFailed","oldProtocol"}, //Class 0 Names [0][message#] + {"chat","changeUsers","changeLobbies","privateMessage","logout","motd","switchLobby","kickUserGame","newGame","changeUsersLobby"}, // Class 1 Names [1][message#] + {"kickUser"}, // Class 2 Names [2][message#] + {"changeUserClass"}}; // Class 3 Names [3][message#]\ + private String username = null; + private static final String PROTONUM = "00"; + private static final short PROTONUMSHORT = 0; + + /** + * @param parent The Server that started the thread + * @param sock The Socket to communicate with the client + * @param UUID The Unique User ID + * @since 0.0 + * @version 0.0 + * @author Mike Chaten + */ + + public ClientThread(Server parent,Socket sock,UUID uuid) { + + this.uuid = uuid; + this.sock = sock; + if (theServer == null) + { + theServer = parent; + } + + } + /** + * @author Mike Chaten + * @since 0.0 + * @version 0.0 + */ + public void run() + { + try + { + toClient = new PrintWriter(sock.getOutputStream(),true); + fromClient = new BufferedReader(new InputStreamReader(sock.getInputStream())); + } + catch (IOException e) + { + e.printStackTrace(); + return; + } + while(sock.isConnected()) + { + try + { + if(fromClient.ready()) + { + analyzeMessage(fromClient.readLine()); + } + } + catch(IOException e) + { + e.printStackTrace(); + } + } + theServer.removeMe(uuid); + } + /** + * @param message The message read from the socket + * @return Returns True if executed cleanly + * @return Returns False if did not execute cleanly + * @author Mike Chaten + * @since 0.0 + * @version 0.0 + * Analyzes the message from the client and executes the appropriate + * method + * Implementation-> DONE + * BUGS -> Unknown/0 + * TODO Rewrite the errors to a logging facility + */ + private boolean analyzeMessage(final String message) + { + short messageProtoNum; + short messageClass; + short messageNum; + String messageInfo; + + if (message.length() <= 5) + { + return false; + } + try + { + messageProtoNum = Short.valueOf(message.substring(0,2)); + if (messageProtoNum != PROTONUMSHORT) + { + oldProtocol(PROTONUM,true); + return false; + } + messageClass = Short.valueOf(message.substring(2,3)); + if (messageClass > MAXCLASS || messageClass > maxUserClass) + { + System.err.println(message + " :Was invalid"); + return false; + } + messageNum = Short.valueOf(message.substring(3,5)); + if (messageNum > METHODNAMES[messageClass].length) + { + System.err.println(message + " :Was invalid"); + return false; + } + messageInfo = message.substring(5,message.length()+1); + } + catch(NumberFormatException e) + { + e.printStackTrace(); + System.err.println(message + " :Was invalid"); + return false; + } + try // This snipet of code finds the appropriate method to call based on the protocol class and number + // And then calls it with temp.invoke(this,messageInfo,false); + // TODO Possibly change this.getClass() to a static variable to run faster + { + Method temp = this.getClass().getDeclaredMethod(METHODNAMES[messageClass][messageNum],PROTOPARAMS); + temp.invoke(this,messageInfo,false); + } + catch(Exception e) + { + e.printStackTrace(); + System.err.println(message + " :Was invalid"); + return false; + } + return true; + } + /** + * @author Mike Chaten + * @param classNumber The class number of the message + * @param messageNumber The number of the message in the protocol for the class + * @param message The message to send to the client + */ + private void send(int classNumber,int messageNumber,String message) + { + if (classNumber <= MAXCLASS && messageNumber <= METHODNAMES[classNumber].length) + { + String classString = Integer.toString(classNumber); + String messageString = Integer.toString(messageNumber); + if(messageString.length()<2) + { + messageString = "0"+messageString; + } + if(message==null) + { + toClient.println(classString+messageString); + return; + } + toClient.println(PROTONUM+classString+messageString+message); + } + + } + /** + * + * @return the unique user id of this client + */ + protected UUID getUUID() + { + return uuid; + } + /** + * + * @param names + * @return the list of arrays + */ + private String unpackNameArray(String[] names,String seperator) + { + StringBuilder messages = new StringBuilder(); + for(String i : names) + { + messages.append(i+seperator); + } + return messages.toString(); + } + private String unpackNameArray(String[] names) + { + return unpackNameArray(names," | "); + } + private String getUsername() + { + return username; + } + /* ********************************* + ***BEGIN PROTOCOL DEFINED METHODS*** + ********************************* */ + // TODO ???Make all protocol methods have 2 methods, one for server one for client??? + /** + * @param message The message from the client or to the client + * @param calledByServer True if called by Server, False if called by ClientThread + */ + protected synchronized void chat(String message,boolean calledByServer) + { + if(calledByServer) + { + send(1,0,message); + } + else + { + currentLobby.sendChat(message); + } + } + /** + * Can only be called by server + * Updates the client with users that have been added or deleted + * @param message + * @param calledByServer + */ + protected synchronized void changeUsers(String message,boolean calledByServer) + { + if(calledByServer) + { + unpackNameArray(theServer.getUsers()); + } + } + /** + * Can Only be called by server + * Updates the client with lobbies that have been added or deleted + * @param messsage + * @param calledByServer + */ + protected void changeLobbies(String message,boolean calledByServer) + { + if(calledByServer) + { + send(1,2,message); + } + } + /** + * @param message + * @param calledByServer + */ + protected void privateMessage(String message,boolean calledByServer) + { + if(calledByServer) + { + + } + } + /** + * Tells either the client or the server that they are disconnecting + * + * @param messsage Not used + * @param calledByServer + */ + protected void logout(String messsage,boolean calledByServer) + { + if (calledByServer) + { + send(1,4,null); + try + { + sock.close(); + } + catch(IOException e) + { + e.printStackTrace(); + } + } + } + /** + * Can only be called by server + * @param message + * @param calledByServer + */ + protected void motd(String message,boolean calledByServer) + { + if(calledByServer) + { + send(1,5,message); + } + } + /** + * @param message + * @param calledByServer + */ + protected void switchLobby(String message,boolean calledByServer) + { + if (calledByServer) + { + send(1,6,message); + } + else + { + theServer.requestLobbyChange(message); + } + } + /** + * @param message + * @param calledByServer + */ + protected void kickUserGame(String message,boolean calledByServer) + { + if (calledByServer) + { + + } + } + /** + * @param message + * @param calledByServer + */ + protected void newGame(String message,boolean calledByServer) + { + if (calledByServer) + { + send(1,7,message); + } + } + /** + * Can only be called by the server + * @param message + * @param calledByServer + */ + protected void changeUsersLobby(String message,boolean calledByServer) + { + if (calledByServer) + { + send(1,8,message); + } + } + /** + * Can't be called by the server + * @param message + * @param calledByServer + * Implementation -> Done (Underlying server method does not check p/w) + * Bugs -> Unknown/0 + * + */ + protected void login(String message,boolean calledByServer) + { + if (!calledByServer) + { + String loginName = theServer.login(message, uuid); + if(loginName!=null) + loginOk(loginName,true); + else + loginFailed(null,true); + } + } + /** + * Can only be called by the server + * @param message Username + * @param calledByServer + * Implementation -> Done + */ + protected void loginOk(String message,boolean calledByServer) + { + if (calledByServer) + { + username = message; + send(0,1,username); + theServer.addUser(username,uuid); + } + } + /** + * Can only be called by the server + * @param message + * @param calledByServer + */ + protected void loginFailed(String message,boolean calledByServer) + { + if (calledByServer) + { + send(0,2,message); + } + } + /** + * Can only be called by the server + * @param message + * @param calledByServer + */ + protected void oldProtocol(String message,boolean calledByServer) + { + if (calledByServer) + { + send(0,3,message); + logout(null,true); + } + } + /** + * + * @param message + * @param calledByServer + */ + protected void kickUser(String message,boolean calledByServer) + { + if (!calledByServer) + { + send(2,0,message); + } + } + /** + * + * @param message + * @param calledByServer + */ + protected void changeUserClass(String message,boolean calledByServer) + { + if (calledByServer) + { + try + { + maxUserClass = Short.valueOf(message); + send(3,0,message); + } + catch(Exception e) + { + e.printStackTrace(); + } + + } + } + + + /* ******************************* + ***END PROTOCOL DEFINED METHODS*** + ******************************* */ +} Added: trunk/src/org/slac/server/GameLobby.java =================================================================== --- trunk/src/org/slac/server/GameLobby.java (rev 0) +++ trunk/src/org/slac/server/GameLobby.java 2007-02-25 23:36:41 UTC (rev 23) @@ -0,0 +1,18 @@ +package org.slac.server; + +public class GameLobby extends ChatLobby { + + public GameLobby(String lobbyName, Server theServer, int maxUsers) { + super(lobbyName, theServer, maxUsers,"Generic Game",false,null); + // TODO Auto-generated constructor stub + } + public GameLobby(String lobbyName,Server theServer, int maxUsers,String gameType, + boolean priv,String password) + { + super(lobbyName,theServer,maxUsers,gameType,priv,password); + } + + + + +} Added: trunk/src/org/slac/server/Lobby.java =================================================================== --- trunk/src/org/slac/server/Lobby.java (rev 0) +++ trunk/src/org/slac/server/Lobby.java 2007-02-25 23:36:41 UTC (rev 23) @@ -0,0 +1,64 @@ +/** + * + */ +package org.slac.server; +import java.util.SortedMap; +import java.util.UUID; +/** + * @author Mike Chaten + * @since 0.0 + * @version 0.0 + */ + +public interface Lobby { + + /** + * + * @return The current Users sorted alphabetically + */ + public SortedMap<UUID,ClientThread> getUsers(); + /** + * + * @param client The client thread + * @param uuid The user's unique user id + * @param password The password, null is there is none + */ + public void addUser(ClientThread client,UUID uuid,String password); + /** + * + * @param message The message to send to the lobby + * @since 0.0 + * @version 0.0 + */ + public void sendChat(String message); + /** + * @since 0.0 + * @version 0.0 + * @return the number of users online in the lobby + */ + public int numberUsers(); + /** + * + * @return the Lobby's name + */ + public String getLobbyName(); + /** + * @return THe Type of the lobby + */ + public String getLobbyType(); + /** + * + * @return the maximum number of users + */ + public int maxUsers(); + /** + * + * @return true if a password is required to join + */ + public boolean isPrivate(); + /** + * + * @return True if maxUsers()-currentUsers() > 0 + */ + public boolean canJoin(); +} Added: trunk/src/org/slac/server/Protocol.java =================================================================== --- trunk/src/org/slac/server/Protocol.java (rev 0) +++ trunk/src/org/slac/server/Protocol.java 2007-02-25 23:36:41 UTC (rev 23) @@ -0,0 +1,12 @@ +/** + * + */ +package org.slac.server; + +/** + * @author colbertff + * + */ +public enum Protocol { + +} Added: trunk/src/org/slac/server/Server.java =================================================================== --- trunk/src/org/slac/server/Server.java (rev 0) +++ trunk/src/org/slac/server/Server.java 2007-02-25 23:36:41 UTC (rev 23) @@ -0,0 +1,121 @@ +package org.slac.server; +import java.net.*; +import java.io.*; +import java.util.*; +/* + ALL Public and protected methods need to be thread safe! +*/ + + +public class Server implements Runnable{ + + private TreeMap<UUID,ClientThread> users; + private TreeMap<UUID,String> usernames; + private ServerSocket incoming; + private int backlog; + private int port; + private TreeMap<String,Lobby> lobbies; + + + public Server(final int port,final int backlog) + { + + this.port = port; + this.backlog = backlog; + + } + /** + * + * @param sock + * @return the ClientThread created + */ + private void spawnClientThread(final Socket sock) + { + ClientThread child; + UUID uuid = UUID.randomUUID(); + while(users.containsKey(uuid)) //Make sure the UUID is indeed unique + { + uuid = UUID.randomUUID(); + } + child = new ClientThread(this,sock,uuid); + users.put(uuid,child); + + + } + /** + * This implementation will change once we proceede to setup a database with usernames + * and passwords + * @param username The requested username + * @param uuid The client's UUID + * + */ + protected synchronized boolean requestLobbyChange(final String lobbyName,final String password,final UUID uuid) + { + return false; + } + protected synchronized boolean requestLobbyChange(final String lobbyName) + { + Lobby requested = lobbies.get(lobbyName); + if (requested.maxUsers()-requested.getUsers().size() == 0) + { + return false; + } + else if(requested.isPrivate()) + { + return false; + } + { + return true; + } + } + protected synchronized String login(final String username,final UUID uuid) + { + if(usernames.containsValue(username)) + return null; + else + { + users.get(uuid).loginOk(username,true); + return username; + } + } + protected Lobby newGameLobby(String lobbyName,int maxUsers,String gameType,boolean priv,String password) + { + return lobbies.put(lobbyName,new GameLobby(lobbyName,this,maxUsers,gameType,priv,password)); + + } + protected synchronized void removeMe(UUID uuid) + { + users.remove(uuid); + String name = usernames.remove(uuid); + + } + protected Lobby newChatLobby(String lobbyName,int maxUsers,boolean priv,String password) + { + return lobbies.put(lobbyName,new ChatLobby(lobbyName,this,maxUsers,priv,password)); + } + protected String[] getUsers() + { + return usernames.values().toArray(new String[usernames.size()]); + } + protected synchronized void addUser(String username,UUID uuid) + { + usernames.put(uuid,username); + + } + public void run() + { + try + { + while(true) + { + incoming = new ServerSocket(port,backlog); + spawnClientThread(incoming.accept()); + } + } + catch (IOException e) + { + e.printStackTrace(); + return; + } + } +} Added: trunk/src/org/slac/server/ServerLoader.java =================================================================== --- trunk/src/org/slac/server/ServerLoader.java (rev 0) +++ trunk/src/org/slac/server/ServerLoader.java 2007-02-25 23:36:41 UTC (rev 23) @@ -0,0 +1,15 @@ +package org.slac.server; + +//Administrative things can go here too +public class ServerLoader { + + /** + * @param args + */ + public static void main(String[] args) { + // TODO Add administrative things + Server theServer = new Server(13000,10000); + theServer.run(); + } + +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <air...@us...> - 2007-02-25 22:05:33
|
Revision: 22 http://svn.sourceforge.net/slac/?rev=22&view=rev Author: airpizza Date: 2007-02-25 14:05:31 -0800 (Sun, 25 Feb 2007) Log Message: ----------- Initial work on the server Added Paths: ----------- trunk/DOCUMENTATION/ trunk/DOCUMENTATION/allclasses-frame.html trunk/DOCUMENTATION/allclasses-noframe.html trunk/DOCUMENTATION/constant-values.html trunk/DOCUMENTATION/deprecated-list.html trunk/DOCUMENTATION/help-doc.html trunk/DOCUMENTATION/index-all.html trunk/DOCUMENTATION/index.html trunk/DOCUMENTATION/org/ trunk/DOCUMENTATION/org/slac/ trunk/DOCUMENTATION/org/slac/server/ trunk/DOCUMENTATION/org/slac/server/ChatLobby.html trunk/DOCUMENTATION/org/slac/server/ClientThread.html trunk/DOCUMENTATION/org/slac/server/GameLobby.html trunk/DOCUMENTATION/org/slac/server/Lobby.html trunk/DOCUMENTATION/org/slac/server/Server.html trunk/DOCUMENTATION/org/slac/server/ServerLoader.html trunk/DOCUMENTATION/org/slac/server/package-frame.html trunk/DOCUMENTATION/org/slac/server/package-summary.html trunk/DOCUMENTATION/org/slac/server/package-tree.html trunk/DOCUMENTATION/overview-tree.html trunk/DOCUMENTATION/package-list trunk/DOCUMENTATION/resources/ trunk/DOCUMENTATION/resources/inherit.gif trunk/DOCUMENTATION/stylesheet.css trunk/src/ Removed Paths: ------------- trunk/org/ Added: trunk/DOCUMENTATION/allclasses-frame.html =================================================================== --- trunk/DOCUMENTATION/allclasses-frame.html (rev 0) +++ trunk/DOCUMENTATION/allclasses-frame.html 2007-02-25 22:05:31 UTC (rev 22) @@ -0,0 +1,41 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!--NewPage--> +<HTML> +<HEAD> +<!-- Generated by javadoc (build 1.6.0) on Sun Feb 25 16:31:15 EST 2007 --> +<TITLE> +All Classes +</TITLE> + +<META NAME="date" CONTENT="2007-02-25"> + +<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style"> + + +</HEAD> + +<BODY BGCOLOR="white"> +<FONT size="+1" CLASS="FrameHeadingFont"> +<B>All Classes</B></FONT> +<BR> + +<TABLE BORDER="0" WIDTH="100%" SUMMARY=""> +<TR> +<TD NOWRAP><FONT CLASS="FrameItemFont"><A HREF="org/slac/server/ChatLobby.html" title="class in org.slac.server" target="classFrame">ChatLobby</A> +<BR> +<A HREF="org/slac/server/ClientThread.html" title="class in org.slac.server" target="classFrame">ClientThread</A> +<BR> +<A HREF="org/slac/server/GameLobby.html" title="class in org.slac.server" target="classFrame">GameLobby</A> +<BR> +<A HREF="org/slac/server/Lobby.html" title="interface in org.slac.server" target="classFrame"><I>Lobby</I></A> +<BR> +<A HREF="org/slac/server/Server.html" title="class in org.slac.server" target="classFrame">Server</A> +<BR> +<A HREF="org/slac/server/ServerLoader.html" title="class in org.slac.server" target="classFrame">ServerLoader</A> +<BR> +</FONT></TD> +</TR> +</TABLE> + +</BODY> +</HTML> Added: trunk/DOCUMENTATION/allclasses-noframe.html =================================================================== --- trunk/DOCUMENTATION/allclasses-noframe.html (rev 0) +++ trunk/DOCUMENTATION/allclasses-noframe.html 2007-02-25 22:05:31 UTC (rev 22) @@ -0,0 +1,41 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!--NewPage--> +<HTML> +<HEAD> +<!-- Generated by javadoc (build 1.6.0) on Sun Feb 25 16:31:15 EST 2007 --> +<TITLE> +All Classes +</TITLE> + +<META NAME="date" CONTENT="2007-02-25"> + +<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style"> + + +</HEAD> + +<BODY BGCOLOR="white"> +<FONT size="+1" CLASS="FrameHeadingFont"> +<B>All Classes</B></FONT> +<BR> + +<TABLE BORDER="0" WIDTH="100%" SUMMARY=""> +<TR> +<TD NOWRAP><FONT CLASS="FrameItemFont"><A HREF="org/slac/server/ChatLobby.html" title="class in org.slac.server">ChatLobby</A> +<BR> +<A HREF="org/slac/server/ClientThread.html" title="class in org.slac.server">ClientThread</A> +<BR> +<A HREF="org/slac/server/GameLobby.html" title="class in org.slac.server">GameLobby</A> +<BR> +<A HREF="org/slac/server/Lobby.html" title="interface in org.slac.server"><I>Lobby</I></A> +<BR> +<A HREF="org/slac/server/Server.html" title="class in org.slac.server">Server</A> +<BR> +<A HREF="org/slac/server/ServerLoader.html" title="class in org.slac.server">ServerLoader</A> +<BR> +</FONT></TD> +</TR> +</TABLE> + +</BODY> +</HTML> Added: trunk/DOCUMENTATION/constant-values.html =================================================================== --- trunk/DOCUMENTATION/constant-values.html (rev 0) +++ trunk/DOCUMENTATION/constant-values.html 2007-02-25 22:05:31 UTC (rev 22) @@ -0,0 +1,142 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!--NewPage--> +<HTML> +<HEAD> +<!-- Generated by javadoc (build 1.6.0) on Sun Feb 25 16:31:15 EST 2007 --> +<TITLE> +Constant Field Values +</TITLE> + +<META NAME="date" CONTENT="2007-02-25"> + +<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style"> + +<SCRIPT type="text/javascript"> +function windowTitle() +{ + if (location.href.indexOf('is-external=true') == -1) { + parent.document.title="Constant Field Values"; + } +} +</SCRIPT> +<NOSCRIPT> +</NOSCRIPT> + +</HEAD> + +<BODY BGCOLOR="white" onload="windowTitle();"> +<HR> + + +<!-- ========= START OF TOP NAVBAR ======= --> +<A NAME="navbar_top"><!-- --></A> +<A HREF="#skip-navbar_top" title="Skip navigation links"></A> +<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> +<TR> +<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> +<A NAME="navbar_top_firstrow"><!-- --></A> +<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> + <TR ALIGN="center" VALIGN="top"> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="org/slac/server/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="org/slac/server/package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> + </TR> +</TABLE> +</TD> +<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> +</EM> +</TD> +</TR> + +<TR> +<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> + PREV + NEXT</FONT></TD> +<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> + <A HREF="index.html?constant-values.html" target="_top"><B>FRAMES</B></A> + <A HREF="constant-values.html" target="_top"><B>NO FRAMES</B></A> + <SCRIPT type="text/javascript"> + <!-- + if(window==top) { + document.writeln('<A HREF="allclasses-noframe.html"><B>All Classes</B></A>'); + } + //--> +</SCRIPT> +<NOSCRIPT> + <A HREF="allclasses-noframe.html"><B>All Classes</B></A> +</NOSCRIPT> + + +</FONT></TD> +</TR> +</TABLE> +<A NAME="skip-navbar_top"></A> +<!-- ========= END OF TOP NAVBAR ========= --> + +<HR> +<CENTER> +<H1> +Constant Field Values</H1> +</CENTER> +<HR SIZE="4" NOSHADE> +<B>Contents</B><UL> +</UL> + +<HR> + + +<!-- ======= START OF BOTTOM NAVBAR ====== --> +<A NAME="navbar_bottom"><!-- --></A> +<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> +<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> +<TR> +<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> +<A NAME="navbar_bottom_firstrow"><!-- --></A> +<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> + <TR ALIGN="center" VALIGN="top"> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="org/slac/server/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="org/slac/server/package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> + </TR> +</TABLE> +</TD> +<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> +</EM> +</TD> +</TR> + +<TR> +<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> + PREV + NEXT</FONT></TD> +<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> + <A HREF="index.html?constant-values.html" target="_top"><B>FRAMES</B></A> + <A HREF="constant-values.html" target="_top"><B>NO FRAMES</B></A> + <SCRIPT type="text/javascript"> + <!-- + if(window==top) { + document.writeln('<A HREF="allclasses-noframe.html"><B>All Classes</B></A>'); + } + //--> +</SCRIPT> +<NOSCRIPT> + <A HREF="allclasses-noframe.html"><B>All Classes</B></A> +</NOSCRIPT> + + +</FONT></TD> +</TR> +</TABLE> +<A NAME="skip-navbar_bottom"></A> +<!-- ======== END OF BOTTOM NAVBAR ======= --> + +<HR> + +</BODY> +</HTML> Added: trunk/DOCUMENTATION/deprecated-list.html =================================================================== --- trunk/DOCUMENTATION/deprecated-list.html (rev 0) +++ trunk/DOCUMENTATION/deprecated-list.html 2007-02-25 22:05:31 UTC (rev 22) @@ -0,0 +1,142 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!--NewPage--> +<HTML> +<HEAD> +<!-- Generated by javadoc (build 1.6.0) on Sun Feb 25 16:31:15 EST 2007 --> +<TITLE> +Deprecated List +</TITLE> + +<META NAME="date" CONTENT="2007-02-25"> + +<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style"> + +<SCRIPT type="text/javascript"> +function windowTitle() +{ + if (location.href.indexOf('is-external=true') == -1) { + parent.document.title="Deprecated List"; + } +} +</SCRIPT> +<NOSCRIPT> +</NOSCRIPT> + +</HEAD> + +<BODY BGCOLOR="white" onload="windowTitle();"> +<HR> + + +<!-- ========= START OF TOP NAVBAR ======= --> +<A NAME="navbar_top"><!-- --></A> +<A HREF="#skip-navbar_top" title="Skip navigation links"></A> +<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> +<TR> +<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> +<A NAME="navbar_top_firstrow"><!-- --></A> +<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> + <TR ALIGN="center" VALIGN="top"> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="org/slac/server/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="org/slac/server/package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> + <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Deprecated</B></FONT> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> + </TR> +</TABLE> +</TD> +<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> +</EM> +</TD> +</TR> + +<TR> +<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> + PREV + NEXT</FONT></TD> +<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> + <A HREF="index.html?deprecated-list.html" target="_top"><B>FRAMES</B></A> + <A HREF="deprecated-list.html" target="_top"><B>NO FRAMES</B></A> + <SCRIPT type="text/javascript"> + <!-- + if(window==top) { + document.writeln('<A HREF="allclasses-noframe.html"><B>All Classes</B></A>'); + } + //--> +</SCRIPT> +<NOSCRIPT> + <A HREF="allclasses-noframe.html"><B>All Classes</B></A> +</NOSCRIPT> + + +</FONT></TD> +</TR> +</TABLE> +<A NAME="skip-navbar_top"></A> +<!-- ========= END OF TOP NAVBAR ========= --> + +<HR> +<CENTER> +<H2> +<B>Deprecated API</B></H2> +</CENTER> +<HR SIZE="4" NOSHADE> +<B>Contents</B><UL> +</UL> + +<HR> + + +<!-- ======= START OF BOTTOM NAVBAR ====== --> +<A NAME="navbar_bottom"><!-- --></A> +<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> +<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> +<TR> +<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> +<A NAME="navbar_bottom_firstrow"><!-- --></A> +<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> + <TR ALIGN="center" VALIGN="top"> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="org/slac/server/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="org/slac/server/package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> + <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Deprecated</B></FONT> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> + </TR> +</TABLE> +</TD> +<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> +</EM> +</TD> +</TR> + +<TR> +<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> + PREV + NEXT</FONT></TD> +<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> + <A HREF="index.html?deprecated-list.html" target="_top"><B>FRAMES</B></A> + <A HREF="deprecated-list.html" target="_top"><B>NO FRAMES</B></A> + <SCRIPT type="text/javascript"> + <!-- + if(window==top) { + document.writeln('<A HREF="allclasses-noframe.html"><B>All Classes</B></A>'); + } + //--> +</SCRIPT> +<NOSCRIPT> + <A HREF="allclasses-noframe.html"><B>All Classes</B></A> +</NOSCRIPT> + + +</FONT></TD> +</TR> +</TABLE> +<A NAME="skip-navbar_bottom"></A> +<!-- ======== END OF BOTTOM NAVBAR ======= --> + +<HR> + +</BODY> +</HTML> Added: trunk/DOCUMENTATION/help-doc.html =================================================================== --- trunk/DOCUMENTATION/help-doc.html (rev 0) +++ trunk/DOCUMENTATION/help-doc.html 2007-02-25 22:05:31 UTC (rev 22) @@ -0,0 +1,209 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!--NewPage--> +<HTML> +<HEAD> +<!-- Generated by javadoc (build 1.6.0) on Sun Feb 25 16:31:15 EST 2007 --> +<TITLE> +API Help +</TITLE> + +<META NAME="date" CONTENT="2007-02-25"> + +<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style"> + +<SCRIPT type="text/javascript"> +function windowTitle() +{ + if (location.href.indexOf('is-external=true') == -1) { + parent.document.title="API Help"; + } +} +</SCRIPT> +<NOSCRIPT> +</NOSCRIPT> + +</HEAD> + +<BODY BGCOLOR="white" onload="windowTitle();"> +<HR> + + +<!-- ========= START OF TOP NAVBAR ======= --> +<A NAME="navbar_top"><!-- --></A> +<A HREF="#skip-navbar_top" title="Skip navigation links"></A> +<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> +<TR> +<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> +<A NAME="navbar_top_firstrow"><!-- --></A> +<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> + <TR ALIGN="center" VALIGN="top"> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="org/slac/server/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="org/slac/server/package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> + <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Help</B></FONT> </TD> + </TR> +</TABLE> +</TD> +<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> +</EM> +</TD> +</TR> + +<TR> +<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> + PREV + NEXT</FONT></TD> +<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> + <A HREF="index.html?help-doc.html" target="_top"><B>FRAMES</B></A> + <A HREF="help-doc.html" target="_top"><B>NO FRAMES</B></A> + <SCRIPT type="text/javascript"> + <!-- + if(window==top) { + document.writeln('<A HREF="allclasses-noframe.html"><B>All Classes</B></A>'); + } + //--> +</SCRIPT> +<NOSCRIPT> + <A HREF="allclasses-noframe.html"><B>All Classes</B></A> +</NOSCRIPT> + + +</FONT></TD> +</TR> +</TABLE> +<A NAME="skip-navbar_top"></A> +<!-- ========= END OF TOP NAVBAR ========= --> + +<HR> +<CENTER> +<H1> +How This API Document Is Organized</H1> +</CENTER> +This API (Application Programming Interface) document has pages corresponding to the items in the navigation bar, described as follows.<H3> +Package</H3> +<BLOCKQUOTE> + +<P> +Each package has a page that contains a list of its classes and interfaces, with a summary for each. This page can contain four categories:<UL> +<LI>Interfaces (italic)<LI>Classes<LI>Enums<LI>Exceptions<LI>Errors<LI>Annotation Types</UL> +</BLOCKQUOTE> +<H3> +Class/Interface</H3> +<BLOCKQUOTE> + +<P> +Each class, interface, nested class and nested interface has its own separate page. Each of these pages has three sections consisting of a class/interface description, summary tables, and detailed member descriptions:<UL> +<LI>Class inheritance diagram<LI>Direct Subclasses<LI>All Known Subinterfaces<LI>All Known Implementing Classes<LI>Class/interface declaration<LI>Class/interface description +<P> +<LI>Nested Class Summary<LI>Field Summary<LI>Constructor Summary<LI>Method Summary +<P> +<LI>Field Detail<LI>Constructor Detail<LI>Method Detail</UL> +Each summary entry contains the first sentence from the detailed description for that item. The summary entries are alphabetical, while the detailed descriptions are in the order they appear in the source code. This preserves the logical groupings established by the programmer.</BLOCKQUOTE> +</BLOCKQUOTE> +<H3> +Annotation Type</H3> +<BLOCKQUOTE> + +<P> +Each annotation type has its own separate page with the following sections:<UL> +<LI>Annotation Type declaration<LI>Annotation Type description<LI>Required Element Summary<LI>Optional Element Summary<LI>Element Detail</UL> +</BLOCKQUOTE> +</BLOCKQUOTE> +<H3> +Enum</H3> +<BLOCKQUOTE> + +<P> +Each enum has its own separate page with the following sections:<UL> +<LI>Enum declaration<LI>Enum description<LI>Enum Constant Summary<LI>Enum Constant Detail</UL> +</BLOCKQUOTE> +<H3> +Tree (Class Hierarchy)</H3> +<BLOCKQUOTE> +There is a <A HREF="overview-tree.html">Class Hierarchy</A> page for all packages, plus a hierarchy for each package. Each hierarchy page contains a list of classes and a list of interfaces. The classes are organized by inheritance structure starting with <code>java.lang.Object</code>. The interfaces do not inherit from <code>java.lang.Object</code>.<UL> +<LI>When viewing the Overview page, clicking on "Tree" displays the hierarchy for all packages.<LI>When viewing a particular package, class or interface page, clicking "Tree" displays the hierarchy for only that package.</UL> +</BLOCKQUOTE> +<H3> +Deprecated API</H3> +<BLOCKQUOTE> +The <A HREF="deprecated-list.html">Deprecated API</A> page lists all of the API that have been deprecated. A deprecated API is not recommended for use, generally due to improvements, and a replacement API is usually given. Deprecated APIs may be removed in future implementations.</BLOCKQUOTE> +<H3> +Index</H3> +<BLOCKQUOTE> +The <A HREF="index-all.html">Index</A> contains an alphabetic list of all classes, interfaces, constructors, methods, and fields.</BLOCKQUOTE> +<H3> +Prev/Next</H3> +These links take you to the next or previous class, interface, package, or related page.<H3> +Frames/No Frames</H3> +These links show and hide the HTML frames. All pages are available with or without frames. +<P> +<H3> +Serialized Form</H3> +Each serializable or externalizable class has a description of its serialization fields and methods. This information is of interest to re-implementors, not to developers using the API. While there is no link in the navigation bar, you can get to this information by going to any serialized class and clicking "Serialized Form" in the "See also" section of the class description. +<P> +<H3> +Constant Field Values</H3> +The <a href="constant-values.html">Constant Field Values</a> page lists the static final fields and their values. +<P> +<FONT SIZE="-1"> +<EM> +This help file applies to API documentation generated using the standard doclet.</EM> +</FONT> +<BR> +<HR> + + +<!-- ======= START OF BOTTOM NAVBAR ====== --> +<A NAME="navbar_bottom"><!-- --></A> +<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> +<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> +<TR> +<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> +<A NAME="navbar_bottom_firstrow"><!-- --></A> +<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> + <TR ALIGN="center" VALIGN="top"> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="org/slac/server/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="org/slac/server/package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> + <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Help</B></FONT> </TD> + </TR> +</TABLE> +</TD> +<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> +</EM> +</TD> +</TR> + +<TR> +<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> + PREV + NEXT</FONT></TD> +<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> + <A HREF="index.html?help-doc.html" target="_top"><B>FRAMES</B></A> + <A HREF="help-doc.html" target="_top"><B>NO FRAMES</B></A> + <SCRIPT type="text/javascript"> + <!-- + if(window==top) { + document.writeln('<A HREF="allclasses-noframe.html"><B>All Classes</B></A>'); + } + //--> +</SCRIPT> +<NOSCRIPT> + <A HREF="allclasses-noframe.html"><B>All Classes</B></A> +</NOSCRIPT> + + +</FONT></TD> +</TR> +</TABLE> +<A NAME="skip-navbar_bottom"></A> +<!-- ======== END OF BOTTOM NAVBAR ======= --> + +<HR> + +</BODY> +</HTML> Added: trunk/DOCUMENTATION/index-all.html =================================================================== --- trunk/DOCUMENTATION/index-all.html (rev 0) +++ trunk/DOCUMENTATION/index-all.html 2007-02-25 22:05:31 UTC (rev 22) @@ -0,0 +1,358 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!--NewPage--> +<HTML> +<HEAD> +<!-- Generated by javadoc (build 1.6.0) on Sun Feb 25 16:31:15 EST 2007 --> +<TITLE> +Index +</TITLE> + +<META NAME="date" CONTENT="2007-02-25"> + +<LINK REL ="stylesheet" TYPE="text/css" HREF="./stylesheet.css" TITLE="Style"> + +<SCRIPT type="text/javascript"> +function windowTitle() +{ + if (location.href.indexOf('is-external=true') == -1) { + parent.document.title="Index"; + } +} +</SCRIPT> +<NOSCRIPT> +</NOSCRIPT> + +</HEAD> + +<BODY BGCOLOR="white" onload="windowTitle();"> +<HR> + + +<!-- ========= START OF TOP NAVBAR ======= --> +<A NAME="navbar_top"><!-- --></A> +<A HREF="#skip-navbar_top" title="Skip navigation links"></A> +<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> +<TR> +<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> +<A NAME="navbar_top_firstrow"><!-- --></A> +<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> + <TR ALIGN="center" VALIGN="top"> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="./org/slac/server/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="./org/slac/server/package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="./deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> + <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Index</B></FONT> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="./help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> + </TR> +</TABLE> +</TD> +<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> +</EM> +</TD> +</TR> + +<TR> +<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> + PREV + NEXT</FONT></TD> +<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> + <A HREF="./index.html?index-all.html" target="_top"><B>FRAMES</B></A> + <A HREF="index-all.html" target="_top"><B>NO FRAMES</B></A> + <SCRIPT type="text/javascript"> + <!-- + if(window==top) { + document.writeln('<A HREF="./allclasses-noframe.html"><B>All Classes</B></A>'); + } + //--> +</SCRIPT> +<NOSCRIPT> + <A HREF="./allclasses-noframe.html"><B>All Classes</B></A> +</NOSCRIPT> + + +</FONT></TD> +</TR> +</TABLE> +<A NAME="skip-navbar_top"></A> +<!-- ========= END OF TOP NAVBAR ========= --> + +<A HREF="#_A_">A</A> <A HREF="#_C_">C</A> <A HREF="#_G_">G</A> <A HREF="#_I_">I</A> <A HREF="#_K_">K</A> <A HREF="#_L_">L</A> <A HREF="#_M_">M</A> <A HREF="#_N_">N</A> <A HREF="#_O_">O</A> <A HREF="#_P_">P</A> <A HREF="#_R_">R</A> <A HREF="#_S_">S</A> <HR> +<A NAME="_A_"><!-- --></A><H2> +<B>A</B></H2> +<DL> +<DT><A HREF="./org/slac/server/ChatLobby.html#addUser(org.slac.server.ClientThread, java.util.UUID, java.lang.String)"><B>addUser(ClientThread, UUID, String)</B></A> - +Method in class org.slac.server.<A HREF="./org/slac/server/ChatLobby.html" title="class in org.slac.server">ChatLobby</A> +<DD> +<DT><A HREF="./org/slac/server/Lobby.html#addUser(org.slac.server.ClientThread, java.util.UUID, java.lang.String)"><B>addUser(ClientThread, UUID, String)</B></A> - +Method in interface org.slac.server.<A HREF="./org/slac/server/Lobby.html" title="interface in org.slac.server">Lobby</A> +<DD> +<DT><A HREF="./org/slac/server/Server.html#addUser(java.lang.String, java.util.UUID)"><B>addUser(String, UUID)</B></A> - +Method in class org.slac.server.<A HREF="./org/slac/server/Server.html" title="class in org.slac.server">Server</A> +<DD> +</DL> +<HR> +<A NAME="_C_"><!-- --></A><H2> +<B>C</B></H2> +<DL> +<DT><A HREF="./org/slac/server/ChatLobby.html#canJoin()"><B>canJoin()</B></A> - +Method in class org.slac.server.<A HREF="./org/slac/server/ChatLobby.html" title="class in org.slac.server">ChatLobby</A> +<DD> +<DT><A HREF="./org/slac/server/Lobby.html#canJoin()"><B>canJoin()</B></A> - +Method in interface org.slac.server.<A HREF="./org/slac/server/Lobby.html" title="interface in org.slac.server">Lobby</A> +<DD> +<DT><A HREF="./org/slac/server/ClientThread.html#changeLobbies(java.lang.String, boolean)"><B>changeLobbies(String, boolean)</B></A> - +Method in class org.slac.server.<A HREF="./org/slac/server/ClientThread.html" title="class in org.slac.server">ClientThread</A> +<DD>Can Only be called by server + Updates the client with lobbies that have been added or deleted +<DT><A HREF="./org/slac/server/ClientThread.html#changeUserClass(java.lang.String, boolean)"><B>changeUserClass(String, boolean)</B></A> - +Method in class org.slac.server.<A HREF="./org/slac/server/ClientThread.html" title="class in org.slac.server">ClientThread</A> +<DD> +<DT><A HREF="./org/slac/server/ClientThread.html#changeUsers(java.lang.String, boolean)"><B>changeUsers(String, boolean)</B></A> - +Method in class org.slac.server.<A HREF="./org/slac/server/ClientThread.html" title="class in org.slac.server">ClientThread</A> +<DD>Can only be called by server + Updates the client with users that have been added or deleted +<DT><A HREF="./org/slac/server/ClientThread.html#changeUsersLobby(java.lang.String, boolean)"><B>changeUsersLobby(String, boolean)</B></A> - +Method in class org.slac.server.<A HREF="./org/slac/server/ClientThread.html" title="class in org.slac.server">ClientThread</A> +<DD>Can only be called by the server +<DT><A HREF="./org/slac/server/ClientThread.html#chat(java.lang.String, boolean)"><B>chat(String, boolean)</B></A> - +Method in class org.slac.server.<A HREF="./org/slac/server/ClientThread.html" title="class in org.slac.server">ClientThread</A> +<DD> +<DT><A HREF="./org/slac/server/ChatLobby.html" title="class in org.slac.server"><B>ChatLobby</B></A> - Class in <A HREF="./org/slac/server/package-summary.html">org.slac.server</A><DD> <DT><A HREF="./org/slac/server/ChatLobby.html#ChatLobby(java.lang.String, org.slac.server.Server, int, boolean, java.lang.String)"><B>ChatLobby(String, Server, int, boolean, String)</B></A> - +Constructor for class org.slac.server.<A HREF="./org/slac/server/ChatLobby.html" title="class in org.slac.server">ChatLobby</A> +<DD> +<DT><A HREF="./org/slac/server/ChatLobby.html#ChatLobby(java.lang.String, org.slac.server.Server, int)"><B>ChatLobby(String, Server, int)</B></A> - +Constructor for class org.slac.server.<A HREF="./org/slac/server/ChatLobby.html" title="class in org.slac.server">ChatLobby</A> +<DD> +<DT><A HREF="./org/slac/server/ClientThread.html" title="class in org.slac.server"><B>ClientThread</B></A> - Class in <A HREF="./org/slac/server/package-summary.html">org.slac.server</A><DD>This class does the general work related to a single client<DT><A HREF="./org/slac/server/ClientThread.html#ClientThread(org.slac.server.Server, java.net.Socket, java.util.UUID)"><B>ClientThread(Server, Socket, UUID)</B></A> - +Constructor for class org.slac.server.<A HREF="./org/slac/server/ClientThread.html" title="class in org.slac.server">ClientThread</A> +<DD> +</DL> +<HR> +<A NAME="_G_"><!-- --></A><H2> +<B>G</B></H2> +<DL> +<DT><A HREF="./org/slac/server/GameLobby.html" title="class in org.slac.server"><B>GameLobby</B></A> - Class in <A HREF="./org/slac/server/package-summary.html">org.slac.server</A><DD> <DT><A HREF="./org/slac/server/GameLobby.html#GameLobby(java.lang.String, org.slac.server.Server, int)"><B>GameLobby(String, Server, int)</B></A> - +Constructor for class org.slac.server.<A HREF="./org/slac/server/GameLobby.html" title="class in org.slac.server">GameLobby</A> +<DD> +<DT><A HREF="./org/slac/server/GameLobby.html#GameLobby(java.lang.String, org.slac.server.Server, int, java.lang.String, boolean, java.lang.String)"><B>GameLobby(String, Server, int, String, boolean, String)</B></A> - +Constructor for class org.slac.server.<A HREF="./org/slac/server/GameLobby.html" title="class in org.slac.server">GameLobby</A> +<DD> +<DT><A HREF="./org/slac/server/ChatLobby.html#getLobbyName()"><B>getLobbyName()</B></A> - +Method in class org.slac.server.<A HREF="./org/slac/server/ChatLobby.html" title="class in org.slac.server">ChatLobby</A> +<DD> +<DT><A HREF="./org/slac/server/Lobby.html#getLobbyName()"><B>getLobbyName()</B></A> - +Method in interface org.slac.server.<A HREF="./org/slac/server/Lobby.html" title="interface in org.slac.server">Lobby</A> +<DD> +<DT><A HREF="./org/slac/server/ChatLobby.html#getLobbyType()"><B>getLobbyType()</B></A> - +Method in class org.slac.server.<A HREF="./org/slac/server/ChatLobby.html" title="class in org.slac.server">ChatLobby</A> +<DD> +<DT><A HREF="./org/slac/server/Lobby.html#getLobbyType()"><B>getLobbyType()</B></A> - +Method in interface org.slac.server.<A HREF="./org/slac/server/Lobby.html" title="interface in org.slac.server">Lobby</A> +<DD> +<DT><A HREF="./org/slac/server/ChatLobby.html#getUsers()"><B>getUsers()</B></A> - +Method in class org.slac.server.<A HREF="./org/slac/server/ChatLobby.html" title="class in org.slac.server">ChatLobby</A> +<DD> +<DT><A HREF="./org/slac/server/Lobby.html#getUsers()"><B>getUsers()</B></A> - +Method in interface org.slac.server.<A HREF="./org/slac/server/Lobby.html" title="interface in org.slac.server">Lobby</A> +<DD> +<DT><A HREF="./org/slac/server/Server.html#getUsers()"><B>getUsers()</B></A> - +Method in class org.slac.server.<A HREF="./org/slac/server/Server.html" title="class in org.slac.server">Server</A> +<DD> +<DT><A HREF="./org/slac/server/ClientThread.html#getUUID()"><B>getUUID()</B></A> - +Method in class org.slac.server.<A HREF="./org/slac/server/ClientThread.html" title="class in org.slac.server">ClientThread</A> +<DD> +</DL> +<HR> +<A NAME="_I_"><!-- --></A><H2> +<B>I</B></H2> +<DL> +<DT><A HREF="./org/slac/server/ChatLobby.html#isPrivate()"><B>isPrivate()</B></A> - +Method in class org.slac.server.<A HREF="./org/slac/server/ChatLobby.html" title="class in org.slac.server">ChatLobby</A> +<DD> +<DT><A HREF="./org/slac/server/Lobby.html#isPrivate()"><B>isPrivate()</B></A> - +Method in interface org.slac.server.<A HREF="./org/slac/server/Lobby.html" title="interface in org.slac.server">Lobby</A> +<DD> +</DL> +<HR> +<A NAME="_K_"><!-- --></A><H2> +<B>K</B></H2> +<DL> +<DT><A HREF="./org/slac/server/ClientThread.html#kickUser(java.lang.String, boolean)"><B>kickUser(String, boolean)</B></A> - +Method in class org.slac.server.<A HREF="./org/slac/server/ClientThread.html" title="class in org.slac.server">ClientThread</A> +<DD> +<DT><A HREF="./org/slac/server/ClientThread.html#kickUserGame(java.lang.String, boolean)"><B>kickUserGame(String, boolean)</B></A> - +Method in class org.slac.server.<A HREF="./org/slac/server/ClientThread.html" title="class in org.slac.server">ClientThread</A> +<DD> +</DL> +<HR> +<A NAME="_L_"><!-- --></A><H2> +<B>L</B></H2> +<DL> +<DT><A HREF="./org/slac/server/Lobby.html" title="interface in org.slac.server"><B>Lobby</B></A> - Interface in <A HREF="./org/slac/server/package-summary.html">org.slac.server</A><DD> <DT><A HREF="./org/slac/server/ClientThread.html#login(java.lang.String, boolean)"><B>login(String, boolean)</B></A> - +Method in class org.slac.server.<A HREF="./org/slac/server/ClientThread.html" title="class in org.slac.server">ClientThread</A> +<DD>Can't be called by the server +<DT><A HREF="./org/slac/server/Server.html#login(java.lang.String, java.util.UUID)"><B>login(String, UUID)</B></A> - +Method in class org.slac.server.<A HREF="./org/slac/server/Server.html" title="class in org.slac.server">Server</A> +<DD> +<DT><A HREF="./org/slac/server/ClientThread.html#loginFailed(java.lang.String, boolean)"><B>loginFailed(String, boolean)</B></A> - +Method in class org.slac.server.<A HREF="./org/slac/server/ClientThread.html" title="class in org.slac.server">ClientThread</A> +<DD>Can only be called by the server +<DT><A HREF="./org/slac/server/ClientThread.html#loginOk(java.lang.String, boolean)"><B>loginOk(String, boolean)</B></A> - +Method in class org.slac.server.<A HREF="./org/slac/server/ClientThread.html" title="class in org.slac.server">ClientThread</A> +<DD>Can only be called by the server +<DT><A HREF="./org/slac/server/ClientThread.html#logout(java.lang.String, boolean)"><B>logout(String, boolean)</B></A> - +Method in class org.slac.server.<A HREF="./org/slac/server/ClientThread.html" title="class in org.slac.server">ClientThread</A> +<DD>Tells either the client or the server that they are disconnecting +</DL> +<HR> +<A NAME="_M_"><!-- --></A><H2> +<B>M</B></H2> +<DL> +<DT><A HREF="./org/slac/server/ServerLoader.html#main(java.lang.String[])"><B>main(String[])</B></A> - +Static method in class org.slac.server.<A HREF="./org/slac/server/ServerLoader.html" title="class in org.slac.server">ServerLoader</A> +<DD> +<DT><A HREF="./org/slac/server/ChatLobby.html#maxUsers()"><B>maxUsers()</B></A> - +Method in class org.slac.server.<A HREF="./org/slac/server/ChatLobby.html" title="class in org.slac.server">ChatLobby</A> +<DD> +<DT><A HREF="./org/slac/server/Lobby.html#maxUsers()"><B>maxUsers()</B></A> - +Method in interface org.slac.server.<A HREF="./org/slac/server/Lobby.html" title="interface in org.slac.server">Lobby</A> +<DD> +<DT><A HREF="./org/slac/server/ClientThread.html#motd(java.lang.String, boolean)"><B>motd(String, boolean)</B></A> - +Method in class org.slac.server.<A HREF="./org/slac/server/ClientThread.html" title="class in org.slac.server">ClientThread</A> +<DD>Can only be called by server +</DL> +<HR> +<A NAME="_N_"><!-- --></A><H2> +<B>N</B></H2> +<DL> +<DT><A HREF="./org/slac/server/Server.html#newChatLobby(java.lang.String, int, boolean, java.lang.String)"><B>newChatLobby(String, int, boolean, String)</B></A> - +Method in class org.slac.server.<A HREF="./org/slac/server/Server.html" title="class in org.slac.server">Server</A> +<DD> +<DT><A HREF="./org/slac/server/ClientThread.html#newGame(java.lang.String, boolean)"><B>newGame(String, boolean)</B></A> - +Method in class org.slac.server.<A HREF="./org/slac/server/ClientThread.html" title="class in org.slac.server">ClientThread</A> +<DD> +<DT><A HREF="./org/slac/server/Server.html#newGameLobby(java.lang.String, int, java.lang.String, boolean, java.lang.String)"><B>newGameLobby(String, int, String, boolean, String)</B></A> - +Method in class org.slac.server.<A HREF="./org/slac/server/Server.html" title="class in org.slac.server">Server</A> +<DD> +<DT><A HREF="./org/slac/server/ChatLobby.html#numberUsers()"><B>numberUsers()</B></A> - +Method in class org.slac.server.<A HREF="./org/slac/server/ChatLobby.html" title="class in org.slac.server">ChatLobby</A> +<DD> +<DT><A HREF="./org/slac/server/Lobby.html#numberUsers()"><B>numberUsers()</B></A> - +Method in interface org.slac.server.<A HREF="./org/slac/server/Lobby.html" title="interface in org.slac.server">Lobby</A> +<DD> +</DL> +<HR> +<A NAME="_O_"><!-- --></A><H2> +<B>O</B></H2> +<DL> +<DT><A HREF="./org/slac/server/ClientThread.html#oldProtocol(java.lang.String, boolean)"><B>oldProtocol(String, boolean)</B></A> - +Method in class org.slac.server.<A HREF="./org/slac/server/ClientThread.html" title="class in org.slac.server">ClientThread</A> +<DD>Can only be called by the server +<DT><A HREF="./org/slac/server/package-summary.html"><B>org.slac.server</B></A> - package org.slac.server<DD> </DL> +<HR> +<A NAME="_P_"><!-- --></A><H2> +<B>P</B></H2> +<DL> +<DT><A HREF="./org/slac/server/ClientThread.html#privateMessage(java.lang.String, boolean)"><B>privateMessage(String, boolean)</B></A> - +Method in class org.slac.server.<A HREF="./org/slac/server/ClientThread.html" title="class in org.slac.server">ClientThread</A> +<DD> +</DL> +<HR> +<A NAME="_R_"><!-- --></A><H2> +<B>R</B></H2> +<DL> +<DT><A HREF="./org/slac/server/Server.html#removeMe(java.util.UUID)"><B>removeMe(UUID)</B></A> - +Method in class org.slac.server.<A HREF="./org/slac/server/Server.html" title="class in org.slac.server">Server</A> +<DD> +<DT><A HREF="./org/slac/server/Server.html#requestLobbyChange(java.lang.String, java.lang.String, java.util.UUID)"><B>requestLobbyChange(String, String, UUID)</B></A> - +Method in class org.slac.server.<A HREF="./org/slac/server/Server.html" title="class in org.slac.server">Server</A> +<DD>This implementation will change once we proceede to setup a database with usernames + and passwords +<DT><A HREF="./org/slac/server/Server.html#requestLobbyChange(java.lang.String)"><B>requestLobbyChange(String)</B></A> - +Method in class org.slac.server.<A HREF="./org/slac/server/Server.html" title="class in org.slac.server">Server</A> +<DD> +<DT><A HREF="./org/slac/server/ChatLobby.html#run()"><B>run()</B></A> - +Method in class org.slac.server.<A HREF="./org/slac/server/ChatLobby.html" title="class in org.slac.server">ChatLobby</A> +<DD> +<DT><A HREF="./org/slac/server/ClientThread.html#run()"><B>run()</B></A> - +Method in class org.slac.server.<A HREF="./org/slac/server/ClientThread.html" title="class in org.slac.server">ClientThread</A> +<DD> +<DT><A HREF="./org/slac/server/Server.html#run()"><B>run()</B></A> - +Method in class org.slac.server.<A HREF="./org/slac/server/Server.html" title="class in org.slac.server">Server</A> +<DD> +</DL> +<HR> +<A NAME="_S_"><!-- --></A><H2> +<B>S</B></H2> +<DL> +<DT><A HREF="./org/slac/server/ChatLobby.html#sendChat(java.lang.String)"><B>sendChat(String)</B></A> - +Method in class org.slac.server.<A HREF="./org/slac/server/ChatLobby.html" title="class in org.slac.server">ChatLobby</A> +<DD> +<DT><A HREF="./org/slac/server/Lobby.html#sendChat(java.lang.String)"><B>sendChat(String)</B></A> - +Method in interface org.slac.server.<A HREF="./org/slac/server/Lobby.html" title="interface in org.slac.server">Lobby</A> +<DD> +<DT><A HREF="./org/slac/server/Server.html" title="class in org.slac.server"><B>Server</B></A> - Class in <A HREF="./org/slac/server/package-summary.html">org.slac.server</A><DD> <DT><A HREF="./org/slac/server/Server.html#Server(int, int)"><B>Server(int, int)</B></A> - +Constructor for class org.slac.server.<A HREF="./org/slac/server/Server.html" title="class in org.slac.server">Server</A> +<DD> +<DT><A HREF="./org/slac/server/ServerLoader.html" title="class in org.slac.server"><B>ServerLoader</B></A> - Class in <A HREF="./org/slac/server/package-summary.html">org.slac.server</A><DD> <DT><A HREF="./org/slac/server/ServerLoader.html#ServerLoader()"><B>ServerLoader()</B></A> - +Constructor for class org.slac.server.<A HREF="./org/slac/server/ServerLoader.html" title="class in org.slac.server">ServerLoader</A> +<DD> +<DT><A HREF="./org/slac/server/ClientThread.html#switchLobby(java.lang.String, boolean)"><B>switchLobby(String, boolean)</B></A> - +Method in class org.slac.server.<A HREF="./org/slac/server/ClientThread.html" title="class in org.slac.server">ClientThread</A> +<DD> +</DL> +<HR> +<A HREF="#_A_">A</A> <A HREF="#_C_">C</A> <A HREF="#_G_">G</A> <A HREF="#_I_">I</A> <A HREF="#_K_">K</A> <A HREF="#_L_">L</A> <A HREF="#_M_">M</A> <A HREF="#_N_">N</A> <A HREF="#_O_">O</A> <A HREF="#_P_">P</A> <A HREF="#_R_">R</A> <A HREF="#_S_">S</A> + +<!-- ======= START OF BOTTOM NAVBAR ====== --> +<A NAME="navbar_bottom"><!-- --></A> +<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> +<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> +<TR> +<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> +<A NAME="navbar_bottom_firstrow"><!-- --></A> +<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> + <TR ALIGN="center" VALIGN="top"> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="./org/slac/server/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="./org/slac/server/package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="./deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> + <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Index</B></FONT> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="./help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> + </TR> +</TABLE> +</TD> +<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> +</EM> +</TD> +</TR> + +<TR> +<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> + PREV + NEXT</FONT></TD> +<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> + <A HREF="./index.html?index-all.html" target="_top"><B>FRAMES</B></A> + <A HREF="index-all.html" target="_top"><B>NO FRAMES</B></A> + <SCRIPT type="text/javascript"> + <!-- + if(window==top) { + document.writeln('<A HREF="./allclasses-noframe.html"><B>All Classes</B></A>'); + } + //--> +</SCRIPT> +<NOSCRIPT> + <A HREF="./allclasses-noframe.html"><B>All Classes</B></A> +</NOSCRIPT> + + +</FONT></TD> +</TR> +</TABLE> +<A NAME="skip-navbar_bottom"></A> +<!-- ======== END OF BOTTOM NAVBAR ======= --> + +<HR> + +</BODY> +</HTML> Added: trunk/DOCUMENTATION/index.html =================================================================== --- trunk/DOCUMENTATION/index.html (rev 0) +++ trunk/DOCUMENTATION/index.html 2007-02-25 22:05:31 UTC (rev 22) @@ -0,0 +1,34 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd"> +<!--NewPage--> +<HTML> +<HEAD> +<!-- Generated by javadoc on Sun Feb 25 16:31:15 EST 2007--> +<TITLE> +Generated Documentation (Untitled) +</TITLE> +<SCRIPT type="text/javascript"> + targetPage = "" + window.location.search; + if (targetPage != "" && targetPage != "undefined") + targetPage = targetPage.substring(1); + function loadFrames() { + if (targetPage != "" && targetPage != "undefined") + top.classFrame.location = top.targetPage; + } +</SCRIPT> +<NOSCRIPT> +</NOSCRIPT> +</HEAD> +<FRAMESET cols="20%,80%" title="" onLoad="top.loadFrames()"> +<FRAME src="allclasses-frame.html" name="packageFrame" title="All classes and interfaces (except non-static nested types)"> +<FRAME src="org/slac/server/package-summary.html" name="classFrame" title="Package, class and interface descriptions" scrolling="yes"> +<NOFRAMES> +<H2> +Frame Alert</H2> + +<P> +This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client. +<BR> +Link to<A HREF="org/slac/server/package-summary.html">Non-frame version.</A> +</NOFRAMES> +</FRAMESET> +</HTML> Added: trunk/DOCUMENTATION/org/slac/server/ChatLobby.html =================================================================== --- trunk/DOCUMENTATION/org/slac/server/ChatLobby.html (rev 0) +++ trunk/DOCUMENTATION/org/slac/server/ChatLobby.html 2007-02-25 22:05:31 UTC (rev 22) @@ -0,0 +1,498 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!--NewPage--> +<HTML> +<HEAD> +<!-- Generated by javadoc (build 1.6.0) on Sun Feb 25 16:31:14 EST 2007 --> +<TITLE> +ChatLobby +</TITLE> + +<META NAME="date" CONTENT="2007-02-25"> + +<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style"> + +<SCRIPT type="text/javascript"> +function windowTitle() +{ + if (location.href.indexOf('is-external=true') == -1) { + parent.document.title="ChatLobby"; + } +} +</SCRIPT> +<NOSCRIPT> +</NOSCRIPT> + +</HEAD> + +<BODY BGCOLOR="white" onload="windowTitle();"> +<HR> + + +<!-- ========= START OF TOP NAVBAR ======= --> +<A NAME="navbar_top"><!-- --></A> +<A HREF="#skip-navbar_top" title="Skip navigation links"></A> +<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> +<TR> +<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> +<A NAME="navbar_top_firstrow"><!-- --></A> +<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> + <TR ALIGN="center" VALIGN="top"> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../org/slac/server/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> + <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> + </TR> +</TABLE> +</TD> +<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> +</EM> +</TD> +</TR> + +<TR> +<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> + PREV CLASS + <A HREF="../../../org/slac/server/ClientThread.html" title="class in org.slac.server"><B>NEXT CLASS</B></A></FONT></TD> +<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> + <A HREF="../../../index.html?org/slac/server/ChatLobby.html" target="_top"><B>FRAMES</B></A> + <A HREF="ChatLobby.html" target="_top"><B>NO FRAMES</B></A> + <SCRIPT type="text/javascript"> + <!-- + if(window==top) { + document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>'); + } + //--> +</SCRIPT> +<NOSCRIPT> + <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A> +</NOSCRIPT> + + +</FONT></TD> +</TR> +<TR> +<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> + SUMMARY: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> +<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> +DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> +</TR> +</TABLE> +<A NAME="skip-navbar_top"></A> +<!-- ========= END OF TOP NAVBAR ========= --> + +<HR> +<!-- ======== START OF CLASS DATA ======== --> +<H2> +<FONT SIZE="-1"> +org.slac.server</FONT> +<BR> +Class ChatLobby</H2> +<PRE> +java.lang.Object + <IMG SRC="../../../resources/inherit.gif" ALT="extended by "><B>org.slac.server.ChatLobby</B> +</PRE> +<DL> +<DT><B>All Implemented Interfaces:</B> <DD>java.lang.Runnable, <A HREF="../../../org/slac/server/Lobby.html" title="interface in org.slac.server">Lobby</A></DD> +</DL> +<DL> +<DT><B>Direct Known Subclasses:</B> <DD><A HREF="../../../org/slac/server/GameLobby.html" title="class in org.slac.server">GameLobby</A></DD> +</DL> +<HR> +<DL> +<DT><PRE>public class <B>ChatLobby</B><DT>extends java.lang.Object<DT>implements <A HREF="../../../org/slac/server/Lobby.html" title="interface in org.slac.server">Lobby</A>, java.lang.Runnable</DL> +</PRE> + +<P> +<DL> +<DT><B>Since:</B></DT> + <DD>0.0</DD> +</DL> +<HR> + +<P> + +<!-- ======== CONSTRUCTOR SUMMARY ======== --> + +<A NAME="constructor_summary"><!-- --></A> +<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> +<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> +<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> +<B>Constructor Summary</B></FONT></TH> +</TR> +<TR BGCOLOR="white" CLASS="TableRowColor"> +<TD><CODE><B><A HREF="../../../org/slac/server/ChatLobby.html#ChatLobby(java.lang.String, org.slac.server.Server, int)">ChatLobby</A></B>(java.lang.String lobbyName, + <A HREF="../../../org/slac/server/Server.html" title="class in org.slac.server">Server</A> theServer, + int maxUsers)</CODE> + +<BR> + </TD> +</TR> +<TR BGCOLOR="white" CLASS="TableRowColor"> +<TD><CODE><B><A HREF="../../../org/slac/server/ChatLobby.html#ChatLobby(java.lang.String, org.slac.server.Server, int, boolean, java.lang.String)">ChatLobby</A></B>(java.lang.String lobbyName, + <A HREF="../../../org/slac/server/Server.html" title="class in org.slac.server">Server</A> theServer, + int maxUsers, + boolean priv, + java.lang.String password)</CODE> + +<BR> + </TD> +</TR> +</TABLE> + +<!-- ========== METHOD SUMMARY =========== --> + +<A NAME="method_summary"><!-- --></A> +<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> +<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> +<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> +<B>Method Summary</B></FONT></TH> +</TR> +<TR BGCOLOR="white" CLASS="TableRowColor"> +<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> +<CODE> void</CODE></FONT></TD> +<TD><CODE><B><A HREF="../../../org/slac/server/ChatLobby.html#addUser(org.slac.server.ClientThread, java.util.UUID, java.lang.String)">addUser</A></B>(<A HREF="../../../org/slac/server/ClientThread.html" title="class in org.slac.server">ClientThread</A> client, + java.util.UUID uuid, + java.lang.String password)</CODE> + +<BR> + </TD> +</TR> +<TR BGCOLOR="white" CLASS="TableRowColor"> +<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> +<CODE> boolean</CODE></FONT></TD> +<TD><CODE><B><A HREF="../../../org/slac/server/ChatLobby.html#canJoin()">canJoin</A></B>()</CODE> + +<BR> + </TD> +</TR> +<TR BGCOLOR="white" CLASS="TableRowColor"> +<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> +<CODE> java.lang.String</CODE></FONT></TD> +<TD><CODE><B><A HREF="../../../org/slac/server/ChatLobby.html#getLobbyName()">getLobbyName</A></B>()</CODE> + +<BR> + </TD> +</TR> +<TR BGCOLOR="white" CLASS="TableRowColor"> +<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> +<CODE> java.lang.String</CODE></FONT></TD> +<TD><CODE><B><A HREF="../../../org/slac/server/ChatLobby.html#getLobbyType()">getLobbyType</A></B>()</CODE> + +<BR> + </TD> +</TR> +<TR BGCOLOR="white" CLASS="TableRowColor"> +<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> +<CODE> java.util.TreeMap<java.util.UUID,<A HREF="../../../org/slac/server/ClientThread.html" title="class in org.slac.server">ClientThread</A>></CODE></FONT></TD> +<TD><CODE><B><A HREF="../../../org/slac/server/ChatLobby.html#getUsers()">getUsers</A></B>()</CODE> + +<BR> + </TD> +</TR> +<TR BGCOLOR="white" CLASS="TableRowColor"> +<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> +<CODE> boolean</CODE></FONT></TD> +<TD><CODE><B><A HREF="../../../org/slac/server/ChatLobby.html#isPrivate()">isPrivate</A></B>()</CODE> + +<BR> + </TD> +</TR> +<TR BGCOLOR="white" CLASS="TableRowColor"> +<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> +<CODE> int</CODE></FONT></TD> +<TD><CODE><B><A HREF="../../../org/slac/server/ChatLobby.html#maxUsers()">maxUsers</A></B>()</CODE> + +<BR> + </TD> +</TR> +<TR BGCOLOR="white" CLASS="TableRowColor"> +<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> +<CODE> int</CODE></FONT></TD> +<TD><CODE><B><A HREF="../../../org/slac/server/ChatLobby.html#numberUsers()">numberUsers</A></B>()</CODE> + +<BR> + </TD> +</TR> +<TR BGCOLOR="white" CLASS="TableRowColor"> +<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> +<CODE> void</CODE></FONT></TD> +<TD><CODE><B><A HREF="../../../org/slac/server/ChatLobby.html#run()">run</A></B>()</CODE> + +<BR> + </TD> +</TR> +<TR BGCOLOR="white" CLASS="TableRowColor"> +<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> +<CODE> void</CODE></FONT></TD> +<TD><CODE><B><A HREF="../../../org/slac/server/ChatLobby.html#sendChat(java.lang.String)">sendChat</A></B>(java.lang.String message)</CODE> + +<BR> + </TD> +</TR> +</TABLE> + <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A> +<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> +<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> +<TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH> +</TR> +<TR BGCOLOR="white" CLASS="TableRowColor"> +<TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD> +</TR> +</TABLE> + +<P> + +<!-- ========= CONSTRUCTOR DETAIL ======== --> + +<A NAME="constructor_detail"><!-- --></A> +<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> +<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> +<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> +<B>Constructor Detail</B></FONT></TH> +</TR> +</TABLE> + +<A NAME="ChatLobby(java.lang.String, org.slac.server.Server, int, boolean, java.lang.String)"><!-- --></A><H3> +ChatLobby</H3> +<PRE> +public <B>ChatLobby</B>(java.lang.String lobbyName, + <A HREF="../../../org/slac/server/Server.html" title="class in org.slac.server">Server</A> theServer, + int maxUsers, + boolean priv, + java.lang.String password)</PRE> +<DL> +<DL> +<DT><B>Parameters:</B><DD><CODE>lobbyName</CODE> - The name of this lobby<DD><CODE>theServer</CODE> - The server that created this lobby<DD><CODE>maxUsers</CODE> - The maxiumum number of users allowed, 0 for Integer.MAXNUMBER (more than 2bil)<DD><CODE>priv</CODE> - True if it is private<DD><CODE>password</CODE> - The password for the lobby</DL> +</DL> +<HR> + +<A NAME="ChatLobby(java.lang.String, org.slac.server.Server, int)"><!-- --></A><H3> +ChatLobby</H3> +<PRE> +public <B>ChatLobby</B>(java.lang.String lobbyName, + <A HREF="../../../org/slac/server/Server.html" title="class in org.slac.server">Server</A> theServer, + int maxUsers)</PRE> +<DL> +</DL> + +<!-- ============ METHOD DETAIL ========== --> + +<A NAME="method_detail"><!-- --></A> +<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> +<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> +<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> +<B>Method Detail</B></FONT></TH> +</TR> +</TABLE> + +<A NAME="addUser(org.slac.server.ClientThread, java.util.UUID, java.lang.String)"><!-- --></A><H3> +addUser</H3> +<PRE> +public void <B>addUser</B>(<A HREF="../../../org/slac/server/ClientThread.html" title="class in org.slac.server">ClientThread</A> client, + java.util.UUID uuid, + java.lang.String password)</PRE> +<DL> +<DD><DL> +<DT><B>Specified by:</B><DD><CODE><A HREF="../../../org/slac/server/Lobby.html#addUser(org.slac.server.ClientThread, java.util.UUID, java.lang.String)">addUser</A></CODE> in interface <CODE><A HREF="../../../org/slac/server/Lobby.html" title="interface in org.slac.server">Lobby</A></CODE></DL> +</DD> +<DD><DL> +<DT><B>Parameters:</B><DD><CODE>client</CODE> - The client thread<DD><CODE>uuid</CODE> - The user's unique user id<DD><CODE>password</CODE> - The password, null is there is none</DL> +</DD> +</DL> +<HR> + +<A NAME="getUsers()"><!-- --></A><H3> +getUsers</H3> +<PRE> +public java.util.TreeMap<java.util.UUID,<A HREF="../../../org/slac/server/ClientThread.html" title="class in org.slac.server">Cli... [truncated message content] |
From: <air...@us...> - 2007-02-22 23:09:54
|
Revision: 21 http://svn.sourceforge.net/slac/?rev=21&view=rev Author: airpizza Date: 2007-02-22 15:09:52 -0800 (Thu, 22 Feb 2007) Log Message: ----------- Added Paths: ----------- trunk/org/ trunk/org/slac/ trunk/org/slac/client/ trunk/org/slac/server/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <air...@us...> - 2006-08-08 21:39:49
|
Revision: 20 Author: airpizza Date: 2006-08-08 14:39:43 -0700 (Tue, 08 Aug 2006) ViewCVS: http://svn.sourceforge.net/slac/?rev=20&view=rev Log Message: ----------- Added Paths: ----------- branches/ trunk/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <air...@us...> - 2006-08-08 21:38:56
|
Revision: 19 Author: airpizza Date: 2006-08-08 14:38:52 -0700 (Tue, 08 Aug 2006) ViewCVS: http://svn.sourceforge.net/slac/?rev=19&view=rev Log Message: ----------- Removed Paths: ------------- branches/ trunk/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <air...@us...> - 2006-06-14 20:46:09
|
Revision: 18 Author: airpizza Date: 2006-06-14 13:45:48 -0700 (Wed, 14 Jun 2006) ViewCVS: http://svn.sourceforge.net/slac/?rev=18&view=rev Log Message: ----------- Modified Paths: -------------- trunk/slac/client/Desktop.java trunk/slac/client/Lobby.java trunk/slac/server/ClientConnectionThread.java trunk/slac/server/DefaultClient.java trunk/slac/server/MANIFEST.MF trunk/slac/server/Server.java trunk/slac/server/ServerLoader.java Added Paths: ----------- trunk/slac/server/HostPreload.java trunk/slac/server/Preload.java trunk/slac/server/ServerPreload.java Removed Paths: ------------- trunk/slac/client/Client.java Deleted: trunk/slac/client/Client.java =================================================================== --- trunk/slac/client/Client.java 2006-06-14 00:00:43 UTC (rev 17) +++ trunk/slac/client/Client.java 2006-06-14 20:45:48 UTC (rev 18) @@ -1,59 +0,0 @@ -import java.io.*; - -import java.net.*; - -public class Client { - public static void main(String[] args) throws IOException { - Socket mySocket = null; - PrintStream out = null; - BufferedReader in = null; - - try { - mySocket = new Socket(); - mySocket.connect(new InetSocketAddress("localhost", 4444)); - out = new PrintStream(mySocket.getOutputStream(), true); - in = - new BufferedReader(new InputStreamReader(mySocket.getInputStream())); - } catch (IOException e) { - System.err.println("Unable to connect to localhost on 4444"); - System.exit(-1); - } - BufferedReader keyboard = - new BufferedReader(new InputStreamReader(System.in)); - String fromSocket; - String fromKeyboard; - boolean running = true; - while (running) { - if (in.ready()) //From Server - { - fromSocket = in.readLine(); - System.out.println("Recieved: " + fromSocket); - if (fromSocket.equalsIgnoreCase("Close") || - fromSocket.equalsIgnoreCase("\0")) { - running = false; - System.out.println("Exiting"); - } - } - if (keyboard.ready()) //To Server - { - fromKeyboard = keyboard.readLine(); - System.out.println("You Typed: " + fromKeyboard); - if (fromKeyboard.equals("connect")) { - System.out.print("Hostname? "); - mySocket.close(); - mySocket = new Socket(); - mySocket.connect(new InetSocketAddress("localhost", 4444)); - out = new PrintStream(mySocket.getOutputStream(), true); - in = - new BufferedReader(new InputStreamReader(mySocket.getInputStream())); - } else { - out.println(fromKeyboard); - } - try { - Thread.currentThread().wait(100); - } catch (InterruptedException e) { - } - } - } - } -} Modified: trunk/slac/client/Desktop.java =================================================================== --- trunk/slac/client/Desktop.java 2006-06-14 00:00:43 UTC (rev 17) +++ trunk/slac/client/Desktop.java 2006-06-14 20:45:48 UTC (rev 18) @@ -124,6 +124,8 @@ in = new BufferedReader(new InputStreamReader(socket.getInputStream())); out = new PrintStream(socket.getOutputStream(), true); done = true; + System.err.println("Keep alive on socket ="+socket.getKeepAlive()); + System.err.println("Keep alive on infoSocket = "+infoSocket.getKeepAlive()); } catch (IOException e) { Modified: trunk/slac/client/Lobby.java =================================================================== --- trunk/slac/client/Lobby.java 2006-06-14 00:00:43 UTC (rev 17) +++ trunk/slac/client/Lobby.java 2006-06-14 20:45:48 UTC (rev 18) @@ -29,11 +29,12 @@ private Vector<String> userNames; private Connection connection; private Thread connectionThread; + private DefaultListModel usersModel; public static final String USERS = "Request: userlist"; + public static final String GAMES = "Request: gamelist"; - public Lobby(Socket mySocket,Socket myInfoSocket, String userName) { infoSocket= myInfoSocket; @@ -99,10 +100,14 @@ playerList.setBorder(LineBorder.createGrayLineBorder()); playerList.setMinimumSize(playerDim); playerList.setMaximumSize(playerDim); + //Change this if we want pm's among multiple ppl alowed. + playerList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); + usersModel = new DefaultListModel(); requestInfo(USERS); preloadList = new JList(); preloadList.setMinimumSize(gameDim); preloadList.setMaximumSize(gameDim); + menubar = new JMenuBar(); menu = new JMenu("Test"); item = new JMenuItem("Test1"); @@ -170,27 +175,33 @@ userNames = new Vector<String>(); System.out.println("Temp.getClass() "+temp.getClass()); System.out.println("userNames.getClass() "+userNames.getClass()); - try + try//Why is this in a try? { if (temp.getClass().equals(userNames.getClass())) { System.out.println(temp); userNames = (Vector<String>) temp; System.out.println(userNames); - playerList.setListData(userNames); + for (int i =0;i<userNames.size();i++) + { + usersModel.addElement(userNames.get(i)); + } + playerList.setModel(usersModel); } } catch(Exception e) { e.printStackTrace(); } +// else if(temp.getClass().equals( } protected void addUser(String obj) { if(!userNames.contains(obj)) { userNames.add(obj); - playerList.setListData(userNames); + usersModel.addElement(obj); + // playerList.setListData(userNames); } else return; } @@ -211,7 +222,7 @@ System.err.println("Connection setup"); } } - + // This class handles the connection between the server and the Client class Connection implements Runnable { //Possibly change this to just find out what class the incomming thing is @@ -221,6 +232,7 @@ public static final String ADD = "Add"; public static final String REMOVE = "Remove"; public static final String REQUEST_USERS = "Request: userlist"; + public static final String CLOSE = "Close"; private Socket messageSocket; private Socket infoSocket; @@ -314,6 +326,11 @@ e.printStackTrace(); } } + else if(message.equalsIgnoreCase(CLOSE)) + { + //Replace this with a clean exit later + System.exit(0); + } } private void updateChat() throws Exception { @@ -321,7 +338,7 @@ Object temp = objIn.readObject(); if(temp.getClass().equals(new String().getClass())) { - reference.updateChat((String)temp); +// reference.updateChat((String)temp); } } private void updateGames() throws Exception Modified: trunk/slac/server/ClientConnectionThread.java =================================================================== --- trunk/slac/server/ClientConnectionThread.java 2006-06-14 00:00:43 UTC (rev 17) +++ trunk/slac/server/ClientConnectionThread.java 2006-06-14 20:45:48 UTC (rev 18) @@ -70,8 +70,9 @@ e.printStackTrace(); } } - - public void examineMessage(String message) { //Has to be a better way to do this?? + //Any other way to do this? + private void examineMessage(String message) + { try { if (message.equalsIgnoreCase("Request: userlist")) { @@ -81,6 +82,8 @@ outObj.writeObject(reference.getUsers()); outObj.flush(); System.err.println("Userlist sent"); + //Once the client has the userlist,everyone + // can see the client reference.notifyClients(client,reference.ADD); } catch (IOException e) @@ -93,7 +96,7 @@ } } - public void close() { + protected void close() { try { running = false; out.println("Close"); Modified: trunk/slac/server/DefaultClient.java =================================================================== --- trunk/slac/server/DefaultClient.java 2006-06-14 00:00:43 UTC (rev 17) +++ trunk/slac/server/DefaultClient.java 2006-06-14 20:45:48 UTC (rev 18) @@ -19,14 +19,17 @@ return ip; } - public int compareTo(Client o) { - DefaultClient compare = (DefaultClient)o; - if (compare.getUsername().equals(this.getUsername())) { - System.out.println("Same Client"); - return 0; - } else { - System.out.println("Different Client"); - return 1; - } + public int compareTo(Client compare) + { + // if (compare.getUsername().equals(this.getUsername())) + // { + // System.out.println("Same Client"); + // return 0; + // } + // else + // { + return compare.getUsername().compareToIgnoreCase(this.getUsername()); + //} + } } Added: trunk/slac/server/HostPreload.java =================================================================== --- trunk/slac/server/HostPreload.java (rev 0) +++ trunk/slac/server/HostPreload.java 2006-06-14 20:45:48 UTC (rev 18) @@ -0,0 +1,6 @@ +package slac.server; + +public interface HostPreload extends Preload +{ + public Client getHost(); +} Modified: trunk/slac/server/MANIFEST.MF =================================================================== --- trunk/slac/server/MANIFEST.MF 2006-06-14 00:00:43 UTC (rev 17) +++ trunk/slac/server/MANIFEST.MF 2006-06-14 20:45:48 UTC (rev 18) @@ -1,3 +1,3 @@ Manifest-Version: 1.0 Created-By: Airpizza (air...@sf...) -Main-Class: slac.server.Connect +Main-Class: slac.server.ServerLoader Added: trunk/slac/server/Preload.java =================================================================== --- trunk/slac/server/Preload.java (rev 0) +++ trunk/slac/server/Preload.java 2006-06-14 20:45:48 UTC (rev 18) @@ -0,0 +1,17 @@ +package slac.server; + +import java.net.InetSocketAddress; +import java.util.Vector; + +public interface Preload +{ + public String getProgramName(); + //This needed? + public String getLaunchCommand(); + public String getPreloadName(); + public Vector<String> getUserList(); + //This can be either the host's address, or the server address + public InetSocketAddress getAddress(); + public String getGameType(); + public String getMapName(); +} Modified: trunk/slac/server/Server.java =================================================================== --- trunk/slac/server/Server.java 2006-06-14 00:00:43 UTC (rev 17) +++ trunk/slac/server/Server.java 2006-06-14 20:45:48 UTC (rev 18) @@ -148,20 +148,30 @@ public synchronized boolean addUser(Client user) { - return userList.add(user); + synchronized(userList) + { + return userList.add(user); + } } public synchronized void removeUser(Client user) { // Want to make sure that they are getting good info - if(userList.remove(user)== true) + synchronized(userList) { - notifyClients(user,REMOVE); + if(userList.remove(user)== true) + { + notifyClients(user,REMOVE); + } + else return; } - else return; } public synchronized Vector getUsers() { - Vector<Client> listVector = new Vector<Client>(userList); + Vector<Client> listVector; + synchronized (userList) + { + listVector = new Vector<Client>(userList); + } Vector<String> names = new Vector<String>(); for(int i = 0;i<listVector.size();i++) { Modified: trunk/slac/server/ServerLoader.java =================================================================== --- trunk/slac/server/ServerLoader.java 2006-06-14 00:00:43 UTC (rev 17) +++ trunk/slac/server/ServerLoader.java 2006-06-14 20:45:48 UTC (rev 18) @@ -21,7 +21,7 @@ String input = keyboard.readLine(); if (input.trim().equalsIgnoreCase("start")) { Server temp = new Server(port); - port++; + port+=2; serverList.add(temp); new Thread(serverThreads, temp).start(); temp.addReference(temp); Added: trunk/slac/server/ServerPreload.java =================================================================== --- trunk/slac/server/ServerPreload.java (rev 0) +++ trunk/slac/server/ServerPreload.java 2006-06-14 20:45:48 UTC (rev 18) @@ -0,0 +1,6 @@ +package slac.server; + +public interface ServerPreload extends Preload +{ + +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <air...@us...> - 2006-06-14 00:00:52
|
Revision: 17 Author: airpizza Date: 2006-06-13 17:00:43 -0700 (Tue, 13 Jun 2006) ViewCVS: http://svn.sourceforge.net/slac/?rev=17&view=rev Log Message: ----------- Modified Paths: -------------- trunk/slac/client/Base.java trunk/slac/client/Desktop.java trunk/slac/client/Lobby.java trunk/slac/client/MainClient.java trunk/slac/server/Client.java trunk/slac/server/ClientConnectionThread.java trunk/slac/server/Connect.java trunk/slac/server/Server.java Removed Paths: ------------- trunk/slac/client/Connection.java Modified: trunk/slac/client/Base.java =================================================================== --- trunk/slac/client/Base.java 2006-06-12 02:48:57 UTC (rev 16) +++ trunk/slac/client/Base.java 2006-06-14 00:00:43 UTC (rev 17) @@ -12,7 +12,7 @@ private Desktop basePane; private JInternalFrame lobby; private Base reference; - public static final String VERSION = "Slac pre-alpha 2"; + public static final String VERSION = "Slac pre-alpha 3"; public Base() { super (VERSION); System.out.println("Creating Base"); @@ -28,11 +28,11 @@ * @param args */ public static void main(String[] args) { - try - { - UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName()); +/* try + { + UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); } - catch (Exception e) { } + catch (Exception e) { }*/ javax.swing.SwingUtilities.invokeLater(new Runnable() { public void run() { Deleted: trunk/slac/client/Connection.java =================================================================== --- trunk/slac/client/Connection.java 2006-06-12 02:48:57 UTC (rev 16) +++ trunk/slac/client/Connection.java 2006-06-14 00:00:43 UTC (rev 17) @@ -1,11 +0,0 @@ -package slac.client; - -import java.net.*; - -public class Connection implements Runnable -{ - public void run() - { - - } -} Modified: trunk/slac/client/Desktop.java =================================================================== --- trunk/slac/client/Desktop.java 2006-06-12 02:48:57 UTC (rev 16) +++ trunk/slac/client/Desktop.java 2006-06-14 00:00:43 UTC (rev 17) @@ -10,13 +10,14 @@ public class Desktop extends JDesktopPane { Socket socket; + Socket infoSocket; InetAddress ip; BufferedReader in; PrintStream out; String auth; Lobby lobby; String username; - String password;//Crypt needed + String password;//Crypt needed, string not best? public Desktop(){} public void setUpDesktop() @@ -24,11 +25,14 @@ String authType=null; getAddress(); setUpConnection(); + System.err.println("Connection Setup"); while (authType==null) { try { + System.err.println("Getting auth type"); authType = in.readLine(); + System.err.println("Auth type is: "+ authType); } catch (IOException e) {} @@ -40,17 +44,18 @@ { if(auth.equals("None")) { - lobby = new Lobby(socket,username); + lobby = new Lobby(socket,infoSocket,username); add(lobby); lobby.createGUI(); + lobby.startConnection(); } else if (auth.equals("Password")) { - //lobby = new Lobby(socket,username,password); + //lobby = new Lobby(socket,infoSocket,username,password); } else if (auth.equals("Username")) { - //lobby = new Lobby(socket,username);//Extra param?? + //lobby = new Lobby(socket,infoSocket,username);//Extra param?? } } private void authenticate(String authType) @@ -75,6 +80,7 @@ System.err.println("Unknown Authentication Type"); } } + //Performs no authentication private void noAuth() { username=null; @@ -103,6 +109,7 @@ } } } + // Connects to the server private void setUpConnection() { boolean done = false; @@ -111,6 +118,9 @@ try { socket = new Socket(ip,4444); + System.err.println("Setting up infoSocket"); + infoSocket = new Socket(ip,4445); + System.err.println("Infosocket setup"); in = new BufferedReader(new InputStreamReader(socket.getInputStream())); out = new PrintStream(socket.getOutputStream(), true); done = true; @@ -118,11 +128,12 @@ catch (IOException e) { System.err.println("Error Connecting"); - JOptionPane.showInternalMessageDialog(this,"Error Connecting"); + JOptionPane.showInternalMessageDialog(this,"Error Connecting","ERROR",JOptionPane.ERROR_MESSAGE); getAddress(); } } } + // Gets the ip of the server from the user private void getAddress() { String input = null; Modified: trunk/slac/client/Lobby.java =================================================================== --- trunk/slac/client/Lobby.java 2006-06-12 02:48:57 UTC (rev 16) +++ trunk/slac/client/Lobby.java 2006-06-14 00:00:43 UTC (rev 17) @@ -4,16 +4,17 @@ import java.util.*; import java.io.*; import javax.swing.*; +import javax.swing.border.LineBorder; import java.awt.event.*; import java.awt.*; public class Lobby extends JInternalFrame implements ActionListener, - KeyListener { + KeyListener { private Socket socket; + private Socket infoSocket; private JTextArea chatArea; private JTextField chatInput; private JTable preGameList; - private JList userList; private String username; private JButton doStuff; private JList preloadList; @@ -21,15 +22,41 @@ private JMenuBar menubar; private JMenu menu; private JMenuItem item; + private ObjectInputStream inObj; + private ObjectOutputStream outObj; + private PrintWriter out; + private BufferedReader in; + private Vector<String> userNames; + private Connection connection; + private Thread connectionThread; - public Lobby(Socket mySocket, String userName) { + public static final String USERS = "Request: userlist"; + + + + public Lobby(Socket mySocket,Socket myInfoSocket, String userName) + { + infoSocket= myInfoSocket; socket = mySocket; username = userName; - //createGUI(); + try + { + inObj = new ObjectInputStream(infoSocket.getInputStream()); + outObj = new ObjectOutputStream(infoSocket.getOutputStream()); + out = new PrintWriter(socket.getOutputStream(),true); + in = new BufferedReader(new InputStreamReader(socket.getInputStream())); + } + catch(IOException e) + { + e.printStackTrace(); + } + connection = new Connection(socket,infoSocket,inObj,outObj,out,in,this); + System.err.println("Finished setting constructing lobby"); } //Sets up the GUI and makes it visible protected void createGUI() { + System.err.println("Creating GUI"); // Dimension realScreenSize = Toolkit.getDefaultToolkit().getScreenSize(); Dimension screenSize = getDesktopPane().getSize(); Dimension playerDim; @@ -66,10 +93,14 @@ // I need another server // the Chat needs to get its information from the chatserver // Going to need another thread to deal with server messages - playerList = new JList(new String[] { "Test", "Test2" }); + playerList = new JList(); + playerList.setForeground(Color.white); + playerList.setBackground(Color.black); + playerList.setBorder(LineBorder.createGrayLineBorder()); playerList.setMinimumSize(playerDim); playerList.setMaximumSize(playerDim); - preloadList = new JList(new String[] { "preload", "preload2" }); + requestInfo(USERS); + preloadList = new JList(); preloadList.setMinimumSize(gameDim); preloadList.setMaximumSize(gameDim); menubar = new JMenuBar(); @@ -94,6 +125,7 @@ add(rootPane); setSize(screenSize); show(); + System.err.println("GUI Created"); } public void keyPressed(KeyEvent e) { @@ -115,4 +147,250 @@ Object source = e.getSource(); // if( } + // Should use the thread eventually + private void requestInfo(String info) + { + out.println(info); + Object temp; + try + { + temp = inObj.readObject(); + //while (inObj.available()>0) + //{ + //temp = inObj.readObject(); + //temp2.add(inObj.readObject()); + // System.out.println("Adding object"); + // } + } + catch (Exception e) + { + System.out.println(e.getMessage()); + return; + } + userNames = new Vector<String>(); + System.out.println("Temp.getClass() "+temp.getClass()); + System.out.println("userNames.getClass() "+userNames.getClass()); + try + { + if (temp.getClass().equals(userNames.getClass())) + { + System.out.println(temp); + userNames = (Vector<String>) temp; + System.out.println(userNames); + playerList.setListData(userNames); + } + } + catch(Exception e) + { + e.printStackTrace(); + } + } + protected void addUser(String obj) + { + if(!userNames.contains(obj)) + { + userNames.add(obj); + playerList.setListData(userNames); + } + else return; + } + protected void removeUser(String obj) + { + userNames.remove(obj); + playerList.setListData(userNames); + } + protected void addGame(Object obj) + {} + protected void removeGame(Object obj) + {} + protected void startConnection() + { + System.err.println("Setting up connection"); + connectionThread = new Thread(connection); + connectionThread.start(); + System.err.println("Connection setup"); + } } + + class Connection implements Runnable + { + //Possibly change this to just find out what class the incomming thing is + public static final String USER_UPDATE = "User update comming"; + public static final String GAME_UPDATE = "Game update comming"; + public static final String CHAT_UPDATE = "Chat update comming"; + public static final String ADD = "Add"; + public static final String REMOVE = "Remove"; + public static final String REQUEST_USERS = "Request: userlist"; + + private Socket messageSocket; + private Socket infoSocket; + private ObjectInputStream objIn; + private ObjectOutputStream objOut; + private PrintWriter out; + private BufferedReader in; + private Lobby reference; + private volatile boolean running; + public Connection(Socket message,Socket info,ObjectInputStream objIn, + ObjectOutputStream objOut,PrintWriter out,BufferedReader in,Lobby ref) + { + messageSocket = message; + infoSocket = info; + this.objIn = objIn; + this.objOut= objOut; + this.out=out; + this.in=in; + reference = ref; + } + // Needs to setup the reads and writes + public Connection(Socket message,Socket info, Lobby ref) + { + messageSocket = message; + infoSocket = info; + reference = ref; + } + public void run() + { + running = true; + while(running) + { + try + { + examineMessage(in.readLine()); + } + catch (IOException e) + { + System.err.println("Error recieving message for examination"); + } + } + try + { + objIn.close(); + in.close(); + objOut.close(); + out.close(); + messageSocket.close(); + infoSocket.close(); + } + catch (IOException e) + { + System.out.println(e.getMessage()); + } + } + private void examineMessage(String message) + { + if(message.equalsIgnoreCase(USER_UPDATE)) + { + try + { + updateUsers(); + } + catch (Exception e) + { + System.err.println("Error updating users"); + e.printStackTrace(); + } + } + else if(message.equalsIgnoreCase(GAME_UPDATE)) + { + try + { + updateGames(); + } + catch (Exception e) + { + System.err.println("Error updating games"); + e.printStackTrace(); + } + } + else if(message.equalsIgnoreCase(CHAT_UPDATE)) + { + try + { + updateChat(); + } + catch (Exception e) + { + System.err.println("Error updating chat"); + e.printStackTrace(); + } + } + } + private void updateChat() throws Exception + { + System.err.println("Updating the chat"); + Object temp = objIn.readObject(); + if(temp.getClass().equals(new String().getClass())) + { + reference.updateChat((String)temp); + } + } + private void updateGames() throws Exception + { + System.err.println("Updating game list"); + Object temp = objIn.readObject(); + String todo; + if(temp.getClass().equals(new String().getClass())) + { + todo = (String) temp; + System.err.println(todo+" a game"); + if (todo.equalsIgnoreCase(ADD)) + { + temp = objIn.readObject(); + reference.addGame(temp); + } + else if (todo.equalsIgnoreCase(REMOVE)) + { + temp = objIn.readObject(); + reference.removeGame(temp); + } + else + { + System.err.println("Unknown action"); + } + } + else {System.out.println(temp.getClass()+" Is not supported yet");} + } + private void updateUsers() throws Exception + { + System.err.println("Updating userlist"); + Object temp= objIn.readObject(); + String todo; + if(temp.getClass().equals(new String().getClass())) + { + todo = (String) temp; + if(todo.equalsIgnoreCase(ADD)) + { + temp = objIn.readObject(); + reference.addUser((String)temp); + } + else if(todo.equalsIgnoreCase(REMOVE)) + { + temp = objIn.readObject(); + reference.removeUser((String)temp); + } + else + { + System.err.println("Unsupported type"+ todo); + } + } + else System.err.println("Unknown server message" + temp); + } + protected void close() + { + System.err.println("Closing connection thread"); + running = false; + try + { + objIn.close(); + in.close(); + out.close(); + objOut.close(); + messageSocket.close(); + infoSocket.close(); + } + catch(IOException e) + { + e.printStackTrace(); + } + } +} Modified: trunk/slac/client/MainClient.java =================================================================== --- trunk/slac/client/MainClient.java 2006-06-12 02:48:57 UTC (rev 16) +++ trunk/slac/client/MainClient.java 2006-06-14 00:00:43 UTC (rev 17) @@ -58,7 +58,7 @@ username = name; System.err.println(username); root.setVisible(false); - Lobby lobby = new Lobby(socket, this, username); - root = lobby.getFrame(); +// Lobby lobby = new Lobby(socket, this, username); + // root = lobby.getFrame(); } } Modified: trunk/slac/server/Client.java =================================================================== --- trunk/slac/server/Client.java 2006-06-12 02:48:57 UTC (rev 16) +++ trunk/slac/server/Client.java 2006-06-14 00:00:43 UTC (rev 17) @@ -1,5 +1,8 @@ package slac.server; -public interface Client extends Comparable<Client> { - +import java.net.InetSocketAddress; +public interface Client extends Comparable<Client> +{ + public String getUsername(); + public InetSocketAddress getAddress(); } Modified: trunk/slac/server/ClientConnectionThread.java =================================================================== --- trunk/slac/server/ClientConnectionThread.java 2006-06-12 02:48:57 UTC (rev 16) +++ trunk/slac/server/ClientConnectionThread.java 2006-06-14 00:00:43 UTC (rev 17) @@ -6,6 +6,7 @@ public class ClientConnectionThread implements Serializable, Runnable { private Socket socket = null; + private Socket infoSocket; private Server reference; private BufferedReader in; private PrintStream out; @@ -13,18 +14,26 @@ public final String authType; private String username; private DefaultClient client; + private ObjectOutputStream outObj; + private ObjectInputStream inObj; - public ClientConnectionThread(Socket socket, Server ref, String auth) { + public ClientConnectionThread(Socket socket,Socket infoSocket, Server ref, String auth) { this.socket = socket; + this.infoSocket = infoSocket; reference = ref; running = true; authType = auth; try { out = new PrintStream(socket.getOutputStream(), true); - in = - new BufferedReader(new InputStreamReader(socket.getInputStream())); + System.err.println("Out setup[CCT]"); + in = new BufferedReader(new InputStreamReader(socket.getInputStream())); + System.err.println("In setup[CCT]"); + outObj = new ObjectOutputStream(infoSocket.getOutputStream()); + System.err.println("outObj setup[CCT]"); + //inObj = new ObjectInputStream(infoSocket.getInputStream()); + //System.err.println("inObj setup[CCT]"); } catch (IOException e) { - System.out.println("Error setting up the streams"); + System.out.println("Error setting up the streams[CCT.java]"); } } @@ -37,9 +46,14 @@ while (added == false) { username = in.readLine(); - client = new DefaultClient(username, socket.getRemoteSocketAddress()); - added = reference.addUser(client); - out.println(added); //Boolean + username = username.trim(); + if(username.length()>2 && username.length()<20) + { + client = new DefaultClient(username, socket.getRemoteSocketAddress()); + added = reference.addUser(client); + out.println(added); //Boolean + } + else out.println(false); // TODO: Make sure the client has the same username // TODO: Add other auth types to the thread } @@ -49,6 +63,9 @@ } in.close(); socket.close(); + infoSocket.close(); + out.close(); + outObj.close(); } catch (IOException e) { e.printStackTrace(); } @@ -56,8 +73,20 @@ public void examineMessage(String message) { //Has to be a better way to do this?? try { - if (message.equalsIgnoreCase("Lobby List")) { - + if (message.equalsIgnoreCase("Request: userlist")) + { + System.err.println("Userlist requested"); + try + { + outObj.writeObject(reference.getUsers()); + outObj.flush(); + System.err.println("Userlist sent"); + reference.notifyClients(client,reference.ADD); + } + catch (IOException e) + { + System.err.println("Error sending userlist"); + } } } catch (NullPointerException e) { close(); @@ -69,16 +98,35 @@ running = false; out.println("Close"); out.close(); + outObj.close(); System.out.println("Closing in" + this); in.close(); System.out.println("Closing the socket" + this); socket.close(); + infoSocket.close(); System.out.println("Sockets Closed" + this); - reference.removeClient(this); - reference.removeUser(client); } catch (Exception e) { System.err.println("Error Closing the thread[CCT.java]"); e.printStackTrace(); } + reference.removeClient(this); + reference.removeUser(client); } + // Synchronized because the server could call this method before it is done sending the first time + protected synchronized void notifyClient(String message,String change,Object info) + { + System.err.println("Notifying Client of "+message+" regarding a "+change); + try + { + out.println(message); + outObj.writeObject(change); + outObj.writeObject(info); + outObj.flush(); + } + catch(IOException e) + { + System.err.println("Error notifying clients of change[CCT.java]"); + System.err.println(e.getMessage()); + } + } } Modified: trunk/slac/server/Connect.java =================================================================== --- trunk/slac/server/Connect.java 2006-06-12 02:48:57 UTC (rev 16) +++ trunk/slac/server/Connect.java 2006-06-14 00:00:43 UTC (rev 17) @@ -10,6 +10,8 @@ private int number; private boolean listening; private ServerSocket serverSocket; + private ServerSocket infoSocket; + private Server reference; private ThreadGroup clientThreads; public final String authType; @@ -32,6 +34,7 @@ try { serverSocket = new ServerSocket(port); // 50 max queue'd connections + infoSocket = new ServerSocket(port+1); } catch (IOException e) { System.err.println("[Connect.java]Error creating socket on port" + port); @@ -61,7 +64,7 @@ Thread tempThread = null; try { temp = -new ClientConnectionThread(serverSocket.accept(), reference, authType); +new ClientConnectionThread(serverSocket.accept(),infoSocket.accept(), reference, authType); tempThread = new Thread(clientThreads, temp, "ClientConnectionThread"); tempThread.start(); Modified: trunk/slac/server/Server.java =================================================================== --- trunk/slac/server/Server.java 2006-06-12 02:48:57 UTC (rev 16) +++ trunk/slac/server/Server.java 2006-06-14 00:00:43 UTC (rev 17) @@ -20,7 +20,12 @@ private Thread connectThread; private final String authType; private TreeSet<Client> userList = new TreeSet<Client>(); - + public static final String ADD = "Add"; + public static final String REMOVE = "Remove"; + public static final String USER_UPDATE = "User update comming"; + public static final String GAME_UPDATE = "Game update comming"; + public static final String CHAT_UPDATE = "Chat update comming"; + private Class Client = null; public Server(int Port) { this(Port, null); } @@ -57,6 +62,15 @@ connectThread = new Thread(connectThreads, connect, "Server Connection Thread"); connectThread.start(); + try + { + Client = Class.forName("slac.server.Client"); + } + catch (ClassNotFoundException e) + { + e.printStackTrace(); + System.err.println("Client class not found"); + } //dealWithPipe(); // Not needed?? } @@ -103,8 +117,7 @@ } public void waitForReference() { - while (reference == null) - ; + while (reference == null); } public void addReference(Server server) { @@ -133,11 +146,44 @@ clients.remove(obj); } - public synchronized boolean addUser(Client user) { + public synchronized boolean addUser(Client user) + { return userList.add(user); } - - public synchronized void removeUser(Client user) { - userList.remove(user); + public synchronized void removeUser(Client user) + { + // Want to make sure that they are getting good info + if(userList.remove(user)== true) + { + notifyClients(user,REMOVE); + } + else return; } + public synchronized Vector getUsers() + { + Vector<Client> listVector = new Vector<Client>(userList); + Vector<String> names = new Vector<String>(); + for(int i = 0;i<listVector.size();i++) + { + System.out.println(listVector.get(i).getUsername()); + names.add(listVector.get(i).getUsername()); + } + return names; + } + protected void notifyClients(Object info,String action) + { + // If we are updating the client list + Class temp = info.getClass(); + Class[] interfaces = temp.getInterfaces(); + if(interfaces.length>0 && interfaces[0].equals(Client)) + { + for(int i = 0;i<clients.size();i++) + { + System.err.println("Notifying client:"+ clients.get(i)); + clients.get(i).notifyClient(USER_UPDATE,action,((Client)info).getUsername()); + } + } + //If we are updating the game list + //else if(info.getClass().equals(new + } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <air...@us...> - 2006-06-12 02:49:09
|
Revision: 16 Author: airpizza Date: 2006-06-11 19:48:57 -0700 (Sun, 11 Jun 2006) ViewCVS: http://svn.sourceforge.net/slac/?rev=16&view=rev Log Message: ----------- Modified Paths: -------------- trunk/slac/client/Client.java trunk/slac/client/ConnectTo.java trunk/slac/client/Lobby.java trunk/slac/client/MainClient.java trunk/slac/client/NoAccount.java trunk/slac/server/Client.java trunk/slac/server/ClientConnectionThread.java trunk/slac/server/Connect.java trunk/slac/server/DefaultClient.java trunk/slac/server/Server.java trunk/slac/server/ServerLoader.java Added Paths: ----------- trunk/slac/client/Base.java trunk/slac/client/Connection.java trunk/slac/client/Desktop.java trunk/slac/server/ChatClientConnection.java trunk/slac/server/ChatConnect.java trunk/slac/server/ChatServer.java Removed Paths: ------------- trunk/slac/client/StressTest.java trunk/slac/server/ClientInterface.java Added: trunk/slac/client/Base.java =================================================================== --- trunk/slac/client/Base.java (rev 0) +++ trunk/slac/client/Base.java 2006-06-12 02:48:57 UTC (rev 16) @@ -0,0 +1,68 @@ +package slac.client; + +import java.awt.event.*; +import java.awt.*; +import javax.swing.*; + +// This the base class that you call to start the gui. + +public class Base extends JFrame +{ + Connection next; + private Desktop basePane; + private JInternalFrame lobby; + private Base reference; + public static final String VERSION = "Slac pre-alpha 2"; + public Base() { + super (VERSION); + System.out.println("Creating Base"); + reference = this; + initGui(); + } + private static void createAndShowGUI() + { + new Base(); + } + + /** + * @param args + */ + public static void main(String[] args) { + try + { + UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName()); + } + catch (Exception e) { } + javax.swing.SwingUtilities.invokeLater(new Runnable() { + public void run() + { + createAndShowGUI(); + } + }); + + } + + private void initGui() + { + basePane = new Desktop(); + setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + setSize(Toolkit.getDefaultToolkit().getScreenSize()); + setVisible(true); + System.err.println("GUI VISIBLE"); + setContentPane(basePane); + setJMenuBar(setUpMenu()); + basePane.setUpDesktop(); + } + private JMenuBar setUpMenu() + { + JMenuBar temp = new JMenuBar(); + JMenu tempMenu = new JMenu("File"); + tempMenu.setMnemonic(KeyEvent.VK_F); + temp.add(tempMenu); + JMenuItem tempItem = new JMenuItem("Quit"); + tempItem.setMnemonic(KeyEvent.VK_Q); + tempItem.setActionCommand("quit"); + tempMenu.add(tempItem); + return temp; + } +} Modified: trunk/slac/client/Client.java =================================================================== --- trunk/slac/client/Client.java 2006-05-26 02:46:16 UTC (rev 15) +++ trunk/slac/client/Client.java 2006-06-12 02:48:57 UTC (rev 16) @@ -1,63 +1,59 @@ import java.io.*; + import java.net.*; -public class Client -{ - public static void main (String [] args) throws IOException - { - Socket mySocket = null; - PrintStream out = null; - BufferedReader in = null; +public class Client { + public static void main(String[] args) throws IOException { + Socket mySocket = null; + PrintStream out = null; + BufferedReader in = null; - try - { - mySocket = new Socket(); - mySocket.connect(new InetSocketAddress("localhost",4444)); - out = new PrintStream(mySocket.getOutputStream(), true); - in = new BufferedReader(new InputStreamReader(mySocket.getInputStream())); - } - catch (IOException e) - { - System.err.println("Unable to connect to localhost on 4444"); - System.exit(-1); - } - BufferedReader keyboard = new BufferedReader(new InputStreamReader(System.in)); - String fromSocket; - String fromKeyboard; - boolean running = true; - while (running) - { - if (in.ready())//From Server - { - fromSocket = in.readLine(); - System.out.println("Recieved: "+fromSocket); - if (fromSocket.equalsIgnoreCase("Close")||fromSocket.equalsIgnoreCase("\0")) - { - running = false; - System.out.println("Exiting"); + try { + mySocket = new Socket(); + mySocket.connect(new InetSocketAddress("localhost", 4444)); + out = new PrintStream(mySocket.getOutputStream(), true); + in = + new BufferedReader(new InputStreamReader(mySocket.getInputStream())); + } catch (IOException e) { + System.err.println("Unable to connect to localhost on 4444"); + System.exit(-1); + } + BufferedReader keyboard = + new BufferedReader(new InputStreamReader(System.in)); + String fromSocket; + String fromKeyboard; + boolean running = true; + while (running) { + if (in.ready()) //From Server + { + fromSocket = in.readLine(); + System.out.println("Recieved: " + fromSocket); + if (fromSocket.equalsIgnoreCase("Close") || + fromSocket.equalsIgnoreCase("\0")) { + running = false; + System.out.println("Exiting"); + } + } + if (keyboard.ready()) //To Server + { + fromKeyboard = keyboard.readLine(); + System.out.println("You Typed: " + fromKeyboard); + if (fromKeyboard.equals("connect")) { + System.out.print("Hostname? "); + mySocket.close(); + mySocket = new Socket(); + mySocket.connect(new InetSocketAddress("localhost", 4444)); + out = new PrintStream(mySocket.getOutputStream(), true); + in = + new BufferedReader(new InputStreamReader(mySocket.getInputStream())); + } else { + out.println(fromKeyboard); + } + try { + Thread.currentThread().wait(100); + } catch (InterruptedException e) { + } + } + } } - } - if (keyboard.ready())//To Server - { - fromKeyboard = keyboard.readLine(); - System.out.println("You Typed: "+fromKeyboard); - if(fromKeyboard.equals("connect")) - { - System.out.print("Hostname? "); - mySocket.close(); - mySocket = new Socket(); - mySocket.connect(new InetSocketAddress("localhost",4444)); - out = new PrintStream(mySocket.getOutputStream(), true); - in = new BufferedReader(new InputStreamReader(mySocket.getInputStream())); - } - else{out.println(fromKeyboard);} - try - { - Thread.currentThread().wait(100); - } - catch (InterruptedException e) - {} - } - } - } } Modified: trunk/slac/client/ConnectTo.java =================================================================== --- trunk/slac/client/ConnectTo.java 2006-05-26 02:46:16 UTC (rev 15) +++ trunk/slac/client/ConnectTo.java 2006-06-12 02:48:57 UTC (rev 16) @@ -1,9 +1,12 @@ package slac.client; import javax.swing.*; + import java.awt.*; import java.awt.event.*; + import java.net.*; + import java.io.*; /* This class is the class that starts the GUI client (separated) @@ -12,65 +15,62 @@ */ -public class ConnectTo implements ActionListener -{ - private JTextField ipInput; - private JButton connectTo; - private JFrame theRoot; - Socket mySocket; - private MainClient reference; - public ConnectTo(MainClient ref) - { - reference = ref; - createGUI(); - } - private void createGUI() - { - theRoot = new JFrame(reference.VERSION); - theRoot.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); - theRoot.setResizable(false); - theRoot.setLocationRelativeTo(ipInput);//Center - ipInput = new JTextField("Enter the ip or hostname of the server"); +public class ConnectTo implements ActionListener { + private JTextField ipInput; + private JButton connectTo; + private JFrame theRoot; + Socket mySocket; + private MainClient reference; - connectTo = new JButton("Connect"); - connectTo.addActionListener(this); + public ConnectTo(MainClient ref) { + reference = ref; + createGUI(); + } - JPanel rootPane = new JPanel(new BorderLayout()); - rootPane.add(ipInput,BorderLayout.WEST); - rootPane.add(connectTo,BorderLayout.EAST); + private void createGUI() { + theRoot = new JFrame(reference.VERSION); + theRoot.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + theRoot.setResizable(false); + theRoot.setLocationRelativeTo(ipInput); //Center + ipInput = new JTextField("Enter the ip or hostname of the server"); - theRoot.getContentPane().add(rootPane); - theRoot.pack(); - theRoot.setVisible(true); - } - public JFrame getFrame() - {return theRoot;} - public void actionPerformed(ActionEvent e) - { - if(e.getSource() == connectTo) - { - InetAddress addr; - BufferedReader in; - try - { - System.err.println(ipInput.getText()); - System.err.println(InetAddress.getByName(ipInput.getText())); - addr = InetAddress.getByName(ipInput.getText()); - } - catch(UnknownHostException i) - {addr=null;} - try - { - mySocket= new Socket(addr,4444); - reference.setSocket(mySocket); - in = new BufferedReader(new InputStreamReader(mySocket.getInputStream())); - reference.setAuthType(in.readLine()); - } - catch(IOException i) - { - System.err.println("Error connecting on port 4444 to"+addr); - return; - } - } - } + connectTo = new JButton("Connect"); + connectTo.addActionListener(this); + + JPanel rootPane = new JPanel(new BorderLayout()); + rootPane.add(ipInput, BorderLayout.WEST); + rootPane.add(connectTo, BorderLayout.EAST); + + theRoot.getContentPane().add(rootPane); + theRoot.pack(); + theRoot.setVisible(true); + } + + public JFrame getFrame() { + return theRoot; + } + + public void actionPerformed(ActionEvent e) { + if (e.getSource() == connectTo) { + InetAddress addr; + BufferedReader in; + try { + System.err.println(ipInput.getText()); + System.err.println(InetAddress.getByName(ipInput.getText())); + addr = InetAddress.getByName(ipInput.getText()); + } catch (UnknownHostException i) { + addr = null; + } + try { + mySocket = new Socket(addr, 4444); + reference.setSocket(mySocket); + in = + new BufferedReader(new InputStreamReader(mySocket.getInputStream())); + reference.setAuthType(in.readLine()); + } catch (IOException i) { + System.err.println("Error connecting on port 4444 to" + addr); + return; + } + } + } } Added: trunk/slac/client/Connection.java =================================================================== --- trunk/slac/client/Connection.java (rev 0) +++ trunk/slac/client/Connection.java 2006-06-12 02:48:57 UTC (rev 16) @@ -0,0 +1,11 @@ +package slac.client; + +import java.net.*; + +public class Connection implements Runnable +{ + public void run() + { + + } +} Added: trunk/slac/client/Desktop.java =================================================================== --- trunk/slac/client/Desktop.java (rev 0) +++ trunk/slac/client/Desktop.java 2006-06-12 02:48:57 UTC (rev 16) @@ -0,0 +1,143 @@ +package slac.client; + +import javax.swing.JDesktopPane; +import javax.swing.JOptionPane; +import java.awt.*; +import java.awt.event.*; +import java.net.*; +import java.io.*; + +public class Desktop extends JDesktopPane +{ + Socket socket; + InetAddress ip; + BufferedReader in; + PrintStream out; + String auth; + Lobby lobby; + String username; + String password;//Crypt needed + public Desktop(){} + + public void setUpDesktop() + { + String authType=null; + getAddress(); + setUpConnection(); + while (authType==null) + { + try + { + authType = in.readLine(); + } + catch (IOException e) + {} + } + authenticate(authType); + createLobby(); + } + private void createLobby() + { + if(auth.equals("None")) + { + lobby = new Lobby(socket,username); + add(lobby); + lobby.createGUI(); + } + else if (auth.equals("Password")) + { + //lobby = new Lobby(socket,username,password); + } + else if (auth.equals("Username")) + { + //lobby = new Lobby(socket,username);//Extra param?? + } + } + private void authenticate(String authType) + { + if(authType.equals("None")) + { + auth=authType; + noAuth(); + } + else if (authType.equals("Password")) + { + auth=authType; + //passAuth(); + } + else if (authType.equals("Username")) + { + auth=authType; + //userAuth(); + } + else + { + System.err.println("Unknown Authentication Type"); + } + } + private void noAuth() + { + username=null; + while(username==null) + { + String tempName = JOptionPane.showInternalInputDialog(this,"Enter your Username"); + out.println(tempName); + String response="false"; + try + { + response = in.readLine(); + } + catch (IOException e) + { + System.err.println("Error getting response"); + } + if (response.equals("true")) + { + //Auth Accepted + username=tempName; + System.out.println("Username is: "+username); + } + else + { + JOptionPane.showInternalMessageDialog(this,"Username '"+tempName+"' In Use","ERROR",JOptionPane.ERROR_MESSAGE); + } + } + } + private void setUpConnection() + { + boolean done = false; + while (done == false) + { + try + { + socket = new Socket(ip,4444); + in = new BufferedReader(new InputStreamReader(socket.getInputStream())); + out = new PrintStream(socket.getOutputStream(), true); + done = true; + } + catch (IOException e) + { + System.err.println("Error Connecting"); + JOptionPane.showInternalMessageDialog(this,"Error Connecting"); + getAddress(); + } + } + } + private void getAddress() + { + String input = null; + while (input == null) + { + input = JOptionPane.showInternalInputDialog(this,"What is the server ip?"); + try + { + ip = InetAddress.getByName(input); + } + catch (UnknownHostException e) + { + input = null; + JOptionPane.showInternalMessageDialog(this,"Invalid Address"); + } + } + } +} Modified: trunk/slac/client/Lobby.java =================================================================== --- trunk/slac/client/Lobby.java 2006-05-26 02:46:16 UTC (rev 15) +++ trunk/slac/client/Lobby.java 2006-06-12 02:48:57 UTC (rev 16) @@ -6,46 +6,113 @@ import javax.swing.*; import java.awt.event.*; import java.awt.*; -public class Lobby implements ActionListener -{ - private Socket socket; - private MainClient reference; - private JFrame root; - private JTextArea chatArea; - private JTextField chatInput; - private JTable preGameList; - private JList userList; - private String username; - public Lobby(Socket mySocket,MainClient ref,String userName) - { - socket = mySocket; - reference = ref; - username = userName; - createGUI(); - } - private void createGUI() - { - root = new JFrame(reference.VERSION); - root.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); - JPanel rootPane = new JPanel(); - rootPane.setLayout(new BoxLayout(rootPane,BoxLayout.X_AXIS)); - chatArea = new JTextArea(); - chatArea.setRows(10); - chatArea.setColumns(20); - chatArea.setEditable(false); - chatInput = new JTextField(); - chatInput.setColumns(20); - // I need another server - // the Chat needs to get its information from the chatserver - rootPane.add(chatArea); - rootPane.add(chatInput); - root.getContentPane().add(rootPane); - root.pack(); - root.setVisible(true); - } - public void actionPerformed(ActionEvent e) - {} - public JFrame getFrame() - {return root;} +public class Lobby extends JInternalFrame implements ActionListener, + KeyListener { + private Socket socket; + private JTextArea chatArea; + private JTextField chatInput; + private JTable preGameList; + private JList userList; + private String username; + private JButton doStuff; + private JList preloadList; + private JList playerList; + private JMenuBar menubar; + private JMenu menu; + private JMenuItem item; + + public Lobby(Socket mySocket, String userName) { + socket = mySocket; + username = userName; + //createGUI(); + } + //Sets up the GUI and makes it visible + protected void createGUI() + { + // Dimension realScreenSize = Toolkit.getDefaultToolkit().getScreenSize(); + Dimension screenSize = getDesktopPane().getSize(); + Dimension playerDim; + Dimension gameDim; + Dimension fullHalf; + double screenWidth = screenSize.getWidth(); + double screenHeight = screenSize.getHeight(); + //all width, half height + fullHalf = new Dimension((int)screenWidth,(int)screenHeight/2); + //a fourth of the width, half the height + playerDim = new Dimension((int)screenWidth/4,(int)screenHeight/2); + //3 fourths of the width, half the height + gameDim = new Dimension((int)screenWidth*3/4,(int)screenHeight/2); + JPanel rootPane = new JPanel(); + JPanel chatPane = new JPanel(); + chatPane.setLayout(new BoxLayout(chatPane, BoxLayout.Y_AXIS)); + JPanel gamePane = new JPanel(); + gamePane.setLayout(new BoxLayout(gamePane, BoxLayout.X_AXIS)); + rootPane.setLayout(new BoxLayout(rootPane, BoxLayout.Y_AXIS)); + + chatArea = new JTextArea(); + chatArea.setBackground(Color.black); + chatArea.setForeground(Color.white); + chatArea.setCaretColor(Color.green); + chatArea.setEditable(false); + + chatInput = new JTextField(); + int fontHeight = chatInput.getFontMetrics(chatInput.getFont()).getHeight(); + chatInput.addKeyListener(this); + chatInput.setBackground(Color.black); + chatInput.setForeground(Color.white); + chatInput.setCaretColor(Color.green); + chatInput.setMaximumSize(new Dimension((int)screenWidth,fontHeight)); + // I need another server + // the Chat needs to get its information from the chatserver + // Going to need another thread to deal with server messages + playerList = new JList(new String[] { "Test", "Test2" }); + playerList.setMinimumSize(playerDim); + playerList.setMaximumSize(playerDim); + preloadList = new JList(new String[] { "preload", "preload2" }); + preloadList.setMinimumSize(gameDim); + preloadList.setMaximumSize(gameDim); + menubar = new JMenuBar(); + menu = new JMenu("Test"); + item = new JMenuItem("Test1"); + menu.add(item); + menubar.add(menu); + setJMenuBar(menubar); + + chatPane.add(chatArea); + chatPane.add(chatInput); + chatPane.setMaximumSize(fullHalf); + + gamePane.add(playerList); + gamePane.add(preloadList); + gamePane.setMinimumSize(fullHalf); + gamePane.setSize(fullHalf); + gamePane.setMaximumSize(fullHalf); + rootPane.add(gamePane); + rootPane.add(chatPane); + + add(rootPane); + setSize(screenSize); + show(); + } + + public void keyPressed(KeyEvent e) { + int key = e.getKeyCode(); + if (key == KeyEvent.VK_ENTER) { + // Send the chat to the server + //chatOut.println(chatInput.getText()); + chatInput.setText(""); + } + } + + public void keyReleased(KeyEvent e) { + } + + public void keyTyped(KeyEvent e) { + } + + public void actionPerformed(ActionEvent e) { + Object source = e.getSource(); + // if( + } } Modified: trunk/slac/client/MainClient.java =================================================================== --- trunk/slac/client/MainClient.java 2006-05-26 02:46:16 UTC (rev 15) +++ trunk/slac/client/MainClient.java 2006-06-12 02:48:57 UTC (rev 16) @@ -1,55 +1,64 @@ package slac.client; + import java.net.*; + import java.io.*; + import javax.swing.*; -public class MainClient -{ - public static final String VERSION = "Slac Pre-Alpha 1 "; - private Socket socket; - private JFrame root; - private String authType; - private String username; - public static final String NONE = "None"; - public MainClient() - { - setUp(); - } - private void setUp() - { - ConnectTo setUpSocket = new ConnectTo(this); - root = setUpSocket.getFrame(); - } - private static void showGUI() - { - new MainClient(); - } - public static void main(String[] Args) - { - javax.swing.SwingUtilities.invokeLater(new Runnable() - { public void run() {showGUI(); }}); - } - public void setSocket(Socket set) - { - socket = set; - } - public void setAuthType(String auth) - { - authType = auth; - System.err.println(authType); - if(authType.equalsIgnoreCase(NONE)) - { - System.err.println("Setting up Auth"); - NoAccount setUpAuth = new NoAccount(this,socket); - root.setVisible(false); - root = setUpAuth.getFrame(); - } - } - public void setUsername(String name) - { - username = name; - System.err.println(username); - root.setVisible(false); - Lobby lobby = new Lobby(socket,this,username); - root = lobby.getFrame(); - } + +public class MainClient { + public static final String VERSION = "Slac Pre-Alpha 1 "; + private Socket socket; + private JFrame root; + private String authType; + private String username; + public static final String NONE = "None"; + + public MainClient() { + setUp(); + } + + private void setUp() { + ConnectTo setUpSocket = new ConnectTo(this); + root = setUpSocket.getFrame(); + } + + private static void showGUI() { + new MainClient(); + } + + public static void main(String[] Args) { + try { + UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName()); + } catch (Exception e) { + } + javax.swing.SwingUtilities.invokeLater(new Runnable() { + public void run() { + showGUI(); + } + }); + } + + public void setSocket(Socket set) { + socket = set; + } + + public void setAuthType(String auth) { + authType = auth; + System.err.println(authType); + if (authType.equalsIgnoreCase(NONE)) { + System.err.println("Setting up Auth"); + NoAccount setUpAuth = new NoAccount(this, socket); + root.setVisible(false); + root = setUpAuth.getFrame(); + } + } + + public void setUsername(String name) { + username = name; + System.err.println(username); + root.setVisible(false); + Lobby lobby = new Lobby(socket, this, username); + root = lobby.getFrame(); + } } Modified: trunk/slac/client/NoAccount.java =================================================================== --- trunk/slac/client/NoAccount.java 2006-05-26 02:46:16 UTC (rev 15) +++ trunk/slac/client/NoAccount.java 2006-06-12 02:48:57 UTC (rev 16) @@ -1,73 +1,73 @@ package slac.client; + import java.net.*; + import java.io.*; + import javax.swing.*; + import java.awt.event.*; import java.awt.*; -public class NoAccount implements ActionListener -{ - private JFrame root; - private MainClient reference; - private Socket socket; - private JTextField username; - private JButton setUsername; - public NoAccount(MainClient ref,Socket mySocket) - { - reference = ref; - socket = mySocket; - createGUI(); - } - public void actionPerformed(ActionEvent e) - { - if(e.getSource().equals(setUsername)) - { - PrintStream out=null; - BufferedReader in=null; - String response = null; - try - { - out = new PrintStream(socket.getOutputStream(),true); - in = new BufferedReader(new InputStreamReader(socket.getInputStream())); - } - catch (IOException i) - { - System.err.println("Error creating Streams"); - return; - } - out.println(username.getText()); - try - { - response = in.readLine(); - System.out.println(response); - } - catch (IOException i) - {} - if(response.equals("true")) - { - // Accepted - reference.setUsername(username.getText()); - } - else {username.setText("Username In Use");} - } - } - private void createGUI() - { - root = new JFrame(reference.VERSION); - root.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); -// root.setMinimumSize(new Dimension(100,100)); - root.setResizable(false); - root.setLocationRelativeTo(username);//Middle of screen - username = new JTextField("Enter your Username"); - setUsername = new JButton("Accept"); - setUsername.addActionListener(this); - JPanel rootPane = new JPanel (new BorderLayout()); - rootPane.add(username,BorderLayout.WEST); - rootPane.add(setUsername,BorderLayout.EAST); - root.getContentPane().add(rootPane); - root.pack(); - root.setVisible(true); - } - public JFrame getFrame() - {return root;} +public class NoAccount implements ActionListener { + private JFrame root; + private MainClient reference; + private Socket socket; + private JTextField username; + private JButton setUsername; + + public NoAccount(MainClient ref, Socket mySocket) { + reference = ref; + socket = mySocket; + createGUI(); + } + + public void actionPerformed(ActionEvent e) { + if (e.getSource().equals(setUsername)) { + PrintStream out = null; + BufferedReader in = null; + String response = null; + try { + out = new PrintStream(socket.getOutputStream(), true); + in = + new BufferedReader(new InputStreamReader(socket.getInputStream())); + } catch (IOException i) { + System.err.println("Error creating Streams"); + return; + } + out.println(username.getText()); + try { + response = in.readLine(); + System.out.println(response); + } catch (IOException i) { + } + if (response.equals("true")) { + // Accepted + reference.setUsername(username.getText()); + } else { + username.setText("Username In Use"); + } + } + } + + private void createGUI() { + root = new JFrame(reference.VERSION); + root.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + // root.setMinimumSize(new Dimension(100,100)); + root.setResizable(false); + root.setLocationRelativeTo(username); //Middle of screen + username = new JTextField("Enter your Username"); + setUsername = new JButton("Accept"); + setUsername.addActionListener(this); + JPanel rootPane = new JPanel(new BorderLayout()); + rootPane.add(username, BorderLayout.WEST); + rootPane.add(setUsername, BorderLayout.EAST); + root.getContentPane().add(rootPane); + root.pack(); + root.setVisible(true); + } + + public JFrame getFrame() { + return root; + } } Deleted: trunk/slac/client/StressTest.java =================================================================== --- trunk/slac/client/StressTest.java 2006-05-26 02:46:16 UTC (rev 15) +++ trunk/slac/client/StressTest.java 2006-06-12 02:48:57 UTC (rev 16) @@ -1,33 +0,0 @@ -import java.io.*; -import java.net.*; - -public class StressTest -{ - public static void main (String [] args) throws IOException - { - Socket mySocket = null; - PrintWriter out = null; - BufferedReader in = null; - try - { - mySocket = new Socket(); - mySocket.connect(new InetSocketAddress("localhost",4444)); - out = new PrintWriter(mySocket.getOutputStream(), true); - in = new BufferedReader(new InputStreamReader(mySocket.getInputStream())); - } - catch (IOException e) - { - System.err.println("Unable to connect to localhost on 4444"); - System.exit(1); - } - BufferedReader keyboard = new BufferedReader(new InputStreamReader(System.in)); - String fromServer; - String fromKeyboard; - while (mySocket != null) - { - mySocket.close(); - mySocket = new Socket(); - mySocket.connect(new InetSocketAddress("localhost",4444)); - } - } -} Added: trunk/slac/server/ChatClientConnection.java =================================================================== --- trunk/slac/server/ChatClientConnection.java (rev 0) +++ trunk/slac/server/ChatClientConnection.java 2006-06-12 02:48:57 UTC (rev 16) @@ -0,0 +1,19 @@ +package slac.server; + +import java.io.*; + +import java.net.*; + +public class ChatClientConnection implements Runnable { + private Socket socket; + private ChatServer reference; + + public ChatClientConnection(Socket mySocket, ChatServer ref) { + reference = ref; + socket = mySocket; + } + + public void run() { + + } +} Added: trunk/slac/server/ChatConnect.java =================================================================== --- trunk/slac/server/ChatConnect.java (rev 0) +++ trunk/slac/server/ChatConnect.java 2006-06-12 02:48:57 UTC (rev 16) @@ -0,0 +1,35 @@ +package slac.server; + +import java.io.*; + +import java.net.*; + +public class ChatConnect implements Runnable { + private ChatServer reference; + private ServerSocket socket; + private boolean running; + + public ChatConnect(int port, ChatServer ref) { + reference = ref; + try { + socket = new ServerSocket(port); + } catch (IOException e) { + // TODO + } + running = true; + } + + public void run() { + while (running) { + reference.addClient(dealWithIncoming()); + } + } + + private ChatClientConnection dealWithIncoming() { + try { + return new ChatClientConnection(socket.accept(), reference); + } catch (IOException e) { + return null; + } + } +} Added: trunk/slac/server/ChatServer.java =================================================================== --- trunk/slac/server/ChatServer.java (rev 0) +++ trunk/slac/server/ChatServer.java 2006-06-12 02:48:57 UTC (rev 16) @@ -0,0 +1,27 @@ +package slac.server; + +import java.net.*; + +import java.util.*; + +import java.io.*; + +// Todo: Make threadgroups +public class ChatServer implements Runnable { + + ChatConnect acceptConnections; + Thread acceptConnectionsThread; + Vector<ChatClientConnection> clients; + + ChatServer(int port) { + acceptConnections = new ChatConnect(port, this); + acceptConnectionsThread = new Thread(acceptConnections); + } + + public void run() { + acceptConnectionsThread.start(); + } + void addClient(ChatClientConnection p0) + { + } +} Modified: trunk/slac/server/Client.java =================================================================== --- trunk/slac/server/Client.java 2006-05-26 02:46:16 UTC (rev 15) +++ trunk/slac/server/Client.java 2006-06-12 02:48:57 UTC (rev 16) @@ -1,6 +1,5 @@ package slac.server; -public interface Client extends Comparable<Client> -{ +public interface Client extends Comparable<Client> { } Modified: trunk/slac/server/ClientConnectionThread.java =================================================================== --- trunk/slac/server/ClientConnectionThread.java 2006-05-26 02:46:16 UTC (rev 15) +++ trunk/slac/server/ClientConnectionThread.java 2006-06-12 02:48:57 UTC (rev 16) @@ -1,83 +1,84 @@ package slac.server; import java.net.*; + import java.io.*; -public class ClientConnectionThread implements Serializable, Runnable -{ - private Socket socket = null; - private Server reference; - private BufferedReader in; - private PrintStream out; - private volatile boolean running; - public final String authType; - private String username; - private DefaultClient client; - public ClientConnectionThread(Socket socket, Server ref,String auth) - { - this.socket = socket; - reference = ref; - running = true; - authType = auth; - try - { - out = new PrintStream (socket.getOutputStream(),true); - in = new BufferedReader(new InputStreamReader(socket.getInputStream())); - } - catch (IOException e) - { - System.out.println("Error setting up the streams"); - } - } - public void run() - { - System.out.println("StartedConnectionThread"+this.toString()); - String outputLine = null; - try - { - out.println(authType); - username = in.readLine(); - client = new DefaultClient(username,socket.getRemoteSocketAddress()); - out.println(reference.addUser(client));//Boolean - // TODO: Make sure the client has the same username - // TODO: Add other auth types to the thread - while (socket.isConnected() && running) - { - examineMessage(in.readLine()); + +public class ClientConnectionThread implements Serializable, Runnable { + private Socket socket = null; + private Server reference; + private BufferedReader in; + private PrintStream out; + private volatile boolean running; + public final String authType; + private String username; + private DefaultClient client; + + public ClientConnectionThread(Socket socket, Server ref, String auth) { + this.socket = socket; + reference = ref; + running = true; + authType = auth; + try { + out = new PrintStream(socket.getOutputStream(), true); + in = + new BufferedReader(new InputStreamReader(socket.getInputStream())); + } catch (IOException e) { + System.out.println("Error setting up the streams"); + } } - in.close(); - socket.close(); + + public void run() { + System.out.println("StartedConnectionThread" + this.toString()); + String outputLine = null; + try { + out.println(authType); + boolean added = false; + while (added == false) + { + username = in.readLine(); + client = new DefaultClient(username, socket.getRemoteSocketAddress()); + added = reference.addUser(client); + out.println(added); //Boolean + // TODO: Make sure the client has the same username + // TODO: Add other auth types to the thread + } + while (socket.isConnected() && running) + { + examineMessage(in.readLine()); + } + in.close(); + socket.close(); + } catch (IOException e) { + e.printStackTrace(); + } } - catch (IOException e) - { - e.printStackTrace(); + + public void examineMessage(String message) { //Has to be a better way to do this?? + try { + if (message.equalsIgnoreCase("Lobby List")) { + + } + } catch (NullPointerException e) { + close(); + } } - } - public void examineMessage(String message) - {//Has to be a better way to do this?? - if(message.equalsIgnoreCase("Lobby List")) - { - - } - } - public void close() - { - try - { - running = false; - out.println("Close"); - out.close(); - System.out.println("Closing in"+this); - in.close(); - System.out.println("Closing the socket"+this); - socket.close(); - System.out.println("Sockets Closed"+this); - reference.removeClient(this); - reference.removeUser(client); - } - catch (Exception e) - { - System.err.println("Error Closing the thread[CCT.java]"); - } - } + public void close() { + try { + running = false; + out.println("Close"); + out.close(); + System.out.println("Closing in" + this); + in.close(); + System.out.println("Closing the socket" + this); + socket.close(); + System.out.println("Sockets Closed" + this); + reference.removeClient(this); + reference.removeUser(client); + } catch (Exception e) { + System.err.println("Error Closing the thread[CCT.java]"); + e.printStackTrace(); + } + } } Deleted: trunk/slac/server/ClientInterface.java =================================================================== --- trunk/slac/server/ClientInterface.java 2006-05-26 02:46:16 UTC (rev 15) +++ trunk/slac/server/ClientInterface.java 2006-06-12 02:48:57 UTC (rev 16) @@ -1,8 +0,0 @@ -package slac.server; - -public interface ClientInterface -{ - - - -} Modified: trunk/slac/server/Connect.java =================================================================== --- trunk/slac/server/Connect.java 2006-05-26 02:46:16 UTC (rev 15) +++ trunk/slac/server/Connect.java 2006-06-12 02:48:57 UTC (rev 16) @@ -1,94 +1,87 @@ package slac.server; import java.net.*; + import java.io.*; -public class Connect implements Runnable -{ - private BufferedReader serverArgs; - private int port; - private int number; - private boolean listening; - private ServerSocket serverSocket; - private Server reference; - private ThreadGroup clientThreads; - public final String authType; - public Connect(Server ref, int Port,String auth) - { - port = Port; - reference = ref; - authType = auth; - } - public void run() - { - clientThreads = new ThreadGroup(Thread.currentThread().getThreadGroup(),"Client Threads"); - serverSocket = null; - listening = true; - //getPrefs("prefs.ini"); - number=0; - System.out.println(port); - try - { - serverSocket = new ServerSocket(port);// 50 max queue'd connections - } - catch (IOException e) - { - System.err.println("[Connect.java]Error creating socket on port"+port); - close(); - } - while (listening) - { - // ClientConnectionThread temp = new ClientConnectionThread(serverSocket.accept()); - ClientConnectionThread tempClient = startNewClient(); - if(tempClient!=null) - { - reference.addClient(tempClient); +public class Connect implements Runnable { + private BufferedReader serverArgs; + private int port; + private int number; + private boolean listening; + private ServerSocket serverSocket; + private Server reference; + private ThreadGroup clientThreads; + public final String authType; + + public Connect(Server ref, int Port, String auth) { + port = Port; + reference = ref; + authType = auth; } - } - } - private void getPrefs(String filename) - { - try - { - serverArgs = new BufferedReader(new FileReader(filename)); - port = Integer.parseInt(serverArgs.readLine()); - serverArgs.close(); - } - catch (IOException e) - { - System.err.println("Invalid File[Connect.java]"); - } - } - private ClientConnectionThread startNewClient() - { - ClientConnectionThread temp = null; - Thread tempThread = null; - try - { - temp = new ClientConnectionThread(serverSocket.accept(),reference,authType); - tempThread = new Thread(clientThreads,temp,"ClientConnectionThread"); - tempThread.start(); - } - catch(IOException e) - { - System.err.println("Error creating thread[Connect.java]"); - } - return temp; - } - public void close() - { - System.out.println("Setting Listening to false[Connect.java]"); - listening = false; - try - { - System.out.println("Closing the serverSocket[Connect.java]"); - serverSocket.close(); - } - catch (IOException e) - { - System.out.println("Error Closing the serverSocket[Connect.java]"); - } - clientThreads.list(); - System.out.println("Active Threads[Connect.java]"+clientThreads.activeCount()); - } + + public void run() { + clientThreads = + new ThreadGroup(Thread.currentThread().getThreadGroup(), + "Client Threads"); + serverSocket = null; + listening = true; + //getPrefs("prefs.ini"); + number = 0; + System.out.println(port); + try { + serverSocket = + new ServerSocket(port); // 50 max queue'd connections + } catch (IOException e) { + System.err.println("[Connect.java]Error creating socket on port" + + port); + close(); + } + while (listening) { + // ClientConnectionThread temp = new ClientConnectionThread(serverSocket.accept()); + ClientConnectionThread tempClient = startNewClient(); + if (tempClient != null) { + reference.addClient(tempClient); + } + } + } + + private void getPrefs(String filename) { + try { + serverArgs = new BufferedReader(new FileReader(filename)); + port = Integer.parseInt(serverArgs.readLine()); + serverArgs.close(); + } catch (IOException e) { + System.err.println("Invalid File[Connect.java]"); + } + } + + private ClientConnectionThread startNewClient() { + ClientConnectionThread temp = null; + Thread tempThread = null; + try { + temp = +new ClientConnectionThread(serverSocket.accept(), reference, authType); + tempThread = + new Thread(clientThreads, temp, "ClientConnectionThread"); + tempThread.start(); + } catch (IOException e) { + System.err.println("Error creating thread[Connect.java]"); + } + return temp; + } + + public void close() { + System.out.println("Setting Listening to false[Connect.java]"); + listening = false; + try { + System.out.println("Closing the serverSocket[Connect.java]"); + serverSocket.close(); + } catch (IOException e) { + System.out.println("Error Closing the serverSocket[Connect.java]"); + } + clientThreads.list(); + System.out.println("Active Threads[Connect.java]" + + clientThreads.activeCount()); + } } Modified: trunk/slac/server/DefaultClient.java =================================================================== --- trunk/slac/server/DefaultClient.java 2006-05-26 02:46:16 UTC (rev 15) +++ trunk/slac/server/DefaultClient.java 2006-06-12 02:48:57 UTC (rev 16) @@ -1,31 +1,32 @@ package slac.server; + import java.net.*; // Provides an interface to deal with client threads easier. -public class DefaultClient implements Client -{ - private String username; - private InetSocketAddress ip; - public DefaultClient(String Username,SocketAddress Ip) - { - username = Username; - ip =(InetSocketAddress) Ip; - } - public String getUsername() - {return username;} - public InetSocketAddress getAddress() - {return ip;} - public int compareTo(Client o) - { - DefaultClient compare = (DefaultClient) o; - if (compare.getUsername().equals(this.getUsername())) - { - System.out.println("Same Client"); - return 0; - } - else - { - System.out.println("Different Client"); - return 1; - } - } +public class DefaultClient implements Client { + private String username; + private InetSocketAddress ip; + + public DefaultClient(String Username, SocketAddress Ip) { + username = Username; + ip = (InetSocketAddress)Ip; + } + + public String getUsername() { + return username; + } + + public InetSocketAddress getAddress() { + return ip; + } + + public int compareTo(Client o) { + DefaultClient compare = (DefaultClient)o; + if (compare.getUsername().equals(this.getUsername())) { + System.out.println("Same Client"); + return 0; + } else { + System.out.println("Different Client"); + return 1; + } + } } Modified: trunk/slac/server/Server.java =================================================================== --- trunk/slac/server/Server.java 2006-05-26 02:46:16 UTC (rev 15) +++ trunk/slac/server/Server.java 2006-06-12 02:48:57 UTC (rev 16) @@ -1,144 +1,143 @@ package slac.server; + import java.util.*; + import java.io.*; -public class Server implements Runnable -{ - // Stores all of the clients into a treeset - private volatile Vector<ClientConnectionThread> clients = new Vector<ClientConnectionThread>(); - private ThreadGroup connectThreads; - private ObjectOutputStream objOut; - private ObjectInputStream objIn; - private PipedInputStream pipeIn; - private PipedOutputStream pipeOut; - private Server reference; - private int port; - private Connect connect; - private boolean running; - private Thread connectThread; - private final String authType; - private TreeSet<Client> userList = new TreeSet<Client>(); - public Server(int Port) - { - this(Port,null); - } - public Server(int Port,Server s) - { - this(Port,s,0); - } - public Server(int Port,int auth) - { - this(Port,null,auth); - } - public Server(int Port,Server s,int auth) - { - port = Port; - reference = s; - if(auth == 1) - { - authType = "Username"; - } - else if(auth == 1) - { - authType = "Password"; - } - else {authType = "None";} - running = true; - } - public void run() - { - connectThreads= new ThreadGroup(Thread.currentThread().getThreadGroup(),"Connects"); - //setUpPipes();// Not Needed?? - //setUpStreams();// Not Needed?? - waitForReference(); - connect = new Connect(reference,port,authType); - connectThread = new Thread(connectThreads,connect,"Server Connection Thread"); - connectThread.start(); - //dealWithPipe(); // Not needed?? - } - private void dealWithPipe() - { - while(running) - { - try - { - Object temp = objIn.readObject(); - System.out.println(temp.getClass().getName()); - //if(temp.getClass().equals(ClientConnectionThread)) - //{ - // clients.add(temp); - // System.out.println("Added"+temp); - // } - } - catch (IOException e) - {System.err.println("Error Reading ObjectStream");} - catch (ClassNotFoundException e) - {System.err.println("ClassNotFound");} - } - System.out.println("Exiting dealwithPipe()"); - } - private void setUpPipes() - { - try - { - pipeIn = new PipedInputStream(); - pipeOut = new PipedOutputStream(pipeIn); - pipeIn.connect(pipeOut); - } - catch(IOException e) {} - } - private void setUpStreams() - { - try - { - objOut = new ObjectOutputStream(pipeOut); - objIn = new ObjectInputStream(pipeIn); - } - catch (IOException e) - { - } - } - public void addClient(ClientConnectionThread newClient) - { - clients.add(newClient); - System.out.println(newClient+"Added to list"); - } - public void waitForReference() - { - while (reference == null); - } - public void addReference(Server server) - { - reference = server; - } - public void stopServer() - { - System.out.println("Exiting....[Server.java]"); - connectThread.interrupt(); - connect.close(); - System.out.println("Setting running to false[Server.java]"); - running = false; - System.out.println("Removing clients from list"); - System.out.println("Clients in Array"+clients); - while(clients.size()>0) - { - System.out.println("[Server.java]Removing: "+clients.get(0)); - ClientConnectionThread tmp = clients.remove(0); - tmp.close(); - } - connectThreads.list(); - System.out.println("Active[server.java]"+connectThreads.activeGroupCount()); - } - public void removeClient(ClientConnectionThread obj) - { - clients.remove(obj); - } - public synchronized boolean addUser(Client user) - { - return userList.add(user); - } - public synchronized void removeUser(Client user) - { - userList.remove(user); - } +public class Server implements Runnable { + // Stores all of the clients into a treeset + private volatile Vector<ClientConnectionThread> clients = + new Vector<ClientConnectionThread>(); + private ThreadGroup connectThreads; + private ObjectOutputStream objOut; + private ObjectInputStream objIn; + private PipedInputStream pipeIn; + private PipedOutputStream pipeOut; + private Server reference; + private int port; + private Connect connect; + private boolean running; + private Thread connectThread; + private final String authType; + private TreeSet<Client> userList = new TreeSet<Client>(); + + public Server(int Port) { + this(Port, null); + } + + public Server(int Port, Server s) { + this(Port, s, 0); + } + + public Server(int Port, int auth) { + this(Port, null, auth); + } + + public Server(int Port, Server s, int auth) { + port = Port; + reference = s; + if (auth == 1) { + authType = "Username"; + } else if (auth == 1) { + authType = "Password"; + } else { + authType = "None"; + } + running = true; + } + + public void run() { + connectThreads = + new ThreadGroup(Thread.currentThread().getThreadGroup(), + "Connects"); + //setUpPipes();// Not Needed?? + //setUpStreams();// Not Needed?? + waitForReference(); + connect = new Connect(reference, port, authType); + connectThread = + new Thread(connectThreads, connect, "Server Connection Thread"); + connectThread.start(); + //dealWithPipe(); // Not needed?? + } + + private void dealWithPipe() { + while (running) { + try { + Object temp = objIn.readObject(); + System.out.println(temp.getClass().getName()); + //if(temp.getClass().equals(ClientConnectionThread)) + //{ + // clients.add(temp); + // System.out.println("Added"+temp); + + // } + } catch (IOException e) { + System.err.println("Error Reading ObjectStream"); + } catch (ClassNotFoundException e) { + System.err.println("ClassNotFound"); + } + } + System.out.println("Exiting dealwithPipe()"); + } + + private void setUpPipes() { + try { + pipeIn = new PipedInputStream(); + pipeOut = new PipedOutputStream(pipeIn); + pipeIn.connect(pipeOut); + } catch (IOException e) { + } + } + + private void setUpStreams() { + try { + objOut = new ObjectOutputStream(pipeOut); + objIn = new ObjectInputStream(pipeIn); + } catch (IOException e) { + } + } + + public void addClient(ClientConnectionThread newClient) { + clients.add(newClient); + System.out.println(newClient + "Added to list"); + } + + public void waitForReference() { + while (reference == null) + ; + } + + public void addReference(Server server) { + reference = server; + } + + public void stopServer() { + System.out.println("Exiting....[Server.java]"); + connectThread.interrupt(); + connect.close(); + System.out.println("Setting running to false[Server.java]"); + running = false; + System.out.println("Removing clients from list"); + System.out.println("Clients in Array" + clients); + while (clients.size() > 0) { + System.out.println("[Server.java]Removing: " + clients.get(0)); + ClientConnectionThread tmp = clients.remove(0); + tmp.close(); + } + connectThreads.list(); + System.out.println("Active[server.java]" + + connectThreads.activeGroupCount()); + } + + public void removeClient(ClientConnectionThread obj) { + clients.remove(obj); + } + + public synchronized boolean addUser(Client user) { + return userList.add(user); + } + + public synchronized void removeUser(Client user) { + userList.remove(user); + } } Modified: trunk/slac/server/ServerLoader.java =================================================================== --- trunk/slac/server/ServerLoader.java 2006-05-26 02:46:16 UTC (rev 15) +++ trunk/slac/server/ServerLoader.java 2006-06-12 02:48:57 UTC (rev 16) @@ -1,62 +1,53 @@ package slac.server; + import java.io.*; + import java.util.*; -public class ServerLoader -{ - public static void main(String [] args) throws IOException - { - String motd = "Welcome to the Slac Server Loader Interface"+"\n" - +"Possible Commands are:"; - String cmdlist = "start, stop, list, shutdown"; - boolean running = true; - Vector<Server> serverList= new Vector<Server>(); - ThreadGroup serverThreads = new ThreadGroup("Server Group"); - BufferedReader keyboard = new BufferedReader(new InputStreamReader(System.in)); - int port = 4444; - System.out.println(motd); - System.out.println(cmdlist); - while (running) - { - String input = keyboard.readLine(); - if (input.trim().equalsIgnoreCase("start")) - { - Server temp = new Server(port); - port ++; - serverList.add(temp); - new Thread(serverThreads,temp).start(); - temp.addReference(temp); - } - else if (input.trim().equalsIgnoreCase("stop")) - { - System.out.println("Which Server?"); - for (int i = 0; i<serverList.size();i++) - { - System.out.println(i+": "+serverList.get(i)); + +public class ServerLoader { + public static void main(String[] args) throws IOException { + String motd = + "Welcome to the Slac Server Loader Interface" + "\n" + "Possible Commands are:"; + String cmdlist = "start, stop, list, shutdown"; + boolean running = true; + Vector<Server> serverList = new Vector<Server>(); + ThreadGroup serverThreads = new ThreadGroup("Server Group"); + BufferedReader keyboard = + new BufferedReader(new InputStreamReader(System.in)); + int port = 4444; + System.out.println(motd); + System.out.println(cmdlist); + while (running) { + String input = keyboard.readLine(); + if (input.trim().equalsIgnoreCase("start")) { + Server temp = new Server(port); + port++; + serverList.add(temp); + new Thread(serverThreads, temp).start(); + temp.addReference(temp); + } else if (input.trim().equalsIgnoreCase("stop")) { + System.out.println("Which Server?"); + for (int i = 0; i < serverList.size(); i++) { + System.out.println(i + ": " + serverList.get(i)); + } + int i = Integer.parseInt(keyboard.readLine()); + System.out.println("I: " + i); + Server remove = (Server)serverList.remove(i); + remove.stopServer(); + System.gc(); + System.out.println("GC Done"); + } else if (input.trim().equalsIgnoreCase("List")) { + for (int i = 0; i < serverList.size(); i++) { + System.out.println(i + ": " + serverList.get(i)); + } + } else if (input.trim().equalsIgnoreCase("Shutdown")) { + for (int i = 0; i < serverList.size(); i++) { + serverList.remove(i).stopServer(); + } + running = false; + } + } + System.exit(0); } - int i = Integer.parseInt(keyboard.readLine()); - System.out.println("I: "+i); - Server remove =(Server) serverList.remove(i); - remove.stopServer(); - System.gc(); - System.out.println("GC Done"); - } - else if (input.trim().equalsIgnoreCase("List")) - { - for (int i =0; i < serverList.size(); i ++) - { - System.out.println(i+": "+serverList.get(i)); - } - } - else if (input.trim().equalsIgnoreCase("Shutdown")) - { - for (int i = 0; i < serverList.size(); i ++) - { - serverList.remove(i).stopServer(); - } - running = false; - } - } - System.exit(0); - } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <air...@us...> - 2006-05-26 02:46:26
|
Revision: 15 Author: airpizza Date: 2006-05-25 19:46:16 -0700 (Thu, 25 May 2006) ViewCVS: http://svn.sourceforge.net/slac/?rev=15&view=rev Log Message: ----------- Added Paths: ----------- trunk/slac/client/ConnectTo.java trunk/slac/client/Lobby.java trunk/slac/client/MainClient.java trunk/slac/client/NoAccount.java trunk/slac/server/Client.java trunk/slac/server/DefaultClient.java Added: trunk/slac/client/ConnectTo.java =================================================================== --- trunk/slac/client/ConnectTo.java (rev 0) +++ trunk/slac/client/ConnectTo.java 2006-05-26 02:46:16 UTC (rev 15) @@ -0,0 +1,76 @@ +package slac.client; + +import javax.swing.*; +import java.awt.*; +import java.awt.event.*; +import java.net.*; +import java.io.*; +/* + This class is the class that starts the GUI client (separated) + All it does is request the ip of the server, and then connects to the server + It then spawns the rest of the client +*/ + + +public class ConnectTo implements ActionListener +{ + private JTextField ipInput; + private JButton connectTo; + private JFrame theRoot; + Socket mySocket; + private MainClient reference; + public ConnectTo(MainClient ref) + { + reference = ref; + createGUI(); + } + private void createGUI() + { + theRoot = new JFrame(reference.VERSION); + theRoot.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + theRoot.setResizable(false); + theRoot.setLocationRelativeTo(ipInput);//Center + ipInput = new JTextField("Enter the ip or hostname of the server"); + + connectTo = new JButton("Connect"); + connectTo.addActionListener(this); + + JPanel rootPane = new JPanel(new BorderLayout()); + rootPane.add(ipInput,BorderLayout.WEST); + rootPane.add(connectTo,BorderLayout.EAST); + + theRoot.getContentPane().add(rootPane); + theRoot.pack(); + theRoot.setVisible(true); + } + public JFrame getFrame() + {return theRoot;} + public void actionPerformed(ActionEvent e) + { + if(e.getSource() == connectTo) + { + InetAddress addr; + BufferedReader in; + try + { + System.err.println(ipInput.getText()); + System.err.println(InetAddress.getByName(ipInput.getText())); + addr = InetAddress.getByName(ipInput.getText()); + } + catch(UnknownHostException i) + {addr=null;} + try + { + mySocket= new Socket(addr,4444); + reference.setSocket(mySocket); + in = new BufferedReader(new InputStreamReader(mySocket.getInputStream())); + reference.setAuthType(in.readLine()); + } + catch(IOException i) + { + System.err.println("Error connecting on port 4444 to"+addr); + return; + } + } + } +} Added: trunk/slac/client/Lobby.java =================================================================== --- trunk/slac/client/Lobby.java (rev 0) +++ trunk/slac/client/Lobby.java 2006-05-26 02:46:16 UTC (rev 15) @@ -0,0 +1,51 @@ +package slac.client; + +import java.net.*; +import java.util.*; +import java.io.*; +import javax.swing.*; +import java.awt.event.*; +import java.awt.*; +public class Lobby implements ActionListener +{ + private Socket socket; + private MainClient reference; + private JFrame root; + private JTextArea chatArea; + private JTextField chatInput; + private JTable preGameList; + private JList userList; + private String username; + public Lobby(Socket mySocket,MainClient ref,String userName) + { + socket = mySocket; + reference = ref; + username = userName; + createGUI(); + } + private void createGUI() + { + root = new JFrame(reference.VERSION); + root.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + JPanel rootPane = new JPanel(); + rootPane.setLayout(new BoxLayout(rootPane,BoxLayout.X_AXIS)); + chatArea = new JTextArea(); + chatArea.setRows(10); + chatArea.setColumns(20); + chatArea.setEditable(false); + chatInput = new JTextField(); + chatInput.setColumns(20); + // I need another server + // the Chat needs to get its information from the chatserver + rootPane.add(chatArea); + rootPane.add(chatInput); + + root.getContentPane().add(rootPane); + root.pack(); + root.setVisible(true); + } + public void actionPerformed(ActionEvent e) + {} + public JFrame getFrame() + {return root;} +} Added: trunk/slac/client/MainClient.java =================================================================== --- trunk/slac/client/MainClient.java (rev 0) +++ trunk/slac/client/MainClient.java 2006-05-26 02:46:16 UTC (rev 15) @@ -0,0 +1,55 @@ +package slac.client; +import java.net.*; +import java.io.*; +import javax.swing.*; +public class MainClient +{ + public static final String VERSION = "Slac Pre-Alpha 1 "; + private Socket socket; + private JFrame root; + private String authType; + private String username; + public static final String NONE = "None"; + public MainClient() + { + setUp(); + } + private void setUp() + { + ConnectTo setUpSocket = new ConnectTo(this); + root = setUpSocket.getFrame(); + } + private static void showGUI() + { + new MainClient(); + } + public static void main(String[] Args) + { + javax.swing.SwingUtilities.invokeLater(new Runnable() + { public void run() {showGUI(); }}); + } + public void setSocket(Socket set) + { + socket = set; + } + public void setAuthType(String auth) + { + authType = auth; + System.err.println(authType); + if(authType.equalsIgnoreCase(NONE)) + { + System.err.println("Setting up Auth"); + NoAccount setUpAuth = new NoAccount(this,socket); + root.setVisible(false); + root = setUpAuth.getFrame(); + } + } + public void setUsername(String name) + { + username = name; + System.err.println(username); + root.setVisible(false); + Lobby lobby = new Lobby(socket,this,username); + root = lobby.getFrame(); + } +} Added: trunk/slac/client/NoAccount.java =================================================================== --- trunk/slac/client/NoAccount.java (rev 0) +++ trunk/slac/client/NoAccount.java 2006-05-26 02:46:16 UTC (rev 15) @@ -0,0 +1,73 @@ +package slac.client; +import java.net.*; +import java.io.*; +import javax.swing.*; +import java.awt.event.*; +import java.awt.*; + +public class NoAccount implements ActionListener +{ + private JFrame root; + private MainClient reference; + private Socket socket; + private JTextField username; + private JButton setUsername; + public NoAccount(MainClient ref,Socket mySocket) + { + reference = ref; + socket = mySocket; + createGUI(); + } + public void actionPerformed(ActionEvent e) + { + if(e.getSource().equals(setUsername)) + { + PrintStream out=null; + BufferedReader in=null; + String response = null; + try + { + out = new PrintStream(socket.getOutputStream(),true); + in = new BufferedReader(new InputStreamReader(socket.getInputStream())); + } + catch (IOException i) + { + System.err.println("Error creating Streams"); + return; + } + out.println(username.getText()); + try + { + response = in.readLine(); + System.out.println(response); + } + catch (IOException i) + {} + if(response.equals("true")) + { + // Accepted + reference.setUsername(username.getText()); + } + else {username.setText("Username In Use");} + } + } + private void createGUI() + { + root = new JFrame(reference.VERSION); + root.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); +// root.setMinimumSize(new Dimension(100,100)); + root.setResizable(false); + root.setLocationRelativeTo(username);//Middle of screen + username = new JTextField("Enter your Username"); + setUsername = new JButton("Accept"); + setUsername.addActionListener(this); + JPanel rootPane = new JPanel (new BorderLayout()); + rootPane.add(username,BorderLayout.WEST); + rootPane.add(setUsername,BorderLayout.EAST); + root.getContentPane().add(rootPane); + root.pack(); + root.setVisible(true); + } + public JFrame getFrame() + {return root;} +} Added: trunk/slac/server/Client.java =================================================================== --- trunk/slac/server/Client.java (rev 0) +++ trunk/slac/server/Client.java 2006-05-26 02:46:16 UTC (rev 15) @@ -0,0 +1,6 @@ +package slac.server; + +public interface Client extends Comparable<Client> +{ + +} Added: trunk/slac/server/DefaultClient.java =================================================================== --- trunk/slac/server/DefaultClient.java (rev 0) +++ trunk/slac/server/DefaultClient.java 2006-05-26 02:46:16 UTC (rev 15) @@ -0,0 +1,31 @@ +package slac.server; +import java.net.*; +// Provides an interface to deal with client threads easier. +public class DefaultClient implements Client +{ + private String username; + private InetSocketAddress ip; + public DefaultClient(String Username,SocketAddress Ip) + { + username = Username; + ip =(InetSocketAddress) Ip; + } + public String getUsername() + {return username;} + public InetSocketAddress getAddress() + {return ip;} + public int compareTo(Client o) + { + DefaultClient compare = (DefaultClient) o; + if (compare.getUsername().equals(this.getUsername())) + { + System.out.println("Same Client"); + return 0; + } + else + { + System.out.println("Different Client"); + return 1; + } + } +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <air...@us...> - 2006-05-26 02:45:38
|
Revision: 14 Author: airpizza Date: 2006-05-25 19:45:29 -0700 (Thu, 25 May 2006) ViewCVS: http://svn.sourceforge.net/slac/?rev=14&view=rev Log Message: ----------- Modified Paths: -------------- trunk/slac/client/Client.java trunk/slac/server/ClientConnectionThread.java trunk/slac/server/Connect.java trunk/slac/server/Server.java Modified: trunk/slac/client/Client.java =================================================================== --- trunk/slac/client/Client.java 2006-05-23 21:54:40 UTC (rev 13) +++ trunk/slac/client/Client.java 2006-05-26 02:45:29 UTC (rev 14) @@ -25,7 +25,7 @@ String fromSocket; String fromKeyboard; boolean running = true; - while (!mySocket.isClosed() && running) + while (running) { if (in.ready())//From Server { @@ -51,6 +51,12 @@ in = new BufferedReader(new InputStreamReader(mySocket.getInputStream())); } else{out.println(fromKeyboard);} + try + { + Thread.currentThread().wait(100); + } + catch (InterruptedException e) + {} } } } Modified: trunk/slac/server/ClientConnectionThread.java =================================================================== --- trunk/slac/server/ClientConnectionThread.java 2006-05-23 21:54:40 UTC (rev 13) +++ trunk/slac/server/ClientConnectionThread.java 2006-05-26 02:45:29 UTC (rev 14) @@ -9,11 +9,15 @@ private BufferedReader in; private PrintStream out; private volatile boolean running; - public ClientConnectionThread(Socket socket, Server ref) + public final String authType; + private String username; + private DefaultClient client; + public ClientConnectionThread(Socket socket, Server ref,String auth) { this.socket = socket; reference = ref; running = true; + authType = auth; try { out = new PrintStream (socket.getOutputStream(),true); @@ -26,33 +30,19 @@ } public void run() { + System.out.println("StartedConnectionThread"+this.toString()); + String outputLine = null; try { - System.out.println("StartedConnectionThread"+this.toString()); - String outputLine = null; - out.println("Welcome to Slac"); - out.println("Just type in something and i'll proccess it"); + out.println(authType); + username = in.readLine(); + client = new DefaultClient(username,socket.getRemoteSocketAddress()); + out.println(reference.addUser(client));//Boolean + // TODO: Make sure the client has the same username + // TODO: Add other auth types to the thread while (socket.isConnected() && running) { - outputLine = in.readLine(); - out.println(outputLine); - System.out.println(outputLine); - if (outputLine.equalsIgnoreCase("Exit")||outputLine.equalsIgnoreCase("Close")) - { - System.out.println("Exiting"+this.toString()); - close(); - /* try - { - in.close(); - socket.close(); - System.out.println("I've closed the socket, joining now"); - join(); - } - catch (Exception e) - { - System.out.println("error exiting"); - }*/ - } + examineMessage(in.readLine()); } in.close(); socket.close(); @@ -62,23 +52,32 @@ e.printStackTrace(); } } - public void close() + public void examineMessage(String message) + {//Has to be a better way to do this?? + if(message.equalsIgnoreCase("Lobby List")) { - try - { - running = false; - out.println("Close"); - out.close(); - System.out.println("Closing in"+this); - in.close(); - System.out.println("Closing the socket"+this); - socket.close(); - System.out.println("Sockets Closed"+this); - reference.removeClient(this); - } - catch (Exception e) - { - System.err.println("Error Closing the thread[CCT.java]"); - } + } + } + + public void close() + { + try + { + running = false; + out.println("Close"); + out.close(); + System.out.println("Closing in"+this); + in.close(); + System.out.println("Closing the socket"+this); + socket.close(); + System.out.println("Sockets Closed"+this); + reference.removeClient(this); + reference.removeUser(client); + } + catch (Exception e) + { + System.err.println("Error Closing the thread[CCT.java]"); + } + } } Modified: trunk/slac/server/Connect.java =================================================================== --- trunk/slac/server/Connect.java 2006-05-23 21:54:40 UTC (rev 13) +++ trunk/slac/server/Connect.java 2006-05-26 02:45:29 UTC (rev 14) @@ -12,10 +12,12 @@ private ServerSocket serverSocket; private Server reference; private ThreadGroup clientThreads; - public Connect(Server ref, int Port) + public final String authType; + public Connect(Server ref, int Port,String auth) { port = Port; reference = ref; + authType = auth; } public void run() { @@ -63,7 +65,7 @@ Thread tempThread = null; try { - temp = new ClientConnectionThread(serverSocket.accept(),reference); + temp = new ClientConnectionThread(serverSocket.accept(),reference,authType); tempThread = new Thread(clientThreads,temp,"ClientConnectionThread"); tempThread.start(); } Modified: trunk/slac/server/Server.java =================================================================== --- trunk/slac/server/Server.java 2006-05-23 21:54:40 UTC (rev 13) +++ trunk/slac/server/Server.java 2006-05-26 02:45:29 UTC (rev 14) @@ -15,17 +15,33 @@ private Connect connect; private boolean running; private Thread connectThread; - + private final String authType; + private TreeSet<Client> userList = new TreeSet<Client>(); public Server(int Port) { - port = Port; - reference = null; - running = true; + this(Port,null); } public Server(int Port,Server s) { + this(Port,s,0); + } + public Server(int Port,int auth) + { + this(Port,null,auth); + } + public Server(int Port,Server s,int auth) + { port = Port; reference = s; + if(auth == 1) + { + authType = "Username"; + } + else if(auth == 1) + { + authType = "Password"; + } + else {authType = "None";} running = true; } public void run() @@ -34,7 +50,7 @@ //setUpPipes();// Not Needed?? //setUpStreams();// Not Needed?? waitForReference(); - connect = new Connect(reference,port); + connect = new Connect(reference,port,authType); connectThread = new Thread(connectThreads,connect,"Server Connection Thread"); connectThread.start(); //dealWithPipe(); // Not needed?? @@ -117,4 +133,12 @@ { clients.remove(obj); } + public synchronized boolean addUser(Client user) + { + return userList.add(user); + } + public synchronized void removeUser(Client user) + { + userList.remove(user); + } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <air...@us...> - 2006-05-23 21:54:50
|
Revision: 13 Author: airpizza Date: 2006-05-23 14:54:40 -0700 (Tue, 23 May 2006) ViewCVS: http://svn.sourceforge.net/slac/?rev=13&view=rev Log Message: ----------- Modified Paths: -------------- trunk/slac/client/Client.java trunk/slac/server/ClientConnectionThread.java trunk/slac/server/ClientInterface.java trunk/slac/server/Connect.java trunk/slac/server/Server.java trunk/slac/server/ServerLoader.java Modified: trunk/slac/client/Client.java =================================================================== --- trunk/slac/client/Client.java 2006-05-20 20:17:18 UTC (rev 12) +++ trunk/slac/client/Client.java 2006-05-23 21:54:40 UTC (rev 13) @@ -24,14 +24,20 @@ BufferedReader keyboard = new BufferedReader(new InputStreamReader(System.in)); String fromSocket; String fromKeyboard; - while (!mySocket.isClosed()) + boolean running = true; + while (!mySocket.isClosed() && running) { - if (in.ready()) + if (in.ready())//From Server { fromSocket = in.readLine(); System.out.println("Recieved: "+fromSocket); + if (fromSocket.equalsIgnoreCase("Close")||fromSocket.equalsIgnoreCase("\0")) + { + running = false; + System.out.println("Exiting"); + } } - if (keyboard.ready()) + if (keyboard.ready())//To Server { fromKeyboard = keyboard.readLine(); System.out.println("You Typed: "+fromKeyboard); @@ -44,16 +50,6 @@ out = new PrintStream(mySocket.getOutputStream(), true); in = new BufferedReader(new InputStreamReader(mySocket.getInputStream())); } - else if (fromKeyboard.equals("exit")||fromKeyboard.equals("Exit")) - { - out.println(fromKeyboard); - mySocket.close(); - System.exit(0); - } - else if(fromKeyboard.equals("send")||fromKeyboard.equals("Send")) - { - out.println(new Client()); - } else{out.println(fromKeyboard);} } } Modified: trunk/slac/server/ClientConnectionThread.java =================================================================== --- trunk/slac/server/ClientConnectionThread.java 2006-05-20 20:17:18 UTC (rev 12) +++ trunk/slac/server/ClientConnectionThread.java 2006-05-23 21:54:40 UTC (rev 13) @@ -2,17 +2,18 @@ import java.net.*; import java.io.*; -public class ClientConnectionThread extends Thread implements Serializable +public class ClientConnectionThread implements Serializable, Runnable { private Socket socket = null; private Server reference; private BufferedReader in; private PrintStream out; + private volatile boolean running; public ClientConnectionThread(Socket socket, Server ref) { - super ("ClientConnection"+socket.toString()); this.socket = socket; reference = ref; + running = true; try { out = new PrintStream (socket.getOutputStream(),true); @@ -31,12 +32,12 @@ String outputLine = null; out.println("Welcome to Slac"); out.println("Just type in something and i'll proccess it"); - while (socket.isConnected()) + while (socket.isConnected() && running) { outputLine = in.readLine(); out.println(outputLine); System.out.println(outputLine); - if (outputLine.equals("Exit") || outputLine.equals("exit")) + if (outputLine.equalsIgnoreCase("Exit")||outputLine.equalsIgnoreCase("Close")) { System.out.println("Exiting"+this.toString()); close(); @@ -65,17 +66,19 @@ { try { - System.out.println("Closing in"); + running = false; + out.println("Close"); + out.close(); + System.out.println("Closing in"+this); in.close(); - System.out.println("Closing the socket"); + System.out.println("Closing the socket"+this); socket.close(); - System.out.println("Sockets Closed"); + System.out.println("Sockets Closed"+this); reference.removeClient(this); - join(); } catch (Exception e) { - System.err.println("Error Closing the thread"); + System.err.println("Error Closing the thread[CCT.java]"); } } } Modified: trunk/slac/server/ClientInterface.java =================================================================== --- trunk/slac/server/ClientInterface.java 2006-05-20 20:17:18 UTC (rev 12) +++ trunk/slac/server/ClientInterface.java 2006-05-23 21:54:40 UTC (rev 13) @@ -1,2 +1,8 @@ +package slac.server; + public interface ClientInterface -{} +{ + + + +} Modified: trunk/slac/server/Connect.java =================================================================== --- trunk/slac/server/Connect.java 2006-05-20 20:17:18 UTC (rev 12) +++ trunk/slac/server/Connect.java 2006-05-23 21:54:40 UTC (rev 13) @@ -3,7 +3,7 @@ import java.net.*; import java.io.*; -public class Connect extends Thread +public class Connect implements Runnable { private BufferedReader serverArgs; private int port; @@ -11,14 +11,15 @@ private boolean listening; private ServerSocket serverSocket; private Server reference; + private ThreadGroup clientThreads; public Connect(Server ref, int Port) { - super ("Accepting Connections"); port = Port; reference = ref; } public void run() { + clientThreads = new ThreadGroup(Thread.currentThread().getThreadGroup(),"Client Threads"); serverSocket = null; listening = true; //getPrefs("prefs.ini"); @@ -26,17 +27,21 @@ System.out.println(port); try { - serverSocket = new ServerSocket(port,10000); + serverSocket = new ServerSocket(port);// 50 max queue'd connections } catch (IOException e) { - System.err.println("Error creating socket on port"+port); + System.err.println("[Connect.java]Error creating socket on port"+port); close(); } while (listening) { // ClientConnectionThread temp = new ClientConnectionThread(serverSocket.accept()); - reference.addClient(startNewClient()); + ClientConnectionThread tempClient = startNewClient(); + if(tempClient!=null) + { + reference.addClient(tempClient); + } } } private void getPrefs(String filename) @@ -49,35 +54,39 @@ } catch (IOException e) { - System.err.println("Invalid File"); + System.err.println("Invalid File[Connect.java]"); } } - private ClientConnectionThread startNewClient() + private ClientConnectionThread startNewClient() + { + ClientConnectionThread temp = null; + Thread tempThread = null; + try { - ClientConnectionThread temp= null; - try - { temp = new ClientConnectionThread(serverSocket.accept(),reference); - temp.start(); - } + tempThread = new Thread(clientThreads,temp,"ClientConnectionThread"); + tempThread.start(); + } catch(IOException e) { - System.err.println("Error creating thread"); + System.err.println("Error creating thread[Connect.java]"); } return temp; } public void close() { - System.out.println("Setting Listening to false"); + System.out.println("Setting Listening to false[Connect.java]"); listening = false; try { - System.out.println("Closing the serverSocket"); + System.out.println("Closing the serverSocket[Connect.java]"); serverSocket.close(); } catch (IOException e) { - System.out.println("Error Closing the serverSocket"); + System.out.println("Error Closing the serverSocket[Connect.java]"); } + clientThreads.list(); + System.out.println("Active Threads[Connect.java]"+clientThreads.activeCount()); } } Modified: trunk/slac/server/Server.java =================================================================== --- trunk/slac/server/Server.java 2006-05-20 20:17:18 UTC (rev 12) +++ trunk/slac/server/Server.java 2006-05-23 21:54:40 UTC (rev 13) @@ -1,10 +1,11 @@ package slac.server; import java.util.*; import java.io.*; -public class Server extends Thread +public class Server implements Runnable { // Stores all of the clients into a treeset - Vector<ClientConnectionThread> clients = new Vector<ClientConnectionThread>(); + private volatile Vector<ClientConnectionThread> clients = new Vector<ClientConnectionThread>(); + private ThreadGroup connectThreads; private ObjectOutputStream objOut; private ObjectInputStream objIn; private PipedInputStream pipeIn; @@ -13,6 +14,8 @@ private int port; private Connect connect; private boolean running; + private Thread connectThread; + public Server(int Port) { port = Port; @@ -27,12 +30,14 @@ } public void run() { - setUpPipes(); - setUpStreams(); + connectThreads= new ThreadGroup(Thread.currentThread().getThreadGroup(),"Connects"); + //setUpPipes();// Not Needed?? + //setUpStreams();// Not Needed?? waitForReference(); connect = new Connect(reference,port); - connect.start(); - dealWithPipe(); + connectThread = new Thread(connectThreads,connect,"Server Connection Thread"); + connectThread.start(); + //dealWithPipe(); // Not needed?? } private void dealWithPipe() { @@ -89,25 +94,24 @@ public void addReference(Server server) { reference = server; - System.out.println(this +" This"); - System.out.println(reference +" Reference"); - System.out.println(server +" Server"); } public void stopServer() { - System.out.println("Exiting...."); - connect.interrupt(); + System.out.println("Exiting....[Server.java]"); + connectThread.interrupt(); connect.close(); - System.out.println("Setting running to false"); + System.out.println("Setting running to false[Server.java]"); running = false; System.out.println("Removing clients from list"); - for (int i = 0;i<clients.size();i++) + System.out.println("Clients in Array"+clients); + while(clients.size()>0) { - System.out.println("Removing: "+i); - ClientConnectionThread tmp = clients.remove(i); - //tmp.interrupt(); + System.out.println("[Server.java]Removing: "+clients.get(0)); + ClientConnectionThread tmp = clients.remove(0); tmp.close(); } + connectThreads.list(); + System.out.println("Active[server.java]"+connectThreads.activeGroupCount()); } public void removeClient(ClientConnectionThread obj) { Modified: trunk/slac/server/ServerLoader.java =================================================================== --- trunk/slac/server/ServerLoader.java 2006-05-20 20:17:18 UTC (rev 12) +++ trunk/slac/server/ServerLoader.java 2006-05-23 21:54:40 UTC (rev 13) @@ -10,6 +10,7 @@ String cmdlist = "start, stop, list, shutdown"; boolean running = true; Vector<Server> serverList= new Vector<Server>(); + ThreadGroup serverThreads = new ThreadGroup("Server Group"); BufferedReader keyboard = new BufferedReader(new InputStreamReader(System.in)); int port = 4444; System.out.println(motd); @@ -22,9 +23,8 @@ Server temp = new Server(port); port ++; serverList.add(temp); - temp.start(); + new Thread(serverThreads,temp).start(); temp.addReference(temp); - temp = null; } else if (input.trim().equalsIgnoreCase("stop")) { @@ -35,7 +35,7 @@ } int i = Integer.parseInt(keyboard.readLine()); System.out.println("I: "+i); - Server remove = serverList.remove(i); + Server remove =(Server) serverList.remove(i); remove.stopServer(); System.gc(); System.out.println("GC Done"); @@ -51,8 +51,7 @@ { for (int i = 0; i < serverList.size(); i ++) { - Server remove = serverList.remove(i); - remove.stopServer(); + serverList.remove(i).stopServer(); } running = false; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <air...@us...> - 2006-05-20 20:17:23
|
Revision: 12 Author: airpizza Date: 2006-05-20 13:17:18 -0700 (Sat, 20 May 2006) ViewCVS: http://svn.sourceforge.net/slac/?rev=12&view=rev Log Message: ----------- Modified Paths: -------------- trunk/slac/server/ClientConnectionThread.java trunk/slac/server/Server.java trunk/slac/server/ServerLoader.java Modified: trunk/slac/server/ClientConnectionThread.java =================================================================== --- trunk/slac/server/ClientConnectionThread.java 2006-05-20 20:04:31 UTC (rev 11) +++ trunk/slac/server/ClientConnectionThread.java 2006-05-20 20:17:18 UTC (rev 12) @@ -2,7 +2,6 @@ import java.net.*; import java.io.*; -import slac.server.*; public class ClientConnectionThread extends Thread implements Serializable { private Socket socket = null; Modified: trunk/slac/server/Server.java =================================================================== --- trunk/slac/server/Server.java 2006-05-20 20:04:31 UTC (rev 11) +++ trunk/slac/server/Server.java 2006-05-20 20:17:18 UTC (rev 12) @@ -4,7 +4,7 @@ public class Server extends Thread { // Stores all of the clients into a treeset - Vector<ClientConnectionThread> clients = new Vector(); + Vector<ClientConnectionThread> clients = new Vector<ClientConnectionThread>(); private ObjectOutputStream objOut; private ObjectInputStream objIn; private PipedInputStream pipeIn; Modified: trunk/slac/server/ServerLoader.java =================================================================== --- trunk/slac/server/ServerLoader.java 2006-05-20 20:04:31 UTC (rev 11) +++ trunk/slac/server/ServerLoader.java 2006-05-20 20:17:18 UTC (rev 12) @@ -1,15 +1,19 @@ package slac.server; import java.io.*; import java.util.*; -import slac.server.Server; public class ServerLoader { public static void main(String [] args) throws IOException { + String motd = "Welcome to the Slac Server Loader Interface"+"\n" + +"Possible Commands are:"; + String cmdlist = "start, stop, list, shutdown"; boolean running = true; Vector<Server> serverList= new Vector<Server>(); BufferedReader keyboard = new BufferedReader(new InputStreamReader(System.in)); int port = 4444; + System.out.println(motd); + System.out.println(cmdlist); while (running) { String input = keyboard.readLine(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <air...@us...> - 2006-05-20 20:04:35
|
Revision: 11 Author: airpizza Date: 2006-05-20 13:04:31 -0700 (Sat, 20 May 2006) ViewCVS: http://svn.sourceforge.net/slac/?rev=11&view=rev Log Message: ----------- Added Paths: ----------- trunk/slac/client/ trunk/slac/client/Client.java trunk/slac/client/StressTest.java Added: trunk/slac/client/Client.java =================================================================== --- trunk/slac/client/Client.java (rev 0) +++ trunk/slac/client/Client.java 2006-05-20 20:04:31 UTC (rev 11) @@ -0,0 +1,61 @@ +import java.io.*; +import java.net.*; + +public class Client +{ + public static void main (String [] args) throws IOException + { + Socket mySocket = null; + PrintStream out = null; + BufferedReader in = null; + + try + { + mySocket = new Socket(); + mySocket.connect(new InetSocketAddress("localhost",4444)); + out = new PrintStream(mySocket.getOutputStream(), true); + in = new BufferedReader(new InputStreamReader(mySocket.getInputStream())); + } + catch (IOException e) + { + System.err.println("Unable to connect to localhost on 4444"); + System.exit(-1); + } + BufferedReader keyboard = new BufferedReader(new InputStreamReader(System.in)); + String fromSocket; + String fromKeyboard; + while (!mySocket.isClosed()) + { + if (in.ready()) + { + fromSocket = in.readLine(); + System.out.println("Recieved: "+fromSocket); + } + if (keyboard.ready()) + { + fromKeyboard = keyboard.readLine(); + System.out.println("You Typed: "+fromKeyboard); + if(fromKeyboard.equals("connect")) + { + System.out.print("Hostname? "); + mySocket.close(); + mySocket = new Socket(); + mySocket.connect(new InetSocketAddress("localhost",4444)); + out = new PrintStream(mySocket.getOutputStream(), true); + in = new BufferedReader(new InputStreamReader(mySocket.getInputStream())); + } + else if (fromKeyboard.equals("exit")||fromKeyboard.equals("Exit")) + { + out.println(fromKeyboard); + mySocket.close(); + System.exit(0); + } + else if(fromKeyboard.equals("send")||fromKeyboard.equals("Send")) + { + out.println(new Client()); + } + else{out.println(fromKeyboard);} + } + } + } +} Added: trunk/slac/client/StressTest.java =================================================================== --- trunk/slac/client/StressTest.java (rev 0) +++ trunk/slac/client/StressTest.java 2006-05-20 20:04:31 UTC (rev 11) @@ -0,0 +1,33 @@ +import java.io.*; +import java.net.*; + +public class StressTest +{ + public static void main (String [] args) throws IOException + { + Socket mySocket = null; + PrintWriter out = null; + BufferedReader in = null; + try + { + mySocket = new Socket(); + mySocket.connect(new InetSocketAddress("localhost",4444)); + out = new PrintWriter(mySocket.getOutputStream(), true); + in = new BufferedReader(new InputStreamReader(mySocket.getInputStream())); + } + catch (IOException e) + { + System.err.println("Unable to connect to localhost on 4444"); + System.exit(1); + } + BufferedReader keyboard = new BufferedReader(new InputStreamReader(System.in)); + String fromServer; + String fromKeyboard; + while (mySocket != null) + { + mySocket.close(); + mySocket = new Socket(); + mySocket.connect(new InetSocketAddress("localhost",4444)); + } + } +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <air...@us...> - 2006-05-20 20:04:02
|
Revision: 10 Author: airpizza Date: 2006-05-20 13:03:57 -0700 (Sat, 20 May 2006) ViewCVS: http://svn.sourceforge.net/slac/?rev=10&view=rev Log Message: ----------- Added Paths: ----------- trunk/slac/server/ trunk/slac/server/ClientConnectionThread.java trunk/slac/server/ClientInterface.java trunk/slac/server/Connect.java trunk/slac/server/MANIFEST.MF trunk/slac/server/Server.java trunk/slac/server/ServerLoader.java trunk/slac/server/prefs.ini Added: trunk/slac/server/ClientConnectionThread.java =================================================================== --- trunk/slac/server/ClientConnectionThread.java (rev 0) +++ trunk/slac/server/ClientConnectionThread.java 2006-05-20 20:03:57 UTC (rev 10) @@ -0,0 +1,82 @@ +package slac.server; + +import java.net.*; +import java.io.*; +import slac.server.*; +public class ClientConnectionThread extends Thread implements Serializable +{ + private Socket socket = null; + private Server reference; + private BufferedReader in; + private PrintStream out; + public ClientConnectionThread(Socket socket, Server ref) + { + super ("ClientConnection"+socket.toString()); + this.socket = socket; + reference = ref; + try + { + out = new PrintStream (socket.getOutputStream(),true); + in = new BufferedReader(new InputStreamReader(socket.getInputStream())); + } + catch (IOException e) + { + System.out.println("Error setting up the streams"); + } + } + public void run() + { + try + { + System.out.println("StartedConnectionThread"+this.toString()); + String outputLine = null; + out.println("Welcome to Slac"); + out.println("Just type in something and i'll proccess it"); + while (socket.isConnected()) + { + outputLine = in.readLine(); + out.println(outputLine); + System.out.println(outputLine); + if (outputLine.equals("Exit") || outputLine.equals("exit")) + { + System.out.println("Exiting"+this.toString()); + close(); + /* try + { + in.close(); + socket.close(); + System.out.println("I've closed the socket, joining now"); + join(); + } + catch (Exception e) + { + System.out.println("error exiting"); + }*/ + } + } + in.close(); + socket.close(); + } + catch (IOException e) + { + e.printStackTrace(); + } + } + public void close() + { + try + { + System.out.println("Closing in"); + in.close(); + System.out.println("Closing the socket"); + socket.close(); + System.out.println("Sockets Closed"); + reference.removeClient(this); + join(); + } + catch (Exception e) + { + System.err.println("Error Closing the thread"); + } + } +} Added: trunk/slac/server/ClientInterface.java =================================================================== --- trunk/slac/server/ClientInterface.java (rev 0) +++ trunk/slac/server/ClientInterface.java 2006-05-20 20:03:57 UTC (rev 10) @@ -0,0 +1,2 @@ +public interface ClientInterface +{} Added: trunk/slac/server/Connect.java =================================================================== --- trunk/slac/server/Connect.java (rev 0) +++ trunk/slac/server/Connect.java 2006-05-20 20:03:57 UTC (rev 10) @@ -0,0 +1,83 @@ +package slac.server; + +import java.net.*; +import java.io.*; + +public class Connect extends Thread +{ + private BufferedReader serverArgs; + private int port; + private int number; + private boolean listening; + private ServerSocket serverSocket; + private Server reference; + public Connect(Server ref, int Port) + { + super ("Accepting Connections"); + port = Port; + reference = ref; + } + public void run() + { + serverSocket = null; + listening = true; + //getPrefs("prefs.ini"); + number=0; + System.out.println(port); + try + { + serverSocket = new ServerSocket(port,10000); + } + catch (IOException e) + { + System.err.println("Error creating socket on port"+port); + close(); + } + while (listening) + { + // ClientConnectionThread temp = new ClientConnectionThread(serverSocket.accept()); + reference.addClient(startNewClient()); + } + } + private void getPrefs(String filename) + { + try + { + serverArgs = new BufferedReader(new FileReader(filename)); + port = Integer.parseInt(serverArgs.readLine()); + serverArgs.close(); + } + catch (IOException e) + { + System.err.println("Invalid File"); + } + } + private ClientConnectionThread startNewClient() + { + ClientConnectionThread temp= null; + try + { + temp = new ClientConnectionThread(serverSocket.accept(),reference); + temp.start(); + } + catch(IOException e) + { + System.err.println("Error creating thread"); + } + return temp; + } + public void close() + { + System.out.println("Setting Listening to false"); + listening = false; + try + { + System.out.println("Closing the serverSocket"); + serverSocket.close(); + } + catch (IOException e) + { + System.out.println("Error Closing the serverSocket"); + } + } +} Added: trunk/slac/server/MANIFEST.MF =================================================================== --- trunk/slac/server/MANIFEST.MF (rev 0) +++ trunk/slac/server/MANIFEST.MF 2006-05-20 20:03:57 UTC (rev 10) @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +Created-By: Airpizza (air...@sf...) +Main-Class: slac.server.Connect Added: trunk/slac/server/Server.java =================================================================== --- trunk/slac/server/Server.java (rev 0) +++ trunk/slac/server/Server.java 2006-05-20 20:03:57 UTC (rev 10) @@ -0,0 +1,116 @@ +package slac.server; +import java.util.*; +import java.io.*; +public class Server extends Thread +{ + // Stores all of the clients into a treeset + Vector<ClientConnectionThread> clients = new Vector(); + private ObjectOutputStream objOut; + private ObjectInputStream objIn; + private PipedInputStream pipeIn; + private PipedOutputStream pipeOut; + private Server reference; + private int port; + private Connect connect; + private boolean running; + public Server(int Port) + { + port = Port; + reference = null; + running = true; + } + public Server(int Port,Server s) + { + port = Port; + reference = s; + running = true; + } + public void run() + { + setUpPipes(); + setUpStreams(); + waitForReference(); + connect = new Connect(reference,port); + connect.start(); + dealWithPipe(); + } + private void dealWithPipe() + { + while(running) + { + try + { + Object temp = objIn.readObject(); + System.out.println(temp.getClass().getName()); + //if(temp.getClass().equals(ClientConnectionThread)) + //{ + // clients.add(temp); + // System.out.println("Added"+temp); + + // } + } + catch (IOException e) + {System.err.println("Error Reading ObjectStream");} + catch (ClassNotFoundException e) + {System.err.println("ClassNotFound");} + } + System.out.println("Exiting dealwithPipe()"); + } + private void setUpPipes() + { + try + { + pipeIn = new PipedInputStream(); + pipeOut = new PipedOutputStream(pipeIn); + pipeIn.connect(pipeOut); + } + catch(IOException e) {} + } + private void setUpStreams() + { + try + { + objOut = new ObjectOutputStream(pipeOut); + objIn = new ObjectInputStream(pipeIn); + } + catch (IOException e) + { + } + } + public void addClient(ClientConnectionThread newClient) + { + clients.add(newClient); + System.out.println(newClient+"Added to list"); + } + public void waitForReference() + { + while (reference == null); + } + public void addReference(Server server) + { + reference = server; + System.out.println(this +" This"); + System.out.println(reference +" Reference"); + System.out.println(server +" Server"); + } + public void stopServer() + { + System.out.println("Exiting...."); + connect.interrupt(); + connect.close(); + System.out.println("Setting running to false"); + running = false; + System.out.println("Removing clients from list"); + for (int i = 0;i<clients.size();i++) + { + System.out.println("Removing: "+i); + ClientConnectionThread tmp = clients.remove(i); + //tmp.interrupt(); + tmp.close(); + } + } + public void removeClient(ClientConnectionThread obj) + { + clients.remove(obj); + } +} Added: trunk/slac/server/ServerLoader.java =================================================================== --- trunk/slac/server/ServerLoader.java (rev 0) +++ trunk/slac/server/ServerLoader.java 2006-05-20 20:03:57 UTC (rev 10) @@ -0,0 +1,59 @@ +package slac.server; +import java.io.*; +import java.util.*; +import slac.server.Server; +public class ServerLoader +{ + public static void main(String [] args) throws IOException + { + boolean running = true; + Vector<Server> serverList= new Vector<Server>(); + BufferedReader keyboard = new BufferedReader(new InputStreamReader(System.in)); + int port = 4444; + while (running) + { + String input = keyboard.readLine(); + if (input.trim().equalsIgnoreCase("start")) + { + Server temp = new Server(port); + port ++; + serverList.add(temp); + temp.start(); + temp.addReference(temp); + temp = null; + } + else if (input.trim().equalsIgnoreCase("stop")) + { + System.out.println("Which Server?"); + for (int i = 0; i<serverList.size();i++) + { + System.out.println(i+": "+serverList.get(i)); + } + int i = Integer.parseInt(keyboard.readLine()); + System.out.println("I: "+i); + Server remove = serverList.remove(i); + remove.stopServer(); + System.gc(); + System.out.println("GC Done"); + } + else if (input.trim().equalsIgnoreCase("List")) + { + for (int i =0; i < serverList.size(); i ++) + { + System.out.println(i+": "+serverList.get(i)); + } + } + else if (input.trim().equalsIgnoreCase("Shutdown")) + { + for (int i = 0; i < serverList.size(); i ++) + { + Server remove = serverList.remove(i); + remove.stopServer(); + } + running = false; + } + } + System.exit(0); + } +} + Added: trunk/slac/server/prefs.ini =================================================================== --- trunk/slac/server/prefs.ini (rev 0) +++ trunk/slac/server/prefs.ini 2006-05-20 20:03:57 UTC (rev 10) @@ -0,0 +1 @@ +4444 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <air...@us...> - 2006-05-20 20:02:29
|
Revision: 9 Author: airpizza Date: 2006-05-20 13:02:23 -0700 (Sat, 20 May 2006) ViewCVS: http://svn.sourceforge.net/slac/?rev=9&view=rev Log Message: ----------- Added Paths: ----------- trunk/slac/ Removed Paths: ------------- trunk/client/ trunk/server/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <air...@us...> - 2006-05-20 19:43:26
|
Revision: 8 Author: airpizza Date: 2006-05-20 12:43:16 -0700 (Sat, 20 May 2006) ViewCVS: http://svn.sourceforge.net/slac/?rev=8&view=rev Log Message: ----------- Modified Paths: -------------- trunk/client/Client.java trunk/server/ClientConnectionThread.java trunk/server/Connect.java trunk/server/ServerLoader.java Modified: trunk/client/Client.java =================================================================== --- trunk/client/Client.java 2006-05-20 18:13:53 UTC (rev 7) +++ trunk/client/Client.java 2006-05-20 19:43:16 UTC (rev 8) @@ -6,48 +6,56 @@ public static void main (String [] args) throws IOException { Socket mySocket = null; - PrintWriter out = null; + PrintStream out = null; BufferedReader in = null; - + try { mySocket = new Socket(); mySocket.connect(new InetSocketAddress("localhost",4444)); - out = new PrintWriter(mySocket.getOutputStream(), true); + out = new PrintStream(mySocket.getOutputStream(), true); in = new BufferedReader(new InputStreamReader(mySocket.getInputStream())); } catch (IOException e) { System.err.println("Unable to connect to localhost on 4444"); - System.exit(1); + System.exit(-1); } BufferedReader keyboard = new BufferedReader(new InputStreamReader(System.in)); - String fromServer; + String fromSocket; String fromKeyboard; - while (mySocket != null) + while (!mySocket.isClosed()) { - fromKeyboard = keyboard.readLine(); - System.out.println("You Typed: "+fromKeyboard); - if(fromKeyboard.equals("connect")) + if (in.ready()) { - System.out.print("Hostname? "); - mySocket.close(); - mySocket = new Socket(); - mySocket.connect(new InetSocketAddress("localhost",4444)); - out = new PrintWriter(mySocket.getOutputStream(), true); - in = new BufferedReader(new InputStreamReader(mySocket.getInputStream())); + fromSocket = in.readLine(); + System.out.println("Recieved: "+fromSocket); } - else if (fromKeyboard.equals("exit")||fromKeyboard.equals("Exit")) + if (keyboard.ready()) { - out.println(fromKeyboard); - mySocket.close(); - System.exit(1); + fromKeyboard = keyboard.readLine(); + System.out.println("You Typed: "+fromKeyboard); + if(fromKeyboard.equals("connect")) + { + System.out.print("Hostname? "); + mySocket.close(); + mySocket = new Socket(); + mySocket.connect(new InetSocketAddress("localhost",4444)); + out = new PrintStream(mySocket.getOutputStream(), true); + in = new BufferedReader(new InputStreamReader(mySocket.getInputStream())); + } + else if (fromKeyboard.equals("exit")||fromKeyboard.equals("Exit")) + { + out.println(fromKeyboard); + mySocket.close(); + System.exit(0); + } + else if(fromKeyboard.equals("send")||fromKeyboard.equals("Send")) + { + out.println(new Client()); + } + else{out.println(fromKeyboard);} } - else if(fromKeyboard.equals("send")||fromKeyboard.equals("Send")) - { - out.print(new Client()); - } - else{out.println(fromKeyboard);} } } } Modified: trunk/server/ClientConnectionThread.java =================================================================== --- trunk/server/ClientConnectionThread.java 2006-05-20 18:13:53 UTC (rev 7) +++ trunk/server/ClientConnectionThread.java 2006-05-20 19:43:16 UTC (rev 8) @@ -6,36 +6,50 @@ private Socket socket = null; private Server reference; private BufferedReader in; + private PrintStream out; public ClientConnectionThread(Socket socket, Server ref) { super ("ClientConnection"+socket.toString()); this.socket = socket; reference = ref; + try + { + out = new PrintStream (socket.getOutputStream(),true); + in = new BufferedReader(new InputStreamReader(socket.getInputStream())); + } + catch (IOException e) + { + System.out.println("Error setting up the streams"); + } } public void run() { try { System.out.println("StartedConnectionThread"+this.toString()); - in = new BufferedReader(new InputStreamReader(socket.getInputStream())); String outputLine = null; + out.println("Welcome to Slac"); + out.println("Just type in something and i'll proccess it"); while (socket.isConnected()) { outputLine = in.readLine(); + out.println(outputLine); System.out.println(outputLine); if (outputLine.equals("Exit") || outputLine.equals("exit")) { System.out.println("Exiting"+this.toString()); - try + close(); + /* try { in.close(); socket.close(); + System.out.println("I've closed the socket, joining now"); join(); } catch (Exception e) { - System.out.println("error"); - } + System.out.println("error exiting"); + }*/ } } in.close(); @@ -50,8 +64,12 @@ { try { + System.out.println("Closing in"); in.close(); + System.out.println("Closing the socket"); socket.close(); + System.out.println("Sockets Closed"); + reference.removeClient(this); join(); } catch (Exception e) Modified: trunk/server/Connect.java =================================================================== --- trunk/server/Connect.java 2006-05-20 18:13:53 UTC (rev 7) +++ trunk/server/Connect.java 2006-05-20 19:43:16 UTC (rev 8) @@ -26,7 +26,7 @@ System.out.println(port); try { - serverSocket = new ServerSocket(port); + serverSocket = new ServerSocket(port,10000); } catch (IOException e) { Modified: trunk/server/ServerLoader.java =================================================================== --- trunk/server/ServerLoader.java 2006-05-20 18:13:53 UTC (rev 7) +++ trunk/server/ServerLoader.java 2006-05-20 19:43:16 UTC (rev 8) @@ -5,13 +5,14 @@ { public static void main(String [] args) throws IOException { + boolean running = true; Vector<Server> serverList= new Vector<Server>(); BufferedReader keyboard = new BufferedReader(new InputStreamReader(System.in)); int port = 4444; - while (true) + while (running) { String input = keyboard.readLine(); - if (input.equalsIgnoreCase("New server")) + if (input.trim().equalsIgnoreCase("start")) { Server temp = new Server(port); port ++; @@ -20,7 +21,7 @@ temp.addReference(temp); temp = null; } - else if (input.equalsIgnoreCase("Stop Server")) + else if (input.trim().equalsIgnoreCase("stop")) { System.out.println("Which Server?"); for (int i = 0; i<serverList.size();i++) @@ -34,7 +35,24 @@ System.gc(); System.out.println("GC Done"); } + else if (input.trim().equalsIgnoreCase("List")) + { + for (int i =0; i < serverList.size(); i ++) + { + System.out.println(i+": "+serverList.get(i)); + } + } + else if (input.trim().equalsIgnoreCase("Shutdown")) + { + for (int i = 0; i < serverList.size(); i ++) + { + Server remove = serverList.remove(i); + remove.stopServer(); + } + running = false; + } } + System.exit(0); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <air...@us...> - 2006-05-20 18:14:00
|
Revision: 7 Author: airpizza Date: 2006-05-20 11:13:53 -0700 (Sat, 20 May 2006) ViewCVS: http://svn.sourceforge.net/slac/?rev=7&view=rev Log Message: ----------- Modified Paths: -------------- trunk/client/Client.java Added Paths: ----------- trunk/gpl.txt trunk/lgpl.txt Modified: trunk/client/Client.java =================================================================== --- trunk/client/Client.java 2006-05-20 18:06:09 UTC (rev 6) +++ trunk/client/Client.java 2006-05-20 18:13:53 UTC (rev 7) @@ -8,6 +8,7 @@ Socket mySocket = null; PrintWriter out = null; BufferedReader in = null; + try { mySocket = new Socket(); @@ -42,6 +43,10 @@ mySocket.close(); System.exit(1); } + else if(fromKeyboard.equals("send")||fromKeyboard.equals("Send")) + { + out.print(new Client()); + } else{out.println(fromKeyboard);} } } Added: trunk/gpl.txt =================================================================== --- trunk/gpl.txt (rev 0) +++ trunk/gpl.txt 2006-05-20 18:13:53 UTC (rev 7) @@ -0,0 +1,340 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + <one line to give the program's name and a brief idea of what it does.> + Copyright (C) <year> <name of author> + + 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + <signature of Ty Coon>, 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. Added: trunk/lgpl.txt =================================================================== --- trunk/lgpl.txt (rev 0) +++ trunk/lgpl.txt 2006-05-20 18:13:53 UTC (rev 7) @@ -0,0 +1,504 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations below. + + When we speak of free software, we are referring to freedom of use, +not price. Our General Public Licenses are designed to make sure that +you have the freedom to distribute copies of free software (and charge +for this service if you wish); that you receive source code or can get +it if you want it; that you can change the software and use pieces of +it in new free programs; and that you are informed that you can do +these things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it becomes +a de-facto standard. To achieve this, non-free programs must be +allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. + + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also combine or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the materials to be distributed need not include anything that is +normally distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties with +this License. + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Lesser General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Libraries + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms of the +ordinary General Public License). + + To apply these terms, attach the following notices to the library. It is +safest to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + <one line to give the library's name and a brief idea of what it does.> + Copyright (C) <year> <name of author> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the library, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James Random Hacker. + + <signature of Ty Coon>, 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! + + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |