Tweak presence handling and whip up a database connector and handler
for testign the new generic table handling0.6.8-post-fixes
parent
0cd3bf074a
commit
06ecdf1967
|
@ -32,11 +32,11 @@ using OpenSim.Framework;
|
|||
|
||||
namespace OpenSim.Data
|
||||
{
|
||||
public class PresenceData
|
||||
public struct PresenceData
|
||||
{
|
||||
public UUID UUID;
|
||||
public UUID currentRegion;
|
||||
public Dictionary<string, object> Data;
|
||||
public Dictionary<string, string> Data;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
@ -190,11 +190,13 @@ namespace OpenSim.Data.MySQL
|
|||
return DoQuery(cmd);
|
||||
}
|
||||
|
||||
public void Store(T row)
|
||||
public bool Store(T row)
|
||||
{
|
||||
MySqlCommand cmd = new MySqlCommand();
|
||||
|
||||
string query = "";
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -94,6 +94,33 @@ namespace OpenSim.Server.Handlers.Presence
|
|||
|
||||
byte[] Report(Dictionary<string, string> request)
|
||||
{
|
||||
PresenceInfo info = new PresenceInfo();
|
||||
info.Data = new Dictionary<string, string>();
|
||||
|
||||
if (request["PrincipalID"] == null || request["RegionID"] == null)
|
||||
return FailureResult();
|
||||
|
||||
if (!UUID.TryParse(request["PrincipalID"].ToString(),
|
||||
out info.PrincipalID))
|
||||
return FailureResult();
|
||||
|
||||
if (!UUID.TryParse(request["RegionID"].ToString(),
|
||||
out info.RegionID))
|
||||
return FailureResult();
|
||||
|
||||
foreach (KeyValuePair<string, string> kvp in request)
|
||||
{
|
||||
if (kvp.Key == "METHOD" ||
|
||||
kvp.Key == "PrincipalID" ||
|
||||
kvp.Key == "RegionID")
|
||||
continue;
|
||||
|
||||
info.Data[kvp.Key] = kvp.Value;
|
||||
}
|
||||
|
||||
if (m_PresenceService.Report(info))
|
||||
return SuccessResult();
|
||||
|
||||
return FailureResult();
|
||||
}
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@ namespace OpenSim.Services.Interfaces
|
|||
{
|
||||
public UUID PrincipalID;
|
||||
public UUID RegionID;
|
||||
public Dictionary<string, object> Data;
|
||||
public Dictionary<string, string> Data;
|
||||
}
|
||||
|
||||
public interface IPresenceService
|
||||
|
|
|
@ -52,6 +52,15 @@ namespace OpenSim.Services.PresenceService
|
|||
|
||||
public bool Report(PresenceInfo presence)
|
||||
{
|
||||
PresenceData p = new PresenceData();
|
||||
p.Data = new Dictionary<string, string>();
|
||||
|
||||
p.UUID = presence.PrincipalID;
|
||||
p.currentRegion = presence.RegionID;
|
||||
|
||||
foreach (KeyValuePair<string, string> kvp in presence.Data)
|
||||
p.Data[kvp.Key] = kvp.Value;
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue