Exemple #1
0
        /// <summary>
        /// Tell the client about X event
        /// </summary>
        /// <param name="remoteClient"></param>
        /// <param name="queryEventID">ID of the event</param>
        public void EventInfoRequest(IClientAPI remoteClient, uint queryEventID)
        {
            //Find the event
            EventData data = directoryService.GetEventInfo(queryEventID.ToString());

            //Send the event
            remoteClient.SendEventInfoReply(data);
        }
Exemple #2
0
        public void EventInfoRequest(IClientAPI remoteClient, uint queryEventID)
        {
            Hashtable ReqHash = new Hashtable();

            ReqHash["eventID"] = queryEventID.ToString();

            Hashtable result = GenericXMLRPCRequest(ReqHash, "event_info_query");

            if (!Convert.ToBoolean(result["success"]))
            {
                remoteClient.SendAgentAlertMessage(result["errorMessage"].ToString(), false);
                return;
            }

            ArrayList dataArray = (ArrayList)result["data"];

            if (dataArray.Count == 0)
            {
                // something bad happened here, if we could return an
                // event after the search,
                // we should be able to find it here
                // TODO do some (more) sensible error-handling here
                remoteClient.SendAgentAlertMessage("Couldn't find this event.", false);
                return;
            }

            Hashtable d = (Hashtable)dataArray[0];

            string name = d["name"].ToString();
            string desc = d["description"].ToString();
            string cate = d["category"].ToString();

            if (Enc != null)
            {
                name = Enc.GetString(Convert.FromBase64String(name));
                desc = Enc.GetString(Convert.FromBase64String(desc));
                cate = Enc.GetString(Convert.FromBase64String(cate));
            }

            EventData data = new EventData();

            data.eventID     = Convert.ToUInt32(d["event_id"]);
            data.creator     = d["creator"].ToString();
            data.name        = name;
            data.category    = cate;
            data.description = desc;
            data.date        = d["date"].ToString();
            data.dateUTC     = Convert.ToUInt32(d["dateUTC"]);
            data.duration    = Convert.ToUInt32(d["duration"]);
            data.cover       = Convert.ToUInt32(d["covercharge"]);
            data.amount      = Convert.ToUInt32(d["coveramount"]);
            data.simName     = d["simname"].ToString();
            Vector3.TryParse(d["globalposition"].ToString(), out data.globalPos);
            data.eventFlags = Convert.ToUInt32(d["eventflags"]);

            remoteClient.SendEventInfoReply(data);
        }
        /// <summary>
        ///   Tell the client about X event
        /// </summary>
        /// <param name = "remoteClient"></param>
        /// <param name = "queryEventID">ID of the event</param>
        public void EventInfoRequest(IClientAPI remoteClient, uint queryEventID)
        {
            //Find the event
            EventData data = directoryService.GetEventInfo(queryEventID);

            if (data == null)
            {
                return;
            }
            //Send the event
            remoteClient.SendEventInfoReply(data);
        }
 /// <summary>
 /// Tell the client about X event
 /// </summary>
 /// <param name="remoteClient"></param>
 /// <param name="queryEventID">ID of the event</param>
 public void EventInfoRequest(IClientAPI remoteClient, uint queryEventID)
 {
     //Find the event
     EventData data = directoryService.GetEventInfo(queryEventID.ToString());
     //Send the event
     remoteClient.SendEventInfoReply(data);
 }
        public void EventInfoRequest(IClientAPI remoteClient, uint queryEventID)
        {
            Hashtable ReqHash = new Hashtable();
            ReqHash["eventID"] = queryEventID.ToString();

            Hashtable result = GenericXMLRPCRequest(ReqHash,
                    "event_info_query");

            if (!Convert.ToBoolean(result["success"]))
            {
                remoteClient.SendAgentAlertMessage(
                        result["errorMessage"].ToString(), false);
                return;
            }

            ArrayList dataArray = (ArrayList)result["data"];
            if (dataArray.Count == 0)
            {
                // something bad happened here, if we could return an
                // event after the search,
                // we should be able to find it here
                // TODO do some (more) sensible error-handling here
                remoteClient.SendAgentAlertMessage("Couldn't find this event.",
                        false);
                return;
            }

            Hashtable d = (Hashtable)dataArray[0];
            EventData data = new EventData();
            data.eventID = Convert.ToUInt32(d["event_id"]);
            data.creator = d["creator"].ToString();
            data.name = d["name"].ToString();
            data.category = d["category"].ToString();
            data.description = d["description"].ToString();
            data.date = d["date"].ToString();
            data.dateUTC = Convert.ToUInt32(d["dateUTC"]);
            data.duration = Convert.ToUInt32(d["duration"]);
            data.cover = Convert.ToUInt32(d["covercharge"]);
            data.amount = Convert.ToUInt32(d["coveramount"]);
            data.simName = d["simname"].ToString();
            Vector3.TryParse(d["globalposition"].ToString(), out data.globalPos);
            data.eventFlags = Convert.ToUInt32(d["eventflags"]);

            remoteClient.SendEventInfoReply(data);
        }
        public void EventInfoRequest(IClientAPI remoteClient, uint queryEventID)
        {

            EventData data = new EventData();
            Dictionary<string, object> parms = new Dictionary<string, object>();
            parms.Add("?eventID", queryEventID);

            string query = "select * from events where eventid=?eventID";

            using (ISimpleDB db = _connFactory.GetConnection())
            {
                List<Dictionary<string, string>> results = db.QueryWithResults(query, parms);
                foreach (Dictionary<string, string> row in results)
                {
                    data.eventID = Convert.ToUInt32(row["eventid"]);
                    data.creator = row["creatoruuid"].ToString();
                    data.name = row["name"].ToString();
                    // need to convert this from the integer it is to the 
                    // real string value so it shows correctly
                    if (row["category"] == "18")
                        data.category = "Discussion";
                    if (row["category"] == "19")
                        data.category = "Sports";
                    if (row["category"] == "20")
                        data.category = "Live Music";
                    if (row["category"] == "22")
                        data.category = "Commercial";
                    if (row["category"] == "23")
                        data.category = "Nightlife/Entertainment";
                    if (row["category"] == "24")
                        data.category = "Games/Contests";
                    if (row["category"] == "25")
                        data.category = "Pageants";
                    if (row["category"] == "26")
                        data.category = "Education";
                    if (row["category"] == "27")
                        data.category = "Arts and Culture";
                    if (row["category"] == "28")
                        data.category = "Charity/Support Groups";
                    if (row["category"] == "29")
                        data.category = "Miscellaneous";

                    data.description = row["description"].ToString();

                    // do something here with date to format it correctly for what
                    // the viewer needs!
                    //data.date = row["date"].ToString();

                    // need to convert the unix timestamp we get into legible date for viewer
                    DateTime localViewerEventTime = Util.UnixToLocalDateTime(Convert.ToInt32(row["dateUTC"])); 
                    string newSendingDate = String.Format("{0:yyyy-MM-dd HH:MM:ss}", localViewerEventTime);

                    data.date = newSendingDate;
                    
                    data.dateUTC = Convert.ToUInt32(row["dateUTC"]);
                    data.duration = Convert.ToUInt32(row["duration"]);
                    data.cover = Convert.ToUInt32(row["covercharge"]);
                    data.amount = Convert.ToUInt32(row["coveramount"]);
                    data.simName = row["simname"].ToString();
                    Vector3.TryParse(row["globalPos"].ToString(), out data.globalPos);
                    data.eventFlags = Convert.ToUInt32(row["eventflags"]);

                }
            }
            
            remoteClient.SendEventInfoReply(data);
            
        }
 public void EventInfoRequest(IClientAPI remoteClient, uint queryEventID)
 {
     EventData data = DSC.GetEventInfo(queryEventID.ToString());
     remoteClient.SendEventInfoReply(data);
 }
Exemple #8
0
        public void EventInfoRequest(IClientAPI remoteClient, uint queryEventID)
        {
            EventData data = new EventData();
            Dictionary <string, object> parms = new Dictionary <string, object>();

            parms.Add("?eventID", queryEventID);

            string query = "select * from events where eventid=?eventID";

            using (ISimpleDB db = _connFactory.GetConnection())
            {
                List <Dictionary <string, string> > results = db.QueryWithResults(query, parms);
                foreach (Dictionary <string, string> row in results)
                {
                    data.eventID = Convert.ToUInt32(row["eventid"]);
                    data.creator = row["creatoruuid"].ToString();
                    data.name    = row["name"].ToString();
                    // need to convert this from the integer it is to the
                    // real string value so it shows correctly
                    if (row["category"] == "18")
                    {
                        data.category = "Discussion";
                    }
                    if (row["category"] == "19")
                    {
                        data.category = "Sports";
                    }
                    if (row["category"] == "20")
                    {
                        data.category = "Live Music";
                    }
                    if (row["category"] == "22")
                    {
                        data.category = "Commercial";
                    }
                    if (row["category"] == "23")
                    {
                        data.category = "Nightlife/Entertainment";
                    }
                    if (row["category"] == "24")
                    {
                        data.category = "Games/Contests";
                    }
                    if (row["category"] == "25")
                    {
                        data.category = "Pageants";
                    }
                    if (row["category"] == "26")
                    {
                        data.category = "Education";
                    }
                    if (row["category"] == "27")
                    {
                        data.category = "Arts and Culture";
                    }
                    if (row["category"] == "28")
                    {
                        data.category = "Charity/Support Groups";
                    }
                    if (row["category"] == "29")
                    {
                        data.category = "Miscellaneous";
                    }

                    data.description = row["description"].ToString();

                    // do something here with date to format it correctly for what
                    // the viewer needs!
                    //data.date = row["date"].ToString();

                    // need to convert the unix timestamp we get into legible date for viewer
                    DateTime localViewerEventTime = Util.UnixToLocalDateTime(Convert.ToInt32(row["dateUTC"]));
                    string   newSendingDate       = String.Format("{0:yyyy-MM-dd HH:MM:ss}", localViewerEventTime);

                    data.date = newSendingDate;

                    data.dateUTC  = Convert.ToUInt32(row["dateUTC"]);
                    data.duration = Convert.ToUInt32(row["duration"]);
                    data.cover    = Convert.ToUInt32(row["covercharge"]);
                    data.amount   = Convert.ToUInt32(row["coveramount"]);
                    data.simName  = row["simname"].ToString();
                    Vector3.TryParse(row["globalPos"].ToString(), out data.globalPos);
                    data.eventFlags = Convert.ToUInt32(row["eventflags"]);
                }
            }

            remoteClient.SendEventInfoReply(data);
        }