Example #1
0
 public virtual K OnExecu <T, K>(T o, BConfig x)
     where T : ExternalReqBase
     where K : ExternalResBase
 {
     try
     {
         using (var dbContext = new DbContextContainer(DbName.HCDb)._DataAccess)
         {
             var dynamicSql = @"SELECT * 
                                  FROM AT_RegDev
                                 WHERE AuthorizeHospitalCode = '" + x.HCode + "' " +
                              "AND RegDevCode = 'Conlin'";
             var dbRegDev = dbContext.Database.Connection.QueryFirstOrDefault <Db_RegDev>(dynamicSql);
             o.ReqHeader = new ReqHeader(dbRegDev, x.BCode, x.TCode, x.OCode);
             var s = String.Empty;
             var v = _ESBClient.ReqBusiness(o.ReqHeader.ReqHospitalCode, o.ReqHeader.ReqCompanyCode, x.TKind, OnEntry(o, x).ToJson(), ref s);
             return(OnExits(s, x).ToEntity <K>());
         }
     }
     catch (Exception ex)
     {
         LogModule.Info("执行ESB请求异常:", ex);
         throw ex;
     }
 }
    protected override void LoadEffect(Tab_Effect effectData, PlayEffectDelegate delPlayEffect, object param)
    {
        if (effectData == null)
        {
            return;
        }
        if (m_effectBindPointCache == null)
        {
            return;
        }

        GameObject effectParentObj = null;

        if (m_effectBindPointCache.ContainsKey(effectData.ParentName) && m_effectBindPointCache[effectData.ParentName] != null)
        {
            effectParentObj = m_effectBindPointCache[effectData.ParentName];
        }
        if (effectParentObj != null)
        {
            AddEffect(effectParentObj, effectData, delPlayEffect, param);
        }
        else
        {
            if (m_BaseEffectBindPoint != null)
            {
                AddEffect(m_BaseEffectBindPoint.gameObject, effectData, delPlayEffect, param);
            }
            else
            {
                LogModule.ErrorLog("find bind point failed!, id {0} bindPoint {1}", effectData.EffectID, effectData.ParentName);
            }
        }
    }
Example #3
0
    bool ProcessInput()
    {
        if (m_SocketInputStream == null)
        {
            return(false);
        }
        if (m_Socket.IsCanReceive() == false)
        {
            return(true);
        }

        uint nSizeBefore = m_SocketInputStream.Length();
        uint ret         = m_SocketInputStream.Fill();
        uint nSizeAfter  = m_SocketInputStream.Length();

        if (ret == SOCKET_ERROR)
        {
            LogModule.WarningLog("send packet fail");
            m_Socket.close();
            ConnectLost();
            return(false);
        }

        //收包统计
        if (nSizeAfter > nSizeBefore)
        {
            if (NetWorkLogic.s_nReceiveCount < 0)
            {
                NetWorkLogic.s_nReceiveCount = 0;
            }
            NetWorkLogic.s_nReceiveCount += (int)(nSizeAfter - nSizeBefore);
        }
        return(true);
    }
Example #4
0
    public void OnTabTableau(TabButton button)
    {
        if (null == button)
        {
            LogModule.ErrorLog("OnTabTableau::button is null");
            return;
        }

        else if (button.name == m_TabWindows[(int)Tab_Index.Tab_HongBao].name)
        {
            if (GameManager.gameManager.PlayerDataPool.IsShowHongBaoTip == true)
            {
                GameManager.gameManager.PlayerDataPool.IsShowHongBaoTip = false;
                UpdateHongBaoTip();
            }
        }
        else if (button.name == m_TabWindows[(int)Tab_Index.Tab_Lover_Flower].name)
        {
            if (GameManager.gameManager.PlayerDataPool.IsShowLoverFlowerTip == true)
            {
                GameManager.gameManager.PlayerDataPool.IsShowLoverFlowerTip = false;
                UpdateLoverFlowerTip();
            }
        }
        else if (button.name == m_TabWindows[(int)Tab_Index.Tab_Lover_Thing].name)
        {
            if (GameManager.gameManager.PlayerDataPool.IsShowLoverThingTip == true)
            {
                GameManager.gameManager.PlayerDataPool.IsShowLoverThingTip = false;
                UpdateLoverThingTip();
            }
        }
    }
Example #5
0
    private void LoadCharmItem()
    {
        if (null == m_DynamicItemGrid)
        {
            LogModule.ErrorLog("m_DynamicItemGrid id null");
            return;
        }
        if (null == m_prefItem)
        {
            LogModule.ErrorLog("tabCharItem is null");
            return;
        }
        Utils.CleanGrid(m_DynamicItemGrid.gameObject);
        int  nIndex      = 0;
        bool bCanAddItem = false;

        foreach (KeyValuePair <int, List <Tab_CharmItem> > pair in TableManager.GetCharmItem())
        {
            Tab_CharmItem tabCharItem = pair.Value[0];
            if (tabCharItem == null)
            {
                continue;
            }
            bCanAddItem = false;
            if (m_Type == ShowType.ALL)
            {
                bCanAddItem = true;
            }
            else if (m_Type == ShowType.FLOWER)
            {
                if (tabCharItem.Type == (int)ShowType.FLOWER)
                {
                    bCanAddItem = true;
                }
            }
            else if (m_Type == ShowType.EGG)
            {
                if (tabCharItem.Type == (int)ShowType.EGG)
                {
                    bCanAddItem = true;
                }
            }
            if (!bCanAddItem)
            {
                continue;
            }
            FlowerEggItemSlot oItem = FlowerEggItemSlot.CreateItem(m_DynamicItemGrid.gameObject, m_prefItem, nIndex.ToString(), this);
            if (oItem != null)
            {
                oItem.SetData(tabCharItem);
                if (m_CurSelect == null)
                {
                    SelectItem(oItem);
                }
            }
            nIndex++;
        }
        m_nItemNum       = 1;
        m_NumInput.value = m_nItemNum.ToString();
    }
Example #6
0
    void OnSceneMapClick()
    {
        Vector3 worldPos = UICamera.currentCamera.ScreenToWorldPoint(UICamera.lastTouchPosition);
        Vector3 localPos = m_TextureMap.transform.InverseTransformPoint(worldPos);
        Vector3 mapPos   = MapPosToScenePos(localPos, m_curTabScene);

        AutoSearchPoint point = new AutoSearchPoint(m_curSceneID, mapPos.x, mapPos.z);

        if (GameManager.gameManager && GameManager.gameManager.AutoSearch)
        {
            if (Singleton <ObjManager> .GetInstance().MainPlayer)
            {
                //验证导航是否可达,如果不可达,不进行移动
                Vector3 testVec = new Vector3(point.PosX, 0, point.PosZ);
                testVec = ActiveScene.GetTerrainPosition(testVec);
                if (!Singleton <ObjManager> .GetInstance().MainPlayer.IsMoveNavAgent(testVec))
                {
                    return;
                }
            }

            GameManager.gameManager.AutoSearch.ProcessAutoSearch(point);
        }

        if (m_ClickEffectSprite != null && m_ClickEffectTran != null)
        {
            m_ClickEffectTran.localPosition = localPos;
            m_ClickEffectSprite.gameObject.SetActive(true);
        }
        else
        {
            LogModule.ErrorLog("OnSceneMapClick::m_ClickEffectSprite = null || m_ClickEffectTran = null");
        }
    }
        void SetCommonData(int nIndex, int nValue)
        {
            if (nIndex < 0 || nIndex >= MAX_CHAR_COMMON_DATA_NUM)
            {
                LogModule.DebugLog("SetCommonData: Index out of Range!!!");
                return;
            }
            int nData = m_CommonData[nIndex];

            m_CommonData[nIndex] = nValue;

            // 特殊添加 其他 更改 加在 OnCommonDataChange()中
            if (nIndex == (int)Games.UserCommonData.USER_COMMONDATA.CD_COPYSCENE_CANGJINGGE_SWEEP)
            {
                if (ActivityController.Instance() != null)
                {
                    ActivityController.Instance().UpdateTabTips();
                }
                if (FunctionButtonLogic.Instance())
                {
                    FunctionButtonLogic.Instance().UpdateActionButtonTip();
                }
                if (CangJingGeWindow.Instance() != null)
                {
                    CangJingGeWindow.Instance().UpdateInfo();
                    if (nData < nValue)//开始扫荡
                    {
                        CangJingGeWindow.Instance().StartSweep();
                    }
                }
            }
            // 更新 操作
            OnCommonDataChange(nIndex, nValue);
        }
    void OnClickChangeChannel()
    {
        if (null == InputChannel)
        {
            LogModule.ErrorLog("InputChannel  can't find ");
            return;
        }
        if (string.IsNullOrEmpty(InputChannel.value))
        {
            //MessageBoxLogic.OpenOKBox(1288, 1000);
            MessageBoxLogic.OpenOKBox(2174, 1000);
            return;
        }
        int nChannelID = -1;

        if (!int.TryParse(InputChannel.value, out nChannelID))
        {
            MessageBoxLogic.OpenOKBox(2174, 1000);
            return;
        }
        nChannelID = nChannelID - 1;
        if (nChannelID >= 0 && nChannelID != SceneData.SceneInst && SceneData.SceneInstList.Contains(nChannelID))
        {
            CG_SCENE_CHANGEINST packet = (CG_SCENE_CHANGEINST)PacketDistributed.CreatePacket(MessageID.PACKET_CG_SCENE_CHANGEINST);
            packet.SetSceneInst(nChannelID);
            packet.SendPacket();
            UIManager.CloseUI(UIInfo.ChannelChange);
        }
        else
        {
            MessageBoxLogic.OpenOKBox(2174, 1000);
        }
    }
Example #9
0
    public void SetCombatValue()
    {
        if (BelleInfoWindow.Instance() != null)
        {
            Tab_Belle belleTab = BelleInfoWindow.Instance().CurSellectedBelleData;

            if (null == belleTab)
            {
                LogModule.ErrorLog("BelleInfoWindow.Instance().CurSellectedBelleData is null!");
                return;
            }

            Belle curBelleData = null;
            if (BelleData.OwnedBelleMap.ContainsKey(belleTab.Id))
            {
                curBelleData = BelleData.OwnedBelleMap[belleTab.Id];
            }

            if (null == curBelleData)
            {
                return;
            }
            curBelleData.UpdateAttrMap();
            m_battleValue.text = BelleData.GetPowerNum(curBelleData.attrMap).ToString();
        }
    }
Example #10
0
    public void updateBelleColor()
    {
        if (BelleInfoWindow.Instance() != null)
        {
            Tab_Belle belleTab = BelleInfoWindow.Instance().CurSellectedBelleData;

            if (null == belleTab)
            {
                LogModule.ErrorLog("BelleInfoWindow.Instance().CurSellectedBelleData is null!");
                return;
            }

            Belle curBelleData = null;
            if (BelleData.OwnedBelleMap.ContainsKey(belleTab.Id))
            {
                curBelleData = BelleData.OwnedBelleMap[belleTab.Id];
            }

            if (null == curBelleData)
            {
                return;
            }
            //品阶
            m_curBelleMainColor.text          = BelleData.GetBelleDescByColorLevel(curBelleData.colorLevel);
            m_curBelleMainColorPic.spriteName = BelleData.GetBelleColorPicByColorLevel(curBelleData.colorLevel);
            m_curBelleSubColor.text           = StrDictionary.GetClientDictionaryString("#{10811}", curBelleData.subLevel);
            m_curBelleMainColor.color         = BelleData.GetBelleColorByColorLevel(curBelleData.colorLevel);
            m_curBelleSubColor.color          = BelleData.GetBelleColorByColorLevel(curBelleData.colorLevel);

            m_belleName.color = BelleData.GetBelleColorByColorLevel(curBelleData.colorLevel);
        }
    }
Example #11
0
    /// <summary>
    /// 亲密进度条更新
    /// </summary>
    public void UpdateCloseProcessBar()
    {
        if (BelleInfoWindow.Instance() != null)
        {
            Tab_Belle belleTab = BelleInfoWindow.Instance().CurSellectedBelleData;

            if (null == belleTab)
            {
                LogModule.ErrorLog("BelleInfoWindow.Instance().CurSellectedBelleData is null!");
                return;
            }

            Belle curBelleData = null;
            if (BelleData.OwnedBelleMap.ContainsKey(belleTab.Id))
            {
                ;
            }
            {
                curBelleData = BelleData.OwnedBelleMap[belleTab.Id];
            }
            //亲密等级
            m_curCloseLevel.text    = curBelleData.closeLevel.ToString();
            m_nextAddAttrValue.text = Utils.GetAttrTypeString(belleTab.CloseAddAttrType) + curBelleData.nextCloseAttrValue.ToString();
            m_curFavorValue.text    = curBelleData.favourValue.ToString() + "/" + curBelleData.maxFavourValue.ToString();

            m_processBar.fillAmount = curBelleData.maxFavourValue == 0 ? 0f : curBelleData.favourValue * 1.0f / curBelleData.maxFavourValue;
        }
    }
Example #12
0
    // 立即前往
    void ButtonGo()
    {
        Tab_MissionDictionary DicTab = TableManager.GetMissionDictionaryByID(GlobeVar.PAOSHANG_MISSIONID_H, 0);

        if (DicTab == null)
        {
            LogModule.ErrorLog("Can not find missionDictionary {0}", GlobeVar.PAOSHANG_MISSIONID_H);
            return;
        }

        // 自动寻路
        AutoSearchPoint point = new AutoSearchPoint(DicTab.AccepteNpcSceneID, DicTab.AccepteNpcPosX, DicTab.AccepteNpcPosZ);

        if (GameManager.gameManager && GameManager.gameManager.AutoSearch)
        {
            string           sAutoSearchTargetName = string.Empty;
            Tab_RoleBaseAttr RoleBase = TableManager.GetRoleBaseAttrByID(DicTab.AcceptNpcDataID, 0);
            if (null != RoleBase)
            {
                sAutoSearchTargetName = RoleBase.Name;
            }
            else
            {
                LogModule.ErrorLog("Can not find roleBaseAttr {0}", DicTab.AcceptNpcDataID);
            }
            GameManager.gameManager.AutoSearch.ProcessAutoSearch(point, sAutoSearchTargetName, false);
        }
    }
        public uint Execute(PacketDistributed ipacket)
        {
            GC_LOGIN_RET packet = (GC_LOGIN_RET)ipacket;

            if (null == packet)
            {
                return((uint)PACKET_EXE.PACKET_EXE_ERROR);
            }
            //enter your logic

            UnityEngine.Debug.Log("packet.Result : " + packet.Result);
            switch (packet.Result)
            {
            case 1:
                SetProxy(packet);
                EventManager.GetInstance().SendEvent(EventId.PlayerProxyUpdate, null);
                break;

            case 3:
                LogModule.ErrorLog("壮哥,3了!");
                break;

            case 8:
                CG_CREATEROLE p       = (CG_CREATEROLE)PacketDistributed.CreatePacket(MessageID.PACKET_CG_CREATEROLE);
                Random        ran     = new Random();
                int           RandKey = ran.Next(1, 999);
                p.SetName("TestRole" + RandKey);
                p.SetGender(0);
                p.SendPacket();
                break;
            }

            return((uint)PACKET_EXE.PACKET_EXE_CONTINUE);
        }
Example #14
0
        public void OnException(ExceptionContext filterContext)
        {
            var  httpContext = filterContext.HttpContext;//"为所欲为"
            bool result      = false;

            var xreq = httpContext.Request.Headers.ContainsKey("x-requested-with");

            if (xreq)
            {
                result = httpContext.Request.Headers["x-requested-with"] == "XMLHttpRequest";
            }

            if (!filterContext.ExceptionHandled)
            {
                LogModule.LogError(this.GetLogStr(filterContext.HttpContext, filterContext.Exception));
                HttpResponse response = filterContext.HttpContext.Response;
                response.ContentType = "application/json";
                response.StatusCode  = -1;
                response.WriteAsync(new
                {
                    Result       = 0,
                    DebugMessage = filterContext.Exception.Message,
                    RetValue     = "",
                    PromptMsg    = "发生错误,请联系管理员"
                }.ToJson());
                filterContext.ExceptionHandled = true;//已经被我处理了
            }
        }
        void SetCommonFlag(int nBits, bool bFlag)
        {
            if (nBits < 0 || nBits >= MAX_CHAR_COMMON_FLAG_NUM * 8 * sizeof(int))
            {
                LogModule.DebugLog("SetCommonFlag: Index out of Range!!!");
                return;
            }

            int nIndex = nBits / (sizeof(int) * 8);

            if (nIndex >= 0 && nIndex < MAX_CHAR_COMMON_FLAG_NUM)
            {
                //int nOldBits = nBits;
                nBits = nBits % (sizeof(int) * 8);// 0-31
                if (nBits >= 0 && nBits <= 31)
                {
                    int nDataValue = m_CommonFlag[nIndex];
                    if (bFlag != false)
                    {
                        nDataValue |= (1 << nBits);
                    }
                    else
                    {
                        nDataValue &= ~(1 << nBits);
                    }

                    m_CommonFlag[nIndex] = nDataValue;
                }

                // 更新后操作
                OnCommonFlagChange(nBits);
            }
        }
Example #16
0
    // 开启帮会任务
    void OpenGuildMission()
    {
        // 没有帮会
        PlayerData MyPlayerData = GameManager.gameManager.PlayerDataPool;

        if (MyPlayerData == null)
        {
            return;
        }
        if (MyPlayerData.GuildInfo == null)
        {
            return;
        }
        if (false == MyPlayerData.IsHaveGuild())
        {
            return;
        }

        if (false == MyPlayerData.IsGuildChief())
        {
            return;
        }

        Tab_GuildMissionGuild guildMisGuild = TableManager.GetGuildMissionGuildByID(MyPlayerData.GuildInfo.GuildLevel, 0);

        if (guildMisGuild == null)
        {
            LogModule.ErrorLog("Can not find guidMissionGuid {0}", MyPlayerData.GuildInfo.GuildLevel);
            return;
        }

        string str = StrDictionary.GetClientDictionaryString("#{5432}", guildMisGuild.ConsumeWealth, guildMisGuild.CanAcceptTimesOnce);

        MessageBoxLogic.OpenOKCancelBox(str, null, OnOpenGuildMisMessageOK, OnCancelClick);
    }
    public void SwitchToScene(SceneId sceneId, object param = null)
    {
        if (sceneId == CurrentSceneId)
        {
            LogModule.WarningLog("switch to current scene: " + sceneId);
        }
        LogModule.DebugLog("SceneMgr  SwitchToScene  sceneId:" + sceneId.ToString() + "  " + System.DateTime.Now.ToString());
        mParam = param;

        if (mCurScene != null)
        {
            mCurScene.OnWillExit();
            //App.EventMgr.Post(EventId.SceneWillExit, mCurScene.Id);
        }

        if (mSceneTypeDict.ContainsKey(sceneId))
        {
            mNextScene = Activator.CreateInstance(mSceneTypeDict[sceneId]) as SceneBase;
            if (mNextScene != null)
            {
                mNextScene.OnWillEnter(param);
            }
        }

        if (hdlSceneWillSwitch != null)
        {
            hdlSceneWillSwitch.Invoke(mCurrentSceneId, sceneId, param);
        }

        SceneManager.LoadScene(sceneId.ToString());
    }
Example #18
0
    // 创建坐骑
    public void InitMount(Obj_OtherPlayer PlayerObj, int nMountID)
    {
        if (PlayerObj == null)
        {
            return;
        }

        Tab_MountBase MountBase = TableManager.GetMountBaseByID(nMountID, 0);

        if (null == MountBase)
        {
            LogModule.DebugLog("MountBase.txt has not Line ID=" + nMountID);
            return;
        }
        Tab_CharMount MountTable = TableManager.GetCharMountByID(MountBase.ModelID, 0);

        if (MountTable == null)
        {
            LogModule.DebugLog("CharMount.txt has not Line ID=" + MountBase.ModelID);
            return;
        }
        GameObject Obj = PlayerObj.gameObject;

        if (Obj == null)
        {
            return;
        }

        //PlayerObj.MountID = nMountID;
        m_PlayerObj = PlayerObj;

        Singleton <ObjManager> .GetInstance().ReloadModel(Obj, MountTable.MountModel, Obj_Mount.OnAsycLoadMount, PlayerObj, MountTable.BindPoint);
    }
 // Use this for initialization
 void OnEnable()
 {
     LogModule.ErrorLog("starting " + name);
     m_panel       = GetComponent <UIDraggablePanel>();
     m_uiConnector = Engine.JoyUI.JoyUIConnector.Instance;
     //Refresh();
 }
Example #20
0
    /// <summary>
    /// 检查是否可以在密聊频道发送消息
    /// </summary>
    bool CheckIsCanSendTell()
    {
        //密聊频道检测一下当前是否有密聊对象
        if (CurChannelType != ChatInfoLogic.CHANNEL_TYPE.CHAT_TYPE_TELL)
        {
            return(true);
        }
        UInt64 tellGuid = GameManager.gameManager.PlayerDataPool.LastTellGUID;
        String tellName = GameManager.gameManager.PlayerDataPool.LastTellName;

        if (tellGuid == GlobeVar.INVALID_GUID || tellName == "")
        {
            Obj_MainPlayer _mainPlayer = Singleton <ObjManager> .GetInstance().MainPlayer;

            if (_mainPlayer == null)
            {
                LogModule.DebugLog("_mainPlayer is Null");
                return(false);
            }

            _mainPlayer.SendNoticMsg(false, "#{11166}");
            return(false);
        }

        return(true);
    }
Example #21
0
        /// <summary>
        /// 刷脸识别
        /// </summary>
        /// <param name="reqData"></param>
        /// <returns></returns>
        public XAIResFind Find(XAIReqFind reqData)
        {
            LogModule.Info("XAI->BIDU:Find--->入参:" + reqData.ToJson());
            string resJson;

            try
            {
                resJson = client.Search(reqData.Image.Split(new string[] { ";base64," }, StringSplitOptions.RemoveEmptyEntries)[1], "BASE64", reqData.GroupId).ToJson();
            }
            catch (Exception ex)
            {
                throw new XAIException(7100, "请求人脸识别服务异常,请重试!" + ex.Message);
            }
            LogModule.Info("XAI->BIDU:Find--->出参:" + resJson);
            var res = resJson.ToEntity <BIDUResponse>();

            if (res.error_code != 0)
            {
                throw new XAIException(7100, typeof(BIDUErrorCodeEnum).GetEnumName(res.error_code.ToInt()));
            }
            res.result.user_list = res.result.user_list.Where(w => w.score > 80).OrderByDescending(o => o.score).ToList();
            if (res.result.user_list.Count() == 0)
            {
                throw new XAIException(7101, "未识别出有效用户");
            }
            return(new XAIResFind()
            {
                UserId = res.result.user_list.OrderByDescending(w => w.score).First().user_id
            });
        }
Example #22
0
    void WaitPacket()
    {
        try
        {
            if (!m_Socket.IsValid)
            {
                return;
            }
            if (!m_Socket.IsConnected
#if UNITY_WP8
                && !m_Socket.ForceReconnect
#endif
                )
            {
                return;
            }
            if (!ProcessInput())
            {
                return;
            }
            if (!ProcessOutput())
            {
                return;
            }

            ProcessPacket();
        }
        catch (System.Exception ex)
        {
            LogModule.ErrorLog(ex.Message);
        }
    }
Example #23
0
        /// <summary>
        /// 刷脸新增
        /// </summary>
        /// <param name="reqData"></param>
        /// <returns></returns>
        public XAIResFAdd FAdd(XAIReqFAdd reqData)
        {
            LogModule.Info("XAI->BIDU:FAdd--->入参:" + reqData.ToJson());
            var options = new Dictionary <string, object>()
            {
                { "user_info", reqData.UserInfo.ToJson() }
            };
            string resJson;

            try
            {
                resJson = client.UserAdd(reqData.Image.Split(new string[] { ";base64," }, StringSplitOptions.RemoveEmptyEntries)[1], "BASE64", reqData.GroupId, reqData.UserId, options).ToJson();
            }
            catch (Exception ex)
            {
                throw new XAIException(7100, "请求人脸识别服务异常,请重试!" + ex.Message);
            }
            LogModule.Info("XAI->BIDU:FAdd--->出参:" + resJson);
            var res = resJson.ToEntity <BIDUResponse>();

            if (res.error_code != 0)
            {
                throw new XAIException(7100, typeof(BIDUErrorCodeEnum).GetEnumName(res.error_code.ToInt()));
            }
            return(new XAIResFAdd()
            {
                AuthId = res.log_id,
                FaceToken = res.result.face_token,
                LocationLeft = res.result.location.left.ToString(),
                LocationTop = res.result.location.top.ToString(),
                LocationWidth = res.result.location.width.ToString(),
                LocationHeight = res.result.location.height.ToString(),
                LocationRotaion = res.result.location.rotation.ToString()
            });
        }
Example #24
0
    //////////////////////////////////////////////////////////////////////////
    #region Thread For Connect

    public void ConnectThread()
    {
        m_connectStatus = ConnectStatus.CONNECTING;
        while (true)
        {
            m_Socket.close();

            Console.WriteLine("connect:" + m_strServerAddr);
            m_strConnectResult = m_Socket.connect(m_strServerAddr, m_nServerPort);
            if (m_strConnectResult.Length == 0 && m_Socket.IsValid)
            {
                m_SocketInputStream  = new SocketInputStream(m_Socket);
                m_SocketOutputStream = new SocketOutputStream(m_Socket);
                m_connectStatus      = ConnectStatus.CONNECTED;
                break;
            }
            else
            {
                LogModule.WarningLog(m_strConnectResult);
            }
            m_Socket.close();

            Thread.Sleep(m_nConnectSleep);
            m_connectStatus = ConnectStatus.DISCONNECTED;
            break;
        }

        m_bConnectFinish = true;
    }
Example #25
0
        /// <summary>
        /// 用户查询
        /// </summary>
        /// <param name="reqData"></param>
        /// <returns></returns>
        public XAIResFGet FGet(XAIReqFGet reqData)
        {
            LogModule.Info("XAI->BIDU:FGet--->入参:" + reqData.ToJson());
            string resJson;

            try
            {
                resJson = client.UserGet(reqData.UserId, reqData.GroupId).ToJson();
            }
            catch (Exception ex)
            {
                throw new XAIException(7100, "请求人脸识别服务异常,请重试!" + ex.Message);
            }
            LogModule.Info("XAI->BIDU:FGet--->出参:" + resJson);
            var res = resJson.ToEntity <BIDUResponse>();

            if (res.error_code != 0)
            {
                throw new XAIException(7100, typeof(BIDUErrorCodeEnum).GetEnumName(res.error_code.ToInt()));
            }
            return(new XAIResFGet()
            {
                UserInfo = res.result.user_list.FirstOrDefault()?.user_info.ToEntity <BCL.ToolLibWithApp.XAI.Entity.UserInfo>()
            });
        }
Example #26
0
 public virtual T OnEntry <T>(T o, BConfig x) where T : class
 {
     LogModule.Info("执行ESB请求开始:------------------------------------------------------------------------------------------");
     LogModule.Info("执行ESB请求交易:" + x.TKind);
     LogModule.Info("执行ESB请求入参:" + o.ToJson());
     return(o);
 }
Example #27
0
        /// <summary>
        /// 获取用户列表
        /// </summary>
        /// <param name="reqData"></param>
        /// <returns></returns>
        public XAIResGetUserList GetUserList(XAIReqGetUserList reqData)
        {
            LogModule.Info("XAI->BIDU:GetUserList--->入参:" + reqData.ToJson());
            string resJson;

            try
            {
                resJson = client.GroupGetusers(reqData.GroupId).ToJson();
            }
            catch (Exception ex)
            {
                throw new XAIException(7100, "请求人脸识别服务异常,请重试!" + ex.Message);
            }
            LogModule.Info("XAI->BIDU:GetUserList--->出参:" + resJson);
            var res = resJson.ToEntity <BIDUResponse>();

            if (res.error_code != 0)
            {
                throw new XAIException(7100, typeof(BIDUErrorCodeEnum).GetEnumName(res.error_code.ToInt()));
            }
            return(new XAIResGetUserList()
            {
                UserIdList = res.result.user_id_list
            });
        }
    public void OnItemClick()
    {
        Tab_RestaurantFood curFood = TableManager.GetRestaurantFoodByID(m_foodID, 0);

        if (null == curFood)
        {
            LogModule.ErrorLog("OnItemClick::curTabData is null");
            return;
        }
        if (null == RestaurantData.m_PlayerRestaurantInfo)
        {
            LogModule.ErrorLog("OnItemClick::RestaurantData.m_PlayerRestaurantInfo is null");
            return;
        }
        if (null == m_parentWindow)
        {
            LogModule.ErrorLog("OnItemClick::m_parentWindow is null");
            return;
        }
        if (curFood.OpenLevel > RestaurantData.m_PlayerRestaurantInfo.m_RestaurantLevel)
        {
            return;
        }
        m_parentWindow.OnFoodItemClick(this);
        if (RestaurantController.Instance().NewPlayerGuide_Step == 1 && m_foodID == 0)
        {
            RestaurantController.Instance().NewPlayerGuide(2);
        }
    }
Example #29
0
    void LateUpdate()
    {
        if (IsMoving)
        {
            var ratio = (Time.realtimeSinceStartup - MoveStartTime) / Duration;
            if (ratio > 1)
            {
                IsMoving = false;

                if (SingleMoveEndAction != null)
                {
                    var tempAction = SingleMoveEndAction;
                    SingleMoveEndAction = null;
                    tempAction();
                }
            }
            else if (ratio < 0)
            {
                LogModule.ErrorLog("March Move Error, ratio:{0}", ratio);
                IsMoving = false;
            }
            else
            {
                transform.position = Vector3.Lerp(MoveStartPos, MoveEndPos, (Time.realtimeSinceStartup - MoveStartTime) / Duration);
            }
        }
    }
Example #30
0
    private IEnumerator RequestNotice()
    {
        WWW wwwNotice = new WWW("http://ydcabal.changyou.com/cabal3D/conf/notice/login/Notice_AppStore.txt");

        yield return(wwwNotice);

        if (!string.IsNullOrEmpty(wwwNotice.error))
        {
            LogModule.ErrorLog("request login notice error" + wwwNotice.error);
        }
        else
        {
            LogModule.DebugLog(wwwNotice.text);
            m_text = wwwNotice.text;
            BoxCollider curCollider = labelText.gameObject.GetComponent <BoxCollider>();
            if (null == curCollider)
            {
                LogModule.ErrorLog("label not contain collider");
                yield break;
            }



            m_bReceiveData = true;
            m_bRequesting  = false;
            DoShowNotice();
        }
    }
Example #31
0
 /// <summary>
 /// Writes out a formatted string, using the same semantics as String ..::.Format . 
 /// </summary>
 /// <param name="module">The owner module.</param>
 /// <param name="level">Log level.</param>
 /// <param name="format">The formatting string.</param>
 /// <param name="parameters">The object array to write into the formatted string.</param>
 public static void Write(LogModule module, LogLevel level, string format, params object[] parameters)
 {
     if (RvLogger.IsPrintable(level))
         try
         {
             RvLogger.Write(module, level, String.Format(format, parameters));
         }
         catch (Exception ex)
         {
             RvLogger.Write(module, level, ex.Message);
         }
 }
Example #32
0
        /// <summary>
        /// Writes a string to the log.
        /// </summary>
        /// <param name="module">The owner module.</param>
        /// <param name="level">Log level.</param>
        /// <param name="text">The string to write.</param>
        private static void Write(LogModule module, LogLevel level, string text)
        {
            lock (RvLogger.theLock)
            {
                if (RvLogger._Writer != null && RvLogger.IsPrintable(level))
                {
                    using (StringReader reader = new StringReader(text))
                    {
                        string line;
                        while ((line = reader.ReadLine()) != null)
                            RvLogger._Writer.WriteLine("{0} | {1,9} | {2,11} | {3}", DateTime.Now.ToString("dd/MM/yyyy HH:mm:ss.ff"), level.ToString(), module.ToString(), line);
                    }

                    RvLogger._Writer.Flush();
                }
            }
        }