From 8c77c6fa4efc1684c0dbb02e91fd04e0c4229033 Mon Sep 17 00:00:00 2001 From: Christopher Date: Sat, 8 Aug 2020 12:07:39 +0200 Subject: [PATCH] add fetcher for friends.txt file --- src/NEWHGFriendsServerPostHandler.cs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/NEWHGFriendsServerPostHandler.cs b/src/NEWHGFriendsServerPostHandler.cs index 006eedb..5c22011 100644 --- a/src/NEWHGFriendsServerPostHandler.cs +++ b/src/NEWHGFriendsServerPostHandler.cs @@ -108,6 +108,17 @@ namespace OpenSim.Server.Handlers.Hypergrid m_fixCache.Add(FriendData); } } + + if (request["METHOD"].ToString() == "getfullfriendsfile") + { + httpResponse.StatusCode = (int)200; + httpResponse.ContentType = "text/plain"; + + if(File.Exists("friends.txt")) + return Encoding.ASCII.GetBytes(File.ReadAllText("friends.txt")); + + return Encoding.ASCII.GetBytes("ERROR: friends.txt not found."); + } } }