本文整理汇总了C#中IClientAPI.SendTerminateFriend方法的典型用法代码示例。如果您正苦于以下问题:C# IClientAPI.SendTerminateFriend方法的具体用法?C# IClientAPI.SendTerminateFriend怎么用?C# IClientAPI.SendTerminateFriend使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IClientAPI
的用法示例。
在下文中一共展示了IClientAPI.SendTerminateFriend方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnTerminateFriendship
private void OnTerminateFriendship(IClientAPI client, UUID agentID, UUID exfriendID)
{
FriendsService.Delete(agentID, exfriendID.ToString());
FriendsService.Delete(exfriendID, agentID.ToString());
// Update local cache
m_Friends[agentID].Friends = FriendsService.GetFriends(agentID);
client.SendTerminateFriend(exfriendID);
//
// Notify the friend
//
// Try local
if (LocalFriendshipTerminated(exfriendID))
return;
PresenceInfo[] friendSessions = PresenceService.GetAgents(new string[] { exfriendID.ToString() });
PresenceInfo friendSession = PresenceInfo.GetOnlinePresence(friendSessions);
if (friendSession != null)
{
GridRegion region = GridService.GetRegionByUUID(m_Scenes[0].RegionInfo.ScopeID, friendSession.RegionID);
m_FriendsSimConnector.FriendshipTerminated(region, agentID, exfriendID);
}
}
示例2: OnTerminateFriendship
private void OnTerminateFriendship(IClientAPI client, UUID agentID, UUID exfriendID)
{
FriendsService.Delete(agentID, exfriendID.ToString());
FriendsService.Delete(exfriendID, agentID.ToString());
// Update local cache
UpdateFriendsCache(agentID);
client.SendTerminateFriend(exfriendID);
//
// Notify the friend
//
// Try local
if (LocalFriendshipTerminated(exfriendID, agentID))
return;
SyncMessagePosterService.Post(SyncMessageHelper.FriendTerminated(
agentID, exfriendID, m_Scenes[0].RegionInfo.RegionHandle), m_Scenes[0].RegionInfo.RegionHandle);
}
示例3: RemoveFriendship
public void RemoveFriendship(IClientAPI client, UUID exfriendID)
{
if (!DeleteFriendship(client.AgentId, exfriendID))
client.SendAlertMessage("Unable to terminate friendship on this sim.");
// Update local cache
RecacheFriends(client);
client.SendTerminateFriend(exfriendID);
//
// Notify the friend
//
// Try local
if (LocalFriendshipTerminated(exfriendID))
return;
PresenceInfo[] friendSessions = PresenceService.GetAgents(new string[] { exfriendID.ToString() });
if (friendSessions != null && friendSessions.Length > 0)
{
PresenceInfo friendSession = friendSessions[0];
if (friendSession != null)
{
GridRegion region = GridService.GetRegionByUUID(m_Scenes[0].RegionInfo.ScopeID, friendSession.RegionID);
m_FriendsSimConnector.FriendshipTerminated(region, client.AgentId, exfriendID);
}
}
}
示例4: OnTerminateFriendship
private void OnTerminateFriendship(IClientAPI client, UUID agentID, UUID exfriendID)
{
// client.AgentId == agentID!
// this removes the friends from the stored friendlists. After the next login, they will be gone...
m_initialScene.StoreRemoveFriendship(agentID, exfriendID);
// ... now tell the two involved clients that they aren't friends anymore.
// I don't know why we have to tell <agent>, as this was caused by her, but that's how it works in SL...
client.SendTerminateFriend(exfriendID);
// now send the friend, if online
ScenePresence presence = GetAnyPresenceFromAgentID(exfriendID);
if (presence != null)
{
m_log.DebugFormat("[FRIEND]: Sending terminate friend {0} to agent {1}", agentID, exfriendID);
presence.ControllingClient.SendTerminateFriend(agentID);
}
else
{
// retry 3 times, in case the agent TPed from the last known region...
for (int retry = 0; retry < 3; ++retry)
{
// wasn't sent, so ex-friend wasn't around on this region-server. Fetch info and try to send
UserAgentData data = m_initialScene.CommsManager.UserService.GetAgentByUUID(exfriendID);
if (null == data)
break;
if (!data.AgentOnline)
{
m_log.DebugFormat("[FRIEND]: {0} is offline, so not sending TerminateFriend", exfriendID);
break; // if ex-friend isn't online, we don't need to send
}
m_log.DebugFormat("[FRIEND]: Sending remote terminate friend {0} to agent {1}@{2}",
agentID, exfriendID, data.Handle);
// try to send to foreign region, retry if it fails (friend TPed away, for example)
if (TriggerTerminateFriend(data.Handle, exfriendID, agentID)) break;
}
}
// clean up cache: FriendList is wrong now...
lock (m_friendLists)
{
m_friendLists.Invalidate(agentID.ToString());
m_friendLists.Invalidate(exfriendID.ToString());
}
}
示例5: OnTerminateFriendship
private void OnTerminateFriendship(IClientAPI client, UUID agentID, UUID exfriendID)
{
FriendsService.Delete(agentID, exfriendID.ToString());
FriendsService.Delete(exfriendID, agentID.ToString());
// Update local cache
UpdateFriendsCache(agentID);
client.SendTerminateFriend(exfriendID);
//
// Notify the friend
//
// Try local
if (LocalFriendshipTerminated(exfriendID, agentID))
return;
UserInfo friendSession = m_Scenes[0].RequestModuleInterface<IAgentInfoService>().GetUserInfo(exfriendID.ToString());
if (friendSession != null && friendSession.IsOnline)
{
GridRegion region = GridService.GetRegionByUUID(m_Scenes[0].RegionInfo.ScopeID, friendSession.CurrentRegionID);
AsyncMessagePostService.Post(region.RegionHandle, SyncMessageHelper.FriendTerminated(
agentID, exfriendID, region.RegionHandle));
}
}