Ejemplo n.º 1
0
        private void LoadAgreementModule()
        {
            var moduleLoadRequest = bnet.protocol.authentication.ModuleLoadRequest.CreateBuilder();
            var moduleHandle      = bnet.protocol.ContentHandle.CreateBuilder()
                                    .SetRegion(VersionInfo.LogNet.Regions[VersionInfo.LogNet.Region])
                                    .SetUsage(0x61757468) // auth
                                    .SetHash(ByteString.CopyFrom(VersionInfo.LogNet.AgreementHashMap[this.Platform]));

            this.LastRequestedModule = StreamedModule.Agreement;

            moduleLoadRequest.SetModuleHandle(moduleHandle);
            this.MakeRPC(() => bnet.protocol.authentication.AuthenticationClient.CreateStub(this).ModuleLoad(null, moduleLoadRequest.Build(), callback => { }));
        }
Ejemplo n.º 2
0
        public void SendAgreements()
        {
            var moduleMessageRequest = bnet.protocol.authentication.ModuleMessageRequest.CreateBuilder()
                                       .SetModuleId(this.ClientModuleIds[StreamedModule.Agreement]);

            //Account has not agreed to TOS
            if (!Agreements.ContainsKey(AvailableAgreements.TOS))
            {
                moduleMessageRequest.SetMessage(ByteString.CopyFrom(VersionInfo.LogNet.TOS));
                Logger.Trace("Sending TOS to client {0}", this);
                this.LastAgreementSent = AvailableAgreements.TOS;
            }
            //Account has not agreed to EULA
            else if (!Agreements.ContainsKey(AvailableAgreements.EULA))
            {
                moduleMessageRequest.SetMessage(ByteString.CopyFrom(VersionInfo.LogNet.EULA));
                Logger.Trace("Sending EULA to client {0}", this);
                this.LastAgreementSent = AvailableAgreements.EULA;
            }
            //Account has not agreed to RMAH
            else if (!Agreements.ContainsKey(AvailableAgreements.RMAH))
            {
                moduleMessageRequest.SetMessage(ByteString.CopyFrom(VersionInfo.LogNet.RMAH));
                Logger.Trace("Sending RMAH to client {0}", this);
                this.LastAgreementSent = AvailableAgreements.RMAH;
            }
            else
            {
                //Account has no more agreements to see.
                var moduleLoadRequest = bnet.protocol.authentication.ModuleLoadRequest.CreateBuilder();
                var moduleHandle      = bnet.protocol.ContentHandle.CreateBuilder()
                                        .SetRegion(VersionInfo.LogNet.Regions[VersionInfo.LogNet.Region])
                                        .SetUsage(0x61757468); // auth

                moduleHandle.SetHash(ByteString.CopyFrom(VersionInfo.LogNet.RiskFingerprintHashMap[this.Platform]));
                moduleLoadRequest.SetMessage(ByteString.Empty);
                this.LastRequestedModule = StreamedModule.RiskFingerprint;
                moduleLoadRequest.SetModuleHandle(moduleHandle);

                this.MakeRPC(() => bnet.protocol.authentication.AuthenticationClient.CreateStub(this).ModuleLoad(null, moduleLoadRequest.Build(), callback => { }));
                return;
            }

            this.MakeRPC(() => bnet.protocol.authentication.AuthenticationClient.CreateStub(this).ModuleMessage(null, moduleMessageRequest.Build(), callback => { }));
        }
Ejemplo n.º 3
0
        public void CheckAuthenticator()
        {
            var HasAuthenticator  = false;
            var moduleLoadRequest = bnet.protocol.authentication.ModuleLoadRequest.CreateBuilder();
            var moduleHandle      = bnet.protocol.ContentHandle.CreateBuilder()
                                    .SetRegion(VersionInfo.LogNet.Regions[VersionInfo.LogNet.Region])
                                    .SetUsage(0x61757468); // auth

            //Account has Authenticator attached, load Token module
            if (HasAuthenticator)
            {
                moduleHandle.SetHash(ByteString.CopyFrom(VersionInfo.LogNet.TokenHashMap[this.Platform]));
                moduleLoadRequest.SetMessage(ByteString.CopyFrom("0012F1BF6506277817890210A8529A4BB7BDD1E08EB397A4B0CABF174F6266B7CAF7F2CE7A298F001958F8".ToByteArray()));

                this.LastRequestedModule = StreamedModule.Token;
            }
            //Account does not have Authenticator, Check Agreements or load RiskFingerprint module
            else
            {
                if (this.HasAgreements())
                {
                    moduleHandle.SetHash(ByteString.CopyFrom(VersionInfo.LogNet.AgreementHashMap[this.Platform]));
                    this.LastRequestedModule = StreamedModule.Agreement;
                }
                else
                {
                    moduleHandle.SetHash(ByteString.CopyFrom(VersionInfo.LogNet.RiskFingerprintHashMap[this.Platform]));
                    moduleLoadRequest.SetMessage(ByteString.Empty);
                    this.LastRequestedModule = StreamedModule.RiskFingerprint;
                }
            }

            moduleLoadRequest.SetModuleHandle(moduleHandle);

            this.MakeRPC(() => bnet.protocol.authentication.AuthenticationClient.CreateStub(this).ModuleLoad(null, moduleLoadRequest.Build(), callback => { }));
        }
Ejemplo n.º 4
0
        public void CheckAuthenticator()
        {
            var HasAuthenticator = false;
            var moduleLoadRequest = bnet.protocol.authentication.ModuleLoadRequest.CreateBuilder();
            var moduleHandle = bnet.protocol.ContentHandle.CreateBuilder()
                .SetRegion(VersionInfo.MooNet.Regions[VersionInfo.MooNet.Region])
                .SetUsage(0x61757468); // auth

            //Account has Authenticator attached, load Token module
            if (HasAuthenticator)
            {
                moduleHandle.SetHash(ByteString.CopyFrom(VersionInfo.MooNet.TokenHashMap[this.Platform]));
                moduleLoadRequest.SetMessage(ByteString.CopyFrom("0012F1BF6506277817890210A8529A4BB7BDD1E08EB397A4B0CABF174F6266B7CAF7F2CE7A298F001958F8".ToByteArray()));

                this.LastRequestedModule = StreamedModule.Token;
            }
            //Account does not have Authenticator, Check Agreements or load RiskFingerprint module
            else
            {
                if (this.HasAgreements())
                {
                    moduleHandle.SetHash(ByteString.CopyFrom(VersionInfo.MooNet.AgreementHashMap[this.Platform]));
                    this.LastRequestedModule = StreamedModule.Agreement;
                }
                else
                {
                    moduleHandle.SetHash(ByteString.CopyFrom(VersionInfo.MooNet.RiskFingerprintHashMap[this.Platform]));
                    moduleLoadRequest.SetMessage(ByteString.Empty);
                    this.LastRequestedModule = StreamedModule.RiskFingerprint;
                }
            }

            moduleLoadRequest.SetModuleHandle(moduleHandle);

            this.MakeRPC(() => bnet.protocol.authentication.AuthenticationClient.CreateStub(this).ModuleLoad(null, moduleLoadRequest.Build(), callback => { }));
        }
Ejemplo n.º 5
0
        public void SendAgreements()
        {

            var moduleMessageRequest = bnet.protocol.authentication.ModuleMessageRequest.CreateBuilder()
                .SetModuleId(this.ClientModuleIds[StreamedModule.Agreement]);

            //Account has not agreed to TOS
            if (!Agreements.ContainsKey(AvailableAgreements.TOS))
            {
                moduleMessageRequest.SetMessage(ByteString.CopyFrom(VersionInfo.MooNet.TOS));
                Logger.Trace("Sending TOS to client {0}", this);
                this.LastAgreementSent = AvailableAgreements.TOS;
            }
            //Account has not agreed to EULA
            else if (!Agreements.ContainsKey(AvailableAgreements.EULA))
            {
                moduleMessageRequest.SetMessage(ByteString.CopyFrom(VersionInfo.MooNet.EULA));
                Logger.Trace("Sending EULA to client {0}", this);
                this.LastAgreementSent = AvailableAgreements.EULA;
            }
            //Account has not agreed to RMAH
            else if (!Agreements.ContainsKey(AvailableAgreements.RMAH))
            {
                moduleMessageRequest.SetMessage(ByteString.CopyFrom(VersionInfo.MooNet.RMAH));
                Logger.Trace("Sending RMAH to client {0}", this);
                this.LastAgreementSent = AvailableAgreements.RMAH;
            }
            else
            {
                //Account has no more agreements to see.
                var moduleLoadRequest = bnet.protocol.authentication.ModuleLoadRequest.CreateBuilder();
                var moduleHandle = bnet.protocol.ContentHandle.CreateBuilder()
                    .SetRegion(VersionInfo.MooNet.Regions[VersionInfo.MooNet.Region])
                    .SetUsage(0x61757468); // auth

                moduleHandle.SetHash(ByteString.CopyFrom(VersionInfo.MooNet.RiskFingerprintHashMap[this.Platform]));
                moduleLoadRequest.SetMessage(ByteString.Empty);
                this.LastRequestedModule = StreamedModule.RiskFingerprint;
                moduleLoadRequest.SetModuleHandle(moduleHandle);

                this.MakeRPC(() => bnet.protocol.authentication.AuthenticationClient.CreateStub(this).ModuleLoad(null, moduleLoadRequest.Build(), callback => { }));
                return;
            }

            this.MakeRPC(() => bnet.protocol.authentication.AuthenticationClient.CreateStub(this).ModuleMessage(null, moduleMessageRequest.Build(), callback => { }));
        }
Ejemplo n.º 6
0
        private void LoadAgreementModule()
        {
            var moduleLoadRequest = bnet.protocol.authentication.ModuleLoadRequest.CreateBuilder();
            var moduleHandle = bnet.protocol.ContentHandle.CreateBuilder()
                .SetRegion(VersionInfo.MooNet.Regions[VersionInfo.MooNet.Region])
                .SetUsage(0x61757468) // auth
                .SetHash(ByteString.CopyFrom(VersionInfo.MooNet.AgreementHashMap[this.Platform]));

            this.LastRequestedModule = StreamedModule.Agreement;

            moduleLoadRequest.SetModuleHandle(moduleHandle);
            this.MakeRPC(() => bnet.protocol.authentication.AuthenticationClient.CreateStub(this).ModuleLoad(null, moduleLoadRequest.Build(), callback => { }));
        }