文件名称:java网络对战的国际象棋源码
文件大小:460KB
文件格式:ZIP
更新时间:2011-01-31 08:27:54
java 国际象棋 网络对战
一个可以进行网络对战的国际象棋源码。这个程序可以换棋子和棋盘,还有聊天、以applet运行等功能,非常不错!!
一、用ant编译源码(所有源文件及目录结构请下载)
C:\cs>ant compile
Buildfile: build.xml
compile:
[mkdir] Created dir: C:\cs\build
[javac] Compiling 60 source files to C:\cs\build
[javac] Note: * uses or overrides a deprecated API.
[javac] Note: Recompile with -Xlint:deprecation for details.
[javac] Note: Some input files use unchecked or unsafe operations.
[javac] Note: Recompile with -Xlint:unchecked for details.
BUILD SUCCESSFUL
Total time: 14 seconds
二、在命令行启动服务端
C:\cs>java com.borland.samples.chess.server.ChessServer
05-12-28 下午09时44分43秒 CST
Read 2 userId records from C:\cs\users.obj
Hello 8889
Address of the Server :microsof-0f0cfb/127.0.0.1
HelloThread: Waiting for someone to talk to me on port 8889
三、打开两个dos窗口,在命令行分别启动两个客户端程序,每一个客户端程序都会弹出登录对话框,请输入你的姓名和口令登录。如其中之一
C:\cs>java com.borland.samples.chess.client.ChessViewer
imageName = images/cmpieces.gif
imageName = images/owlpieces.gif
imageName = images/ibmpieces.gif
no file specified
ImageFactory.square size = 49 pieces=23671010
CV8889Received: 8890
ClientSender:Name with 2 parameters
ClientSender:List with 0 parameters
ClientSender:AdjuornedList with 0 parameters