Exemple #1
0
        //-------------------------------------------------------------------------
        // 请求刷新Ip所在地
        public void requestRefreshIpAddress()
        {
            PlayerRequest player_request;

            player_request.id   = PlayerRequestId.RefreshIpAddress;
            player_request.data = null;
            DefaultRpcSession.rpc((ushort)MethodType.c2sPlayerRequest, player_request);
        }
Exemple #2
0
        //-------------------------------------------------------------------------
        public void requestSetVip4Test(bool is_vip)
        {
            PlayerRequest player_request;

            player_request.id   = PlayerRequestId.SetVip4Test;
            player_request.data = EbTool.protobufSerialize <bool>(is_vip);
            DefaultRpcSession.rpc((ushort)MethodType.c2sPlayerRequest, player_request);
        }
Exemple #3
0
        //-------------------------------------------------------------------------
        // 请求改昵称
        public void requestChangeNickName(string nick_name)
        {
            PlayerRequest player_request;

            player_request.id   = PlayerRequestId.ChangeNickName;
            player_request.data = EbTool.protobufSerialize <string>(nick_name);
            DefaultRpcSession.rpc((ushort)MethodType.c2sPlayerRequest, player_request);
        }
Exemple #4
0
        //-------------------------------------------------------------------------
        // 请求改个人签名
        public void requestChangeIndividualSignature(string sign)
        {
            PlayerRequest player_request;

            player_request.id   = PlayerRequestId.ChangeIndividualSignature;
            player_request.data = EbTool.protobufSerialize <string>(sign);
            DefaultRpcSession.rpc((ushort)MethodType.c2sPlayerRequest, player_request);
        }
Exemple #5
0
        //-------------------------------------------------------------------------
        // 请求获取牌桌上其他玩家信息
        public void requestGetPlayerInfoOther(string et_player_guid)
        {
            PlayerRequest player_request;

            player_request.id   = PlayerRequestId.GetPlayerInfoOther;
            player_request.data = EbTool.protobufSerialize <string>(et_player_guid);
            DefaultRpcSession.rpc((ushort)MethodType.c2sPlayerRequest, player_request);
        }
Exemple #6
0
        //-------------------------------------------------------------------------
        // 请求换肤
        public void requestChangePlayerProfileSkin(int profileskin_tableid)
        {
            PlayerRequest player_request;

            player_request.id   = PlayerRequestId.ChangeProfileSkin;
            player_request.data = EbTool.protobufSerialize <int>(profileskin_tableid);
            DefaultRpcSession.rpc((ushort)MethodType.c2sPlayerRequest, player_request);
        }
Exemple #7
0
        //-------------------------------------------------------------------------
        // 请求获取在线玩家总数
        public void requestGetOnlinePlayerNum()
        {
            PlayerRequest player_request;

            player_request.id   = PlayerRequestId.GetOnlinePlayerNum;
            player_request.data = null;
            DefaultRpcSession.rpc((ushort)MethodType.c2sPlayerRequest, player_request);
        }
Exemple #8
0
        //-------------------------------------------------------------------------
        // 请求离开桌子
        public void requestLeaveDesktop()
        {
            PlayerRequest player_request;

            player_request.id   = PlayerRequestId.LeaveDesktop;
            player_request.data = null;
            DefaultRpcSession.rpc((ushort)MethodType.c2sPlayerRequest, player_request);
        }
Exemple #9
0
        //-------------------------------------------------------------------------
        // 请求创建私人牌桌
        public void requestCreatePrivateDesktop(PrivateDesktopCreateInfo desktop_createinfo)
        {
            PlayerRequest player_request;

            player_request.id   = PlayerRequestId.CreatePrivateDesktop;
            player_request.data = EbTool.protobufSerialize(desktop_createinfo);
            DefaultRpcSession.rpc((ushort)MethodType.c2sPlayerRequest, player_request);
        }
Exemple #10
0
        //-------------------------------------------------------------------------
        public void requestSetAFK(bool afk)
        {
            PlayerRequest player_request;

            player_request.id   = PlayerRequestId.SetAFK;
            player_request.data = EbTool.protobufSerialize <bool>(afk);
            DefaultRpcSession.rpc((ushort)MethodType.c2sPlayerRequest, player_request);
        }
Exemple #11
0
        //-------------------------------------------------------------------------
        // 玩家坐下
        public void requestPlayerSitdown(byte seat_index)
        {
            DesktopRequest desktop_request;

            desktop_request.id   = DesktopRequestId.PlayerSitdown;
            desktop_request.data = EbTool.protobufSerialize <byte>(seat_index);
            DefaultRpcSession.rpc((ushort)MethodType.c2sPlayerDesktopRequest, desktop_request);
        }
Exemple #12
0
        //-------------------------------------------------------------------------
        // 请求进入指定桌子
        public void requestEnterDesktop(string desktop_etguid)
        {
            PlayerRequest player_request;

            player_request.id   = PlayerRequestId.EnterDesktop;
            player_request.data = EbTool.protobufSerialize(desktop_etguid);
            DefaultRpcSession.rpc((ushort)MethodType.c2sPlayerRequest, player_request);
        }
Exemple #13
0
        //-------------------------------------------------------------------------
        // 玩家回桌
        public void requestPlayerReturn()
        {
            DesktopRequest desktop_request;

            desktop_request.id   = DesktopRequestId.PlayerReturn;
            desktop_request.data = null;
            DefaultRpcSession.rpc((ushort)MethodType.c2sPlayerDesktopRequest, desktop_request);
        }
Exemple #14
0
        //-------------------------------------------------------------------------
        public void requestSceneRender2Logic(List <string> vec_param)
        {
            DesktopRequest desktop_request;

            desktop_request.id   = DesktopRequestId.PlayerSceneAction;
            desktop_request.data = EbTool.protobufSerialize(vec_param);
            DefaultRpcSession.rpc((ushort)MethodType.c2sPlayerDesktopRequest, desktop_request);
        }
Exemple #15
0
        //-------------------------------------------------------------------------
        // 请求进入任意桌子
        public void requestEnterDesktopAny()
        {
            PlayerRequest player_request;

            player_request.id   = PlayerRequestId.EnterDesktopAny;
            player_request.data = null;
            DefaultRpcSession.rpc((ushort)MethodType.c2sPlayerRequest, player_request);
        }
Exemple #16
0
        //-------------------------------------------------------------------------
        public void requestSetupBag()
        {
            BagRequest bag_request;

            bag_request.id   = BagRequestId.SetupBag;
            bag_request.data = null;

            DefaultRpcSession.rpc((ushort)MethodType.c2sBagRequest, bag_request);
        }
Exemple #17
0
        //-------------------------------------------------------------------------
        public void requestTakeoffEquip(EquipSlot equip_slot)
        {
            EquipRequest equip_request;

            equip_request.id   = EquipRequestId.TakeoffEquip;
            equip_request.data = EbTool.protobufSerialize <EquipSlot>(equip_slot);

            DefaultRpcSession.rpc((ushort)MethodType.c2sEquipRequest, equip_request);
        }
Exemple #18
0
        //-------------------------------------------------------------------------
        public void requestSetEquip()
        {
            EquipRequest equip_request;

            equip_request.id   = EquipRequestId.SetupEquip;
            equip_request.data = null;

            DefaultRpcSession.rpc((ushort)MethodType.c2sEquipRequest, equip_request);
        }
Exemple #19
0
        //-------------------------------------------------------------------------
        // 请求放弃任务
        public void requestGiveUpTask(int task_id)
        {
            PlayerTaskRequest playertask_request;

            playertask_request.id   = PlayerTaskRequestId.TaskGiveUp;
            playertask_request.data = EbTool.protobufSerialize <int>(task_id);

            DefaultRpcSession.rpc((ushort)MethodType.c2sPlayerTaskRequest, playertask_request);
        }
Exemple #20
0
        //-------------------------------------------------------------------------
        // 根据任务状态发送任务请求
        //public void requestTask(TaskBase task)
        //{
        //    EbLog.Note("ClientPlayerTask.requestTask() TaskId=" + task.TbDataTask.Id);

        //    switch (task.TaskData.task_state)
        //    {
        //        case TaskState.CanDo:
        //            {
        //                requestAcceptTask(task.TaskData.task_id);
        //            }
        //            break;
        //        case TaskState.Doing:
        //            {
        //                requestExcuteTask(task.TaskData.task_id);
        //            }
        //            break;
        //        case TaskState.Done:
        //            {
        //                requestFinishTask(task.TaskData.task_id);
        //            }
        //            break;
        //        default:
        //            break;
        //    }
        //}

        //-------------------------------------------------------------------------
        // 请求初始化任务
        public void requestSetupTask()
        {
            PlayerTaskRequest playertask_request;

            playertask_request.id   = PlayerTaskRequestId.SetupTask;
            playertask_request.data = null;

            DefaultRpcSession.rpc((ushort)MethodType.c2sPlayerTaskRequest, playertask_request);
        }
Exemple #21
0
        //-------------------------------------------------------------------------
        // 请求初始化邮箱信息
        public void requestMailBoxInitInfo()
        {
            PlayerMailBoxRequest mailbox_request;

            mailbox_request.id   = PlayerMailBoxRequestId.MailBoxInitInfo;
            mailbox_request.data = null;

            DefaultRpcSession.rpc((ushort)MethodType.c2sPlayerMailBoxRequest, mailbox_request);
        }
Exemple #22
0
        //-------------------------------------------------------------------------
        // 请求查找好友
        public void requestFindFriend(string find_info)
        {
            PlayerFriendRequest playerfriend_request;

            playerfriend_request.id   = PlayerFriendRequestId.FindFriend;
            playerfriend_request.data = EbTool.protobufSerialize <string>(find_info);

            DefaultRpcSession.rpc((ushort)MethodType.c2sPlayerFriendRequest, playerfriend_request);
        }
Exemple #23
0
        //-------------------------------------------------------------------------
        // 请求删除好友
        public void requestDeleteFriend(string et_player_guid)
        {
            PlayerFriendRequest playerfriend_request;

            playerfriend_request.id   = PlayerFriendRequestId.DeleteFriend;
            playerfriend_request.data = EbTool.protobufSerialize <string>(et_player_guid);

            DefaultRpcSession.rpc((ushort)MethodType.c2sPlayerFriendRequest, playerfriend_request);
        }
Exemple #24
0
        //-------------------------------------------------------------------------
        // 请求获取好友详细信息
        public void requestGetPlayerInfoFriend(string player_etguid)
        {
            PlayerFriendRequest playerfriend_request;

            playerfriend_request.id   = PlayerFriendRequestId.GetPlayerInfoFriend;
            playerfriend_request.data = EbTool.protobufSerialize <string>(player_etguid);

            DefaultRpcSession.rpc((ushort)MethodType.c2sPlayerRequest, player_etguid);
        }
Exemple #25
0
        //-------------------------------------------------------------------------
        // 玩家观战
        public void requestPlayerOb()
        {
            EbLog.Note("requestPlayerOb");
            DesktopRequest desktop_request;

            desktop_request.id   = DesktopRequestId.PlayerOb;
            desktop_request.data = null;
            DefaultRpcSession.rpc((ushort)MethodType.c2sPlayerDesktopRequest, desktop_request);
        }
Exemple #26
0
    //-------------------------------------------------------------------------
    public void connectBase(string base_ip, int base_port)
    {
        DefaultRpcSession.close();

        DefaultRpcSession.OnSocketConnected = _onSocketConnected;
        DefaultRpcSession.OnSocketClosed    = _onSocketClosed;
        DefaultRpcSession.OnSocketError     = _onSocketError;
        DefaultRpcSession.connect(base_ip, base_port);
    }
Exemple #27
0
        //-------------------------------------------------------------------------
        // 请求邮件操作
        public void requestMailOperate(MailOperate mail_operate)
        {
            PlayerMailBoxRequest mailbox_request;

            mailbox_request.id   = PlayerMailBoxRequestId.MailOperate;
            mailbox_request.data = EbTool.protobufSerialize <MailOperate>(mail_operate);

            DefaultRpcSession.rpc((ushort)MethodType.c2sPlayerMailBoxRequest, mailbox_request);
        }
Exemple #28
0
        //-------------------------------------------------------------------------
        // 请求获取排行榜
        public void requestGetRankingList(RankingListType ranking_list_type)
        {
            PlayerRankingRequest ranking_request;

            ranking_request.id   = PlayerRankingRequestId.GetRankingList;
            ranking_request.data = EbTool.protobufSerialize <RankingListType>(ranking_list_type);

            DefaultRpcSession.rpc((ushort)MethodType.c2sPlayerRankingRequest, ranking_request);
        }
Exemple #29
0
        //-------------------------------------------------------------------------
        public void requestSetupStatus()
        {
            StatusRequest status_request;

            status_request.id   = StatusRequestId.SetupStatus;
            status_request.data = null;

            DefaultRpcSession.rpc((ushort)MethodType.c2sStatusRequest, status_request);
        }
Exemple #30
0
    //-------------------------------------------------------------------------
    public override void init()
    {
        EbLog.Note("ClientSampleNetwork.init()");

        EntityMgr.getDefaultEventPublisher().addHandler(Entity);

        DefaultRpcSession.defRpcMethod <int, string>(1, _onRpcMethod1);

        connectBase("192.168.0.10", 5882);
    }