RealmGameAddressHelper.cs 593 B

1234567891011121314151617181920212223242526
  1. using System.Collections.Generic;
  2. namespace ET.Server
  3. {
  4. public static class RealmGameAddressHelper
  5. {
  6. public static StartSceneConfig GetGame(int zone)
  7. {
  8. List<StartSceneConfig> zoneGames = StartSceneConfigCategory.Instance.Games[zone];
  9. int n = RandomGenerator.RandomNumber(0, zoneGames.Count);
  10. return zoneGames[n];
  11. }
  12. public static StartSceneConfig GetGame(int zone, long accountId)
  13. {
  14. List<StartSceneConfig> zoneGames = StartSceneConfigCategory.Instance.Games[zone];
  15. int n = accountId.GetHashCode() % zoneGames.Count;
  16. return zoneGames[n];
  17. }
  18. }
  19. }