byte[] IAuthenticationWebServiceContract.LoginSteam(byte[] data)
        {
            try
            {
                using (var bytes = new MemoryStream(data))
                {
                    var steamId   = StringProxy.Deserialize(bytes);
                    var authToken = StringProxy.Deserialize(bytes);
                    var machineId = StringProxy.Deserialize(bytes);

                    var view = OnLoginSteam(steamId, authToken, machineId);
                    using (var outBytes = new MemoryStream())
                    {
                        MemberAuthenticationResultViewProxy.Serialize(outBytes, view);
                        return(outBytes.ToArray());
                    }
                }
            }
            catch (Exception ex)
            {
                Log.Error("Unable to handle LoginSteam request:");
                Log.Error(ex);
                return(null);
            }
        }
示例#2
0
        public MemberAuthenticationResultView LoginSteam(string steamId, string authToken, string machineId)
        {
            using (var bytes = new MemoryStream())
            {
                StringProxy.Serialize(bytes, steamId);
                StringProxy.Serialize(bytes, authToken);
                StringProxy.Serialize(bytes, machineId);

                var data = Channel.LoginSteam(bytes.ToArray());
                using (var inBytes = new MemoryStream(data))
                    return(MemberAuthenticationResultViewProxy.Deserialize(inBytes));
            }
        }
示例#3
0
        // Token: 0x06001149 RID: 4425 RVA: 0x0001BEE8 File Offset: 0x0001A0E8
        public static Coroutine LoginMemberPortal(int cmid, string hash, string machineId, Action <MemberAuthenticationResultView> callback, Action <Exception> handler)
        {
            Coroutine result;

            using (MemoryStream memoryStream = new MemoryStream())
            {
                Int32Proxy.Serialize(memoryStream, cmid);
                StringProxy.Serialize(memoryStream, hash);
                StringProxy.Serialize(memoryStream, machineId);
                result = MonoInstance.Mono.StartCoroutine(SoapClient.MakeRequest("IAuthenticationWebServiceContract", "AuthenticationWebService", "LoginMemberPortal", memoryStream.ToArray(), delegate(byte[] data)
                {
                    if (callback != null)
                    {
                        callback(MemberAuthenticationResultViewProxy.Deserialize(new MemoryStream(data)));
                    }
                }, handler));
            }
            return(result);
        }
示例#4
0
        // Token: 0x06001147 RID: 4423 RVA: 0x0001BDC8 File Offset: 0x00019FC8
        public static Coroutine LoginMemberFacebookUnitySdk(string facebookPlayerAccessToken, ChannelType channelType, string machineId, Action <MemberAuthenticationResultView> callback, Action <Exception> handler)
        {
            Coroutine result;

            using (MemoryStream memoryStream = new MemoryStream())
            {
                StringProxy.Serialize(memoryStream, facebookPlayerAccessToken);
                EnumProxy <ChannelType> .Serialize(memoryStream, channelType);

                StringProxy.Serialize(memoryStream, machineId);
                result = MonoInstance.Mono.StartCoroutine(SoapClient.MakeRequest("IAuthenticationWebServiceContract", "AuthenticationWebService", "LoginMemberFacebookUnitySdk", memoryStream.ToArray(), delegate(byte[] data)
                {
                    if (callback != null)
                    {
                        callback(MemberAuthenticationResultViewProxy.Deserialize(new MemoryStream(data)));
                    }
                }, handler));
            }
            return(result);
        }
示例#5
0
        // Token: 0x0600114A RID: 4426 RVA: 0x0001BF78 File Offset: 0x0001A178
        public static Coroutine LinkSteamMember(string email, string password, string steamId, string machineId, Action <MemberAuthenticationResultView> callback, Action <Exception> handler)
        {
            Coroutine result;

            using (MemoryStream memoryStream = new MemoryStream())
            {
                StringProxy.Serialize(memoryStream, email);
                StringProxy.Serialize(memoryStream, password);
                StringProxy.Serialize(memoryStream, steamId);
                StringProxy.Serialize(memoryStream, machineId);
                result = MonoInstance.Mono.StartCoroutine(SoapClient.MakeRequest("IAuthenticationWebServiceContract", "AuthenticationWebService", "LinkSteamMember", memoryStream.ToArray(), delegate(byte[] data)
                {
                    if (callback != null)
                    {
                        callback(MemberAuthenticationResultViewProxy.Deserialize(new MemoryStream(data)));
                    }
                }, handler));
            }
            return(result);
        }
示例#6
0
        public byte[] LoginSteam(byte[] data)
        {
            var inputStream = new MemoryStream(data);

            var steamId   = StringProxy.Deserialize(inputStream);
            var authToken = StringProxy.Deserialize(inputStream);
            var machineId = StringProxy.Deserialize(inputStream);

            var outputStream = new MemoryStream();

            if (userData.ContainsKey(steamId) && userData[steamId] != null)
            {
                var instance = new MemberAuthenticationResultView {
                    MemberAuthenticationResult = MemberAuthenticationResult.Ok,
                    MemberView           = userData[steamId],
                    PlayerStatisticsView = playerStatistics[steamId],
                    ServerTime           = DateTime.Now,
                    IsAccountComplete    = true,
                    AuthToken            = Convert.ToBase64String(Encoding.UTF8.GetBytes(steamId))
                };

                MemberAuthenticationResultViewProxy.Serialize(outputStream, instance);
            }
            else
            {
                var r    = new Random((int)DateTime.Now.Ticks);
                var Cmid = r.Next(1000000, 9999999);

                var newMemberView = new MemberView {
                    PublicProfile = new PublicProfileView {
                        Cmid               = Cmid,
                        Name               = "Player Name",
                        IsChatDisabled     = false,
                        AccessLevel        = MemberAccessLevel.Default,
                        GroupTag           = "",
                        LastLoginDate      = DateTime.Now,
                        EmailAddressStatus = EmailAddressStatus.Verified,
                        FacebookId         = "-1"
                    },
                    MemberWallet = new MemberWalletView {
                        Cmid    = Cmid,
                        Credits = 2000,
                        Points  = 2000
                    }
                };

                var newPlayerStatisticsView = new PlayerStatisticsView {
                    Cmid             = Cmid,
                    PersonalRecord   = new PlayerPersonalRecordStatisticsView(),
                    WeaponStatistics = new PlayerWeaponStatisticsView()
                };

                var instance = new MemberAuthenticationResultView {
                    MemberAuthenticationResult = MemberAuthenticationResult.Ok,
                    MemberView           = newMemberView,
                    PlayerStatisticsView = newPlayerStatisticsView,
                    ServerTime           = DateTime.Now,
                    IsAccountComplete    = true,
                    AuthToken            = Convert.ToBase64String(Encoding.UTF8.GetBytes(steamId))
                };

                userData[steamId]         = newMemberView;
                playerStatistics[steamId] = newPlayerStatisticsView;

                MemberAuthenticationResultViewProxy.Serialize(outputStream, instance);

                UpdatePlayerData();
            }

            return(outputStream.ToArray());
        }