baltica 0.1.18 → 0.1.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -35,10 +35,12 @@ class Client extends shared_1.Emitter {
35
35
  ? new worker_1.WorkerClient({
36
36
  address: this.options.address,
37
37
  port: this.options.port,
38
+ proxy: this.options.proxy,
38
39
  })
39
40
  : new raknet_1.Client({
40
41
  address: this.options.address,
41
42
  port: this.options.port,
43
+ proxy: this.options.proxy,
42
44
  });
43
45
  /** Create ClientData to store and handle auth data */
44
46
  this.data = new types_2.ClientData(this);
@@ -47,6 +47,17 @@ export type ClientOptions = {
47
47
  email?: string;
48
48
  /** Password for direct email/password authentication (requires 2FA disabled) */
49
49
  password?: string;
50
+ /** SOCKS5 Proxy for the client to use. */
51
+ proxy?: {
52
+ /** Proxy Host */
53
+ host: string;
54
+ /** Proxy Port */
55
+ port: number;
56
+ /** Proxy Username */
57
+ userId?: string;
58
+ /** Proxy Password */
59
+ password?: string;
60
+ };
50
61
  };
51
62
  /** Default Client Options */
52
63
  export declare const defaultClientOptions: ClientOptions;
@@ -41,6 +41,22 @@ async function authenticateWithCredentials(options) {
41
41
  throw new Error("Authentication failed: Invalid credentials or 2FA is enabled.\n" +
42
42
  "Direct email/password login only works with 2FA DISABLED.");
43
43
  }
44
+ // Check for Xbox Live specific errors
45
+ const xErr = err.data?.attributes?.extra?.body?.XErr;
46
+ if (xErr) {
47
+ const xboxErrors = {
48
+ 2148916233: "No Xbox profile exists for this account. Create one at https://xbox.com/live",
49
+ 2148916227: "Account banned by Xbox for violating Community Standards.",
50
+ 2148916229: "Account restricted - guardian permission required. Visit https://account.microsoft.com/family/",
51
+ 2148916234: "Must accept Xbox Terms of Service. Login at https://xbox.com",
52
+ 2148916235: "Account region not authorized by Xbox.",
53
+ 2148916236: "Account requires age verification. Login at https://login.live.com",
54
+ 2148916238: "Account under 18 must be added to a family by an adult.",
55
+ };
56
+ if (xboxErrors[xErr]) {
57
+ throw new Error(`Xbox Live error: ${xboxErrors[xErr]}`);
58
+ }
59
+ }
44
60
  throw error;
45
61
  }
46
62
  }
@@ -120,6 +120,7 @@ async function authenticateWithEmailPassword(client) {
120
120
  }
121
121
  catch (error) {
122
122
  raknet_1.Logger.error(`Email/password authentication failed: ${error instanceof Error ? error.message : String(error)}`);
123
+ raknet_1.Logger.warn("Make sure you have an xbox profile crated!");
123
124
  throw error;
124
125
  }
125
126
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "baltica",
3
3
  "description": "Library for Minecraft Bedrock Edition community developers.",
4
- "version": "0.1.18",
4
+ "version": "0.1.19",
5
5
  "minecraft": "1.21.130",
6
6
  "main": "dist/index.js",
7
7
  "license": "MIT",