本文整理汇总了C#中IClientAPI.SendEventInfoReply方法的典型用法代码示例。如果您正苦于以下问题:C# IClientAPI.SendEventInfoReply方法的具体用法?C# IClientAPI.SendEventInfoReply怎么用?C# IClientAPI.SendEventInfoReply使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IClientAPI
的用法示例。
在下文中一共展示了IClientAPI.SendEventInfoReply方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: EventInfoRequest
/// <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);
}
示例2: EventInfoRequest
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);
}
示例3: EventInfoRequest
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);
}
示例4: EventInfoRequest
public void EventInfoRequest(IClientAPI remoteClient, uint queryEventID)
{
EventData data = DSC.GetEventInfo(queryEventID.ToString());
remoteClient.SendEventInfoReply(data);
}