Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
SteelSeriesDeviceGroup.cs
Go to the documentation of this file.
1using System;
3using Newtonsoft.Json;
4using Newtonsoft.Json.Linq;
5using SteelSeries.GameSense;
6
8
10{
11 public static class EventNames
12 {
13 public const string DoRainbows = "DO_RAINBOWS";
14 }
15
16 private readonly List<RgbDevice> _devices = new List<RgbDevice>();
17
19
20 private const int ThrottleLoopSize = 12;
21
23
25
26 private int _throttleCounter;
27
28 private bool _isInitialized;
29
31
33
35
37
38 private JsonSerializer _serializer = JsonSerializer.Create(new JsonSerializerSettings
39 {
42 Formatting = (Formatting)0
43 });
44
46 {
47 //IL_002f: Unknown result type (might be due to invalid IL or missing references)
48 //IL_0034: Unknown result type (might be due to invalid IL or missing references)
49 //IL_003b: Unknown result type (might be due to invalid IL or missing references)
50 //IL_0042: Unknown result type (might be due to invalid IL or missing references)
51 //IL_004e: Expected O, but got Unknown
52 //IL_006e: Unknown result type (might be due to invalid IL or missing references)
53 //IL_0070: Unknown result type (might be due to invalid IL or missing references)
55 {
56 GameName = gameNameIdInAllCaps,
57 GameDisplayName = gameDisplayName,
58 IconColor = iconColor
59 };
66 }
67
72
73 protected override void Initialize()
74 {
75 if (!_isInitialized)
76 {
78 _isInitialized = true;
79 for (int i = 0; i < 12; i++)
80 {
82 }
84 int num = 27;
85 int num2 = 0;
98 }
99 }
100
102 {
103 _devices.Add(device);
104 deviceList.Add(device);
105 }
106
107 protected override void Uninitialize()
108 {
109 if (_isInitialized)
110 {
113 }
114 }
115
116 public override void LoadSpecialRules(object specialRulesObject)
117 {
119 {
120 return;
121 }
122 _bindEvents = gameSenseSpecificInfo.EventsToBind.ToArray();
123 ARgbGameValueTracker[] array = gameSenseSpecificInfo.MiscEvents.ToArray();
125 foreach (RgbDevice device in _devices)
126 {
128 {
129 gameSenseDevice.CollectEventsToTrack(_bindEvents, array);
130 }
131 }
134 {
136 }
137 }
138
140 {
142 foreach (Bind_Event bind_Event in bindEvents)
143 {
145 }
146 }
147
149 {
150 return _devices.GetEnumerator();
151 }
152
153 public override void OnceProcessed()
154 {
156 }
157
168
170 {
171 foreach (RgbDevice device in deviceList)
172 {
173 if (!(device is IGameSenseDevice gameSenseDevice))
174 {
175 continue;
176 }
177 List<JObject> list = gameSenseDevice.TryGetEventUpdateRequest();
178 if (list == null)
179 {
180 continue;
181 }
182 for (int i = 0; i < list.Count; i++)
183 {
184 JObject jObject = list[i];
185 if (jObject != null)
186 {
187 jObject.Add("game", JToken.op_Implicit(_gameSenseConnection.GameName));
188 string fullEventJson = ((JToken)jObject).ToString((Formatting)0, Array.Empty<JsonConverter>());
190 }
191 }
192 }
194 {
195 List<JObject> list2 = miscEvent.TryGetEventUpdateRequest();
196 if (list2 == null)
197 {
198 continue;
199 }
200 for (int j = 0; j < list2.Count; j++)
201 {
203 if (jObject2 != null)
204 {
205 jObject2.Add("game", JToken.op_Implicit(_gameSenseConnection.GameName));
206 string fullEventJson2 = ((JToken)jObject2).ToString((Formatting)0, Array.Empty<JsonConverter>());
208 }
209 }
210 }
211 }
212
213 private void ConnectToGameSense()
214 {
216 }
217
222
227
233}
void TrackDeviceAndAddItToList(List< RgbDevice > deviceList, RgbDevice device)
SteelSeriesDeviceGroup(VendorColorProfile colorProfiles, string gameNameIdInAllCaps, string gameDisplayName, IconColor iconColor)
void Add(TKey key, TValue value)
static ? Delegate Combine(Delegate? a, Delegate? b)
Definition Delegate.cs:379