本文整理汇总了C#中IClientAPI.SendCreateGroupReply方法的典型用法代码示例。如果您正苦于以下问题:C# IClientAPI.SendCreateGroupReply方法的具体用法?C# IClientAPI.SendCreateGroupReply怎么用?C# IClientAPI.SendCreateGroupReply使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IClientAPI
的用法示例。
在下文中一共展示了IClientAPI.SendCreateGroupReply方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateGroup
public UUID CreateGroup(IClientAPI remoteClient, string name, string charter, bool showInList, UUID insigniaID, int membershipFee, bool openEnrollment, bool allowPublish, bool maturePublish)
{
if (m_debugEnabled) m_log.DebugFormat("[Groups]: {0} called in {1}", System.Reflection.MethodBase.GetCurrentMethod().Name, remoteClient.Scene.RegionInfo.RegionName);
if (m_groupData.GetGroupRecord(GetRequestingAgentIDStr(remoteClient), UUID.Zero, name) != null)
{
remoteClient.SendCreateGroupReply(UUID.Zero, false, "A group with the same name already exists.");
return UUID.Zero;
}
// check user level
ScenePresence avatar = null;
Scene scene = (Scene)remoteClient.Scene;
scene.TryGetScenePresence(remoteClient.AgentId, out avatar);
if (avatar != null)
{
if (avatar.UserLevel < m_levelGroupCreate)
{
remoteClient.SendCreateGroupReply(UUID.Zero, false, String.Format("Insufficient permissions to create a group. Requires level {0}", m_levelGroupCreate));
return UUID.Zero;
}
}
// check funds
// is there is a money module present ?
IMoneyModule money = scene.RequestModuleInterface<IMoneyModule>();
if (money != null)
{
// do the transaction, that is if the agent has got sufficient funds
if (!money.AmountCovered(remoteClient.AgentId, money.GroupCreationCharge)) {
remoteClient.SendCreateGroupReply(UUID.Zero, false, "Insufficient funds to create a group.");
return UUID.Zero;
}
}
string reason = string.Empty;
UUID groupID = m_groupData.CreateGroup(remoteClient.AgentId, name, charter, showInList, insigniaID, membershipFee, openEnrollment,
allowPublish, maturePublish, remoteClient.AgentId, out reason);
if (groupID != UUID.Zero)
{
if (money != null)
money.ApplyCharge(remoteClient.AgentId, money.GroupCreationCharge, MoneyTransactionType.GroupCreate);
remoteClient.SendCreateGroupReply(groupID, true, "Group created successfullly");
// Update the founder with new group information.
SendAgentGroupDataUpdate(remoteClient, GetRequestingAgentID(remoteClient));
}
else
remoteClient.SendCreateGroupReply(groupID, false, reason);
return groupID;
}
示例2: CreateGroup
public UUID CreateGroup(IClientAPI remoteClient, string name, string charter, bool showInList, UUID insigniaID, int membershipFee, bool openEnrollment, bool allowPublish, bool maturePublish)
{
if (m_debugEnabled) m_log.DebugFormat("[GROUPS]: {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name);
if (m_groupData.GetGroupRecord(GetRequestingAgentID(remoteClient), UUID.Zero, name) != null)
{
remoteClient.SendCreateGroupReply(UUID.Zero, false, "A group with the same name already exists.");
return UUID.Zero;
}
// is there is a money module present ?
IMoneyModule money = remoteClient.Scene.RequestModuleInterface<IMoneyModule>();
if (money != null)
{
// do the transaction, that is if the agent has got sufficient funds
if (!money.AmountCovered(remoteClient, money.GroupCreationCharge)) {
remoteClient.SendCreateGroupReply(UUID.Zero, false, "You have got issuficient funds to create a group.");
return UUID.Zero;
}
money.ApplyCharge(GetRequestingAgentID(remoteClient), money.GroupCreationCharge, "Group Creation");
}
UUID groupID = m_groupData.CreateGroup(GetRequestingAgentID(remoteClient), name, charter, showInList, insigniaID, membershipFee, openEnrollment, allowPublish, maturePublish, GetRequestingAgentID(remoteClient));
remoteClient.SendCreateGroupReply(groupID, true, "Group created successfullly");
// Update the founder with new group information.
SendAgentGroupDataUpdate(remoteClient, GetRequestingAgentID(remoteClient));
return groupID;
}
示例3: CreateGroup
public UUID CreateGroup(IClientAPI remoteClient, string name, string charter, bool showInList, UUID insigniaID,
int membershipFee, bool openEnrollment, bool allowPublish, bool maturePublish)
{
if (m_debugEnabled)
MainConsole.Instance.DebugFormat("[GROUPS]: {0} called", MethodBase.GetCurrentMethod().Name);
if (m_groupData.GetGroupRecord(GetRequestingAgentID(remoteClient), UUID.Zero, name) != null)
{
remoteClient.SendCreateGroupReply(UUID.Zero, false, "A group with the same name already exists.");
return UUID.Zero;
}
// is there is a money module present ?
IMoneyModule money = remoteClient.Scene.RequestModuleInterface<IMoneyModule>();
if (money != null)
{
try
{
// do the transaction, that is if the agent has got sufficient funds
if (!money.Charge(GetRequestingAgentID(remoteClient), money.GroupCreationCharge, "Group Creation", TransactionType.GroupCreate))
{
remoteClient.SendCreateGroupReply(UUID.Zero, false,
"You have got insuficient funds to create a group.");
return UUID.Zero;
}
}
catch
{
remoteClient.SendCreateGroupReply(UUID.Zero, false,
"A money related exception occured, please contact your grid administrator.");
return UUID.Zero;
}
}
UUID groupID = UUID.Random();
m_groupData.CreateGroup(groupID, name, charter, showInList,
insigniaID, membershipFee, openEnrollment, allowPublish,
maturePublish, GetRequestingAgentID(remoteClient), UUID.Random());
remoteClient.SendCreateGroupReply(groupID, true, "Group created successfullly");
m_cachedGroupTitles[remoteClient.AgentId] =
AttemptFindGroupMembershipData(remoteClient.AgentId, remoteClient.AgentId, groupID);
m_cachedGroupMemberships.Remove(remoteClient.AgentId);
RemoveFromGroupPowersCache(remoteClient.AgentId, remoteClient.ActiveGroupId);
// Update the founder with new group information.
SendAgentGroupDataUpdate(remoteClient, GetRequestingAgentID(remoteClient));
return groupID;
}
示例4: CreateGroup
public UUID CreateGroup(IClientAPI remoteClient, string name, string charter, bool showInList, UUID insigniaID, int membershipFee, bool openEnrollment, bool allowPublish, bool maturePublish)
{
if (m_debugEnabled) m_log.DebugFormat("[GROUPS]: {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name);
GroupRequestID grID = GetClientGroupRequestID(remoteClient);
if (m_groupData.GetGroupRecord(grID, UUID.Zero, name) != null)
{
remoteClient.SendCreateGroupReply(UUID.Zero, false, "A group with the same name already exists.");
return UUID.Zero;
}
UUID groupID = m_groupData.CreateGroup(grID, name, charter, showInList, insigniaID, membershipFee, openEnrollment, allowPublish, maturePublish, remoteClient.AgentId);
remoteClient.SendCreateGroupReply(groupID, true, "Group created successfullly");
// Update the founder with new group information.
SendAgentGroupDataUpdate(remoteClient, remoteClient.AgentId);
return groupID;
}
示例5: ClassifiedInfoUpdate
// Classifieds Update
public void ClassifiedInfoUpdate(UUID queryclassifiedID, uint queryCategory, string queryName, string queryDescription, UUID queryParcelID,
uint queryParentEstate, UUID querySnapshotID, Vector3 queryGlobalPos, byte queryclassifiedFlags,
int queryclassifiedPrice, IClientAPI remoteClient)
{
Hashtable ReqHash = new Hashtable();
Scene s = (Scene) remoteClient.Scene;
Vector3 pos = remoteClient.SceneAgent.AbsolutePosition;
ILandObject land = s.LandChannel.GetLandObject(pos.X, pos.Y);
if (land == null)
ReqHash["parcelname"] = String.Empty;
else
ReqHash["parcelname"] = land.LandData.Name;
ReqHash["creatorUUID"] = remoteClient.AgentId.ToString();
ReqHash["classifiedUUID"] = queryclassifiedID.ToString();
ReqHash["category"] = queryCategory.ToString();
ReqHash["name"] = queryName;
ReqHash["description"] = queryDescription;
ReqHash["parentestate"] = queryParentEstate.ToString();
ReqHash["snapshotUUID"] = querySnapshotID.ToString();
ReqHash["sim_name"] = remoteClient.Scene.RegionInfo.RegionName;
ReqHash["globalpos"] = queryGlobalPos.ToString();
ReqHash["classifiedFlags"] = queryclassifiedFlags.ToString();
ReqHash["classifiedPrice"] = queryclassifiedPrice.ToString();
ScenePresence p = FindPresence(remoteClient.AgentId);
string serverURI = string.Empty;
GetUserProfileServerURI(remoteClient.AgentId, out serverURI);
Vector3 avaPos = p.AbsolutePosition;
// Getting the parceluuid for this parcel
ReqHash["parcelUUID"] = p.currentParcelUUID.ToString();
// Getting the global position for the Avatar
Vector3 posGlobal = new Vector3(remoteClient.Scene.RegionInfo.RegionLocX * Constants.RegionSize + avaPos.X,
remoteClient.Scene.RegionInfo.RegionLocY * Constants.RegionSize + avaPos.Y,
avaPos.Z);
ReqHash["pos_global"] = posGlobal.ToString();
//Check available funds if there is a money module present
IMoneyModule money = s.RequestModuleInterface<IMoneyModule>();
if (money != null)
{
if (!money.AmountCovered(remoteClient.AgentId, queryclassifiedPrice))
{
remoteClient.SendCreateGroupReply(UUID.Zero, false, "Insufficient funds to create a classified ad.");
return;
}
}
Hashtable result = GenericXMLRPCRequest(ReqHash,
"classified_update", serverURI);
if (!Convert.ToBoolean(result["success"]))
{
remoteClient.SendAgentAlertMessage(
result["errorMessage"].ToString(), false);
return;
}
if (money != null && Convert.ToBoolean(result["created"]))
{
money.ApplyCharge(remoteClient.AgentId, queryclassifiedPrice,
MoneyTransactionType.ClassifiedCharge,
queryName);
}
}