Ejemplo n.º 1
0
        public byte[] GetLoadout(byte[] data)
        {
            var inputStream = new MemoryStream(data);
            var steamId     = Encoding.UTF8.GetString(Convert.FromBase64String(StringProxy.Deserialize(inputStream)));

            LoadoutView instance = null;

            if (loadoutData.ContainsKey(steamId) && loadoutData[steamId] != null)
            {
                instance = loadoutData[steamId];
            }
            else
            {
                instance = new LoadoutView {
                    MeleeWeapon = 1,
                    Weapon1     = 12
                };

                loadoutData[steamId] = instance;
                UpdateInventoryData();
            }

            var outputStream = new MemoryStream();

            LoadoutViewProxy.Serialize(outputStream, instance);

            return(outputStream.ToArray());
        }
Ejemplo n.º 2
0
        byte[] IUserWebServiceContract.SetLoadout(byte[] data)
        {
            try
            {
                using (var bytes = new MemoryStream(data))
                {
                    var authToken   = StringProxy.Deserialize(bytes);
                    var loadoutView = LoadoutViewProxy.Deserialize(bytes);

                    var result = OnSetLoaduout(authToken, loadoutView);
                    using (var outBytes = new MemoryStream())
                    {
                        EnumProxy <MemberOperationResult> .Serialize(outBytes, result);

                        return(outBytes.ToArray());
                    }
                }
            }
            catch (Exception ex)
            {
                Log.Error("Unable to handle SetLoadout request:");
                Log.Error(ex);
                return(null);
            }
        }
Ejemplo n.º 3
0
        public LoadoutView GetLoadout(string authToken)
        {
            using (var bytes = new MemoryStream())
            {
                StringProxy.Serialize(bytes, authToken);

                var data = Channel.GetLoadout(bytes.ToArray());
                using (var inBytes = new MemoryStream(data))
                    return(LoadoutViewProxy.Deserialize(inBytes));
            }
        }
Ejemplo n.º 4
0
        // Token: 0x060011F7 RID: 4599 RVA: 0x0001DF4C File Offset: 0x0001C14C
        public static Coroutine GetLoadout(string authToken, Action <LoadoutView> callback, Action <Exception> handler)
        {
            Coroutine result;

            using (MemoryStream memoryStream = new MemoryStream())
            {
                StringProxy.Serialize(memoryStream, authToken);
                result = MonoInstance.Mono.StartCoroutine(SoapClient.MakeRequest("IUserWebServiceContract", "UserWebService", "GetLoadout", memoryStream.ToArray(), delegate(byte[] data)
                {
                    if (callback != null)
                    {
                        callback(LoadoutViewProxy.Deserialize(new MemoryStream(data)));
                    }
                }, handler));
            }
            return(result);
        }
Ejemplo n.º 5
0
        public byte[] SetLoadout(byte[] data)
        {
            var inputStream = new MemoryStream(data);
            var steamId     = Encoding.UTF8.GetString(Convert.FromBase64String(StringProxy.Deserialize(inputStream)));
            var loadoutView = LoadoutViewProxy.Deserialize(inputStream);

            var outputStream = new MemoryStream();

            if (loadoutData.ContainsKey(steamId) && loadoutData[steamId] != null)
            {
                loadoutData[steamId] = loadoutView;

                UpdateInventoryData();

                Int32Proxy.Serialize(outputStream, (int)MemberOperationResult.Ok);
            }
            else
            {
                Int32Proxy.Serialize(outputStream, (int)MemberOperationResult.MemberNotFound);
            }

            return(outputStream.ToArray());
        }
Ejemplo n.º 6
0
        byte[] IUserWebServiceContract.GetLoadout(byte[] data)
        {
            try
            {
                using (var bytes = new MemoryStream(data))
                {
                    var authToken = StringProxy.Deserialize(bytes);

                    LoadoutView view = OnGetLoadout(authToken);
                    using (var outBytes = new MemoryStream())
                    {
                        LoadoutViewProxy.Serialize(outBytes, view);
                        return(outBytes.ToArray());
                    }
                }
            }
            catch (Exception ex)
            {
                Log.Error("Unable to handle GetLoadout request:");
                Log.Error(ex);
                return(null);
            }
        }