Example #1
0
        private static void GameSearchLogicStart()
        {
            BitmapSource capturedImage   = ScreenCapture.GetGameType(gameWindowX, gameWindowY);
            string       googleApiResult = SocketObject.GetImageSearching(LoginViewModel.LoginUser, ImageSearchClass.BufferFromImage(capturedImage));

            if (googleApiResult != null && googleApiResult != string.Empty)
            {
                googleApiResult = googleApiResult.Split('\n')[1].Split('\n')[0];
            }
            if (googleApiResult == "비공개 선택")
            {
                gameType = GameType.비공개_선택;
            }
            else if (googleApiResult == "개인/2인 랭크 게임")
            {
                gameType = GameType.랭크_게임;
            }
            else if (googleApiResult == "무작위 총력전")
            {
                gameType = GameType.무작위_총력전;
            }
            else
            {
                //Debug.Assert(false);
            }
            Debug.WriteLine("게임 타입 : " + googleApiResult);
            return;
        }
Example #2
0
        private static async Task AddUsers()
        {
            BitmapSource capturedImage = await ScreenCapture.GetUsersAllImageAsync(gameWindowX, gameWindowY, gameType);

            string googleApiResult = SocketObject.GetImageSearching(LoginViewModel.LoginUser, ImageSearchClass.BufferFromImage(capturedImage));

            if (googleApiResult == null || googleApiResult == string.Empty)
            {
                Debug.Assert(false);
                return;
            }

            string[] googleAPIResuluts = googleApiResult.Split('\n');
            if (gameType == GameType.비공개_선택)
            {
                for (int index = 0; index < googleAPIResuluts.Length; index++)
                {
                    if (index % 2 == 0)
                    {
                        continue;
                    }
                    GameUser user = await CreateUserAsync(googleAPIResuluts[index]);

                    user.index = index / 2;
                    Users.Add(user);
                }
            }
            else if (gameType == GameType.무작위_총력전)
            {
                for (int index = 0; index < googleAPIResuluts.Length; index++)
                {
                    GameUser user = await CreateUserAsync(googleAPIResuluts[index]);

                    user.index = index;
                    Users.Add(user);
                }
            }
            else if (gameType == GameType.랭크_게임)
            {
                for (int index = 0; index < googleAPIResuluts.Length; index++)
                {
                    if (googleAPIResuluts[index] == "상단 (탑)" ||
                        googleAPIResuluts[index] == "중단 (미드)" ||
                        googleAPIResuluts[index] == "정글" ||
                        googleAPIResuluts[index] == "하단 (봇)" ||
                        googleAPIResuluts[index] == "서포터" ||
                        googleAPIResuluts[index] == "희망 챔피언 선택" ||
                        googleAPIResuluts[index] == string.Empty)
                    {
                        continue;
                    }
                    GameUser user = await CreateUserAsync(googleAPIResuluts[index]);

                    user.index = index / 2;
                    Users.Add(user);
                }
            }
        }