mirror of
https://github.com/recroom2016/OpenRec.git
synced 2026-04-22 13:25:51 +00:00
Add project files.
This commit is contained in:
221
APIServer.cs
Normal file
221
APIServer.cs
Normal file
@@ -0,0 +1,221 @@
|
|||||||
|
using System;
|
||||||
|
using System.IO;
|
||||||
|
using System.Net;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading;
|
||||||
|
using api;
|
||||||
|
using api2018;
|
||||||
|
|
||||||
|
namespace server
|
||||||
|
{
|
||||||
|
|
||||||
|
internal class APIServer
|
||||||
|
{
|
||||||
|
|
||||||
|
public APIServer()
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
Console.WriteLine("APIServer.cs has started.");
|
||||||
|
new Thread(new ThreadStart(this.StartListen)).Start();
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Console.WriteLine("An Exception Occurred while Listening :" + ex.ToString());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void StartListen()
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
this.listener.Prefixes.Add("http://localhost:" + start.Program.version + "/");
|
||||||
|
if (start.Program.version == "2016")
|
||||||
|
{
|
||||||
|
for (; ; )
|
||||||
|
{
|
||||||
|
this.listener.Start();
|
||||||
|
Console.WriteLine("APIServer.cs is listening.");
|
||||||
|
HttpListenerContext context = this.listener.GetContext();
|
||||||
|
HttpListenerRequest request = context.Request;
|
||||||
|
HttpListenerResponse response = context.Response;
|
||||||
|
string rawUrl = request.RawUrl;
|
||||||
|
string Url = "";
|
||||||
|
if (rawUrl.StartsWith("/api/"))
|
||||||
|
{
|
||||||
|
Url = rawUrl.Remove(0, 5);
|
||||||
|
}
|
||||||
|
string text;
|
||||||
|
string s = "";
|
||||||
|
using (StreamReader streamReader = new StreamReader(request.InputStream, request.ContentEncoding))
|
||||||
|
{
|
||||||
|
text = streamReader.ReadToEnd();
|
||||||
|
}
|
||||||
|
if (!(Url == ""))
|
||||||
|
{
|
||||||
|
Console.WriteLine("API Requested: " + Url);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Console.WriteLine("API Requested: " + rawUrl);
|
||||||
|
}
|
||||||
|
Console.WriteLine("API Data: " + text);
|
||||||
|
if (Url.StartsWith("versioncheck"))
|
||||||
|
{
|
||||||
|
s = VersionCheckResponse;
|
||||||
|
}
|
||||||
|
if (Url == ("config/v2"))
|
||||||
|
{
|
||||||
|
s = Config2.GetDebugConfig();
|
||||||
|
}
|
||||||
|
Console.WriteLine("API Response: " + s);
|
||||||
|
byte[] bytes = Encoding.UTF8.GetBytes(s);
|
||||||
|
response.ContentLength64 = (long)bytes.Length;
|
||||||
|
Stream outputStream = response.OutputStream;
|
||||||
|
outputStream.Write(bytes, 0, bytes.Length);
|
||||||
|
Thread.Sleep(400);
|
||||||
|
outputStream.Close();
|
||||||
|
this.listener.Stop();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (start.Program.version == "2017")
|
||||||
|
{
|
||||||
|
for (; ; )
|
||||||
|
{
|
||||||
|
this.listener.Start();
|
||||||
|
Console.WriteLine("APIServer.cs is listening.");
|
||||||
|
HttpListenerContext context = this.listener.GetContext();
|
||||||
|
HttpListenerRequest request = context.Request;
|
||||||
|
HttpListenerResponse response = context.Response;
|
||||||
|
string rawUrl = request.RawUrl;
|
||||||
|
string Url = "";
|
||||||
|
if (rawUrl.StartsWith("/api/"))
|
||||||
|
{
|
||||||
|
Url = rawUrl.Remove(0, 5);
|
||||||
|
}
|
||||||
|
string text;
|
||||||
|
string s = "";
|
||||||
|
using (StreamReader streamReader = new StreamReader(request.InputStream, request.ContentEncoding))
|
||||||
|
{
|
||||||
|
text = streamReader.ReadToEnd();
|
||||||
|
}
|
||||||
|
if (!(Url == ""))
|
||||||
|
{
|
||||||
|
Console.WriteLine("API Requested: " + Url);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Console.WriteLine("API Requested: " + rawUrl);
|
||||||
|
}
|
||||||
|
Console.WriteLine("API Data: " + text);
|
||||||
|
if (Url.StartsWith("versioncheck"))
|
||||||
|
{
|
||||||
|
s = VersionCheckResponse;
|
||||||
|
}
|
||||||
|
if (Url == ("config/v2"))
|
||||||
|
{
|
||||||
|
s = Config2.GetDebugConfig();
|
||||||
|
}
|
||||||
|
Console.WriteLine("API Response: " + s);
|
||||||
|
byte[] bytes = Encoding.UTF8.GetBytes(s);
|
||||||
|
response.ContentLength64 = (long)bytes.Length;
|
||||||
|
Stream outputStream = response.OutputStream;
|
||||||
|
outputStream.Write(bytes, 0, bytes.Length);
|
||||||
|
Thread.Sleep(400);
|
||||||
|
outputStream.Close();
|
||||||
|
this.listener.Stop();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (start.Program.version == "2018")
|
||||||
|
{
|
||||||
|
for (; ; )
|
||||||
|
{
|
||||||
|
this.listener.Start();
|
||||||
|
Console.WriteLine("APIServer.cs is listening.");
|
||||||
|
HttpListenerContext context = this.listener.GetContext();
|
||||||
|
HttpListenerRequest request = context.Request;
|
||||||
|
HttpListenerResponse response = context.Response;
|
||||||
|
string rawUrl = request.RawUrl;
|
||||||
|
string Url = "";
|
||||||
|
if (rawUrl.StartsWith("/api/"))
|
||||||
|
{
|
||||||
|
Url = rawUrl.Remove(0, 5);
|
||||||
|
}
|
||||||
|
if (!(Url == ""))
|
||||||
|
{
|
||||||
|
Console.WriteLine("API Requested: " + Url);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Console.WriteLine("API Requested: " + rawUrl);
|
||||||
|
}
|
||||||
|
string text;
|
||||||
|
string s = "";
|
||||||
|
using (StreamReader streamReader = new StreamReader(request.InputStream, request.ContentEncoding))
|
||||||
|
{
|
||||||
|
text = streamReader.ReadToEnd();
|
||||||
|
}
|
||||||
|
Console.WriteLine("API Data: " + text);
|
||||||
|
if (Url.StartsWith("versioncheck"))
|
||||||
|
{
|
||||||
|
s = VersionCheckResponse;
|
||||||
|
}
|
||||||
|
if (Url == ("config/v2"))
|
||||||
|
{
|
||||||
|
s = Config2.GetDebugConfig();
|
||||||
|
}
|
||||||
|
if (Url == "platformlogin/v1/getcachedlogins")
|
||||||
|
{
|
||||||
|
s = getcachedlogins.GetDebugLogin(ulong.Parse(text.Remove(0, 32)), ulong.Parse(text.Remove(0, 22)));
|
||||||
|
CachedPlayerID = ulong.Parse(text.Remove(0, 32));
|
||||||
|
CachedPlatformID = ulong.Parse(text.Remove(0, 22));
|
||||||
|
}
|
||||||
|
if (Url == "platformlogin/v1/logincached")
|
||||||
|
{
|
||||||
|
s = logincached.loginCache(CachedPlayerID, CachedPlatformID);
|
||||||
|
}
|
||||||
|
if (Url == "relationships/v1/bulkignoreplatformusers")
|
||||||
|
{
|
||||||
|
s = BlankResponse;
|
||||||
|
}
|
||||||
|
if (Url == "config/v1/amplitude")
|
||||||
|
{
|
||||||
|
s = Amplitude.amplitude();
|
||||||
|
}
|
||||||
|
if (Url == "images/v2/named")
|
||||||
|
{
|
||||||
|
s = BlankResponse;
|
||||||
|
}
|
||||||
|
if (Url == "PlayerReporting/v1/moderationBlockDetails")
|
||||||
|
{
|
||||||
|
s = ModerationBlockDetails;
|
||||||
|
}
|
||||||
|
Console.WriteLine("API Response: " + s);
|
||||||
|
byte[] bytes = Encoding.UTF8.GetBytes(s);
|
||||||
|
response.ContentLength64 = (long)bytes.Length;
|
||||||
|
Stream outputStream = response.OutputStream;
|
||||||
|
outputStream.Write(bytes, 0, bytes.Length);
|
||||||
|
Thread.Sleep(400);
|
||||||
|
outputStream.Close();
|
||||||
|
this.listener.Stop();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex4)
|
||||||
|
{
|
||||||
|
Console.WriteLine(ex4);
|
||||||
|
File.WriteAllText("crashdump.txt", Convert.ToString(ex4));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static ulong CachedPlayerID = 1;
|
||||||
|
public static ulong CachedPlatformID = 10000;
|
||||||
|
public static string VersionCheckResponse = "{\"ValidVersion\":true}";
|
||||||
|
public static string BlankResponse = "[]";
|
||||||
|
public static string ModerationBlockDetails = "{\"ReportCategory\":0,\"Duration\":0,\"GameSessionId\":0,\"Message\":\"\"}";
|
||||||
|
public static string ImagesV2Named = "[{\"FriendlyImageName\":\"DormRoomBucket\",\"ImageName\":\"OpenRec\",\"StartTime\":\"2021-12-27T21:27:38.1880175-08:00\",\"EndTime\":\"2043-12-27T21:27:38.1880399-08:00\"}";
|
||||||
|
|
||||||
|
private HttpListener listener = new HttpListener();
|
||||||
|
}
|
||||||
|
}
|
||||||
23
Amplitude.cs
Normal file
23
Amplitude.cs
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
using System;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
|
namespace api
|
||||||
|
{
|
||||||
|
// Token: 0x0200005A RID: 90
|
||||||
|
internal class Amplitude
|
||||||
|
{
|
||||||
|
// Token: 0x0600029D RID: 669 RVA: 0x0000342D File Offset: 0x0000162D
|
||||||
|
public static string amplitude()
|
||||||
|
{
|
||||||
|
return JsonConvert.SerializeObject(new Amplitude
|
||||||
|
{
|
||||||
|
AmplitudeKey = "e1693a1003671058b6abc356c8ba8d59"
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x170000FF RID: 255
|
||||||
|
// (get) Token: 0x0600029F RID: 671 RVA: 0x00003444 File Offset: 0x00001644
|
||||||
|
// (set) Token: 0x060002A0 RID: 672 RVA: 0x0000344C File Offset: 0x0000164C
|
||||||
|
public string AmplitudeKey { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
14
Avatar.cs
Normal file
14
Avatar.cs
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
namespace api
|
||||||
|
{
|
||||||
|
class Avatar
|
||||||
|
{
|
||||||
|
public string OutfitSelections { get; set; }
|
||||||
|
public string HairColor { get; set; }
|
||||||
|
public string SkinColor { get; set; }
|
||||||
|
public string FaceFeatures { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
163
Config.cs
Normal file
163
Config.cs
Normal file
@@ -0,0 +1,163 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Text;
|
||||||
|
using System.IO;
|
||||||
|
using System.Net;
|
||||||
|
|
||||||
|
namespace api
|
||||||
|
{
|
||||||
|
class Config
|
||||||
|
{
|
||||||
|
|
||||||
|
public static void setup()
|
||||||
|
{
|
||||||
|
Console.WriteLine("Setting up...");
|
||||||
|
Directory.CreateDirectory("SaveData\\Profile\\");
|
||||||
|
if (!(File.Exists("SaveData\\avatar.txt")))
|
||||||
|
{
|
||||||
|
File.Create("SaveData\\avatar.txt");
|
||||||
|
}
|
||||||
|
if (!(File.Exists("SaveData\\Profile\\username.txt")))
|
||||||
|
{
|
||||||
|
File.WriteAllText("SaveData\\Profile\\username.txt", "DefaultUsername");
|
||||||
|
}
|
||||||
|
if (!(File.Exists("SaveData\\profileimage.png")))
|
||||||
|
{
|
||||||
|
File.WriteAllBytes("SaveData\\profileimage.png", new WebClient().DownloadData("https://github.com/OpenRecRoom/OpenRec/raw/main/profileimage.png"));
|
||||||
|
}
|
||||||
|
Console.WriteLine("Done!");
|
||||||
|
Console.Clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Objective[][] dailyObjectives = new Objective[][]
|
||||||
|
{
|
||||||
|
new Objective[]
|
||||||
|
{
|
||||||
|
new Objective
|
||||||
|
{
|
||||||
|
type = 20,
|
||||||
|
score = 1
|
||||||
|
},
|
||||||
|
new Objective
|
||||||
|
{
|
||||||
|
type = 21,
|
||||||
|
score = 1
|
||||||
|
},
|
||||||
|
new Objective
|
||||||
|
{
|
||||||
|
type = 22,
|
||||||
|
score = 1
|
||||||
|
}
|
||||||
|
},
|
||||||
|
new Objective[]
|
||||||
|
{
|
||||||
|
new Objective
|
||||||
|
{
|
||||||
|
type = 20,
|
||||||
|
score = 1
|
||||||
|
},
|
||||||
|
new Objective
|
||||||
|
{
|
||||||
|
type = 21,
|
||||||
|
score = 1
|
||||||
|
},
|
||||||
|
new Objective
|
||||||
|
{
|
||||||
|
type = 22,
|
||||||
|
score = 1
|
||||||
|
}
|
||||||
|
},
|
||||||
|
new Objective[]
|
||||||
|
{
|
||||||
|
new Objective
|
||||||
|
{
|
||||||
|
type = 20,
|
||||||
|
score = 1
|
||||||
|
},
|
||||||
|
new Objective
|
||||||
|
{
|
||||||
|
type = 21,
|
||||||
|
score = 1
|
||||||
|
},
|
||||||
|
new Objective
|
||||||
|
{
|
||||||
|
type = 22,
|
||||||
|
score = 1
|
||||||
|
}
|
||||||
|
},
|
||||||
|
new Objective[]
|
||||||
|
{
|
||||||
|
new Objective
|
||||||
|
{
|
||||||
|
type = 20,
|
||||||
|
score = 1
|
||||||
|
},
|
||||||
|
new Objective
|
||||||
|
{
|
||||||
|
type = 21,
|
||||||
|
score = 1
|
||||||
|
},
|
||||||
|
new Objective
|
||||||
|
{
|
||||||
|
type = 22,
|
||||||
|
score = 1
|
||||||
|
}
|
||||||
|
},
|
||||||
|
new Objective[]
|
||||||
|
{
|
||||||
|
new Objective
|
||||||
|
{
|
||||||
|
type = 20,
|
||||||
|
score = 1
|
||||||
|
},
|
||||||
|
new Objective
|
||||||
|
{
|
||||||
|
type = 21,
|
||||||
|
score = 1
|
||||||
|
},
|
||||||
|
new Objective
|
||||||
|
{
|
||||||
|
type = 22,
|
||||||
|
score = 1
|
||||||
|
}
|
||||||
|
},
|
||||||
|
new Objective[]
|
||||||
|
{
|
||||||
|
new Objective
|
||||||
|
{
|
||||||
|
type = 20,
|
||||||
|
score = 1
|
||||||
|
},
|
||||||
|
new Objective
|
||||||
|
{
|
||||||
|
type = 21,
|
||||||
|
score = 1
|
||||||
|
},
|
||||||
|
new Objective
|
||||||
|
{
|
||||||
|
type = 22,
|
||||||
|
score = 1
|
||||||
|
}
|
||||||
|
},
|
||||||
|
new Objective[]
|
||||||
|
{
|
||||||
|
new Objective
|
||||||
|
{
|
||||||
|
type = 20,
|
||||||
|
score = 1
|
||||||
|
},
|
||||||
|
new Objective
|
||||||
|
{
|
||||||
|
type = 21,
|
||||||
|
score = 1
|
||||||
|
},
|
||||||
|
new Objective
|
||||||
|
{
|
||||||
|
type = 22,
|
||||||
|
score = 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
192
Config2.cs
Normal file
192
Config2.cs
Normal file
@@ -0,0 +1,192 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.IO;
|
||||||
|
using System.Net;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using api;
|
||||||
|
|
||||||
|
namespace api
|
||||||
|
{
|
||||||
|
// Token: 0x02000013 RID: 19
|
||||||
|
internal class Config2
|
||||||
|
{
|
||||||
|
// Token: 0x17000011 RID: 17
|
||||||
|
// (get) Token: 0x06000050 RID: 80 RVA: 0x00002215 File Offset: 0x00000415
|
||||||
|
// (set) Token: 0x06000051 RID: 81 RVA: 0x0000221D File Offset: 0x0000041D
|
||||||
|
public string MessageOfTheDay { get; set; }
|
||||||
|
|
||||||
|
// Token: 0x17000012 RID: 18
|
||||||
|
// (get) Token: 0x06000052 RID: 82 RVA: 0x00002226 File Offset: 0x00000426
|
||||||
|
// (set) Token: 0x06000053 RID: 83 RVA: 0x0000222E File Offset: 0x0000042E
|
||||||
|
public string CdnBaseUri { get; set; }
|
||||||
|
|
||||||
|
// Token: 0x17000013 RID: 19
|
||||||
|
// (get) Token: 0x06000054 RID: 84 RVA: 0x00002237 File Offset: 0x00000437
|
||||||
|
// (set) Token: 0x06000055 RID: 85 RVA: 0x0000223F File Offset: 0x0000043F
|
||||||
|
public List<LevelProgressionEntry> LevelProgressionMaps { get; set; }
|
||||||
|
|
||||||
|
// Token: 0x17000014 RID: 20
|
||||||
|
// (get) Token: 0x06000056 RID: 86 RVA: 0x00002248 File Offset: 0x00000448
|
||||||
|
// (set) Token: 0x06000057 RID: 87 RVA: 0x00002250 File Offset: 0x00000450
|
||||||
|
public MatchmakingConfigParams MatchmakingParams { get; set; }
|
||||||
|
|
||||||
|
// Token: 0x17000015 RID: 21
|
||||||
|
// (get) Token: 0x06000058 RID: 88 RVA: 0x00002259 File Offset: 0x00000459
|
||||||
|
// (set) Token: 0x06000059 RID: 89 RVA: 0x00002261 File Offset: 0x00000461
|
||||||
|
public Objective[][] DailyObjectives { get; set; }
|
||||||
|
|
||||||
|
// Token: 0x17000016 RID: 22
|
||||||
|
// (get) Token: 0x0600005A RID: 90 RVA: 0x0000226A File Offset: 0x0000046A
|
||||||
|
// (set) Token: 0x0600005B RID: 91 RVA: 0x00002272 File Offset: 0x00000472
|
||||||
|
public List<ConfigTableEntry> ConfigTable { get; set; }
|
||||||
|
|
||||||
|
// Token: 0x17000017 RID: 23
|
||||||
|
// (get) Token: 0x0600005C RID: 92 RVA: 0x0000227B File Offset: 0x0000047B
|
||||||
|
// (set) Token: 0x0600005D RID: 93 RVA: 0x00002283 File Offset: 0x00000483
|
||||||
|
public photonConfig PhotonConfig { get; set; }
|
||||||
|
|
||||||
|
// Token: 0x0600005E RID: 94 RVA: 0x00005450 File Offset: 0x00003650
|
||||||
|
public static string GetDebugConfig()
|
||||||
|
{
|
||||||
|
|
||||||
|
return JsonConvert.SerializeObject(new Config2
|
||||||
|
{
|
||||||
|
MessageOfTheDay = "Default MOTD",
|
||||||
|
CdnBaseUri = "http://img.rec.net/",
|
||||||
|
LevelProgressionMaps = new List<LevelProgressionEntry>
|
||||||
|
{
|
||||||
|
new LevelProgressionEntry
|
||||||
|
{
|
||||||
|
Level = 0,
|
||||||
|
RequiredXp = 1
|
||||||
|
},
|
||||||
|
new LevelProgressionEntry
|
||||||
|
{
|
||||||
|
Level = 1,
|
||||||
|
RequiredXp = 2
|
||||||
|
},
|
||||||
|
new LevelProgressionEntry
|
||||||
|
{
|
||||||
|
Level = 2,
|
||||||
|
RequiredXp = 3
|
||||||
|
},
|
||||||
|
new LevelProgressionEntry
|
||||||
|
{
|
||||||
|
Level = 3,
|
||||||
|
RequiredXp = 4
|
||||||
|
},
|
||||||
|
new LevelProgressionEntry
|
||||||
|
{
|
||||||
|
Level = 4,
|
||||||
|
RequiredXp = 5
|
||||||
|
},
|
||||||
|
new LevelProgressionEntry
|
||||||
|
{
|
||||||
|
Level = 5,
|
||||||
|
RequiredXp = 6
|
||||||
|
},
|
||||||
|
new LevelProgressionEntry
|
||||||
|
{
|
||||||
|
Level = 6,
|
||||||
|
RequiredXp = 7
|
||||||
|
},
|
||||||
|
new LevelProgressionEntry
|
||||||
|
{
|
||||||
|
Level = 7,
|
||||||
|
RequiredXp = 8
|
||||||
|
},
|
||||||
|
new LevelProgressionEntry
|
||||||
|
{
|
||||||
|
Level = 8,
|
||||||
|
RequiredXp = 9
|
||||||
|
},
|
||||||
|
new LevelProgressionEntry
|
||||||
|
{
|
||||||
|
Level = 9,
|
||||||
|
RequiredXp = 10
|
||||||
|
},
|
||||||
|
new LevelProgressionEntry
|
||||||
|
{
|
||||||
|
Level = 10,
|
||||||
|
RequiredXp = 11
|
||||||
|
},
|
||||||
|
new LevelProgressionEntry
|
||||||
|
{
|
||||||
|
Level = 11,
|
||||||
|
RequiredXp = 12
|
||||||
|
},
|
||||||
|
new LevelProgressionEntry
|
||||||
|
{
|
||||||
|
Level = 12,
|
||||||
|
RequiredXp = 13
|
||||||
|
},
|
||||||
|
new LevelProgressionEntry
|
||||||
|
{
|
||||||
|
Level = 13,
|
||||||
|
RequiredXp = 14
|
||||||
|
},
|
||||||
|
new LevelProgressionEntry
|
||||||
|
{
|
||||||
|
Level = 14,
|
||||||
|
RequiredXp = 15
|
||||||
|
},
|
||||||
|
new LevelProgressionEntry
|
||||||
|
{
|
||||||
|
Level = 15,
|
||||||
|
RequiredXp = 16
|
||||||
|
},
|
||||||
|
new LevelProgressionEntry
|
||||||
|
{
|
||||||
|
Level = 16,
|
||||||
|
RequiredXp = 17
|
||||||
|
},
|
||||||
|
new LevelProgressionEntry
|
||||||
|
{
|
||||||
|
Level = 17,
|
||||||
|
RequiredXp = 18
|
||||||
|
},
|
||||||
|
new LevelProgressionEntry
|
||||||
|
{
|
||||||
|
Level = 18,
|
||||||
|
RequiredXp = 19
|
||||||
|
},
|
||||||
|
new LevelProgressionEntry
|
||||||
|
{
|
||||||
|
Level = 19,
|
||||||
|
RequiredXp = 20
|
||||||
|
},
|
||||||
|
new LevelProgressionEntry
|
||||||
|
{
|
||||||
|
Level = 20,
|
||||||
|
RequiredXp = 21
|
||||||
|
}
|
||||||
|
},
|
||||||
|
MatchmakingParams = new MatchmakingConfigParams
|
||||||
|
{
|
||||||
|
PreferEmptyRoomsFrequency = 0f,
|
||||||
|
PreferFullRoomsFrequency = 1f
|
||||||
|
},
|
||||||
|
DailyObjectives = Config.dailyObjectives,
|
||||||
|
ConfigTable = new List<ConfigTableEntry>
|
||||||
|
{
|
||||||
|
new ConfigTableEntry
|
||||||
|
{
|
||||||
|
Key = "Gift.DropChance",
|
||||||
|
Value = 0.5f.ToString()
|
||||||
|
},
|
||||||
|
new ConfigTableEntry
|
||||||
|
{
|
||||||
|
Key = "Gift.XP",
|
||||||
|
Value = 0.5f.ToString()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
PhotonConfig = new photonConfig
|
||||||
|
{
|
||||||
|
CloudRegion = "us",
|
||||||
|
CrcCheckEnabled = false,
|
||||||
|
EnableServerTracingAfterDisconnect = false
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
18
ConfigTableEntry.cs
Normal file
18
ConfigTableEntry.cs
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
using System;
|
||||||
|
|
||||||
|
namespace api
|
||||||
|
{
|
||||||
|
// Token: 0x02000019 RID: 25
|
||||||
|
internal class ConfigTableEntry
|
||||||
|
{
|
||||||
|
// Token: 0x17000022 RID: 34
|
||||||
|
// (get) Token: 0x0600007A RID: 122 RVA: 0x00002336 File Offset: 0x00000536
|
||||||
|
// (set) Token: 0x0600007B RID: 123 RVA: 0x0000233E File Offset: 0x0000053E
|
||||||
|
public string Key { get; set; }
|
||||||
|
|
||||||
|
// Token: 0x17000023 RID: 35
|
||||||
|
// (get) Token: 0x0600007C RID: 124 RVA: 0x00002347 File Offset: 0x00000547
|
||||||
|
// (set) Token: 0x0600007D RID: 125 RVA: 0x0000234F File Offset: 0x0000054F
|
||||||
|
public string Value { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
139
GetCachedLogin.cs
Normal file
139
GetCachedLogin.cs
Normal file
@@ -0,0 +1,139 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using api2018;
|
||||||
|
using System.IO;
|
||||||
|
|
||||||
|
namespace api2018
|
||||||
|
{
|
||||||
|
// Token: 0x02000076 RID: 118
|
||||||
|
public class getcachedlogins
|
||||||
|
{
|
||||||
|
// Token: 0x0600033C RID: 828 RVA: 0x00008F30 File Offset: 0x00007130
|
||||||
|
public static string GetDebugLogin(ulong userid, ulong platformid)
|
||||||
|
{
|
||||||
|
string name = File.ReadAllText("SaveData\\Profile\\username.txt");
|
||||||
|
return JsonConvert.SerializeObject(new List<getcachedlogins>
|
||||||
|
{
|
||||||
|
new getcachedlogins
|
||||||
|
{
|
||||||
|
Id = userid,
|
||||||
|
Username = name,
|
||||||
|
DisplayName = name,
|
||||||
|
XP = 9999,
|
||||||
|
Level = 10,
|
||||||
|
RegistrationStatus = 2,
|
||||||
|
Developer = false,
|
||||||
|
CanReceiveInvites = false,
|
||||||
|
ProfileImageName = name,
|
||||||
|
JuniorProfile = false,
|
||||||
|
ForceJuniorImages = false,
|
||||||
|
PendingJunior = false,
|
||||||
|
HasBirthday = true,
|
||||||
|
AvoidJuniors = true,
|
||||||
|
PlayerReputation = new mPlayerReputation
|
||||||
|
{
|
||||||
|
Noteriety = 0,
|
||||||
|
CheerCredit = 20,
|
||||||
|
CheerGeneral = 10,
|
||||||
|
CheerHelpful = 10,
|
||||||
|
CheerGreatHost = 10,
|
||||||
|
CheerSportsman = 10,
|
||||||
|
CheerCreative = 10,
|
||||||
|
SubscriberCount = 0,
|
||||||
|
SubscribedCount = 0,
|
||||||
|
SelectedCheer = 0
|
||||||
|
},
|
||||||
|
PlatformIds = new List<mPlatformID>
|
||||||
|
{
|
||||||
|
new mPlatformID
|
||||||
|
{
|
||||||
|
Platform = 0,
|
||||||
|
PlatformId = platformid
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x17000135 RID: 309
|
||||||
|
// (get) Token: 0x0600033D RID: 829 RVA: 0x0000395C File Offset: 0x00001B5C
|
||||||
|
// (set) Token: 0x0600033E RID: 830 RVA: 0x00003964 File Offset: 0x00001B64
|
||||||
|
public ulong Id { get; set; }
|
||||||
|
|
||||||
|
// Token: 0x17000136 RID: 310
|
||||||
|
// (get) Token: 0x0600033F RID: 831 RVA: 0x0000396D File Offset: 0x00001B6D
|
||||||
|
// (set) Token: 0x06000340 RID: 832 RVA: 0x00003975 File Offset: 0x00001B75
|
||||||
|
public string Username { get; set; }
|
||||||
|
|
||||||
|
// Token: 0x17000137 RID: 311
|
||||||
|
// (get) Token: 0x06000341 RID: 833 RVA: 0x0000397E File Offset: 0x00001B7E
|
||||||
|
// (set) Token: 0x06000342 RID: 834 RVA: 0x00003986 File Offset: 0x00001B86
|
||||||
|
public string DisplayName { get; set; }
|
||||||
|
|
||||||
|
// Token: 0x17000138 RID: 312
|
||||||
|
// (get) Token: 0x06000343 RID: 835 RVA: 0x0000398F File Offset: 0x00001B8F
|
||||||
|
// (set) Token: 0x06000344 RID: 836 RVA: 0x00003997 File Offset: 0x00001B97
|
||||||
|
public int XP { get; set; }
|
||||||
|
|
||||||
|
// Token: 0x17000139 RID: 313
|
||||||
|
// (get) Token: 0x06000345 RID: 837 RVA: 0x000039A0 File Offset: 0x00001BA0
|
||||||
|
// (set) Token: 0x06000346 RID: 838 RVA: 0x000039A8 File Offset: 0x00001BA8
|
||||||
|
public int Level { get; set; }
|
||||||
|
|
||||||
|
// Token: 0x1700013A RID: 314
|
||||||
|
// (get) Token: 0x06000347 RID: 839 RVA: 0x000039B1 File Offset: 0x00001BB1
|
||||||
|
// (set) Token: 0x06000348 RID: 840 RVA: 0x000039B9 File Offset: 0x00001BB9
|
||||||
|
public int RegistrationStatus { get; set; }
|
||||||
|
|
||||||
|
// Token: 0x1700013B RID: 315
|
||||||
|
// (get) Token: 0x06000349 RID: 841 RVA: 0x000039C2 File Offset: 0x00001BC2
|
||||||
|
// (set) Token: 0x0600034A RID: 842 RVA: 0x000039CA File Offset: 0x00001BCA
|
||||||
|
public bool Developer { get; set; }
|
||||||
|
|
||||||
|
// Token: 0x1700013C RID: 316
|
||||||
|
// (get) Token: 0x0600034B RID: 843 RVA: 0x000039D3 File Offset: 0x00001BD3
|
||||||
|
// (set) Token: 0x0600034C RID: 844 RVA: 0x000039DB File Offset: 0x00001BDB
|
||||||
|
public bool CanReceiveInvites { get; set; }
|
||||||
|
|
||||||
|
// Token: 0x1700013D RID: 317
|
||||||
|
// (get) Token: 0x0600034D RID: 845 RVA: 0x000039E4 File Offset: 0x00001BE4
|
||||||
|
// (set) Token: 0x0600034E RID: 846 RVA: 0x000039EC File Offset: 0x00001BEC
|
||||||
|
public string ProfileImageName { get; set; }
|
||||||
|
|
||||||
|
// Token: 0x1700013E RID: 318
|
||||||
|
// (get) Token: 0x0600034F RID: 847 RVA: 0x000039F5 File Offset: 0x00001BF5
|
||||||
|
// (set) Token: 0x06000350 RID: 848 RVA: 0x000039FD File Offset: 0x00001BFD
|
||||||
|
public bool JuniorProfile { get; set; }
|
||||||
|
|
||||||
|
// Token: 0x1700013F RID: 319
|
||||||
|
// (get) Token: 0x06000351 RID: 849 RVA: 0x00003A06 File Offset: 0x00001C06
|
||||||
|
// (set) Token: 0x06000352 RID: 850 RVA: 0x00003A0E File Offset: 0x00001C0E
|
||||||
|
public bool ForceJuniorImages { get; set; }
|
||||||
|
|
||||||
|
// Token: 0x17000140 RID: 320
|
||||||
|
// (get) Token: 0x06000353 RID: 851 RVA: 0x00003A17 File Offset: 0x00001C17
|
||||||
|
// (set) Token: 0x06000354 RID: 852 RVA: 0x00003A1F File Offset: 0x00001C1F
|
||||||
|
public bool PendingJunior { get; set; }
|
||||||
|
|
||||||
|
// Token: 0x17000141 RID: 321
|
||||||
|
// (get) Token: 0x06000355 RID: 853 RVA: 0x00003A28 File Offset: 0x00001C28
|
||||||
|
// (set) Token: 0x06000356 RID: 854 RVA: 0x00003A30 File Offset: 0x00001C30
|
||||||
|
public bool HasBirthday { get; set; }
|
||||||
|
|
||||||
|
// Token: 0x17000142 RID: 322
|
||||||
|
// (get) Token: 0x06000357 RID: 855 RVA: 0x00003A39 File Offset: 0x00001C39
|
||||||
|
// (set) Token: 0x06000358 RID: 856 RVA: 0x00003A41 File Offset: 0x00001C41
|
||||||
|
public bool AvoidJuniors { get; set; }
|
||||||
|
|
||||||
|
// Token: 0x17000143 RID: 323
|
||||||
|
// (get) Token: 0x06000359 RID: 857 RVA: 0x00003A4A File Offset: 0x00001C4A
|
||||||
|
// (set) Token: 0x0600035A RID: 858 RVA: 0x00003A52 File Offset: 0x00001C52
|
||||||
|
public mPlayerReputation PlayerReputation { get; set; }
|
||||||
|
|
||||||
|
// Token: 0x17000144 RID: 324
|
||||||
|
// (get) Token: 0x0600035B RID: 859 RVA: 0x00003A5B File Offset: 0x00001C5B
|
||||||
|
// (set) Token: 0x0600035C RID: 860 RVA: 0x00003A63 File Offset: 0x00001C63
|
||||||
|
public List<mPlatformID> PlatformIds { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
67
ImageServer.cs
Normal file
67
ImageServer.cs
Normal file
@@ -0,0 +1,67 @@
|
|||||||
|
using System;
|
||||||
|
using System.IO;
|
||||||
|
using System.Net;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading;
|
||||||
|
using api;
|
||||||
|
|
||||||
|
namespace server
|
||||||
|
{
|
||||||
|
// Token: 0x02000050 RID: 80
|
||||||
|
internal class ImageServer
|
||||||
|
{
|
||||||
|
// Token: 0x06000227 RID: 551 RVA: 0x00006D1C File Offset: 0x00004F1C
|
||||||
|
public ImageServer()
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
Console.WriteLine("ImageServer.cs has started.");
|
||||||
|
new Thread(new ThreadStart(this.StartListen)).Start();
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Console.WriteLine("An Exception Occurred while Listening :" + ex.ToString());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x06000228 RID: 552 RVA: 0x00006D84 File Offset: 0x00004F84
|
||||||
|
private void StartListen()
|
||||||
|
{
|
||||||
|
this.listener.Prefixes.Add("http://localhost:20182/");
|
||||||
|
for (; ; )
|
||||||
|
{
|
||||||
|
this.listener.Start();
|
||||||
|
Console.WriteLine("ImageServer.cs is listening.");
|
||||||
|
HttpListenerContext context = this.listener.GetContext();
|
||||||
|
HttpListenerRequest request = context.Request;
|
||||||
|
HttpListenerResponse response = context.Response;
|
||||||
|
string rawUrl = request.RawUrl;
|
||||||
|
string text;
|
||||||
|
byte[] i = File.ReadAllBytes("SaveData\\profileimage.png");
|
||||||
|
using (StreamReader streamReader = new StreamReader(request.InputStream, request.ContentEncoding))
|
||||||
|
{
|
||||||
|
text = streamReader.ReadToEnd();
|
||||||
|
}
|
||||||
|
Console.WriteLine("Image Requested: " + rawUrl);
|
||||||
|
Console.WriteLine("Image Data: " + text);
|
||||||
|
Console.WriteLine("Image Response: ");
|
||||||
|
byte[] bytes = i;
|
||||||
|
response.ContentLength64 = (long)bytes.Length;
|
||||||
|
Stream outputStream = response.OutputStream;
|
||||||
|
outputStream.Write(bytes, 0, bytes.Length);
|
||||||
|
Thread.Sleep(400);
|
||||||
|
outputStream.Close();
|
||||||
|
this.listener.Stop();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static string VersionCheckResponse = "{\"ValidVersion\":true}";
|
||||||
|
|
||||||
|
public static string BlankResponse = "";
|
||||||
|
|
||||||
|
|
||||||
|
// Token: 0x04000192 RID: 402
|
||||||
|
private HttpListener listener = new HttpListener();
|
||||||
|
}
|
||||||
|
}
|
||||||
18
LevelProgressionEntry.cs
Normal file
18
LevelProgressionEntry.cs
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
using System;
|
||||||
|
|
||||||
|
namespace api
|
||||||
|
{
|
||||||
|
// Token: 0x02000017 RID: 23
|
||||||
|
public class LevelProgressionEntry
|
||||||
|
{
|
||||||
|
// Token: 0x1700001E RID: 30
|
||||||
|
// (get) Token: 0x06000070 RID: 112 RVA: 0x000022F2 File Offset: 0x000004F2
|
||||||
|
// (set) Token: 0x06000071 RID: 113 RVA: 0x000022FA File Offset: 0x000004FA
|
||||||
|
public int Level { get; set; }
|
||||||
|
|
||||||
|
// Token: 0x1700001F RID: 31
|
||||||
|
// (get) Token: 0x06000072 RID: 114 RVA: 0x00002303 File Offset: 0x00000503
|
||||||
|
// (set) Token: 0x06000073 RID: 115 RVA: 0x0000230B File Offset: 0x0000050B
|
||||||
|
public int RequiredXp { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
93
LoginCached.cs
Normal file
93
LoginCached.cs
Normal file
@@ -0,0 +1,93 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using System.IO;
|
||||||
|
|
||||||
|
namespace api2018
|
||||||
|
{
|
||||||
|
// Token: 0x02000078 RID: 120
|
||||||
|
public class logincached
|
||||||
|
{
|
||||||
|
// Token: 0x17000145 RID: 325
|
||||||
|
// (get) Token: 0x0600035E RID: 862 RVA: 0x00003A6C File Offset: 0x00001C6C
|
||||||
|
// (set) Token: 0x0600035F RID: 863 RVA: 0x00003A74 File Offset: 0x00001C74
|
||||||
|
public string Error { get; set; }
|
||||||
|
|
||||||
|
// Token: 0x17000146 RID: 326
|
||||||
|
// (get) Token: 0x06000360 RID: 864 RVA: 0x00003A7D File Offset: 0x00001C7D
|
||||||
|
// (set) Token: 0x06000361 RID: 865 RVA: 0x00003A85 File Offset: 0x00001C85
|
||||||
|
public getcachedlogins Player { get; set; }
|
||||||
|
|
||||||
|
// Token: 0x17000147 RID: 327
|
||||||
|
// (get) Token: 0x06000362 RID: 866 RVA: 0x00003A8E File Offset: 0x00001C8E
|
||||||
|
// (set) Token: 0x06000363 RID: 867 RVA: 0x00003A96 File Offset: 0x00001C96
|
||||||
|
public string Token { get; set; }
|
||||||
|
|
||||||
|
// Token: 0x17000148 RID: 328
|
||||||
|
// (get) Token: 0x06000364 RID: 868 RVA: 0x00003A9F File Offset: 0x00001C9F
|
||||||
|
// (set) Token: 0x06000365 RID: 869 RVA: 0x00003AA7 File Offset: 0x00001CA7
|
||||||
|
public bool FirstLoginOfTheDay { get; set; }
|
||||||
|
|
||||||
|
// Token: 0x17000149 RID: 329
|
||||||
|
// (get) Token: 0x06000366 RID: 870 RVA: 0x00003AB0 File Offset: 0x00001CB0
|
||||||
|
// (set) Token: 0x06000367 RID: 871 RVA: 0x00003AB8 File Offset: 0x00001CB8
|
||||||
|
public ulong AnalyticsSessionId { get; set; }
|
||||||
|
|
||||||
|
// Token: 0x1700014A RID: 330
|
||||||
|
// (get) Token: 0x06000368 RID: 872 RVA: 0x00003AC1 File Offset: 0x00001CC1
|
||||||
|
// (set) Token: 0x06000369 RID: 873 RVA: 0x00003AC9 File Offset: 0x00001CC9
|
||||||
|
public bool CanUseScreenMode { get; set; }
|
||||||
|
|
||||||
|
// Token: 0x0600036A RID: 874 RVA: 0x00009044 File Offset: 0x00007244
|
||||||
|
public static string loginCache(ulong userid, ulong platformid)
|
||||||
|
{
|
||||||
|
string name = File.ReadAllText("SaveData\\Profile\\username.txt");
|
||||||
|
return JsonConvert.SerializeObject(new logincached
|
||||||
|
{
|
||||||
|
Error = "",
|
||||||
|
Player = new getcachedlogins
|
||||||
|
{
|
||||||
|
Id = userid,
|
||||||
|
Username = name,
|
||||||
|
DisplayName = name,
|
||||||
|
XP = 9999,
|
||||||
|
Level = 10,
|
||||||
|
RegistrationStatus = 2,
|
||||||
|
Developer = false,
|
||||||
|
CanReceiveInvites = false,
|
||||||
|
ProfileImageName = name,
|
||||||
|
JuniorProfile = false,
|
||||||
|
ForceJuniorImages = false,
|
||||||
|
PendingJunior = false,
|
||||||
|
HasBirthday = true,
|
||||||
|
AvoidJuniors = true,
|
||||||
|
PlayerReputation = new mPlayerReputation
|
||||||
|
{
|
||||||
|
Noteriety = 0,
|
||||||
|
CheerCredit = 20,
|
||||||
|
CheerGeneral = 10,
|
||||||
|
CheerHelpful = 10,
|
||||||
|
CheerGreatHost = 10,
|
||||||
|
CheerSportsman = 10,
|
||||||
|
CheerCreative = 10,
|
||||||
|
SubscriberCount = 0,
|
||||||
|
SubscribedCount = 0,
|
||||||
|
SelectedCheer = 0
|
||||||
|
},
|
||||||
|
PlatformIds = new List<mPlatformID>
|
||||||
|
{
|
||||||
|
new mPlatformID
|
||||||
|
{
|
||||||
|
Platform = 0,
|
||||||
|
PlatformId = platformid
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
Token = "NoKeyProvided",
|
||||||
|
FirstLoginOfTheDay = true,
|
||||||
|
AnalyticsSessionId = 392394UL,
|
||||||
|
CanUseScreenMode = true
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
18
MatchmakingConfigParams.cs
Normal file
18
MatchmakingConfigParams.cs
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
using System;
|
||||||
|
|
||||||
|
namespace api
|
||||||
|
{
|
||||||
|
// Token: 0x02000015 RID: 21
|
||||||
|
internal class MatchmakingConfigParams
|
||||||
|
{
|
||||||
|
// Token: 0x17000019 RID: 25
|
||||||
|
// (get) Token: 0x06000064 RID: 100 RVA: 0x0000229D File Offset: 0x0000049D
|
||||||
|
// (set) Token: 0x06000065 RID: 101 RVA: 0x000022A5 File Offset: 0x000004A5
|
||||||
|
public float PreferFullRoomsFrequency { get; set; }
|
||||||
|
|
||||||
|
// Token: 0x1700001A RID: 26
|
||||||
|
// (get) Token: 0x06000066 RID: 102 RVA: 0x000022AE File Offset: 0x000004AE
|
||||||
|
// (set) Token: 0x06000067 RID: 103 RVA: 0x000022B6 File Offset: 0x000004B6
|
||||||
|
public float PreferEmptyRoomsFrequency { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
59
NameServer.cs
Normal file
59
NameServer.cs
Normal file
@@ -0,0 +1,59 @@
|
|||||||
|
using System;
|
||||||
|
using System.IO;
|
||||||
|
using System.Net;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading;
|
||||||
|
|
||||||
|
namespace server
|
||||||
|
{
|
||||||
|
// Token: 0x02000050 RID: 80
|
||||||
|
internal class NameServer
|
||||||
|
{
|
||||||
|
// Token: 0x06000227 RID: 551 RVA: 0x00006D1C File Offset: 0x00004F1C
|
||||||
|
public NameServer()
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
Console.WriteLine("NameServer.cs has started.");
|
||||||
|
new Thread(new ThreadStart(this.StartListen)).Start();
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Console.WriteLine("An Exception Occurred while Listening :" + ex.ToString());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x06000228 RID: 552 RVA: 0x00006D84 File Offset: 0x00004F84
|
||||||
|
private void StartListen()
|
||||||
|
{
|
||||||
|
this.listener.Prefixes.Add("http://localhost:20181/");
|
||||||
|
for (; ; )
|
||||||
|
{
|
||||||
|
this.listener.Start();
|
||||||
|
Console.WriteLine("NameServer.cs is listening.");
|
||||||
|
HttpListenerContext context = this.listener.GetContext();
|
||||||
|
HttpListenerRequest request = context.Request;
|
||||||
|
HttpListenerResponse response = context.Response;
|
||||||
|
string rawUrl = request.RawUrl;
|
||||||
|
string s = "";
|
||||||
|
s = "{\"API\":\"http://localhost:2018\",\"Notifications\":\"http://localhost:20161\",\"Images\":\"http://localhost:20182\"}";
|
||||||
|
Console.WriteLine("API Response: " + s);
|
||||||
|
byte[] bytes = Encoding.UTF8.GetBytes(s);
|
||||||
|
response.ContentLength64 = (long)bytes.Length;
|
||||||
|
Stream outputStream = response.OutputStream;
|
||||||
|
outputStream.Write(bytes, 0, bytes.Length);
|
||||||
|
Thread.Sleep(400);
|
||||||
|
outputStream.Close();
|
||||||
|
this.listener.Stop();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static string VersionCheckResponse = "{\"ValidVersion\":true}";
|
||||||
|
|
||||||
|
public static string BlankResponse = "";
|
||||||
|
|
||||||
|
|
||||||
|
// Token: 0x04000192 RID: 402
|
||||||
|
private HttpListener listener = new HttpListener();
|
||||||
|
}
|
||||||
|
}
|
||||||
83
Notification.cs
Normal file
83
Notification.cs
Normal file
@@ -0,0 +1,83 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
|
namespace ws
|
||||||
|
{
|
||||||
|
// Token: 0x02000029 RID: 41
|
||||||
|
public class Notification
|
||||||
|
{
|
||||||
|
// Token: 0x06000104 RID: 260 RVA: 0x00004EF4 File Offset: 0x000030F4
|
||||||
|
public static string ProcessRequest(string jsonData)
|
||||||
|
{
|
||||||
|
string result;
|
||||||
|
{
|
||||||
|
result = jsonData;
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x0200002A RID: 42
|
||||||
|
public enum ResponseResult
|
||||||
|
{
|
||||||
|
// Token: 0x04000091 RID: 145
|
||||||
|
RelationshipChanged = 1,
|
||||||
|
// Token: 0x04000092 RID: 146
|
||||||
|
MessageReceived,
|
||||||
|
// Token: 0x04000093 RID: 147
|
||||||
|
MessageDeleted,
|
||||||
|
// Token: 0x04000094 RID: 148
|
||||||
|
PresenceHeartbeatResponse,
|
||||||
|
// Token: 0x04000095 RID: 149
|
||||||
|
SubscriptionListUpdated = 9,
|
||||||
|
// Token: 0x04000096 RID: 150
|
||||||
|
SubscriptionUpdateProfile = 11,
|
||||||
|
// Token: 0x04000097 RID: 151
|
||||||
|
SubscriptionUpdatePresence,
|
||||||
|
// Token: 0x04000098 RID: 152
|
||||||
|
SubscriptionUpdateGameSession,
|
||||||
|
// Token: 0x04000099 RID: 153
|
||||||
|
SubscriptionUpdateRoom,
|
||||||
|
// Token: 0x0400009A RID: 154
|
||||||
|
ModerationQuitGame = 20,
|
||||||
|
// Token: 0x0400009B RID: 155
|
||||||
|
ModerationUpdateRequired,
|
||||||
|
// Token: 0x0400009C RID: 156
|
||||||
|
ModerationKick,
|
||||||
|
// Token: 0x0400009D RID: 157
|
||||||
|
ModerationKickAttemptFailed,
|
||||||
|
// Token: 0x0400009E RID: 158
|
||||||
|
GiftPackageReceived = 30,
|
||||||
|
// Token: 0x0400009F RID: 159
|
||||||
|
ProfileJuniorStatusUpdate = 40,
|
||||||
|
// Token: 0x040000A0 RID: 160
|
||||||
|
RelationshipsInvalid = 50,
|
||||||
|
// Token: 0x040000A1 RID: 161
|
||||||
|
StorefrontBalanceAdd = 60
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x0200002B RID: 43
|
||||||
|
public class Reponse
|
||||||
|
{
|
||||||
|
// Token: 0x1700005C RID: 92
|
||||||
|
// (get) Token: 0x06000106 RID: 262 RVA: 0x000027DA File Offset: 0x000009DA
|
||||||
|
// (set) Token: 0x06000107 RID: 263 RVA: 0x000027E2 File Offset: 0x000009E2
|
||||||
|
public int Id { get; set; }
|
||||||
|
|
||||||
|
// Token: 0x1700005D RID: 93
|
||||||
|
// (get) Token: 0x06000108 RID: 264 RVA: 0x000027EB File Offset: 0x000009EB
|
||||||
|
// (set) Token: 0x06000109 RID: 265 RVA: 0x000027F3 File Offset: 0x000009F3
|
||||||
|
public object Msg { get; set; }
|
||||||
|
|
||||||
|
// Token: 0x0600010A RID: 266 RVA: 0x00004FC0 File Offset: 0x000031C0
|
||||||
|
public static Notification.Reponse createResponse(int id, object msg)
|
||||||
|
{
|
||||||
|
return new Notification.Reponse
|
||||||
|
{
|
||||||
|
Id = id,
|
||||||
|
Msg = msg
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
19
Objective.cs
Normal file
19
Objective.cs
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
using System;
|
||||||
|
|
||||||
|
namespace api
|
||||||
|
|
||||||
|
{
|
||||||
|
// Token: 0x02000018 RID: 24
|
||||||
|
public class Objective
|
||||||
|
{
|
||||||
|
// Token: 0x17000020 RID: 32
|
||||||
|
// (get) Token: 0x06000075 RID: 117 RVA: 0x00002314 File Offset: 0x00000514
|
||||||
|
// (set) Token: 0x06000076 RID: 118 RVA: 0x0000231C File Offset: 0x0000051C
|
||||||
|
public int type { get; set; }
|
||||||
|
|
||||||
|
// Token: 0x17000021 RID: 33
|
||||||
|
// (get) Token: 0x06000077 RID: 119 RVA: 0x00002325 File Offset: 0x00000525
|
||||||
|
// (set) Token: 0x06000078 RID: 120 RVA: 0x0000232D File Offset: 0x0000052D
|
||||||
|
public int score { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
18
OpenRec_.csproj
Normal file
18
OpenRec_.csproj
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<OutputType>Exe</OutputType>
|
||||||
|
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<Reference Include="websocket-sharp">
|
||||||
|
<HintPath>..\..\..\r16server\making new server\websocket-sharp.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
</Project>
|
||||||
25
OpenRec_.sln
Normal file
25
OpenRec_.sln
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
|
||||||
|
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||||
|
# Visual Studio Version 16
|
||||||
|
VisualStudioVersion = 16.0.31321.278
|
||||||
|
MinimumVisualStudioVersion = 10.0.40219.1
|
||||||
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OpenRec_", "OpenRec_.csproj", "{C3C433FC-52FB-4472-81F7-B271A2CDABFE}"
|
||||||
|
EndProject
|
||||||
|
Global
|
||||||
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
|
Debug|Any CPU = Debug|Any CPU
|
||||||
|
Release|Any CPU = Release|Any CPU
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||||
|
{C3C433FC-52FB-4472-81F7-B271A2CDABFE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{C3C433FC-52FB-4472-81F7-B271A2CDABFE}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{C3C433FC-52FB-4472-81F7-B271A2CDABFE}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{C3C433FC-52FB-4472-81F7-B271A2CDABFE}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
|
HideSolutionNode = FALSE
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||||
|
SolutionGuid = {3C2E49E2-E5D3-47A6-8F3A-5A1DF6A19A06}
|
||||||
|
EndGlobalSection
|
||||||
|
EndGlobal
|
||||||
18
PlatformID.cs
Normal file
18
PlatformID.cs
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
using System;
|
||||||
|
|
||||||
|
namespace api2018
|
||||||
|
{
|
||||||
|
// Token: 0x02000037 RID: 55
|
||||||
|
public class mPlatformID
|
||||||
|
{
|
||||||
|
// Token: 0x17000097 RID: 151
|
||||||
|
// (get) Token: 0x0600018E RID: 398 RVA: 0x00002B9F File Offset: 0x00000D9F
|
||||||
|
// (set) Token: 0x0600018F RID: 399 RVA: 0x00002BA7 File Offset: 0x00000DA7
|
||||||
|
public int Platform { get; set; }
|
||||||
|
|
||||||
|
// Token: 0x17000098 RID: 152
|
||||||
|
// (get) Token: 0x06000190 RID: 400 RVA: 0x00002BB0 File Offset: 0x00000DB0
|
||||||
|
// (set) Token: 0x06000191 RID: 401 RVA: 0x00002BB8 File Offset: 0x00000DB8
|
||||||
|
public ulong PlatformId { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
58
PlayerReputation.cs
Normal file
58
PlayerReputation.cs
Normal file
@@ -0,0 +1,58 @@
|
|||||||
|
using System;
|
||||||
|
|
||||||
|
namespace api2018
|
||||||
|
{
|
||||||
|
// Token: 0x02000036 RID: 54
|
||||||
|
public class mPlayerReputation
|
||||||
|
{
|
||||||
|
// Token: 0x1700008D RID: 141
|
||||||
|
// (get) Token: 0x06000179 RID: 377 RVA: 0x00002AF5 File Offset: 0x00000CF5
|
||||||
|
// (set) Token: 0x0600017A RID: 378 RVA: 0x00002AFD File Offset: 0x00000CFD
|
||||||
|
public int Noteriety { get; set; }
|
||||||
|
|
||||||
|
// Token: 0x1700008E RID: 142
|
||||||
|
// (get) Token: 0x0600017B RID: 379 RVA: 0x00002B06 File Offset: 0x00000D06
|
||||||
|
// (set) Token: 0x0600017C RID: 380 RVA: 0x00002B0E File Offset: 0x00000D0E
|
||||||
|
public int CheerGeneral { get; set; }
|
||||||
|
|
||||||
|
// Token: 0x1700008F RID: 143
|
||||||
|
// (get) Token: 0x0600017D RID: 381 RVA: 0x00002B17 File Offset: 0x00000D17
|
||||||
|
// (set) Token: 0x0600017E RID: 382 RVA: 0x00002B1F File Offset: 0x00000D1F
|
||||||
|
public int CheerHelpful { get; set; }
|
||||||
|
|
||||||
|
// Token: 0x17000090 RID: 144
|
||||||
|
// (get) Token: 0x0600017F RID: 383 RVA: 0x00002B28 File Offset: 0x00000D28
|
||||||
|
// (set) Token: 0x06000180 RID: 384 RVA: 0x00002B30 File Offset: 0x00000D30
|
||||||
|
public int CheerGreatHost { get; set; }
|
||||||
|
|
||||||
|
// Token: 0x17000091 RID: 145
|
||||||
|
// (get) Token: 0x06000181 RID: 385 RVA: 0x00002B39 File Offset: 0x00000D39
|
||||||
|
// (set) Token: 0x06000182 RID: 386 RVA: 0x00002B41 File Offset: 0x00000D41
|
||||||
|
public int CheerSportsman { get; set; }
|
||||||
|
|
||||||
|
// Token: 0x17000092 RID: 146
|
||||||
|
// (get) Token: 0x06000183 RID: 387 RVA: 0x00002B4A File Offset: 0x00000D4A
|
||||||
|
// (set) Token: 0x06000184 RID: 388 RVA: 0x00002B52 File Offset: 0x00000D52
|
||||||
|
public int CheerCreative { get; set; }
|
||||||
|
|
||||||
|
// Token: 0x17000093 RID: 147
|
||||||
|
// (get) Token: 0x06000185 RID: 389 RVA: 0x00002B5B File Offset: 0x00000D5B
|
||||||
|
// (set) Token: 0x06000186 RID: 390 RVA: 0x00002B63 File Offset: 0x00000D63
|
||||||
|
public int CheerCredit { get; set; }
|
||||||
|
|
||||||
|
// Token: 0x17000094 RID: 148
|
||||||
|
// (get) Token: 0x06000187 RID: 391 RVA: 0x00002B6C File Offset: 0x00000D6C
|
||||||
|
// (set) Token: 0x06000188 RID: 392 RVA: 0x00002B74 File Offset: 0x00000D74
|
||||||
|
public int SubscriberCount { get; set; }
|
||||||
|
|
||||||
|
// Token: 0x17000095 RID: 149
|
||||||
|
// (get) Token: 0x06000189 RID: 393 RVA: 0x00002B7D File Offset: 0x00000D7D
|
||||||
|
// (set) Token: 0x0600018A RID: 394 RVA: 0x00002B85 File Offset: 0x00000D85
|
||||||
|
public int SubscribedCount { get; set; }
|
||||||
|
|
||||||
|
// Token: 0x17000096 RID: 150
|
||||||
|
// (get) Token: 0x0600018B RID: 395 RVA: 0x00002B8E File Offset: 0x00000D8E
|
||||||
|
// (set) Token: 0x0600018C RID: 396 RVA: 0x00002B96 File Offset: 0x00000D96
|
||||||
|
public int SelectedCheer { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
41
Profiles.cs
Normal file
41
Profiles.cs
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
namespace api2016
|
||||||
|
|
||||||
|
{
|
||||||
|
class Profiles
|
||||||
|
{
|
||||||
|
|
||||||
|
public ulong Id { get; set; }
|
||||||
|
public string Username { get; set; }
|
||||||
|
public string DisplayName { get; set; }
|
||||||
|
public int XP { get; set; }
|
||||||
|
public int Level { get; set; }
|
||||||
|
public int Reputation { get; set; }
|
||||||
|
public bool Verified { get; set; }
|
||||||
|
|
||||||
|
public bool Developer { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
public bool HasEmail { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
public bool CanReceiveInvites { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
public string ProfileImageName { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
public bool JuniorProfile { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
public bool ForceJuniorImages { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
public bool PendingJunior { get; set; }
|
||||||
|
|
||||||
|
public bool HasBirthday { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
87
Program.cs
Normal file
87
Program.cs
Normal file
@@ -0,0 +1,87 @@
|
|||||||
|
using System;
|
||||||
|
using server;
|
||||||
|
using System.IO;
|
||||||
|
using ws;
|
||||||
|
using api;
|
||||||
|
|
||||||
|
namespace start
|
||||||
|
{
|
||||||
|
class Program
|
||||||
|
{
|
||||||
|
static void Main(string[] args)
|
||||||
|
{
|
||||||
|
Config.setup();
|
||||||
|
goto Start;
|
||||||
|
|
||||||
|
Start:
|
||||||
|
Console.WriteLine("OpenRec - Open source RecNet server software.");
|
||||||
|
Console.WriteLine("1) Modify Settings" + Environment.NewLine + "2) Modify Profile" + Environment.NewLine + "3) Start Server");
|
||||||
|
string readline = Console.ReadLine();
|
||||||
|
|
||||||
|
if (readline == "1")
|
||||||
|
{
|
||||||
|
Console.WriteLine("Not yet added in...");
|
||||||
|
goto Start;
|
||||||
|
}
|
||||||
|
if (readline == "2")
|
||||||
|
{
|
||||||
|
goto Start;
|
||||||
|
Console.Clear();
|
||||||
|
Console.WriteLine("1) Change Username" + Environment.NewLine + "2) Go Back");
|
||||||
|
string readline3 = Console.ReadLine();
|
||||||
|
if (readline3 == "1")
|
||||||
|
{
|
||||||
|
Console.Clear();
|
||||||
|
Console.WriteLine("Current Username: " + File.ReadAllText("SaveData\\Profile\\username.txt)"));
|
||||||
|
Console.WriteLine("New Username: ");
|
||||||
|
string newusername = Console.ReadLine();
|
||||||
|
File.WriteAllText("SaveData\\Profile\\username.txt)", newusername);
|
||||||
|
Console.Clear();
|
||||||
|
goto Start;
|
||||||
|
|
||||||
|
}
|
||||||
|
if (readline3 == "2")
|
||||||
|
{
|
||||||
|
Console.Clear();
|
||||||
|
goto Start;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (readline == "3")
|
||||||
|
{
|
||||||
|
|
||||||
|
Console.WriteLine("Please select the version of RecRoom the server should host: (2016, 2017, 2018)");
|
||||||
|
string readline2 = Console.ReadLine();
|
||||||
|
if (readline2 == "2016")
|
||||||
|
{
|
||||||
|
version = "2016";
|
||||||
|
Console.Clear();
|
||||||
|
Console.WriteLine("Version Selected: " + start.Program.version);
|
||||||
|
new APIServer();
|
||||||
|
new WebSocket();
|
||||||
|
}
|
||||||
|
if (readline2 == "2017")
|
||||||
|
{
|
||||||
|
version = "2017";
|
||||||
|
Console.Clear();
|
||||||
|
Console.WriteLine("Version Selected: " + start.Program.version);
|
||||||
|
new APIServer();
|
||||||
|
new WebSocket();
|
||||||
|
}
|
||||||
|
if (readline2 == "2018")
|
||||||
|
{
|
||||||
|
version = "2018";
|
||||||
|
Console.Clear();
|
||||||
|
Console.WriteLine("Version Selected: " + start.Program.version);
|
||||||
|
new NameServer();
|
||||||
|
new ImageServer();
|
||||||
|
new APIServer();
|
||||||
|
new WebSocket();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static string version = "";
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
32
WebSocket.cs
Normal file
32
WebSocket.cs
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
using System;
|
||||||
|
using WebSocketSharp;
|
||||||
|
using WebSocketSharp.Server;
|
||||||
|
|
||||||
|
namespace ws
|
||||||
|
{
|
||||||
|
// Token: 0x02000008 RID: 8
|
||||||
|
internal class WebSocket
|
||||||
|
{
|
||||||
|
// Token: 0x06000012 RID: 18 RVA: 0x0000418C File Offset: 0x0000238C
|
||||||
|
public WebSocket()
|
||||||
|
{
|
||||||
|
WebSocketServer webSocketServer = new WebSocketServer(string.Format("ws://localhost:20161"));
|
||||||
|
webSocketServer.AddWebSocketService<WebSocket.NotificationV2>("/api/notification/v2");
|
||||||
|
webSocketServer.AddWebSocketService<WebSocket.NotificationV2>("/hub/v1");
|
||||||
|
webSocketServer.Start();
|
||||||
|
Console.WriteLine("WebSocket.cs has started.");
|
||||||
|
Console.WriteLine("WebSocket.cs is listening.");
|
||||||
|
}
|
||||||
|
|
||||||
|
// Token: 0x02000009 RID: 9
|
||||||
|
public class NotificationV2 : WebSocketBehavior
|
||||||
|
{
|
||||||
|
// Token: 0x06000013 RID: 19 RVA: 0x0000209D File Offset: 0x0000029D
|
||||||
|
protected override void OnMessage(MessageEventArgs e)
|
||||||
|
{
|
||||||
|
Console.WriteLine("WebSocket.cs called for. Not yet implemented.");
|
||||||
|
base.Send(Notification.ProcessRequest(e.Data));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
23
photonConfig.cs
Normal file
23
photonConfig.cs
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
using System;
|
||||||
|
|
||||||
|
namespace api
|
||||||
|
{
|
||||||
|
// Token: 0x02000016 RID: 22
|
||||||
|
public class photonConfig
|
||||||
|
{
|
||||||
|
// Token: 0x1700001B RID: 27
|
||||||
|
// (get) Token: 0x06000069 RID: 105 RVA: 0x000022BF File Offset: 0x000004BF
|
||||||
|
// (set) Token: 0x0600006A RID: 106 RVA: 0x000022C7 File Offset: 0x000004C7
|
||||||
|
public string CloudRegion { get; set; }
|
||||||
|
|
||||||
|
// Token: 0x1700001C RID: 28
|
||||||
|
// (get) Token: 0x0600006B RID: 107 RVA: 0x000022D0 File Offset: 0x000004D0
|
||||||
|
// (set) Token: 0x0600006C RID: 108 RVA: 0x000022D8 File Offset: 0x000004D8
|
||||||
|
public bool CrcCheckEnabled { get; set; }
|
||||||
|
|
||||||
|
// Token: 0x1700001D RID: 29
|
||||||
|
// (get) Token: 0x0600006D RID: 109 RVA: 0x000022E1 File Offset: 0x000004E1
|
||||||
|
// (set) Token: 0x0600006E RID: 110 RVA: 0x000022E9 File Offset: 0x000004E9
|
||||||
|
public bool EnableServerTracingAfterDisconnect { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user