Пример #1
0
    public override void GetInput(InputParams _input)
    {
        t += Time.deltaTime;

        if (t > 1f)
        {

            float minDist = 1000000000;
            Transform target = null;
            foreach (var pl in GameController.Instance.playerController.currentPlayers)
            {
                if (pl == null) continue;
                float distance = (pl.transform.position - transform.position).magnitude;
                if (distance < minDist)
                {
                    minDist = distance;
                    target = pl.transform;
                }
            }

            if (target != null)
            {
                t = 0.0f;
                _input.Clear();
                var dist = target.position - transform.position;
                if (Mathf.Abs(dist.x) > Mathf.Abs(dist.y))
                    _input.x = Mathf.Sign(dist.x);
                else
                    _input.y = Mathf.Sign(dist.y);
            }

        }
    }
Пример #2
0
    public override void Move(InputParams _input)
    {
        float dx = 0;

        if (!onPlatform) {
            current_speed.y = current_speed.y + acceleration.y * Time.deltaTime - gravity*Time.deltaTime;
            transform.position = transform.position + Time.deltaTime*(transform.up*current_speed.y+transform.right*current_speed.x);
        }

        if (onPlatform) {
            if (!isJumping && _input.fire) {

                isJumping = true;
                onPlatform = false;

                current_speed.y = 15f + current_speed.y + acceleration.y * Time.deltaTime - gravity*Time.deltaTime;

            }

            transform.position = transform.position + Time.deltaTime*(transform.up*current_speed.y+transform.right*current_speed.x);

        }

        if (_input.x != 0)
            current_speed.x = Mathf.Sign(_input.x) * speed;
        else current_speed.x = 0;

        if (current_speed.y < -maxSpeed)
            current_speed.y = -maxSpeed;
    }
Пример #3
0
 public override void Fire(InputParams _input)
 {
     if (fire_enabled) {
         Instantiate (missile, transform.position + transform.up * .7f, transform.rotation);
         fire_enabled = false;
         SoundManager.instance.PlayFire();
         StartCoroutine(CannotFire());
     }
 }
    public IAsyncResult BeginProcessRequest(HttpContext context, AsyncCallback cb, Object extraData)
    {
        TransportClassMainAshx oTransportClassMainAshx = new TransportClassMainAshx(context, cb);
        ErrorTypes eError = ErrorTypes.NoError;
        try
        {
            _log.Info("Starting process request...");
            _log.Info(context.Request.QueryString.ToString());
            
            InputParams oInputParams = new InputParams();
            oInputParams.m_sKey = context.Request.QueryString["key"];
            oInputParams.m_svKey = context.Request.QueryString["vkey"];
            oInputParams.m_sUrl = context.Request.QueryString["url"];
            oInputParams.m_sEmbeddedfonts = context.Request.QueryString["embeddedfonts"];

            int nIndexSep = oInputParams.m_sUrl.IndexOf(',');
            if (-1 != nIndexSep)
                oInputParams.m_sUrl = oInputParams.m_sUrl.Substring(0, nIndexSep);
            oInputParams.m_sTitle = context.Request.QueryString["title"];
            if (string.IsNullOrEmpty(oInputParams.m_sTitle))
                oInputParams.m_sTitle = "convert";
            oInputParams.m_sFiletype = context.Request.QueryString["filetype"];
            oInputParams.m_nOutputtype = FileFormats.FromString(context.Request.QueryString["outputtype"]);
            oInputParams.m_bAsyncConvert = Convert.ToBoolean(context.Request.QueryString["async"]);
            oInputParams.m_sCodepage = context.Request.QueryString["codePage"];
            oInputParams.m_sDelimiter = context.Request.QueryString["delimiter"];

            if (ErrorTypes.NoError == eError)
            {
                ITaskResultInterface oTaskResult = TaskResult.NewTaskResult();
                TaskResultData oToAdd = new TaskResultData();
                
                oInputParams.m_sKey = "conv_" + oInputParams.m_sKey;
                oToAdd.sKey = oInputParams.m_sKey;
                oToAdd.sFormat = oInputParams.m_sFiletype;
                oToAdd.eStatus = FileStatus.WaitQueue;
                oToAdd.sTitle = oInputParams.m_sTitle;
                TransportClass1 oTransportClass1 = new TransportClass1(oTransportClassMainAshx, oTaskResult, new CTaskQueue(), oInputParams);
                oTaskResult.GetOrCreateBegin(oInputParams.m_sKey, oToAdd, GetOrCreateCallback, oTransportClass1);
            }
        }
        catch(Exception e)
        {
            eError = ErrorTypes.Unknown;
            
            _log.Error(context.Request.QueryString.ToString());
            _log.Error("Exeption: ", e);
        }
        finally
        {
            if( ErrorTypes.NoError != eError )
                WriteOutputCommand(oTransportClassMainAshx, new OutputCommand(null, null, null, eError));
        }
        return new AsyncOperationData(extraData);
    }
 private static DeploymentInfo GetDeploymentInfo(InputParams inputParams)
 {
     return
     new DeploymentInfo(
       Guid.NewGuid(),
       false,
       "project_name",
       "project_configuration_name",
       "project_configuration_build_id",
       "target_environment_name",
       inputParams);
 }
        public string Post(InputParams p)
        {
            // 메일 주소로 메일 전송 - 회원 가입 확인(메일 주소 체크) 등 - 관리자 또는 특수 조건 하에 회원 호출
            Logging.CBLoggers logMessage = new Logging.CBLoggers();
            string jsonParam = JsonConvert.SerializeObject(p);

            try
            {
                using (SqlConnection connection = new SqlConnection(globalVal.DBConnectionString))
                {
                    using (SqlCommand command = new SqlCommand("CloudBread.uspSelSendEmailToMember", connection))
                    {
                        command.CommandType = CommandType.StoredProcedure;
                        command.Parameters.Add("@MemberID", SqlDbType.NVarChar, -1).Value = p.memberID;
                        connection.Open();
                        using (SqlDataReader dreader = command.ExecuteReader())
                        {
                            while (dreader.Read())
                            {
                                result = dreader[0].ToString();
                            }
                            //////////////////////////////////////////////////////////////////////////////////////
                            // 메일 전송 루틴 - CloudBreadlib/BAL/SendSMTPMail 참조
                            //방화벽, 안티바이러스 등 outbound 체크
                            //SendEmail 찾아가서 인증 정보 등 변경할 것
                            //string s = SendSMTPMail.SendEmail(dreader[0].ToString(), "제목", "내용");
                            //Debug.WriteLine(s);
                            //////////////////////////////////////////////////////////////////////////////////////

                            dreader.Close();
                        }
                        connection.Close();

                        return result;
                    }

                }
            }

            catch (Exception ex)
            {
                //에러로그
                logMessage.memberID = p.memberID;
                logMessage.Level = "ERROR";
                logMessage.Logger = "CBSelSendEmailToMemberController";
                logMessage.Message = jsonParam;
                logMessage.Exception = ex.ToString();
                Logging.RunLog(logMessage);

                throw ;
            }
        }
Пример #7
0
 public override void Move(InputParams _input)
 {
     if (is_vertical) {
         Debug.LogError("VERTICALE");
         if (_input.y < 0)
             transform.position += Vector3.down * Time.deltaTime * speed;
         if (_input.y > 0)
             transform.position += Vector3.up * Time.deltaTime * speed;
     } else {
         if (_input.x < 0)
             transform.position += Vector3.left * Time.deltaTime * speed;
         if (_input.x > 0)
             transform.position += Vector3.right * Time.deltaTime * speed;
     }
 }
Пример #8
0
    //private Vector3 direction = Vector3.up;
    public override void Move(InputParams _input)
    {
        //Debug.Log(direction);
        var tmpPos = this.transform.position;
        //tmpPos.x += _input.x * speed * Time.deltaTime;
        //tmpPos.y += _input.y * speed * Time.deltaTime;

        tmpPos += transform.up * _input.y * speed * Time.deltaTime;

        transform.up = Quaternion.AngleAxis(rotSpeed * Time.deltaTime * _input.x * rotDirection, Vector3.forward) * transform.up;

        //transform.up = direction;

        this.transform.position = tmpPos;

        Debug.DrawLine(this.transform.position, this.transform.position + transform.up * 2);
    }
Пример #9
0
    public override void Move(InputParams _input)
    {
        if (_input.y != 0) {
            if (_input.y < 0)
                transform.position += Vector3.down * Time.deltaTime * speed;
            if (_input.y > 0)
                transform.position += Vector3.up * Time.deltaTime * speed;
        } else {

            if (_input.x != 0) {
                if (_input.x < 0)
                    transform.position += Vector3.left * Time.deltaTime * speed;
                if (_input.x > 0)
                    transform.position += Vector3.right * Time.deltaTime * speed;
            }
        }
    }
Пример #10
0
    public override void Move(InputParams _input)
    {
        var tmpPos = this.transform.position;

        tmpPos.y -= fallSpeed * Time.deltaTime;

        //Interazione con il muro (cambio di direzione o morte)
        if (transform.position.x >= ConstVar.X_LIMIT - 1f)
        {
               tmpPos.y -= 3f * Time.deltaTime;
               if (transform.position.x >= ConstVar.X_LIMIT - 0.5f)
               {
                   if (transform.position.x >= ConstVar.X_LIMIT - 0.5f && transform.position.x <= ConstVar.X_LIMIT - 0.4f && Random.Range(0, 100) < deathProbability)
                   {
                       Destroy(this.gameObject);
                       Debug.Log("caco");
                   }
                   else
                       direction.x = -1;
               }
        }
        else if (transform.position.x <= -1*(ConstVar.X_LIMIT - 1f))
        {
            tmpPos.y -= 3f * Time.deltaTime;
            if (transform.position.x <= -1*(ConstVar.X_LIMIT - 0.5f))
            {
                if (transform.position.x == -1 * (ConstVar.X_LIMIT - 0.5f) && transform.position.x == -1 * (ConstVar.X_LIMIT - 0.4f) && Random.Range(0, 100) < deathProbability)
                {
                    Destroy(this.gameObject);
                    Debug.Log("caco");
                }
                else
                    direction.x = 1;
            }
        }

        //Interazioni con il limite inferiore della scena
        //if (transform.position.y <= -1*(ConstVar.Y_LIMIT - 0.5f))
        //{
        //Destroy(this.gameObject);
        // }

        //normal flow
        tmpPos += direction * speed * Time.deltaTime;
        this.transform.position = tmpPos;
    }
        public string Post(InputParams p)
        {
            // 메일 주소로 메일 전송 - 회원 가입 확인(메일 주소 체크) 등
            Logging.CBLoggers logMessage = new Logging.CBLoggers();
            string jsonParam = JsonConvert.SerializeObject(p);

            try
            {
                using (SqlConnection connection = new SqlConnection(globalVal.DBConnectionString))
                {
                    using (SqlCommand command = new SqlCommand("CloudBread.uspUdtConfirmedEmailAddress", connection))
                    {
                        command.CommandType = CommandType.StoredProcedure;
                        command.Parameters.Add("@MemberID", SqlDbType.NVarChar, -1).Value = p.memberID;
                        command.Parameters.Add("@MemberPWD", SqlDbType.NVarChar, -1).Value = p.memberPWD;
                        connection.Open();
                        using (SqlDataReader dreader = command.ExecuteReader())
                        {
                            while (dreader.Read())
                            {
                                result =  dreader[0].ToString();
                            }

                            dreader.Close();
                        }
                        connection.Close();

                        return result;
                    }

                }
            }

            catch (Exception ex)
            {
                //에러로그
                logMessage.memberID = p.memberID;
                logMessage.Level = "ERROR";
                logMessage.Logger = "CBUdtConfirmedEmailAddressController";
                logMessage.Message = jsonParam;
                logMessage.Exception = ex.ToString();
                Logging.RunLog(logMessage);

                throw;
            }
        }
Пример #12
0
    public override void Move(InputParams _input)
    {
        var tmpPos = this.transform.position;

        if (_input.x > 0)
            direction = Vector3.right;
        if (_input.x < 0)
            direction = Vector3.left;
        if (_input.y > 0)
            direction = Vector3.up;
        if (_input.y < 0)
            direction = Vector3.down;

        tmpPos += direction * speed * Time.deltaTime;
        //tmpPos.x += _input.x * speed * Time.deltaTime;
        //tmpPos.y += _input.y * speed * Time.deltaTime;
        this.transform.position = tmpPos;
    }
Пример #13
0
    public override void Move(InputParams _input)
    {
        var tmpPos = this.transform.position;

        if (flag)
        {
            flag = false;
            if (_input.y < 0)
                transform.position += (new Vector3(0,-y_dir,0))* speed;
            if (_input.y > 0)
                transform.position += (new Vector3(0, y_dir, 0)) * speed;
            if (_input.x < 0)
                transform.position += (new Vector3(-x_dir, 0, 0)) * speed;
            if (_input.x > 0)
                transform.position += (new Vector3(x_dir, 0, 0)) * speed;

            StartCoroutine(WaitTime());
        }
    }
Пример #14
0
    public override void Move(InputParams _input)
    {
        var tmpPos = this.transform.position;

        if (canChangeDir)
        {
            canChangeDir = false;
            StartCoroutine(GoDown());
        }
        if(flag){
            flag = false;
            StartCoroutine(ChangeDir());

        }

        tmpPos += direction * speed * Time.deltaTime;
        //tmpPos.x += _input.x * speed * Time.deltaTime;
        //tmpPos.y += _input.y * speed * Time.deltaTime;
        this.transform.position = tmpPos;
    }
Пример #15
0
    public override void Move(InputParams _input)
    {
        if (_input.y > 0) {
            current_speed = current_speed + acceleration * Time.deltaTime;
            current_speed = Mathf.Min (current_speed, max_speed);
        }

        //transform.Rotate (- _input.x * rotSpeed * Time.deltaTime * Vector3.forward);
        transform.up = Quaternion.AngleAxis(-rotSpeed * Time.deltaTime * _input.x, Vector3.forward) * transform.up;
        //transform.up = direction;

        if (_input.y > 0)
            direction = direction + transform.up * _input.y * Time.deltaTime * acceleration;

        if (direction.magnitude > max_speed)
            direction = direction.normalized * max_speed;

        this.transform.position = this.transform.position + direction * Time.deltaTime;

        Debug.DrawLine(this.transform.position, this.transform.position + transform.up * 2);
    }
Пример #16
0
        public DeploymentInfo(
            Guid deploymentId,
            bool isSimulation,
            string projectName,
            string projectConfigurationName,
            string projectConfigurationBuildId,
            string targetEnvironmentName,
            InputParams inputParams)
        {
            Guard.NotEmpty(deploymentId, "deploymentId");
              Guard.NotNullNorEmpty(projectName, "projectName");
              Guard.NotNullNorEmpty(projectConfigurationName, "projectConfigurationName");
              Guard.NotNullNorEmpty(projectConfigurationBuildId, "projectConfigurationBuildId");
              Guard.NotNullNorEmpty(targetEnvironmentName, "targetEnvironmentName");
              Guard.NotNull(inputParams, "inputParams");

              DeploymentId = deploymentId;
              IsSimulation = isSimulation;
              ProjectName = projectName;
              ProjectConfigurationName = projectConfigurationName;
              ProjectConfigurationBuildId = projectConfigurationBuildId;
              TargetEnvironmentName = targetEnvironmentName;
              InputParams = inputParams;
        }
Пример #17
0
 public override void Move(InputParams _input)
 {
     this.transform.position += direction * speed * Time.deltaTime;
 }
Пример #18
0
    void InteractAccordingToInput(InputParams inputParams)
    {
        switch (interactState)
        {
        case InteractState.Nothing:


            if (previousInteractState == InteractState.MeleeAttack)
            {
                interactBehaviorCtrl.StopMeleeAttack();
            }

            if (previousInteractState == InteractState.DistantAttack)
            {
                interactBehaviorCtrl.StopDistantAttack();
            }

            if (previousInteractState == InteractState.Glide)
            {
                interactBehaviorCtrl.StopGlide();
            }

            if (previousInteractState == InteractState.Inflate)
            {
                interactBehaviorCtrl.DoInflate(false);
            }
            break;

        case InteractState.Glide:
            body.velocity = new Vector3(body.velocity.x, -5f, body.velocity.z);
            interactBehaviorCtrl.DoGlide();

            break;

        case InteractState.MeleeAttack:


            if (interactStateParameter.canMeleeAttack)
            {
                interactBehaviorCtrl.DoMeleeAttack();
            }

            //if (Input.GetButtonDown("Fire1")) {
            //    timerAttack = 0;
            //}

            //if (Input.GetButton("Fire1")) {
            //    timerAttack += Time.deltaTime;

            //}

            //if (Input.GetButtonUp("Fire1")) {
            //    Debug.Log("Coucou");
            //    if (timerAttack < 0.3) {
            //        interactBehaviorCtrl.DoMeleeAttack();
            //    }
            //    else if (timerAttack >= 0.3) {
            //        interactBehaviorCtrl.DoChargedMeleeAttack();
            //    }
            //}



            break;


        case InteractState.DistantAttack:

            if (interactStateParameter.canDistantAttack)
            {
                interactBehaviorCtrl.DoDistantAttack();
            }


            break;

        case InteractState.SpawnLure:
            break;

        case InteractState.Inflate:

            if (previousInteractState != InteractState.Inflate)
            {
                Debug.Log("coucou");
                interactBehaviorCtrl.DoInflate(true);
            }


            break;

        case InteractState.Tiny:
            break;

        case InteractState.Activate:
            break;

        case InteractState.Absorb:

            GameObject nearestObject = absorbRange.GetComponent <DetectNearInteractObject>().GetNearestObject();

            if (nearestObject == null || !nearestObject.CompareTag("Yokai"))
            {
                interactStateParameter.yokaiStillInRange = false;
            }



            break;

        case InteractState.Carry:
            break;

        case InteractState.Push:
            break;
        }
    }
Пример #19
0
    void UpdateInteractStateParameters(InputParams inputParams)
    {
        switch (inputParams.actionRequest)
        {
        case ActionRequest.Glide:
            if (movementState == MovementState.Fall)
            {
                interactStateParameter.canGlide = true;
            }
            break;

        case ActionRequest.MeleeAttack:
            interactStateParameter.canMeleeAttack = true;
            break;

        case ActionRequest.DistantAttack:
            interactStateParameter.canDistantAttack = true;
            break;

        case ActionRequest.SpawnLure:
            interactStateParameter.canSpawnLure = true;
            break;

        case ActionRequest.Inflate:

            if (IsGrounded())
            {
                interactStateParameter.canInflate = true;
            }
            break;

        case ActionRequest.Resize:
            if (IsGrounded())
            {
                interactStateParameter.canResize = true;
            }
            break;

        case ActionRequest.ContextualAction:

            GameObject nearestObject = absorbRange.GetComponent <DetectNearInteractObject>().GetNearestObject();

            if (nearestObject != null)
            {
                bool inFrontOfActivableObject  = false;
                bool inFrontOfAbsorbableObject = false;
                bool inFrontOfPortableObject   = false;

                if (nearestObject.CompareTag("Yokai"))
                {
                    inFrontOfAbsorbableObject = true;
                    interactStateParameter.yokaiStillInRange = true;
                }
                else if (nearestObject.gameObject.layer == LayerMask.NameToLayer("Catchable"))
                {
                    inFrontOfPortableObject = true;
                }
                else if (nearestObject.gameObject.layer == LayerMask.NameToLayer("Activable"))
                {
                    inFrontOfActivableObject = true;
                }

                interactStateParameter.canActivate = false;
                interactStateParameter.canAbsorb   = false;
                interactStateParameter.canCarry    = false;

                if (IsGrounded())
                {
                    if (inFrontOfActivableObject)
                    {
                        interactStateParameter.canActivate = true;
                    }
                    else if (inFrontOfAbsorbableObject)
                    {
                        interactStateParameter.canAbsorb = true;
                    }
                    else if (inFrontOfPortableObject)
                    {
                        interactStateParameter.canCarry = true;
                    }
                }
            }


            break;

        case ActionRequest.None:
            interactStateParameter.canGlide         = false;
            interactStateParameter.canMeleeAttack   = false;
            interactStateParameter.canDistantAttack = false;
            interactStateParameter.canSpawnLure     = false;
            interactStateParameter.canInflate       = false;
            interactStateParameter.canActivate      = false;
            interactStateParameter.canAbsorb        = false;
            interactStateParameter.canCarry         = false;
            interactStateParameter.canPush          = false;
            break;
        }
    }
        protected override int ProvideInputDataForSkillExecution(ExecutableSkill SkillToExecute, out InputParams ParametersForTheSkill)
        {
            //Note that SkillToExecute is tested before (in mother class), so it will NOT be null,
            // and SkillToExecute.AmlSkillDescription.Execution.Type is also NOT NULL

            //Here, do a big switch case on the Execution's type of the skill.
            //In our case, since we allways execute the "MethodHelloWorld" skill (console write), we always have the same input

            switch (SkillToExecute.AmlSkillDescription.Execution.Type)
            {
            default:
                //In our case, whatever the skill type, we will execute the same method
                DateTime Now     = DateTime.Now;
                string   message = "Hello world ! Executing Skill " + SkillToExecute.AmlSkillDescription.ID + ". Time is " + Now.ToString("yyyy_MM_dd_hh_mm_ss_") + Now.Millisecond.ToString();
                ParametersForTheSkill = new InputParams(0, (object)message);
                break;
            }

            //You can throw an exeception or return !=0 if something does not suits you => the SEE will NOT execute
            //the skill and will go in error state

            return(0);
        }
Пример #21
0
        public IAsyncResult BeginProcessRequest(HttpContext context, AsyncCallback cb, Object extraData)
        {
            TransportClassMainAshx oTransportClassMainAshx = new TransportClassMainAshx(context, cb);
            ErrorTypes             eError = ErrorTypes.NoError;

            try
            {
                _log.Info("Starting process request...");
                _log.Info(context.Request.QueryString.ToString());

                InputParams oInputParams = new InputParams();
                oInputParams.m_sKey           = context.Request.QueryString["key"];
                oInputParams.m_svKey          = context.Request.QueryString["vkey"];
                oInputParams.m_sUrl           = context.Request.QueryString["url"];
                oInputParams.m_sEmbeddedfonts = context.Request.QueryString["embeddedfonts"];

                int nIndexSep = oInputParams.m_sUrl.IndexOf(',');
                if (-1 != nIndexSep)
                {
                    oInputParams.m_sUrl = oInputParams.m_sUrl.Substring(0, nIndexSep);
                }
                oInputParams.m_sTitle = context.Request.QueryString["title"];
                if (string.IsNullOrEmpty(oInputParams.m_sTitle))
                {
                    oInputParams.m_sTitle = "convert";
                }
                oInputParams.m_sFiletype     = context.Request.QueryString["filetype"];
                oInputParams.m_nOutputtype   = FileFormats.FromString(context.Request.QueryString["outputtype"]);
                oInputParams.m_bAsyncConvert = Convert.ToBoolean(context.Request.QueryString["async"]);
                oInputParams.m_sCodepage     = context.Request.QueryString["codePage"];
                oInputParams.m_sDelimiter    = context.Request.QueryString["delimiter"];

                if (ErrorTypes.NoError == eError)
                {
                    ITaskResultInterface oTaskResult = TaskResult.NewTaskResult();
                    TaskResultData       oToAdd      = new TaskResultData();

                    oInputParams.m_sKey = "conv_" + oInputParams.m_sKey;
                    oToAdd.sKey         = oInputParams.m_sKey;
                    oToAdd.sFormat      = oInputParams.m_sFiletype;
                    oToAdd.eStatus      = FileStatus.WaitQueue;
                    oToAdd.sTitle       = oInputParams.m_sTitle;
                    TransportClass1 oTransportClass1 = new TransportClass1(oTransportClassMainAshx, oTaskResult, new CTaskQueue(), oInputParams);
                    oTaskResult.GetOrCreateBegin(oInputParams.m_sKey, oToAdd, GetOrCreateCallback, oTransportClass1);
                }
            }
            catch (Exception e)
            {
                eError = ErrorTypes.Unknown;

                _log.Error(context.Request.QueryString.ToString());
                _log.Error("Exeption: ", e);
            }
            finally
            {
                if (ErrorTypes.NoError != eError)
                {
                    WriteOutputCommand(oTransportClassMainAshx, new OutputCommand(null, null, null, eError));
                }
            }
            return(new AsyncOperationData(extraData));
        }
Пример #22
0
        protected override void OnStart()
        {
            InitLogger();
            Timer.Start(60);

            InputParams = new InputParams
            {
                StrategyType    = StrategyType,
                Instrument      = Symbol.Name,
                LastPrice       = Symbol.Bid,
                LevelFilePath   = FilePath,
                LevelFileName   = FileName,
                DailyReloadHour = int.Parse(DailyReloadTime.Split(new string[]
                {
                    ":"
                }, StringSplitOptions.None)[0]),
                DailyReloadMinute = int.Parse(DailyReloadTime.Split(new string[]
                {
                    ":"
                }, StringSplitOptions.None)[1]),
                TimeZoneOffset = TimeZoneOffset,
                LevelId        = LevelId,

                PositionSize    = PositionSizePercents * 0.01,
                FixedRiskAmount = FixedRisk,
                MaxSpread       = MaxSpread,
                MarginTreshold  = MarginThreshold,

                LevelActivate   = ActivateLevelPercents * 0.01,
                LevelDeactivate = DeactivateLevelPercents * 0.01,
                LevelOffset     = LevelOffset,

                LossStrategy             = LossStrategy,
                DefaultStopLossPips      = DefaultStopLossPips,
                UseAtrBasedStoppLossPips = UseAtrBasedStoppLossPips,
                PreventSpikes            = PreventSpikes,
                CandlesInNegativeArea    = CandlesInNegativeArea,
                NegativeBreakEvenOffset  = NegativeBreakEvenOffset * 0.01,

                ProfitBreakEvenThreshold = ProfitBreakEvenThreshold * 0.01,
                RiskRewardRatio          = RiskRewardRatio * 0.01,
                ProfitThreshold          = ProfitThreshold * 0.01,
                ProfitVolume             = ProfitVolume * 0.01,
                ProfitStrategy           = ProfitStrategy,

                CalendarPause         = CalendarPause,
                CalendarEventDuration = CalendarBeforeOffset,

                BackTestPath = BackTestPath,
                Email        = Email
            };

            MarketSeries daily = MarketData.GetSeries(TimeFrame.Daily);

            Atr     = Indicators.AverageTrueRange(daily, 70, MovingAverageType.Simple);
            EmaHigh = Indicators.ExponentialMovingAverage(MarketSeries.High, 50);
            EmaLow  = Indicators.ExponentialMovingAverage(MarketSeries.Low, 50);

            Calendar = new Calendar(this, InputParams);
            Calendar.Init();
            LevelController = new LevelController(this, InputParams, Calendar);
            double atrPips = Math.Round(Atr.Result[Atr.Result.Count - 1] / Symbol.PipSize);

            if (RunningMode != RunningMode.RealTime)
            {
                LevelController.Init(atrPips, Server.TimeInUtc.AddDays(-1));
            }
            else
            {
                LevelController.Init(atrPips);
            }


            PositionController = new PositionController(this, InputParams, EmaHigh, EmaLow, Calendar);
            Print("LevelTrader version 2.1 started");
        }
Пример #23
0
 public PaymentService(InputParams inputParams)
 {
     _inputParams = inputParams;
 }
Пример #24
0
        private IEnumerable <ProjectDeploymentData> CreateProjectEnvironmentDeployments(Guid uniqueClientId, EnvironmentDeployInfo environmentDeployInfo, IEnumerable <ProjectToDeploy> projects)
        {
            var projectDeployments         = new List <ProjectDeploymentData>();
            var priorityProjectDeplyoments = new List <ProjectDeploymentData>();

            EnvironmentInfo environmentInfo = _environmentInfoRepository.FindByName(environmentDeployInfo.TargetEnvironment);

            if (environmentInfo == null)
            {
                throw new FaultException <EnvironmentNotFoundFault>(new EnvironmentNotFoundFault {
                    EnvironmentName = environmentDeployInfo.TargetEnvironment
                });
            }

            foreach (var projectToDeploy in projects)
            {
                try
                {
                    ProjectInfo projectInfo = _projectInfoRepository.FindByName(projectToDeploy.ProjectName);

                    if (projectInfo == null)
                    {
                        throw new DeploymentTaskException(string.Format("Not found configuration for project: {0}", projectToDeploy.ProjectName));
                    }

                    ProjectConfigurationBuild lastSuccessfulBuild = GetLatestSuccessfulBuild(projectToDeploy.ProjectName, environmentDeployInfo.BuildConfigurationName);

                    if (lastSuccessfulBuild == null)
                    {
                        throw new DeploymentTaskException(string.Format("Successful build not found for project: {0} and configuration: {1}", projectToDeploy, environmentDeployInfo.BuildConfigurationName));
                    }

                    InputParams inputParams = BuildInputParams(projectInfo, environmentInfo);

                    var deploymentInfo = new Core.Domain.DeploymentInfo(projectToDeploy.DeploymentId, false, projectToDeploy.ProjectName, environmentDeployInfo.BuildConfigurationName, lastSuccessfulBuild.Id, environmentDeployInfo.TargetEnvironment, inputParams);

                    DeploymentTask deploymentTask;

                    // TODO LK: could replace below code with factory
                    if (projectInfo.Type == ProjectType.Db)
                    {
                        DeploymentTask dropDbProjectDeploymentTask = new DropDbProjectDeploymentTask(
                            ObjectFactory.Instance.CreateProjectInfoRepository(),
                            ObjectFactory.Instance.CreateEnvironmentInfoRepository(),
                            ObjectFactory.Instance.CreateDbManagerFactory());

                        priorityProjectDeplyoments.Add(new ProjectDeploymentData(deploymentInfo, projectInfo, dropDbProjectDeploymentTask));

                        deploymentTask =
                            new DeployDbProjectDeploymentTask(
                                ObjectFactory.Instance.CreateProjectInfoRepository(),
                                ObjectFactory.Instance.CreateEnvironmentInfoRepository(),
                                ObjectFactory.Instance.CreateArtifactsRepository(),
                                ObjectFactory.Instance.CreateDbScriptRunnerFactory(),
                                ObjectFactory.Instance.CreateDbVersionProvider(),
                                ObjectFactory.Instance.CreateFileAdapter(),
                                ObjectFactory.Instance.CreateZipFileAdapter(),
                                ObjectFactory.Instance.CreateScriptsToRunWebSelectorForEnvironmentDeploy(),
                                ObjectFactory.Instance.CreateMsSqlDatabasePublisher(),
                                ObjectFactory.Instance.CreateDbManagerFactory(),
                                ObjectFactory.Instance.CreateUserNameNormalizer(),
                                ObjectFactory.Instance.CreateDirectoryAdapter());
                    }
                    else if (projectInfo.Type == ProjectType.NtService)
                    {
                        deploymentTask = new DeployNtServiceDeploymentTask(
                            ObjectFactory.Instance.CreateProjectInfoRepository(),
                            ObjectFactory.Instance.CreateEnvironmentInfoRepository(),
                            ObjectFactory.Instance.CreateArtifactsRepository(),
                            ObjectFactory.Instance.CreateNtServiceManager(),
                            ObjectFactory.Instance.CreatePasswordCollector(),
                            ObjectFactory.Instance.CreateFailoverClusterManager(),
                            ObjectFactory.Instance.CreateDirectoryAdapter(),
                            ObjectFactory.Instance.CreateFileAdapter(),
                            ObjectFactory.Instance.CreateZipFileAdapter())
                        {
                            UseLocalSystemUser = true
                        };
                    }
                    else
                    {
                        deploymentTask = projectInfo.CreateDeploymentTask(ObjectFactory.Instance);
                    }

                    projectDeployments.Add(new ProjectDeploymentData(deploymentInfo, projectInfo, deploymentTask));
                }
                catch (Exception e)
                {
                    LogMessage(uniqueClientId, DiagnosticMessageType.Error, e.Message);
                }
            }

            priorityProjectDeplyoments.AddRange(projectDeployments);

            return(priorityProjectDeplyoments);
        }
Пример #25
0
    public void Update(float _dt, InputParams _ip)
    {
        if (!_ip.Consumed)
        {
            UI.Update(_ip);
        }


        //If a squad isn't actually moving
        if (!MoveSquad)
        {
            // Debug fast cursor travel
            if (UI.IsPlayable() && !_ip.Consumed)
            {
                if (_ip.onePressed)
                {
                    ShowedNearLoc = Cities[0];
                }
                if (_ip.twoPressed)
                {
                    ShowedNearLoc = Cities[1];
                }
                if (_ip.threePressed)
                {
                    ShowedNearLoc = Cities[2];
                }


                //Show diferent nearest locations
                if (_ip.Direction.x != 0 || _ip.Direction.y != 0)
                {
                    if (ShowedNearLoc == null)
                    {
                        Iterator = 0;
                    }
                    else if (_ip.Direction.x > 0)
                    {
                        Iterator++;
                        Iterator = Iterator.Clamp(NearLoc.Count - 1);
                    }
                    else if (_ip.Direction.x < 0)
                    {
                        Iterator--;
                        Iterator = Iterator.Clamp(NearLoc.Count - 1);
                    }
                    else if (_ip.Direction.y > 0)
                    {
                        Iterator++;
                        Iterator = Iterator.Clamp(NearLoc.Count - 1);
                    }
                    else if (_ip.Direction.y < 0)
                    {
                        Iterator--;
                        Iterator = Iterator.Clamp(NearLoc.Count - 1);
                    }
                    ShowedNearLoc = NearLoc[Iterator];

                    UI.ShowCapturable(ShowedNearLoc.GetComponent <Capturable>());
                    SuggestSelect(ShowedNearLoc);
                }
                // If comfirm pressed, go to the next lock
                if (_ip.Confirm)
                {
                    if (ShowedNearLoc != null)
                    {
                        Select();
                    }
                    else
                    {
                        List <Choice> list = new List <Choice>();
                        if (SelectObject.GetComponent <Capturable>().HasBuilding)
                        {
                            Choice CreateUnitC = new Choice("Create Unit", CreateUnit);
                            list.Add(CreateUnitC);
                        }
                        if (SelectObject.GetComponent <Capturable>().Units.Count > 0)
                        {
                            Choice SelectSquadC = new Choice("Select Squad", SelectSquad);
                            list.Add(SelectSquadC);
                        }
                        if (SelectObject.GetComponent <Capturable>().Units.Count > 1)
                        {
                            Choice Battle = new Choice("Battle", LaunchBattle);
                            list.Add(Battle);
                        }

                        UI.UpChoices(list);
                    }
                }
                _ip.Use();
            }
        }
        else if (!_ip.Consumed)
        {
            if (ShowedNearLoc == null)
            {
                Iterator = 0;
            }
            else if (_ip.Direction.x > 0)
            {
                Iterator++;
                Iterator = Iterator.Clamp(NearLoc.Count - 1);
            }
            else if (_ip.Direction.x < 0)
            {
                Iterator--;
                Iterator = Iterator.Clamp(NearLoc.Count - 1);
            }
            else if (_ip.Direction.y > 0)
            {
                Iterator++;
                Iterator = Iterator.Clamp(NearLoc.Count - 1);
            }
            else if (_ip.Direction.y < 0)
            {
                Iterator--;
                Iterator = Iterator.Clamp(NearLoc.Count - 1);
            }
            ShowedNearLoc = NearLoc[Iterator];

            UI.ShowCapturable(ShowedNearLoc.GetComponent <Capturable>());
            SuggestSelect(ShowedNearLoc);

            if (_ip.Confirm)
            {
                SelectObject.GetComponent <Capturable>().MoveSquad(selectedSquad, ShowedNearLoc.GetComponent <Capturable>());
                MoveSquad = false;
            }
        }


        if (_ip.Cancel)
        {
            //Debug.Log("Cancel called");
            if (UI.IsPlayable())
            {
                UI.HideChoices();
                UI.HideMenu();
            }
            else
            {
                //Debug.Log("Menu called");
                UI.ShowMenu();
            }
        }
    }
Пример #26
0
 public abstract void Move(InputParams _input);
Пример #27
0
 public override void UpdateFlow(float _dt, InputParams _ip)
 {
     MasterGameManager.Instance.Update(_ip, _dt);
 }
Пример #28
0
    public void Update(InputParams _ip)
    {
        Unit unit = UnitsManager.Instance.GetUnitAtPos(selectorPosition);

        if (unit != null)
        {
            UI.ShowSelect(unit);
        }
        else
        {
            UI.HideSelect();
        }

        if (!_ip.Consumed)
        {
            UI.Update(_ip);
        }

        if (UI.Playable && !_ip.Consumed)
        {
            if (_ip.Direction.x < 0)
            {
                if (selectorPosition.x > 0)
                {
                    selectorPosition.x--;
                }
            }
            else if (_ip.Direction.x > 0)
            {
                if (selectorPosition.x < battlefield.GetComponent <BattleField>().GetSize().x - 1)
                {
                    selectorPosition.x++;
                }
            }
            if (_ip.Direction.y < 0)
            {
                if (selectorPosition.y < battlefield.GetComponent <BattleField>().GetSize().y - 1)
                {
                    selectorPosition.y++;
                }
            }
            else if (_ip.Direction.y > 0)
            {
                if (selectorPosition.y > 0)
                {
                    selectorPosition.y--;
                }
            }

            SelectorPosUpdate();

            if (_ip.Confirm && unit != null && !attackMod)
            {
                selectedOne = unit;
                Choice        move    = new Choice("Move", MoveHandler);
                Choice        attack  = new Choice("Attack", AttackHandler);
                List <Choice> choices = new List <Choice>();
                choices.Add(move);
                choices.Add(attack);
                UI.UpChoices(choices);
            }
            else if (_ip.Confirm && selectedOne != null && !attackMod)
            {
                selectedOne.Move(battlefield.GetComponent <BattleField>().GetMapPos(selector.transform.position));
                selectedOne = null;
            }
            else if (_ip.Confirm && attackMod && unit != null)
            {
                attackMod = false;
                selectedOne.Attack(unit);
                selectedOne = null;
            }
            _ip.Use();
        }
    }
Пример #29
0
 public override void UpdateFlow(float _dt, InputParams _ip)
 {
     BattlefieldManager.Instance.Update(_ip);
 }
Пример #30
0
        /*************************************/

        public virtual bool CanRemoveInput(string name)
        {
            ParamInfo match = InputParams.Find(x => x.Name == name);

            return(match != null && !match.IsRequired);
        }
        public string Post(InputParams p)
        {
            string result = "";
            ////////////////////////////////////////////////////////////////////////
            // 한번 사용한 쿠폰. 쿠폰에서 받은 아이템을 insert 또는 update하고
            // MemberCoupon 테이블에 저장.
            // Coupon 중복 사용이 불가한 경우 DeleteYN을 Y로 처리.
            ////////////////////////////////////////////////////////////////////////
            Logging.CBLoggers logMessage = new Logging.CBLoggers();
            string jsonParam = JsonConvert.SerializeObject(p);

            try
            {
                // 진입로그
                //logMessage.memberID = p.MemberID_MemberItems;
                //logMessage.Level = "INFO";
                //logMessage.Logger = "CBUdtCouponMemberController";
                //logMessage.Message = jsonParam;
                //Logging.RunLog(logMessage);

                using (SqlConnection connection = new SqlConnection(globalVal.DBConnectionString))
                {
                    using (SqlCommand command = new SqlCommand("CloudBread.uspUdtCouponMember", connection))
                    {

                        command.CommandType = CommandType.StoredProcedure;
                        command.Parameters.Add("@InsertORUpdate", SqlDbType.NVarChar, -1).Value = p.InsertORUpdate.ToUpper();
                        command.Parameters.Add("@CouponID_Coupon", SqlDbType.NVarChar, -1).Value = p.CouponID_Coupon;
                        command.Parameters.Add("@MemberItemID_MemberItems", SqlDbType.NVarChar, -1).Value = p.MemberItemID_MemberItems;
                        command.Parameters.Add("@MemberID_MemberItems", SqlDbType.NVarChar, -1).Value = p.MemberID_MemberItems;
                        command.Parameters.Add("@ItemListID_MemberItems", SqlDbType.NVarChar, -1).Value = p.ItemListID_MemberItems;
                        command.Parameters.Add("@ItemCount_MemberItems", SqlDbType.NVarChar, -1).Value = p.ItemCount_MemberItems;
                        command.Parameters.Add("@ItemStatus_MemberItems", SqlDbType.NVarChar, -1).Value = p.ItemStatus_MemberItems;
                        command.Parameters.Add("@sCol1_MemberItems", SqlDbType.NVarChar, -1).Value = p.sCol1_MemberItems;
                        command.Parameters.Add("@sCol2_MemberItems", SqlDbType.NVarChar, -1).Value = p.sCol2_MemberItems;
                        command.Parameters.Add("@sCol3_MemberItems", SqlDbType.NVarChar, -1).Value = p.sCol3_MemberItems;
                        command.Parameters.Add("@sCol4_MemberItems", SqlDbType.NVarChar, -1).Value = p.sCol4_MemberItems;
                        command.Parameters.Add("@sCol5_MemberItems", SqlDbType.NVarChar, -1).Value = p.sCol5_MemberItems;
                        command.Parameters.Add("@sCol6_MemberItems", SqlDbType.NVarChar, -1).Value = p.sCol6_MemberItems;
                        command.Parameters.Add("@sCol7_MemberItems", SqlDbType.NVarChar, -1).Value = p.sCol7_MemberItems;
                        command.Parameters.Add("@sCol8_MemberItems", SqlDbType.NVarChar, -1).Value = p.sCol8_MemberItems;
                        command.Parameters.Add("@sCol9_MemberItems", SqlDbType.NVarChar, -1).Value = p.sCol9_MemberItems;
                        command.Parameters.Add("@sCol10_MemberItems", SqlDbType.NVarChar, -1).Value = p.sCol10_MemberItems;
                        command.Parameters.Add("@CouponID_CouponMember", SqlDbType.NVarChar, -1).Value = p.CouponID_CouponMember;
                        command.Parameters.Add("@MemberID_CouponMember", SqlDbType.NVarChar, -1).Value = p.MemberID_CouponMember;
                        command.Parameters.Add("@sCol1_CouponMember", SqlDbType.NVarChar, -1).Value = p.sCol1_CouponMember;
                        command.Parameters.Add("@sCol2_CouponMember", SqlDbType.NVarChar, -1).Value = p.sCol2_CouponMember;
                        command.Parameters.Add("@sCol3_CouponMember", SqlDbType.NVarChar, -1).Value = p.sCol3_CouponMember;
                        command.Parameters.Add("@sCol4_CouponMember", SqlDbType.NVarChar, -1).Value = p.sCol4_CouponMember;
                        command.Parameters.Add("@sCol5_CouponMember", SqlDbType.NVarChar, -1).Value = p.sCol5_CouponMember;
                        command.Parameters.Add("@sCol6_CouponMember", SqlDbType.NVarChar, -1).Value = p.sCol6_CouponMember;
                        command.Parameters.Add("@sCol7_CouponMember", SqlDbType.NVarChar, -1).Value = p.sCol7_CouponMember;
                        command.Parameters.Add("@sCol8_CouponMember", SqlDbType.NVarChar, -1).Value = p.sCol8_CouponMember;
                        command.Parameters.Add("@sCol9_CouponMember", SqlDbType.NVarChar, -1).Value = p.sCol9_CouponMember;
                        command.Parameters.Add("@sCol10_CouponMember", SqlDbType.NVarChar, -1).Value = p.sCol10_CouponMember;

                        connection.Open();
                        using (SqlDataReader dreader = command.ExecuteReader())
                        {
                            while (dreader.Read())
                            {
                                result = dreader[0].ToString();
                            }
                            dreader.Close();
                        }
                        connection.Close();

                        //완료 로그
                        logMessage.memberID = p.MemberID_MemberItems;
                        logMessage.Level = "INFO";
                        logMessage.Logger = "CBUdtCouponMemberController";
                        logMessage.Message = jsonParam;
                        Logging.RunLog(logMessage);

                        return result;
                    }

                }
            }

            catch (Exception ex)
            {
                //에러로그
                logMessage.memberID = p.MemberID_MemberItems;
                logMessage.Level = "ERROR";
                logMessage.Logger = "CBUdtCouponMemberController";
                logMessage.Message = jsonParam;
                logMessage.Exception = ex.ToString();
                Logging.RunLog(logMessage);

                throw;
            }
        }
Пример #32
0
 public abstract void GetInput(InputParams _input);
 protected override void onPreShow([Optional, DefaultParameterValue(null)] object param)
 {
     this.m_params = (InputParams)param;
     this.onRefresh();
 }
Пример #34
0
 public override void UpdateFlow(float _dt, InputParams _ip)
 {
     MacroManager.Instance.Update(_dt, _ip);
 }
Пример #35
0
 private void OnInputTaken(InputParams inputParams)
 {
     view.UpdateInputPos(inputParams.XPosition, inputParams.XClampNegativeSide, inputParams.XClampPositiveSide,
                         inputParams.MovementSpeed);
 }
        public string Post(InputParams p)
        {
            string result = "";
            ////////////////////////////////////////////////////////////////////////
            // 공통 MemberItemPurchase 정보 수정 모듈 시작 update시 파라미터를 NULL로 주면 해당 컬럼은 변화되지 않음.
            // Json에서는 null 으로 값을 지정하거나 아예 로우 값을 제공하지 않아도 가능
            ////////////////////////////////////////////////////////////////////////
            Logging.CBLoggers logMessage = new Logging.CBLoggers();
            string jsonParam = JsonConvert.SerializeObject(p);

            try
            {
                // 진입로그
                //logMessage.memberID = p.MemberID;
                //logMessage.Level = "INFO";
                //logMessage.Logger = "CBComUdtMemberItemPurchaseController";
                //logMessage.Message = jsonParam;
                //Logging.RunLog(logMessage);

                using (SqlConnection connection = new SqlConnection(globalVal.DBConnectionString))
                {
                    using (SqlCommand command = new SqlCommand("CloudBread.uspComUdtMemberItemPurchase", connection))
                    {

                        command.CommandType = CommandType.StoredProcedure;
                        command.Parameters.Add("@MemberItemPurchaseID", SqlDbType.NVarChar, -1).Value = p.MemberItemPurchaseID;
                        command.Parameters.Add("@MemberID", SqlDbType.NVarChar, -1).Value = p.MemberID;
                        command.Parameters.Add("@ItemListID", SqlDbType.NVarChar, -1).Value = p.ItemListID;
                        command.Parameters.Add("@PurchaseQuantity", SqlDbType.NVarChar, -1).Value = p.PurchaseQuantity;
                        command.Parameters.Add("@PurchasePrice", SqlDbType.NVarChar, -1).Value = p.PurchasePrice;
                        command.Parameters.Add("@PGinfo1", SqlDbType.NVarChar, -1).Value = p.PGinfo1;
                        command.Parameters.Add("@PGinfo2", SqlDbType.NVarChar, -1).Value = p.PGinfo2;
                        command.Parameters.Add("@PGinfo3", SqlDbType.NVarChar, -1).Value = p.PGinfo3;
                        command.Parameters.Add("@PGinfo4", SqlDbType.NVarChar, -1).Value = p.PGinfo4;
                        command.Parameters.Add("@PGinfo5", SqlDbType.NVarChar, -1).Value = p.PGinfo5;
                        command.Parameters.Add("@PurchaseDeviceID", SqlDbType.NVarChar, -1).Value = p.PurchaseDeviceID;
                        command.Parameters.Add("@PurchaseDeviceIPAddress", SqlDbType.NVarChar, -1).Value = p.PurchaseDeviceIPAddress;
                        command.Parameters.Add("@PurchaseDeviceMACAddress", SqlDbType.NVarChar, -1).Value = p.PurchaseDeviceMACAddress;
                        command.Parameters.Add("@PurchaseDT", SqlDbType.NVarChar, -1).Value = p.PurchaseDT;
                        command.Parameters.Add("@PurchaseCancelYN", SqlDbType.NVarChar, -1).Value = p.PurchaseCancelYN;
                        command.Parameters.Add("@PurchaseCancelDT", SqlDbType.NVarChar, -1).Value = p.PurchaseCancelDT;
                        command.Parameters.Add("@PurchaseCancelingStatus", SqlDbType.NVarChar, -1).Value = p.PurchaseCancelingStatus;
                        command.Parameters.Add("@PurchaseCancelReturnedAmount", SqlDbType.NVarChar, -1).Value = p.PurchaseCancelReturnedAmount;
                        command.Parameters.Add("@PurchaseCancelDeviceID", SqlDbType.NVarChar, -1).Value = p.PurchaseCancelDeviceID;
                        command.Parameters.Add("@PurchaseCancelDeviceIPAddress", SqlDbType.NVarChar, -1).Value = p.PurchaseCancelDeviceIPAddress;
                        command.Parameters.Add("@PurchaseCancelDeviceMACAddress", SqlDbType.NVarChar, -1).Value = p.PurchaseCancelDeviceMACAddress;
                        command.Parameters.Add("@sCol1", SqlDbType.NVarChar, -1).Value = p.sCol1;
                        command.Parameters.Add("@sCol2", SqlDbType.NVarChar, -1).Value = p.sCol2;
                        command.Parameters.Add("@sCol3", SqlDbType.NVarChar, -1).Value = p.sCol3;
                        command.Parameters.Add("@sCol4", SqlDbType.NVarChar, -1).Value = p.sCol4;
                        command.Parameters.Add("@sCol5", SqlDbType.NVarChar, -1).Value = p.sCol5;
                        command.Parameters.Add("@sCol6", SqlDbType.NVarChar, -1).Value = p.sCol6;
                        command.Parameters.Add("@sCol7", SqlDbType.NVarChar, -1).Value = p.sCol7;
                        command.Parameters.Add("@sCol8", SqlDbType.NVarChar, -1).Value = p.sCol8;
                        command.Parameters.Add("@sCol9", SqlDbType.NVarChar, -1).Value = p.sCol9;
                        command.Parameters.Add("@sCol10", SqlDbType.NVarChar, -1).Value = p.sCol10;

                        connection.Open();
                        using (SqlDataReader dreader = command.ExecuteReader())
                        {
                            while (dreader.Read())
                            {
                                result = dreader[0].ToString();
                            }
                            dreader.Close();
                        }
                        connection.Close();

                        // 완료 로그
                        logMessage.memberID = p.MemberID;
                        logMessage.Level = "INFO";
                        logMessage.Logger = "CBComUdtMemberItemPurchaseController";
                        logMessage.Message = jsonParam;
                        Logging.RunLog(logMessage);

                        return result;
                    }

                }
            }

            catch (Exception ex)
            {
                //에러로그
                logMessage.memberID = p.MemberID;
                logMessage.Level = "ERROR";
                logMessage.Logger = "CBComUdtMemberItemPurchaseController";
                logMessage.Message = jsonParam;
                logMessage.Exception = ex.ToString();
                Logging.RunLog(logMessage);

                throw;
            }
        }
Пример #37
0
        //private void EditWindowParametersMethod(Document doc)
        //{
        //  InputParams inputParameters = JsonConvert.DeserializeObject<InputParams>(File.ReadAllText("params.json"));

        //  //Modifying the window parameters
        //  //Open transaction
        //  using (Transaction trans = new Transaction(doc))
        //  {
        //    trans.Start("Update window parameters");

        //    //Filter for windows
        //    FilteredElementCollector WindowCollector = new FilteredElementCollector(doc).OfCategory(BuiltInCategory.OST_Windows).WhereElementIsNotElementType();
        //    IList<ElementId> windowIds = WindowCollector.ToElementIds() as IList<ElementId>;

        //    foreach (ElementId windowId in windowIds)
        //    {
        //      Element Window = doc.GetElement(windowId);
        //      FamilyInstance FamInst = Window as FamilyInstance;
        //      FamilySymbol FamSym = FamInst.Symbol;
        //      SetElementParameter(FamSym, BuiltInParameter.WINDOW_HEIGHT, inputParameters.Height);
        //      SetElementParameter(FamSym, BuiltInParameter.WINDOW_WIDTH, inputParameters.Width);
        //    }

        //    //To save all the changes commit the transaction
        //    trans.Commit();
        //  }

        //  //Save the updated file by overwriting the existing file
        //  ModelPath ProjectModelPath = ModelPathUtils.ConvertUserVisiblePathToModelPath(OUTPUT_FILE);
        //  SaveAsOptions SAO = new SaveAsOptions();
        //  SAO.OverwriteExistingFile = true;

        //  //Save the project file with updated window's parameters
        //  LogTrace("Saving file...");
        //  doc.SaveAs(ProjectModelPath, SAO);
        //}

        private void EditWindowParametersMethod(Document doc)
        {
            string sVal = "";
            int    iVal = 0;

            InputParams inputParameters = JsonConvert.DeserializeObject <InputParams>(File.ReadAllText("params.json"));

            // パラメータ確認
            //int elemIdVal = 0;
            //sVal = inputParameters.ElemIdStr;
            //if ((sVal != null) && (sVal != ""))
            //{
            //  try
            //  {
            //    iVal = int.Parse(sVal);
            //  }
            //  catch (System.Exception ex)
            //  {
            //    string errMsg = ex.Message;
            //  }
            //  if (iVal != 0)
            //  {
            //    elemIdVal = iVal;
            //  }
            //}
            //if (iVal == 0)
            //{
            //  return;
            //}
            string elemUqId = inputParameters.ElemIdStr;

            if ((elemUqId == null) || (elemUqId == ""))
            {
                return;
            }

            string commentStr = "";

            sVal = inputParameters.CommentStr;
            if ((sVal != null) && (sVal != ""))
            {
                commentStr = sVal;
            }

            // 要素検索
            //ElementId elemIdTgt = new ElementId(elemIdVal);
            //Element elemTgt = doc.GetElement(elemIdTgt);
            Element elemTgt = doc.GetElement(elemUqId);

            if (elemTgt == null)
            {
                return;
            }

            // コメントパラメータ取得
            Parameter paramComnt = elemTgt.get_Parameter(BuiltInParameter.ALL_MODEL_INSTANCE_COMMENTS);

            if (paramComnt == null)
            {
                return;
            }

            //Modifying the window parameters
            //Open transaction
            Transaction trans = new Transaction(doc);

            trans.Start("Update Comment parameters");

            paramComnt.Set(commentStr);

            //To save all the changes commit the transaction
            trans.Commit();

            //Save the updated file by overwriting the existing file
            ModelPath     ProjectModelPath = ModelPathUtils.ConvertUserVisiblePathToModelPath(OUTPUT_FILE);
            SaveAsOptions SAO = new SaveAsOptions();

            SAO.OverwriteExistingFile = true;

            //Save the project file with updated window's parameters
            LogTrace("Saving file...");
            doc.SaveAs(ProjectModelPath, SAO);
        }
Пример #38
0
        public List<Model> Post(InputParams p)
        {
            Logging.CBLoggers logMessage = new Logging.CBLoggers();
            string jsonParam = JsonConvert.SerializeObject(p);

            List<Model> result = new List<Model>();

            try
            {
                // 아이템 리스트 1개를 가져오는 프로시져.

                using (SqlConnection connection = new SqlConnection(globalVal.DBConnectionString))
                {
                    using (SqlCommand command = new SqlCommand("CloudBread.uspSelItem1", connection))
                    {
                        command.CommandType = CommandType.StoredProcedure;
                        command.Parameters.Add("@ItemListID", SqlDbType.NVarChar, -1).Value = p.ItemListID;
                        connection.Open();

                        using (SqlDataReader dreader = command.ExecuteReader())
                        {
                            while (dreader.Read())
                            {
                                Model workItem = new Model()
                                {
                                    ItemListID = dreader[0].ToString(),
                                    ItemName = dreader[1].ToString(),
                                    ItemDescription = dreader[2].ToString(),
                                    ItemPrice = dreader[3].ToString(),
                                    ItemSellPrice = dreader[4].ToString(),
                                    ItemCategory1 = dreader[5].ToString(),
                                    ItemCategory2 = dreader[6].ToString(),
                                    ItemCategory3 = dreader[7].ToString(),
                                    sCol1 = dreader[8].ToString(),
                                    sCol2 = dreader[9].ToString(),
                                    sCol3 = dreader[10].ToString(),
                                    sCol4 = dreader[11].ToString(),
                                    sCol5 = dreader[12].ToString(),
                                    sCol6 = dreader[13].ToString(),
                                    sCol7 = dreader[14].ToString(),
                                    sCol8 = dreader[15].ToString(),
                                    sCol9 = dreader[16].ToString(),
                                    sCol10 = dreader[17].ToString(),
                                };
                                result.Add(workItem);
                            }
                            dreader.Close();
                        }
                        connection.Close();
                    }
                    return result;
                }
            }

            catch (Exception ex)
            {
                //에러로그
                logMessage.memberID = p.MemberID;
                logMessage.Level = "ERROR";
                logMessage.Logger = "CBSelItem1Controller";
                logMessage.Message = jsonParam;
                logMessage.Exception = ex.ToString();
                Logging.RunLog(logMessage);

                throw;
            }
        }
Пример #39
0
 public TransportClass1(TransportClassMainAshx oTransportClassMainAshx, ITaskResultInterface oTaskResult, CTaskQueue oTaskQueue, InputParams oInputParams)
     : base(oTransportClassMainAshx.m_oHttpContext, oTransportClassMainAshx.m_oAsyncCallback)
 {
     m_oTaskResult  = oTaskResult;
     m_oInputParams = oInputParams;
     m_oTaskQueue   = oTaskQueue;
     m_oTimer       = null;
 }
Пример #40
0
        public string Post(InputParams p)
        {
            string result = "";
            ////////////////////////////////////////////////////////////////////////
            //공통 회원 정보 수정 모듈 시작 update시 파라미터를 NULL로 주면 해당 컬럼은 변화되지 않음.
            // Json에서는 null 으로 값을 지정하거나 아예 값을 제공하지 않아도 가능
            ////////////////////////////////////////////////////////////////////////

            Logging.CBLoggers logMessage = new Logging.CBLoggers();
            string jsonParam = JsonConvert.SerializeObject(p);

            try
            {
                // 진입로그
                //logMessage.memberID = p.MemberID;
                //logMessage.Level = "INFO";
                //logMessage.Logger = "CBUdtMoveGiftController";
                //logMessage.Message = jsonParam;
                //Logging.RunLog(logMessage);

                using (SqlConnection connection = new SqlConnection(globalVal.DBConnectionString))
                {
                    using (SqlCommand command = new SqlCommand("CloudBread.uspUdtMoveGift", connection))
                    {
                        command.CommandType = CommandType.StoredProcedure;
                        command.Parameters.Add("@InsertORUpdate", SqlDbType.NVarChar, -1).Value = p.InsertORUpdate.ToUpper();       // INSERT UPDATE 여부 분기
                        command.Parameters.Add("@GiftDepositoryID", SqlDbType.NVarChar, -1).Value = p.GiftDepositoryID;
                        command.Parameters.Add("@MemberItemID", SqlDbType.NVarChar, -1).Value = p.MemberItemID;
                        command.Parameters.Add("@MemberID", SqlDbType.NVarChar, -1).Value = p.MemberID;
                        command.Parameters.Add("@ItemListID", SqlDbType.NVarChar, -1).Value = p.ItemListID;
                        command.Parameters.Add("@ItemCount", SqlDbType.NVarChar, -1).Value = p.ItemCount;
                        command.Parameters.Add("@ItemStatus", SqlDbType.NVarChar, -1).Value = p.ItemStatus;
                        command.Parameters.Add("@sCol1", SqlDbType.NVarChar, -1).Value = p.sCol1;
                        command.Parameters.Add("@sCol2", SqlDbType.NVarChar, -1).Value = p.sCol2;
                        command.Parameters.Add("@sCol3", SqlDbType.NVarChar, -1).Value = p.sCol3;
                        command.Parameters.Add("@sCol4", SqlDbType.NVarChar, -1).Value = p.sCol4;
                        command.Parameters.Add("@sCol5", SqlDbType.NVarChar, -1).Value = p.sCol5;
                        command.Parameters.Add("@sCol6", SqlDbType.NVarChar, -1).Value = p.sCol6;
                        command.Parameters.Add("@sCol7", SqlDbType.NVarChar, -1).Value = p.sCol7;
                        command.Parameters.Add("@sCol8", SqlDbType.NVarChar, -1).Value = p.sCol8;
                        command.Parameters.Add("@sCol9", SqlDbType.NVarChar, -1).Value = p.sCol9;
                        command.Parameters.Add("@sCol10", SqlDbType.NVarChar, -1).Value = p.sCol10;

                        connection.Open();
                        using (SqlDataReader dreader = command.ExecuteReader())
                        {
                            while (dreader.Read())
                            {
                                result = dreader[0].ToString();
                            }
                            dreader.Close();
                        }
                        connection.Close();

                        //완료 로그
                        logMessage.memberID = p.MemberID;
                        logMessage.Level = "INFO";
                        logMessage.Logger = "CBUdtMoveGiftController";
                        logMessage.Message = jsonParam;
                        Logging.RunLog(logMessage);

                        return result;
                    }

                }
            }

            catch (Exception ex)
            {
                //에러로그
                logMessage.memberID = p.MemberID;
                logMessage.Level = "ERROR";
                logMessage.Logger = "CBUdtMoveGiftController";
                logMessage.Message = jsonParam;
                logMessage.Exception = ex.ToString();
                Logging.RunLog(logMessage);

                throw;
            }
        }
        public string Post(InputParams p)
        {
            string result = "";
            ////////////////////////////////////////////////////////////////////////
            //보유 아이템 추가-사용 컨트롤러 시작
            ////////////////////////////////////////////////////////////////////////
            Logging.CBLoggers logMessage = new Logging.CBLoggers();
            string jsonParam = JsonConvert.SerializeObject(p);

            try
            {
                // 진입로그
                //logMessage.memberID = p.MemberID_MemberItem;
                //logMessage.Level = "INFO";
                //logMessage.Logger = "CBAddUseMemberItemController";
                //logMessage.Message = jsonParam;
                //Logging.RunLog(logMessage);

                using (SqlConnection connection = new SqlConnection(globalVal.DBConnectionString))
                {
                    using (SqlCommand command = new SqlCommand("CloudBread.uspAddUseMemberItem", connection))
                    {
                        command.CommandType = CommandType.StoredProcedure;
                        command.Parameters.Add("@InsertORUpdateORDelete", SqlDbType.NVarChar, -1).Value = p.InsertORUpdateORDelete.ToUpper();
                        command.Parameters.Add("@MemberItemID_MemberItem", SqlDbType.NVarChar, -1).Value = p.MemberItemID_MemberItem;
                        command.Parameters.Add("@MemberID_MemberItem", SqlDbType.NVarChar, -1).Value = p.MemberID_MemberItem;
                        command.Parameters.Add("@ItemListID_MemberItem", SqlDbType.NVarChar, -1).Value = p.ItemListID_MemberItem;
                        command.Parameters.Add("@ItemCount_MemberItem", SqlDbType.NVarChar, -1).Value = p.ItemCount_MemberItem;
                        command.Parameters.Add("@ItemStatus_MemberItem", SqlDbType.NVarChar, -1).Value = p.ItemStatus_MemberItem;
                        command.Parameters.Add("@sCol1_MemberItem", SqlDbType.NVarChar, -1).Value = p.sCol1_MemberItem;
                        command.Parameters.Add("@sCol2_MemberItem", SqlDbType.NVarChar, -1).Value = p.sCol2_MemberItem;
                        command.Parameters.Add("@sCol3_MemberItem", SqlDbType.NVarChar, -1).Value = p.sCol3_MemberItem;
                        command.Parameters.Add("@sCol4_MemberItem", SqlDbType.NVarChar, -1).Value = p.sCol4_MemberItem;
                        command.Parameters.Add("@sCol5_MemberItem", SqlDbType.NVarChar, -1).Value = p.sCol5_MemberItem;
                        command.Parameters.Add("@sCol6_MemberItem", SqlDbType.NVarChar, -1).Value = p.sCol6_MemberItem;
                        command.Parameters.Add("@sCol7_MemberItem", SqlDbType.NVarChar, -1).Value = p.sCol7_MemberItem;
                        command.Parameters.Add("@sCol8_MemberItem", SqlDbType.NVarChar, -1).Value = p.sCol8_MemberItem;
                        command.Parameters.Add("@sCol9_MemberItem", SqlDbType.NVarChar, -1).Value = p.sCol9_MemberItem;
                        command.Parameters.Add("@sCol10_MemberItem", SqlDbType.NVarChar, -1).Value = p.sCol10_MemberItem;
                        command.Parameters.Add("@MemberID_MemberGameInfoes", SqlDbType.NVarChar, -1).Value = p.MemberID_MemberGameInfoes;
                        command.Parameters.Add("@Level_MemberGameInfoes", SqlDbType.NVarChar, -1).Value = p.Level_MemberGameInfoes;
                        command.Parameters.Add("@Exps_MemberGameInfoes", SqlDbType.NVarChar, -1).Value = p.Exps_MemberGameInfoes;
                        command.Parameters.Add("@Points_MemberGameInfoes", SqlDbType.NVarChar, -1).Value = p.Points_MemberGameInfoes;
                        command.Parameters.Add("@UserSTAT1_MemberGameInfoes", SqlDbType.NVarChar, -1).Value = p.UserSTAT1_MemberGameInfoes;
                        command.Parameters.Add("@UserSTAT2_MemberGameInfoes", SqlDbType.NVarChar, -1).Value = p.UserSTAT2_MemberGameInfoes;
                        command.Parameters.Add("@UserSTAT3_MemberGameInfoes", SqlDbType.NVarChar, -1).Value = p.UserSTAT3_MemberGameInfoes;
                        command.Parameters.Add("@UserSTAT4_MemberGameInfoes", SqlDbType.NVarChar, -1).Value = p.UserSTAT4_MemberGameInfoes;
                        command.Parameters.Add("@UserSTAT5_MemberGameInfoes", SqlDbType.NVarChar, -1).Value = p.UserSTAT5_MemberGameInfoes;
                        command.Parameters.Add("@UserSTAT6_MemberGameInfoes", SqlDbType.NVarChar, -1).Value = p.UserSTAT6_MemberGameInfoes;
                        command.Parameters.Add("@UserSTAT7_MemberGameInfoes", SqlDbType.NVarChar, -1).Value = p.UserSTAT7_MemberGameInfoes;
                        command.Parameters.Add("@UserSTAT8_MemberGameInfoes", SqlDbType.NVarChar, -1).Value = p.UserSTAT8_MemberGameInfoes;
                        command.Parameters.Add("@UserSTAT9_MemberGameInfoes", SqlDbType.NVarChar, -1).Value = p.UserSTAT9_MemberGameInfoes;
                        command.Parameters.Add("@UserSTAT10_MemberGameInfoes", SqlDbType.NVarChar, -1).Value = p.UserSTAT10_MemberGameInfoes;
                        command.Parameters.Add("@sCol1_MemberGameInfoes", SqlDbType.NVarChar, -1).Value = p.sCol1_MemberGameInfoes;
                        command.Parameters.Add("@sCol2_MemberGameInfoes", SqlDbType.NVarChar, -1).Value = p.sCol2_MemberGameInfoes;
                        command.Parameters.Add("@sCol3_MemberGameInfoes", SqlDbType.NVarChar, -1).Value = p.sCol3_MemberGameInfoes;
                        command.Parameters.Add("@sCol4_MemberGameInfoes", SqlDbType.NVarChar, -1).Value = p.sCol4_MemberGameInfoes;
                        command.Parameters.Add("@sCol5_MemberGameInfoes", SqlDbType.NVarChar, -1).Value = p.sCol5_MemberGameInfoes;
                        command.Parameters.Add("@sCol6_MemberGameInfoes", SqlDbType.NVarChar, -1).Value = p.sCol6_MemberGameInfoes;
                        command.Parameters.Add("@sCol7_MemberGameInfoes", SqlDbType.NVarChar, -1).Value = p.sCol7_MemberGameInfoes;
                        command.Parameters.Add("@sCol8_MemberGameInfoes", SqlDbType.NVarChar, -1).Value = p.sCol8_MemberGameInfoes;
                        command.Parameters.Add("@sCol9_MemberGameInfoes", SqlDbType.NVarChar, -1).Value = p.sCol9_MemberGameInfoes;
                        command.Parameters.Add("@sCol10_MemberGameInfoes", SqlDbType.NVarChar, -1).Value = p.sCol10_MemberGameInfoes;

                        connection.Open();
                        using (SqlDataReader dreader = command.ExecuteReader())
                        {
                            while (dreader.Read())
                            {
                                result = dreader[0].ToString();
                            }
                            dreader.Close();
                        }
                        connection.Close();

                        //완료 로그
                        logMessage.memberID = p.MemberID_MemberItem;
                        logMessage.Level = "INFO";
                        logMessage.Logger = "CBAddUseMemberItemController";
                        logMessage.Message = jsonParam;
                        Logging.RunLog(logMessage);

                        return result;
                    }

                }
            }

            catch (Exception ex)
            {
                //에러로그
                logMessage.memberID = p.MemberID_MemberItem;
                logMessage.Level = "ERROR";
                logMessage.Logger = "CBAddUseMemberItemController";
                logMessage.Message = jsonParam;
                logMessage.Exception = ex.ToString();
                Logging.RunLog(logMessage);

                throw;
            }
        }
Пример #42
0
 public override void UpdateFlow(float _dt, InputParams _ip)
 {
     throw new System.NotImplementedException();
 }
Пример #43
0
 void UpdateMoveStateParameters(InputParams inputParams)
 {
     moveStateParameters.velocity     = body.velocity;
     moveStateParameters.jumpRequired = inputParams.jumpRequest;
     moveStateParameters.grounded     = IsGrounded();
 }
Пример #44
0
 public override void Move(InputParams _input)
 {
     transform.position = transform.position + transform.up * speed * Time.deltaTime;
 }
    void UpdateInteractStateParameters(InputParams inputParams)
    {
        switch (inputParams.actionRequest)
        {
        case ActionRequest.Glide:
            if (movementState == MovementState.Fall || movementState == MovementState.PushUp)
            {
                interactStateParameter.canGlide = true;
            }
            else
            {
                interactStateParameter.canGlide = false;
            }
            break;

        case ActionRequest.MeleeAttack:
            if (interactState != InteractState.Glide)
            {
                interactStateParameter.finishedMeleeAttack = false;
                interactStateParameter.canMeleeAttack      = true;
            }
            break;

        case ActionRequest.DistantAttack:
            if (interactState != InteractState.Glide)
            {
                interactStateParameter.finishedDistantAttack = false;
                interactStateParameter.canDistantAttack      = true;
            }
            break;

        case ActionRequest.SpawnLure:
            if (actualLure == null)
            {
                interactStateParameter.canSpawnLure = true;
            }
            else
            {
                interactStateParameter.canDestroyLure = true;
            }
            break;

        case ActionRequest.Inflate:
            if (IsGrounded())
            {
                interactStateParameter.canInflate = true;
            }
            break;

        case ActionRequest.Resize:
            if (IsGrounded())
            {
                interactStateParameter.canResize = true;
            }
            break;

        case ActionRequest.ContextualAction:
            GameObject nearestObject = absorbRange.GetComponent <DetectNearInteractObject>().GetNearestObject();

            if (interactState == InteractState.Carry)
            {
                interactStateParameter.finishedCarry = true;
            }
            else if (nearestObject != null)
            {
                bool inFrontOfActivableObject  = false;
                bool inFrontOfAbsorbableObject = false;
                bool inFrontOfPortableObject   = false;

                if (nearestObject.CompareTag("Yokai"))
                {
                    inFrontOfAbsorbableObject = true;
                    interactStateParameter.yokaiStillInRange = true;
                }
                else if (nearestObject.gameObject.layer == LayerMask.NameToLayer("Catchable"))
                {
                    inFrontOfPortableObject = true;
                }
                else if (nearestObject.gameObject.layer == LayerMask.NameToLayer("Activable"))
                {
                    inFrontOfActivableObject = true;
                }

                interactStateParameter.canActivate = false;
                interactStateParameter.canAbsorb   = false;
                interactStateParameter.canCarry    = false;

                if (IsGrounded())
                {
                    if (inFrontOfActivableObject)
                    {
                        interactStateParameter.canActivate = true;
                    }
                    else if (inFrontOfAbsorbableObject)
                    {
                        interactStateParameter.canAbsorb = true;
                    }
                    else if (inFrontOfPortableObject)
                    {
                        interactStateParameter.canCarry = true;
                        objectToCarry = nearestObject;
                        //reset action so that we cannot catch and decatch due to malsynchronization
                        inputParams.actionRequest = ActionRequest.None;
                        inputController.SetUserRequest(inputParams);
                    }
                }
            }
            break;

        case ActionRequest.None:
            interactStateParameter.canGlide         = false;
            interactStateParameter.canMeleeAttack   = false;
            interactStateParameter.canDistantAttack = false;
            interactStateParameter.canSpawnLure     = false;
            interactStateParameter.canDestroyLure   = false;
            interactStateParameter.canInflate       = false;
            interactStateParameter.canActivate      = false;
            interactStateParameter.canAbsorb        = false;
            interactStateParameter.canCarry         = false;
            interactStateParameter.canPush          = false;
            interactStateParameter.finishedCarry    = false;
            interactStateParameter.canAirStream     = false;
            nearestObject = null;
            break;
        }
    }
        public List<Model> Post(InputParams p)
        {
            Logging.CBLoggers logMessage = new Logging.CBLoggers();
            string jsonParam = JsonConvert.SerializeObject(p);

            List<Model> result = new List<Model>();

            try
            {
                // 아이템 리스트들을 가져오는 프로시져. 전체를 가져올 경우 페이지사이즈를 최대로 준다.
                // 페이징이 필요 없을 경우는 파라미터를 크게 잡을 것
                // 참고로 big int -9223372036854775808 부터 9223372036854775807 까지

                using (SqlConnection connection = new SqlConnection(globalVal.DBConnectionString))
                {
                    using (SqlCommand command = new SqlCommand("CloudBread.uspSelItemListAll", connection))
                    {
                        command.CommandType = CommandType.StoredProcedure;
                        command.Parameters.Add("@Page", SqlDbType.BigInt).Value = p.Page;
                        command.Parameters.Add("@PageSize", SqlDbType.BigInt).Value = p.PageSize;
                        connection.Open();

                        using (SqlDataReader dreader = command.ExecuteReader())
                        {
                            while (dreader.Read())
                            {
                                Model workItem = new Model()
                                {
                                    ROWNUM = dreader[0].ToString(),
                                    ItemListID = dreader[1].ToString(),
                                    ItemName = dreader[2].ToString(),
                                    ItemDescription = dreader[3].ToString(),
                                    ItemPrice = dreader[4].ToString(),
                                    ItemSellPrice = dreader[5].ToString(),
                                    ItemCategory1 = dreader[6].ToString(),
                                    ItemCategory2 = dreader[7].ToString(),
                                    ItemCategory3 = dreader[8].ToString(),
                                    sCol1 = dreader[9].ToString(),
                                    sCol2 = dreader[10].ToString(),
                                    sCol3 = dreader[11].ToString(),
                                    sCol4 = dreader[12].ToString(),
                                    sCol5 = dreader[13].ToString(),
                                    sCol6 = dreader[14].ToString(),
                                    sCol7 = dreader[15].ToString(),
                                    sCol8 = dreader[16].ToString(),
                                    sCol9 = dreader[17].ToString(),
                                    sCol10 = dreader[18].ToString()
                                };
                                result.Add(workItem);
                            }
                            dreader.Close();
                        }
                        connection.Close();
                    }
                    return result;
                }
            }

            catch (Exception ex)
            {
                //에러로그
                logMessage.memberID = p.MemberID;
                logMessage.Level = "ERROR";
                logMessage.Logger = "CBSelItemListAllController";
                logMessage.Message = jsonParam;
                logMessage.Exception = ex.ToString();
                Logging.RunLog(logMessage);

                throw ex;
            }
        }
        public string Post(InputParams p)
        {
            string result = "";
            ////////////////////////////////////////////////////////////////////////
            // 공통 MemberGameInfo 정보 수정 모듈 시작 update시 파라미터를 NULL로 주면 해당 컬럼은 변화되지 않음.
            // Json에서는 null 으로 값을 지정하거나 아예 로우 값을 제공하지 않아도 가능
            ////////////////////////////////////////////////////////////////////////
            Logging.CBLoggers logMessage = new Logging.CBLoggers();
            string jsonParam = JsonConvert.SerializeObject(p);

            try
            {
                // 진입로그
                //logMessage.memberID = p.MemberID;
                //logMessage.Level = "INFO";
                //logMessage.Logger = "CBComUdtMemberGameInfoesController";
                //logMessage.Message = jsonParam;
                //Logging.RunLog(logMessage);

                using (SqlConnection connection = new SqlConnection(globalVal.DBConnectionString))
                {
                    using (SqlCommand command = new SqlCommand("CloudBread.uspComUdtMemberGameInfoes", connection))
                    {

                        command.CommandType = CommandType.StoredProcedure;
                        command.Parameters.Add("@MemberID", SqlDbType.NVarChar, -1).Value = p.MemberID;
                        command.Parameters.Add("@Level", SqlDbType.NVarChar, -1).Value = p.Level;
                        command.Parameters.Add("@Exps", SqlDbType.NVarChar, -1).Value = p.Exps;
                        command.Parameters.Add("@Points", SqlDbType.NVarChar, -1).Value = p.Points;
                        command.Parameters.Add("@UserSTAT1", SqlDbType.NVarChar, -1).Value = p.UserSTAT1;
                        command.Parameters.Add("@UserSTAT2", SqlDbType.NVarChar, -1).Value = p.UserSTAT2;
                        command.Parameters.Add("@UserSTAT3", SqlDbType.NVarChar, -1).Value = p.UserSTAT3;
                        command.Parameters.Add("@UserSTAT4", SqlDbType.NVarChar, -1).Value = p.UserSTAT4;
                        command.Parameters.Add("@UserSTAT5", SqlDbType.NVarChar, -1).Value = p.UserSTAT5;
                        command.Parameters.Add("@UserSTAT6", SqlDbType.NVarChar, -1).Value = p.UserSTAT6;
                        command.Parameters.Add("@UserSTAT7", SqlDbType.NVarChar, -1).Value = p.UserSTAT7;
                        command.Parameters.Add("@UserSTAT8", SqlDbType.NVarChar, -1).Value = p.UserSTAT8;
                        command.Parameters.Add("@UserSTAT9", SqlDbType.NVarChar, -1).Value = p.UserSTAT9;
                        command.Parameters.Add("@UserSTAT10", SqlDbType.NVarChar, -1).Value = p.UserSTAT10;
                        command.Parameters.Add("@sCol1", SqlDbType.NVarChar, -1).Value = p.sCol1;
                        command.Parameters.Add("@sCol2", SqlDbType.NVarChar, -1).Value = p.sCol2;
                        command.Parameters.Add("@sCol3", SqlDbType.NVarChar, -1).Value = p.sCol3;
                        command.Parameters.Add("@sCol4", SqlDbType.NVarChar, -1).Value = p.sCol4;
                        command.Parameters.Add("@sCol5", SqlDbType.NVarChar, -1).Value = p.sCol5;
                        command.Parameters.Add("@sCol6", SqlDbType.NVarChar, -1).Value = p.sCol6;
                        command.Parameters.Add("@sCol7", SqlDbType.NVarChar, -1).Value = p.sCol7;
                        command.Parameters.Add("@sCol8", SqlDbType.NVarChar, -1).Value = p.sCol8;
                        command.Parameters.Add("@sCol9", SqlDbType.NVarChar, -1).Value = p.sCol9;
                        command.Parameters.Add("@sCol10", SqlDbType.NVarChar, -1).Value = p.sCol10;

                        connection.Open();
                        using (SqlDataReader dreader = command.ExecuteReader())
                        {
                            while (dreader.Read())
                            {
                                result = dreader[0].ToString();
                            }
                            dreader.Close();
                        }
                        connection.Close();

                        // 완료 로그
                        logMessage.memberID = p.MemberID;
                        logMessage.Level = "INFO";
                        logMessage.Logger = "CBComUdtMemberGameInfoesController";
                        logMessage.Message = jsonParam;
                        Logging.RunLog(logMessage);

                        return result;
                    }

                }
            }

            catch (Exception ex)
            {
                //에러로그
                logMessage.memberID = p.MemberID;
                logMessage.Level = "ERROR";
                logMessage.Logger = "CBComUdtMemberGameInfoesController";
                logMessage.Message = jsonParam;
                logMessage.Exception = ex.ToString();
                Logging.RunLog(logMessage);

                throw;
            }
        }
Пример #48
0
        public void ExecuteAction(ref NodePlatformAction platformAction)
        {
            try
            {
                mPlatformAction = platformAction;

                InputParams = platformAction.InputParams;

                // convert the JArray to list of locators
                JObject Locators = (JObject)InputParams["Locators"];

                eElementType      ElementType = (eElementType)Enum.Parse(typeof(eElementType), (string)InputParams["ElementType"]);
                IGingerWebElement uiElement   = null;
                JArray            Frames      = null;
                if (InputParams.ContainsKey("Frames"))
                {
                    Frames = (JArray)InputParams["Frames"];

                    if (Frames != null && Frames.Children().Count() > 0)
                    {
                        mPlatformService.BrowserActions.SwitchToDefaultContent();
                        foreach (JToken jf in Frames.Children())
                        {
                            IGingerWebElement GWA = mPlatformService.LocateWebElement.LocateElementByXPath(eElementType.WebElement, jf.ToString());
                            mPlatformService.BrowserActions.SwitchToFrame(GWA);
                        }
                    }
                }

                foreach (JProperty locator in Locators.Children())
                {
                    uiElement = WebPlatformActionHandler.LocateElement(ref ElementType, locator.Name, locator.Value.ToString(), mPlatformService);
                    if (uiElement != null)
                    {
                        platformAction.exInfo += "UI Element Located using: " + locator.Name + "=" + locator.Value;
                        break;
                    }
                }
                if (uiElement == null)
                {
                    platformAction.error += "Element not found";

                    return;
                }

                ElementAction = (eElementAction)Enum.Parse(typeof(eElementAction), (string)platformAction.InputParams["ElementAction"]);



                RunActionOnUIElement(uiElement, ElementType);

                //TODO: remove  // update output values - TODO: do it directlyon platformAction !!!
                foreach (NodeActionOutputValue nodeActionOutputValue in AOVs)
                {
                    platformAction.Output.Add(nodeActionOutputValue.Param, (string)nodeActionOutputValue.Value); // TODO: add path !!!
                }
            }

            catch (Exception Ex)
            {
                Error         = Ex.Message;
                ExecutionInfo = Ex.StackTrace;  // DO not put stacktrace !!!!
            }
        }
Пример #49
0
        private void BtnGo_Click(object sender, EventArgs e)
        {
            void Alert(string text)
            {
                MessageBox.Show(text, ApplicationHelper.GetApplicationTitle(), MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }

            bool Confirm(string text)
            {
                var r = MessageBox.Show(text, ApplicationHelper.GetApplicationTitle(), MessageBoxButtons.YesNo, MessageBoxIcon.Warning);

                return(r == DialogResult.Yes);
            }

            bool CheckInputParams()
            {
                bool CheckOutputDir(string filePath)
                {
                    var outputDirExists = !string.IsNullOrEmpty(filePath);

                    if (outputDirExists)
                    {
                        var file = new FileInfo(filePath);
                        var dir  = file.Directory;
                        outputDirExists = dir != null && dir.Exists;
                    }

                    if (!outputDirExists)
                    {
                        Alert($"Output folder of \"{filePath}\" does not exist.");
                    }

                    return(outputDirExists);
                }

                if (chkGenerateModel.Checked || chkGenerateCharAnim.Checked)
                {
                    if (!File.Exists(txtInputHead.Text))
                    {
                        Alert($"Head model \"{txtInputHead.Text}\" does not exist.");
                        return(false);
                    }

                    if (!File.Exists(txtInputBody.Text))
                    {
                        Alert($"Body model \"{txtInputBody.Text}\" does not exist.");
                        return(false);
                    }
                }

                if (chkGenerateModel.Checked)
                {
                    if (!CheckOutputDir(txtOutputModel.Text))
                    {
                        return(false);
                    }
                }

                if (chkOptApplyCharHeight.Checked)
                {
                    if (!float.TryParse(txtOptCharHeight.Text, NumberStyles.Float, GlobalizationHelper.Culture, out var height) || height <= 0.1f)
                    {
                        Alert("Please enter a valid idol height.");
                    }

                    if (height < 1.0f || 2.0f < height)
                    {
                        var heightStr = height.ToString(GlobalizationHelper.Culture);
                        // Don't mind multiple string concatenations. It only executes once. :D
                        var message = "You entered a strange value for idol height." +
                                      " This may be caused by the differences of decimal point among countries." +
                                      " A wrong value may let this program generate wrong mesh and bones for the model." +
                                      Environment.NewLine + Environment.NewLine +
                                      $"The number in the numeric format of your culture ({GlobalizationHelper.Culture.DisplayName}) is: {heightStr}" +
                                      Environment.NewLine + Environment.NewLine +
                                      "Are you sure that you entered a correct value?";

                        if (!Confirm(message))
                        {
                            return(false);
                        }
                    }
                }

                if (chkGenerateCharAnim.Checked)
                {
                    if (!File.Exists(txtInputDance.Text))
                    {
                        Alert($"Dance data \"{txtInputDance.Text}\" does not exist.");
                        return(false);
                    }

                    if (!CheckOutputDir(txtOutputCharAnim.Text))
                    {
                        return(false);
                    }
                }

                if (chkGenerateLipSync.Checked || chkGenerateFacialExpression.Checked)
                {
                    if (!File.Exists(txtInputFacialExpression.Text))
                    {
                        Alert($"Facial expression data \"{txtInputFacialExpression.Text}\" does not exist.");
                        return(false);
                    }
                }

                if (chkGenerateLipSync.Checked)
                {
                    if (!CheckOutputDir(txtOutputLipSync.Text))
                    {
                        return(false);
                    }
                }

                if (chkGenerateFacialExpression.Checked)
                {
                    if (!File.Exists(txtOptFEMappings.Text))
                    {
                        Alert($"Facial expression mapping file \"{txtOptFEMappings.Text}\" does not exist.");
                        return(false);
                    }

                    if (!CheckOutputDir(txtOutputFacialExpression.Text))
                    {
                        return(false);
                    }
                }

                if (chkGenerateCameraMotion.Checked)
                {
                    if (!File.Exists(txtInputCamera.Text))
                    {
                        Alert($"Camera data \"{txtInputCamera.Text}\" does not exist.");
                        return(false);
                    }

                    if (!CheckOutputDir(txtOutputCameraMotion.Text))
                    {
                        return(false);
                    }
                }

                if (radOptCamFormatVmd.Checked)
                {
                    // globalization: The type is uint32 so only thousand separator appears. In either way,
                    // it will raise a parse error if the user does not conform the UI locale (e.g. input
                    // "12,345" in French locale, or "12.345" in US locale).
                    if (!uint.TryParse(txtOptFixedFov.Text, NumberStyles.Integer, GlobalizationHelper.Culture, out var u) || u == 0)
                    {
                        Alert($"FOV value \"{txtOptFixedFov.Text}\" should be a valid positive integer.");
                        return(false);
                    }
                }

                if (chkGenerateModel.Checked || chkGenerateCharAnim.Checked)
                {
                    if (!Regex.IsMatch(txtInputHead.Text, @"ch_[a-z]{2}\d{3}_(?:\d{3}[a-z]{3}|[a-z])(?:_v2)?\.unity3d$", RegexOptions.CultureInvariant))
                    {
                        Alert($"File \"{txtInputHead.Text}\" does not look like a character head file from the game.");
                        return(false);
                    }

                    if (!Regex.IsMatch(txtInputBody.Text, @"cb_[a-z]{2}\d{3}_(?:\d{3}[a-z]{3}|[a-z])\.unity3d$", RegexOptions.CultureInvariant))
                    {
                        Alert($"File \"{txtInputBody.Text}\" does not look like a character body file from the game.");
                        return(false);
                    }
                }

                if (chkGenerateCharAnim.Checked)
                {
                    if (!Regex.IsMatch(txtInputDance.Text, @"dan_[a-z0-9]{6}_0[12345](?:\.imo)?\.unity3d$", RegexOptions.CultureInvariant))
                    {
                        Alert($"File \"{txtInputDance.Text}\" does not look like a dance data file from the game.");
                        return(false);
                    }
                }

                if (chkGenerateLipSync.Checked || chkGenerateFacialExpression.Checked)
                {
                    if (!Regex.IsMatch(txtInputFacialExpression.Text, @"scrobj_[a-z0-9]{6}\.unity3d$", RegexOptions.CultureInvariant))
                    {
                        Alert($"File \"{txtInputFacialExpression.Text}\" does not look like a mixed data file from the game containing facial expressions.");
                        return(false);
                    }
                }

                if (chkGenerateCameraMotion.Checked)
                {
                    if (!Regex.IsMatch(txtInputCamera.Text, @"cam_[a-z0-9]{6}(?:\.imo)?\.unity3d$", RegexOptions.CultureInvariant))
                    {
                        Alert($"File \"{txtInputCamera.Text}\" does not look like a camera data file from the game.");
                        return(false);
                    }

                    if (radOptCamFormatVmd.Checked)
                    {
                        if (!txtOutputCameraMotion.Text.EndsWith(".vmd", StringComparison.OrdinalIgnoreCase))
                        {
                            if (!Confirm("The output camera file name does not ends with \".vmd\". Are you sure to continue?"))
                            {
                                return(false);
                            }
                        }
                    }
                    else if (radOptCamFormatMvd.Checked)
                    {
                        if (!txtOutputCameraMotion.Text.EndsWith(".mvd", StringComparison.OrdinalIgnoreCase))
                        {
                            if (!Confirm("The output camera file name does not ends with \".mvd\". Are you sure to continue?"))
                            {
                                return(false);
                            }
                        }
                    }
                }

                return(true);
            }

            InputParams PrepareInputParams()
            {
                var ip = new InputParams();

                ip.GenerateModel             = chkGenerateModel.Checked;
                ip.GenerateCharacterMotion   = chkGenerateCharAnim.Checked;
                ip.GenerateLipSync           = chkGenerateLipSync.Checked;
                ip.GenerateFacialExpressions = chkGenerateFacialExpression.Checked;
                ip.GenerateCameraMotion      = chkGenerateCameraMotion.Checked;

                ip.InputHead             = txtInputHead.Text;
                ip.InputBody             = txtInputBody.Text;
                ip.InputDance            = txtInputDance.Text;
                ip.InputFacialExpression = txtInputFacialExpression.Text;
                ip.InputCamera           = txtInputCamera.Text;

                ip.OutputModel = txtOutputModel.Text;
                ip.OutputCharacterAnimation = txtOutputCharAnim.Text;
                ip.OutputLipSync            = txtOutputLipSync.Text;
                ip.OutputFacialExpressions  = txtOutputFacialExpression.Text;
                ip.OutputCamera             = txtOutputCameraMotion.Text;

                ip.MotionSource                   = radOptMotionSourceMltd.Checked ? MotionFormat.Mltd : MotionFormat.Mmd;
                ip.ScalePmx                       = chkOptScalePmx.Checked;
                ip.ConsiderIdolHeight             = chkOptApplyCharHeight.Checked;
                ip.IdolHeight                     = ip.ConsiderIdolHeight ? Convert.ToSingle(txtOptCharHeight.Text) : 0;
                ip.TranslateBoneNames             = chkOptTranslateBoneNames.Checked;
                ip.AppendLegIkBones               = chkOptAppendLegIKBones.Checked;
                ip.FixCenterBones                 = chkOptFixCenterBones.Checked;
                ip.ConvertBindingPose             = chkOptConvertToTdaPose.Checked;
                ip.AppendEyeBones                 = chkOptAppendEyeBones.Checked;
                ip.HideUnityGeneratedBones        = chkOptHideUnityGenBones.Checked;
                ip.TranslateFacialExpressionNames = chkOptTranslateFacialExpressionNames.Checked;
                ip.ImportPhysics                  = chkOptImportPhysics.Checked;
                ip.ApplyGameStyledToon            = chkGameToon.Checked;
                ip.SkinToonNumber                 = cboGameToonSkinNumber.SelectedIndex + 1;
                ip.ClothesToonNumber              = cboGameToonClothesNumber.SelectedIndex + 1;

                ip.TransformTo30Fps = radOptAnimFrameRate30.Checked;
                ip.ScaleVmd         = chkOptScaleVmd.Checked;
                ip.UseMvdForCamera  = radOptCamFormatMvd.Checked;
                ip.FixedFov         = ip.UseMvdForCamera ? Convert.ToUInt32(txtOptFixedFov.Text) : 0;
                ip.SongPosition     = cboOptSongPosition.SelectedIndex + 1;

                ip.FacialExpressionMappingFilePath = txtOptFEMappings.Text;
                ip.PreferredFacialExpressionSource = radFESourceLandscape.Checked ? InputParams.FallbackFacialExpressionSource.Landscape : InputParams.FallbackFacialExpressionSource.Portrait;

                return(ip);
            }

            txtLog.Clear();

            InputParams p;

            try {
                if (!CheckInputParams())
                {
                    return;
                }

                p = PrepareInputParams();
            } catch (Exception ex) {
                Alert(ex.Message);
                return;
            }

            var thread = new Thread(DoWork);

            thread.Name         = "Conversion thread";
            thread.IsBackground = true;

            thread.Start(p);

            EnableMainControls(false);
        }
        public string Post(InputParams p)
        {
            string result = "";
            //익명 회원가입 모듈 시작

            Logging.CBLoggers logMessage = new Logging.CBLoggers();
            string jsonParam = JsonConvert.SerializeObject(p);

            try
            {
                // 진입로그
                //logMessage.memberID = p.MembersMemberID;
                //logMessage.Level = "INFO";
                //logMessage.Logger = "CBInsAnonymousRegMemberController";
                //logMessage.Message = jsonParam;
                //Logging.RunLog(logMessage);

                using (SqlConnection connection = new SqlConnection(globalVal.DBConnectionString))
                {
                    using (SqlCommand command = new SqlCommand("CloudBread.uspInsAnonymousRegMember", connection))
                    {
                        command.CommandType = CommandType.StoredProcedure;
                        command.Parameters.Add("@MembersMemberID", SqlDbType.NVarChar, -1).Value = p.MembersMemberID;
                        command.Parameters.Add("@MembersMemberPWD", SqlDbType.NVarChar, -1).Value = p.MembersMemberPWD;
                        command.Parameters.Add("@MembersEmailAddress", SqlDbType.NVarChar, -1).Value = p.MembersEmailAddress;
                        command.Parameters.Add("@MembersEmailConfirmedYN", SqlDbType.NVarChar, -1).Value = p.MembersEmailConfirmedYN;
                        command.Parameters.Add("@MembersPhoneNumber1", SqlDbType.NVarChar, -1).Value = p.MembersPhoneNumber1;
                        command.Parameters.Add("@MembersPhoneNumber2", SqlDbType.NVarChar, -1).Value = p.MembersPhoneNumber2;
                        command.Parameters.Add("@MembersPINumber", SqlDbType.NVarChar, -1).Value = p.MembersPINumber;
                        command.Parameters.Add("@MembersName1", SqlDbType.NVarChar, -1).Value = p.MembersName1;
                        command.Parameters.Add("@MembersName2", SqlDbType.NVarChar, -1).Value = p.MembersName2;
                        command.Parameters.Add("@MembersName3", SqlDbType.NVarChar, -1).Value = p.MembersName3;
                        command.Parameters.Add("@MembersDOB", SqlDbType.NVarChar, -1).Value = p.MembersDOB;
                        command.Parameters.Add("@MembersRecommenderID", SqlDbType.NVarChar, -1).Value = p.MembersRecommenderID;
                        command.Parameters.Add("@MembersMemberGroup", SqlDbType.NVarChar, -1).Value = p.MembersMemberGroup;
                        command.Parameters.Add("@MembersLastDeviceID", SqlDbType.NVarChar, -1).Value = p.MembersLastDeviceID;
                        command.Parameters.Add("@MembersLastIPaddress", SqlDbType.NVarChar, -1).Value = p.MembersLastIPaddress;
                        command.Parameters.Add("@MembersLastLoginDT", SqlDbType.NVarChar, -1).Value = p.MembersLastLoginDT;
                        command.Parameters.Add("@MembersLastLogoutDT", SqlDbType.NVarChar, -1).Value = p.MembersLastLogoutDT;
                        command.Parameters.Add("@MembersLastMACAddress", SqlDbType.NVarChar, -1).Value = p.MembersLastMACAddress;
                        command.Parameters.Add("@MembersAccountBlockYN", SqlDbType.NVarChar, -1).Value = p.MembersAccountBlockYN;
                        command.Parameters.Add("@MembersAccountBlockEndDT", SqlDbType.NVarChar, -1).Value = p.MembersAccountBlockEndDT;
                        command.Parameters.Add("@MembersAnonymousYN", SqlDbType.NVarChar, -1).Value = p.MembersAnonymousYN;
                        command.Parameters.Add("@Members3rdAuthProvider", SqlDbType.NVarChar, -1).Value = p.Members3rdAuthProvider;
                        command.Parameters.Add("@Members3rdAuthID", SqlDbType.NVarChar, -1).Value = p.Members3rdAuthID;
                        command.Parameters.Add("@Members3rdAuthParam", SqlDbType.NVarChar, -1).Value = p.Members3rdAuthParam;
                        command.Parameters.Add("@MembersPushNotificationID", SqlDbType.NVarChar, -1).Value = p.MembersPushNotificationID;
                        command.Parameters.Add("@MembersPushNotificationProvider", SqlDbType.NVarChar, -1).Value = p.MembersPushNotificationProvider;
                        command.Parameters.Add("@MembersPushNotificationGroup", SqlDbType.NVarChar, -1).Value = p.MembersPushNotificationGroup;
                        command.Parameters.Add("@MemberssCol1", SqlDbType.NVarChar, -1).Value = p.MemberssCol1;
                        command.Parameters.Add("@MemberssCol2", SqlDbType.NVarChar, -1).Value = p.MemberssCol2;
                        command.Parameters.Add("@MemberssCol3", SqlDbType.NVarChar, -1).Value = p.MemberssCol3;
                        command.Parameters.Add("@MemberssCol4", SqlDbType.NVarChar, -1).Value = p.MemberssCol4;
                        command.Parameters.Add("@MemberssCol5", SqlDbType.NVarChar, -1).Value = p.MemberssCol5;
                        command.Parameters.Add("@MemberssCol6", SqlDbType.NVarChar, -1).Value = p.MemberssCol6;
                        command.Parameters.Add("@MemberssCol7", SqlDbType.NVarChar, -1).Value = p.MemberssCol7;
                        command.Parameters.Add("@MemberssCol8", SqlDbType.NVarChar, -1).Value = p.MemberssCol8;
                        command.Parameters.Add("@MemberssCol9", SqlDbType.NVarChar, -1).Value = p.MemberssCol9;
                        command.Parameters.Add("@MemberssCol10", SqlDbType.NVarChar, -1).Value = p.MemberssCol10;
                        command.Parameters.Add("@MembersTimeZoneID", SqlDbType.NVarChar, -1).Value = p.MembersTimeZoneID;
                        command.Parameters.Add("@MemberGameInfoesLevel", SqlDbType.NVarChar, -1).Value = p.MemberGameInfoesLevel;
                        command.Parameters.Add("@MemberGameInfoesExps", SqlDbType.NVarChar, -1).Value = p.MemberGameInfoesExps;
                        command.Parameters.Add("@MemberGameInfoesPoints", SqlDbType.NVarChar, -1).Value = p.MemberGameInfoesPoints;
                        command.Parameters.Add("@MemberGameInfoesUserSTAT1", SqlDbType.NVarChar, -1).Value = p.MemberGameInfoesUserSTAT1;
                        command.Parameters.Add("@MemberGameInfoesUserSTAT2", SqlDbType.NVarChar, -1).Value = p.MemberGameInfoesUserSTAT2;
                        command.Parameters.Add("@MemberGameInfoesUserSTAT3", SqlDbType.NVarChar, -1).Value = p.MemberGameInfoesUserSTAT3;
                        command.Parameters.Add("@MemberGameInfoesUserSTAT4", SqlDbType.NVarChar, -1).Value = p.MemberGameInfoesUserSTAT4;
                        command.Parameters.Add("@MemberGameInfoesUserSTAT5", SqlDbType.NVarChar, -1).Value = p.MemberGameInfoesUserSTAT5;
                        command.Parameters.Add("@MemberGameInfoesUserSTAT6", SqlDbType.NVarChar, -1).Value = p.MemberGameInfoesUserSTAT6;
                        command.Parameters.Add("@MemberGameInfoesUserSTAT7", SqlDbType.NVarChar, -1).Value = p.MemberGameInfoesUserSTAT7;
                        command.Parameters.Add("@MemberGameInfoesUserSTAT8", SqlDbType.NVarChar, -1).Value = p.MemberGameInfoesUserSTAT8;
                        command.Parameters.Add("@MemberGameInfoesUserSTAT9", SqlDbType.NVarChar, -1).Value = p.MemberGameInfoesUserSTAT9;
                        command.Parameters.Add("@MemberGameInfoesUserSTAT10", SqlDbType.NVarChar, -1).Value = p.MemberGameInfoesUserSTAT10;
                        command.Parameters.Add("@MemberGameInfoessCol1", SqlDbType.NVarChar, -1).Value = p.MemberGameInfoessCol1;
                        command.Parameters.Add("@MemberGameInfoessCol2", SqlDbType.NVarChar, -1).Value = p.MemberGameInfoessCol2;
                        command.Parameters.Add("@MemberGameInfoessCol3", SqlDbType.NVarChar, -1).Value = p.MemberGameInfoessCol3;
                        command.Parameters.Add("@MemberGameInfoessCol4", SqlDbType.NVarChar, -1).Value = p.MemberGameInfoessCol4;
                        command.Parameters.Add("@MemberGameInfoessCol5", SqlDbType.NVarChar, -1).Value = p.MemberGameInfoessCol5;
                        command.Parameters.Add("@MemberGameInfoessCol6", SqlDbType.NVarChar, -1).Value = p.MemberGameInfoessCol6;
                        command.Parameters.Add("@MemberGameInfoessCol7", SqlDbType.NVarChar, -1).Value = p.MemberGameInfoessCol7;
                        command.Parameters.Add("@MemberGameInfoessCol8", SqlDbType.NVarChar, -1).Value = p.MemberGameInfoessCol8;
                        command.Parameters.Add("@MemberGameInfoessCol9", SqlDbType.NVarChar, -1).Value = p.MemberGameInfoessCol9;
                        command.Parameters.Add("@MemberGameInfoessCol10", SqlDbType.NVarChar, -1).Value = p.MemberGameInfoessCol10;

                        connection.Open();
                        using (SqlDataReader dreader = command.ExecuteReader())
                        {
                            while (dreader.Read())
                            {
                                result = dreader[0].ToString();
                            }
                            dreader.Close();
                        }
                        connection.Close();

                        //완료 로그
                        logMessage.memberID = p.MembersMemberID;
                        logMessage.Level = "INFO";
                        logMessage.Logger = "CBInsAnonymousRegMemberController";
                        logMessage.Message = jsonParam;
                        Logging.RunLog(logMessage);

                        return result;
                    }
                }
            }

            catch (Exception ex)
            {
                //에러로그
                logMessage.memberID = p.MembersMemberID;
                logMessage.Level = "ERROR";
                logMessage.Logger = "CBInsAnonymousRegMemberController";
                logMessage.Message = jsonParam;
                logMessage.Exception = ex.ToString();
                Logging.RunLog(logMessage);

                throw;
            }
        }
        public List<Model> Post(InputParams p)
        {
            Logging.CBLoggers logMessage = new Logging.CBLoggers();
            string jsonParam = JsonConvert.SerializeObject(p);

            List<Model> result = new List<Model>();

            try
            {

                using (SqlConnection connection = new SqlConnection(globalVal.DBConnectionString))
                {
                    using (SqlCommand command = new SqlCommand("CloudBread.uspComSelMemberItemPurchase", connection))
                    {
                        command.CommandType = CommandType.StoredProcedure;
                        command.Parameters.Add("@MemberItemPurchaseID", SqlDbType.NVarChar, -1).Value = p.MemberItemPurchaseID;
                        connection.Open();

                        using (SqlDataReader dreader = command.ExecuteReader())
                        {
                            while (dreader.Read())
                            {
                                Model workItem = new Model()
                                {
                                    MemberItemPurchaseID = dreader[0].ToString(),
                                    MemberID = dreader[1].ToString(),
                                    ItemListID = dreader[2].ToString(),
                                    PurchaseQuantity = dreader[3].ToString(),
                                    PurchasePrice = dreader[4].ToString(),
                                    PGinfo1 = dreader[5].ToString(),
                                    PGinfo2 = dreader[6].ToString(),
                                    PGinfo3 = dreader[7].ToString(),
                                    PGinfo4 = dreader[8].ToString(),
                                    PGinfo5 = dreader[9].ToString(),
                                    PurchaseDeviceID = dreader[10].ToString(),
                                    PurchaseDeviceIPAddress = dreader[11].ToString(),
                                    PurchaseDeviceMACAddress = dreader[12].ToString(),
                                    PurchaseDT = dreader[13].ToString(),
                                    PurchaseCancelYN = dreader[14].ToString(),
                                    PurchaseCancelDT = dreader[15].ToString(),
                                    PurchaseCancelingStatus = dreader[16].ToString(),
                                    PurchaseCancelReturnedAmount = dreader[17].ToString(),
                                    PurchaseCancelDeviceID = dreader[18].ToString(),
                                    PurchaseCancelDeviceIPAddress = dreader[19].ToString(),
                                    PurchaseCancelDeviceMACAddress = dreader[20].ToString(),
                                    sCol1 = dreader[21].ToString(),
                                    sCol2 = dreader[22].ToString(),
                                    sCol3 = dreader[23].ToString(),
                                    sCol4 = dreader[24].ToString(),
                                    sCol5 = dreader[25].ToString(),
                                    sCol6 = dreader[26].ToString(),
                                    sCol7 = dreader[27].ToString(),
                                    sCol8 = dreader[28].ToString(),
                                    sCol9 = dreader[29].ToString(),
                                    sCol10 = dreader[30].ToString()

                                };
                                result.Add(workItem);
                            }
                            dreader.Close();
                        }
                        connection.Close();
                    }
                    return result;
                }
            }

            catch (Exception ex)
            {
                //에러로그
                logMessage.memberID = p.MemberID;
                logMessage.Level = "ERROR";
                logMessage.Logger = "CBComSelMemberItemPurchaseController";
                logMessage.Message = jsonParam;
                logMessage.Exception = ex.ToString();
                Logging.RunLog(logMessage);

                throw;
            }
        }
Пример #52
0
    public void Update(InputParams input)
    {
        //*********************************//
        // CHOICE PANEL MANAGEMENT
        //*********************************//

        if (panels[MacroUIPanels.choice].activeInHierarchy && !panels[MacroUIPanels.menu].activeInHierarchy)
        {
            if (Choices.GetCountNotNull() == 0)
            {
                //Debug.Log("Error hav been catch");
                panels[MacroUIPanels.choice].SetActive(false);
            }

            IteratorChoiceUpdate();
            if (input.Direction.y > 0)
            {
                iteratorChoices++;
                iteratorChoices = iteratorChoices.Clamp(Choices.GetCountNotNull() - 1);
            }
            else if (input.Direction.y < 0)
            {
                iteratorChoices--;
                iteratorChoices = iteratorChoices.Clamp(Choices.GetCountNotNull() - 1);
            }
            if (input.Confirm)
            {
                try {
                    Choices[iteratorChoices].Value.Call();
                }
                catch {
                    Debug.Log("iteratorChoices : " + iteratorChoices);
                    Debug.Log("Clamp : " + iteratorChoices.Clamp(Choices.GetCountNotNull() - 1));
                }
            }
            if (input.Cancel)
            {
                HideChoices();
            }

            input.Use();
        }


        //*********************************//
        // MENU PANEL MANAGEMENT
        //*********************************//
        else if (panels[MacroUIPanels.menu].activeInHierarchy)
        {
            if (input.Direction.y > 0)
            {
                iteratorMenu++;
            }
            else if (input.Direction.y < 0)
            {
                iteratorMenu--;
            }
            IteratorMenuUpdate();
            if (input.Confirm)
            {
                switch (iteratorMenu)
                {
                case 0:
                    Exit();
                    HideMenu();
                    break;

                case 1:
                    Save();
                    HideMenu();
                    break;

                case 2:
                    HideMenu();
                    Option();
                    break;

                case 3:
                    HideMenu();
                    End();
                    break;

                default:
                    break;
                }
            }

            if (input.Cancel)
            {
                HideMenu();
            }
        }
        else
        {
            if (input.Cancel)
            {
                ShowMenu();
            }
        }
    }
Пример #53
0
 public abstract void GetInput(InputParams _input);
Пример #54
0
 /// <summary>
 /// Must be call in an update unity
 /// </summary>
 /// <param name="_dt">the delta time</param>
 /// <param name="_ip">Input parametter</param>
 public abstract void UpdateFlow(float _dt, InputParams _ip);
Пример #55
0
 public void Initialization()
 {
     inputParams     = new InputParams();
     expectedResults = new SyncResults();
 }
Пример #56
0
        /// <summary>
        /// Runs a test case
        /// </summary>
        private static void TestOneCase(string[] srcDirectories, string[] srcFiles, string[] destDirectories, string[] destFiles, InputParams inputParams, SyncResults expectedResults)
        {
            // delete base directories in case they were hanging around from a previous failed test
            DeleteTestDirectory(baseDirSrc);
            DeleteTestDirectory(baseDirDest);

            // create source directories and files specified by test
            CreateTestDirectories(baseDirSrc, srcDirectories);
            CreateTestFiles(baseDirSrc, null, srcFiles);
            // create destination directories and files specified by test
            if (destDirectories != null)
            {
                CreateTestDirectories(baseDirDest, destDirectories);
            }
            if (destFiles != null)
            {
                CreateTestFiles(baseDirDest, baseDirSrc, destFiles);
            }

            // perform the directory sync
            SyncResults results = new SyncResults();

            results = new Sync(baseDirSrc, baseDirDest).Start(inputParams);

            // Assert we have expected results
            Assert.IsTrue(SyncTools.CompareTo(expectedResults, results));

            // If we are deleting extra files from destination, verify we have exactly the same files as filtered source files
            if (inputParams.DeleteFromDest &&
                (!(inputParams.DeleteExcludeFiles != null) && !(inputParams.DeleteExcludeDirs != null)))
            {
                // calc hash of filtered files & directories in source tree
                byte[] hashSrc = CalcHash(baseDirSrc, inputParams);
                // calc hash of all files & directories in destination tree
                byte[] hashDest = CalcHash(baseDirDest, null);
                // hashes must match
                bool hashesMatch = SyncTools.CompareByteArrays(hashSrc, hashDest);
                Assert.IsTrue(hashesMatch);
            }

            DeleteTestDirectory(baseDirSrc);
            DeleteTestDirectory(baseDirDest);
        }
Пример #57
0
        /// Set redis rank by member
        public MemberRankNumber POST(InputParams p)
        {
            MemberRankNumber result = new MemberRankNumber();

            // Get the sid or memberID of the current user.
            var claimsPrincipal = this.User as ClaimsPrincipal;
            p.sid = CBAuth.getMemberID(p.sid, claimsPrincipal);

            /// logging purpose
            Logging.CBLoggers logMessage = new Logging.CBLoggers();
            string jsonParam = JsonConvert.SerializeObject(p.sid);

            try
            {
                /// set redis point and return
                CBRedis.SetSortedSetRank(p.sid, p.point);
                result.rank = CBRedis.GetSortedSetRank(p.sid);
                return result;
            }

            catch (Exception ex)
            {
                // error log
                logMessage.memberID = p.sid;        // requested value. Not redis data value.
                logMessage.Level = "ERROR";
                logMessage.Logger = "CBRankController-SetMemberPoint";
                logMessage.Message = jsonParam;
                logMessage.Exception = ex.ToString();
                Logging.RunLog(logMessage);

                throw;
            }
        }
Пример #58
0
 public override void UpdateFlow(float _dt, InputParams _ip)
 {
 }
Пример #59
0
 public override void Move(InputParams _input)
 {
     this.transform.position += direction * speed * Time.deltaTime;
 }
        public string Post(InputParams p)
        {
            string result = "";

            Logging.CBLoggers logMessage = new Logging.CBLoggers();
            string jsonParam = JsonConvert.SerializeObject(p);

            try
            {
                //// 진입로그
                //logMessage.memberID = p.MemberID_Members;
                //logMessage.Level = "INFO";
                //logMessage.Logger = "CBuspInsRegMemberCheckController";
                //logMessage.Message = jsonParam;
                //Logging.RunLog(logMessage);

                using (SqlConnection connection = new SqlConnection(globalVal.DBConnectionString))
                {
                    using (SqlCommand command = new SqlCommand("CloudBread.uspInsRegMember", connection))
                    {
                        command.CommandType = CommandType.StoredProcedure;
                        command.Parameters.Add("@MemberID_Members", SqlDbType.NVarChar, -1).Value = p.MemberID_Members;
                        command.Parameters.Add("@MemberPWD_Members", SqlDbType.NVarChar, -1).Value = p.MemberPWD_Members;
                        command.Parameters.Add("@EmailAddress_Members", SqlDbType.NVarChar, -1).Value = p.EmailAddress_Members;
                        command.Parameters.Add("@EmailConfirmedYN_Members", SqlDbType.NVarChar, -1).Value = p.EmailConfirmedYN_Members;
                        command.Parameters.Add("@PhoneNumber1_Members", SqlDbType.NVarChar, -1).Value = p.PhoneNumber1_Members;
                        command.Parameters.Add("@PhoneNumber2_Members", SqlDbType.NVarChar, -1).Value = p.PhoneNumber2_Members;
                        command.Parameters.Add("@PINumber_Members", SqlDbType.NVarChar, -1).Value = p.PINumber_Members;
                        command.Parameters.Add("@Name1_Members", SqlDbType.NVarChar, -1).Value = p.Name1_Members;
                        command.Parameters.Add("@Name2_Members", SqlDbType.NVarChar, -1).Value = p.Name2_Members;
                        command.Parameters.Add("@Name3_Members", SqlDbType.NVarChar, -1).Value = p.Name3_Members;
                        command.Parameters.Add("@DOB_Members", SqlDbType.NVarChar, -1).Value = p.DOB_Members;
                        command.Parameters.Add("@RecommenderID_Members", SqlDbType.NVarChar, -1).Value = p.RecommenderID_Members;
                        command.Parameters.Add("@MemberGroup_Members", SqlDbType.NVarChar, -1).Value = p.MemberGroup_Members;
                        command.Parameters.Add("@LastDeviceID_Members", SqlDbType.NVarChar, -1).Value = p.LastDeviceID_Members;
                        command.Parameters.Add("@LastIPaddress_Members", SqlDbType.NVarChar, -1).Value = p.LastIPaddress_Members;
                        command.Parameters.Add("@LastLoginDT_Members", SqlDbType.NVarChar, -1).Value = p.LastLoginDT_Members;
                        command.Parameters.Add("@LastLogoutDT_Members", SqlDbType.NVarChar, -1).Value = p.LastLogoutDT_Members;
                        command.Parameters.Add("@LastMACAddress_Members", SqlDbType.NVarChar, -1).Value = p.LastMACAddress_Members;
                        command.Parameters.Add("@AccountBlockYN_Members", SqlDbType.NVarChar, -1).Value = p.AccountBlockYN_Members;
                        command.Parameters.Add("@AccountBlockEndDT_Members", SqlDbType.NVarChar, -1).Value = p.AccountBlockEndDT_Members;
                        command.Parameters.Add("@AnonymousYN_Members", SqlDbType.NVarChar, -1).Value = p.AnonymousYN_Members;
                        command.Parameters.Add("@3rdAuthProvider_Members", SqlDbType.NVarChar, -1).Value = p._3rdAuthProvider_Members;
                        command.Parameters.Add("@3rdAuthID_Members", SqlDbType.NVarChar, -1).Value = p._3rdAuthID_Members;
                        command.Parameters.Add("@3rdAuthParam_Members", SqlDbType.NVarChar, -1).Value = p._3rdAuthParam_Members;
                        command.Parameters.Add("@PushNotificationID_Members", SqlDbType.NVarChar, -1).Value = p.PushNotificationID_Members;
                        command.Parameters.Add("@PushNotificationProvider_Members", SqlDbType.NVarChar, -1).Value = p.PushNotificationProvider_Members;
                        command.Parameters.Add("@PushNotificationGroup_Members", SqlDbType.NVarChar, -1).Value = p.PushNotificationGroup_Members;
                        command.Parameters.Add("@sCol1_Members", SqlDbType.NVarChar, -1).Value = p.sCol1_Members;
                        command.Parameters.Add("@sCol2_Members", SqlDbType.NVarChar, -1).Value = p.sCol2_Members;
                        command.Parameters.Add("@sCol3_Members", SqlDbType.NVarChar, -1).Value = p.sCol3_Members;
                        command.Parameters.Add("@sCol4_Members", SqlDbType.NVarChar, -1).Value = p.sCol4_Members;
                        command.Parameters.Add("@sCol5_Members", SqlDbType.NVarChar, -1).Value = p.sCol5_Members;
                        command.Parameters.Add("@sCol6_Members", SqlDbType.NVarChar, -1).Value = p.sCol6_Members;
                        command.Parameters.Add("@sCol7_Members", SqlDbType.NVarChar, -1).Value = p.sCol7_Members;
                        command.Parameters.Add("@sCol8_Members", SqlDbType.NVarChar, -1).Value = p.sCol8_Members;
                        command.Parameters.Add("@sCol9_Members", SqlDbType.NVarChar, -1).Value = p.sCol9_Members;
                        command.Parameters.Add("@sCol10_Members", SqlDbType.NVarChar, -1).Value = p.sCol10_Members;
                        command.Parameters.Add("@TimeZoneID_Members", SqlDbType.NVarChar, -1).Value = p.TimeZoneID_Members;
                        command.Parameters.Add("@Level_MemberGameInfoes", SqlDbType.NVarChar, -1).Value = p.Level_MemberGameInfoes;
                        command.Parameters.Add("@Exps_MemberGameInfoes", SqlDbType.NVarChar, -1).Value = p.Exps_MemberGameInfoes;
                        command.Parameters.Add("@Points_MemberGameInfoes", SqlDbType.NVarChar, -1).Value = p.Points_MemberGameInfoes;
                        command.Parameters.Add("@UserSTAT1_MemberGameInfoes", SqlDbType.NVarChar, -1).Value = p.UserSTAT1_MemberGameInfoes;
                        command.Parameters.Add("@UserSTAT2_MemberGameInfoes", SqlDbType.NVarChar, -1).Value = p.UserSTAT2_MemberGameInfoes;
                        command.Parameters.Add("@UserSTAT3_MemberGameInfoes", SqlDbType.NVarChar, -1).Value = p.UserSTAT3_MemberGameInfoes;
                        command.Parameters.Add("@UserSTAT4_MemberGameInfoes", SqlDbType.NVarChar, -1).Value = p.UserSTAT4_MemberGameInfoes;
                        command.Parameters.Add("@UserSTAT5_MemberGameInfoes", SqlDbType.NVarChar, -1).Value = p.UserSTAT5_MemberGameInfoes;
                        command.Parameters.Add("@UserSTAT6_MemberGameInfoes", SqlDbType.NVarChar, -1).Value = p.UserSTAT6_MemberGameInfoes;
                        command.Parameters.Add("@UserSTAT7_MemberGameInfoes", SqlDbType.NVarChar, -1).Value = p.UserSTAT7_MemberGameInfoes;
                        command.Parameters.Add("@UserSTAT8_MemberGameInfoes", SqlDbType.NVarChar, -1).Value = p.UserSTAT8_MemberGameInfoes;
                        command.Parameters.Add("@UserSTAT9_MemberGameInfoes", SqlDbType.NVarChar, -1).Value = p.UserSTAT9_MemberGameInfoes;
                        command.Parameters.Add("@UserSTAT10_MemberGameInfoes", SqlDbType.NVarChar, -1).Value = p.UserSTAT10_MemberGameInfoes;
                        command.Parameters.Add("@sCol1_MemberGameInfoes", SqlDbType.NVarChar, -1).Value = p.sCol1_MemberGameInfoes;
                        command.Parameters.Add("@sCol2_MemberGameInfoes", SqlDbType.NVarChar, -1).Value = p.sCol2_MemberGameInfoes;
                        command.Parameters.Add("@sCol3_MemberGameInfoes", SqlDbType.NVarChar, -1).Value = p.sCol3_MemberGameInfoes;
                        command.Parameters.Add("@sCol4_MemberGameInfoes", SqlDbType.NVarChar, -1).Value = p.sCol4_MemberGameInfoes;
                        command.Parameters.Add("@sCol5_MemberGameInfoes", SqlDbType.NVarChar, -1).Value = p.sCol5_MemberGameInfoes;
                        command.Parameters.Add("@sCol6_MemberGameInfoes", SqlDbType.NVarChar, -1).Value = p.sCol6_MemberGameInfoes;
                        command.Parameters.Add("@sCol7_MemberGameInfoes", SqlDbType.NVarChar, -1).Value = p.sCol7_MemberGameInfoes;
                        command.Parameters.Add("@sCol8_MemberGameInfoes", SqlDbType.NVarChar, -1).Value = p.sCol8_MemberGameInfoes;
                        command.Parameters.Add("@sCol9_MemberGameInfoes", SqlDbType.NVarChar, -1).Value = p.sCol9_MemberGameInfoes;
                        command.Parameters.Add("@sCol10_MemberGameInfoes", SqlDbType.NVarChar, -1).Value = p.sCol10_MemberGameInfoes;

                        connection.Open();
                        using (SqlDataReader dreader = command.ExecuteReader())
                        {
                            while (dreader.Read())
                            {
                                result = dreader[0].ToString();
                            }
                            dreader.Close();
                        }
                        connection.Close();

                        // 완료 로그
                        logMessage.memberID = p.MemberID_Members;
                        logMessage.Level = "INFO";
                        logMessage.Logger = "CBuspInsRegMemberCheckController";
                        logMessage.Message = jsonParam;
                        Logging.RunLog(logMessage);

                        return result;
                    }

                }
            }

            catch (Exception ex)
            {
                //에러로그
                logMessage.memberID = p.MemberID_Members;
                logMessage.Level = "ERROR";
                logMessage.Logger = "CBuspInsRegMemberCheckController";
                logMessage.Message = jsonParam;
                logMessage.Exception = ex.ToString();
                Logging.RunLog(logMessage);

                throw;
            }
        }