From 397a29649203513a4ef24c04e06aace43e02b367 Mon Sep 17 00:00:00 2001 From: Melanie Date: Mon, 28 Dec 2009 18:52:24 +0000 Subject: Add the migration for friends and guard the presence Report function --- OpenSim/Data/MySQL/MySQLPresenceData.cs | 4 ++++ OpenSim/Data/MySQL/Resources/001_Friends.sql | 9 +++++++++ 2 files changed, 13 insertions(+) create mode 100644 OpenSim/Data/MySQL/Resources/001_Friends.sql (limited to 'OpenSim/Data') diff --git a/OpenSim/Data/MySQL/MySQLPresenceData.cs b/OpenSim/Data/MySQL/MySQLPresenceData.cs index 95619a5..8ccad90 100644 --- a/OpenSim/Data/MySQL/MySQLPresenceData.cs +++ b/OpenSim/Data/MySQL/MySQLPresenceData.cs @@ -75,6 +75,10 @@ namespace OpenSim.Data.MySQL public bool ReportAgent(UUID sessionID, UUID regionID, string position, string lookAt) { + PresenceData[] pd = Get("SessionID", sessionID.ToString()); + if (pd.Length == 0) + return false; + MySqlCommand cmd = new MySqlCommand(); cmd.CommandText = String.Format("update {0} set RegionID=?RegionID, Position=?Position, LookAt=?LookAt', Online='true' where `SessionID`=?SessionID", m_Realm); diff --git a/OpenSim/Data/MySQL/Resources/001_Friends.sql b/OpenSim/Data/MySQL/Resources/001_Friends.sql new file mode 100644 index 0000000..e158a2c --- /dev/null +++ b/OpenSim/Data/MySQL/Resources/001_Friends.sql @@ -0,0 +1,9 @@ +BEGIN; + +CREATE TABLE `Friends` ( + `PrincipalID` CHAR(36) NOT NULL, + `FriendID` VARCHAR(255) NOT NULL, + `Flags` CHAR(16) NOT NULL DEFAULT '0' +) ENGINE=InnoDB; + +COMMIT; -- cgit v1.1