@@ -183,6 +183,20 @@ void TrackHints(Action<Hint[]> onHintsUpdated,
183
183
/// <param name="team">the team id of the player to request the status for, defaults to the current player's team if left empty</param>
184
184
void TrackClientStatus ( Action < ArchipelagoClientState > onStatusUpdated ,
185
185
bool retrieveCurrentClientStatus = true , int ? slot = null , int ? team = null ) ;
186
+
187
+ #if NET35
188
+ /// <summary>
189
+ /// Retrieves the server's race mode setting. 0 for disabled, 1 for enabled
190
+ /// </summary>
191
+ /// <param name="onRaceModeRetrieved"> the method to call with the retrieved race mode setting</param>
192
+ void GetRaceModeAsync ( Action < int > onRaceModeRetrieved ) ;
193
+ #else
194
+ /// <summary>
195
+ /// Retrieves the server's race mode setting. 0 for disabled, 1 for enabled
196
+ /// </summary>
197
+ /// <param name="onRaceModeRetrieved"> the method to call with the retrieved race mode setting</param>
198
+ Task < int > GetRaceModeAsync ( ) ;
199
+ #endif
186
200
}
187
201
188
202
public partial class DataStorageHelper : IDataStorageWrapper
@@ -197,6 +211,7 @@ DataStorageElement GetLocationNameGroupsElement(string game = null) =>
197
211
this [ Scope . ReadOnly , $ "location_name_groups_{ game ?? connectionInfoProvider . Game } "] ;
198
212
DataStorageElement GetClientStatusElement ( int ? slot = null , int ? team = null ) =>
199
213
this [ Scope . ReadOnly , $ "client_status_{ team ?? connectionInfoProvider . Team } _{ slot ?? connectionInfoProvider . Slot } "] ;
214
+ DataStorageElement GetRaceModeElement ( ) => this [ Scope . ReadOnly , "race_mode" ] ;
200
215
201
216
/// <inheritdoc />
202
217
public Hint [ ] GetHints ( int ? slot = null , int ? team = null ) =>
@@ -302,5 +317,15 @@ public void TrackClientStatus(Action<ArchipelagoClientState> onStatusUpdated,
302
317
GetClientStatusAsync ( slot , team ) . ContinueWith ( t => onStatusUpdated ( t . Result ) ) ;
303
318
#endif
304
319
}
320
+
321
+ #if NET35
322
+ /// <inheritdoc />
323
+ public void GetRaceModeAsync ( Action < int > onRaceModeRetrieved ) =>
324
+ GetRaceModeElement ( ) . GetAsync ( t => onRaceModeRetrieved ( t . ToObject < int ? > ( ) ?? 0 ) ) ;
325
+ #else
326
+ /// <inheritdoc />
327
+ public Task < int > GetRaceModeAsync ( ) => GetRaceModeElement ( ) . GetAsync < int ? > ( )
328
+ . ContinueWith ( t => t . Result ?? 0 ) ;
329
+ #endif
305
330
}
306
331
}
0 commit comments