├── docs
├── login.PNG
├── Version6_10.png
└── screenshot.png
├── libs
└── ModniteServer.API.Core.dll
├── ModniteServer
├── Inconsolata-Regular.ttf
├── App.xaml.cs
├── App.config
├── packages.config
├── Properties
│ ├── Settings.settings
│ ├── AssemblyInfo.cs
│ ├── Settings.Designer.cs
│ ├── Resources.Designer.cs
│ └── Resources.resx
├── IUserCommand.cs
├── App.xaml
├── Controls
│ ├── LogStreamSink.cs
│ ├── LogStream.xaml
│ ├── LogStreamEntry.xaml.cs
│ ├── LogStream.xaml.cs
│ └── LogStreamEntry.xaml
├── Commands
│ ├── UpdateCommand.cs
│ ├── CreateAccountCommand.cs
│ ├── DisplayNameCommand.cs
│ ├── GetItemsCommand.cs
│ └── GiveItemCommand.cs
├── Views
│ ├── MainWindow.xaml.cs
│ └── MainWindow.xaml
├── CommandManager.cs
├── ObservableObject.cs
├── ViewModels
│ └── MainViewModel.cs
└── ModniteServer.csproj
├── ModniteServer.Api
├── Assets
│ └── ClientSettings.Sav
├── Controllers
│ ├── AffiliateController.cs
│ ├── TournamentController.cs
│ ├── TelemetryController.cs
│ ├── LightswitchController.cs
│ ├── PrivacyController.cs
│ ├── WaitingRoomController.cs
│ ├── StorefrontController.cs
│ ├── CloudStorageController.cs
│ ├── AccessController.cs
│ ├── AccountController.cs
│ ├── FriendsController.cs
│ ├── CalendarController.cs
│ ├── MatchmakingController.cs
│ ├── CustomizationController.cs
│ ├── ClientQuestController.cs
│ ├── ContentController.cs
│ ├── OAuthController.cs
│ └── ProfileController.cs
├── OAuth
│ ├── OAuthToken.cs
│ └── OAuthManager.cs
├── Controller.cs
├── ModniteServer.API.csproj
├── Accounts
│ ├── Account.cs
│ └── AccountManager.cs
└── ApiConfig.cs
├── ModniteServer.Services
├── ModniteServer.Services.csproj
├── Websockets
│ ├── WebsocketMessageReceivedEventArgs.cs
│ ├── WebsocketNewConnectionEventArgs.cs
│ ├── WebsocketMessage.cs
│ └── WebsocketServer.cs
├── Xmpp
│ ├── XmppClient.cs
│ └── XmppServer.cs
└── Matchmaker
│ └── MatchmakerServer.cs
├── LICENSE
├── ModniteServer.sln
├── README.md
└── .gitignore
/docs/login.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/msx752/ModniteServer/HEAD/docs/login.PNG
--------------------------------------------------------------------------------
/docs/Version6_10.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/msx752/ModniteServer/HEAD/docs/Version6_10.png
--------------------------------------------------------------------------------
/docs/screenshot.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/msx752/ModniteServer/HEAD/docs/screenshot.png
--------------------------------------------------------------------------------
/libs/ModniteServer.API.Core.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/msx752/ModniteServer/HEAD/libs/ModniteServer.API.Core.dll
--------------------------------------------------------------------------------
/ModniteServer/Inconsolata-Regular.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/msx752/ModniteServer/HEAD/ModniteServer/Inconsolata-Regular.ttf
--------------------------------------------------------------------------------
/ModniteServer.Api/Assets/ClientSettings.Sav:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/msx752/ModniteServer/HEAD/ModniteServer.Api/Assets/ClientSettings.Sav
--------------------------------------------------------------------------------
/ModniteServer/App.xaml.cs:
--------------------------------------------------------------------------------
1 | using System.Windows;
2 |
3 | namespace ModniteServer
4 | {
5 | public partial class App : Application
6 | {
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/ModniteServer/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/ModniteServer/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/ModniteServer/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/ModniteServer/IUserCommand.cs:
--------------------------------------------------------------------------------
1 | namespace ModniteServer
2 | {
3 | public interface IUserCommand
4 | {
5 | string Description { get; }
6 |
7 | string ExampleArgs { get; }
8 |
9 | string Args { get; }
10 |
11 | void Handle(string[] args);
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/ModniteServer/App.xaml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/ModniteServer.Api/Controllers/AffiliateController.cs:
--------------------------------------------------------------------------------
1 | using System.Linq;
2 |
3 | namespace ModniteServer.API.Controllers
4 | {
5 | public sealed class AffiliateController : Controller
6 | {
7 | [Route("GET", "/affiliate/api/public/affiliates/slug/*")]
8 | public void CheckIfAffiliateExists()
9 | {
10 | string affiliateName = Request.Url.Segments.Last();
11 |
12 | Response.StatusCode = 404;
13 | }
14 | }
15 | }
--------------------------------------------------------------------------------
/ModniteServer.Services/ModniteServer.Services.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | netstandard2.0
5 | 7.2
6 | ModniteServer
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/ModniteServer/Controls/LogStreamSink.cs:
--------------------------------------------------------------------------------
1 | using Serilog.Core;
2 | using Serilog.Events;
3 |
4 | namespace ModniteServer.Controls
5 | {
6 | public class LogStreamSink : ILogEventSink
7 | {
8 | public LogStreamSink(LogStream logStream)
9 | {
10 | LogStream = logStream;
11 | }
12 |
13 | public LogStream LogStream { get; }
14 |
15 | public void Emit(LogEvent logEvent)
16 | {
17 | LogStream.AppendEvent(logEvent);
18 | }
19 | }
20 | }
--------------------------------------------------------------------------------
/ModniteServer/Commands/UpdateCommand.cs:
--------------------------------------------------------------------------------
1 | using System.Diagnostics;
2 |
3 | namespace ModniteServer.Commands
4 | {
5 | public sealed class UpdateCommand : IUserCommand
6 | {
7 | public string Description => "Gets the latest version of Modnite Server";
8 | public string Args => "";
9 | public string ExampleArgs => "";
10 |
11 | public void Handle(string[] args)
12 | {
13 | Process.Start("https://github.com/ModniteNet/ModniteServer/releases");
14 | }
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/ModniteServer.Services/Websockets/WebsocketMessageReceivedEventArgs.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Net.Sockets;
3 |
4 | namespace ModniteServer.Websockets
5 | {
6 | internal sealed class WebsocketMessageReceivedEventArgs : EventArgs
7 | {
8 | public WebsocketMessageReceivedEventArgs(Socket socket, WebsocketMessage message)
9 | {
10 | Socket = socket;
11 | Message = message;
12 | }
13 |
14 | public Socket Socket { get; }
15 |
16 | public WebsocketMessage Message { get; }
17 | }
18 | }
--------------------------------------------------------------------------------
/ModniteServer.Services/Websockets/WebsocketNewConnectionEventArgs.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Net.Sockets;
3 |
4 | namespace ModniteServer.Websockets
5 | {
6 | internal sealed class WebsocketMessageNewConnectionEventArgs : EventArgs
7 | {
8 | public WebsocketMessageNewConnectionEventArgs(Socket socket, string authorization)
9 | {
10 | Socket = socket;
11 | Authorization = authorization;
12 | }
13 |
14 | public Socket Socket { get; }
15 |
16 | public string Authorization { get; }
17 | }
18 | }
--------------------------------------------------------------------------------
/ModniteServer.Api/OAuth/OAuthToken.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace ModniteServer.API.OAuth
4 | {
5 | ///
6 | /// Represents an OAuth token.
7 | ///
8 | internal struct OAuthToken
9 | {
10 | public OAuthToken(string token, int expiresIn)
11 | {
12 | Token = token;
13 | ExpiresIn = expiresIn;
14 | ExpiresAt = DateTime.UtcNow.Add(TimeSpan.FromSeconds(expiresIn));
15 | }
16 |
17 | public string Token { get; }
18 |
19 | public int ExpiresIn { get; }
20 |
21 | public DateTime ExpiresAt { get; }
22 | }
23 | }
--------------------------------------------------------------------------------
/ModniteServer/Controls/LogStream.xaml:
--------------------------------------------------------------------------------
1 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/ModniteServer.Api/Controller.cs:
--------------------------------------------------------------------------------
1 | using ModniteServer.API.OAuth;
2 |
3 | namespace ModniteServer.API
4 | {
5 | ///
6 | /// Provides a base implementation of an API controller.
7 | ///
8 | public abstract class Controller : ControllerCore
9 | {
10 | protected bool Authorize()
11 | {
12 | return true;
13 |
14 | //string authorization = Request.Headers["Authorization"];
15 |
16 | //if (authorization != null && authorization.StartsWith("bearer "))
17 | //{
18 | // string token = authorization.Split(' ')[1];
19 |
20 | // if (OAuthManager.IsTokenValid(token))
21 | // return true;
22 | //}
23 |
24 | //Response.StatusCode = 403;
25 | //return false;
26 | }
27 | }
28 | }
--------------------------------------------------------------------------------
/ModniteServer/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | // Modnite Server - Copyright © 2018 Modnite Contributors
2 | // Licensed under the Affero General Public License
3 |
4 | using System.Reflection;
5 | using System.Runtime.InteropServices;
6 | using System.Windows;
7 |
8 | [assembly: AssemblyTitle("ModniteServer")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("https://modnite.net")]
12 | [assembly: AssemblyProduct("ModniteServer")]
13 | [assembly: AssemblyCopyright("Copyright © 2018 Modnite Contributors")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 | [assembly: AssemblyVersion("1.0.0.0")]
17 | [assembly: AssemblyFileVersion("1.0.0.0")]
18 |
19 | [assembly: ComVisible(false)]
20 |
21 | [assembly: ThemeInfo(ResourceDictionaryLocation.None, ResourceDictionaryLocation.SourceAssembly)]
--------------------------------------------------------------------------------
/ModniteServer.Api/ModniteServer.API.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | netstandard2.0
5 | 7.2
6 |
7 |
8 |
9 | TRACE
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 | ..\libs\ModniteServer.API.Core.dll
20 |
21 |
22 |
23 |
24 |
25 | Always
26 |
27 |
28 |
29 |
30 |
--------------------------------------------------------------------------------
/ModniteServer.Api/Controllers/TournamentController.cs:
--------------------------------------------------------------------------------
1 | using Newtonsoft.Json;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 |
5 | namespace ModniteServer.API.Controllers
6 | {
7 | public sealed class TournamentController : Controller
8 | {
9 | [Route("GET", "/fortnite/api/game/v2/events/tournamentandhistory/*/*/*")]
10 | public void GetTournaments()
11 | {
12 | string accountId = Request.Url.Segments[Request.Url.Segments.Length - 3].Replace("/", "");
13 | string region = Request.Url.Segments[Request.Url.Segments.Length - 2].Replace("/", "");
14 | string clientType = Request.Url.Segments.Last();
15 |
16 | var response = new
17 | {
18 | eventTournaments = new List