本文整理汇总了C#中IClientAPI.SendDirPlacesReply方法的典型用法代码示例。如果您正苦于以下问题:C# IClientAPI.SendDirPlacesReply方法的具体用法?C# IClientAPI.SendDirPlacesReply怎么用?C# IClientAPI.SendDirPlacesReply使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IClientAPI
的用法示例。
在下文中一共展示了IClientAPI.SendDirPlacesReply方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DirPlacesQuery
/// <summary>
/// Parcel request
/// </summary>
/// <param name="remoteClient"></param>
/// <param name="queryID"></param>
/// <param name="queryText">The thing to search for</param>
/// <param name="queryFlags"></param>
/// <param name="category"></param>
/// <param name="simName"></param>
/// <param name="queryStart"></param>
protected void DirPlacesQuery(IClientAPI remoteClient, UUID queryID,
string queryText, int queryFlags, int category, string simName,
int queryStart)
{
DirPlacesReplyData[] ReturnValues = directoryService.FindLand(queryText, category.ToString(), queryStart, (uint)queryFlags);
//Only send 10 at a time so that we don't kill the client with too big of a packet
if (ReturnValues.Length > 10)
{
DirPlacesReplyData[] data = new DirPlacesReplyData[10];
int i = 0;
foreach (DirPlacesReplyData d in ReturnValues)
{
data[i] = d;
i++;
if (i == 10)
{
//Rebuild the packets every 10 places
remoteClient.SendDirPlacesReply(queryID, data);
i = 0;
if (ReturnValues.Length - i < 10)
{
data = new DirPlacesReplyData[ReturnValues.Length - i];
}
else
{
data = new DirPlacesReplyData[10];
}
}
}
//Send all the remaining packets
if(data.Length != 0)
remoteClient.SendDirPlacesReply(queryID, data);
}
else //Send all then if it is less than 10
remoteClient.SendDirPlacesReply(queryID, ReturnValues);
}
示例2: DirPlacesQuery
protected void DirPlacesQuery(IClientAPI remoteClient, UUID queryID, string queryText, int queryFlags, int category, string simName,
int queryStart)
{
// m_log.DebugFormat("[LAND SEARCH]: In Places Search for queryText: {0} with queryFlag: {1} with category {2} for simName {3}",
// queryText, queryFlags.ToString("X"), category.ToString(), simName);
queryText = queryText.Trim(); // newer viewers sometimes append a space
string query = String.Empty;
//string newQueryText = "%" + queryText + "%";
Dictionary<string, object> parms = new Dictionary<string, object>();
parms.Add("?searchText", queryText);
parms.Add("?searchFlags", queryFlags);
if (category > 0)
parms.Add("?searchCategory", category);
//parms.Add("?searchSimName", simName);
Single dwell = 0;
int count = MAX_RESULTS + 1; // +1 so that the viewer knows to enable the NEXT button (it seems)
int i = 0;
int queryEnd = queryStart + count - 1; // 0-based
query = "select * from land where LandFlags & "+ParcelFlags.ShowDirectory.ToString("d");
if (category > 0)
query += " AND Category=?searchCategory";
query += " AND (Name REGEXP ?searchText OR Description REGEXP ?searchText) order by Name, Description";
using (ISimpleDB db = _connFactory.GetConnection())
{
List<UUID> regionsToInclude = UpdateRegionsList(db);
List<Dictionary<string, string>> results = DoLandQueryAndCombine(remoteClient, db, query, parms, 0, queryStart, queryEnd, regionsToInclude);
DirPlacesReplyData[] data = new DirPlacesReplyData[results.Count < 1 ? 1 : results.Count];
foreach (Dictionary<string, string> row in results)
{
bool auction = false;
data[i] = new DirPlacesReplyData();
data[i].parcelID = new UUID(row["uuid"]);
data[i].name = row["name"];
data[i].forSale = (Convert.ToInt16(row["SalePrice"]) > 0);
data[i].auction = auction;
data[i].dwell = dwell;
data[i].Status = STATUS_SEARCH_PLACES_NONE; // 0, success
i++;
}
if (results.Count == 0)
{
data[0] = new DirPlacesReplyData();
data[0].parcelID = UUID.Zero;
data[0].name = String.Empty;
data[0].forSale = false;
data[0].auction = false;
data[0].dwell = 0;
data[0].Status = STATUS_SEARCH_PLACES_FOUNDNONE; // empty results
}
remoteClient.SendDirPlacesReply(queryID, data);
}
}
示例3: DirPlacesQuery
protected void DirPlacesQuery(IClientAPI remoteClient, UUID queryID,
string queryText, int queryFlags, int category, string simName,
int queryStart)
{
Hashtable ReqHash = new Hashtable();
ReqHash["text"] = queryText;
ReqHash["flags"] = queryFlags.ToString();
ReqHash["category"] = category.ToString();
ReqHash["sim_name"] = simName;
ReqHash["query_start"] = queryStart.ToString();
Hashtable result = GenericXMLRPCRequest(ReqHash,
"dir_places_query");
if (!Convert.ToBoolean(result["success"]))
{
remoteClient.SendAgentAlertMessage(
result["errorMessage"].ToString(), false);
return;
}
ArrayList dataArray = (ArrayList)result["data"];
int count = dataArray.Count;
if (count > 100)
count = 101;
DirPlacesReplyData[] data = new DirPlacesReplyData[count];
int i = 0;
foreach (Object o in dataArray)
{
Hashtable d = (Hashtable)o;
data[i] = new DirPlacesReplyData();
data[i].parcelID = new UUID(d["parcel_id"].ToString());
data[i].name = d["name"].ToString();
data[i].forSale = Convert.ToBoolean(d["for_sale"]);
data[i].auction = Convert.ToBoolean(d["auction"]);
data[i].dwell = Convert.ToSingle(d["dwell"]);
if (++i >= count)
break;
}
remoteClient.SendDirPlacesReply(queryID, data);
}
示例4: DirPlacesQuery
/// <summary>
/// Parcel request
/// </summary>
/// <param name="remoteClient"></param>
/// <param name="queryID"></param>
/// <param name="queryText"></param>
/// <param name="queryFlags"></param>
/// <param name="category"></param>
/// <param name="simName"></param>
/// <param name="queryStart"></param>
protected void DirPlacesQuery(IClientAPI remoteClient, UUID queryID,
string queryText, int queryFlags, int category, string simName,
int queryStart)
{
DirPlacesReplyData[] ReturnValues = DSC.FindLand(queryText, category.ToString(), queryStart, (uint)queryFlags);
if (ReturnValues.Length > 10)
{
DirPlacesReplyData[] data = new DirPlacesReplyData[10];
int i = 0;
foreach (DirPlacesReplyData d in ReturnValues)
{
data[i] = d;
i++;
if (i == 10)
{
remoteClient.SendDirPlacesReply(queryID, data);
i = 0;
if (ReturnValues.Length - i < 10)
{
data = new DirPlacesReplyData[ReturnValues.Length - i];
}
else
{
data = new DirPlacesReplyData[10];
}
}
}
remoteClient.SendDirPlacesReply(queryID, data);
}
else
{
remoteClient.SendDirPlacesReply(queryID, ReturnValues);
}
}