Ejemplo n.º 1
0
        public static CascKnownClient ToKnownClient(this CascGameId gameId)
        {
            CascKnownClient result;

            if (!GameClientMap.TryGetValue(gameId, out result))
            {
                result = CascKnownClient.Unknown;
            }

            return(result);
        }
Ejemplo n.º 2
0
        private CascKnownClient GetClient()
        {
            if (_handle == null || _handle.IsInvalid)
            {
                throw new ObjectDisposedException("CascStorageContext");
            }

            uint storageInfo = 0, lengthNeeded = 4;

            if (!_api.CascGetStorageInfo(_handle, CascStorageInfoClass.GameInfo, ref storageInfo, new IntPtr(4), ref lengthNeeded))
            {
                throw new CascException();
            }

            CascGameId gameId = (CascGameId)storageInfo;

            return(gameId.ToKnownClient());
        }