mirror of
https://github.com/recroom2016/OpenRec.git
synced 2026-04-22 13:25:51 +00:00
openrec 0.7.0
This commit is contained in:
25
WebSocket.cs
25
WebSocket.cs
@@ -1,22 +1,19 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Net;
|
||||
using start;
|
||||
using WebSocketSharp;
|
||||
using WebSocketSharp.Server;
|
||||
using Newtonsoft.Json;
|
||||
using server;
|
||||
using start;
|
||||
using System.Net;
|
||||
using System.IO;
|
||||
|
||||
namespace ws
|
||||
{
|
||||
// Token: 0x02000008 RID: 8
|
||||
// Token: 0x02000010 RID: 16
|
||||
internal class WebSocket
|
||||
{
|
||||
// Token: 0x06000012 RID: 18 RVA: 0x0000418C File Offset: 0x0000238C
|
||||
// Token: 0x06000031 RID: 49 RVA: 0x000066D4 File Offset: 0x000048D4
|
||||
public WebSocket()
|
||||
{
|
||||
WebSocketServer webSocketServer = new WebSocketServer(string.Format("ws://localhost:20161"));
|
||||
WebSocketServer webSocketServer = new WebSocketServer(string.Format("ws://localhost:20161", Array.Empty<object>()));
|
||||
webSocketServer.AddWebSocketService<WebSocket.NotificationV2>("/api/notification/v2");
|
||||
webSocketServer.AddWebSocketService<WebSocket.NotificationV2>("/hub/v1");
|
||||
webSocketServer.Start();
|
||||
@@ -24,21 +21,23 @@ namespace ws
|
||||
Console.WriteLine("[WebSocket.cs] is listening.");
|
||||
}
|
||||
|
||||
// Token: 0x02000058 RID: 88
|
||||
public class NotificationV2 : WebSocketBehavior
|
||||
{
|
||||
// Token: 0x06000013 RID: 19 RVA: 0x0000209D File Offset: 0x0000029D
|
||||
// Token: 0x0600023F RID: 575 RVA: 0x0000BDF8 File Offset: 0x00009FF8
|
||||
protected override void OnMessage(MessageEventArgs e)
|
||||
{
|
||||
Console.WriteLine("WebSocket.cs called for.");
|
||||
base.Send(Notification.ProcessRequest(e.Data));
|
||||
if (new WebClient().DownloadString("https://raw.githubusercontent.com/recroom2016/OpenRec/master/Update/banned.txt").Contains(File.ReadAllText("SaveData\\Profile\\userid.txt")))
|
||||
bool flag = new WebClient().DownloadString("https://raw.githubusercontent.com/recroom2016/OpenRec/master/Update/banned.txt").Contains(File.ReadAllText("SaveData\\Profile\\userid.txt"));
|
||||
if (flag)
|
||||
{
|
||||
Console.ForegroundColor = ConsoleColor.Red;
|
||||
Console.WriteLine("You are banned. Using this version of OpenRec will not work, please download OpenRec 0.4.2 or prior.");
|
||||
Console.ForegroundColor = ConsoleColor.Green;
|
||||
start.Program.bannedflag = true;
|
||||
Program.bannedflag = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user