Merge branch 'master' into varregion
commit
86bf79aa2b
|
@ -30,7 +30,7 @@ using Mono.Addins;
|
|||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("0.7.6.*")]
|
||||
[assembly: AssemblyVersion("0.8.0.*")]
|
||||
|
||||
[assembly: Addin("OpenSim.Groups", "0.1")]
|
||||
[assembly: AddinDependency("OpenSim", "0.5")]
|
||||
|
|
|
@ -30,7 +30,7 @@ using Mono.Addins;
|
|||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("0.7.6.*")]
|
||||
[assembly: AssemblyVersion("0.8.0.*")]
|
||||
|
||||
[assembly: Addin("OpenSim.OfflineIM", "0.1")]
|
||||
[assembly: AddinDependency("OpenSim", "0.5")]
|
||||
|
|
|
@ -62,4 +62,4 @@ using System.Runtime.InteropServices;
|
|||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("0.7.6.*")]
|
||||
|
||||
[assembly : AssemblyVersion("0.7.6.*")]
|
||||
[assembly : AssemblyVersion("0.8.0.*")]
|
||||
|
|
|
@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
|
|||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("0.7.6.*")]
|
||||
[assembly: AssemblyVersion("0.8.0.*")]
|
||||
|
||||
|
|
|
@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
|
|||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("0.7.6.*")]
|
||||
[assembly: AssemblyVersion("0.8.0.*")]
|
||||
|
||||
|
|
|
@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
|
|||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("0.7.6.*")]
|
||||
[assembly: AssemblyVersion("0.8.0.*")]
|
||||
|
||||
|
|
|
@ -61,5 +61,5 @@ using System.Runtime.InteropServices;
|
|||
// You can specify all the values or you can default the Revision and Build Numbers
|
||||
// by using the '*' as shown below:
|
||||
|
||||
[assembly : AssemblyVersion("0.7.6.*")]
|
||||
[assembly : AssemblyVersion("0.8.0.*")]
|
||||
|
||||
|
|
|
@ -61,5 +61,5 @@ using System.Runtime.InteropServices;
|
|||
// You can specify all the values or you can default the Revision and Build Numbers
|
||||
// by using the '*' as shown below:
|
||||
|
||||
[assembly : AssemblyVersion("0.7.6.*")]
|
||||
[assembly : AssemblyVersion("0.8.0.*")]
|
||||
|
||||
|
|
|
@ -61,5 +61,5 @@ using System.Runtime.InteropServices;
|
|||
// You can specify all the values or you can default the Revision and Build Numbers
|
||||
// by using the '*' as shown below:
|
||||
|
||||
[assembly : AssemblyVersion("0.7.6.*")]
|
||||
[assembly : AssemblyVersion("0.8.0.*")]
|
||||
|
||||
|
|
|
@ -61,5 +61,5 @@ using System.Runtime.InteropServices;
|
|||
// You can specify all the values or you can default the Revision and Build Numbers
|
||||
// by using the '*' as shown below:
|
||||
|
||||
[assembly : AssemblyVersion("0.7.6.*")]
|
||||
[assembly : AssemblyVersion("0.8.0.*")]
|
||||
|
||||
|
|
|
@ -61,5 +61,5 @@ using System.Runtime.InteropServices;
|
|||
// You can specify all the values or you can default the Revision and Build Numbers
|
||||
// by using the '*' as shown below:
|
||||
|
||||
[assembly : AssemblyVersion("0.7.6.*")]
|
||||
[assembly : AssemblyVersion("0.8.0.*")]
|
||||
|
||||
|
|
|
@ -59,4 +59,4 @@ using System.Runtime.InteropServices;
|
|||
// Revision
|
||||
//
|
||||
|
||||
[assembly : AssemblyVersion("0.7.6.*")]
|
||||
[assembly : AssemblyVersion("0.8.0.*")]
|
||||
|
|
|
@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
|
|||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("0.7.6.*")]
|
||||
[assembly: AssemblyVersion("0.8.0.*")]
|
||||
|
||||
|
|
|
@ -61,5 +61,5 @@ using System.Runtime.InteropServices;
|
|||
// You can specify all the values or you can default the Revision and Build Numbers
|
||||
// by using the '*' as shown below:
|
||||
|
||||
[assembly : AssemblyVersion("0.7.6.*")]
|
||||
[assembly : AssemblyVersion("0.8.0.*")]
|
||||
|
||||
|
|
|
@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
|
|||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("0.7.6.*")]
|
||||
[assembly: AssemblyVersion("0.8.0.*")]
|
||||
|
||||
|
|
|
@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
|
|||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("0.7.6.*")]
|
||||
[assembly: AssemblyVersion("0.8.0.*")]
|
||||
|
||||
|
|
|
@ -55,4 +55,4 @@ using System.Runtime.InteropServices;
|
|||
// You can specify all values by your own or you can build default build and revision
|
||||
// numbers with the '*' character (the default):
|
||||
|
||||
[assembly : AssemblyVersion("0.7.6.*")]
|
||||
[assembly : AssemblyVersion("0.8.0.*")]
|
||||
|
|
|
@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
|
|||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("0.7.6.*")]
|
||||
[assembly: AssemblyVersion("0.8.0.*")]
|
||||
|
||||
|
|
|
@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
|
|||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("0.7.6.*")]
|
||||
[assembly: AssemblyVersion("0.8.0.*")]
|
||||
|
||||
|
|
|
@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
|
|||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("0.7.6.*")]
|
||||
[assembly: AssemblyVersion("0.8.0.*")]
|
||||
|
||||
|
|
|
@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
|
|||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("0.7.6.*")]
|
||||
[assembly: AssemblyVersion("0.8.0.*")]
|
||||
|
||||
|
|
|
@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
|
|||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("0.7.6.*")]
|
||||
[assembly: AssemblyVersion("0.8.0.*")]
|
||||
|
||||
|
|
|
@ -28,8 +28,10 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Net;
|
||||
using System.Security.Cryptography;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using HttpServer;
|
||||
|
||||
namespace OpenSim.Framework.Servers.HttpServer
|
||||
|
@ -98,6 +100,8 @@ namespace OpenSim.Framework.Servers.HttpServer
|
|||
/// </summary>
|
||||
public ValidateHandshake HandshakeValidateMethodOverride = null;
|
||||
|
||||
private ManualResetEvent _receiveDone = new ManualResetEvent(false);
|
||||
|
||||
private OSHttpRequest _request;
|
||||
private HTTPNetworkContext _networkContext;
|
||||
private IHttpClientContext _clientContext;
|
||||
|
@ -109,6 +113,8 @@ namespace OpenSim.Framework.Servers.HttpServer
|
|||
private bool _closing;
|
||||
private bool _upgraded;
|
||||
private int _maxPayloadBytes = 41943040;
|
||||
private int _initialMsgTimeout = 0;
|
||||
private int _defaultReadTimeout = 10000;
|
||||
|
||||
private const string HandshakeAcceptText =
|
||||
"HTTP/1.1 101 Switching Protocols\r\n" +
|
||||
|
@ -131,6 +137,7 @@ namespace OpenSim.Framework.Servers.HttpServer
|
|||
{
|
||||
_request = preq;
|
||||
_networkContext = pContext.GiveMeTheNetworkStreamIKnowWhatImDoing();
|
||||
_networkContext.Stream.ReadTimeout = _defaultReadTimeout;
|
||||
_clientContext = pContext;
|
||||
_bufferLength = bufferlen;
|
||||
_buffer = new byte[_bufferLength];
|
||||
|
@ -205,6 +212,16 @@ namespace OpenSim.Framework.Servers.HttpServer
|
|||
set { _maxPayloadBytes = value; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Set this to the maximum amount of milliseconds to wait for the first complete message to be sent or received on the websocket after upgrading
|
||||
/// Default, it waits forever. Use this when your Websocket consuming code opens a connection and waits for a message from the other side to avoid a Denial of Service vector.
|
||||
/// </summary>
|
||||
public int InitialMsgTimeout
|
||||
{
|
||||
get { return _initialMsgTimeout; }
|
||||
set { _initialMsgTimeout = value; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This triggers the websocket start the upgrade process
|
||||
/// </summary>
|
||||
|
@ -245,6 +262,7 @@ namespace OpenSim.Framework.Servers.HttpServer
|
|||
string rawaccept = string.Format(HandshakeAcceptText, acceptKey);
|
||||
SendUpgradeSuccess(rawaccept);
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -258,6 +276,10 @@ namespace OpenSim.Framework.Servers.HttpServer
|
|||
SendUpgradeSuccess(rawaccept);
|
||||
}
|
||||
}
|
||||
public IPEndPoint GetRemoteIPEndpoint()
|
||||
{
|
||||
return _request.RemoteIPEndPoint;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Generates a handshake response key string based on the client's
|
||||
|
@ -290,9 +312,16 @@ namespace OpenSim.Framework.Servers.HttpServer
|
|||
WebSocketState socketState = new WebSocketState() { ReceivedBytes = new List<byte>(), Header = WebsocketFrameHeader.HeaderDefault(), FrameComplete = true};
|
||||
|
||||
byte[] bhandshakeResponse = Encoding.UTF8.GetBytes(pHandshakeResponse);
|
||||
|
||||
|
||||
|
||||
|
||||
try
|
||||
{
|
||||
|
||||
if (_initialMsgTimeout > 0)
|
||||
{
|
||||
_receiveDone.Reset();
|
||||
}
|
||||
// Begin reading the TCP stream before writing the Upgrade success message to the other side of the stream.
|
||||
_networkContext.Stream.BeginRead(_buffer, 0, _bufferLength, OnReceive, socketState);
|
||||
|
||||
|
@ -303,6 +332,11 @@ namespace OpenSim.Framework.Servers.HttpServer
|
|||
UpgradeCompletedDelegate d = OnUpgradeCompleted;
|
||||
if (d != null)
|
||||
d(this, new UpgradeCompletedEventArgs());
|
||||
if (_initialMsgTimeout > 0)
|
||||
{
|
||||
if (!_receiveDone.WaitOne(TimeSpan.FromMilliseconds(_initialMsgTimeout)))
|
||||
Close(string.Empty);
|
||||
}
|
||||
}
|
||||
catch (IOException)
|
||||
{
|
||||
|
@ -489,6 +523,11 @@ namespace OpenSim.Framework.Servers.HttpServer
|
|||
/// <param name="message">the string message that is to be sent</param>
|
||||
public void SendMessage(string message)
|
||||
{
|
||||
if (_initialMsgTimeout > 0)
|
||||
{
|
||||
_receiveDone.Set();
|
||||
_initialMsgTimeout = 0;
|
||||
}
|
||||
byte[] messagedata = Encoding.UTF8.GetBytes(message);
|
||||
WebSocketFrame textMessageFrame = new WebSocketFrame() { Header = WebsocketFrameHeader.HeaderDefault(), WebSocketPayload = messagedata };
|
||||
textMessageFrame.Header.Opcode = WebSocketReader.OpCode.Text;
|
||||
|
@ -499,6 +538,11 @@ namespace OpenSim.Framework.Servers.HttpServer
|
|||
|
||||
public void SendData(byte[] data)
|
||||
{
|
||||
if (_initialMsgTimeout > 0)
|
||||
{
|
||||
_receiveDone.Set();
|
||||
_initialMsgTimeout = 0;
|
||||
}
|
||||
WebSocketFrame dataMessageFrame = new WebSocketFrame() { Header = WebsocketFrameHeader.HeaderDefault(), WebSocketPayload = data};
|
||||
dataMessageFrame.Header.IsEnd = true;
|
||||
dataMessageFrame.Header.Opcode = WebSocketReader.OpCode.Binary;
|
||||
|
@ -531,6 +575,11 @@ namespace OpenSim.Framework.Servers.HttpServer
|
|||
/// </summary>
|
||||
public void SendPingCheck()
|
||||
{
|
||||
if (_initialMsgTimeout > 0)
|
||||
{
|
||||
_receiveDone.Set();
|
||||
_initialMsgTimeout = 0;
|
||||
}
|
||||
WebSocketFrame pingFrame = new WebSocketFrame() { Header = WebsocketFrameHeader.HeaderDefault(), WebSocketPayload = new byte[0] };
|
||||
pingFrame.Header.Opcode = WebSocketReader.OpCode.Ping;
|
||||
pingFrame.Header.IsEnd = true;
|
||||
|
@ -544,6 +593,11 @@ namespace OpenSim.Framework.Servers.HttpServer
|
|||
/// <param name="message"></param>
|
||||
public void Close(string message)
|
||||
{
|
||||
if (_initialMsgTimeout > 0)
|
||||
{
|
||||
_receiveDone.Set();
|
||||
_initialMsgTimeout = 0;
|
||||
}
|
||||
if (_networkContext == null)
|
||||
return;
|
||||
if (_networkContext.Stream != null)
|
||||
|
@ -583,7 +637,11 @@ namespace OpenSim.Framework.Servers.HttpServer
|
|||
WebSocketReader.Mask(psocketState.Header.Mask, unmask);
|
||||
psocketState.ReceivedBytes = new List<byte>(unmask);
|
||||
}
|
||||
|
||||
if (psocketState.Header.Opcode != WebSocketReader.OpCode.Continue && _initialMsgTimeout > 0)
|
||||
{
|
||||
_receiveDone.Set();
|
||||
_initialMsgTimeout = 0;
|
||||
}
|
||||
switch (psocketState.Header.Opcode)
|
||||
{
|
||||
case WebSocketReader.OpCode.Ping:
|
||||
|
@ -696,6 +754,11 @@ namespace OpenSim.Framework.Servers.HttpServer
|
|||
}
|
||||
public void Dispose()
|
||||
{
|
||||
if (_initialMsgTimeout > 0)
|
||||
{
|
||||
_receiveDone.Set();
|
||||
_initialMsgTimeout = 0;
|
||||
}
|
||||
if (_networkContext != null && _networkContext.Stream != null)
|
||||
{
|
||||
if (_networkContext.Stream.CanWrite)
|
||||
|
|
|
@ -29,7 +29,7 @@ namespace OpenSim
|
|||
{
|
||||
public class VersionInfo
|
||||
{
|
||||
private const string VERSION_NUMBER = "0.7.6";
|
||||
private const string VERSION_NUMBER = "0.8.0";
|
||||
private const Flavour VERSION_FLAVOUR = Flavour.Dev;
|
||||
|
||||
public enum Flavour
|
||||
|
|
|
@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
|
|||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("0.7.6.*")]
|
||||
[assembly: AssemblyVersion("0.8.0.*")]
|
||||
|
||||
|
|
|
@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
|
|||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("0.7.6.*")]
|
||||
[assembly: AssemblyVersion("0.8.0.*")]
|
||||
|
||||
|
|
|
@ -32,6 +32,7 @@ using log4net;
|
|||
using Nini.Config;
|
||||
using Mono.Addins;
|
||||
using OpenMetaverse;
|
||||
using OpenMetaverse.StructuredData;
|
||||
using OpenSim.Framework;
|
||||
using OpenSim.Region.Framework.Interfaces;
|
||||
using OpenSim.Region.Framework.Scenes;
|
||||
|
@ -94,6 +95,14 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
|
|||
|
||||
public virtual void RegionLoaded(Scene scene)
|
||||
{
|
||||
if (!m_enabled)
|
||||
return;
|
||||
|
||||
ISimulatorFeaturesModule featuresModule = scene.RequestModuleInterface<ISimulatorFeaturesModule>();
|
||||
|
||||
if (featuresModule != null)
|
||||
featuresModule.OnSimulatorFeaturesRequest += OnSimulatorFeaturesRequest;
|
||||
|
||||
}
|
||||
|
||||
public virtual void RemoveRegion(Scene scene)
|
||||
|
@ -351,5 +360,33 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
|
|||
|
||||
return true;
|
||||
}
|
||||
|
||||
#region SimulatorFeaturesRequest
|
||||
|
||||
static OSDInteger m_SayRange, m_WhisperRange, m_ShoutRange;
|
||||
|
||||
private void OnSimulatorFeaturesRequest(UUID agentID, ref OSDMap features)
|
||||
{
|
||||
OSD extras = new OSDMap();
|
||||
if (features.ContainsKey("OpenSimExtras"))
|
||||
extras = features["OpenSimExtras"];
|
||||
else
|
||||
features["OpenSimExtras"] = extras;
|
||||
|
||||
if (m_SayRange == null)
|
||||
{
|
||||
// Do this only once
|
||||
m_SayRange = new OSDInteger(m_saydistance);
|
||||
m_WhisperRange = new OSDInteger(m_whisperdistance);
|
||||
m_ShoutRange = new OSDInteger(m_shoutdistance);
|
||||
}
|
||||
|
||||
((OSDMap)extras)["say-range"] = m_SayRange;
|
||||
((OSDMap)extras)["whisper-range"] = m_WhisperRange;
|
||||
((OSDMap)extras)["shout-range"] = m_ShoutRange;
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
|
@ -30,7 +30,7 @@ using Mono.Addins;
|
|||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("0.7.6.*")]
|
||||
[assembly: AssemblyVersion("0.8.0.*")]
|
||||
|
||||
|
||||
[assembly: Addin("OpenSim.Region.CoreModules", "0.1")]
|
||||
|
|
|
@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
|
|||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("0.7.6.*")]
|
||||
[assembly: AssemblyVersion("0.8.0.*")]
|
||||
|
||||
|
|
|
@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
|
|||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("0.7.6.*")]
|
||||
[assembly: AssemblyVersion("0.8.0.*")]
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@ using Mono.Addins;
|
|||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("0.7.6.*")]
|
||||
[assembly: AssemblyVersion("0.8.0.*")]
|
||||
|
||||
|
||||
[assembly: Addin("OpenSim.Region.OptionalModules", "0.1")]
|
||||
|
|
|
@ -44,6 +44,20 @@ namespace OpenSim.Region.OptionalModules.World.NPC
|
|||
{
|
||||
public bool SenseAsAgent { get; set; }
|
||||
|
||||
public delegate void ChatToNPC(
|
||||
string message, byte type, Vector3 fromPos, string fromName,
|
||||
UUID fromAgentID, UUID ownerID, byte source, byte audible);
|
||||
|
||||
/// <summary>
|
||||
/// Fired when the NPC receives a chat message.
|
||||
/// </summary>
|
||||
public event ChatToNPC OnChatToNPC;
|
||||
|
||||
/// <summary>
|
||||
/// Fired when the NPC receives an instant message.
|
||||
/// </summary>
|
||||
public event Action<GridInstantMessage> OnInstantMessageToNPC;
|
||||
|
||||
private readonly string m_firstname;
|
||||
private readonly string m_lastname;
|
||||
private readonly Vector3 m_startPos;
|
||||
|
@ -614,17 +628,18 @@ namespace OpenSim.Region.OptionalModules.World.NPC
|
|||
string message, byte type, Vector3 fromPos, string fromName,
|
||||
UUID fromAgentID, UUID ownerID, byte source, byte audible)
|
||||
{
|
||||
}
|
||||
ChatToNPC ctn = OnChatToNPC;
|
||||
|
||||
public virtual void SendChatMessage(
|
||||
byte[] message, byte type, Vector3 fromPos, string fromName,
|
||||
UUID fromAgentID, UUID ownerID, byte source, byte audible)
|
||||
{
|
||||
if (ctn != null)
|
||||
ctn(message, type, fromPos, fromName, fromAgentID, ownerID, source, audible);
|
||||
}
|
||||
|
||||
public void SendInstantMessage(GridInstantMessage im)
|
||||
{
|
||||
|
||||
Action<GridInstantMessage> oimtn = OnInstantMessageToNPC;
|
||||
|
||||
if (oimtn != null)
|
||||
oimtn(im);
|
||||
}
|
||||
|
||||
public void SendGenericMessage(string method, UUID invoice, List<string> message)
|
||||
|
|
|
@ -55,4 +55,4 @@ using System.Runtime.InteropServices;
|
|||
// You can specify all values by your own or you can build default build and revision
|
||||
// numbers with the '*' character (the default):
|
||||
|
||||
[assembly : AssemblyVersion("0.7.6.*")]
|
||||
[assembly : AssemblyVersion("0.8.0.*")]
|
||||
|
|
|
@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
|
|||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("0.7.6.*")]
|
||||
[assembly: AssemblyVersion("0.8.0.*")]
|
||||
|
||||
|
|
|
@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
|
|||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("0.7.6.*")]
|
||||
[assembly: AssemblyVersion("0.8.0.*")]
|
||||
|
||||
|
|
|
@ -55,4 +55,4 @@ using System.Runtime.InteropServices;
|
|||
// You can specify all values by your own or you can build default build and revision
|
||||
// numbers with the '*' character (the default):
|
||||
|
||||
[assembly : AssemblyVersion("0.7.6.*")]
|
||||
[assembly : AssemblyVersion("0.8.0.*")]
|
||||
|
|
|
@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
|
|||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("0.7.6.*")]
|
||||
[assembly: AssemblyVersion("0.8.0.*")]
|
||||
|
||||
|
|
|
@ -55,4 +55,4 @@ using System.Runtime.InteropServices;
|
|||
// You can specify all values by your own or you can build default build and revision
|
||||
// numbers with the '*' character (the default):
|
||||
|
||||
[assembly : AssemblyVersion("0.7.6.*")]
|
||||
[assembly : AssemblyVersion("0.8.0.*")]
|
||||
|
|
|
@ -55,4 +55,4 @@ using System.Runtime.InteropServices;
|
|||
// You can specify all values by your own or you can build default build and revision
|
||||
// numbers with the '*' character (the default):
|
||||
|
||||
[assembly : AssemblyVersion("0.7.6.*")]
|
||||
[assembly : AssemblyVersion("0.8.0.*")]
|
||||
|
|
|
@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
|
|||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("0.7.6.*")]
|
||||
[assembly: AssemblyVersion("0.8.0.*")]
|
||||
|
||||
|
|
|
@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
|
|||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("0.7.6.*")]
|
||||
[assembly: AssemblyVersion("0.8.0.*")]
|
||||
|
||||
|
|
|
@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
|
|||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("0.7.6.*")]
|
||||
[assembly: AssemblyVersion("0.8.0.*")]
|
||||
|
||||
|
|
|
@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
|
|||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("0.7.6.*")]
|
||||
[assembly: AssemblyVersion("0.8.0.*")]
|
||||
|
||||
|
|
|
@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
|
|||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("0.7.6.*")]
|
||||
[assembly: AssemblyVersion("0.8.0.*")]
|
||||
|
||||
|
|
|
@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
|
|||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("0.7.6.*")]
|
||||
[assembly: AssemblyVersion("0.8.0.*")]
|
||||
|
||||
|
|
|
@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
|
|||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("0.7.6.*")]
|
||||
[assembly: AssemblyVersion("0.8.0.*")]
|
||||
|
||||
|
|
|
@ -53,6 +53,7 @@ namespace OpenSim.Server.Handlers.Login
|
|||
|
||||
private ILoginService m_LocalService;
|
||||
private bool m_Proxy;
|
||||
|
||||
|
||||
public LLLoginHandlers(ILoginService service, bool hasProxy)
|
||||
{
|
||||
|
@ -213,6 +214,61 @@ namespace OpenSim.Server.Handlers.Login
|
|||
return FailedOSDResponse();
|
||||
}
|
||||
|
||||
public void HandleWebSocketLoginEvents(string path, WebSocketHttpServerHandler sock)
|
||||
{
|
||||
sock.MaxPayloadSize = 16384; //16 kb payload
|
||||
sock.InitialMsgTimeout = 5000; //5 second first message to trigger at least one of these events
|
||||
sock.NoDelay_TCP_Nagle = true;
|
||||
sock.OnData += delegate(object sender, WebsocketDataEventArgs data) { sock.Close("fail"); };
|
||||
sock.OnPing += delegate(object sender, PingEventArgs pingdata) { sock.Close("fail"); };
|
||||
sock.OnPong += delegate(object sender, PongEventArgs pongdata) { sock.Close("fail"); };
|
||||
sock.OnText += delegate(object sender, WebsocketTextEventArgs text)
|
||||
{
|
||||
OSD request = null;
|
||||
try
|
||||
{
|
||||
request = OSDParser.DeserializeJson(text.Data);
|
||||
if (!(request is OSDMap))
|
||||
{
|
||||
sock.SendMessage(OSDParser.SerializeJsonString(FailedOSDResponse()));
|
||||
}
|
||||
else
|
||||
{
|
||||
OSDMap req = request as OSDMap;
|
||||
string first = req["firstname"].AsString();
|
||||
string last = req["lastname"].AsString();
|
||||
string passwd = req["passwd"].AsString();
|
||||
string start = req["startlocation"].AsString();
|
||||
string version = req["version"].AsString();
|
||||
string channel = req["channel"].AsString();
|
||||
string mac = req["mac"].AsString();
|
||||
string id0 = req["id0"].AsString();
|
||||
UUID scope = UUID.Zero;
|
||||
IPEndPoint endPoint =
|
||||
(sender as WebSocketHttpServerHandler).GetRemoteIPEndpoint();
|
||||
LoginResponse reply = null;
|
||||
reply = m_LocalService.Login(first, last, passwd, start, scope, version,
|
||||
channel, mac, id0, endPoint);
|
||||
sock.SendMessage(OSDParser.SerializeJsonString(reply.ToOSDMap()));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
sock.SendMessage(OSDParser.SerializeJsonString(FailedOSDResponse()));
|
||||
}
|
||||
finally
|
||||
{
|
||||
sock.Close("success");
|
||||
}
|
||||
};
|
||||
|
||||
sock.HandshakeAndUpgrade();
|
||||
|
||||
}
|
||||
|
||||
|
||||
private XmlRpcResponse FailedXMLRPCResponse()
|
||||
{
|
||||
Hashtable hash = new Hashtable();
|
||||
|
|
|
@ -98,6 +98,7 @@ namespace OpenSim.Server.Handlers.Login
|
|||
server.AddXmlRPCHandler("login_to_simulator", loginHandlers.HandleXMLRPCLogin, false);
|
||||
server.AddXmlRPCHandler("set_login_level", loginHandlers.HandleXMLRPCSetLoginLevel, false);
|
||||
server.SetDefaultLLSDHandler(loginHandlers.HandleLLSDLogin);
|
||||
server.AddWebSocketHandler("/WebSocket/GridLogin", loginHandlers.HandleWebSocketLoginEvents);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
|
|||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("0.7.6.*")]
|
||||
[assembly: AssemblyVersion("0.8.0.*")]
|
||||
|
||||
|
|
|
@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
|
|||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("0.7.6.*")]
|
||||
[assembly: AssemblyVersion("0.8.0.*")]
|
||||
|
||||
|
|
|
@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
|
|||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("0.7.6.*")]
|
||||
[assembly: AssemblyVersion("0.8.0.*")]
|
||||
|
||||
|
|
|
@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
|
|||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("0.7.6.*")]
|
||||
[assembly: AssemblyVersion("0.8.0.*")]
|
||||
|
||||
|
|
|
@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
|
|||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("0.7.6.*")]
|
||||
[assembly: AssemblyVersion("0.8.0.*")]
|
||||
|
||||
|
|
|
@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
|
|||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("0.7.6.*")]
|
||||
[assembly: AssemblyVersion("0.8.0.*")]
|
||||
|
||||
|
|
|
@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
|
|||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("0.7.6.*")]
|
||||
[assembly: AssemblyVersion("0.8.0.*")]
|
||||
|
||||
|
|
|
@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
|
|||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("0.7.6.*")]
|
||||
[assembly: AssemblyVersion("0.8.0.*")]
|
||||
|
||||
|
|
|
@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
|
|||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("0.7.6.*")]
|
||||
[assembly: AssemblyVersion("0.8.0.*")]
|
||||
|
||||
|
|
|
@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
|
|||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("0.7.6.*")]
|
||||
[assembly: AssemblyVersion("0.8.0.*")]
|
||||
|
||||
|
|
|
@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
|
|||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("0.7.6.*")]
|
||||
[assembly: AssemblyVersion("0.8.0.*")]
|
||||
|
||||
|
|
|
@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
|
|||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("0.7.6.*")]
|
||||
[assembly: AssemblyVersion("0.8.0.*")]
|
||||
|
||||
|
|
|
@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
|
|||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("0.7.6.*")]
|
||||
[assembly: AssemblyVersion("0.8.0.*")]
|
||||
|
||||
|
|
|
@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
|
|||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("0.7.6.*")]
|
||||
[assembly: AssemblyVersion("0.8.0.*")]
|
||||
|
||||
|
|
|
@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
|
|||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("0.7.6.*")]
|
||||
[assembly: AssemblyVersion("0.8.0.*")]
|
||||
|
||||
|
|
|
@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
|
|||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("0.7.6.*")]
|
||||
[assembly: AssemblyVersion("0.8.0.*")]
|
||||
|
||||
|
|
|
@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
|
|||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("0.7.6.*")]
|
||||
[assembly: AssemblyVersion("0.8.0.*")]
|
||||
|
||||
|
|
|
@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
|
|||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("0.7.6.*")]
|
||||
[assembly: AssemblyVersion("0.8.0.*")]
|
||||
|
||||
|
|
|
@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
|
|||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("0.7.6.*")]
|
||||
[assembly: AssemblyVersion("0.8.0.*")]
|
||||
|
||||
|
|
|
@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
|
|||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("0.7.6.*")]
|
||||
[assembly: AssemblyVersion("0.8.0.*")]
|
||||
|
||||
|
|
Loading…
Reference in New Issue