Пример #1
0
        //---------------------------------------------------------------------
        // 收到好友进桌邀请
        public Task s2sProxyInvitePlayerEnterDesktop(PlayerInfo player_info, string desktop_etguid,
                                                     int sb, int bb, int player_num, int seat_num)
        {
            InvitePlayerEnterDesktop invite = new InvitePlayerEnterDesktop();

            invite.player_info    = player_info;
            invite.desktop_etguid = desktop_etguid;
            invite.sb             = sb;
            invite.bb             = bb;
            invite.player_num     = player_num;
            invite.seat_num       = seat_num;

            PlayerNotify player_notify;

            player_notify.id   = PlayerNotifyId.InvitePlayerEnterDesktop;
            player_notify.data = EbTool.protobufSerialize <InvitePlayerEnterDesktop>(invite);

            MethodData notify_data = new MethodData();

            notify_data.method_id = MethodType.s2cPlayerNotify;
            notify_data.param1    = EbTool.protobufSerialize <PlayerNotify>(player_notify);
            var grain        = Entity.getUserData <GrainCellPlayer>();
            var grain_player = grain.GF.GetGrain <ICellPlayer>(new Guid(Entity.Guid));

            grain_player.s2sNotify(notify_data);

            return(TaskDone.Done);
        }
Пример #2
0
        //-------------------------------------------------------------------------
        // 请求邀请玩家入桌
        public void requestInvitePlayerEnterDesktop(string friend_etguid,
                                                    string desktop_etguid, int sb, int bb, int player_num, int seat_num)
        {
            PlayerInfo player_info = new PlayerInfo();

            player_info.player_etguid = friend_etguid;

            InvitePlayerEnterDesktop invite = new InvitePlayerEnterDesktop();

            invite.player_info    = player_info;
            invite.desktop_etguid = desktop_etguid;
            invite.sb             = sb;
            invite.bb             = bb;
            invite.player_num     = player_num;
            invite.seat_num       = seat_num;

            PlayerRequest player_request;

            player_request.id   = PlayerRequestId.InvitePlayerEnterDesktop;
            player_request.data = EbTool.protobufSerialize <InvitePlayerEnterDesktop>(invite);
            DefaultRpcSession.rpc((ushort)MethodType.c2sPlayerRequest, player_request);
        }