public async global::System.Threading.Tasks.Task HelloWorldAsync(global::automl.HelloWorldStruct input, CancellationToken cancellationToken = default)
            {
                await OutputProtocol.WriteMessageBeginAsync(new TMessage("HelloWorld", TMessageType.Call, SeqId), cancellationToken);

                var args = new InternalStructs.HelloWorldArgs()
                {
                    Input = input,
                };

                await args.WriteAsync(OutputProtocol, cancellationToken);

                await OutputProtocol.WriteMessageEndAsync(cancellationToken);

                await OutputProtocol.Transport.FlushAsync(cancellationToken);

                var msg = await InputProtocol.ReadMessageBeginAsync(cancellationToken);

                if (msg.Type == TMessageType.Exception)
                {
                    var x = await TApplicationException.ReadAsync(InputProtocol, cancellationToken);

                    await InputProtocol.ReadMessageEndAsync(cancellationToken);

                    throw x;
                }

                var result = new InternalStructs.HelloWorldResult();
                await result.ReadAsync(InputProtocol, cancellationToken);

                await InputProtocol.ReadMessageEndAsync(cancellationToken);

                return;
            }
예제 #2
0
            public async Task TestAsync(int _class, int _struct, CancellationToken cancellationToken = default(CancellationToken))
            {
                await OutputProtocol.WriteMessageBeginAsync(new TMessage("Test", TMessageType.Call, SeqId), cancellationToken);

                var args = new TestArgs();

                args._class  = _class;
                args._struct = _struct;

                await args.WriteAsync(OutputProtocol, cancellationToken);

                await OutputProtocol.WriteMessageEndAsync(cancellationToken);

                await OutputProtocol.Transport.FlushAsync(cancellationToken);

                var msg = await InputProtocol.ReadMessageBeginAsync(cancellationToken);

                if (msg.Type == TMessageType.Exception)
                {
                    var x = await TApplicationException.ReadAsync(InputProtocol, cancellationToken);

                    await InputProtocol.ReadMessageEndAsync(cancellationToken);

                    throw x;
                }

                var result = new TestResult();
                await result.ReadAsync(InputProtocol, cancellationToken);

                await InputProtocol.ReadMessageEndAsync(cancellationToken);

                return;
            }
예제 #3
0
            public async Task needSplitAsync(long rootID, TNeedSplitInfo splitInfo, CancellationToken cancellationToken = default(CancellationToken))
            {
                await OutputProtocol.WriteMessageBeginAsync(new TMessage("needSplit", TMessageType.Call, SeqId), cancellationToken);

                var args = new needSplitArgs();

                args.RootID    = rootID;
                args.SplitInfo = splitInfo;

                await args.WriteAsync(OutputProtocol, cancellationToken);

                await OutputProtocol.WriteMessageEndAsync(cancellationToken);

                await OutputProtocol.Transport.FlushAsync(cancellationToken);

                var msg = await InputProtocol.ReadMessageBeginAsync(cancellationToken);

                if (msg.Type == TMessageType.Exception)
                {
                    var x = await TApplicationException.ReadAsync(InputProtocol, cancellationToken);

                    await InputProtocol.ReadMessageEndAsync(cancellationToken);

                    throw x;
                }

                var result = new needSplitResult();
                await result.ReadAsync(InputProtocol, cancellationToken);

                await InputProtocol.ReadMessageEndAsync(cancellationToken);

                return;
            }
        public async Task pingAsync(CancellationToken cancellationToken = default(CancellationToken))
        {
            await OutputProtocol.WriteMessageBeginAsync(new TMessage("ping", TMessageType.Call, SeqId), cancellationToken);

            var args = new pingArgs();

            await args.WriteAsync(OutputProtocol, cancellationToken);

            await OutputProtocol.WriteMessageEndAsync(cancellationToken);

            await OutputProtocol.Transport.FlushAsync(cancellationToken);

            var msg = await InputProtocol.ReadMessageBeginAsync(cancellationToken);

            if (msg.Type == TMessageType.Exception)
            {
                var x = await TApplicationException.ReadAsync(InputProtocol, cancellationToken);

                await InputProtocol.ReadMessageEndAsync(cancellationToken);

                throw x;
            }

            var result = new pingResult();
            await result.ReadAsync(InputProtocol, cancellationToken);

            await InputProtocol.ReadMessageEndAsync(cancellationToken);

            return;
        }
예제 #5
0
            public async Task ShowInGameOverlayAsync(Ruyi.SDK.Overlay.OverlayState arguments, CancellationToken cancellationToken)
            {
                await OutputProtocol.WriteMessageBeginAsync(new TMessage("ShowInGameOverlay", TMessageType.Call, SeqId), cancellationToken);

                var args = new ShowInGameOverlayArgs();

                args.Arguments = arguments;

                await args.WriteAsync(OutputProtocol, cancellationToken);

                await OutputProtocol.WriteMessageEndAsync(cancellationToken);

                await OutputProtocol.Transport.FlushAsync(cancellationToken);

                var msg = await InputProtocol.ReadMessageBeginAsync(cancellationToken);

                if (msg.Type == TMessageType.Exception)
                {
                    var x = await TApplicationException.ReadAsync(InputProtocol, cancellationToken);

                    await InputProtocol.ReadMessageEndAsync(cancellationToken);

                    throw x;
                }

                var result = new ShowInGameOverlayResult();
                await result.ReadAsync(InputProtocol, cancellationToken);

                await InputProtocol.ReadMessageEndAsync(cancellationToken);

                return;
            }
예제 #6
0
            public async Task <List <User> > GetAllAsync(CancellationToken cancellationToken)
            {
                await OutputProtocol.WriteMessageBeginAsync(new TMessage("GetAll", TMessageType.Call, SeqId), cancellationToken);

                var args = new GetAllArgs();

                await args.WriteAsync(OutputProtocol, cancellationToken);

                await OutputProtocol.WriteMessageEndAsync(cancellationToken);

                await OutputProtocol.Transport.FlushAsync(cancellationToken);

                var msg = await InputProtocol.ReadMessageBeginAsync(cancellationToken);

                if (msg.Type == TMessageType.Exception)
                {
                    var x = await TApplicationException.ReadAsync(InputProtocol, cancellationToken);

                    await InputProtocol.ReadMessageEndAsync(cancellationToken);

                    throw x;
                }

                var result = new GetAllResult();
                await result.ReadAsync(InputProtocol, cancellationToken);

                await InputProtocol.ReadMessageEndAsync(cancellationToken);

                if (result.__isset.success)
                {
                    return(result.Success);
                }
                throw new TApplicationException(TApplicationException.ExceptionType.MissingResult, "GetAll failed: unknown result");
            }
예제 #7
0
        public NumberMoveObject(INumberObject _moveNumberObj, InputProtocol _moveType, Vector2 _endPos, float _distanceWithParent)
        {
            moveNumberObj      = _moveNumberObj;
            moveType           = _moveType;
            endPos             = _endPos;
            distanceWithParent = _distanceWithParent;

            switch (moveType)
            {
            case InputProtocol.MoveUp:
            { moveDir = Vector2.up; }
            break;

            case InputProtocol.MoveDown:
            { moveDir = Vector2.down; }
            break;

            case InputProtocol.MoveLeft:
            { moveDir = Vector2.left; }
            break;

            case InputProtocol.MoveRight:
            { moveDir = Vector2.right; }
            break;
            }
        }
예제 #8
0
        public void ModuleUpdate()
        {
            currentInputData = InputProtocol.None;

            if (Input.GetKeyUp(KeyCode.RightArrow))
            {
                currentInputData = InputProtocol.MoveRight;
                //Debug.Log("MoveRight");
            }
            if (Input.GetKeyUp(KeyCode.LeftArrow))
            {
                currentInputData = InputProtocol.MoveLeft;
                //Debug.Log("MoveLeft");
            }
            if (Input.GetKeyUp(KeyCode.UpArrow))
            {
                currentInputData = InputProtocol.MoveUp;
                //Debug.Log("MoveUp");
            }
            if (Input.GetKeyUp(KeyCode.DownArrow))
            {
                currentInputData = InputProtocol.MoveDown;
                //Debug.Log("MoveDown");
            }
        }
예제 #9
0
            public async Task UpdateAsync(Person person, CancellationToken cancellationToken)
            {
                await OutputProtocol.WriteMessageBeginAsync(new TMessage("Update", TMessageType.Call, SeqId), cancellationToken);

                var args = new UpdateArgs();

                args.Person = person;

                await args.WriteAsync(OutputProtocol, cancellationToken);

                await OutputProtocol.WriteMessageEndAsync(cancellationToken);

                await OutputProtocol.Transport.FlushAsync(cancellationToken);

                var msg = await InputProtocol.ReadMessageBeginAsync(cancellationToken);

                if (msg.Type == TMessageType.Exception)
                {
                    var x = await TApplicationException.ReadAsync(InputProtocol, cancellationToken);

                    await InputProtocol.ReadMessageEndAsync(cancellationToken);

                    throw x;
                }

                var result = new UpdateResult();
                await result.ReadAsync(InputProtocol, cancellationToken);

                await InputProtocol.ReadMessageEndAsync(cancellationToken);

                return;
            }
예제 #10
0
 private void ProcessPlayerInput()
 {
     if (GameFramework.singleton.getInput().GetInputData() == InputProtocol.None)
     {
         return;
     }
     currentGameState = GameState.MovingBegin;
     moveType         = GameFramework.singleton.getInput().GetInputData();
 }
예제 #11
0
    void Start()
    {
        receive = new InputProtocol();
        send    = new InputProtocol();

        Commands = new List <KeyCode>();
        client   = new WebSocketClient(
            "ws://127.0.0.1:8899/gameserver", ExecuteCommand);

        client.Start();
    }
예제 #12
0
        private void CaculateMoveObjects(InputProtocol moveType)
        {
            int count = 0;

            if (moveType == InputProtocol.MoveRight || moveType == InputProtocol.MoveLeft)
            {
                count = Rows;
            }

            if (moveType == InputProtocol.MoveUp || moveType == InputProtocol.MoveDown)
            {
                count = Cols;
            }

            int[] startIndexs = new int[count];
            moveObjList.Clear();

            for (int c = 0; c < count; ++c)
            {
                int i = 0;
                int j = 0;
                switch (moveType)
                {
                case InputProtocol.MoveUp:
                { i = Rows - 1; j = c; }
                break;

                case InputProtocol.MoveDown:
                { i = 0; j = c; }
                break;

                case InputProtocol.MoveLeft:
                { i = c; j = 0; }
                break;

                case InputProtocol.MoveRight:
                { i = c; j = Cols - 1; }
                break;
                }

                NumberMoveObject moveObj = getMoveObject(i, j, moveType, null);
                moveObj = deleteEmptyMoveObject(moveObj);
                moveObjList.Add(moveObj);
            }
        }
예제 #13
0
        public async Task <short> getLibraryByIdConsumerAsync(short idConsumer, CancellationToken cancellationToken = default(CancellationToken))
        {
            await OutputProtocol.WriteMessageBeginAsync(new TMessage("getLibraryByIdConsumer", TMessageType.Call, SeqId), cancellationToken);

            var args = new getLibraryByIdConsumerArgs();

            args.IdConsumer = idConsumer;

            await args.WriteAsync(OutputProtocol, cancellationToken);

            await OutputProtocol.WriteMessageEndAsync(cancellationToken);

            await OutputProtocol.Transport.FlushAsync(cancellationToken);

            var msg = await InputProtocol.ReadMessageBeginAsync(cancellationToken);

            if (msg.Type == TMessageType.Exception)
            {
                var x = await TApplicationException.ReadAsync(InputProtocol, cancellationToken);

                await InputProtocol.ReadMessageEndAsync(cancellationToken);

                throw x;
            }

            var result = new getLibraryByIdConsumerResult();
            await result.ReadAsync(InputProtocol, cancellationToken);

            await InputProtocol.ReadMessageEndAsync(cancellationToken);

            if (result.__isset.success)
            {
                return(result.Success);
            }
            if (result.__isset.sErrorNotFoundE)
            {
                throw result.SErrorNotFoundE;
            }
            if (result.__isset.sErrorSystemE)
            {
                throw result.SErrorSystemE;
            }
            throw new TApplicationException(TApplicationException.ExceptionType.MissingResult, "getLibraryByIdConsumer failed: unknown result");
        }
예제 #14
0
        public async Task <SpotNearbyResponse> lookupNearbyAsync(Location location, SpotCategory category, string query, string countryAreaCode, CancellationToken cancellationToken)
        {
            await OutputProtocol.WriteMessageBeginAsync(new TMessage("lookupNearby", TMessageType.Call, SeqId), cancellationToken);

            var args = new lookupNearbyArgs();

            args.Location        = location;
            args.Category        = category;
            args.Query           = query;
            args.CountryAreaCode = countryAreaCode;

            await args.WriteAsync(OutputProtocol, cancellationToken);

            await OutputProtocol.WriteMessageEndAsync(cancellationToken);

            await OutputProtocol.Transport.FlushAsync(cancellationToken);

            var msg = await InputProtocol.ReadMessageBeginAsync(cancellationToken);

            if (msg.Type == TMessageType.Exception)
            {
                var x = await TApplicationException.ReadAsync(InputProtocol, cancellationToken);

                await InputProtocol.ReadMessageEndAsync(cancellationToken);

                throw x;
            }

            var result = new lookupNearbyResult();
            await result.ReadAsync(InputProtocol, cancellationToken);

            await InputProtocol.ReadMessageEndAsync(cancellationToken);

            if (result.__isset.success)
            {
                return(result.Success);
            }
            if (result.__isset.e)
            {
                throw result.E;
            }
            throw new TApplicationException(TApplicationException.ExceptionType.MissingResult, "lookupNearby failed: unknown result");
        }
예제 #15
0
        public async Task <SnsFriends> getSnsFriendsAsync(SnsIdType snsIdType, string snsAccessToken, int startIdx, int limit, CancellationToken cancellationToken)
        {
            await OutputProtocol.WriteMessageBeginAsync(new TMessage("getSnsFriends", TMessageType.Call, SeqId), cancellationToken);

            var args = new getSnsFriendsArgs();

            args.SnsIdType      = snsIdType;
            args.SnsAccessToken = snsAccessToken;
            args.StartIdx       = startIdx;
            args.Limit          = limit;

            await args.WriteAsync(OutputProtocol, cancellationToken);

            await OutputProtocol.WriteMessageEndAsync(cancellationToken);

            await OutputProtocol.Transport.FlushAsync(cancellationToken);

            var msg = await InputProtocol.ReadMessageBeginAsync(cancellationToken);

            if (msg.Type == TMessageType.Exception)
            {
                var x = await TApplicationException.ReadAsync(InputProtocol, cancellationToken);

                await InputProtocol.ReadMessageEndAsync(cancellationToken);

                throw x;
            }

            var result = new getSnsFriendsResult();
            await result.ReadAsync(InputProtocol, cancellationToken);

            await InputProtocol.ReadMessageEndAsync(cancellationToken);

            if (result.__isset.success)
            {
                return(result.Success);
            }
            if (result.__isset.e)
            {
                throw result.E;
            }
            throw new TApplicationException(TApplicationException.ExceptionType.MissingResult, "getSnsFriends failed: unknown result");
        }
예제 #16
0
            public async global::System.Threading.Tasks.Task <THashSet <THashSet <THashSet <global::OptReqDefTest.Distance> > > > DoItNowAsync(List <List <List <global::OptReqDefTest.RaceDetails> > > rd, int mitDefault, CancellationToken cancellationToken = default)
            {
                await OutputProtocol.WriteMessageBeginAsync(new TMessage("DoItNow", TMessageType.Call, SeqId), cancellationToken);

                var args = new InternalStructs.DoItNowArgs()
                {
                    Rd         = rd,
                    MitDefault = mitDefault,
                };

                await args.WriteAsync(OutputProtocol, cancellationToken);

                await OutputProtocol.WriteMessageEndAsync(cancellationToken);

                await OutputProtocol.Transport.FlushAsync(cancellationToken);

                var msg = await InputProtocol.ReadMessageBeginAsync(cancellationToken);

                if (msg.Type == TMessageType.Exception)
                {
                    var x = await TApplicationException.ReadAsync(InputProtocol, cancellationToken);

                    await InputProtocol.ReadMessageEndAsync(cancellationToken);

                    throw x;
                }

                var result = new InternalStructs.DoItNowResult();
                await result.ReadAsync(InputProtocol, cancellationToken);

                await InputProtocol.ReadMessageEndAsync(cancellationToken);

                if (result.__isset.success)
                {
                    return(result.Success);
                }
                if (result.__isset.cbb)
                {
                    throw result.Cbb;
                }
                throw new TApplicationException(TApplicationException.ExceptionType.MissingResult, "DoItNow failed: unknown result");
            }
예제 #17
0
        public async Task <MessageOperations> fetchMessageOperationsAsync(long localRevision, long lastOpTimestamp, int count, CancellationToken cancellationToken)
        {
            await OutputProtocol.WriteMessageBeginAsync(new TMessage("fetchMessageOperations", TMessageType.Call, SeqId), cancellationToken);

            var args = new fetchMessageOperationsArgs();

            args.LocalRevision   = localRevision;
            args.LastOpTimestamp = lastOpTimestamp;
            args.Count           = count;

            await args.WriteAsync(OutputProtocol, cancellationToken);

            await OutputProtocol.WriteMessageEndAsync(cancellationToken);

            await OutputProtocol.Transport.FlushAsync(cancellationToken);

            var msg = await InputProtocol.ReadMessageBeginAsync(cancellationToken);

            if (msg.Type == TMessageType.Exception)
            {
                var x = await TApplicationException.ReadAsync(InputProtocol, cancellationToken);

                await InputProtocol.ReadMessageEndAsync(cancellationToken);

                throw x;
            }

            var result = new fetchMessageOperationsResult();
            await result.ReadAsync(InputProtocol, cancellationToken);

            await InputProtocol.ReadMessageEndAsync(cancellationToken);

            if (result.__isset.success)
            {
                return(result.Success);
            }
            if (result.__isset.e)
            {
                throw result.E;
            }
            throw new TApplicationException(TApplicationException.ExceptionType.MissingResult, "fetchMessageOperations failed: unknown result");
        }
예제 #18
0
            public async global::System.Threading.Tasks.Task <global::Thrift5320.enums.Task> TaskAsync(global::Thrift5320.structs.Task foo, global::Thrift5320.Task.Foobar bar, CancellationToken cancellationToken = default)
            {
                await OutputProtocol.WriteMessageBeginAsync(new TMessage("Task", TMessageType.Call, SeqId), cancellationToken);

                var args = new InternalStructs.TaskArgs()
                {
                    Foo = foo,
                    Bar = bar,
                };

                await args.WriteAsync(OutputProtocol, cancellationToken);

                await OutputProtocol.WriteMessageEndAsync(cancellationToken);

                await OutputProtocol.Transport.FlushAsync(cancellationToken);

                var msg = await InputProtocol.ReadMessageBeginAsync(cancellationToken);

                if (msg.Type == TMessageType.Exception)
                {
                    var x = await TApplicationException.ReadAsync(InputProtocol, cancellationToken);

                    await InputProtocol.ReadMessageEndAsync(cancellationToken);

                    throw x;
                }

                var result = new InternalStructs.TaskResult();
                await result.ReadAsync(InputProtocol, cancellationToken);

                await InputProtocol.ReadMessageEndAsync(cancellationToken);

                if (result.__isset.success)
                {
                    return(result.Success);
                }
                if (result.__isset.error)
                {
                    throw result.Error;
                }
                throw new TApplicationException(TApplicationException.ExceptionType.MissingResult, "Task failed: unknown result");
            }
예제 #19
0
            public async global::System.Threading.Tasks.Task <global::APIGateway.Thrift.Generated.NotificationTypes.NotificationQueueResponse> SendNotificationAsync(global::APIGateway.Thrift.Generated.NotificationTypes.NotificationQueueRequest queueRequest, CancellationToken cancellationToken = default)
            {
                await OutputProtocol.WriteMessageBeginAsync(new TMessage("SendNotification", TMessageType.Call, SeqId), cancellationToken);

                var args = new InternalStructs.SendNotificationArgs()
                {
                    QueueRequest = queueRequest,
                };

                await args.WriteAsync(OutputProtocol, cancellationToken);

                await OutputProtocol.WriteMessageEndAsync(cancellationToken);

                await OutputProtocol.Transport.FlushAsync(cancellationToken);

                var msg = await InputProtocol.ReadMessageBeginAsync(cancellationToken);

                if (msg.Type == TMessageType.Exception)
                {
                    var x = await TApplicationException.ReadAsync(InputProtocol, cancellationToken);

                    await InputProtocol.ReadMessageEndAsync(cancellationToken);

                    throw x;
                }

                var result = new InternalStructs.SendNotificationResult();
                await result.ReadAsync(InputProtocol, cancellationToken);

                await InputProtocol.ReadMessageEndAsync(cancellationToken);

                if (result.__isset.success)
                {
                    return(result.Success);
                }
                if (result.__isset.ne)
                {
                    throw result.Ne;
                }
                throw new TApplicationException(TApplicationException.ExceptionType.MissingResult, "SendNotification failed: unknown result");
            }
예제 #20
0
            public async Task <int> calculateAsync(int logid, Work w, CancellationToken cancellationToken)
            {
                await OutputProtocol.WriteMessageBeginAsync(new TMessage("calculate", TMessageType.Call, SeqId), cancellationToken);

                var args = new calculateArgs();

                args.Logid = logid;
                args.W     = w;

                await args.WriteAsync(OutputProtocol, cancellationToken);

                await OutputProtocol.WriteMessageEndAsync(cancellationToken);

                await OutputProtocol.Transport.FlushAsync(cancellationToken);

                var msg = await InputProtocol.ReadMessageBeginAsync(cancellationToken);

                if (msg.Type == TMessageType.Exception)
                {
                    var x = await TApplicationException.ReadAsync(InputProtocol, cancellationToken);

                    await InputProtocol.ReadMessageEndAsync(cancellationToken);

                    throw x;
                }

                var result = new calculateResult();
                await result.ReadAsync(InputProtocol, cancellationToken);

                await InputProtocol.ReadMessageEndAsync(cancellationToken);

                if (result.__isset.success)
                {
                    return(result.Success);
                }
                if (result.__isset.ouch)
                {
                    throw result.Ouch;
                }
                throw new TApplicationException(TApplicationException.ExceptionType.MissingResult, "calculate failed: unknown result");
            }
예제 #21
0
            public async Task <Ruyi.SDK.UserServiceExternal.UserInfo_Public> GetPlayingUserInfoAsync(string appId, string userId, CancellationToken cancellationToken)
            {
                await OutputProtocol.WriteMessageBeginAsync(new TMessage("GetPlayingUserInfo", TMessageType.Call, SeqId), cancellationToken);

                var args = new GetPlayingUserInfoArgs();

                args.AppId  = appId;
                args.UserId = userId;

                await args.WriteAsync(OutputProtocol, cancellationToken);

                await OutputProtocol.WriteMessageEndAsync(cancellationToken);

                await OutputProtocol.Transport.FlushAsync(cancellationToken);

                var msg = await InputProtocol.ReadMessageBeginAsync(cancellationToken);

                if (msg.Type == TMessageType.Exception)
                {
                    var x = await TApplicationException.ReadAsync(InputProtocol, cancellationToken);

                    await InputProtocol.ReadMessageEndAsync(cancellationToken);

                    throw x;
                }

                var result = new GetPlayingUserInfoResult();
                await result.ReadAsync(InputProtocol, cancellationToken);

                await InputProtocol.ReadMessageEndAsync(cancellationToken);

                if (result.__isset.success)
                {
                    return(result.Success);
                }
                if (result.__isset.error1)
                {
                    throw result.Error1;
                }
                throw new TApplicationException(TApplicationException.ExceptionType.MissingResult, "GetPlayingUserInfo failed: unknown result");
            }
예제 #22
0
        public async Task <SpotPhoneNumberResponse> lookupByPhoneNumberAsync(string countryAreaCode, string phoneNumber, CancellationToken cancellationToken)
        {
            await OutputProtocol.WriteMessageBeginAsync(new TMessage("lookupByPhoneNumber", TMessageType.Call, SeqId), cancellationToken);

            var args = new lookupByPhoneNumberArgs();

            args.CountryAreaCode = countryAreaCode;
            args.PhoneNumber     = phoneNumber;

            await args.WriteAsync(OutputProtocol, cancellationToken);

            await OutputProtocol.WriteMessageEndAsync(cancellationToken);

            await OutputProtocol.Transport.FlushAsync(cancellationToken);

            var msg = await InputProtocol.ReadMessageBeginAsync(cancellationToken);

            if (msg.Type == TMessageType.Exception)
            {
                var x = await TApplicationException.ReadAsync(InputProtocol, cancellationToken);

                await InputProtocol.ReadMessageEndAsync(cancellationToken);

                throw x;
            }

            var result = new lookupByPhoneNumberResult();
            await result.ReadAsync(InputProtocol, cancellationToken);

            await InputProtocol.ReadMessageEndAsync(cancellationToken);

            if (result.__isset.success)
            {
                return(result.Success);
            }
            if (result.__isset.e)
            {
                throw result.E;
            }
            throw new TApplicationException(TApplicationException.ExceptionType.MissingResult, "lookupByPhoneNumber failed: unknown result");
        }
예제 #23
0
        private void GetMoveDirection()
        {
            float angle = (Vector2.SignedAngle(new Vector2(1, 0), endPoint - startPoint));

            if (angle < 30 && angle > -30)
            {
                InputData = InputProtocol.MoveRight;
            }
            else if (angle > 60 && angle < 120)
            {
                InputData = InputProtocol.MoveUp;
            }
            else if (angle > 150 && angle < -150)
            {
                InputData = InputProtocol.MoveLeft;
            }
            else if (angle > -120 && angle < -60)
            {
                InputData = InputProtocol.MoveDown;
            }
        }
예제 #24
0
        public async Task <List <LastReadMessageIds> > multiGetLastReadMessageIdsAsync(List <string> chatIds, CancellationToken cancellationToken)
        {
            await OutputProtocol.WriteMessageBeginAsync(new TMessage("multiGetLastReadMessageIds", TMessageType.Call, SeqId), cancellationToken);

            var args = new multiGetLastReadMessageIdsArgs();

            args.ChatIds = chatIds;

            await args.WriteAsync(OutputProtocol, cancellationToken);

            await OutputProtocol.WriteMessageEndAsync(cancellationToken);

            await OutputProtocol.Transport.FlushAsync(cancellationToken);

            var msg = await InputProtocol.ReadMessageBeginAsync(cancellationToken);

            if (msg.Type == TMessageType.Exception)
            {
                var x = await TApplicationException.ReadAsync(InputProtocol, cancellationToken);

                await InputProtocol.ReadMessageEndAsync(cancellationToken);

                throw x;
            }

            var result = new multiGetLastReadMessageIdsResult();
            await result.ReadAsync(InputProtocol, cancellationToken);

            await InputProtocol.ReadMessageEndAsync(cancellationToken);

            if (result.__isset.success)
            {
                return(result.Success);
            }
            if (result.__isset.e)
            {
                throw result.E;
            }
            throw new TApplicationException(TApplicationException.ExceptionType.MissingResult, "multiGetLastReadMessageIds failed: unknown result");
        }
예제 #25
0
        public async Task <BotUseInfo> getBotUseInfoAsync(string botMid, CancellationToken cancellationToken)
        {
            await OutputProtocol.WriteMessageBeginAsync(new TMessage("getBotUseInfo", TMessageType.Call, SeqId), cancellationToken);

            var args = new getBotUseInfoArgs();

            args.BotMid = botMid;

            await args.WriteAsync(OutputProtocol, cancellationToken);

            await OutputProtocol.WriteMessageEndAsync(cancellationToken);

            await OutputProtocol.Transport.FlushAsync(cancellationToken);

            var msg = await InputProtocol.ReadMessageBeginAsync(cancellationToken);

            if (msg.Type == TMessageType.Exception)
            {
                var x = await TApplicationException.ReadAsync(InputProtocol, cancellationToken);

                await InputProtocol.ReadMessageEndAsync(cancellationToken);

                throw x;
            }

            var result = new getBotUseInfoResult();
            await result.ReadAsync(InputProtocol, cancellationToken);

            await InputProtocol.ReadMessageEndAsync(cancellationToken);

            if (result.__isset.success)
            {
                return(result.Success);
            }
            if (result.__isset.e)
            {
                throw result.E;
            }
            throw new TApplicationException(TApplicationException.ExceptionType.MissingResult, "getBotUseInfo failed: unknown result");
        }
예제 #26
0
        public async Task sendChatCheckedByWatermarkAsync(int seq, string mid, long watermark, sbyte sessionId, CancellationToken cancellationToken)
        {
            await OutputProtocol.WriteMessageBeginAsync(new TMessage("sendChatCheckedByWatermark", TMessageType.Call, SeqId), cancellationToken);

            var args = new sendChatCheckedByWatermarkArgs();

            args.Seq       = seq;
            args.Mid       = mid;
            args.Watermark = watermark;
            args.SessionId = sessionId;

            await args.WriteAsync(OutputProtocol, cancellationToken);

            await OutputProtocol.WriteMessageEndAsync(cancellationToken);

            await OutputProtocol.Transport.FlushAsync(cancellationToken);

            var msg = await InputProtocol.ReadMessageBeginAsync(cancellationToken);

            if (msg.Type == TMessageType.Exception)
            {
                var x = await TApplicationException.ReadAsync(InputProtocol, cancellationToken);

                await InputProtocol.ReadMessageEndAsync(cancellationToken);

                throw x;
            }

            var result = new sendChatCheckedByWatermarkResult();
            await result.ReadAsync(InputProtocol, cancellationToken);

            await InputProtocol.ReadMessageEndAsync(cancellationToken);

            if (result.__isset.e)
            {
                throw result.E;
            }
            return;
        }
예제 #27
0
        public async Task postSnsInvitationMessageAsync(SnsIdType snsIdType, string snsAccessToken, string toSnsUserId, CancellationToken cancellationToken)
        {
            await OutputProtocol.WriteMessageBeginAsync(new TMessage("postSnsInvitationMessage", TMessageType.Call, SeqId), cancellationToken);

            var args = new postSnsInvitationMessageArgs();

            args.SnsIdType      = snsIdType;
            args.SnsAccessToken = snsAccessToken;
            args.ToSnsUserId    = toSnsUserId;

            await args.WriteAsync(OutputProtocol, cancellationToken);

            await OutputProtocol.WriteMessageEndAsync(cancellationToken);

            await OutputProtocol.Transport.FlushAsync(cancellationToken);

            var msg = await InputProtocol.ReadMessageBeginAsync(cancellationToken);

            if (msg.Type == TMessageType.Exception)
            {
                var x = await TApplicationException.ReadAsync(InputProtocol, cancellationToken);

                await InputProtocol.ReadMessageEndAsync(cancellationToken);

                throw x;
            }

            var result = new postSnsInvitationMessageResult();
            await result.ReadAsync(InputProtocol, cancellationToken);

            await InputProtocol.ReadMessageEndAsync(cancellationToken);

            if (result.__isset.e)
            {
                throw result.E;
            }
            return;
        }
            public async global::System.Threading.Tasks.Task <global::PElementServer.Thrift.PElement> @GetAsync(string name, CancellationToken cancellationToken = default)
            {
                await OutputProtocol.WriteMessageBeginAsync(new TMessage("Get", TMessageType.Call, SeqId), cancellationToken);

                var args = new InternalStructs.GetArgs()
                {
                    Name = name,
                };

                await args.WriteAsync(OutputProtocol, cancellationToken);

                await OutputProtocol.WriteMessageEndAsync(cancellationToken);

                await OutputProtocol.Transport.FlushAsync(cancellationToken);

                var msg = await InputProtocol.ReadMessageBeginAsync(cancellationToken);

                if (msg.Type == TMessageType.Exception)
                {
                    var x = await TApplicationException.ReadAsync(InputProtocol, cancellationToken);

                    await InputProtocol.ReadMessageEndAsync(cancellationToken);

                    throw x;
                }

                var result = new InternalStructs.GetResult();
                await result.ReadAsync(InputProtocol, cancellationToken);

                await InputProtocol.ReadMessageEndAsync(cancellationToken);

                if (result.__isset.success)
                {
                    return(result.Success);
                }
                throw new TApplicationException(TApplicationException.ExceptionType.MissingResult, "Get failed: unknown result");
            }
예제 #29
0
            public async Task <int> @AddAsync(int num1, int num2, CancellationToken cancellationToken = default(CancellationToken))
            {
                await OutputProtocol.WriteMessageBeginAsync(new TMessage("Add", TMessageType.Call, SeqId), cancellationToken);

                var args = new AddArgs();

                args.Num1 = num1;
                args.Num2 = num2;

                await args.WriteAsync(OutputProtocol, cancellationToken);

                await OutputProtocol.WriteMessageEndAsync(cancellationToken);

                await OutputProtocol.Transport.FlushAsync(cancellationToken);

                var msg = await InputProtocol.ReadMessageBeginAsync(cancellationToken);

                if (msg.Type == TMessageType.Exception)
                {
                    var x = await TApplicationException.ReadAsync(InputProtocol, cancellationToken);

                    await InputProtocol.ReadMessageEndAsync(cancellationToken);

                    throw x;
                }

                var result = new AddResult();
                await result.ReadAsync(InputProtocol, cancellationToken);

                await InputProtocol.ReadMessageEndAsync(cancellationToken);

                if (result.__isset.success)
                {
                    return(result.Success);
                }
                throw new TApplicationException(TApplicationException.ExceptionType.MissingResult, "Add failed: unknown result");
            }
            public async global::System.Threading.Tasks.Task <List <global::Jaeger.Thrift.BatchSubmitResponse> > submitBatchesAsync(List <global::Jaeger.Thrift.Batch> batches, CancellationToken cancellationToken = default)
            {
                await OutputProtocol.WriteMessageBeginAsync(new TMessage("submitBatches", TMessageType.Call, SeqId), cancellationToken);

                var args = new InternalStructs.submitBatchesArgs()
                {
                    Batches = batches,
                };

                await args.WriteAsync(OutputProtocol, cancellationToken);

                await OutputProtocol.WriteMessageEndAsync(cancellationToken);

                await OutputProtocol.Transport.FlushAsync(cancellationToken);

                var msg = await InputProtocol.ReadMessageBeginAsync(cancellationToken);

                if (msg.Type == TMessageType.Exception)
                {
                    var x = await TApplicationException.ReadAsync(InputProtocol, cancellationToken);

                    await InputProtocol.ReadMessageEndAsync(cancellationToken);

                    throw x;
                }

                var result = new InternalStructs.submitBatchesResult();
                await result.ReadAsync(InputProtocol, cancellationToken);

                await InputProtocol.ReadMessageEndAsync(cancellationToken);

                if (result.__isset.success)
                {
                    return(result.Success);
                }
                throw new TApplicationException(TApplicationException.ExceptionType.MissingResult, "submitBatches failed: unknown result");
            }