📄 server.html
字号:
</DL>
<HR>
<A NAME="threads"><!-- --></A><H3>
threads</H3>
<PRE>
public static <A HREF="ClientHandleThread.html" title="class in <Unnamed>">ClientHandleThread</A>[] <B>threads</B></PRE>
<DL>
<DD>The array holding multiple threads handling various clients
<P>
<DL>
</DL>
</DL>
<HR>
<A NAME="names"><!-- --></A><H3>
names</H3>
<PRE>
public static java.lang.String[] <B>names</B></PRE>
<DL>
<DD>The name of each client
<P>
<DL>
</DL>
</DL>
<HR>
<A NAME="scores"><!-- --></A><H3>
scores</H3>
<PRE>
public static int[] <B>scores</B></PRE>
<DL>
<DD>The score of each client
<P>
<DL>
</DL>
</DL>
<HR>
<A NAME="orders"><!-- --></A><H3>
orders</H3>
<PRE>
public static int[] <B>orders</B></PRE>
<DL>
<DD>The ranking order, holding the competition places of each client
<P>
<DL>
</DL>
</DL>
<HR>
<A NAME="over"><!-- --></A><H3>
over</H3>
<PRE>
public static boolean[] <B>over</B></PRE>
<DL>
<DD>Holding game over information of each client
<P>
<DL>
</DL>
</DL>
<HR>
<A NAME="currentTime"><!-- --></A><H3>
currentTime</H3>
<PRE>
public static long <B>currentTime</B></PRE>
<DL>
<DL>
</DL>
</DL>
<HR>
<A NAME="gameBegin"><!-- --></A><H3>
gameBegin</H3>
<PRE>
public static boolean <B>gameBegin</B></PRE>
<DL>
<DD>The flag indicating whether the game has begun
<P>
<DL>
</DL>
</DL>
<HR>
<A NAME="AllAreOver"><!-- --></A><H3>
AllAreOver</H3>
<PRE>
public static boolean <B>AllAreOver</B></PRE>
<DL>
<DD>The flag indicating whether all the clients' games are over
<P>
<DL>
</DL>
</DL>
<HR>
<A NAME="gameTimer"><!-- --></A><H3>
gameTimer</H3>
<PRE>
public static GameTimer <B>gameTimer</B></PRE>
<DL>
<DD>The timer used for timing
<P>
<DL>
</DL>
</DL>
<!-- ========= 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="Server()"><!-- --></A><H3>
Server</H3>
<PRE>
public <B>Server</B>()</PRE>
<DL>
<DD>The constructor
<P>
</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="run()"><!-- --></A><H3>
run</H3>
<PRE>
public void <B>run</B>()</PRE>
<DL>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE>run</CODE> in interface <CODE>java.lang.Runnable</CODE><DT><B>Overrides:</B><DD><CODE>run</CODE> in class <CODE>java.lang.Thread</CODE></DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="startUp()"><!-- --></A><H3>
startUp</H3>
<PRE>
public void <B>startUp</B>()</PRE>
<DL>
<DD>Start up the server
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="GameStart()"><!-- --></A><H3>
GameStart</H3>
<PRE>
public static void <B>GameStart</B>()</PRE>
<DL>
<DD>Send the game starting information to all the clients
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="GameOver()"><!-- --></A><H3>
GameOver</H3>
<PRE>
public static void <B>GameOver</B>()</PRE>
<DL>
<DD>send the game over information to all the clients
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="Rank()"><!-- --></A><H3>
Rank</H3>
<PRE>
public static void <B>Rank</B>()</PRE>
<DL>
<DD>Sorting in accordance with the scores of the clients after the game is over
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="IamOver(int)"><!-- --></A><H3>
IamOver</H3>
<PRE>
public static void <B>IamOver</B>(int No)</PRE>
<DL>
<DD>Store the game over information of a client
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>No</CODE> - the id of the client whose game is over</DL>
</DD>
</DL>
<HR>
<A NAME="sendNameToThisClient(java.io.PrintWriter)"><!-- --></A><H3>
sendNameToThisClient</H3>
<PRE>
public static void <B>sendNameToThisClient</B>(java.io.PrintWriter printWriter)</PRE>
<DL>
<DD>As soon as a client connects to the server, the server immediately sends the names of existing clients to this client
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>printWriter</CODE> - the output stream</DL>
</DD>
</DL>
<HR>
<A NAME="sendStartInformationToThisClient(java.io.PrintWriter)"><!-- --></A><H3>
sendStartInformationToThisClient</H3>
<PRE>
public static void <B>sendStartInformationToThisClient</B>(java.io.PrintWriter printWriter)</PRE>
<DL>
<DD>send start information to the connected client
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>printWriter</CODE> - the output stream</DL>
</DD>
</DL>
<HR>
<A NAME="sendName(int, java.io.BufferedReader)"><!-- --></A><H3>
sendName</H3>
<PRE>
public static void <B>sendName</B>(int No,
java.io.BufferedReader in)</PRE>
<DL>
<DD>A client sends his name to other clients
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>No</CODE> - the id of the client<DD><CODE>in</CODE> - the input stream</DL>
</DD>
</DL>
<HR>
<A NAME="chat(int, java.io.BufferedReader)"><!-- --></A><H3>
chat</H3>
<PRE>
public static void <B>chat</B>(int No,
java.io.BufferedReader in)</PRE>
<DL>
<DD>send the chatting information of a client to other clients
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>No</CODE> - the id of the client<DD><CODE>in</CODE> - the input stream</DL>
</DD>
</DL>
<HR>
<A NAME="clientStartGame()"><!-- --></A><H3>
clientStartGame</H3>
<PRE>
public static void <B>clientStartGame</B>()</PRE>
<DL>
<DD>A client has clicked the "start" button
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="sendNumber(int, java.io.PrintWriter)"><!-- --></A><H3>
sendNumber</H3>
<PRE>
public static void <B>sendNumber</B>(int No,
java.io.PrintWriter printWriter)</PRE>
<DL>
<DD>Send random numbers to a client for them to create bars
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>No</CODE> - the id of the client<DD><CODE>printWriter</CODE> - the output stream</DL>
</DD>
</DL>
<HR>
<A NAME="sendPlayingField(int, java.io.BufferedReader)"><!-- --></A><H3>
sendPlayingField</H3>
<PRE>
public static void <B>sendPlayingField</B>(int No,
java.io.BufferedReader in)</PRE>
<DL>
<DD>send the playing field of a client to other clients
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>No</CODE> - the ID of the client<DD><CODE>in</CODE> - the input stream</DL>
</DD>
</DL>
<HR>
<A NAME="clear(int, java.io.BufferedReader)"><!-- --></A><H3>
clear</H3>
<PRE>
public static void <B>clear</B>(int No,
java.io.BufferedReader in)</PRE>
<DL>
<DD>send the clearing information of a client to other clients
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>No</CODE> - the ID of the client<DD><CODE>in</CODE> - the input stream</DL>
</DD>
</DL>
<HR>
<A NAME="set(int, java.io.BufferedReader)"><!-- --></A><H3>
set</H3>
<PRE>
public static void <B>set</B>(int No,
java.io.BufferedReader in)</PRE>
<DL>
<DD>send the coloring information of a client to other clients
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>No</CODE> - the id of the client<DD><CODE>in</CODE> - the input stream</DL>
</DD>
</DL>
<HR>
<A NAME="setScore(int, java.io.BufferedReader)"><!-- --></A><H3>
setScore</H3>
<PRE>
public static void <B>setScore</B>(int No,
java.io.BufferedReader in)</PRE>
<DL>
<DD>send the score of a client to other clients
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>No</CODE> - the ID of the client<DD><CODE>in</CODE> - the input stream</DL>
</DD>
</DL>
<HR>
<A NAME="main(java.lang.String[])"><!-- --></A><H3>
main</H3>
<PRE>
public static void <B>main</B>(java.lang.String[] args)
throws java.io.IOException</PRE>
<DL>
<DD><DL>
<DT><B>Throws:</B>
<DD><CODE>java.io.IOException</CODE></DL>
</DD>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<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="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">
<A HREF="Score.html" title="class in <Unnamed>"><B>PREV CLASS</B></A>
<A HREF="SingleBar.html" title="class in <Unnamed>"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="index.html?Server.html" target="_top"><B>FRAMES</B></A>
<A HREF="Server.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: <A HREF="#nested_classes_inherited_from_class_java.lang.Thread">NESTED</A> | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<HR>
</BODY>
</HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -