chatroomcallbacki.java

来自「ICE3.3.0--聊天程序服务器端demo」· Java 代码 · 共 48 行

JAVA
48
字号
// **********************************************************************//// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved.//// This copy of Chat Demo is licensed to you under the terms// described in the CHAT_DEMO_LICENSE file included in this// distribution.//// **********************************************************************package ChatDemoGUI;//// This class implements the ChatRoomCallback interface.//class ChatRoomCallbackI extends Chat._ChatRoomCallbackDisp{    public ChatRoomCallbackI(Coordinator coordinator)    {        _coordinator = coordinator;    }    public void init(String[] users, Ice.Current currrent)    {        _coordinator.initEvent(users);    }    public void send(long timestamp, String name, String message, Ice.Current currrent)    {        if(name.compareToIgnoreCase(_coordinator.getUsername()) != 0)        {            _coordinator.userSayEvent(timestamp, name, message);        }    }    public void join(long timestamp, String name, Ice.Current currrent)    {        _coordinator.userJoinEvent(timestamp, name);    }    public void leave(long timestamp, String name, Ice.Current currrent)    {        _coordinator.userLeaveEvent(timestamp, name);    }    private final Coordinator _coordinator;}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?