Exemple #1
0
        public DataTable GetGettyevents_toupdatecount()
        {
            DataTable      objDT    = new DataTable();
            SqlConnection  _newconn = new SqlConnection(GetnetworkID(NetworkId.ToString()));
            SqlDataAdapter _sdlda;
            DataSet        _ds = new DataSet();
            int            cnt = 0;

            try
            {
                SqlCommand _spcommand = new SqlCommand("AK_SP_GettyEvents_to_updateimagecount", _newconn);
                _spcommand.CommandType = CommandType.StoredProcedure;
                _newconn.Open();
                _sdlda = new SqlDataAdapter(_spcommand);
                _sdlda.Fill(objDT);
                _newconn.Close();
            }
            catch (Exception ex)
            {
                if (_newconn.State == ConnectionState.Open)
                {
                    _newconn.Close();
                }
                CommonLib.ExceptionHandler.WriteLog(CommonLib.Sections.Client, "Gettyimages-addimages-Addnewsimages-", ex);
            }

            return(objDT);
        }
Exemple #2
0
        public bool Update_GettyEvents_imagecount(int imagecount, int ID)
        {
            DataTable     objDT    = new DataTable();
            SqlConnection _newconn = new SqlConnection(GetnetworkID(NetworkId.ToString()));

            try
            {
                SqlCommand _spcommand = new SqlCommand("AK_SP_UpdategettyEventsimagecount", _newconn);
                _spcommand.CommandType = CommandType.StoredProcedure;
                _spcommand.Parameters.Add("@eventId", SqlDbType.Int).Value    = ID;
                _spcommand.Parameters.Add("@imagecount", SqlDbType.Int).Value = imagecount;
                _newconn.Open();
                _spcommand.ExecuteNonQuery();
                _newconn.Close();
            }
            catch (Exception ex)
            {
                if (_newconn.State == ConnectionState.Open)
                {
                    _newconn.Close();
                }
                CommonLib.ExceptionHandler.WriteLog(CommonLib.Sections.Client, "Gettyimages-addimages-Addnewsimages-", ex);
            }
            return(true);
        }
Exemple #3
0
        public bool AddexternalimagesURL()
        {
            DataTable     objDT    = new DataTable();
            SqlConnection _newconn = new SqlConnection(GetnetworkID(NetworkId.ToString()));
            int           cnt      = 0;

            try
            {
                SqlCommand _spcommand = new SqlCommand("AK_SP_Addexternalimagepostfromgetty", _newconn);
                _spcommand.CommandType = CommandType.StoredProcedure;
                _spcommand.Parameters.Add("@SiteID", SqlDbType.Int).Value       = this.SiteID;
                _spcommand.Parameters.Add("@randomId", SqlDbType.VarChar).Value = !string.IsNullOrEmpty(RandomId) ? RandomId : "00";
                _spcommand.Parameters.Add("@exturl", SqlDbType.VarChar).Value   = !string.IsNullOrEmpty(exturl) ? exturl : " ";
                _spcommand.Parameters.Add("@title", SqlDbType.VarChar).Value    = !string.IsNullOrEmpty(imagetxt) ? imagetxt : " ";
                _spcommand.Parameters.Add("@desc", SqlDbType.VarChar).Value     = !string.IsNullOrEmpty(imagetxtbelow) ? imagetxtbelow : " ";
                _spcommand.Parameters.Add("@credit", SqlDbType.VarChar).Value   = !string.IsNullOrEmpty(imagecredit) ? imagecredit : " ";
                _newconn.Open();
                _spcommand.ExecuteNonQuery();
                _newconn.Close();
            }
            catch (Exception ex)
            {
                if (_newconn.State == ConnectionState.Open)
                {
                    _newconn.Close();
                }
                CommonLib.ExceptionHandler.WriteLog(CommonLib.Sections.Client, "Gettyimages-addimages-Addnewsimages-", ex);
            }

            return(true);
        }
Exemple #4
0
        public bool AddGettyEvents()
        {
            DataTable     objDT    = new DataTable();
            SqlConnection _newconn = new SqlConnection(GetnetworkID(NetworkId.ToString()));
            int           cnt      = 0;

            try
            {
                SqlCommand _spcommand = new SqlCommand("AK_SP_AddGettyEvent", _newconn);
                _spcommand.CommandType = CommandType.StoredProcedure;
                _spcommand.Parameters.Add("@eventId", SqlDbType.VarChar).Value      = EventId;
                _spcommand.Parameters.Add("@imageurl", SqlDbType.VarChar).Value     = !string.IsNullOrEmpty(eventImageURL) ? eventImageURL : "";
                _spcommand.Parameters.Add("@title", SqlDbType.VarChar).Value        = !string.IsNullOrEmpty(EventTitle) ? EventTitle : "";
                _spcommand.Parameters.Add("@eventdate", SqlDbType.VarChar).Value    = !string.IsNullOrEmpty(EventDate) ? EventDate : "";
                _spcommand.Parameters.Add("@imagecount", SqlDbType.VarChar).Value   = ImageCount;
                _spcommand.Parameters.Add("@imagecaption", SqlDbType.VarChar).Value = !string.IsNullOrEmpty(imagetxtbelow) ? imagetxtbelow : "";
                _newconn.Open();
                _spcommand.ExecuteNonQuery();
                _newconn.Close();
            }
            catch (Exception ex)
            {
                if (_newconn.State == ConnectionState.Open)
                {
                    _newconn.Close();
                }
                CommonLib.ExceptionHandler.WriteLog(CommonLib.Sections.Client, "Gettyimages-addimages-Addnewsimages-", ex);
            }

            return(true);
        }
Exemple #5
0
        public bool AddCategoryimages()
        {
            DataTable     objDT    = new DataTable();
            SqlConnection _newconn = new SqlConnection(GetnetworkID(NetworkId.ToString()));
            int           cnt      = 0;

            try
            {
                SqlCommand _spcommand = new SqlCommand("AK_SP_AddCategoryimagesForslideshow", _newconn);
                _spcommand.CommandType = CommandType.StoredProcedure;
                _spcommand.Parameters.Add("@networkid", SqlDbType.Int).Value         = NetworkId;
                _spcommand.Parameters.Add("@catsId", SqlDbType.Int).Value            = CatID;
                _spcommand.Parameters.Add("@SiteID", SqlDbType.Int).Value            = this.SiteID;
                _spcommand.Parameters.Add("@imagename", SqlDbType.VarChar).Value     = !string.IsNullOrEmpty(imagename) ? imagename : " ";
                _spcommand.Parameters.Add("@imagetxt", SqlDbType.VarChar).Value      = !string.IsNullOrEmpty(imagetxt) ? imagetxt : " ";
                _spcommand.Parameters.Add("@imageURL", SqlDbType.VarChar).Value      = !string.IsNullOrEmpty(imageurl) ? imageurl : " ";
                _spcommand.Parameters.Add("@ImageBelowTxt", SqlDbType.VarChar).Value = !string.IsNullOrEmpty(imagetxtbelow) ? imagetxtbelow : " ";
                _spcommand.Parameters.Add("@imagecredit", SqlDbType.VarChar).Value   = !string.IsNullOrEmpty(imagecredit) ? imagecredit : " ";
                _newconn.Open();
                _spcommand.ExecuteNonQuery();
                _newconn.Close();
            }
            catch (Exception ex)
            {
                if (_newconn.State == ConnectionState.Open)
                {
                    _newconn.Close();
                }
                CommonLib.ExceptionHandler.WriteLog(CommonLib.Sections.Client, "Gettyimages-addimages-Addnewsimages-", ex);
            }
            return(true);
        }
Exemple #6
0
        public string GetCategoryename()
        {
            string        _strcatname = string.Empty;
            DataTable     objDT       = new DataTable();
            SqlConnection _newconn    = new SqlConnection(GetnetworkID(NetworkId.ToString()));
            int           cnt         = 0;

            try
            {
                SqlCommand _spcommand = new SqlCommand("AK_SP_GetCategoryename_Forgetty", _newconn);
                _spcommand.CommandType = CommandType.StoredProcedure;
                _spcommand.Parameters.Add("@SiteID", SqlDbType.Int).Value = this.SiteID;
                _spcommand.Parameters.Add("@catID", SqlDbType.Int).Value  = this.CatID;
                _newconn.Open();
                _strcatname = (string)_spcommand.ExecuteScalar();
                _newconn.Close();
            }
            catch (Exception ex)
            {
                if (_newconn.State == ConnectionState.Open)
                {
                    _newconn.Close();
                }
                CommonLib.ExceptionHandler.WriteLog(CommonLib.Sections.Client, "Gettyimages-addimages-GetCategoryename-", ex);
            }

            return(_strcatname);
        }
Exemple #7
0
        public bool Addnewssingleimages()
        {
            DataTable     objDT    = new DataTable();
            SqlConnection _newconn = new SqlConnection(GetnetworkID(NetworkId.ToString()));
            int           cnt      = 0;

            try
            {
                SqlCommand _spcommand = new SqlCommand("AK_SP_AddSinglegettyimage", _newconn);
                _spcommand.CommandType = CommandType.StoredProcedure;
                _spcommand.Parameters.Add("@RandomId", SqlDbType.VarChar).Value        = !string.IsNullOrEmpty(RandomId) ? RandomId : " ";
                _spcommand.Parameters.Add("@SelectnewsImage", SqlDbType.VarChar).Value = !string.IsNullOrEmpty(imagename) ? imagename : " ";
                _spcommand.Parameters.Add("@sitId", SqlDbType.VarChar).Value           = !string.IsNullOrEmpty(SiteID) ? SiteID : " ";
                _spcommand.Parameters.Add("@Gettyurl", SqlDbType.VarChar).Value        = !string.IsNullOrEmpty(imageurl) ? imageurl : " ";
                _spcommand.Parameters.Add("@ImageDesc", SqlDbType.NVarChar).Value      = !string.IsNullOrEmpty(imagetxtbelow) ? imagetxtbelow : " ";
                _newconn.Open();
                _spcommand.ExecuteNonQuery();
                _newconn.Close();
            }
            catch (Exception ex)
            {
                if (_newconn.State == ConnectionState.Open)
                {
                    _newconn.Close();
                }
                CommonLib.ExceptionHandler.WriteLog(CommonLib.Sections.Client, "Gettyimages-addimages-Addnewsimages-", ex);
            }
            return(true);
        }
Exemple #8
0
        public bool checkGettyEvents(int _valevent)
        {
            DataTable     objDT     = new DataTable();
            SqlConnection _newconn  = new SqlConnection(GetnetworkID(NetworkId.ToString()));
            int           cnt       = 0;
            string        _checkval = string.Empty;

            try
            {
                /*SqlParameter[] msgpara = { new SqlParameter("@eventId", SqlDbType.Int),
                 *                         new SqlParameter("@retval", SqlDbType.VarChar)
                 *                       };
                 * msgpara[0].Value = _valevent;
                 * msgpara[1].Value = "";
                 * msgpara[1].Direction = ParameterDirection.Output;*/
                SqlCommand _spcommand = new SqlCommand("AK_SP_CheckGettyEvent", _newconn);
                _spcommand.CommandType = CommandType.StoredProcedure;
                _spcommand.Parameters.Add("@eventId", SqlDbType.Int).Value = _valevent;
                SqlParameter parm3 = new SqlParameter("@retval", SqlDbType.VarChar);
                parm3.Value     = "false";
                parm3.Direction = ParameterDirection.Output;
                _spcommand.Parameters.Add(parm3);
                _newconn.Open();
                //_spcommand.ExecuteNonQuery();
                _checkval = (string)_spcommand.ExecuteScalar();
                _newconn.Close();
            }
            catch (Exception ex)
            {
                if (_newconn.State == ConnectionState.Open)
                {
                    _newconn.Close();
                }
                CommonLib.ExceptionHandler.WriteLog(CommonLib.Sections.Client, "Gettyimages-addimages-Addnewsimages-", ex);
            }
            finally
            {
                if (_newconn.State == ConnectionState.Open)
                {
                    _newconn.Close();
                }
            }
            if (_checkval == "true")
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Exemple #9
0
        private WebRtcPeerConnection CreatePeerConnection(NetworkId objectid, string uuid)
        {
            var go = new GameObject(objectid.ToString());

            go.transform.SetParent(transform);

            var pc = go.AddComponent <WebRtcPeerConnection>();

            pc.Id = objectid;

            peerUUIDToConnection.Add(uuid, pc);

            return(pc);
        }
Exemple #10
0
        public void GetsitenameandserverID()
        {
            string        _strsitename = string.Empty;
            DataTable     objDT        = new DataTable();
            DataSet       _ds          = new DataSet();
            SqlConnection _newconn     = new SqlConnection(GetnetworkID(NetworkId.ToString()));
            int           cnt          = 0;

            try
            {
                SqlCommand _spcommand = new SqlCommand("AK_SP_GetSitename_Servertype_Forgetty", _newconn);
                _spcommand.CommandType = CommandType.StoredProcedure;
                _spcommand.Parameters.Add("@SiteID", SqlDbType.Int).Value = this.SiteID;
                _newconn.Open();
                SqlDataAdapter da = new SqlDataAdapter(_spcommand);
                da.Fill(_ds);

                if (_ds != null)
                {
                    if (_ds.Tables[0].Rows.Count > 0)
                    {
                        foreach (DataRow _dr in _ds.Tables[0].Rows)
                        {
                            _strsitename  = _dr["SiteURL"].ToString();
                            serverId      = _dr["serverid"].ToString();
                            Sitealias     = _dr["SiteAlias"].ToString();
                            IsImageServer = _dr["IsImageServer"].ToString();
                        }
                    }
                }
                string[] strarr = _strsitename.Split('.');
                if (strarr.Length > 3)
                {
                    Sitename = string.Format("{0}-{1}", strarr[1].Trim(), strarr[3].Trim());
                }
                else
                {
                    Sitename = strarr[1];
                }
                _newconn.Close();
            }
            catch (Exception ex)
            {
                if (_newconn.State == ConnectionState.Open)
                {
                    _newconn.Close();
                }
                CommonLib.ExceptionHandler.WriteLog(CommonLib.Sections.Client, "Gettyimages-addimages-Getsitename-", ex);
            }
        }
Exemple #11
0
        private void Start()
        {
            localAvatarId = NetworkScene.GenerateUniqueId();

            RoomClient.OnPeerAdded.AddListener(UpdateAvatar);
            RoomClient.OnPeerUpdated.AddListener(UpdateAvatar);
            RoomClient.OnPeerRemoved.AddListener(OnPeerRemoved);

            RoomClient.Me["ubiq.avatar.networkid"] = localAvatarId.ToString();

            // The default prefab for the player has been defined; create the avatar with this prefab
            if (LocalPrefabUuid.Length > 0)
            {
                RoomClient.Me["ubiq.avatar.prefab"] = LocalPrefabUuid;
            }

            UpdateAvatar(RoomClient.Me);
        }
Exemple #12
0
        public string Getsitename()
        {
            string        _strsitename = string.Empty;
            DataTable     objDT        = new DataTable();
            SqlConnection _newconn     = new SqlConnection(GetnetworkID(NetworkId.ToString()));
            int           cnt          = 0;

            try
            {
                SqlCommand _spcommand = new SqlCommand("AK_SP_GetSitename_Forgetty", _newconn);
                _spcommand.CommandType = CommandType.StoredProcedure;
                _spcommand.Parameters.Add("@SiteID", SqlDbType.Int).Value = this.SiteID;
                _newconn.Open();
                _strsitename = (string)_spcommand.ExecuteScalar();
                string[] strarr = _strsitename.Split('.');
                if (strarr.Length > 3)
                {
                    _strsitename = string.Format("{0}-{1}", strarr[1].Trim(), strarr[3].Trim());
                }
                else
                {
                    _strsitename = strarr[1];
                }
                _newconn.Close();
            }
            catch (Exception ex)
            {
                if (_newconn.State == ConnectionState.Open)
                {
                    _newconn.Close();
                }
                CommonLib.ExceptionHandler.WriteLog(CommonLib.Sections.Client, "Gettyimages-addimages-Getsitename-", ex);
            }

            return(_strsitename);
        }
Exemple #13
0
 public override string ToString()
 {
     return($"[Name={CurrentAlias?.Name ?? "--"}, NetworkId={NetworkId.ToString("X")}, IP={(string.IsNullOrEmpty(IPAddressString) ? "--" : IPAddressString)}, ClientSlot={ClientNumber}]");
 }
Exemple #14
0
        /// <summary>
        ///     The process record method.
        /// </summary>
        protected override void ProcessRecord()
        {
            ResponseType response = null;

            base.ProcessRecord();
            try
            {
                if (Vlan != null)
                {
                    VlanId = Guid.Parse(Vlan.id);
                }
                else if (Network != null)
                {
                    NetworkId = Guid.Parse(Network.id);
                }

                response =
                    Connection.ApiClient.Networking.IpAddress.UnreservePrivateIpv4Address(
                        new UnreservePrivateIpv4AddressType
                {
                    Item            = VlanId.HasValue ? VlanId.ToString() : NetworkId.HasValue ? NetworkId.ToString() : null,
                    ItemElementName = VlanId.HasValue ? NetworkIdOrVlanIdChoiceType.vlanId : NetworkIdOrVlanIdChoiceType.networkId,
                    ipAddress       = IpAddress
                }).Result;
            }
            catch (AggregateException ae)
            {
                ae.Handle(
                    e =>
                {
                    if (e is ComputeApiException)
                    {
                        WriteError(new ErrorRecord(e, "-2", ErrorCategory.InvalidOperation, Connection));
                    }
                    else
                    {
                        // if (e is HttpRequestException)
                        ThrowTerminatingError(new ErrorRecord(e, "-1", ErrorCategory.ConnectionError, Connection));
                    }

                    return(true);
                });
            }

            WriteObject(response);
        }
        private void AddNetworkObject(NetworkId networkID, IMyNetObject obj)
        {
            IMyNetObject foundObj;
            if (!m_networkIDToObject.TryGetValue(networkID, out foundObj))
            {
                m_networkIDToObject.Add(networkID, obj);
                m_objectToNetworkID.Add(obj, networkID);

                var proxyTarget = obj as IMyProxyTarget;
                if (proxyTarget != null)
                {
                    Debug.Assert(proxyTarget.Target != null, "IMyProxyTarget.Target is null!");
                    if (proxyTarget.Target != null)
                    {
                        m_proxyToTarget.Add(proxyTarget.Target, proxyTarget);
                    }
                }
            }
            else
            {
                if (obj != null && foundObj != null)
                {
                    MyLog.Default.WriteLine("Replicated object already exists adding : " + obj.ToString() + " existing : " + foundObj.ToString() + " id : " + networkID.ToString());
                }
                Debug.Fail("Replicated object already exists!");
            }
        }
        private void AddNetworkObject(NetworkId networkID, IMyNetObject obj)
        {
            IMyNetObject foundObj;
            networkObjectLock.AcquireExclusiveUsing();
            if (!m_networkIDToObject.TryGetValue(networkID, out foundObj))
            {
                m_networkIDToObject.Add(networkID, obj);
                m_objectToNetworkID.Add(obj, networkID);

                var proxyTarget = obj as IMyProxyTarget;
                if (proxyTarget != null)
                {
                    Debug.Assert(proxyTarget.Target != null, "IMyProxyTarget.Target is null!");
                    Debug.Assert(!m_proxyToTarget.ContainsKey(proxyTarget.Target), "Proxy is already added to list!");
                    if (proxyTarget.Target != null && !m_proxyToTarget.ContainsKey(proxyTarget.Target))
                    {
                        m_proxyToTarget.Add(proxyTarget.Target, proxyTarget);
                    }
                }
            }
            else
            {
                if (obj != null && foundObj != null)
                {
                    MyLog.Default.WriteLine("Replicated object already exists adding : " + obj.ToString() + " existing : " + foundObj.ToString() + " id : " + networkID.ToString());
                }
                Debug.Fail("Replicated object already exists!");
            }
            networkObjectLock.ReleaseExclusive();
        }