@@ -164,7 +164,7 @@ fn default_url() -> Url {
164
164
}
165
165
166
166
impl < C > Api < C > {
167
- /// Creates a new API instance for the official server with the `https://screeps.com/api/` base
167
+ /// Creates a new API instance for the official server with the `" https://screeps.com/api/" ` base
168
168
/// url.
169
169
///
170
170
/// Use [`Api::with_url`] or [`Api::set_url`] to change to a custom server.
@@ -200,6 +200,8 @@ impl<C> Api<C> {
200
200
201
201
/// Sets the auth token this api client will use.
202
202
///
203
+ /// See [the screeps docs page](https://docs.screeps.com/auth-tokens.html) for information on tokens.
204
+ ///
203
205
/// See also [`Api::with_token`].
204
206
#[ inline]
205
207
pub fn set_token < T : Into < Token > > ( & mut self , token : T ) {
@@ -208,6 +210,8 @@ impl<C> Api<C> {
208
210
209
211
/// Sets the auth token this api client will use, and returns the client.
210
212
///
213
+ /// See [the screeps docs page](https://docs.screeps.com/auth-tokens.html) for information on tokens.
214
+ ///
211
215
/// See also [`Api::set_token`].
212
216
#[ inline]
213
217
pub fn with_token < T : Into < Token > > ( mut self , token : T ) -> Self {
@@ -267,9 +271,15 @@ impl<C: hyper::client::connect::Connect + 'static> Api<C> {
267
271
self . request ( endpoint) . post ( request_text)
268
272
}
269
273
270
- /// Logs in with the given username and password and returns a result containing the token.
274
+ /// Logs in with the given username and password and stores the authenticated token in self.
275
+ ///
276
+ /// *Note:* since [the official server implemented auth tokens][blog], this method has only
277
+ /// worked for private servers with the [screepsmod-auth] mod.
271
278
///
272
- /// Use `client.set_token(logged_in.token)` to let the client use the token from logging in.
279
+ /// Use [`Api::set_token`] instead for the official server.
280
+ ///
281
+ /// [blog]: https://blog.screeps.com/2017/12/auth-tokens/
282
+ /// [screepsmod-auth]: https://github.com/ScreepsMods/screepsmod-auth
273
283
pub fn login < ' b , U , V > (
274
284
& self ,
275
285
username : U ,
0 commit comments