Added Pause and Resume to NetworkManager to request that the sim stops or resumes sending update (and possibly other) packets
git-svn-id: http://libopenmetaverse.googlecode.com/svn/trunk@2299 52acb1d6-8a22-11de-b505-999d5b087335
This commit is contained in:
@@ -283,6 +283,7 @@ namespace OpenMetaverse
|
||||
private uint _CircuitCode;
|
||||
private Simulator _CurrentSim = null;
|
||||
private bool connected = false;
|
||||
internal int pauseSerial;
|
||||
|
||||
/// <summary>
|
||||
/// Default constructor
|
||||
@@ -538,6 +539,32 @@ namespace OpenMetaverse
|
||||
OnLogoutReply -= callback;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Instructs the simulator to stop sending update (and possibly other) packets
|
||||
/// </summary>
|
||||
public void Pause()
|
||||
{
|
||||
AgentPausePacket pause = new AgentPausePacket();
|
||||
pause.AgentData.AgentID = Client.Self.AgentID;
|
||||
pause.AgentData.SessionID = Client.Self.SessionID;
|
||||
pause.AgentData.SerialNum = (uint)Interlocked.Exchange(ref pauseSerial, pauseSerial + 1);
|
||||
|
||||
Client.Network.SendPacket(pause);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Instructs the simulator to resume sending update packets (unpause)
|
||||
/// </summary>
|
||||
public void Resume()
|
||||
{
|
||||
AgentResumePacket resume = new AgentResumePacket();
|
||||
resume.AgentData.AgentID = Client.Self.AgentID;
|
||||
resume.AgentData.SessionID = Client.Self.SessionID;
|
||||
resume.AgentData.SerialNum = (uint)Interlocked.Exchange(ref pauseSerial, pauseSerial + 1);
|
||||
|
||||
Client.Network.SendPacket(resume);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initiate the logout process. Check if logout succeeded with the
|
||||
/// <code>OnLogoutReply</code> event, and if this does not fire the
|
||||
|
||||
Reference in New Issue
Block a user