资源简介

一个可以进行网络对战的国际象棋源码。这个程序可以换棋子和棋盘,还有聊天、以applet运行等功能,非常不错!!一、用ant编译源码(所有源文件及目录结构请下载)C:\cs>ant compileBuildfile: build.xmlcompile:[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 SUCCESSFULTotal time: 14 seconds 二、在命令行启动服务端C:\cs>java com.borland.samples.chess.server.ChessServer05-12-28 下午09时44分43秒 CSTRead 2 userId records from C:\cs\users.objHello 8889Address of the Server :microsof-0f0cfb/127.0.0.1HelloThread: Waiting for someone to talk to me on port 8889三、打开两个dos窗口,在命令行分别启动两个客户端程序,每一个客户端程序都会弹出登录对话框,请输入你的姓名和口令登录。如其中之一C:\cs>java com.borland.samples.chess.client.ChessViewerimageName = images/cmpieces.gifimageName = images/owlpieces.gifimageName = images/ibmpieces.gifno file specifiedImageFactory.square size = 49 pieces=23671010CV8889Received: 8890ClientSender:Name with 2 parametersClientSender:List with 0 parametersClientSender:AdjuornedList with 0 parameters

资源截图

代码片段和文件信息

/**
 * Copyright (c) 1996-2004 Borland Software Corporation.  All Rights Reserved.
 * 
 * This SOURCE CODE FILE which has been provided by Borland Software as part
 * of a Borland Software product for use ONLY by licensed users of the product
 * includes CONFIDENTIAL and PROPRIETARY information of Borland Software.  
 *
 * USE OF THIS SOFTWARE IS GOVERNED BY THE TERMS AND CONDITIONS 
 * OF THE LICENSE STATEMENT AND LIMITED WARRANTY FURNISHED WITH
 * THE PRODUCT.
 *
 * IN PARTICULAR YOU WILL INDEMNIFY AND HOLD BORLAND SOFTWARE ITS
 * RELATED COMPANIES AND ITS SUPPLIERS HARMLESS FROM AND AGAINST ANY
 * CLAIMS OR LIABILITIES ARISING OUT OF THE USE REPRODUCTION OR
 * DISTRIBUTION OF YOUR PROGRAMS INCLUDING ANY CLAIMS OR LIABILITIES
 * ARISING OUT OF OR RESULTING FROM THE USE MODIFICATION OR
 * DISTRIBUTION OF PROGRAMS OR FILES CREATED FROM baseD ON AND/OR
 * DERIVED FROM THIS SOURCE CODE FILE.
 */
//------------------------------------------------------------------------------
// Copyright (c) 1996-2004 Borland Software Corporation.  All Rights Reserved.
//------------------------------------------------------------------------------

package com.borland.samples.chess;

import java.io.Serializable;

/**
 * The data type held in the player ListModel of ChessViewer.
 */
public class ListData implements Serializable{
private String data;
private Type type;
/**
 * Indicates that the data is a filename for a game from the Library.
 */
public static final Type LIBRARY = new Type(“L“);
/**
 * Indicates that the data is a filename for a suspended game.
 */
public static final Type SAVED_GAME = new Type(“G“);
/**
 * Indicates that the data is a filename for a game that is currently in progress.
 */
public static final Type ACTIVE_GAME = new Type(“A“);
/**
 * Indicates that the data is the userid for a player that is logged and available for a game.
 */
public static final Type Player = new Type(“P“);
static final long serialVersionUID = 6698501905225650088L;

  /**
       * Create an instance consisting of the String representaion of the data along
   * with its Type.
   *
   * @param data String
   * @param type Type
   */
  public ListData(String data Type type) {
this.data = data;
this.type = type;
}

/**
 * Return the String representation of the data.
 * @return the String representation.
 */
public String toString() {
return data;
}

/**
 * Return whether this object represents a Saved (Suspended) Game.
 * @return true if this object represents a Saved Game false otherwise.
 */
public boolean isSavedGame() {
return type == SAVED_GAME;
}

/**
 * Return whether this object represents a idle logged on player.
 * @return true if this object represets a player false otherwise.
 */
public boolean isPlayer() {
return type == Player;
}

/**
 * Return whether this object represents a Library game.
 * @return t

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2005-12-29 00:08  chess\
     文件        2521  2005-12-28 21:10  chess\build.xml
     文件        2372  2005-12-28 23:44  chess\users.obj
     文件        5753  2002-04-24 03:48  chess\chessapplet.html
     目录           0  2005-12-29 00:08  chess\Suspended\
     文件         115  2005-12-28 23:42  chess\Suspended\10121011103.pgn
     目录           0  2005-12-29 00:08  chess\com\
     目录           0  2005-12-29 00:08  chess\com\borland\
     目录           0  2005-12-29 00:08  chess\com\borland\samples\
     目录           0  2005-12-29 00:08  chess\com\borland\samples\chess\
     文件        1037  2005-12-28 21:17  chess\com\borland\samples\chess\ListData$Type.class
     文件        1433  2005-12-28 21:17  chess\com\borland\samples\chess\ListData.class
     文件        1895  2005-12-28 21:17  chess\com\borland\samples\chess\MessageProcessor.class
     文件        6188  2005-12-28 21:17  chess\com\borland\samples\chess\ServerMessage$1.class
     文件        2288  2005-12-28 21:17  chess\com\borland\samples\chess\ServerMessage.class
     文件        1177  2005-12-28 21:17  chess\com\borland\samples\chess\MessageType$1.class
     文件        1173  2005-12-28 21:17  chess\com\borland\samples\chess\MessageType$2.class
     文件         987  2005-12-28 21:17  chess\com\borland\samples\chess\MessageType$3.class
     文件        1273  2005-12-28 21:17  chess\com\borland\samples\chess\MessageType$4.class
     文件        1122  2005-12-28 21:17  chess\com\borland\samples\chess\MessageType$5.class
     文件         995  2005-12-28 21:17  chess\com\borland\samples\chess\MessageType$6.class
     文件        1281  2005-12-28 21:17  chess\com\borland\samples\chess\MessageType$7.class
     文件        1174  2005-12-28 21:17  chess\com\borland\samples\chess\MessageType$8.class
     文件        1135  2005-12-28 21:17  chess\com\borland\samples\chess\MessageType$9.class
     文件        1157  2005-12-28 21:17  chess\com\borland\samples\chess\MessageType$10.class
     文件        1173  2005-12-28 21:17  chess\com\borland\samples\chess\MessageType$11.class
     文件        1166  2005-12-28 21:17  chess\com\borland\samples\chess\MessageType$12.class
     文件        1376  2005-12-28 21:17  chess\com\borland\samples\chess\MessageType$13.class
     文件        1124  2005-12-28 21:17  chess\com\borland\samples\chess\MessageType$14.class
     文件        1128  2005-12-28 21:17  chess\com\borland\samples\chess\MessageType$15.class
     文件        1150  2005-12-28 21:17  chess\com\borland\samples\chess\MessageType$16.class
............此处省略207个文件信息

评论

共有 条评论