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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? 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一区二区三区免费野_久草精品视频
亚洲欧美日本在线| 黑人巨大精品欧美一区| 六月婷婷色综合| 99精品视频在线观看| 欧美一区欧美二区| 亚洲人吸女人奶水| 麻豆精品一区二区av白丝在线| 99精品在线免费| 久久久久99精品国产片| 五月天丁香久久| 91免费版pro下载短视频| 久久亚洲一区二区三区明星换脸| 亚洲夂夂婷婷色拍ww47| 成人免费福利片| 久久免费看少妇高潮| 九九九久久久精品| 制服丝袜av成人在线看| 一区二区欧美视频| 91网站视频在线观看| 国产精品免费看片| 国产高清不卡一区二区| 久久午夜免费电影| 久久99久久精品欧美| 日韩午夜激情av| 日日夜夜精品视频天天综合网| 91久久精品一区二区| 国产精品国产三级国产a| 风间由美一区二区三区在线观看 | 成人黄色777网| 久久男人中文字幕资源站| 日韩专区在线视频| 欧美精品三级日韩久久| 天使萌一区二区三区免费观看| 欧美中文字幕一区| 亚洲一区二区三区视频在线| 在线欧美日韩国产| 亚洲国产sm捆绑调教视频| 欧美中文字幕不卡| 香蕉影视欧美成人| 欧美高清性hdvideosex| 久久精品国产免费看久久精品| 日韩欧美综合一区| 国产成人综合网站| 国产精品乱码人人做人人爱| av高清不卡在线| 亚洲伦在线观看| 欧美人xxxx| 美女一区二区视频| 国产日韩欧美一区二区三区乱码| 国产麻豆视频一区| 亚洲天堂精品视频| 欧美视频精品在线观看| 蜜臀国产一区二区三区在线播放| 欧美成人国产一区二区| 成人手机在线视频| 一区二区三区在线观看国产| 欧美精品久久天天躁| 国产呦萝稀缺另类资源| 亚洲丝袜另类动漫二区| 欧美老年两性高潮| 国产精品白丝av| 亚洲最大色网站| 精品国产伦一区二区三区观看方式 | 成人黄色免费短视频| 一区二区三区欧美在线观看| 欧美一区二区黄| 成人免费毛片aaaaa**| 一区av在线播放| 精品成人一区二区| 色国产精品一区在线观看| 精品综合久久久久久8888| 国产精品不卡一区| 日韩无一区二区| 91同城在线观看| 韩国三级中文字幕hd久久精品| 亚洲日本va午夜在线电影| 日韩三区在线观看| 在线一区二区三区四区五区| 精品无人码麻豆乱码1区2区| 亚洲美女屁股眼交| 久久精品免费在线观看| 精品视频在线免费看| 成人一区二区三区视频在线观看| 日韩精品每日更新| 亚洲激情图片一区| 中文字幕欧美区| 精品国产一区二区三区不卡| 在线视频观看一区| 成人一级片在线观看| 久久精品国产99国产| 亚洲第一福利视频在线| 成人欧美一区二区三区小说 | 中文字幕一区二区三区精华液| 日韩三级免费观看| 欧美视频一区二区三区四区| 成人av免费在线播放| 国产又黄又大久久| 捆绑调教一区二区三区| 午夜av电影一区| 一区二区三区不卡视频| 国产精品电影一区二区| 亚洲国产高清aⅴ视频| 精品国精品自拍自在线| 日韩欧美国产系列| 91精品国产色综合久久ai换脸| 欧美天堂一区二区三区| 欧美亚洲国产怡红院影院| 91在线视频免费91| 99国产精品久久久久久久久久久| 国产不卡视频在线播放| 国产不卡视频一区二区三区| 国产一区欧美一区| 国产高清无密码一区二区三区| 国产精品456露脸| 国产乱码精品一区二区三区五月婷 | 亚洲精品乱码久久久久久黑人 | 91麻豆国产福利精品| 99re热视频精品| 色婷婷一区二区| 色综合夜色一区| 色噜噜久久综合| 欧美无砖砖区免费| 宅男在线国产精品| 日韩欧美色综合网站| 2024国产精品视频| 国产欧美日韩在线| 亚洲欧美日韩在线| 亚洲国产精品一区二区久久 | 亚洲免费观看高清在线观看| 亚洲欧美在线aaa| 亚洲国产日韩a在线播放| 无码av免费一区二区三区试看| 日韩中文欧美在线| 久久丁香综合五月国产三级网站| 国产一区二区三区高清播放| 国产·精品毛片| 在线视频欧美区| 欧美一级专区免费大片| 久久久九九九九| 亚洲免费观看高清完整版在线观看| 亚洲成精国产精品女| 九九视频精品免费| 99视频有精品| 欧美伦理影视网| 国产欧美一区在线| 亚洲电影你懂得| 国产精一区二区三区| 色综合欧美在线视频区| 欧美精品日韩综合在线| 国产亚洲精品福利| 亚洲午夜免费电影| 国产精品456| 欧美日韩国产天堂| 国产欧美日韩卡一| 亚洲国产精品自拍| 风间由美中文字幕在线看视频国产欧美| 色天天综合色天天久久| 精品国产一区二区三区忘忧草| 国产精品国产三级国产| 美女一区二区三区| 在线观看日韩毛片| 久久久久久久久久久99999| 一区二区在线观看免费视频播放| 九九视频精品免费| 欧美日韩精品三区| 国产精品久线在线观看| 蜜臀av一级做a爰片久久| 成人ar影院免费观看视频| 欧美一区二区三区成人| 亚洲欧美一区二区三区极速播放 | 欧美电影免费观看高清完整版在线| 国产精品久久久久久久久果冻传媒 | 精品国产一区二区三区久久久蜜月| 亚洲色图19p| 国产成人在线视频网站| 9191久久久久久久久久久| 国产精品久久久久四虎| 国产一区二区视频在线| 91精品国产黑色紧身裤美女| 亚洲精品欧美激情| 成人avav在线| 欧美激情在线一区二区| 精品影院一区二区久久久| 欧美巨大另类极品videosbest| 亚洲男同性恋视频| 成人精品一区二区三区中文字幕| 欧美成人乱码一区二区三区| 午夜伦欧美伦电影理论片| 一本大道久久a久久综合婷婷| 国产三区在线成人av| 狠狠色狠狠色综合| 2023国产一二三区日本精品2022| 美女网站色91| 日韩一区二区精品在线观看| 性做久久久久久免费观看| 欧美私模裸体表演在线观看| 亚洲精品日韩一| 在线看不卡av| 亚洲电影视频在线| 欧美男人的天堂一二区|