Example #1
0
    /// <summary>
    /// 请求场配置列表
    /// </summary>
    /// <param name="pID">P I.</param>
    /// <param name="msg">Message.</param>
    /// <param name="action">Action.</param>
    public void sendMsg(LobbyProtocol pID, msgReqPlazaList msg, Action <Message> action)
    {
        JsonObject jsonMsg = new JsonObject();

        jsonMsg.Add("game", (int)msg.game);
        sendMsg(pID, jsonMsg, action);
    }
Example #2
0
    //-------------------------------以下为网络消息处理---------------------------------
    public void onAccountLoginSuccess(object data)
    {
        //此时需要加载动画,大厅界面不可点击,数据全部收到或者部分收到时,可以点击。
        SelfData self = Account.getSelfData();

        onEventShowUserInfo(null);

        //为了节省服务器压力,以下数据后续需要实现md5方式请求,如果数据未发生变动,则不需要请求。to do
        //请求大厅数据
        msgReqPlazaList plaza = new msgReqPlazaList();

        plaza.game = GameType.GAME_LIANQI;
        ProtocolManager.getInstance().sendMsg(LobbyProtocol.P_LOBBY_REQ_PLAZA_LIST, plaza, OnRespPlazaList);

        msgReqPropList prop = new msgReqPropList();

        prop.game = GameType.GAME_LIANQI;
        ProtocolManager.getInstance().sendMsg(LobbyProtocol.P_LOBBY_REQ_PROP_LIST, prop, OnRespPropList);

        msgReqPackageList package = new msgReqPackageList();

        package.game = GameType.GAME_LIANQI;
        ProtocolManager.getInstance().sendMsg(LobbyProtocol.P_LOBBY_REQ_PACKAGE_LIST, package, OnRespPackageList);

        msgReqSysMsgList sysmsg = new msgReqSysMsgList();

        sysmsg.game      = GameType.GAME_LIANQI;
        sysmsg.channelId = ChannelType.CHANNEL_APPSTORE;
        ProtocolManager.getInstance().sendMsg(LobbyProtocol.P_LOBBY_REQ_SYSMSG, sysmsg, OnRespSysMsgList);

        //
        msgReqPrivateMsgList primsg = new msgReqPrivateMsgList();

        primsg.game  = GameType.GAME_LIANQI;
        primsg.begin = 0;
        primsg.cnt   = 20;
        ProtocolManager.getInstance().sendMsg(LobbyProtocol.P_LOBBY_REQ_PRIVATEMSG, primsg, OnRespPrivateMsgList);

        msgReqStoreList store = new msgReqStoreList();

        store.game      = GameType.GAME_LIANQI;
        store.channelID = ChannelType.CHANNEL_APPSTORE;
        ProtocolManager.getInstance().sendMsg(LobbyProtocol.P_LOBBY_REQ_STORE_LIST, store, OnRespStoreList);

        msgReqFriendList friend = new msgReqFriendList();

        friend.game = GameType.GAME_LIANQI;
        ProtocolManager.getInstance().sendMsg(LobbyProtocol.P_LOBBY_REQ_FRIEND_LIST, friend, OnRespFriendList);


        /////新增 2017-04-05
        //请求签到和抽奖数据
        msgReqSignInLuckDrawData sild = new msgReqSignInLuckDrawData();

        sild.game     = GameType.GAME_LIANQI;
        sild.areaID   = self.area;
        sild.deviceID = "deviceID";
        ProtocolManager.getInstance().sendMsg(LobbyProtocol.P_LOBBY_REQ_SIGNIN_LUCKDRAW_DATA, sild, OnRespSignInLuckDrawList);
        //请求签到
        msgReqSignIn signin = new msgReqSignIn();

        signin.game     = GameType.GAME_LIANQI;
        signin.areaID   = self.area;
        signin.deviceID = "deviceID";
        ProtocolManager.getInstance().sendMsg(LobbyProtocol.P_LOBBY_REQ_SIGNIN, signin, OnRespSignIn);
        //请求抽奖
        msgReqLuckDraw luckdraw = new msgReqLuckDraw();

        luckdraw.game     = GameType.GAME_LIANQI;
        luckdraw.areaID   = self.area;
        luckdraw.deviceID = "deviceID";
        ProtocolManager.getInstance().sendMsg(LobbyProtocol.P_LOBBY_REQ_LUCKDRAW, luckdraw, OnRespLuckDraw);
    }