diff --git a/Fuyu.Platform.Common/Hashing/EftHash.cs b/Fuyu.Platform.Common/Hashing/SimpleId.cs similarity index 94% rename from Fuyu.Platform.Common/Hashing/EftHash.cs rename to Fuyu.Platform.Common/Hashing/SimpleId.cs index 450fb746..7205f48d 100644 --- a/Fuyu.Platform.Common/Hashing/EftHash.cs +++ b/Fuyu.Platform.Common/Hashing/SimpleId.cs @@ -3,12 +3,12 @@ namespace Fuyu.Platform.Common.Hashing { - public static class EftHash + public static class SimpleId { private static readonly Random _random; private static readonly char[] _chars; - static EftHash() + static SimpleId() { _random = new Random(); diff --git a/Fuyu.Platform.Common/Http/FuyuServer.cs b/Fuyu.Platform.Common/Http/FuyuServer.cs deleted file mode 100644 index 9cd3b5d9..00000000 --- a/Fuyu.Platform.Common/Http/FuyuServer.cs +++ /dev/null @@ -1,82 +0,0 @@ -using System; -using System.Collections.Concurrent; -using System.Collections.Generic; -using System.Threading.Tasks; -using WebSocketSharp.Server; -using Fuyu.Platform.Common.IO; - -namespace Fuyu.Platform.Common.Http -{ - public class FuyuServer - { - private readonly HttpServer _httpv; - public readonly List Behaviours; - public readonly FuyuBehaviour OnError; - public readonly string Address; - public readonly string Name; - - public FuyuServer(string name, string address) - { - var uri = new Uri(address); - - Address = address; - Name = name; - - Behaviours = new List(); - - _httpv = new HttpServer(uri.Port); - _httpv.OnGet += OnRequest; - _httpv.OnPost += OnRequest; - _httpv.OnPut += OnRequest; - } - - private void OnRequest(object sender, HttpRequestEventArgs e) - { - var context = new FuyuContext(e.Request, e.Response); - - Terminal.WriteLine($"[{Name}] {context.Path}"); - - // NOTE: multi-threaded lookup - var matches = new ConcurrentBag(); - - Parallel.ForEach(Behaviours, (behaviour) => - { - if (behaviour.IsMatch(context)) - { - matches.Add(behaviour); - } - }); - - if (matches.Count == 0) - { - Terminal.WriteLine($"No match on path {context.Path}"); - context.Response.Close(); - return; - } - - // NOTE: do we want to support multi-matching? - if (matches.Count > 1) - { - Terminal.WriteLine($"Too many matches on path {context.Path}"); - context.Response.Close(); - return; - } - - foreach (var match in matches) - { - match.Run(context); - } - } - - public void Start() - { - _httpv.Start(); - Terminal.WriteLine($"[{Name}] Started on {Address}"); - } - - public void AddHttpService() where T : FuyuBehaviour, new() - { - Behaviours.Add(new T()); - } - } -} \ No newline at end of file diff --git a/Fuyu.Platform.Common/Models/EFT/Common/MongoId.cs b/Fuyu.Platform.Common/Models/EFT/Common/MongoId.cs new file mode 100644 index 00000000..baddc3d0 --- /dev/null +++ b/Fuyu.Platform.Common/Models/EFT/Common/MongoId.cs @@ -0,0 +1,212 @@ +using System; +using Newtonsoft.Json; + +namespace Fuyu.Platform.Common.Models.EFT.Common +{ + [Serializable] + public readonly struct MongoId : IComparable, IEquatable + { + private static readonly Random _random = new Random(); + private static readonly ulong _processId = Hash; + private static uint _newIdCounter; + private readonly uint _timeStamp; + private readonly ulong _counter; + + public static uint UnixTimestamp + { + get + { + var startTime = new DateTime(1970, 1, 1, 0, 0, 0, 0); + var currTime = DateTime.Now.ToUniversalTime() - startTime; + var result = Convert.ToUInt32(Math.Abs(currTime.TotalSeconds)); + return result; + } + } + + public static ulong Hash + { + get + { + return (ulong)(((long)_random.Next(0, int.MaxValue) << 8) ^ (long)_random.Next(0, int.MaxValue)); + } + } + + [JsonConstructor] + public MongoId([JsonProperty("$value")] string id) + { + if (id == null || id.Length != 24) + { + throw new ArgumentOutOfRangeException("Critical MongoId error: incorrect length. Id: " + id); + } + + _timeStamp = GetTimestamp(id); + _counter = GetCounter(id); + + GenerateNew(); + } + + public MongoId(bool newProcessId = true) + { + _timeStamp = 0U; + + if (newProcessId) + { + _counter = Hash << 24; + } + else + { + _newIdCounter += 1U; + _counter = (_processId << 24) + (ulong)_newIdCounter; + } + + _timeStamp = UnixTimestamp; + } + + public MongoId(int accountId) + { + _timeStamp = UnixTimestamp; + + var num = Convert.ToUInt32(accountId); + var num2 = Convert.ToUInt32(_random.Next(0, 16777215)); + + _counter = 4294967296UL | (ulong)num; + _counter <<= 24; + _counter |= (ulong)num2; + } + + public MongoId(MongoId source, int increment, bool newTimestamp = true) + { + _timeStamp = newTimestamp + ? UnixTimestamp + : source._timeStamp; + + _counter = (increment > 0) + ? (source._counter + (ulong)Convert.ToUInt32(increment)) + : (source._counter - (ulong)Convert.ToUInt32(Math.Abs(increment))); + } + + // smethod_1 + public static uint GetTimestamp(string id) + { + return Convert.ToUInt32(id.Substring(0, 8), 16); + } + + // smethod_2 + public static ulong GetCounter(string id) + { + return Convert.ToUInt64(id.Substring(8, 16), 16); + } + + // method_0 + public void GenerateNew() + { + var num = Convert.ToUInt64(_counter >> 24); + + if (_processId != num) + { + return; + } + + var num2 = Convert.ToUInt32(_counter << 40 >> 40); + _newIdCounter = Math.Max(_newIdCounter, num2); + } + + public bool Equals(MongoId other) + { + return _timeStamp == other._timeStamp + && _counter == other._counter; + } + + public int CompareTo(MongoId other) + { + if (this == other) + { + return 0; + } + + if (this > other) + { + return 1; + } + + return -1; + } + + public override string ToString() + { + return _timeStamp.ToString("X8").ToLower() + + _counter.ToString("X16").ToLower(); + } + + public override bool Equals(object obj) + { + if (obj != null) + { + if (obj is MongoId) + { + var mongoID = (MongoId)obj; + return mongoID == this; + } + + string text; + + if ((text = obj as string) != null) + { + return text == this.ToString(); + } + } + + return false; + } + + public override int GetHashCode() + { + var num = Convert.ToUInt32(_counter >> 32) * 3637U; + var num2 = Convert.ToUInt32(_counter << 32 >> 32) * 5807U; + + return (int)(_timeStamp ^ num ^ num2); + } + + public static implicit operator string(MongoId mongoId) + { + return mongoId.ToString(); + } + + public static implicit operator MongoId(string id) + { + return new MongoId(id); + } + + public static bool operator ==(MongoId a, MongoId b) + { + return a.Equals(b); + } + + public static bool operator !=(MongoId a, MongoId b) + { + return !a.Equals(b); + } + + public static bool operator >(MongoId a, MongoId b) + { + return a._timeStamp > b._timeStamp + || (a._timeStamp == b._timeStamp && a._counter > b._counter); + } + + public static bool operator <(MongoId a, MongoId b) + { + return a._timeStamp < b._timeStamp + || (a._timeStamp == b._timeStamp && a._counter < b._counter); + } + + public static bool operator >=(MongoId a, MongoId b) + { + return a == b || a > b; + } + + public static bool operator <=(MongoId a, MongoId b) + { + return a == b || a < b; + } + } +} \ No newline at end of file diff --git a/Fuyu.Platform.Common/Http/EFuyuSegment.cs b/Fuyu.Platform.Common/Networking/EFuyuPathSegment.cs similarity index 64% rename from Fuyu.Platform.Common/Http/EFuyuSegment.cs rename to Fuyu.Platform.Common/Networking/EFuyuPathSegment.cs index 6d04b875..0ae7b2f6 100644 --- a/Fuyu.Platform.Common/Http/EFuyuSegment.cs +++ b/Fuyu.Platform.Common/Networking/EFuyuPathSegment.cs @@ -1,4 +1,4 @@ -namespace Fuyu.Platform.Common.Http +namespace Fuyu.Platform.Common.Networking { public enum EFuyuSegment { diff --git a/Fuyu.Platform.Common/Http/FuyuBehaviour.cs b/Fuyu.Platform.Common/Networking/FuyuHttpBehaviour.cs similarity index 81% rename from Fuyu.Platform.Common/Http/FuyuBehaviour.cs rename to Fuyu.Platform.Common/Networking/FuyuHttpBehaviour.cs index 4b3ff86b..9479df4c 100644 --- a/Fuyu.Platform.Common/Http/FuyuBehaviour.cs +++ b/Fuyu.Platform.Common/Networking/FuyuHttpBehaviour.cs @@ -2,13 +2,13 @@ using System.Text; using Fuyu.Platform.Common.Compression; -namespace Fuyu.Platform.Common.Http +namespace Fuyu.Platform.Common.Networking { - public abstract class FuyuBehaviour + public abstract class FuyuHttpBehaviour { public readonly Dictionary Path; - public FuyuBehaviour(string path) + public FuyuHttpBehaviour(string path) { Path = InitializePath(path); } @@ -34,7 +34,7 @@ private static Dictionary InitializePath(string path) return result; } - public bool IsMatch(FuyuContext context) + public bool IsMatch(FuyuHttpContext context) { var segments = context.Path.Split('/'); var i = 0; @@ -59,9 +59,9 @@ public bool IsMatch(FuyuContext context) return true; } - public abstract void Run(FuyuContext context); + public abstract void Run(FuyuHttpContext context); - public static void Send(FuyuContext context, byte[] data, string mime, bool zipped = true) + public static void Send(FuyuHttpContext context, byte[] data, string mime, bool zipped = true) { var response = context.Response; @@ -85,13 +85,13 @@ public static void Send(FuyuContext context, byte[] data, string mime, bool zipp } } - public static void SendJson(FuyuContext context, string text, bool zipped = true) + public static void SendJson(FuyuHttpContext context, string text, bool zipped = true) { var data = Encoding.UTF8.GetBytes(text); Send(context, data, "application/json; charset=utf-8", zipped); } - public static void Close(FuyuContext context) + public static void Close(FuyuHttpContext context) { context.Response.Close(); } diff --git a/Fuyu.Platform.Common/Http/FuyuClient.cs b/Fuyu.Platform.Common/Networking/FuyuHttpClient.cs similarity index 96% rename from Fuyu.Platform.Common/Http/FuyuClient.cs rename to Fuyu.Platform.Common/Networking/FuyuHttpClient.cs index 691c836f..bf065a58 100644 --- a/Fuyu.Platform.Common/Http/FuyuClient.cs +++ b/Fuyu.Platform.Common/Networking/FuyuHttpClient.cs @@ -5,18 +5,18 @@ using System.Threading.Tasks; using Fuyu.Platform.Common.Compression; -namespace Fuyu.Platform.Common.Http +namespace Fuyu.Platform.Common.Networking { // NOTE: Don't dispose this, keep a reference for the lifetime of the // application. - public class FuyuClient : IDisposable + public class FuyuHttpClient : IDisposable { protected HttpClient Httpv; protected string Address; protected string Cookie; protected int Retries; - public FuyuClient(string address, string sessionId = "", int retries = 3) + public FuyuHttpClient(string address, string sessionId = "", int retries = 3) { Address = address; Cookie = $"PHPSESSID={sessionId}"; diff --git a/Fuyu.Platform.Common/Http/FuyuContext.cs b/Fuyu.Platform.Common/Networking/FuyuHttpContext.cs similarity index 88% rename from Fuyu.Platform.Common/Http/FuyuContext.cs rename to Fuyu.Platform.Common/Networking/FuyuHttpContext.cs index f265cf98..1054699c 100644 --- a/Fuyu.Platform.Common/Http/FuyuContext.cs +++ b/Fuyu.Platform.Common/Networking/FuyuHttpContext.cs @@ -5,15 +5,15 @@ using Fuyu.Platform.Common.Serialization; using WebSocketSharp.Net; -namespace Fuyu.Platform.Common.Http +namespace Fuyu.Platform.Common.Networking { - public class FuyuContext + public class FuyuHttpContext { public readonly HttpListenerRequest Request; public readonly HttpListenerResponse Response; public readonly string Path; - public FuyuContext(HttpListenerRequest request, HttpListenerResponse response) + public FuyuHttpContext(HttpListenerRequest request, HttpListenerResponse response) { Request = request; Response = response; @@ -32,7 +32,7 @@ private string GetPath() return path; } - public Dictionary GetParameters(FuyuBehaviour behaviour) + public Dictionary GetPathParameters(FuyuHttpBehaviour behaviour) { var result = new Dictionary(); var segments = Path.Split('/'); diff --git a/Fuyu.Platform.Common/Networking/FuyuHttpRouter.cs b/Fuyu.Platform.Common/Networking/FuyuHttpRouter.cs new file mode 100644 index 00000000..9bee4ab8 --- /dev/null +++ b/Fuyu.Platform.Common/Networking/FuyuHttpRouter.cs @@ -0,0 +1,52 @@ +using System; +using System.Collections.Concurrent; +using System.Collections.Generic; +using System.Threading.Tasks; + +namespace Fuyu.Platform.Common.Networking +{ + public class FuyuHttpRouter + { + public readonly List Behaviours; + + public FuyuHttpRouter() + { + Behaviours = new List(); + } + + public void Route(FuyuHttpContext context) + { + // NOTE: multi-threaded lookup + var matches = new ConcurrentBag(); + + Parallel.ForEach(Behaviours, (behaviour) => + { + if (behaviour.IsMatch(context)) + { + matches.Add(behaviour); + } + }); + + if (matches.Count == 0) + { + throw new Exception($"No match on path {context.Path}"); + } + + // NOTE: do we want to support multi-matching? + if (matches.Count > 1) + { + throw new Exception($"Too many matches on path {context.Path}"); + } + + foreach (var match in matches) + { + match.Run(context); + } + } + + public void AddService() where T : FuyuHttpBehaviour, new() + { + Behaviours.Add(new T()); + } + } +} \ No newline at end of file diff --git a/Fuyu.Platform.Common/Networking/FuyuServer.cs b/Fuyu.Platform.Common/Networking/FuyuServer.cs new file mode 100644 index 00000000..7b7ab7ed --- /dev/null +++ b/Fuyu.Platform.Common/Networking/FuyuServer.cs @@ -0,0 +1,55 @@ +using System; +using WebSocketSharp.Server; +using Fuyu.Platform.Common.IO; + +namespace Fuyu.Platform.Common.Networking +{ + public class FuyuServer + { + private readonly HttpServer _httpv; + public readonly FuyuHttpRouter HttpRouter; + public readonly string Address; + public readonly string Name; + + public FuyuServer(string name, string address) + { + HttpRouter = new FuyuHttpRouter(); + Address = address; + Name = name; + + var uri = new Uri(address); + _httpv = new HttpServer(uri.Port); + _httpv.OnGet += OnRequest; + _httpv.OnPost += OnRequest; + _httpv.OnPut += OnRequest; + } + + private void OnRequest(object sender, HttpRequestEventArgs e) + { + var context = new FuyuHttpContext(e.Request, e.Response); + + Terminal.WriteLine($"[{Name}] {context.Path}"); + + try + { + HttpRouter.Route(context); + } + catch (Exception ex) + { + Terminal.WriteLine(ex.Message); + context.Response.Close(); + } + } + + public void Start() + { + _httpv.Start(); + Terminal.WriteLine($"[{Name}] Started on {Address}"); + } + + public void AddHttpService() where T : FuyuHttpBehaviour, new() + { + HttpRouter.Behaviours.Add(new T()); + } + } +} \ No newline at end of file diff --git a/Fuyu.Platform.Common/Networking/FuyuWsClient.cs b/Fuyu.Platform.Common/Networking/FuyuWsClient.cs new file mode 100644 index 00000000..e9d07b14 --- /dev/null +++ b/Fuyu.Platform.Common/Networking/FuyuWsClient.cs @@ -0,0 +1,80 @@ +using System; +using WebSocketSharp; + +namespace Fuyu.Platform.Common.Networking +{ + public class FuyuWsClient : IDisposable + { + private readonly string _url; + private WebSocket _ws; + + public FuyuWsClient(string address, string path) + { + _url = address + path; + } + + public void Start() + { + _ws = new WebSocket(_url) + { + EmitOnPing = true + }; + + _ws.OnMessage += OnMessage; + _ws.Connect(); + } + + public void Stop() + { + _ws.Close(); + } + + public void Send(string text) + { + _ws.Send(text); + } + + public void Send(byte[] data) + { + _ws.Send(data); + } + + private void OnMessage(object sender, MessageEventArgs e) + { + if (e.IsPing) + { + OnReceivePing(); + } + + if (e.IsText) + { + OnReceiveText(e.Data); + } + + if (e.IsBinary) + { + OnReceiveBytes(e.RawData); + } + } + + public virtual void OnReceivePing() + { + // intentionally empty + } + + public virtual void OnReceiveText(string text) + { + // intentionally empty + } + + public virtual void OnReceiveBytes(byte[] data) + { + // intentionally empty + } + + public void Dispose() + { + Stop(); + } + } +} \ No newline at end of file diff --git a/Fuyu.Platform.Common/README.md b/Fuyu.Platform.Common/README.md index 9a07e763..46387bcf 100644 --- a/Fuyu.Platform.Common/README.md +++ b/Fuyu.Platform.Common/README.md @@ -10,20 +10,20 @@ It's a simple wrapper around `HttpServer` that's good enough for most cases. It only supports HTTP without secure connection. - `FuyuServer` receives incoming HTTP requests and has an internal router -that maps `FuyuBehaviour` to a path. -- `FuyuBehaviour` is what handles the path and sends back a response. -- `FuyuContext` is metadata from a request +that maps `FuyuHttpBehaviour` to a path. +- `FuyuHttpBehaviour` is what handles the path and sends back a response. +- `FuyuHttpContext` is metadata from a request ```cs using System; -using Fuyu.Platform.Common.Http; +using Fuyu.Platform.Common.Networking; using Fuyu.Platform.Common.IO; // handles a request -public class HelloWorld : FuyuBehaviour +public class HelloWorld : FuyuHttpBehaviour { // run this code when the path it's bound to is requested - public override void Run(FuyuContext context) + public override void Run(FuyuHttpContext context) { // respond to the request SendText(context, "Hello, world!"); @@ -49,7 +49,7 @@ public class Program } ``` -### FuyuClient +### FuyuHttpClient It's simple wrapper around `HttpClient` that's good enough for most cases. You can make HTTP requests with it to a HTTP server. It only supports HTTP without @@ -61,14 +61,14 @@ It supports both sync and async operations. using System; using System.Text; using System.Threading.Tasks; -using Fuyu.Platform.Common.Http; +using Fuyu.Platform.Common.Networking; public class Program { static async Task Main() { // make a client instance - var client = new FuyuClient("http://localhost:8000"); + var client = new FuyuHttpClient("http://localhost:8000"); // make request var data = await client.GetAsync("/helloworld"); diff --git a/Fuyu.Platform.Server/Behaviours/EFT/AccountCustomization.cs b/Fuyu.Platform.Server/Behaviours/EFT/AccountCustomization.cs index 21c61471..e35d5068 100644 --- a/Fuyu.Platform.Server/Behaviours/EFT/AccountCustomization.cs +++ b/Fuyu.Platform.Server/Behaviours/EFT/AccountCustomization.cs @@ -1,9 +1,9 @@ -using Fuyu.Platform.Common.Http; +using Fuyu.Platform.Common.Networking; using Fuyu.Platform.Common.IO; namespace Fuyu.Platform.Server.Behaviours.EFT { - public class AccountCustomization : FuyuBehaviour + public class AccountCustomization : FuyuHttpBehaviour { private readonly string _response; @@ -12,7 +12,7 @@ public AccountCustomization() : base("/client/account/customization") _response = Resx.GetText("eft", "database.eft.client.account.customization.json"); } - public override void Run(FuyuContext context) + public override void Run(FuyuHttpContext context) { SendJson(context, _response); } diff --git a/Fuyu.Platform.Server/Behaviours/EFT/AchievementList.cs b/Fuyu.Platform.Server/Behaviours/EFT/AchievementList.cs index 37fe7ea4..bea91886 100644 --- a/Fuyu.Platform.Server/Behaviours/EFT/AchievementList.cs +++ b/Fuyu.Platform.Server/Behaviours/EFT/AchievementList.cs @@ -1,9 +1,9 @@ -using Fuyu.Platform.Common.Http; +using Fuyu.Platform.Common.Networking; using Fuyu.Platform.Common.IO; namespace Fuyu.Platform.Server.Behaviours.EFT { - public class AchievementList : FuyuBehaviour + public class AchievementList : FuyuHttpBehaviour { private readonly string _response; @@ -12,7 +12,7 @@ public AchievementList() : base("/client/achievement/list") _response = Resx.GetText("eft", "database.eft.client.achievement.list.json"); } - public override void Run(FuyuContext context) + public override void Run(FuyuHttpContext context) { SendJson(context, _response); } diff --git a/Fuyu.Platform.Server/Behaviours/EFT/AchievementStatistic.cs b/Fuyu.Platform.Server/Behaviours/EFT/AchievementStatistic.cs index 8d648281..c447a9e6 100644 --- a/Fuyu.Platform.Server/Behaviours/EFT/AchievementStatistic.cs +++ b/Fuyu.Platform.Server/Behaviours/EFT/AchievementStatistic.cs @@ -1,11 +1,11 @@ -using Fuyu.Platform.Common.Http; +using Fuyu.Platform.Common.Networking; using Fuyu.Platform.Common.IO; using Fuyu.Platform.Common.Models.EFT.Responses; using Fuyu.Platform.Common.Serialization; namespace Fuyu.Platform.Server.Behaviours.EFT { - public class AchievementStatistic : FuyuBehaviour + public class AchievementStatistic : FuyuHttpBehaviour { private readonly ResponseBody _response; @@ -15,7 +15,7 @@ public AchievementStatistic() : base("/client/achievement/statistic") _response = Json.Parse>(json); } - public override void Run(FuyuContext context) + public override void Run(FuyuHttpContext context) { SendJson(context, Json.Stringify(_response)); } diff --git a/Fuyu.Platform.Server/Behaviours/EFT/BuildsList.cs b/Fuyu.Platform.Server/Behaviours/EFT/BuildsList.cs index c9e279f6..6c8f0561 100644 --- a/Fuyu.Platform.Server/Behaviours/EFT/BuildsList.cs +++ b/Fuyu.Platform.Server/Behaviours/EFT/BuildsList.cs @@ -1,11 +1,11 @@ -using Fuyu.Platform.Common.Http; +using Fuyu.Platform.Common.Networking; using Fuyu.Platform.Common.IO; using Fuyu.Platform.Common.Models.EFT.Responses; using Fuyu.Platform.Common.Serialization; namespace Fuyu.Platform.Server.Behaviours.EFT { - public class BuildsList : FuyuBehaviour + public class BuildsList : FuyuHttpBehaviour { private readonly ResponseBody _response; @@ -15,7 +15,7 @@ public BuildsList() : base("/client/builds/list") _response = Json.Parse>(json); } - public override void Run(FuyuContext context) + public override void Run(FuyuHttpContext context) { SendJson(context, Json.Stringify(_response)); } diff --git a/Fuyu.Platform.Server/Behaviours/EFT/CheckVersion.cs b/Fuyu.Platform.Server/Behaviours/EFT/CheckVersion.cs index f2453c18..01ef3acf 100644 --- a/Fuyu.Platform.Server/Behaviours/EFT/CheckVersion.cs +++ b/Fuyu.Platform.Server/Behaviours/EFT/CheckVersion.cs @@ -1,16 +1,16 @@ -using Fuyu.Platform.Common.Http; +using Fuyu.Platform.Common.Networking; using Fuyu.Platform.Common.Models.EFT.Responses; using Fuyu.Platform.Common.Serialization; namespace Fuyu.Platform.Server.Behaviours.EFT { - public class CheckVersion : FuyuBehaviour + public class CheckVersion : FuyuHttpBehaviour { public CheckVersion() : base("/client/checkVersion") { } - public override void Run(FuyuContext context) + public override void Run(FuyuHttpContext context) { var response = new ResponseBody() { diff --git a/Fuyu.Platform.Server/Behaviours/EFT/Customization.cs b/Fuyu.Platform.Server/Behaviours/EFT/Customization.cs index 25c036e7..6f29c7ae 100644 --- a/Fuyu.Platform.Server/Behaviours/EFT/Customization.cs +++ b/Fuyu.Platform.Server/Behaviours/EFT/Customization.cs @@ -1,5 +1,5 @@ using System.Collections.Generic; -using Fuyu.Platform.Common.Http; +using Fuyu.Platform.Common.Networking; using Fuyu.Platform.Common.Models.EFT.Customization; using Fuyu.Platform.Common.Models.EFT.Responses; using Fuyu.Platform.Common.Serialization; @@ -7,13 +7,13 @@ namespace Fuyu.Platform.Server.Behaviours.EFT { - public class Customization : FuyuBehaviour + public class Customization : FuyuHttpBehaviour { public Customization() : base("/client/customization") { } - public override void Run(FuyuContext context) + public override void Run(FuyuHttpContext context) { var customizations = EftDatabase.Templates.GetCustomizations(); var response = new ResponseBody>() diff --git a/Fuyu.Platform.Server/Behaviours/EFT/CustomizationStorage.cs b/Fuyu.Platform.Server/Behaviours/EFT/CustomizationStorage.cs index 93632c3a..467f0e02 100644 --- a/Fuyu.Platform.Server/Behaviours/EFT/CustomizationStorage.cs +++ b/Fuyu.Platform.Server/Behaviours/EFT/CustomizationStorage.cs @@ -1,17 +1,17 @@ -using Fuyu.Platform.Common.Http; +using Fuyu.Platform.Common.Networking; using Fuyu.Platform.Common.Models.EFT.Responses; using Fuyu.Platform.Common.Serialization; using Fuyu.Platform.Server.Databases; namespace Fuyu.Platform.Server.Behaviours.EFT { - public class CustomizationStorage : FuyuBehaviour + public class CustomizationStorage : FuyuHttpBehaviour { public CustomizationStorage() : base("/client/trading/customization/storage") { } - public override void Run(FuyuContext context) + public override void Run(FuyuHttpContext context) { var sessionId = context.GetSessionId(); var account = FuyuDatabase.Accounts.GetAccount(sessionId); diff --git a/Fuyu.Platform.Server/Behaviours/EFT/FriendList.cs b/Fuyu.Platform.Server/Behaviours/EFT/FriendList.cs index 0c02fe7e..8706ae74 100644 --- a/Fuyu.Platform.Server/Behaviours/EFT/FriendList.cs +++ b/Fuyu.Platform.Server/Behaviours/EFT/FriendList.cs @@ -1,16 +1,16 @@ -using Fuyu.Platform.Common.Http; +using Fuyu.Platform.Common.Networking; using Fuyu.Platform.Common.Models.EFT.Responses; using Fuyu.Platform.Common.Serialization; namespace Fuyu.Platform.Server.Behaviours.EFT { - public class FriendList : FuyuBehaviour + public class FriendList : FuyuHttpBehaviour { public FriendList() : base("/client/friend/list") { } - public override void Run(FuyuContext context) + public override void Run(FuyuHttpContext context) { var response = new ResponseBody() { diff --git a/Fuyu.Platform.Server/Behaviours/EFT/FriendRequestListInbox.cs b/Fuyu.Platform.Server/Behaviours/EFT/FriendRequestListInbox.cs index 344660a7..a52bd05b 100644 --- a/Fuyu.Platform.Server/Behaviours/EFT/FriendRequestListInbox.cs +++ b/Fuyu.Platform.Server/Behaviours/EFT/FriendRequestListInbox.cs @@ -1,16 +1,16 @@ -using Fuyu.Platform.Common.Http; +using Fuyu.Platform.Common.Networking; using Fuyu.Platform.Common.Models.EFT.Responses; using Fuyu.Platform.Common.Serialization; namespace Fuyu.Platform.Server.Behaviours.EFT { - public class FriendRequestListInbox : FuyuBehaviour + public class FriendRequestListInbox : FuyuHttpBehaviour { public FriendRequestListInbox() : base("/client/friend/request/list/inbox") { } - public override void Run(FuyuContext context) + public override void Run(FuyuHttpContext context) { var response = new ResponseBody() { diff --git a/Fuyu.Platform.Server/Behaviours/EFT/FriendRequestListOutbox.cs b/Fuyu.Platform.Server/Behaviours/EFT/FriendRequestListOutbox.cs index adee78ce..934288cd 100644 --- a/Fuyu.Platform.Server/Behaviours/EFT/FriendRequestListOutbox.cs +++ b/Fuyu.Platform.Server/Behaviours/EFT/FriendRequestListOutbox.cs @@ -1,16 +1,16 @@ -using Fuyu.Platform.Common.Http; +using Fuyu.Platform.Common.Networking; using Fuyu.Platform.Common.Models.EFT.Responses; using Fuyu.Platform.Common.Serialization; namespace Fuyu.Platform.Server.Behaviours.EFT { - public class FriendRequestListOutbox : FuyuBehaviour + public class FriendRequestListOutbox : FuyuHttpBehaviour { public FriendRequestListOutbox() : base("/client/friend/request/list/outbox") { } - public override void Run(FuyuContext context) + public override void Run(FuyuHttpContext context) { var response = new ResponseBody() { diff --git a/Fuyu.Platform.Server/Behaviours/EFT/GameBotGenerate.cs b/Fuyu.Platform.Server/Behaviours/EFT/GameBotGenerate.cs index 5b169f63..968b8a18 100644 --- a/Fuyu.Platform.Server/Behaviours/EFT/GameBotGenerate.cs +++ b/Fuyu.Platform.Server/Behaviours/EFT/GameBotGenerate.cs @@ -1,5 +1,5 @@ using Fuyu.Platform.Server.Services; -using Fuyu.Platform.Common.Http; +using Fuyu.Platform.Common.Networking; using Fuyu.Platform.Common.Models.EFT.Profiles; using Fuyu.Platform.Common.Models.EFT.Requests; using Fuyu.Platform.Common.Models.EFT.Responses; @@ -7,13 +7,13 @@ namespace Fuyu.Platform.Server.Behaviours.EFT { - public class GameBotGenerate : FuyuBehaviour + public class GameBotGenerate : FuyuHttpBehaviour { public GameBotGenerate() : base("/client/game/bot/generate") { } - public override void Run(FuyuContext context) + public override void Run(FuyuHttpContext context) { var request = context.GetJson(); var profiles = BotService.GetBots(request.conditions); diff --git a/Fuyu.Platform.Server/Behaviours/EFT/GameConfig.cs b/Fuyu.Platform.Server/Behaviours/EFT/GameConfig.cs index e3405034..b5315ca8 100644 --- a/Fuyu.Platform.Server/Behaviours/EFT/GameConfig.cs +++ b/Fuyu.Platform.Server/Behaviours/EFT/GameConfig.cs @@ -1,16 +1,16 @@ -using Fuyu.Platform.Common.Http; +using Fuyu.Platform.Common.Networking; using Fuyu.Platform.Common.Models.EFT.Responses; using Fuyu.Platform.Common.Serialization; namespace Fuyu.Platform.Server.Behaviours.EFT { - public class GameConfig : FuyuBehaviour + public class GameConfig : FuyuHttpBehaviour { public GameConfig() : base("/client/game/config") { } - public override void Run(FuyuContext context) + public override void Run(FuyuHttpContext context) { var response = new ResponseBody { diff --git a/Fuyu.Platform.Server/Behaviours/EFT/GameKeepalive.cs b/Fuyu.Platform.Server/Behaviours/EFT/GameKeepalive.cs index 5f9b6bd4..8a2a88f0 100644 --- a/Fuyu.Platform.Server/Behaviours/EFT/GameKeepalive.cs +++ b/Fuyu.Platform.Server/Behaviours/EFT/GameKeepalive.cs @@ -1,16 +1,16 @@ -using Fuyu.Platform.Common.Http; +using Fuyu.Platform.Common.Networking; using Fuyu.Platform.Common.Models.EFT.Responses; using Fuyu.Platform.Common.Serialization; namespace Fuyu.Platform.Server.Behaviours.EFT { - public class GameKeepalive : FuyuBehaviour + public class GameKeepalive : FuyuHttpBehaviour { public GameKeepalive() : base("/client/game/keepalive") { } - public override void Run(FuyuContext context) + public override void Run(FuyuHttpContext context) { var response = new ResponseBody { diff --git a/Fuyu.Platform.Server/Behaviours/EFT/GameLogout.cs b/Fuyu.Platform.Server/Behaviours/EFT/GameLogout.cs index 96e8a004..e8b27abd 100644 --- a/Fuyu.Platform.Server/Behaviours/EFT/GameLogout.cs +++ b/Fuyu.Platform.Server/Behaviours/EFT/GameLogout.cs @@ -1,16 +1,16 @@ -using Fuyu.Platform.Common.Http; +using Fuyu.Platform.Common.Networking; using Fuyu.Platform.Common.Models.EFT.Responses; using Fuyu.Platform.Common.Serialization; namespace Fuyu.Platform.Server.Behaviours.EFT { - public class GameLogout : FuyuBehaviour + public class GameLogout : FuyuHttpBehaviour { public GameLogout() : base("/client/game/logout") { } - public override void Run(FuyuContext context) + public override void Run(FuyuHttpContext context) { var response = new ResponseBody() { diff --git a/Fuyu.Platform.Server/Behaviours/EFT/GameMode.cs b/Fuyu.Platform.Server/Behaviours/EFT/GameMode.cs index d5d79c38..72e1f230 100644 --- a/Fuyu.Platform.Server/Behaviours/EFT/GameMode.cs +++ b/Fuyu.Platform.Server/Behaviours/EFT/GameMode.cs @@ -1,16 +1,16 @@ -using Fuyu.Platform.Common.Http; +using Fuyu.Platform.Common.Networking; using Fuyu.Platform.Common.Models.EFT.Responses; using Fuyu.Platform.Common.Serialization; namespace Fuyu.Platform.Server.Behaviours.EFT { - public class GameMode : FuyuBehaviour + public class GameMode : FuyuHttpBehaviour { public GameMode() : base("/client/game/mode") { } - public override void Run(FuyuContext context) + public override void Run(FuyuHttpContext context) { var response = new ResponseBody() { diff --git a/Fuyu.Platform.Server/Behaviours/EFT/GameProfileCreate.cs b/Fuyu.Platform.Server/Behaviours/EFT/GameProfileCreate.cs index 4be1df72..4c3b47e4 100644 --- a/Fuyu.Platform.Server/Behaviours/EFT/GameProfileCreate.cs +++ b/Fuyu.Platform.Server/Behaviours/EFT/GameProfileCreate.cs @@ -1,6 +1,6 @@ -using Fuyu.Platform.Common.Hashing; -using Fuyu.Platform.Common.Http; +using Fuyu.Platform.Common.Networking; using Fuyu.Platform.Common.IO; +using Fuyu.Platform.Common.Models.EFT.Common; using Fuyu.Platform.Common.Models.EFT.Profiles; using Fuyu.Platform.Common.Models.EFT.Requests; using Fuyu.Platform.Common.Models.EFT.Responses; @@ -9,7 +9,7 @@ namespace Fuyu.Platform.Server.Behaviours.EFT { - public class GameProfileCreate : FuyuBehaviour + public class GameProfileCreate : FuyuHttpBehaviour { private readonly string _bearJson; private readonly string _usecJson; @@ -22,7 +22,7 @@ public GameProfileCreate() : base("/client/game/profile/create") _savageJson = Resx.GetText("eft", "database.eft.profiles.player.savage.json"); } - public override void Run(FuyuContext context) + public override void Run(FuyuHttpContext context) { var request = context.GetJson(); var sessionId = context.GetSessionId(); @@ -31,15 +31,17 @@ public override void Run(FuyuContext context) // TODO: PVP-PVE STATE DETECTION + // generate ids + var pmcId = new MongoId(accountId).ToString(); + var savageId = new MongoId(pmcId, 1, false).ToString(); + // create savage - var savageId = EftHash.Generate(); account.EftSave.PvE.Savage = Json.Parse(_savageJson); account.EftSave.PvE.Savage._id = savageId; account.EftSave.PvE.Savage.aid = accountId; // create pmc - var pmcId = EftHash.Generate(); var voiceTemplate = EftDatabase.Templates.GetCustomization(request.voiceId); account.EftSave.PvE.Pmc = request.side == "bear" diff --git a/Fuyu.Platform.Server/Behaviours/EFT/GameProfileList.cs b/Fuyu.Platform.Server/Behaviours/EFT/GameProfileList.cs index 7850656e..a6af59a1 100644 --- a/Fuyu.Platform.Server/Behaviours/EFT/GameProfileList.cs +++ b/Fuyu.Platform.Server/Behaviours/EFT/GameProfileList.cs @@ -1,4 +1,4 @@ -using Fuyu.Platform.Common.Http; +using Fuyu.Platform.Common.Networking; using Fuyu.Platform.Common.Models.EFT.Profiles; using Fuyu.Platform.Common.Models.EFT.Responses; using Fuyu.Platform.Common.Serialization; @@ -6,13 +6,13 @@ namespace Fuyu.Platform.Server.Behaviours.EFT { - public class GameProfileList : FuyuBehaviour + public class GameProfileList : FuyuHttpBehaviour { public GameProfileList() : base("/client/game/profile/list") { } - public override void Run(FuyuContext context) + public override void Run(FuyuHttpContext context) { var sessionId = context.GetSessionId(); var account = FuyuDatabase.Accounts.GetAccount(sessionId); diff --git a/Fuyu.Platform.Server/Behaviours/EFT/GameProfileNicknameReserved.cs b/Fuyu.Platform.Server/Behaviours/EFT/GameProfileNicknameReserved.cs index 09fc25c8..1413b85e 100644 --- a/Fuyu.Platform.Server/Behaviours/EFT/GameProfileNicknameReserved.cs +++ b/Fuyu.Platform.Server/Behaviours/EFT/GameProfileNicknameReserved.cs @@ -1,17 +1,17 @@ -using Fuyu.Platform.Common.Http; +using Fuyu.Platform.Common.Networking; using Fuyu.Platform.Common.Models.EFT.Responses; using Fuyu.Platform.Common.Serialization; using Fuyu.Platform.Server.Databases; namespace Fuyu.Platform.Server.Behaviours.EFT { - public class GameProfileNicknameReserved : FuyuBehaviour + public class GameProfileNicknameReserved : FuyuHttpBehaviour { public GameProfileNicknameReserved() : base("/client/game/profile/nickname/reserved") { } - public override void Run(FuyuContext context) + public override void Run(FuyuHttpContext context) { var sessionId = context.GetSessionId(); var account = FuyuDatabase.Accounts.GetAccount(sessionId); diff --git a/Fuyu.Platform.Server/Behaviours/EFT/GameProfileNicknameValidate.cs b/Fuyu.Platform.Server/Behaviours/EFT/GameProfileNicknameValidate.cs index 99950107..687f1567 100644 --- a/Fuyu.Platform.Server/Behaviours/EFT/GameProfileNicknameValidate.cs +++ b/Fuyu.Platform.Server/Behaviours/EFT/GameProfileNicknameValidate.cs @@ -1,17 +1,17 @@ -using Fuyu.Platform.Common.Http; +using Fuyu.Platform.Common.Networking; using Fuyu.Platform.Common.Models.EFT.Requests; using Fuyu.Platform.Common.Models.EFT.Responses; using Fuyu.Platform.Common.Serialization; namespace Fuyu.Platform.Server.Behaviours.EFT { - public class GameProfileNicknameValidate : FuyuBehaviour + public class GameProfileNicknameValidate : FuyuHttpBehaviour { public GameProfileNicknameValidate() : base("/client/game/profile/nickname/validate") { } - public override void Run(FuyuContext context) + public override void Run(FuyuHttpContext context) { var request = context.GetJson(); diff --git a/Fuyu.Platform.Server/Behaviours/EFT/GameProfileSelect.cs b/Fuyu.Platform.Server/Behaviours/EFT/GameProfileSelect.cs index 062077c8..546e60a4 100644 --- a/Fuyu.Platform.Server/Behaviours/EFT/GameProfileSelect.cs +++ b/Fuyu.Platform.Server/Behaviours/EFT/GameProfileSelect.cs @@ -1,16 +1,16 @@ -using Fuyu.Platform.Common.Http; +using Fuyu.Platform.Common.Networking; using Fuyu.Platform.Common.Models.EFT.Responses; using Fuyu.Platform.Common.Serialization; namespace Fuyu.Platform.Server.Behaviours.EFT { - public class GameProfileSelect : FuyuBehaviour + public class GameProfileSelect : FuyuHttpBehaviour { public GameProfileSelect() : base("/client/game/profile/select") { } - public override void Run(FuyuContext context) + public override void Run(FuyuHttpContext context) { var response = new ResponseBody() { diff --git a/Fuyu.Platform.Server/Behaviours/EFT/GameStart.cs b/Fuyu.Platform.Server/Behaviours/EFT/GameStart.cs index ff672636..b9912422 100644 --- a/Fuyu.Platform.Server/Behaviours/EFT/GameStart.cs +++ b/Fuyu.Platform.Server/Behaviours/EFT/GameStart.cs @@ -1,16 +1,16 @@ -using Fuyu.Platform.Common.Http; +using Fuyu.Platform.Common.Networking; using Fuyu.Platform.Common.Models.EFT.Responses; using Fuyu.Platform.Common.Serialization; namespace Fuyu.Platform.Server.Behaviours.EFT { - public class GameStart : FuyuBehaviour + public class GameStart : FuyuHttpBehaviour { public GameStart() : base("/client/game/start") { } - public override void Run(FuyuContext context) + public override void Run(FuyuHttpContext context) { var response = new ResponseBody() { diff --git a/Fuyu.Platform.Server/Behaviours/EFT/GameVersionValidate.cs b/Fuyu.Platform.Server/Behaviours/EFT/GameVersionValidate.cs index acf0b7e0..28cba4b9 100644 --- a/Fuyu.Platform.Server/Behaviours/EFT/GameVersionValidate.cs +++ b/Fuyu.Platform.Server/Behaviours/EFT/GameVersionValidate.cs @@ -1,16 +1,16 @@ -using Fuyu.Platform.Common.Http; +using Fuyu.Platform.Common.Networking; using Fuyu.Platform.Common.Models.EFT.Responses; using Fuyu.Platform.Common.Serialization; namespace Fuyu.Platform.Server.Behaviours.EFT { - public class GameVersionValidate : FuyuBehaviour + public class GameVersionValidate : FuyuHttpBehaviour { public GameVersionValidate() : base("/client/game/version/validate") { } - public override void Run(FuyuContext context) + public override void Run(FuyuHttpContext context) { var response = new ResponseBody() { diff --git a/Fuyu.Platform.Server/Behaviours/EFT/GetMetricsConfig.cs b/Fuyu.Platform.Server/Behaviours/EFT/GetMetricsConfig.cs index c2db8bd1..7f037a00 100644 --- a/Fuyu.Platform.Server/Behaviours/EFT/GetMetricsConfig.cs +++ b/Fuyu.Platform.Server/Behaviours/EFT/GetMetricsConfig.cs @@ -1,16 +1,16 @@ -using Fuyu.Platform.Common.Http; +using Fuyu.Platform.Common.Networking; using Fuyu.Platform.Common.Models.EFT.Responses; using Fuyu.Platform.Common.Serialization; namespace Fuyu.Platform.Server.Behaviours.EFT { - public class GetMetricsConfig : FuyuBehaviour + public class GetMetricsConfig : FuyuHttpBehaviour { public GetMetricsConfig() : base("/client/getMetricsConfig") { } - public override void Run(FuyuContext context) + public override void Run(FuyuHttpContext context) { var response = new ResponseBody() { diff --git a/Fuyu.Platform.Server/Behaviours/EFT/Globals.cs b/Fuyu.Platform.Server/Behaviours/EFT/Globals.cs index 2ae31165..5df9e075 100644 --- a/Fuyu.Platform.Server/Behaviours/EFT/Globals.cs +++ b/Fuyu.Platform.Server/Behaviours/EFT/Globals.cs @@ -1,9 +1,9 @@ -using Fuyu.Platform.Common.Http; +using Fuyu.Platform.Common.Networking; using Fuyu.Platform.Common.IO; namespace Fuyu.Platform.Server.Behaviours.EFT { - public class Globals : FuyuBehaviour + public class Globals : FuyuHttpBehaviour { private readonly string _response; @@ -12,7 +12,7 @@ public Globals() : base("/client/globals") _response = Resx.GetText("eft", "database.eft.client.globals.json"); } - public override void Run(FuyuContext context) + public override void Run(FuyuHttpContext context) { SendJson(context, _response); } diff --git a/Fuyu.Platform.Server/Behaviours/EFT/HandbookTemplates.cs b/Fuyu.Platform.Server/Behaviours/EFT/HandbookTemplates.cs index f1d617b1..888f3305 100644 --- a/Fuyu.Platform.Server/Behaviours/EFT/HandbookTemplates.cs +++ b/Fuyu.Platform.Server/Behaviours/EFT/HandbookTemplates.cs @@ -1,9 +1,9 @@ -using Fuyu.Platform.Common.Http; +using Fuyu.Platform.Common.Networking; using Fuyu.Platform.Common.IO; namespace Fuyu.Platform.Server.Behaviours.EFT { - public class HandbookTemplates : FuyuBehaviour + public class HandbookTemplates : FuyuHttpBehaviour { private readonly string _response; @@ -12,7 +12,7 @@ public HandbookTemplates() : base("/client/handbook/templates") _response = Resx.GetText("eft", "database.eft.client.handbook.templates.json"); } - public override void Run(FuyuContext context) + public override void Run(FuyuHttpContext context) { SendJson(context, _response); } diff --git a/Fuyu.Platform.Server/Behaviours/EFT/HideoutAreas.cs b/Fuyu.Platform.Server/Behaviours/EFT/HideoutAreas.cs index b22a525f..deec2f7f 100644 --- a/Fuyu.Platform.Server/Behaviours/EFT/HideoutAreas.cs +++ b/Fuyu.Platform.Server/Behaviours/EFT/HideoutAreas.cs @@ -1,9 +1,9 @@ -using Fuyu.Platform.Common.Http; +using Fuyu.Platform.Common.Networking; using Fuyu.Platform.Common.IO; namespace Fuyu.Platform.Server.Behaviours.EFT { - public class HideoutAreas : FuyuBehaviour + public class HideoutAreas : FuyuHttpBehaviour { private readonly string _response; @@ -12,7 +12,7 @@ public HideoutAreas() : base("/client/hideout/areas") _response = Resx.GetText("eft", "database.eft.client.hideout.areas.json"); } - public override void Run(FuyuContext context) + public override void Run(FuyuHttpContext context) { SendJson(context, _response); } diff --git a/Fuyu.Platform.Server/Behaviours/EFT/HideoutProductionRecipes.cs b/Fuyu.Platform.Server/Behaviours/EFT/HideoutProductionRecipes.cs index 8765089a..5ceeadde 100644 --- a/Fuyu.Platform.Server/Behaviours/EFT/HideoutProductionRecipes.cs +++ b/Fuyu.Platform.Server/Behaviours/EFT/HideoutProductionRecipes.cs @@ -1,9 +1,9 @@ -using Fuyu.Platform.Common.Http; +using Fuyu.Platform.Common.Networking; using Fuyu.Platform.Common.IO; namespace Fuyu.Platform.Server.Behaviours.EFT { - public class HideoutProductionRecipes : FuyuBehaviour + public class HideoutProductionRecipes : FuyuHttpBehaviour { private readonly string _response; @@ -12,7 +12,7 @@ public HideoutProductionRecipes() : base("/client/hideout/production/recipes") _response = Resx.GetText("eft", "database.eft.client.hideout.production.recipes.json"); } - public override void Run(FuyuContext context) + public override void Run(FuyuHttpContext context) { SendJson(context, _response); } diff --git a/Fuyu.Platform.Server/Behaviours/EFT/HideoutQteList.cs b/Fuyu.Platform.Server/Behaviours/EFT/HideoutQteList.cs index 15c9c0fb..253c2a0c 100644 --- a/Fuyu.Platform.Server/Behaviours/EFT/HideoutQteList.cs +++ b/Fuyu.Platform.Server/Behaviours/EFT/HideoutQteList.cs @@ -1,9 +1,9 @@ -using Fuyu.Platform.Common.Http; +using Fuyu.Platform.Common.Networking; using Fuyu.Platform.Common.IO; namespace Fuyu.Platform.Server.Behaviours.EFT { - public class HideoutQteList : FuyuBehaviour + public class HideoutQteList : FuyuHttpBehaviour { private readonly string _response; @@ -12,7 +12,7 @@ public HideoutQteList() : base("/client/hideout/qte/list") _response = Resx.GetText("eft", "database.eft.client.hideout.qte.list.json"); } - public override void Run(FuyuContext context) + public override void Run(FuyuHttpContext context) { SendJson(context, _response); } diff --git a/Fuyu.Platform.Server/Behaviours/EFT/HideoutSettings.cs b/Fuyu.Platform.Server/Behaviours/EFT/HideoutSettings.cs index 5f0f8849..317832dc 100644 --- a/Fuyu.Platform.Server/Behaviours/EFT/HideoutSettings.cs +++ b/Fuyu.Platform.Server/Behaviours/EFT/HideoutSettings.cs @@ -1,11 +1,11 @@ -using Fuyu.Platform.Common.Http; +using Fuyu.Platform.Common.Networking; using Fuyu.Platform.Common.IO; using Fuyu.Platform.Common.Models.EFT.Responses; using Fuyu.Platform.Common.Serialization; namespace Fuyu.Platform.Server.Behaviours.EFT { - public class HideoutSettings : FuyuBehaviour + public class HideoutSettings : FuyuHttpBehaviour { private readonly ResponseBody _response; @@ -15,7 +15,7 @@ public HideoutSettings() : base("/client/hideout/settings") _response = Json.Parse>(json); } - public override void Run(FuyuContext context) + public override void Run(FuyuHttpContext context) { SendJson(context, Json.Stringify(_response)); } diff --git a/Fuyu.Platform.Server/Behaviours/EFT/Items.cs b/Fuyu.Platform.Server/Behaviours/EFT/Items.cs index bc367bcd..1e99f4cc 100644 --- a/Fuyu.Platform.Server/Behaviours/EFT/Items.cs +++ b/Fuyu.Platform.Server/Behaviours/EFT/Items.cs @@ -1,9 +1,9 @@ -using Fuyu.Platform.Common.Http; +using Fuyu.Platform.Common.Networking; using Fuyu.Platform.Common.IO; namespace Fuyu.Platform.Server.Behaviours.EFT { - public class Items : FuyuBehaviour + public class Items : FuyuHttpBehaviour { private readonly string _response; @@ -12,7 +12,7 @@ public Items() : base("/client/items") _response = Resx.GetText("eft", "database.eft.client.items.json"); } - public override void Run(FuyuContext context) + public override void Run(FuyuHttpContext context) { SendJson(context, _response); } diff --git a/Fuyu.Platform.Server/Behaviours/EFT/Languages.cs b/Fuyu.Platform.Server/Behaviours/EFT/Languages.cs index 3c5404f5..5f9400d2 100644 --- a/Fuyu.Platform.Server/Behaviours/EFT/Languages.cs +++ b/Fuyu.Platform.Server/Behaviours/EFT/Languages.cs @@ -1,18 +1,18 @@ using System.Collections.Generic; -using Fuyu.Platform.Common.Http; +using Fuyu.Platform.Common.Networking; using Fuyu.Platform.Common.Models.EFT.Responses; using Fuyu.Platform.Common.Serialization; using Fuyu.Platform.Server.Databases; namespace Fuyu.Platform.Server.Behaviours.EFT { - public class Languages : FuyuBehaviour + public class Languages : FuyuHttpBehaviour { public Languages() : base("/client/languages") { } - public override void Run(FuyuContext context) + public override void Run(FuyuHttpContext context) { var languages = EftDatabase.Locales.GetLanguages(); var response = new ResponseBody> diff --git a/Fuyu.Platform.Server/Behaviours/EFT/LocalGameWeather.cs b/Fuyu.Platform.Server/Behaviours/EFT/LocalGameWeather.cs index d1f919b0..1b00f5a6 100644 --- a/Fuyu.Platform.Server/Behaviours/EFT/LocalGameWeather.cs +++ b/Fuyu.Platform.Server/Behaviours/EFT/LocalGameWeather.cs @@ -1,9 +1,9 @@ -using Fuyu.Platform.Common.Http; +using Fuyu.Platform.Common.Networking; using Fuyu.Platform.Common.IO; namespace Fuyu.Platform.Server.Behaviours.EFT { - public class LocalGameWeather : FuyuBehaviour + public class LocalGameWeather : FuyuHttpBehaviour { private readonly string _response; @@ -12,7 +12,7 @@ public LocalGameWeather() : base("/client/localGame/weather") _response = Resx.GetText("eft", "database.eft.client.localGame.weather.json"); } - public override void Run(FuyuContext context) + public override void Run(FuyuHttpContext context) { SendJson(context, _response); } diff --git a/Fuyu.Platform.Server/Behaviours/EFT/Locale.cs b/Fuyu.Platform.Server/Behaviours/EFT/Locale.cs index db44e208..7ad36226 100644 --- a/Fuyu.Platform.Server/Behaviours/EFT/Locale.cs +++ b/Fuyu.Platform.Server/Behaviours/EFT/Locale.cs @@ -1,20 +1,20 @@ using System.Collections.Generic; -using Fuyu.Platform.Common.Http; +using Fuyu.Platform.Common.Networking; using Fuyu.Platform.Common.Models.EFT.Responses; using Fuyu.Platform.Common.Serialization; using Fuyu.Platform.Server.Databases; namespace Fuyu.Platform.Server.Behaviours.EFT { - public class Locale : FuyuBehaviour + public class Locale : FuyuHttpBehaviour { public Locale() : base("/client/locale/{languageId}") { } - public override void Run(FuyuContext context) + public override void Run(FuyuHttpContext context) { - var arguments = context.GetParameters(this); + var arguments = context.GetPathParameters(this); var languageId = arguments["languageId"]; var locale = EftDatabase.Locales.GetGlobalLocale(languageId); diff --git a/Fuyu.Platform.Server/Behaviours/EFT/Locations.cs b/Fuyu.Platform.Server/Behaviours/EFT/Locations.cs index fa63cde3..697a734e 100644 --- a/Fuyu.Platform.Server/Behaviours/EFT/Locations.cs +++ b/Fuyu.Platform.Server/Behaviours/EFT/Locations.cs @@ -1,4 +1,4 @@ -using Fuyu.Platform.Common.Http; +using Fuyu.Platform.Common.Networking; using Fuyu.Platform.Common.IO; using Fuyu.Platform.Common.Models.EFT.Locations; using Fuyu.Platform.Common.Models.EFT.Responses; @@ -6,7 +6,7 @@ namespace Fuyu.Platform.Server.Behaviours.EFT { - public class Locations : FuyuBehaviour + public class Locations : FuyuHttpBehaviour { private readonly ResponseBody _locations; @@ -16,7 +16,7 @@ public Locations() : base("/client/locations") _locations = Json.Parse>(text); } - public override void Run(FuyuContext context) + public override void Run(FuyuHttpContext context) { var response = Json.Stringify(_locations); SendJson(context, response); diff --git a/Fuyu.Platform.Server/Behaviours/EFT/MailDialogList.cs b/Fuyu.Platform.Server/Behaviours/EFT/MailDialogList.cs index 2c12177d..89757310 100644 --- a/Fuyu.Platform.Server/Behaviours/EFT/MailDialogList.cs +++ b/Fuyu.Platform.Server/Behaviours/EFT/MailDialogList.cs @@ -1,16 +1,16 @@ -using Fuyu.Platform.Common.Http; +using Fuyu.Platform.Common.Networking; using Fuyu.Platform.Common.Models.EFT.Responses; using Fuyu.Platform.Common.Serialization; namespace Fuyu.Platform.Server.Behaviours.EFT { - public class MailDialogList : FuyuBehaviour + public class MailDialogList : FuyuHttpBehaviour { public MailDialogList() : base("/client/mail/dialog/list") { } - public override void Run(FuyuContext context) + public override void Run(FuyuHttpContext context) { var response = new ResponseBody { diff --git a/Fuyu.Platform.Server/Behaviours/EFT/MatchGroupCurrent.cs b/Fuyu.Platform.Server/Behaviours/EFT/MatchGroupCurrent.cs index e94c86c9..37964832 100644 --- a/Fuyu.Platform.Server/Behaviours/EFT/MatchGroupCurrent.cs +++ b/Fuyu.Platform.Server/Behaviours/EFT/MatchGroupCurrent.cs @@ -1,16 +1,16 @@ -using Fuyu.Platform.Common.Http; +using Fuyu.Platform.Common.Networking; using Fuyu.Platform.Common.Models.EFT.Responses; using Fuyu.Platform.Common.Serialization; namespace Fuyu.Platform.Server.Behaviours.EFT { - public class MatchGroupCurrent : FuyuBehaviour + public class MatchGroupCurrent : FuyuHttpBehaviour { public MatchGroupCurrent() : base("/client/match/group/current") { } - public override void Run(FuyuContext context) + public override void Run(FuyuHttpContext context) { var response = new ResponseBody() { diff --git a/Fuyu.Platform.Server/Behaviours/EFT/MatchGroupExitFromMenu.cs b/Fuyu.Platform.Server/Behaviours/EFT/MatchGroupExitFromMenu.cs index 8cd9989d..193e8194 100644 --- a/Fuyu.Platform.Server/Behaviours/EFT/MatchGroupExitFromMenu.cs +++ b/Fuyu.Platform.Server/Behaviours/EFT/MatchGroupExitFromMenu.cs @@ -1,16 +1,16 @@ -using Fuyu.Platform.Common.Http; +using Fuyu.Platform.Common.Networking; using Fuyu.Platform.Common.Models.EFT.Responses; using Fuyu.Platform.Common.Serialization; namespace Fuyu.Platform.Server.Behaviours.EFT { - public class MatchGroupExitFromMenu : FuyuBehaviour + public class MatchGroupExitFromMenu : FuyuHttpBehaviour { public MatchGroupExitFromMenu() : base("/client/match/group/exit_from_menu") { } - public override void Run(FuyuContext context) + public override void Run(FuyuHttpContext context) { var response = new ResponseBody() { diff --git a/Fuyu.Platform.Server/Behaviours/EFT/MatchGroupInviteCancelAll.cs b/Fuyu.Platform.Server/Behaviours/EFT/MatchGroupInviteCancelAll.cs index 745786d6..51728a59 100644 --- a/Fuyu.Platform.Server/Behaviours/EFT/MatchGroupInviteCancelAll.cs +++ b/Fuyu.Platform.Server/Behaviours/EFT/MatchGroupInviteCancelAll.cs @@ -1,16 +1,16 @@ -using Fuyu.Platform.Common.Http; +using Fuyu.Platform.Common.Networking; using Fuyu.Platform.Common.Models.EFT.Responses; using Fuyu.Platform.Common.Serialization; namespace Fuyu.Platform.Server.Behaviours.EFT { - public class MatchGroupInviteCancelAll : FuyuBehaviour + public class MatchGroupInviteCancelAll : FuyuHttpBehaviour { public MatchGroupInviteCancelAll() : base("/client/match/group/invite/cancel-all") { } - public override void Run(FuyuContext context) + public override void Run(FuyuHttpContext context) { var response = new ResponseBody() { diff --git a/Fuyu.Platform.Server/Behaviours/EFT/MatchLocalEnd.cs b/Fuyu.Platform.Server/Behaviours/EFT/MatchLocalEnd.cs index 647bc5fe..8b25b9b0 100644 --- a/Fuyu.Platform.Server/Behaviours/EFT/MatchLocalEnd.cs +++ b/Fuyu.Platform.Server/Behaviours/EFT/MatchLocalEnd.cs @@ -1,16 +1,16 @@ -using Fuyu.Platform.Common.Http; +using Fuyu.Platform.Common.Networking; using Fuyu.Platform.Common.Models.EFT.Responses; using Fuyu.Platform.Common.Serialization; namespace Fuyu.Platform.Server.Behaviours.EFT { - public class MatchLocalEnd : FuyuBehaviour + public class MatchLocalEnd : FuyuHttpBehaviour { public MatchLocalEnd() : base("/client/match/local/end") { } - public override void Run(FuyuContext context) + public override void Run(FuyuHttpContext context) { var response = new ResponseBody() { diff --git a/Fuyu.Platform.Server/Behaviours/EFT/MatchLocalStart.cs b/Fuyu.Platform.Server/Behaviours/EFT/MatchLocalStart.cs index 8cf5e8fb..2636a44a 100644 --- a/Fuyu.Platform.Server/Behaviours/EFT/MatchLocalStart.cs +++ b/Fuyu.Platform.Server/Behaviours/EFT/MatchLocalStart.cs @@ -1,11 +1,11 @@ using System.Collections.Generic; -using Fuyu.Platform.Common.Http; +using Fuyu.Platform.Common.Networking; using Fuyu.Platform.Common.IO; using Fuyu.Platform.Common.Models.EFT.Requests; namespace Fuyu.Platform.Server.Behaviours.EFT { - public class MatchLocalStart : FuyuBehaviour + public class MatchLocalStart : FuyuHttpBehaviour { private readonly Dictionary _locations; @@ -27,7 +27,7 @@ public MatchLocalStart() : base("/client/match/local/start") }; } - public override void Run(FuyuContext context) + public override void Run(FuyuHttpContext context) { var request = context.GetJson(); var location = request.location; diff --git a/Fuyu.Platform.Server/Behaviours/EFT/MenuLocale.cs b/Fuyu.Platform.Server/Behaviours/EFT/MenuLocale.cs index 49cbd18f..dd4cc80a 100644 --- a/Fuyu.Platform.Server/Behaviours/EFT/MenuLocale.cs +++ b/Fuyu.Platform.Server/Behaviours/EFT/MenuLocale.cs @@ -1,19 +1,19 @@ -using Fuyu.Platform.Common.Http; +using Fuyu.Platform.Common.Networking; using Fuyu.Platform.Common.Models.EFT.Responses; using Fuyu.Platform.Common.Serialization; using Fuyu.Platform.Server.Databases; namespace Fuyu.Platform.Server.Behaviours.EFT { - public class MenuLocale : FuyuBehaviour + public class MenuLocale : FuyuHttpBehaviour { public MenuLocale() : base("/client/menu/locale/{languageId}") { } - public override void Run(FuyuContext context) + public override void Run(FuyuHttpContext context) { - var arguments = context.GetParameters(this); + var arguments = context.GetPathParameters(this); var languageId = arguments["languageId"]; var locale = EftDatabase.Locales.GetMenuLocale(languageId); diff --git a/Fuyu.Platform.Server/Behaviours/EFT/NotifierChannelCreate.cs b/Fuyu.Platform.Server/Behaviours/EFT/NotifierChannelCreate.cs index faf1f552..d13bf095 100644 --- a/Fuyu.Platform.Server/Behaviours/EFT/NotifierChannelCreate.cs +++ b/Fuyu.Platform.Server/Behaviours/EFT/NotifierChannelCreate.cs @@ -1,19 +1,19 @@ using Fuyu.Platform.Common.Hashing; -using Fuyu.Platform.Common.Http; +using Fuyu.Platform.Common.Networking; using Fuyu.Platform.Common.Models.EFT.Responses; using Fuyu.Platform.Common.Serialization; namespace Fuyu.Platform.Server.Behaviours.EFT { - public class NotifierChannelCreate : FuyuBehaviour + public class NotifierChannelCreate : FuyuHttpBehaviour { public NotifierChannelCreate() : base("/client/notifier/channel/create") { } - public override void Run(FuyuContext context) + public override void Run(FuyuHttpContext context) { - var channelId = EftHash.Generate(64); + var channelId = SimpleId.Generate(64); var response = new ResponseBody { data = new NotifierChannelCreateResponse() diff --git a/Fuyu.Platform.Server/Behaviours/EFT/ProfileSettings.cs b/Fuyu.Platform.Server/Behaviours/EFT/ProfileSettings.cs index 9cdb1c0b..535b16a1 100644 --- a/Fuyu.Platform.Server/Behaviours/EFT/ProfileSettings.cs +++ b/Fuyu.Platform.Server/Behaviours/EFT/ProfileSettings.cs @@ -1,16 +1,16 @@ -using Fuyu.Platform.Common.Http; +using Fuyu.Platform.Common.Networking; using Fuyu.Platform.Common.Models.EFT.Responses; using Fuyu.Platform.Common.Serialization; namespace Fuyu.Platform.Server.Behaviours.EFT { - public class ProfileSettings : FuyuBehaviour + public class ProfileSettings : FuyuHttpBehaviour { public ProfileSettings() : base("/client/profile/settings") { } - public override void Run(FuyuContext context) + public override void Run(FuyuHttpContext context) { var response = new ResponseBody() { diff --git a/Fuyu.Platform.Server/Behaviours/EFT/ProfileStatus.cs b/Fuyu.Platform.Server/Behaviours/EFT/ProfileStatus.cs index 04924009..63fd5769 100644 --- a/Fuyu.Platform.Server/Behaviours/EFT/ProfileStatus.cs +++ b/Fuyu.Platform.Server/Behaviours/EFT/ProfileStatus.cs @@ -1,4 +1,4 @@ -using Fuyu.Platform.Common.Http; +using Fuyu.Platform.Common.Networking; using Fuyu.Platform.Common.Models.EFT.Multiplayer; using Fuyu.Platform.Common.Models.EFT.Responses; using Fuyu.Platform.Common.Serialization; @@ -6,13 +6,13 @@ namespace Fuyu.Platform.Server.Behaviours.EFT { - public class ProfileStatus : FuyuBehaviour + public class ProfileStatus : FuyuHttpBehaviour { public ProfileStatus() : base("/client/profile/status") { } - public override void Run(FuyuContext context) + public override void Run(FuyuHttpContext context) { var sessionId = context.GetSessionId(); var account = FuyuDatabase.Accounts.GetAccount(sessionId); diff --git a/Fuyu.Platform.Server/Behaviours/EFT/PutMetrics.cs b/Fuyu.Platform.Server/Behaviours/EFT/PutMetrics.cs index 9b6f50ed..b3e69e12 100644 --- a/Fuyu.Platform.Server/Behaviours/EFT/PutMetrics.cs +++ b/Fuyu.Platform.Server/Behaviours/EFT/PutMetrics.cs @@ -1,16 +1,16 @@ -using Fuyu.Platform.Common.Http; +using Fuyu.Platform.Common.Networking; using Fuyu.Platform.Common.Models.EFT.Responses; using Fuyu.Platform.Common.Serialization; namespace Fuyu.Platform.Server.Behaviours.EFT { - public class PutMetrics : FuyuBehaviour + public class PutMetrics : FuyuHttpBehaviour { public PutMetrics() : base("/client/putMetrics") { } - public override void Run(FuyuContext context) + public override void Run(FuyuHttpContext context) { var response = new ResponseBody() { diff --git a/Fuyu.Platform.Server/Behaviours/EFT/QuestList.cs b/Fuyu.Platform.Server/Behaviours/EFT/QuestList.cs index c5865f34..1d1e91f5 100644 --- a/Fuyu.Platform.Server/Behaviours/EFT/QuestList.cs +++ b/Fuyu.Platform.Server/Behaviours/EFT/QuestList.cs @@ -1,9 +1,9 @@ -using Fuyu.Platform.Common.Http; +using Fuyu.Platform.Common.Networking; using Fuyu.Platform.Common.IO; namespace Fuyu.Platform.Server.Behaviours.EFT { - public class QuestList : FuyuBehaviour + public class QuestList : FuyuHttpBehaviour { private readonly string _response; @@ -12,7 +12,7 @@ public QuestList() : base("/client/quest/list") _response = Resx.GetText("eft", "database.eft.client.quest.list.json"); } - public override void Run(FuyuContext context) + public override void Run(FuyuHttpContext context) { SendJson(context, _response); } diff --git a/Fuyu.Platform.Server/Behaviours/EFT/RaidConfiguration.cs b/Fuyu.Platform.Server/Behaviours/EFT/RaidConfiguration.cs index 2c409e09..c43cb5c9 100644 --- a/Fuyu.Platform.Server/Behaviours/EFT/RaidConfiguration.cs +++ b/Fuyu.Platform.Server/Behaviours/EFT/RaidConfiguration.cs @@ -1,16 +1,16 @@ -using Fuyu.Platform.Common.Http; +using Fuyu.Platform.Common.Networking; using Fuyu.Platform.Common.Models.EFT.Responses; using Fuyu.Platform.Common.Serialization; namespace Fuyu.Platform.Server.Behaviours.EFT { - public class RaidConfiguration : FuyuBehaviour + public class RaidConfiguration : FuyuHttpBehaviour { public RaidConfiguration() : base("/client/raid/configuration") { } - public override void Run(FuyuContext context) + public override void Run(FuyuHttpContext context) { var response = new ResponseBody() { diff --git a/Fuyu.Platform.Server/Behaviours/EFT/RepeatableQuestActivityPeriods.cs b/Fuyu.Platform.Server/Behaviours/EFT/RepeatableQuestActivityPeriods.cs index 6aa406bc..466bfed3 100644 --- a/Fuyu.Platform.Server/Behaviours/EFT/RepeatableQuestActivityPeriods.cs +++ b/Fuyu.Platform.Server/Behaviours/EFT/RepeatableQuestActivityPeriods.cs @@ -1,16 +1,16 @@ -using Fuyu.Platform.Common.Http; +using Fuyu.Platform.Common.Networking; using Fuyu.Platform.Common.Models.EFT.Responses; using Fuyu.Platform.Common.Serialization; namespace Fuyu.Platform.Server.Behaviours.EFT { - public class RepeatableQuestActivityPeriods : FuyuBehaviour + public class RepeatableQuestActivityPeriods : FuyuHttpBehaviour { public RepeatableQuestActivityPeriods() : base("/client/repeatalbeQuests/activityPeriods") { } - public override void Run(FuyuContext context) + public override void Run(FuyuHttpContext context) { var response = new ResponseBody { diff --git a/Fuyu.Platform.Server/Behaviours/EFT/ServerList.cs b/Fuyu.Platform.Server/Behaviours/EFT/ServerList.cs index a5b2a9f7..d8d33397 100644 --- a/Fuyu.Platform.Server/Behaviours/EFT/ServerList.cs +++ b/Fuyu.Platform.Server/Behaviours/EFT/ServerList.cs @@ -1,17 +1,17 @@ -using Fuyu.Platform.Common.Http; +using Fuyu.Platform.Common.Networking; using Fuyu.Platform.Common.Models.EFT.Responses; using Fuyu.Platform.Common.Models.EFT.Servers; using Fuyu.Platform.Common.Serialization; namespace Fuyu.Platform.Server.Behaviours.EFT { - public class ServerList : FuyuBehaviour + public class ServerList : FuyuHttpBehaviour { public ServerList() : base("/client/server/list") { } - public override void Run(FuyuContext context) + public override void Run(FuyuHttpContext context) { var response = new ResponseBody() { diff --git a/Fuyu.Platform.Server/Behaviours/EFT/Settings.cs b/Fuyu.Platform.Server/Behaviours/EFT/Settings.cs index b4350911..d61ef5d1 100644 --- a/Fuyu.Platform.Server/Behaviours/EFT/Settings.cs +++ b/Fuyu.Platform.Server/Behaviours/EFT/Settings.cs @@ -1,9 +1,9 @@ -using Fuyu.Platform.Common.Http; +using Fuyu.Platform.Common.Networking; using Fuyu.Platform.Common.IO; namespace Fuyu.Platform.Server.Behaviours.EFT { - public class Settings : FuyuBehaviour + public class Settings : FuyuHttpBehaviour { private readonly string _response; @@ -12,7 +12,7 @@ public Settings() : base("/client/settings") _response = Resx.GetText("eft", "database.eft.client.settings.json"); } - public override void Run(FuyuContext context) + public override void Run(FuyuHttpContext context) { SendJson(context, _response); } diff --git a/Fuyu.Platform.Server/Behaviours/EFT/Survey.cs b/Fuyu.Platform.Server/Behaviours/EFT/Survey.cs index 9537692b..b23be318 100644 --- a/Fuyu.Platform.Server/Behaviours/EFT/Survey.cs +++ b/Fuyu.Platform.Server/Behaviours/EFT/Survey.cs @@ -1,16 +1,16 @@ -using Fuyu.Platform.Common.Http; +using Fuyu.Platform.Common.Networking; using Fuyu.Platform.Common.Models.EFT.Responses; using Fuyu.Platform.Common.Serialization; namespace Fuyu.Platform.Server.Behaviours.EFT { - public class Survey : FuyuBehaviour + public class Survey : FuyuHttpBehaviour { public Survey() : base("/client/survey") { } - public override void Run(FuyuContext context) + public override void Run(FuyuHttpContext context) { var response = new ResponseBody() { diff --git a/Fuyu.Platform.Server/Behaviours/EFT/TraderSettings.cs b/Fuyu.Platform.Server/Behaviours/EFT/TraderSettings.cs index b4809c7c..260474d1 100644 --- a/Fuyu.Platform.Server/Behaviours/EFT/TraderSettings.cs +++ b/Fuyu.Platform.Server/Behaviours/EFT/TraderSettings.cs @@ -1,9 +1,9 @@ -using Fuyu.Platform.Common.Http; +using Fuyu.Platform.Common.Networking; using Fuyu.Platform.Common.IO; namespace Fuyu.Platform.Server.Behaviours.EFT { - public class TraderSettings : FuyuBehaviour + public class TraderSettings : FuyuHttpBehaviour { private readonly string _response; @@ -12,7 +12,7 @@ public TraderSettings() : base("/client/trading/api/traderSettings") _response = Resx.GetText("eft", "database.eft.client.trading.api.traderSettings.json"); } - public override void Run(FuyuContext context) + public override void Run(FuyuHttpContext context) { SendJson(context, _response); } diff --git a/Fuyu.Platform.Server/Behaviours/EFT/Weather.cs b/Fuyu.Platform.Server/Behaviours/EFT/Weather.cs index e43454c5..40d8a7dc 100644 --- a/Fuyu.Platform.Server/Behaviours/EFT/Weather.cs +++ b/Fuyu.Platform.Server/Behaviours/EFT/Weather.cs @@ -1,9 +1,9 @@ -using Fuyu.Platform.Common.Http; +using Fuyu.Platform.Common.Networking; using Fuyu.Platform.Common.IO; namespace Fuyu.Platform.Server.Behaviours.EFT { - public class Weather : FuyuBehaviour + public class Weather : FuyuHttpBehaviour { private readonly string _response; @@ -12,7 +12,7 @@ public Weather() : base("/client/weather") _response = Resx.GetText("eft", "database.eft.client.weather.json"); } - public override void Run(FuyuContext context) + public override void Run(FuyuHttpContext context) { SendJson(context, _response); } diff --git a/Fuyu.Platform.Server/Servers/MainServer.cs b/Fuyu.Platform.Server/Servers/MainServer.cs index 696e3d89..efaa3629 100644 --- a/Fuyu.Platform.Server/Servers/MainServer.cs +++ b/Fuyu.Platform.Server/Servers/MainServer.cs @@ -1,4 +1,4 @@ -using Fuyu.Platform.Common.Http; +using Fuyu.Platform.Common.Networking; using Fuyu.Platform.Server.Behaviours.EFT; namespace Fuyu.Platform.Server.Servers diff --git a/Fuyu.Tests/EndToEnd/BackendTest.cs b/Fuyu.Tests/EndToEnd/BackendTest.cs index 7466acdc..75ce234d 100644 --- a/Fuyu.Tests/EndToEnd/BackendTest.cs +++ b/Fuyu.Tests/EndToEnd/BackendTest.cs @@ -3,7 +3,7 @@ using Microsoft.VisualStudio.TestTools.UnitTesting; using Fuyu.Platform.Server.Servers; using Fuyu.Platform.Server.Databases; -using Fuyu.Platform.Common.Http; +using Fuyu.Platform.Common.Networking; using Fuyu.Platform.Common.Models.EFT.Bots; using Fuyu.Platform.Common.Models.EFT.Requests; using Fuyu.Platform.Common.Serialization; @@ -14,12 +14,12 @@ namespace Fuyu.Tests.EndToEnd [TestClass] public class BackendTest { - private static FuyuClient _client; + private static FuyuHttpClient _client; [AssemblyInitialize] public static void AssemblyInitialize(TestContext testContext) { - _client = new FuyuClient("http://localhost:8000", "test"); + _client = new FuyuHttpClient("http://localhost:8000", "test"); FuyuDatabase.Load(); EftDatabase.Load();