public override int GetHashCode()
        {
            int hash = 1;

            if (StatusCode != 0)
            {
                hash ^= StatusCode.GetHashCode();
            }
            if (RequestId != 0UL)
            {
                hash ^= RequestId.GetHashCode();
            }
            if (ApiUrl.Length != 0)
            {
                hash ^= ApiUrl.GetHashCode();
            }
            if (unknown6_ != null)
            {
                hash ^= Unknown6.GetHashCode();
            }
            if (authTicket_ != null)
            {
                hash ^= AuthTicket.GetHashCode();
            }
            hash ^= returns_.GetHashCode();
            if (Error.Length != 0)
            {
                hash ^= Error.GetHashCode();
            }
            return(hash);
        }
예제 #2
0
 public void MergeFrom(RequestEnvelope other)
 {
     if (other == null)
     {
         return;
     }
     if (other.StatusCode != 0)
     {
         StatusCode = other.StatusCode;
     }
     if (other.RequestId != 0UL)
     {
         RequestId = other.RequestId;
     }
     requests_.Add(other.requests_);
     if (other.unknown6_ != null)
     {
         if (unknown6_ == null)
         {
             unknown6_ = new global::PokemonGoDesktop.API.Proto.Unknown6();
         }
         Unknown6.MergeFrom(other.Unknown6);
     }
     if (other.Latitude != 0D)
     {
         Latitude = other.Latitude;
     }
     if (other.Longitude != 0D)
     {
         Longitude = other.Longitude;
     }
     if (other.Altitude != 0D)
     {
         Altitude = other.Altitude;
     }
     if (other.authInfo_ != null)
     {
         if (authInfo_ == null)
         {
             authInfo_ = new global::PokemonGoDesktop.API.Proto.RequestEnvelope.Types.AuthInfo();
         }
         AuthInfo.MergeFrom(other.AuthInfo);
     }
     if (other.authTicket_ != null)
     {
         if (authTicket_ == null)
         {
             authTicket_ = new global::PokemonGoDesktop.API.Proto.AuthTicket();
         }
         AuthTicket.MergeFrom(other.AuthTicket);
     }
     if (other.Unknown12 != 0L)
     {
         Unknown12 = other.Unknown12;
     }
 }
        /// <summary>
        /// Configures the <see cref="RequestEnvelope"/>
        /// </summary>
        /// <param name="env">Request envelope instance.</param>
        public static void WithAuthTicket(this RequestEnvelope env, AuthTicket ticket)
        {
            Throw <ArgumentNullException> .If.IsNull(env)?.Now(nameof(env), "The provided envelop cannot be null during fluent configuration.");

            //This holds data from the server auth resposne that we use as a ticket for other messages
            env.AuthTicket = ticket;

            //Things that the user can't really deal with, because the community doesn't know what they really are, are initialized below.
            env.StatusCode = 2;             //Rocket-API sets it to 2:  https://github.com/FeroxRev/Pokemon-Go-Rocket-API/blob/bca2166d72aaa9799c64965cc4f94748231283eb/PokemonGo.RocketAPI/Helpers/RequestBuilder.cs
            env.Unknown12  = 989;           //Required otherwise we receive incompatible protocol as indicated in Rocket-API: https://github.com/FeroxRev/Pokemon-Go-Rocket-API/blob/bca2166d72aaa9799c64965cc4f94748231283eb/PokemonGo.RocketAPI/Helpers/RequestBuilder.cs
        }
예제 #4
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (StatusCode != 0)
            {
                hash ^= StatusCode.GetHashCode();
            }
            if (RequestId != 0UL)
            {
                hash ^= RequestId.GetHashCode();
            }
            hash ^= requests_.GetHashCode();
            if (unknown6_ != null)
            {
                hash ^= Unknown6.GetHashCode();
            }
            if (Latitude != 0D)
            {
                hash ^= Latitude.GetHashCode();
            }
            if (Longitude != 0D)
            {
                hash ^= Longitude.GetHashCode();
            }
            if (Altitude != 0D)
            {
                hash ^= Altitude.GetHashCode();
            }
            if (authInfo_ != null)
            {
                hash ^= AuthInfo.GetHashCode();
            }
            if (authTicket_ != null)
            {
                hash ^= AuthTicket.GetHashCode();
            }
            if (Unknown12 != 0L)
            {
                hash ^= Unknown12.GetHashCode();
            }
            return(hash);
        }
 public void MergeFrom(ResponseEnvelope other)
 {
     if (other == null)
     {
         return;
     }
     if (other.StatusCode != 0)
     {
         StatusCode = other.StatusCode;
     }
     if (other.RequestId != 0UL)
     {
         RequestId = other.RequestId;
     }
     if (other.ApiUrl.Length != 0)
     {
         ApiUrl = other.ApiUrl;
     }
     if (other.unknown6_ != null)
     {
         if (unknown6_ == null)
         {
             unknown6_ = new global::PokemonGoDesktop.API.Proto.Unknown6Response();
         }
         Unknown6.MergeFrom(other.Unknown6);
     }
     if (other.authTicket_ != null)
     {
         if (authTicket_ == null)
         {
             authTicket_ = new global::PokemonGoDesktop.API.Proto.AuthTicket();
         }
         AuthTicket.MergeFrom(other.AuthTicket);
     }
     returns_.Add(other.returns_);
     if (other.Error.Length != 0)
     {
         Error = other.Error;
     }
 }