LoadDeck() public method

public LoadDeck ( int id, System.Guid type, int group, string size, string sleeve, bool limited ) : void
id int
type System.Guid
group int
size string
sleeve string
limited bool
return void
Exemplo n.º 1
0
        public void LoadDeck(int[] id, Guid[] type, int[] @group, string[] size, string sleeveString, bool limited)
        {
            short s = State.Instance.GetPlayer(_sender).Id;

            for (int i = 0; i < id.Length; i++)
            {
                id[i] = s << 16 | (id[i] & 0xffff);
            }

            var sstring = "";

            try
            {
                var split = sleeveString.Split(new char[1] {
                    '\t'
                }, 2);
                if (split.Length == 2)
                {
                    var sid = 0;
                    if (int.TryParse(split[0], out sid))
                    {
                        Uri url = null;
                        if (Uri.TryCreate(split[1], UriKind.Absolute, out url))
                        {
                            if (State.Instance.Engine.IsLocal == false)
                            {
                                // Check if the user can even do this
                                var p    = State.Instance.GetPlayer(_sender);
                                var c    = new ApiClient();
                                var resp = c.CanUseSleeve(p.Nick, sid);
                                if (resp.Authorized)
                                {
                                    sstring = split[1];
                                }
                            }
                            else
                            {
                                sstring = split[1];
                            }
                        }
                    }
                }
            }
            catch (Exception e)
            {
                if (State.Instance.Engine.IsLocal)
                {
                    Log.Warn("LoadDeck", e);
                }
                else
                {
                    Log.Error("LoadDeck", e);
                }
            }
            _broadcaster.LoadDeck(id, type, group, size, sstring, limited);
        }
Exemplo n.º 2
0
        public void LoadDeck(int[] id, ulong[] type, int[] group)
        {
            short s = _clients[_sender].Id;

            for (int i = 0; i < id.Length; i++)
            {
                id[i] = s << 16 | (id[i] & 0xffff);
            }
            _broadcaster.LoadDeck(id, type, group);
        }
Exemplo n.º 3
0
        public void LoadDeck(int[] id, ulong[] type, int[] group)
        {
            short s = State.Instance.GetPlayer(_sender).Id;

            for (int i = 0; i < id.Length; i++)
            {
                id[i] = s << 16 | (id[i] & 0xffff);
            }
            _broadcaster.LoadDeck(id, type, group);
        }