forked from mooRceR/OpenQuest
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNotification.cs
More file actions
106 lines (100 loc) · 2.69 KB
/
Notification.cs
File metadata and controls
106 lines (100 loc) · 2.69 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
using System;
using System.Collections.Generic;
using Newtonsoft.Json;
using gamesesh;
namespace ws
{
// Token: 0x0200002A RID: 42
public class Notification
{
// Token: 0x0600010B RID: 267
public static string ProcessRequest(string jsonData)
{
Dictionary<string, object> dictionary = JsonConvert.DeserializeObject<Dictionary<string, object>>(jsonData);
string result;
if (dictionary.ContainsKey("api"))
{
string text = (string)dictionary["api"];
string text2 = text;
if (text2 != null)
{
if (text2 == "playerSubscriptions/v1/update")
{
Console.WriteLine("[WSS] Game client sent presence update.");
return JsonConvert.SerializeObject(Notification.Reponse.createResponse(12, GameSessions.StatusSessionInstance()));
}
if (text2 == "heartbeat2")
{
Console.WriteLine("[WSS] Heartbeat 2 sent by game client.");
return JsonConvert.SerializeObject(Notification.Reponse.createResponse(4, GameSessions.StatusSessionInstance()));
}
}
Console.WriteLine("[WSS] Unknown API call: " + text);
result = "";
}
else
{
result = jsonData;
}
return result;
}
// Token: 0x0200002B RID: 43
public enum ResponseResults
{
RelationshipChanged = 1,
MessageReceived,
MessageDeleted,
PresenceHeartbeatResponse,
SubscriptionListUpdated = 9,
SubscriptionUpdateProfile = 11,
SubscriptionUpdatePresence,
SubscriptionUpdateGameSession,
SubscriptionUpdateRoom = 15,
ModerationQuitGame = 20,
ModerationUpdateRequired,
ModerationKick,
ModerationKickAttemptFailed,
ServerMaintenance = 25,
GiftPackageReceived = 30,
ProfileJuniorStatusUpdate = 40,
RelationshipsInvalid = 50,
StorefrontBalanceAdd = 60,
ConsumableMappingAdded = 70,
ConsumableMappingRemoved,
PlayerEventCreated = 80,
PlayerEventUpdated,
PlayerEventDeleted,
PlayerEventResponseChanged,
PlayerEventResponseDeleted,
PlayerEventStateChanged,
ChatMessageReceived = 90
}
public class Reponse
{
public int Id { get; set; }
public object Msg { get; set; }
public static Notification.Reponse createResponse(int id, object msg)
{
return new Notification.Reponse
{
Id = id,
Msg = msg
};
}
public static Notification.Reponse createBannedResponse()
{
return new Notification.Reponse
{
Id = (int)ResponseResults.ModerationKick,
Msg = new api.ModerationBlockDetails()
{
ReportCategory = 1,
Duration = int.MaxValue,
GameSessionId = 100L,
Message = "You have been banned. You are probably a little kid and are now whining at your VR headset. If you aren't a little kid, DM me to appeal."
}
};
}
}
}
}