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

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

?? mudclient.java

?? 本書收入了164個(gè)完整的Java編程實(shí)例
?? 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 " +

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
制服丝袜日韩国产| 麻豆传媒一区二区三区| 蜜臀精品一区二区三区在线观看 | 亚洲视频精选在线| 欧美a一区二区| 欧美午夜电影一区| 亚洲色图欧美偷拍| 国产91综合一区在线观看| 欧美一卡2卡三卡4卡5免费| 亚洲视频在线一区观看| 国产91精品欧美| 精品久久久久久久久久久久久久久久久 | 捆绑调教一区二区三区| 欧美日韩精品福利| 亚洲一区二区免费视频| 99re热这里只有精品免费视频| 亚洲精品一区二区三区四区高清| 日本在线观看不卡视频| 欧美亚洲一区二区在线| 一区二区在线看| 一本大道久久a久久综合婷婷| 中文av一区二区| 国产a精品视频| 国产精品免费人成网站| 成人一区二区三区中文字幕| 久久久久久久久97黄色工厂| 国产精品69久久久久水密桃| 久久久久久日产精品| 国产麻豆成人传媒免费观看| 精品99一区二区三区| 国产主播一区二区三区| 久久久久一区二区三区四区| 国产乱淫av一区二区三区| 久久午夜老司机| 国产成人小视频| |精品福利一区二区三区| av资源站一区| 亚洲一区二区三区四区在线| 欧美日韩不卡在线| 免费在线观看不卡| 久久久久久久久蜜桃| 成人性生交大片免费看视频在线 | 麻豆精品久久精品色综合| 日韩精品一区二| 国产成人夜色高潮福利影视| 最新中文字幕一区二区三区| 在线视频你懂得一区二区三区| 亚洲图片欧美综合| 欧美一级片在线看| 丁香一区二区三区| 亚洲国产美国国产综合一区二区| 欧美一区二区三区系列电影| 国产在线观看一区二区| 亚洲三级电影网站| 3atv在线一区二区三区| 国产麻豆视频精品| 亚洲乱码国产乱码精品精98午夜| 欧美精品久久久久久久多人混战| 久久66热re国产| 亚洲色图欧洲色图| 精品入口麻豆88视频| 99久久婷婷国产综合精品| 午夜电影网一区| 国产精品丝袜久久久久久app| 在线观看国产精品网站| 国产露脸91国语对白| 尤物av一区二区| 日韩精品中文字幕一区二区三区 | 日韩久久久精品| 91农村精品一区二区在线| 蜜乳av一区二区| **性色生活片久久毛片| 日韩欧美区一区二| 在线日韩av片| 国产精品一区二区在线观看不卡| 亚洲一区二区在线免费看| 国产无人区一区二区三区| 精品视频一区 二区 三区| 成+人+亚洲+综合天堂| 理论电影国产精品| 天天综合日日夜夜精品| 国产精品久久久久久久久动漫| 日韩精品最新网址| 欧美午夜影院一区| 97久久人人超碰| 国内久久婷婷综合| 日本亚洲天堂网| 亚洲欧美日本在线| 日本一区二区三区免费乱视频| 欧美一级精品大片| 欧美日韩午夜精品| 色视频一区二区| 99视频有精品| 成人国产一区二区三区精品| 精品制服美女久久| 捆绑调教美女网站视频一区| 亚洲成人av一区二区三区| 亚洲人妖av一区二区| 久久精品视频免费观看| 精品精品国产高清一毛片一天堂| 欧美美女直播网站| 欧美在线看片a免费观看| 99久久免费精品| 91影视在线播放| 91在线porny国产在线看| 成人福利在线看| 国产激情视频一区二区三区欧美| 国产又粗又猛又爽又黄91精品| 日本亚洲最大的色成网站www| 五月婷婷另类国产| 天堂va蜜桃一区二区三区| 亚洲成人中文在线| 婷婷综合五月天| 免费观看一级特黄欧美大片| 日本成人超碰在线观看| 狂野欧美性猛交blacked| 裸体健美xxxx欧美裸体表演| 久久er精品视频| 国产在线精品免费| 国产成人丝袜美腿| 北条麻妃国产九九精品视频| 99久久亚洲一区二区三区青草| 色综合天天综合网天天狠天天 | 亚洲超丰满肉感bbw| 日韩av中文在线观看| 久久精品国产一区二区三 | 欧洲一区二区三区在线| 欧美日韩一区二区在线观看 | 在线中文字幕不卡| 欧美日韩1区2区| 亚洲精品一区二区三区99| 国产精品免费视频网站| 亚洲人成精品久久久久| 亚洲成a人v欧美综合天堂下载| 日日夜夜精品视频免费| 国产老妇另类xxxxx| 色综合天天综合| 欧美夫妻性生活| 欧美激情一区二区三区蜜桃视频| 亚洲视频一区二区免费在线观看| 亚洲第一电影网| 国产一区二区三区免费| 一本大道久久a久久精二百| 欧美酷刑日本凌虐凌虐| 久久久一区二区| 亚洲国产婷婷综合在线精品| 国产在线视频不卡二| av亚洲精华国产精华| 欧美高清视频一二三区 | 亚洲午夜影视影院在线观看| 久久国产精品99久久久久久老狼 | 丰满亚洲少妇av| 欧美日本不卡视频| 久久九九99视频| 亚洲成a人片在线不卡一二三区| 精品一区二区三区在线播放| 色综合久久久久综合体| 精品国产乱码久久久久久夜甘婷婷| 中文字幕日本不卡| 久久精品久久精品| 91福利视频网站| 中文字幕精品在线不卡| 日韩1区2区日韩1区2区| 91热门视频在线观看| 久久人人超碰精品| 日韩av在线发布| 在线精品视频免费观看| 中文久久乱码一区二区| 久久99九九99精品| 欧美午夜电影网| 亚洲区小说区图片区qvod| 韩国成人精品a∨在线观看| 欧美午夜片在线看| 中文字幕中文乱码欧美一区二区| 蜜桃精品视频在线| 制服丝袜亚洲播放| 亚洲成人午夜影院| 色偷偷一区二区三区| 国产三级三级三级精品8ⅰ区| 日本成人在线电影网| 欧美麻豆精品久久久久久| 亚洲狠狠丁香婷婷综合久久久| 不卡在线视频中文字幕| 国产亚洲精品aa| 精品一区二区三区av| 日韩一区二区在线播放| 日本在线不卡视频一二三区| 欧美日韩在线综合| 亚洲大片精品永久免费| 欧美亚洲免费在线一区| 亚洲精品国产第一综合99久久| 成人做爰69片免费看网站| 国产亚洲va综合人人澡精品| 寂寞少妇一区二区三区| 欧美va在线播放| 九九精品一区二区| 欧美精品一区二区久久婷婷| 精品一区二区综合| 国产日韩欧美综合在线| kk眼镜猥琐国模调教系列一区二区|