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

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

?? mudclient.java

?? 本書收入了164個完整的Java編程實例
?? 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久久精品免费看国产| 精品电影一区二区| 亚洲一区二区三区小说| 国产suv精品一区二区三区| 欧美精品一级二级三级| 日韩av电影免费观看高清完整版在线观看| 国产美女一区二区三区| 欧美日韩免费电影| 菠萝蜜视频在线观看一区| 国产色91在线| 欧美日韩综合不卡| 99视频精品在线| 亚洲图片一区二区| 国产日韩欧美不卡在线| av午夜精品一区二区三区| 日韩在线播放一区二区| 国产日韩av一区| 日韩一区二区三区免费看| 色欲综合视频天天天| 亚洲国产精品视频| 亚洲欧美区自拍先锋| 日韩欧美电影一区| 欧美日本一区二区| 欧美影片第一页| 日本中文字幕一区二区视频 | 一区二区三区小说| 日韩视频一区在线观看| 欧美mv和日韩mv国产网站| 亚洲福利视频一区| 激情综合网最新| 欧美日韩国产综合视频在线观看| 亚洲乱码国产乱码精品精的特点 | 538在线一区二区精品国产| 一区二区三区中文字幕精品精品| 色综合欧美在线| 亚洲一区二区三区自拍| 国产精品视频yy9299一区| 精品国产乱码91久久久久久网站| 日韩免费观看高清完整版| 欧美一卡在线观看| 色综合久久88色综合天天| 欧美日韩国产高清一区| 欧美日韩一级二级三级| 欧美日韩国产一级片| 欧美tk—视频vk| 天天色 色综合| 成人涩涩免费视频| 国产精品三级av在线播放| 95精品视频在线| 亚洲.国产.中文慕字在线| 日韩一区二区免费高清| 国产不卡一区视频| 一区二区三区日韩欧美精品 | 久久亚洲精精品中文字幕早川悠里| 国产精品一区二区无线| 亚洲欧美综合另类在线卡通| 26uuu成人网一区二区三区| 国产乱淫av一区二区三区| 亚洲视频在线一区| 欧美国产综合一区二区| 国产区在线观看成人精品 | 老司机精品视频线观看86| 久久免费电影网| 在线亚洲免费视频| 久久综合久色欧美综合狠狠| 99精品久久99久久久久| 青青青伊人色综合久久| 国产精品久久久久久户外露出| 欧美三级日本三级少妇99| 国产精品中文字幕欧美| 亚洲国产一区二区a毛片| 久久久久久夜精品精品免费| 色av成人天堂桃色av| 国产麻豆精品一区二区| 亚洲一区二区美女| 欧美激情在线一区二区三区| 欧美三级视频在线观看| 国产成人免费视频一区| 青娱乐精品在线视频| 日韩伦理电影网| 久久亚洲一区二区三区四区| 欧美影院午夜播放| caoporen国产精品视频| 激情综合网av| 男人的天堂亚洲一区| 一区二区三区在线观看国产| 国产午夜亚洲精品午夜鲁丝片 | 夜夜精品浪潮av一区二区三区| 2020国产精品久久精品美国| 欧美丰满一区二区免费视频| 色老头久久综合| 99久久精品国产观看| 国产一级精品在线| 久久99精品久久久久久| 午夜精彩视频在线观看不卡| 亚洲欧美另类在线| 国产精品成人免费| 亚洲成av人片一区二区三区| 国产精品久久久久三级| 久久理论电影网| 精品999在线播放| 欧美大片在线观看一区| 欧美精品一卡二卡| 555www色欧美视频| 精品视频在线免费看| 欧美性色综合网| 欧美性做爰猛烈叫床潮| 在线观看中文字幕不卡| 色婷婷综合久久久久中文一区二区| www.欧美.com| 99国产精品久久| 色狠狠色噜噜噜综合网| 在线观看亚洲精品视频| 色8久久精品久久久久久蜜| 色久综合一二码| 欧美人与性动xxxx| 6080国产精品一区二区| 日韩一级大片在线观看| 精品处破学生在线二十三| 欧美精品一区二区久久婷婷| 久久精品一区二区三区不卡| 久久久激情视频| 日韩一区欧美一区| 亚洲国产精品一区二区尤物区| 视频一区二区三区入口| 美国av一区二区| 国产精品538一区二区在线| 丁香桃色午夜亚洲一区二区三区| 成人黄色国产精品网站大全在线免费观看| 丰满少妇久久久久久久| 色婷婷av一区二区三区之一色屋| 欧洲一区二区三区免费视频| 777精品伊人久久久久大香线蕉| 精品国产伦一区二区三区观看体验 | 欧美精品三级在线观看| 欧美一区二区在线免费播放| 精品国产乱码久久久久久夜甘婷婷| 欧美极品美女视频| 樱桃视频在线观看一区| 美女尤物国产一区| 不卡一区二区中文字幕| 欧美精品久久天天躁| 一区二区三区高清| 狠狠色综合日日| 91美女视频网站| 2020日本不卡一区二区视频| 亚洲欧美日韩国产一区二区三区| 奇米影视一区二区三区| 成人av电影在线观看| 91麻豆精品国产91久久久久久 | 欧美情侣在线播放| 国产人成一区二区三区影院| 亚洲综合久久久久| 韩国av一区二区| 色乱码一区二区三区88| www久久精品| 亚洲国产va精品久久久不卡综合| 精品一区二区三区在线观看国产| 9色porny自拍视频一区二区| 日韩一级片在线观看| 亚洲精品欧美激情| 国产电影一区二区三区| 欧美日韩不卡一区二区| 亚洲欧美日韩国产另类专区| 精品一区二区三区免费| 91国产免费观看| 国产精品嫩草久久久久| 麻豆91在线播放免费| 91黄色免费版| 中文字幕不卡的av| 国产综合久久久久久久久久久久 | 亚洲午夜免费电影| 成人激情小说网站| 久久久久国产精品厨房| 蜜桃视频在线观看一区二区| 在线影院国内精品| 国产精品电影院| 国产69精品久久99不卡| 精品国产91久久久久久久妲己| 天堂一区二区在线| 欧美色网站导航| 亚洲已满18点击进入久久| 99v久久综合狠狠综合久久| 一区二区三区免费在线观看| 成人动漫精品一区二区| 国产日韩av一区| 国产成人免费在线视频| 久久五月婷婷丁香社区| 国产一区二区毛片| 2023国产精品视频| 韩国毛片一区二区三区| 欧美精品一区二区蜜臀亚洲| 久久成人精品无人区| 欧美刺激脚交jootjob| 久久精品99久久久| 欧美精品一区二区在线观看|