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

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

?? mudplace.java

?? Examples From Java Examples in a Nutshell, 2nd Edition 書中的源碼
?? JAVA
?? 第 1 頁 / 共 2 頁
字號:
        }        // Let everyone know of the demise of this thing.        tellEveryone(name + " had destroyed the " + thing);    }    /**     * Create a new place in this MUD, with the specified name an description.      * The new place is accessible from this place through     * the specified exit, and this place is accessible from the new place      * through the specified entrance.  The creator must be in this place     * in order to create a exit from this place.     **/    public void createPlace(RemoteMudPerson creator,			    String exit, String entrance, String name, 			    String description) 	throws RemoteException,NotThere,ExitAlreadyExists,PlaceAlreadyExists    {        // Verify that the creator is actually here in this place        String creatorname = verifyPresence(creator);        synchronized(exits) {  // Only one client may change exits at a time            // Check that the exit doesn't already exist.            if (exits.indexOf(exit) != -1) throw new ExitAlreadyExists();            // Create the new place, registering its name with the server            MudPlace destination = new MudPlace(server, name, description);            // Link from there back to here            destination.exits.addElement(entrance);            destination.destinations.addElement(this);            // And link from here to there            exits.addElement(exit);            destinations.addElement(destination);        }        // Let everyone know about the new exit, and the new place beyond        tellEveryone(creatorname + " has created a new place: " + exit);    }        /**     * Create a new exit from this mud, linked to a named place in a named     * MUD on a named host (this can also be used to link to a named place in      * the current MUD, of course).  Because of the possibilities of deadlock,     * this method only links from here to there; it does not create a return     * exit from there to here.  That must be done with a separate call.     **/    public void linkTo(RemoteMudPerson linker, String exit, 		       String hostname, String mudname, String placename) 	throws RemoteException, NotThere, ExitAlreadyExists, NoSuchPlace    {        // Verify that the linker is actually here         String name = verifyPresence(linker);	        // Check that the link target actually exists.  Throw NoSuchPlace if        // not.  Note that NoSuchPlace may also mean "NoSuchMud" or        // "MudNotResponding".        String url = "rmi://" + hostname + '/' + Mud.mudPrefix + mudname;        try {            RemoteMudServer s = (RemoteMudServer) Naming.lookup(url);            RemoteMudPlace destination = s.getNamedPlace(placename);        }        catch (Exception e) { throw new NoSuchPlace(); }                synchronized(exits) {            // Check that the exit doesn't already exist.            if (exits.indexOf(exit) != -1) throw new ExitAlreadyExists();            // Add the exit, to the list of exit names            exits.addElement(exit);            // And add the destination to the list of destinations.  Note that            // the destination is stored as a string rather than as a            // RemoteMudPlace.  This is because if the remote server goes down            // then comes back up again, a RemoteMudPlace is not valid, but the            // string still is.            destinations.addElement(url + '@' + placename);        }        // Let everyone know about the new exit and where it leads        tellEveryone(name + " has linked " + exit + " to " + 		     "'" + placename + "' in MUD '" + mudname + 		     "' on host " + hostname);    }        /**     * Close an exit that leads out of this place.     * It does not close the return exit from there back to here.     * Note that this method does not destroy the place that the exit leads to.     * In the current implementation, there is no way to destroy a place.     **/    public void close(RemoteMudPerson who, String exit) 	throws RemoteException, NotThere, NoSuchExit    {        // check that the person closing the exit is actually here        String name = verifyPresence(who);        synchronized(exits) {            // Check that the exit exists            int i = exits.indexOf(exit);            if (i == -1) throw new NoSuchExit();            // Remove it and its destination from the lists            exits.removeElementAt(i);            destinations.removeElementAt(i);        }        // Let everyone know that the exit doesn't exist anymore        tellEveryone(name + " has closed exit " + exit);    }        /**      * Remove a person from this place.  If there is a message, send it to      * everyone who is left in this place.  If the specified person is not here     * this method does nothing and does not throw an exception.  This method     * is called by go(), and the client should call it when the user quits.     * The client should not allow the user to invoke it directly, however.     **/    public void exit(RemoteMudPerson who, String message)	throws RemoteException    {        String name;        synchronized(names) {            int i = people.indexOf(who);            if (i == -1) return;            names.removeElementAt(i);            people.removeElementAt(i);        }        if (message != null) tellEveryone(message);    }        /**      * This method puts a person into this place, assigning them the     * specified name, and displaying a message to anyone else who is in     * that place.  This method is called by go(), and the client should     * call it to initially place a person into the MUD.  Once the person     * is in the MUD, however, the client should restrict them to using go()     * and should not allow them to call this method directly.     * If there have been networking problems, a client might call this method     * to restore a person to this place, in case they've been bumped out.     * (A person will be bumped out of a place if the server tries to send     * a message to them and gets a RemoteException.)     **/    public void enter(RemoteMudPerson who, String name, String message) 	throws RemoteException, AlreadyThere    {        // Send the message to everyone who is already here.        if (message != null) tellEveryone(message);	        // Add the person to this place.        synchronized (names) {            if (people.indexOf(who) != -1) throw new AlreadyThere();            names.addElement(name);            people.addElement(who);        }    }        /**     * This final remote method returns the server object for the MUD in which     * this place exists.  The client should not allow the user to invoke this     * method.     **/    public RemoteMudServer getServer() throws RemoteException {	return server;    }        /**      * Create and start a thread that sends out a message everyone in this     * place.  If it gets a RemoteException talking to a person, it silently     * removes that person from this place.  This is not a remote method, but     * is used internally by a number of remote methods.     **/    protected void tellEveryone(final String message) {        // If there is no-one here, don't bother sending the message!        if (people.size() == 0) return;        // Make a copy of the people here now.  The message is sent        // asynchronously and the list of people in the room may change before        // the message is sent to everyone.        final Vector recipients = (Vector) people.clone();        // Create and start a thread to send the message, using an anonymous        // class.  We do this because sending the message to everyone in this        // place might take some time, (particularly on a slow or flaky        // network) and we don't want to wait.        new Thread() {		public void run() {		    // Loop through the recipients		    for(int i = 0; i < recipients.size(); i++) {			RemoteMudPerson person =			    (RemoteMudPerson)recipients.elementAt(i);			// Try to send the message to each one.			try { person.tell(message); } 			// If it fails, assume that that person's client or			// network has failed, and silently remove them from			// this place.			catch (RemoteException e) { 			    try { MudPlace.this.exit(person, null); } 			    catch (Exception ex) {} 			}		    }		}	    }.start();    }        /**     * This convenience method checks whether the specified person is here.     * If so, it returns their name.  If not it throws a NotThere exception     **/    protected String verifyPresence(RemoteMudPerson who) throws NotThere {        int i = people.indexOf(who);        if (i == -1) throw new NotThere();        else return (String) names.elementAt(i);    }    /**     * This method is used for custom de-serialization.  Since the vectors of     * people and of their names are transient, they are not serialized with     * the rest of this place.  Therefore, when the place is de-serialized,     * those vectors have to be recreated (empty).     **/    private void readObject(ObjectInputStream in) 	throws IOException, ClassNotFoundException {        in.defaultReadObject();  // Read most of the object as normal        names = new Vector();    // Then recreate the names vector        people = new Vector();   // and recreate the people vector    }                             /** This constant is a version number for serialization */    static final long serialVersionUID = 5090967989223703026L;}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲综合免费观看高清在线观看| 欧美电影免费观看高清完整版在| 欧美日韩黄视频| 91精品福利在线一区二区三区| 精品日韩一区二区三区免费视频| 日本一区二区三区视频视频| 亚洲女同ⅹxx女同tv| 午夜私人影院久久久久| 国产综合色产在线精品| 色婷婷亚洲综合| 欧美一区二区福利视频| 国产精品伦理在线| 天堂在线一区二区| a级高清视频欧美日韩| 国产精品高清亚洲| 偷拍日韩校园综合在线| 国产盗摄一区二区| 欧美日韩一级二级三级| 欧美激情一区二区三区不卡| 亚洲成人福利片| 国产高清亚洲一区| 欧美日韩不卡在线| 国产精品色一区二区三区| 午夜视频久久久久久| 成人做爰69片免费看网站| 欧美高清一级片在线| 国产精品美女久久久久久2018| 日韩电影在线一区| 91香蕉视频在线| 久久先锋影音av| 午夜精品123| 成人动漫一区二区| 日韩欧美国产午夜精品| 亚洲伦在线观看| 国产精品一卡二| 日韩视频一区二区三区| 一区二区三区毛片| 粉嫩在线一区二区三区视频| 欧美一级日韩一级| 亚洲另类一区二区| 丰满少妇在线播放bd日韩电影| 日韩午夜小视频| 亚洲午夜三级在线| 色综合天天综合给合国产| 久久亚洲综合av| 琪琪一区二区三区| 精品视频1区2区| 亚洲精品国产无套在线观| 国产盗摄一区二区三区| 亚洲精品在线观| 美日韩一区二区| 欧美日韩国产综合视频在线观看 | 午夜电影网亚洲视频| aaa欧美大片| 国产精品色婷婷久久58| 狠狠色丁香九九婷婷综合五月| 欧美精选一区二区| 亚洲一区二区三区四区在线观看 | 亚洲欧美另类久久久精品| 国产精品一区三区| 久久在线免费观看| 国产在线不卡一卡二卡三卡四卡| 91精品一区二区三区久久久久久| 亚洲一区二区三区四区中文字幕| 一本大道久久精品懂色aⅴ| 中文字幕日本乱码精品影院| 国产大陆亚洲精品国产| 久久九九99视频| 国产成人免费在线观看不卡| 久久久久久9999| 国产美女在线精品| 久久久久久9999| 国产成人精品免费一区二区| 国产午夜精品久久久久久免费视| 精品一区二区三区在线观看| 精品国产91洋老外米糕| 韩国精品主播一区二区在线观看| 精品国内二区三区| 国产永久精品大片wwwapp| 久久久久久亚洲综合| 高清日韩电视剧大全免费| 国产欧美日本一区二区三区| 成人av免费在线| 亚洲视频每日更新| 精品视频一区二区三区免费| 亚洲成人资源在线| 日韩欧美国产电影| 国产在线精品一区二区| 国产人成亚洲第一网站在线播放| 成人黄色网址在线观看| 亚洲日韩欧美一区二区在线| 在线亚洲+欧美+日本专区| 亚洲电影你懂得| 日韩一区二区三区四区| 国产制服丝袜一区| 国产精品女主播av| 欧美性大战xxxxx久久久| 午夜视频一区在线观看| 精品粉嫩aⅴ一区二区三区四区 | 国产亚洲成aⅴ人片在线观看| 国产99久久久国产精品免费看| 中文字幕视频一区二区三区久| 一本一本久久a久久精品综合麻豆 一本一道波多野结衣一区二区 | 中文字幕欧美激情一区| 99riav一区二区三区| 亚洲高清视频在线| 精品国产青草久久久久福利| 国产91清纯白嫩初高中在线观看| 亚洲丝袜另类动漫二区| 制服丝袜激情欧洲亚洲| 国产成人精品免费看| 亚洲综合久久av| 精品久久久久久亚洲综合网| 成人综合婷婷国产精品久久免费| 一区二区三区免费网站| 日韩欧美123| www.亚洲精品| 日韩成人免费电影| 国产精品久久精品日日| 欧美日韩国产经典色站一区二区三区| 久草中文综合在线| 亚洲精品国产精华液| 欧美变态tickle挠乳网站| av中文字幕亚洲| 麻豆国产欧美日韩综合精品二区| 国产精品每日更新在线播放网址| 欧美伦理影视网| 成人污视频在线观看| 天天av天天翘天天综合网| 欧美韩日一区二区三区| 欧美三级乱人伦电影| 成人免费视频caoporn| 日韩av电影免费观看高清完整版| 国产精品污污网站在线观看| 在线成人av网站| 9l国产精品久久久久麻豆| 另类小说综合欧美亚洲| 洋洋av久久久久久久一区| 国产视频一区不卡| 日韩三级av在线播放| 欧美在线视频全部完| 国产·精品毛片| 日韩高清一级片| 亚洲视频中文字幕| 国产日产亚洲精品系列| 日韩三级免费观看| 欧美四级电影网| 99精品在线免费| 加勒比av一区二区| 丝袜亚洲精品中文字幕一区| 亚洲免费资源在线播放| 国产欧美一区二区三区鸳鸯浴| 欧美一级欧美三级| 精品视频在线看| 色综合久久久久久久| 成人激情动漫在线观看| 国产一区在线精品| 美女网站色91| 午夜电影网一区| 亚洲午夜精品在线| 亚洲欧美另类在线| 中文字幕一区二区三区蜜月 | 国产成人av电影在线观看| 久久精品国产精品亚洲综合| 婷婷六月综合亚洲| 亚洲第一狼人社区| 一区二区三区在线观看网站| 国产精品免费看片| 欧美激情综合五月色丁香小说| 精品日韩一区二区| 精品美女在线播放| 精品欧美乱码久久久久久1区2区| 欧美精品 国产精品| 欧美日韩成人高清| 在线播放日韩导航| 欧美日韩精品系列| 欧美日韩美少妇 | 久久精品国产亚洲一区二区三区| 亚洲超丰满肉感bbw| 亚洲成人av中文| 亚洲国产精品综合小说图片区| 亚洲欧美另类小说| 亚洲精品久久嫩草网站秘色| 最新不卡av在线| 综合欧美亚洲日本| 一区二区三区在线免费播放| 亚洲一区在线观看免费观看电影高清| 亚洲丝袜自拍清纯另类| 伊人婷婷欧美激情| 亚洲一卡二卡三卡四卡| 亚洲成人三级小说| 日本一区中文字幕| 美女诱惑一区二区| 国产在线视频一区二区| 国产精华液一区二区三区| 成人午夜视频网站| 91丝袜高跟美女视频| 欧美在线视频不卡| 欧美一级电影网站| 久久色在线观看|