예제 #1
0
        public static string NewGame(ApiKey apiKey, Language language, ServerType serverType)
        {
            var server = ServerSelector.GetServerFor(language, serverType);

            if (string.IsNullOrEmpty(server))
            {
                throw new InvalidOperationException($"No server does match the language {language} and server type {serverType}.");
            }

            return
                ($"https://{server}/new_session?partner=1&callback=jQuery331023608747682107778_{GetTime()}&player=website-desktop&uid_ext_session={apiKey.SessionUid}&frontaddr={apiKey.FrontAdress.UrlEncode()}&constraint=ETAT%3C%3E%27AV%27&&constraint=ETAT<>'AV'");
        }
예제 #2
0
        public static string GetGuessUrl(
            GuessRequest request,
            Language language,
            ServerType serverType)
        {
            if (request == null)
            {
                throw new ArgumentNullException(nameof(request));
            }
            var server = ServerSelector.GetServerFor(language, serverType);

            if (string.IsNullOrEmpty(server))
            {
                throw new InvalidOperationException($"No server does match the language {language} and server type {serverType}.");
            }

            var url = $"https://{server}/list?session={request.Session}&signature={request.Signature}&step={request.Step}";

            return(url);
        }