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

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

?? mudplace.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 implements the RemoteMudPlace interface and exports a * bunch of remote methods that are at the heart of the MUD.  The * MudClient interacts primarily with these methods.  See the comment * for RemoteMudPlace for an overview. * The MudPlace class is Serializable so that places can be saved to disk * along with the MudServer that contains them.  Note, however that the * names and people fields are marked transient, so they are not serialized * along with the place (because it wouldn't make sense to try to save * RemoteMudPerson objects, even if they could be serialized). **/public class MudPlace extends UnicastRemoteObject     implements RemoteMudPlace, Serializable{    String placename, description;          // information about the place    Vector exits = new Vector();            // names of exits from this place    Vector destinations = new Vector();     // where the exits go to    Vector things = new Vector();           // names of things in this place    Vector descriptions = new Vector();     // descriptions of those things    transient Vector names = new Vector();  // names of people in this place    transient Vector people = new Vector(); // the RemoteMudPerson objects    MudServer server;                       // the server for this place        /** A no-arg constructor for de-serialization only.  Do not call it */    public MudPlace() throws RemoteException { super(); }        /**     * This constructor creates a place, and calls a server method     * to register the object so that it will be accessible by name     **/    public MudPlace(MudServer server, String placename, String description) 	throws RemoteException, PlaceAlreadyExists    {        this.server = server;        this.placename = placename;         this.description = description;        server.setPlaceName(this, placename);  // Register the place    }        /** This remote method returns the name of this place */    public String getPlaceName() throws RemoteException { return placename; }        /** This remote method returns the description of this place */    public String getDescription() throws RemoteException {	return description;    }    /** This remote method returns a Vector of names of people in this place */    public Vector getNames() throws RemoteException { return names; }        /** This remote method returns a Vector of names of things in this place */    public Vector getThings() throws RemoteException { return things; }        /** This remote method returns a Vector of names of exits from this place*/    public Vector getExits() throws RemoteException { return exits; }    /**      * This remote method returns a RemoteMudPerson object corresponding to     * the specified name, or throws an exception if no such person is here      **/    public RemoteMudPerson getPerson(String name) 	throws RemoteException, NoSuchPerson    {        synchronized(names) {            // What about when there are 2 of the same name?            int i = names.indexOf(name);            if (i == -1) throw new NoSuchPerson();            return (RemoteMudPerson) people.elementAt(i);        }    }        /**      * This remote method returns a description of the named thing, or     * throws an exception if no such thing is in this place.     **/    public String examineThing(String name) throws RemoteException, NoSuchThing    {        synchronized(things) {            int i = things.indexOf(name);            if (i == -1) throw new NoSuchThing();            return (String) descriptions.elementAt(i);        }    }        /**      * This remote method moves the specified RemoteMudPerson from this place     * in the named direction (i.e. through the named exit) to whatever place     * is there.  It throws exceptions if the specified person isn't in this     * place to begin with, or if they are already in the place through the      * exit or if the exit doesn't exist, or if the exit links to another MUD      * server and the server is not functioning.     **/    public RemoteMudPlace go(RemoteMudPerson who, String direction) 	throws RemoteException, NotThere, AlreadyThere, NoSuchExit, LinkFailed    {        // Make sure the direction is valid, and get destination if it is        Object destination;        synchronized(exits) {            int i = exits.indexOf(direction);            if (i == -1) throw new NoSuchExit();            destination = destinations.elementAt(i);        }	        // If destination is a string, it is a place on another server, so        // connect to that server.  Otherwise, it is a place already on this        // server.  Throw an exception if we can't connect to the server.        RemoteMudPlace newplace;        if (destination instanceof String) {            try {                 String t = (String) destination;                int pos = t.indexOf('@');                String url = t.substring(0, pos);                String placename = t.substring(pos+1);                RemoteMudServer s = (RemoteMudServer) Naming.lookup(url);                newplace = s.getNamedPlace(placename);            }             catch (Exception e) { throw new LinkFailed(); }         }        // If the destination is not a string, then it is a Place        else newplace = (RemoteMudPlace) destination;	        // Make sure the person is here and get their name.          // Throw an exception if they are not here        String name = verifyPresence(who);	        // Move the person out of here, and tell everyone who remains about it.        this.exit(who, name + " has gone " + direction);	        // Put the person into the new place.          // Send a message to everyone already in that new place        String fromwhere;        if (newplace instanceof MudPlace) // going to a local place            fromwhere = placename;        else            fromwhere = server.getMudName() + "." + placename;        newplace.enter(who, name, name + " has arrived from: " + fromwhere);	        // Return the new RemoteMudPlace object to the client so they        // know where they are now at.        return newplace;    }        /**      * This remote method sends a message to everyone in the room.  Used to     * say things to everyone.  Requires that the speaker be in this place.     **/    public void speak(RemoteMudPerson speaker, String msg) 	throws RemoteException, NotThere    {        String name = verifyPresence(speaker);        tellEveryone(name + ":" + msg);    }        /**      * This remote method sends a message to everyone in the room.  Used to     * do things that people can see. Requires that the actor be in this place.     **/    public void act(RemoteMudPerson actor, String msg)	throws RemoteException, NotThere    {        String name = verifyPresence(actor);        tellEveryone(name + " " + msg);    }    /**      * This remote method creates a new thing in this room.     * It requires that the creator be in this room.     **/    public void createThing(RemoteMudPerson creator,			    String name, String description) 	throws RemoteException, NotThere, AlreadyThere    {        // Make sure the creator is here        String creatorname = verifyPresence(creator);        synchronized(things) {            // Make sure there isn't already something with this name.              if (things.indexOf(name) != -1) throw new AlreadyThere();            // Add the thing name and descriptions to the appropriate lists            things.addElement(name);            descriptions.addElement(description);        }        // Tell everyone about the new thing and its creator        tellEveryone(creatorname + " has created a " + name);    }        /**     * Remove a thing from this room.  Throws exceptions if the person     * who removes it isn't themselves in the room, or if there is no     * such thing here.     **/    public void destroyThing(RemoteMudPerson destroyer, String thing) 	throws RemoteException, NotThere, NoSuchThing    {        // Verify that the destroyer is here        String name = verifyPresence(destroyer);        synchronized(things) {            // Verify that there is a thing by that name in this room            int i = things.indexOf(thing);            if (i == -1) throw new NoSuchThing();            // And remove its name and description from the lists            things.removeElementAt(i);            descriptions.removeElementAt(i);

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
丰满岳乱妇一区二区三区| 午夜影视日本亚洲欧洲精品| 国产成人综合亚洲91猫咪| 26uuu亚洲综合色欧美| 国产乱码精品一区二区三区av| 精品福利一区二区三区 | 亚洲精品中文在线观看| 一本一道综合狠狠老| 亚洲va欧美va人人爽午夜| 91 com成人网| 久久精品久久精品| 久久精品一区二区三区不卡 | 国产精品麻豆视频| 91啪在线观看| 爽好久久久欧美精品| 精品美女一区二区三区| 国产不卡在线播放| 亚洲男同性视频| 7777精品伊人久久久大香线蕉完整版 | 色琪琪一区二区三区亚洲区| 午夜亚洲国产au精品一区二区| 日韩欧美资源站| 国产不卡免费视频| 亚洲午夜视频在线| 精品国产乱码久久久久久图片| 国产 欧美在线| 性感美女久久精品| 久久久久国产精品免费免费搜索| 99久久国产综合精品女不卡| 无吗不卡中文字幕| 国产欧美日本一区视频| 91久久一区二区| 狠狠色狠狠色合久久伊人| 国产精品免费久久| 91精品国产一区二区三区蜜臀| 高清国产一区二区| 午夜精品久久久| 国产精品日产欧美久久久久| 91精品久久久久久久91蜜桃| av一区二区三区| 麻豆精品在线观看| 一区二区三区鲁丝不卡| 日韩欧美亚洲另类制服综合在线| 色哟哟一区二区在线观看 | 亚洲精品综合在线| 久久先锋资源网| 欧美日韩一区二区三区在线| 国产成人在线观看免费网站| 日韩激情一区二区| 亚洲啪啪综合av一区二区三区| 2020国产精品久久精品美国| 欧美日本乱大交xxxxx| 成人激情电影免费在线观看| 久久99蜜桃精品| 天天综合日日夜夜精品| 亚洲激情欧美激情| 国产精品久久久久一区二区三区 | 日韩一级二级三级| 色婷婷精品大在线视频| 国产美女精品在线| 麻豆视频一区二区| 婷婷一区二区三区| 一区二区免费在线| 中文字幕成人网| 欧美mv和日韩mv的网站| 欧美色网站导航| 麻豆一区二区三区| 蜜乳av一区二区| 亚洲成人中文在线| 亚洲日本va午夜在线电影| 精品国产青草久久久久福利| 91精品1区2区| 懂色一区二区三区免费观看 | 日本视频中文字幕一区二区三区| 中文字幕在线播放不卡一区| 久久天天做天天爱综合色| 欧美午夜电影一区| 99久久国产综合精品女不卡| 国产在线国偷精品免费看| 亚洲成人动漫一区| 亚洲美女电影在线| 1区2区3区国产精品| 日本一区二区三级电影在线观看| 日韩免费观看2025年上映的电影| 欧美日本在线播放| 欧美日韩精品专区| 在线免费不卡视频| 91欧美激情一区二区三区成人| 国产91对白在线观看九色| 国产一区二区三区| 久久99国内精品| 久久99国内精品| 久久精品72免费观看| 美女脱光内衣内裤视频久久影院| 亚洲成人中文在线| 麻豆极品一区二区三区| 美洲天堂一区二卡三卡四卡视频 | 欧美日本国产一区| 91精品国产全国免费观看| 宅男噜噜噜66一区二区66| 欧美日韩久久不卡| 欧美日韩亚洲不卡| 欧美另类变人与禽xxxxx| 欧美午夜在线观看| 欧美午夜在线观看| 欧美一区二区三区公司| 日韩欧美综合一区| 欧美精品三级日韩久久| 日本乱人伦aⅴ精品| 欧美性三三影院| 欧美婷婷六月丁香综合色| 欧美日韩一级大片网址| 91精品国产综合久久小美女| 欧美成人精品二区三区99精品| 欧美一区二区三区系列电影| 精品视频色一区| 国产色91在线| 日韩美女视频19| 亚洲成人av电影在线| 亚洲一区二区欧美日韩| 美女视频免费一区| 国产成人免费视频网站高清观看视频| 国产不卡高清在线观看视频| 91视频观看免费| 欧美日韩大陆一区二区| 91福利在线免费观看| 91麻豆精品国产91久久久久 | 99视频精品免费视频| 欧美三级电影在线看| 欧美亚洲自拍偷拍| 日韩欧美成人激情| 国产精品免费看片| 亚洲妇熟xx妇色黄| 韩国理伦片一区二区三区在线播放| 成人av资源在线观看| 欧美亚洲高清一区| 久久久久久久精| 亚洲免费视频成人| 国产最新精品精品你懂的| 色香蕉成人二区免费| 欧美一区二区三区免费大片| 国产精品久久久久久久蜜臀| 午夜精品成人在线视频| 国产乱码精品一区二区三区五月婷| 久久精品国产久精国产爱| 欧美亚洲自拍偷拍| 国产精品午夜在线观看| 天天操天天综合网| 丁香婷婷综合激情五月色| 欧美另类高清zo欧美| 中文字幕一区三区| 九色综合国产一区二区三区| 一本久久a久久精品亚洲| 精品国产电影一区二区| 国产日韩欧美一区二区三区乱码| 精品一区二区三区久久久| 91在线视频播放| 久久亚洲综合av| 首页国产丝袜综合| 99国产精品一区| 精品国产区一区| 亚洲综合激情小说| 欧美性受xxxx黑人xyx性爽| 久久久久久电影| 麻豆91精品91久久久的内涵| 91福利视频在线| 亚洲欧美综合另类在线卡通| 激情成人综合网| 欧美精品粉嫩高潮一区二区| 亚洲色图一区二区三区| 成人网在线播放| 国产亚洲综合性久久久影院| 亚欧色一区w666天堂| 99国产一区二区三精品乱码| 国产午夜精品福利| 经典三级在线一区| 日韩欧美国产综合一区 | 日韩成人免费看| 色8久久人人97超碰香蕉987| 国产精品电影院| 成人久久18免费网站麻豆| 日韩片之四级片| 国产成人精品影视| 久久日韩精品一区二区五区| 久久精品国产免费看久久精品| 欧美一区二区视频观看视频| 亚洲国产精品久久人人爱蜜臀| 色国产精品一区在线观看| 亚洲国产精品麻豆| 欧美性猛交xxxxxxxx| 亚洲国产aⅴ天堂久久| 欧美网站一区二区| 无吗不卡中文字幕| 91精品一区二区三区在线观看| 日韩电影免费一区| 精品国产一区二区三区不卡| 婷婷综合五月天| 精品国内片67194| 国产精品12区| 成人欧美一区二区三区小说|