亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? mudclient.java

?? Examples From Java Examples in a Nutshell, 2nd Edition 書中的源碼
?? JAVA
?? 第 1 頁 / 共 2 頁
字號:
/* * Copyright (c) 2000 David Flanagan.  All rights reserved. * This code is from the book Java Examples in a Nutshell, 2nd Edition. * It is provided AS-IS, WITHOUT ANY WARRANTY either expressed or implied. * You may study, use, and modify it for any non-commercial purpose. * You may distribute it non-commercially as long as you retain this notice. * For a commercial use license, or to purchase the book (recommended), * visit http://www.davidflanagan.com/javaexamples2. */package com.davidflanagan.examples.rmi;import java.rmi.*;import java.rmi.server.*;import java.rmi.registry.*;import java.io.*;import java.util.*;import com.davidflanagan.examples.rmi.Mud.*;/** * This class is a client program for the MUD.  The main() method sets up  * a connection to a RemoteMudServer, gets the initial RemoteMudPlace object, * and creates a MudPerson object to represent the user in the MUD.  Then it  * calls runMud() to put the person in the place, begins processing * user commands.  The getLine() and getMultiLine() methods are convenience * methods used throughout to get input from the user. **/public class MudClient {    /**     * The main program.  It expects two or three arguments:     *   0) the name of the host on which the mud server is running     *   1) the name of the MUD on that host     *   2) the name of a place within that MUD to start at (optional).     *     * It uses the Naming.lookup() method to obtain a RemoteMudServer object     * for the named MUD on the specified host.  Then it uses the getEntrance()     * or getNamedPlace() method of RemoteMudServer to obtain the starting     * RemoteMudPlace object.  It prompts the user for a their name and      * description, and creates a MudPerson object.  Finally, it passes     * the person and the place to runMud() to begin interaction with the MUD.     **/    public static void main(String[] args) {        try {            String hostname = args[0]; // Each MUD is uniquely identified by a             String mudname = args[1];  //   host and a MUD name.            String placename = null;   // Each place in a MUD has a unique name            if (args.length > 2) placename = args[2];	                // Look up the RemoteMudServer object for the named MUD using            // the default registry on the specified host.  Note the use of            // the Mud.mudPrefix constant to help prevent naming conflicts            // in the registry.            RemoteMudServer server =                 (RemoteMudServer)Naming.lookup("rmi://" + hostname + "/" +					       Mud.mudPrefix + mudname);            // If the user did not specify a place in the mud, use            // getEntrance() to get the initial place.  Otherwise, call            // getNamedPlace() to find the initial place.            RemoteMudPlace location = null;            if (placename == null) location = server.getEntrance();            else location = (RemoteMudPlace) server.getNamedPlace(placename);	                // Greet the user and ask for their name and description.            // This relies on getLine() and getMultiLine() defined below.            System.out.println("Welcome to " + mudname);            String name = getLine("Enter your name: ");            String description = getMultiLine("Please describe what " +					  "people see when they look at you:");            // Define an output stream that the MudPerson object will use to            // display messages sent to it to the user.  We'll use the console.            PrintWriter myout = new PrintWriter(System.out);	                // Create a MudPerson object to represent the user in the MUD.            // Use the specified name and description, and the output stream.            MudPerson me = new MudPerson(name, description, myout);	                // Lower this thread's priority one notch so that broadcast            // messages can appear even when we're blocking for I/O.  This is            // necessary on the Linux platform, but may not be necessary on all            // platforms.            int pri = Thread.currentThread().getPriority();            Thread.currentThread().setPriority(pri-1);	                // Finally, put the MudPerson into the RemoteMudPlace, and start            // prompting the user for commands.            runMud(location, me);        }        // If anything goes wrong, print a message and exit.        catch (Exception e) {            System.out.println(e);            System.out.println("Usage: java MudClient <host> <mud> [<place>]");            System.exit(1);        }    }    /**     * This method is the main loop of the MudClient.  It places the person     * into the place (using the enter() method of RemoteMudPlace).  Then it     * calls the look() method to describe the place to the user, and enters a     * command loop to prompt the user for a command and process the command     **/    public static void runMud(RemoteMudPlace entrance, MudPerson me) 	throws RemoteException    {        RemoteMudPlace location = entrance;  // The current place        String myname = me.getName();        // The person's name        String placename = null;             // The name of the current place        String mudname = null;             // The name of the mud of that place        try {             // Enter the MUD            location.enter(me, myname, myname + " has entered the MUD.");             // Figure out where we are (for the prompt)            mudname = location.getServer().getMudName();            placename = location.getPlaceName();            // Describe the place to the user            look(location);        }        catch (Exception e) {            System.out.println(e);            System.exit(1);        }	        // Now that we've entered the MUD, begin a command loop to process        // the user's commands.  Note that there is a huge block of catch        // statements at the bottom of the loop to handle all the things that        // could go wrong each time through the loop.        for(;;) {  // Loop until the user types "quit"            try {    // Catch any exceptions that occur in the loop                // Pause just a bit before printing the prompt, to give output                // generated indirectly by the last command a chance to appear.                try { Thread.sleep(200); } catch (InterruptedException e) {}                // Display a prompt, and get the user's input                String line = getLine(mudname + '.' + placename + "> ");		                // Break the input into a command and an argument that consists                // of the rest of the line.  Convert the command to lowercase.                String cmd, arg;                int i = line.indexOf(' ');                if (i == -1) { cmd = line; arg = null; }                else {                    cmd = line.substring(0, i).toLowerCase();                    arg = line.substring(i+1);                }                if (arg == null) arg = "";		                // Now go process the command.  What follows is a huge repeated                // if/else statement covering each of the commands supported by                // this client.  Many of these commands simply invoke one of                // the remote methods of the current RemoteMudPlace object.                // Some have to do a bit of additional processing.                // LOOK: Describe the place and its things, people, and exits                if (cmd.equals("look")) look(location);                // EXAMINE: Describe a named thing                else if (cmd.equals("examine"))                     System.out.println(location.examineThing(arg));                // DESCRIBE: Describe a named person                else if (cmd.equals("describe")) {                    try {                         RemoteMudPerson p = location.getPerson(arg);                        System.out.println(p.getDescription());                     }                    catch(RemoteException e) {                        System.out.println(arg + " is having technical " +					   "difficulties. No description " +					   "is available.");                    }                }                // GO: Go in a named direction                else if (cmd.equals("go")) {                    location = location.go(me, arg);                    mudname = location.getServer().getMudName();                    placename = location.getPlaceName();                    look(location);                }                // SAY: Say something to everyone                 else if (cmd.equals("say")) location.speak(me, arg);                // DO: Do something that will be described to everyone                else if (cmd.equals("do")) location.act(me, arg);                // TALK: Say something to one named person                else if (cmd.equals("talk")) {                    try {                        RemoteMudPerson p = location.getPerson(arg);                        String msg = getLine("What do you want to say?: ");                        p.tell(myname + " says \"" + msg + "\"");                    }                    catch (RemoteException e) {                        System.out.println(arg + " is having technical " +			   	         "difficulties. Can't talk to them.");                    }                }                // CHANGE: Change my own description                 else if (cmd.equals("change"))                    me.setDescription(			    getMultiLine("Describe yourself for others: "));                // CREATE: Create a new thing in this place                else if (cmd.equals("create")) {                    if (arg.length() == 0)                        throw new IllegalArgumentException("name expected");                    String desc = getMultiLine("Please describe the " +					       arg + ": ");                    location.createThing(me, arg, desc);                }                // DESTROY: Destroy a named thing                else if (cmd.equals("destroy")) location.destroyThing(me, arg);                // OPEN: Create a new place and connect this place to it                // through the exit specified in the argument.                else if (cmd.equals("open")) {                    if (arg.length() == 0)                       throw new IllegalArgumentException("direction expected");                    String name = getLine("What is the name of place there?: ");                    String back = getLine("What is the direction from " + 					  "there back to here?: ");                    String desc = getMultiLine("Please describe " +

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
av亚洲精华国产精华| 粉嫩欧美一区二区三区高清影视 | 岛国精品一区二区| 美女视频黄免费的久久| 美日韩一区二区三区| 久久国产精品99久久人人澡| 蜜臀av性久久久久蜜臀av麻豆| 麻豆国产一区二区| 强制捆绑调教一区二区| 美女一区二区久久| 久久精品国产一区二区| 国产mv日韩mv欧美| av一区二区三区黑人| 欧美综合久久久| 欧美日韩精品久久久| 欧美日本视频在线| 精品国产电影一区二区| 亚洲国产电影在线观看| 亚洲欧美日韩小说| 爽好多水快深点欧美视频| 韩国一区二区视频| 不卡区在线中文字幕| 欧美在线999| 欧美国产日韩a欧美在线观看| 中文字幕在线观看不卡视频| 一区二区三区中文字幕电影| 五月婷婷综合在线| 国产精品自在在线| 欧美主播一区二区三区美女| 日韩视频不卡中文| 国产精品麻豆网站| 奇米影视一区二区三区| 国产成人精品一区二区三区四区| 99精品久久久久久| 69av一区二区三区| 国产色爱av资源综合区| 一区二区三区高清| 国产原创一区二区| 欧美做爰猛烈大尺度电影无法无天| 日韩欧美一卡二卡| 亚洲精品视频观看| 国产精品66部| 欧美人与z0zoxxxx视频| 日本一二三四高清不卡| 天堂成人国产精品一区| caoporen国产精品视频| 日韩美女视频在线| 亚洲欧美日韩一区| 成人免费av网站| 日韩欧美激情在线| 亚洲综合清纯丝袜自拍| 国产成人午夜99999| 日韩精品一区二区在线观看| 亚洲欧美日韩国产手机在线 | 欧美探花视频资源| 亚洲欧洲日韩综合一区二区| 蜜臀av国产精品久久久久| 在线欧美一区二区| 亚洲欧美一区二区三区孕妇| 国产麻豆精品一区二区| 51久久夜色精品国产麻豆| 亚洲视频免费观看| 国产成人在线影院| 日韩一级二级三级| 麻豆久久久久久久| 欧美一区二区三区在线观看视频 | 日韩一区二区三区免费观看| 亚洲图片欧美色图| 在线国产电影不卡| 亚洲综合丁香婷婷六月香| 99久久综合国产精品| 中文字幕 久热精品 视频在线| 国产乱妇无码大片在线观看| 日韩免费观看高清完整版在线观看| 午夜久久久久久久久久一区二区| 欧美午夜理伦三级在线观看| 亚洲午夜电影在线| 欧美系列在线观看| 午夜免费久久看| 欧美一卡在线观看| 麻豆成人久久精品二区三区小说| 日韩午夜激情av| 麻豆精品一二三| 国产欧美1区2区3区| 国产成人免费视频精品含羞草妖精 | 亚洲一线二线三线久久久| 一本一本久久a久久精品综合麻豆| 国产精品电影一区二区| 欧美在线观看18| 日韩高清国产一区在线| 精品国产sm最大网站免费看| 国产一区二区视频在线| 中文字幕一区二区三区av| 91福利在线免费观看| 午夜视频一区在线观看| 欧美精品一区二区三区蜜桃| 国产91精品久久久久久久网曝门 | 91亚洲精品久久久蜜桃网站| 亚洲精品国产一区二区精华液 | 日本高清不卡aⅴ免费网站| 亚洲一区在线播放| 精品少妇一区二区三区在线视频| 国产精品一区二区在线观看网站| 中文字幕一区二区三区在线播放| 欧美色综合影院| 国产在线一区观看| 亚洲综合小说图片| 久久在线观看免费| 精品视频一区二区三区免费| 国产综合色视频| 亚洲国产成人精品视频| 亚洲精品一区二区三区影院| 成人福利视频网站| 男女男精品视频网| 亚洲人成在线观看一区二区| 日韩欧美的一区二区| 91美女片黄在线| 国产精品 日产精品 欧美精品| 亚洲成人三级小说| 国产精品国产三级国产普通话三级 | 成人深夜福利app| 水野朝阳av一区二区三区| 国产精品美女久久福利网站| 日韩一区二区精品| 欧美天天综合网| 成人免费毛片app| 久99久精品视频免费观看| 一区二区在线看| 欧美国产成人精品| 欧美精品一区男女天堂| 69精品人人人人| 欧美婷婷六月丁香综合色| 99久久精品国产导航| 韩国av一区二区三区四区| 午夜欧美一区二区三区在线播放| 日韩美女视频一区| 国产午夜亚洲精品午夜鲁丝片| 91精品国产色综合久久久蜜香臀| 一本到三区不卡视频| 成人av手机在线观看| 国产成人av一区二区三区在线 | 久久精品国产第一区二区三区| 亚洲综合999| 中文字幕在线不卡| 国产精品美女久久久久久2018| 欧美精品一区二区精品网| 91精品国产美女浴室洗澡无遮挡| 在线日韩av片| 欧美日韩在线播| 在线精品视频免费播放| 欧洲精品一区二区| 欧美亚一区二区| 欧美日韩国产综合视频在线观看| 91久久精品一区二区| 色婷婷av一区二区三区之一色屋| 97久久超碰国产精品| 日本精品一级二级| 欧美伊人久久久久久午夜久久久久| 91蝌蚪porny| 欧美性视频一区二区三区| 欧美日韩在线电影| 日韩欧美中文字幕制服| 2021中文字幕一区亚洲| 欧美经典一区二区三区| 欧美日韩一区国产| 91精品麻豆日日躁夜夜躁| 欧美mv和日韩mv的网站| 国产欧美精品日韩区二区麻豆天美| 国产偷国产偷亚洲高清人白洁| 中日韩av电影| 亚洲午夜激情网页| 精品在线你懂的| 丰满少妇在线播放bd日韩电影| 99久久99久久综合| 欧美视频精品在线观看| 精品国产伦一区二区三区观看体验| 久久这里只有精品视频网| 亚洲视频一区在线| 日韩成人一区二区三区在线观看| 国产精品亚洲第一区在线暖暖韩国 | 久久精品国产久精国产| 成+人+亚洲+综合天堂| 欧美理论在线播放| 久久久久国产精品麻豆| 有码一区二区三区| 韩国av一区二区三区在线观看| 97久久精品人人做人人爽50路| 欧美网站大全在线观看| 国产视频一区在线播放| 一区二区三区不卡视频在线观看| 奇米影视一区二区三区小说| 高清不卡一二三区| 欧美一区二区在线播放| 亚洲欧洲成人自拍| 久久99国产精品麻豆| 91免费视频网址| 久久九九影视网| 免费精品视频在线| 91蜜桃在线免费视频| 久久久精品欧美丰满|