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

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

?? 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);

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美va亚洲va香蕉在线| 一区二区三区欧美激情| 日韩久久久精品| 欧美一区2区视频在线观看| 欧美日韩aaaaaa| 91精品国产高清一区二区三区蜜臀 | 国产成人免费在线| 国产成人免费网站| 成人av在线网| 91在线小视频| 欧美日韩国产一级| 91精品国产综合久久久久| 欧美精品一级二级| 精品久久久久久综合日本欧美| 久久奇米777| 成人欧美一区二区三区| 亚洲美腿欧美偷拍| 日本欧美一区二区| 国产乱妇无码大片在线观看| 成人一道本在线| 色综合久久综合中文综合网| 欧美撒尿777hd撒尿| 日韩视频免费直播| 日本一区二区不卡视频| 一区二区久久久久久| 日韩av中文字幕一区二区三区| 久久国内精品自在自线400部| 国产一区二区三区四| av亚洲精华国产精华精| 精品视频全国免费看| 欧美va亚洲va香蕉在线| 国产精品久久久久久户外露出| 亚洲精品国产第一综合99久久| 午夜精品国产更新| 国产一区二区在线影院| 99精品欧美一区二区三区小说 | 欧美大片拔萝卜| 国产色爱av资源综合区| 亚洲欧美另类图片小说| 男人操女人的视频在线观看欧美| 国产综合成人久久大片91| 99久久免费视频.com| 欧美精品tushy高清| 国产日本亚洲高清| 亚洲在线视频网站| 国产美女精品在线| 欧美日韩综合在线| 亚洲国产精品二十页| 丝袜美腿成人在线| 福利一区二区在线| 欧美一区二区三区公司| 亚洲婷婷综合久久一本伊一区| 蜜臀av性久久久久蜜臀aⅴ四虎| 成人av片在线观看| 欧美大胆一级视频| 亚洲乱码国产乱码精品精的特点 | 日本三级亚洲精品| av一二三不卡影片| 精品久久久久99| 亚洲成人激情自拍| 99re亚洲国产精品| 久久嫩草精品久久久精品一| 亚洲一区在线免费观看| 东方aⅴ免费观看久久av| 在线播放欧美女士性生活| 国产精品美女久久久久久久久| 青青草原综合久久大伊人精品| aaa国产一区| 久久久亚洲精华液精华液精华液 | 懂色av一区二区夜夜嗨| 日韩视频永久免费| 亚洲成人激情社区| 色婷婷狠狠综合| 中文字幕欧美三区| 黄网站免费久久| 欧美一卡二卡三卡| 午夜久久久久久| 欧美午夜不卡在线观看免费| 国产精品久久久久久久久免费桃花 | 91精品国产美女浴室洗澡无遮挡| 国产精品国产三级国产专播品爱网| 激情偷乱视频一区二区三区| 欧美视频自拍偷拍| 一区二区三区在线观看视频| www.欧美日韩国产在线| 国产欧美一区二区在线| 精品一区二区免费| 精品欧美久久久| 蜜桃视频一区二区三区| 3751色影院一区二区三区| 亚洲一区二区三区激情| 在线看国产一区二区| 亚洲女性喷水在线观看一区| av在线一区二区三区| 亚洲国产成人一区二区三区| 国产福利一区在线| 国产三级一区二区三区| 国产一区二区三区精品欧美日韩一区二区三区| 91麻豆精品国产91久久久使用方法| 亚洲国产色一区| 欧美乱熟臀69xxxxxx| 亚洲bt欧美bt精品777| 欧美私人免费视频| 亚洲成av人片在线观看| 欧美久久久久久久久中文字幕| 亚洲va欧美va人人爽午夜| 欧美美女黄视频| 麻豆国产一区二区| 久久综合狠狠综合久久综合88| 国产精品自拍一区| 国产精品少妇自拍| 99久久精品国产精品久久| 一区二区在线免费观看| 欧美日韩成人在线| 九九视频精品免费| 日本一区二区免费在线观看视频| 成人午夜电影久久影院| 成人免费一区二区三区在线观看| 色婷婷av一区| 日本不卡视频在线| 久久久久久夜精品精品免费| 成人av小说网| 亚洲一区二区高清| 欧美电视剧免费观看| 国产99久久久久| 亚洲免费电影在线| 91精品国产综合久久国产大片| 韩国av一区二区三区四区| 国产精品视频免费看| 在线视频国内一区二区| 日本欧洲一区二区| 国产婷婷色一区二区三区在线| 91在线视频18| 日韩精品一二三区| 国产免费久久精品| 在线一区二区三区四区| 日韩高清不卡在线| 国产免费久久精品| 欧美日韩国产另类不卡| 国产一区二区三区蝌蚪| 亚洲欧美电影院| 欧美大片顶级少妇| 一本在线高清不卡dvd| 麻豆高清免费国产一区| 国产精品久久三区| 3d成人动漫网站| 成人国产视频在线观看| 日本中文一区二区三区| 国产精品久久久久影院色老大 | 久久久精品天堂| 欧美性大战久久久久久久蜜臀| 九九热在线视频观看这里只有精品| 中文字幕在线一区二区三区| 欧美一区二区性放荡片| 99国产精品久久| 激情伊人五月天久久综合| 亚洲综合图片区| 欧美极品少妇xxxxⅹ高跟鞋 | 亚洲第一主播视频| 亚洲国产成人午夜在线一区| 欧美另类久久久品| 成人妖精视频yjsp地址| 五月婷婷久久丁香| 日韩一区在线看| 久久综合九色综合欧美就去吻| 欧美在线一二三| 99久久伊人网影院| 国产精品自拍一区| 麻豆成人av在线| 亚洲成av人影院在线观看网| 1区2区3区欧美| 欧美国产精品中文字幕| 精品日韩欧美在线| 717成人午夜免费福利电影| proumb性欧美在线观看| 国产在线不卡一区| 麻豆精品在线视频| 亚洲电影一区二区| 亚洲精品videosex极品| 日本一区二区成人在线| 久久久无码精品亚洲日韩按摩| 欧美一区二区三区视频在线观看| 欧美在线一区二区| 日本伦理一区二区| 91丝袜高跟美女视频| 国产精品正在播放| 久久不见久久见免费视频1| 五月综合激情日本mⅴ| 亚洲一区在线视频| 亚洲综合久久av| 亚洲一区二区三区在线看| 亚洲女同一区二区| 亚洲精品成人少妇| 亚洲欧美日韩国产另类专区| 成人欧美一区二区三区黑人麻豆| 欧美国产日韩在线观看| 欧美激情一区二区三区四区| 国产午夜精品久久久久久久| 国产亚洲欧美在线| 久久精品视频在线免费观看|