Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ _gamesenseWrk()

void ReLogic.Peripherals.RGB.SteelSeries.GameSenseConnection._gamesenseWrk ( )
inlineprivate

Definition at line 175 of file GameSenseConnection.cs.

176 {
177 //IL_0089: Expected O, but got Unknown
178 //IL_00a5: Expected O, but got Unknown
179 //IL_010c: Expected O, but got Unknown
180 //IL_0014: Unknown result type (might be due to invalid IL or missing references)
181 //IL_0019: Unknown result type (might be due to invalid IL or missing references)
182 //IL_001a: Unknown result type (might be due to invalid IL or missing references)
183 //IL_002c: Expected I4, but got Unknown
184 //IL_0046: Unknown result type (might be due to invalid IL or missing references)
185 //IL_004c: Expected O, but got Unknown
186 //IL_0053: Unknown result type (might be due to invalid IL or missing references)
187 //IL_005d: Expected O, but got Unknown
188 QueueMsg queueMsg = null;
189 Stopwatch stopwatch = new Stopwatch();
190 stopwatch.Start();
192 {
193 ClientState mClientState = _mClientState;
194 switch ((int)mClientState)
195 {
196 case 0:
197 {
198 QueueMsg queueMsg2;
199 while ((queueMsg2 = _mMsgQueue.CDequeue()) == null)
200 {
201 Thread.Sleep(10);
202 if (stopwatch.ElapsedMilliseconds > 1000)
203 {
204 queueMsg2 = (QueueMsg)new QueueMsgSendHeartbeat();
205 queueMsg2.data = (object)new Game(GameName);
206 break;
207 }
208 }
209 try
210 {
211 _sendMsg(queueMsg2);
212 stopwatch.Reset();
213 stopwatch.Start();
214 }
215 catch (ServerDownException val2)
216 {
217 ServerDownException e2 = val2;
218 _logException("Failed connecting to GameSense server", (Exception)(object)e2);
219 queueMsg = queueMsg2;
220 _setClientState((ClientState)1);
221 }
222 catch (CriticalMessageIllFormedException val3)
223 {
224 CriticalMessageIllFormedException e3 = val3;
225 _logException("Message ill-formed", (Exception)(object)e3);
226 _setClientState((ClientState)2);
227 }
228 catch (Exception e4)
229 {
230 _logException("Failed processing msg", e4);
231 }
232 break;
233 }
234 case 1:
236 if (_mServerPort == null)
237 {
238 _logWarning("Failed to obtain GameSense server port. GameSense will not function");
239 _setClientState((ClientState)2);
240 break;
241 }
243 if (queueMsg != null)
244 {
245 try
246 {
247 _sendMsg(queueMsg);
248 queueMsg = null;
249 }
250 catch (ServerDownException val)
251 {
252 ServerDownException e = val;
253 _logException("Failed connecting to GameSense server", (Exception)(object)e);
254 _logDbgMsg("Retrying in 5 seconds...");
255 Thread.Sleep(5000);
256 break;
257 }
258 }
259 _setClientState((ClientState)0);
260 break;
261 case 2:
262 _logDbgMsg("Entering inactive state");
264 break;
265 default:
266 _logErrorMsg("Unknown GameSense client state");
267 _setClientState((ClientState)2);
268 break;
269 }
270 }
271 _logDbgMsg("Worker exiting");
272 }
static void Sleep(int millisecondsTimeout)
Definition Thread.cs:658

References ReLogic.Peripherals.RGB.SteelSeries.GameSenseConnection._getServerPort(), ReLogic.Peripherals.RGB.SteelSeries.GameSenseConnection._initializeUris(), ReLogic.Peripherals.RGB.SteelSeries.GameSenseConnection._logDbgMsg(), ReLogic.Peripherals.RGB.SteelSeries.GameSenseConnection._logErrorMsg(), ReLogic.Peripherals.RGB.SteelSeries.GameSenseConnection._logException(), ReLogic.Peripherals.RGB.SteelSeries.GameSenseConnection._logWarning(), ReLogic.Peripherals.RGB.SteelSeries.GameSenseConnection._mClientState, ReLogic.Peripherals.RGB.SteelSeries.GameSenseConnection._mGameSenseWrkShouldRun, ReLogic.Peripherals.RGB.SteelSeries.GameSenseConnection._mMsgQueue, ReLogic.Peripherals.RGB.SteelSeries.GameSenseConnection._mServerPort, ReLogic.Peripherals.RGB.SteelSeries.GameSenseConnection._sendMsg(), ReLogic.Peripherals.RGB.SteelSeries.GameSenseConnection._setClientState(), System.Diagnostics.Stopwatch.ElapsedMilliseconds, ReLogic.Peripherals.RGB.SteelSeries.GameSenseConnection.GameName, System.Diagnostics.Stopwatch.Reset(), System.Threading.Thread.Sleep(), and System.Diagnostics.Stopwatch.Start().

Referenced by ReLogic.Peripherals.RGB.SteelSeries.GameSenseConnection.BeginConnection().