Ejemplo n.º 1
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.º 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.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 => { }));
        }