NearbyConnectionConfiguration.cs 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. // <copyright file="NearbyConnectionConfiguration.cs" company="Google Inc.">
  2. // Copyright (C) 2014 Google Inc.
  3. //
  4. // Licensed under the Apache License, Version 2.0 (the "License");
  5. // you may not use this file except in compliance with the License.
  6. // You may obtain a copy of the License at
  7. //
  8. // http://www.apache.org/licenses/LICENSE-2.0
  9. //
  10. // Unless required by applicable law or agreed to in writing, software
  11. // distributed under the License is distributed on an "AS IS" BASIS,
  12. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. // See the License for the specific language governing permissions and
  14. // limitations under the License.
  15. // </copyright>
  16. namespace GooglePlayGames.BasicApi.Nearby
  17. {
  18. using System;
  19. using GooglePlayGames.OurUtils;
  20. public enum InitializationStatus
  21. {
  22. Success,
  23. VersionUpdateRequired,
  24. InternalError
  25. }
  26. public struct NearbyConnectionConfiguration
  27. {
  28. public const int MaxUnreliableMessagePayloadLength = 1168;
  29. public const int MaxReliableMessagePayloadLength = 4096;
  30. private readonly Action<InitializationStatus> mInitializationCallback;
  31. private readonly long mLocalClientId;
  32. public NearbyConnectionConfiguration(Action<InitializationStatus> callback,
  33. long localClientId)
  34. {
  35. this.mInitializationCallback = Misc.CheckNotNull(callback);
  36. this.mLocalClientId = localClientId;
  37. }
  38. public long LocalClientId
  39. {
  40. get { return mLocalClientId; }
  41. }
  42. public Action<InitializationStatus> InitializationCallback
  43. {
  44. get { return mInitializationCallback; }
  45. }
  46. }
  47. }