/* 
 * Script decompiled by jagdecs2 v3.2
 * Decompiler opts:
 * --------------
 * t1LocalAnalyzer:true
 * t2LocalAnalyzer:true
 * beautifier:true
 * --------------
 * Made by mgi125 ;)
 */


void script_2946(int a0) {
	object v19;
	int v0 = script_2948();
	int v2 = 39059527;
	int v26 = 39059523;
	int v8 = 39059610;
	if (cs2method_10135() == 1) {
		v2 = 63897626;
		v26 = 63897621;
		v8 = 63897603;
	}
	if (v0 == 49) {
		if (cs2_configs['cfg1100'] != 49) {
			script_4121();
			script_2954();
			script_2950(v0, "The Jagex Account Guardian is protecting this account." + "<br>" + "<br>" + "This device is not recognised. An email has been sent to the validated email address." + "<br>" + "<br>" + "Follow the link in the email to add this device. (Please check your spam folders)", 1, 0, 13105, 1, "Resend Email", 0, 1, "Back");
		}
		cs2_configs['cfg1100'] = 49;
		return;
	}
	if (v0 == 52) {
		if (cs2_configs['cfg1100'] != 52) {
			script_4121();
			script_2954();
			script_2950(v0, "The Jagex Account Guardian is protecting this account." + "<br>" + "<br>" + "You need to validate this device to use with your account. Please follow the instructions in the window that will open shortly." + "<br>" + "<br>" + "If no window appears, we can send you an email to complete the process.", 1, 0, 13105, 1, "Send Email", 0, 1, "Back");
		}
		cs2_configs['cfg1100'] = 52;
		return;
	}
	if (v0 == 56) {
		if (cs2_configs['cfg1100'] != 56) {
			script_2954();
			script_4121();
			script_2408("Enter the 6-digit code generated by your Authenticator app.");
		}
		cs2_configs['cfg1100'] = 56;
		return;
	}
	if (v0 == 57) {
		if (cs2_configs['cfg1100'] != 57) {
			script_2954();
			script_4121();
			script_2408("The code you entered was incorrect." + "<br>" + "Please try again.");
		}
		cs2_configs['cfg1100'] = 57;
		return;
	}
	if (v0 == 42) {
		cs2method_10467(0, 48758810);
		cs2method_10026(48758952, cs2method_10379(cs2method_10966()));
		cs2method_10026(48758953, cs2method_10379(cs2method_10361()));
		cs2_configs['cfg1100'] = 42;
		return;
	}
	if (v0 == 43) {
		cs2method_10026(48758952, cs2method_10379(cs2method_10966()));
		cs2method_10026(48758953, cs2method_10379(cs2method_10361()));
		cs2_configs['cfg1100'] = 43;
		return;
	}
	cs2method_10467(1, 48758810);
	if (v0 == -3) {
		cs2method_10026(v2, "Logging in...");
		cs2method_20390(new function<none>() {
		}, "", new WidgetPointer(v26));
		script_2950(v0, "Logging In - Please Wait", 0, 1, -1, 0, "", -1, 0, "");
		cs2_configs['cfg1100'] = -3;
		return;
	}
	if (cs2_configs['cfg1100'] == -3) {
		script_2954();
	}
	int v15 = 0;
	object v14 = "";
	if (v0 == 21) {
		object v27;
		cs2_configs['cfg1100'] = 21;
		cs2method_10026(v2, "Logging in...");
		cs2method_20390(new function<none>() {
		}, "", new WidgetPointer(v26));
		if (cs2_configs['cfg200'] == 0) {
			cs2_configs['cfg200'] = cs2method_10541();
		}
		cs2_configs['cfg200'] = cs2method_10461(cs2_configs['cfg200'], 1);
		if (cs2_configs['cfg200'] <= 0) {
			cs2method_20162(new function<none>() {
			}, "", new WidgetPointer(v26));
			if (a0 == 0) {
				script_2945(0);
			} else {
				script_4634(a0);
			}
			return;
		}
		int v28 = cs2method_10968(cs2_configs['cfg200'], 50);
		if (v28 == 1) {
			v27 = "You have only just left another world. Your profile will be transferred in" + "<br>" + "1 second.";
		} else {
			v27 = "You have only just left another world. Your profile will be transferred in" + "<br>" + (string)cs2method_10379(v28) + " seconds.";
		}
		if (cs2method_10609(v8) == 1) {
			script_2950(v0, v27, 0, 0, 2611, 1, "Abort Login", 1, 0, "");
		} else {
			script_3233(v27);
		}
		return;
	}
	script_2954();
	script_4121();
	int v4 = 0;
	object v12 = "";
	if (v0 == 1) {
		object v27;
		cs2method_10026(v2, "Logging in...");
		cs2method_20390(new function<none>() {
		}, "", new WidgetPointer(v26));
		int v28 = cs2method_10968(cs2method_10461(500, cs2_configs['cfg201']), 50);
		if (cs2_configs['cfg202'] == 0) {
			if (v28 == 1) {
				v27 = "Could not display video advertisement. Login will continue in 1 second.";
			} else {
				v27 = "Could not display video advertisement. Login will continue in " + (string)cs2method_10379(v28) + " seconds";
			}
		} else if (cs2_configs['cfg201'] < 500) {
			if (v28 == 1) {
				v27 = "Displaying video advertisement. Login will continue in 1 second.";
			} else {
				v27 = "Displaying video advertisement. Login will continue in " + (string)cs2method_10379(v28) + " seconds.";
			}
		} else {
			v27 = "Displaying video advertisement. Login will continue in 0 seconds.";
		}
		script_2950(v0, v27, 0, 0, 2611, 0, "", -1, 0, "");
		cs2_configs['cfg201'] = cs2method_10060(cs2_configs['cfg201'], 1);
		script_2954();
		cs2method_10826();
		return;
	}
	script_2954();
	if (cs2method_10135() == 1) {
		cs2method_10026(v2, "Play Game");
	} else {
		cs2method_10026(v2, "Login");
	}
	cs2method_20390(new function<script_2944>() {
		script_2945(0);
		return;
	}, "", new WidgetPointer(v26));
	if (cs2method_10135() == 1) {
		cs2method_20162(new function<none>() {
		}, "", new WidgetPointer(975,3));
	} else {
		cs2method_20162(new function<none>() {
		}, "", new WidgetPointer(596,154));
	}
	object v5 = "";
	int v21 = 1;
	int v6 = 0;
	int v3 = 2608;
	int v10 = 0;
	int v7 = 0;
	object v1 = "";
	int v11 = 1;
	object v17 = "Back";
	int v9 = 0;
	int v18 = 0;
	int v20 = 0;
	int v22 = 0;
	switch (v0) {
		case -2:
			script_2954();
			if (cs2method_10135() == 1) {
				return;
			}
			script_2940(11);
			return;
		case 29:
			switch (cs2method_10930()) {
				case 0:
					v19 = "You must have a Combat Level of at least 20 (not including Summoning) to enter a PvP world.";
					break;
				case 1:
					v19 = "You are currently carrying lent items and cannot enter a PvP world.";
					break;
				case 2:
					v19 = "You must be standing in the Wilderness or Edgeville to enter this bounty world.";
					break;
				case 3:
					v19 = "You must have a total skill level of 1,000 or greater to enter this world.";
					break;
				case 5:
					v19 = "You must have a total skill level of 1,500 or greater to enter this world.";
					break;
				case 6:
					v19 = "You must have a total skill level of 2,000 or greater to enter this world.";
					break;
				case 7:
					v19 = "You must have a total skill level of 2,400 or greater to enter this world.";
					break;
				case 4:
					v19 = "You must move to a safe area before you can log in to a PvP or bounty world.";
					break;
				case 8:
					v19 = "VIP server access is only available to Gold Premier Club members." + "<br>" + "Become a VIP today. On sale for a limited time only.";
					v10 = 1;
					v1 = "Buy online";
					break;
				case 9:
					v19 = "This server is for staff only.";
					break;
				case 10:
					v19 = "You cannot enter a legacy world while in the tutorial.";
					break;
				default:
					v19 = "Unexpected server response. Please try using a different world.";
			}
			break;
		case 46:
			v19 = "This instance is marked for deletion/rebuild. Please try using a different world.";
			break;
		case 45:
			switch (cs2method_10463()) {
				case 0:
					switch (cs2method_10930()) {
						case 0:
							v19 = "You must be near the TzHaar Fight Pits entrance to enter a global match.";
							break;
						default:
							v19 = "Unable to log in. Please try using a different world.";
					}
					break;
				case 1:
					switch (cs2method_10930()) {
						case 1:
							v19 = "There was an error connecting to your meeting room. Please try again.";
							break;
						case 2:
							v19 = "You need a higher rank to enter that private tent.";
							break;
						case 3:
							v19 = "You need an invitation to enter that private room.";
							break;
						default:
							v19 = "Unable to log in. Please try using a different world.";
					}
					break;
				case 6:
					switch (cs2method_10930()) {
						case 0:
							v19 = "The instance you attempted to join is full.";
							break;
						case 1:
							v19 = "You can't join that instance as you or your follower are carrying items.";
							break;
						default:
							v19 = "Unable to log in. Please try using a different world.";
					}
					break;
				default:
					v19 = "Unexpected server response. Please try using a different world.";
			}
			break;
		case -5:
			v19 = "Connection timed out. Please try using a different world.";
			break;
		case -4:
			v19 = "Error connecting to server.";
			break;
		case -1:
			v19 = "No response from server. Please try using a different world.";
			break;
		case 5:
			v19 = "Your account has not logged out from its last session or the server is too busy to handle your request. Please try again in a few minutes or try a different server.";
			break;
		case 7:
			v19 = "This world is full. Please use a different world.";
			break;
		case 8:
			v19 = "Unable to connect: login server offline.";
			break;
		case 9:
			v19 = "Login limit exceeded: too many connections from your address.";
			break;
		case 10:
			v19 = "Unable to connect: bad session id.";
			break;
		case 13:
			v19 = "Could not complete login. Please try using a different world.";
			break;
		case 16:
			v19 = "Too many incorrect logins from your address. Please wait 5 minutes before trying again.";
			break;
		case 17:
			v19 = "You are standing in a members-only area. To play on this world, move to a free area first.";
			break;
		case 20:
			v19 = "Invalid loginserver requested. Please try using a different world.";
			break;
		case 22:
			v19 = "Malformed login packet. Please try again.";
			break;
		case 23:
			v19 = "No reply from login server. Please wait a minute and try again.";
			break;
		case 24:
			v19 = "Error loading your profile. Please contact customer support.";
			break;
		case 25:
			v19 = "Unexpected loginserver response. Please try using a different world.";
			break;
		case 26:
			v19 = "This computer's address has been blocked, as it was used to break our rules.";
			break;
		case 27:
			v19 = "Service unavailable.";
			break;
		case 36:
			v19 = "Unable to connect: authentication server offline.";
			break;
		case 37:
			v19 = "Your account is currently inaccessible. Please try again in a few minutes.";
			break;
		case 39:
			v19 = "The instance you tried to join no longer exists. Please try using a different world.";
			break;
		case 41:
			v19 = "The instance you tried to join is full. Please try back later or try using a different world.";
			break;
		case 44:
			v19 = "Our systems are currently unavailable. Please try again in a few minutes.";
			break;
		case 55:
			v19 = "Could not complete login. Access to this account is not authorised.";
			break;
		case 35:
			v19 = "Your session has expired. Please click 'Back' in your browser to renew it.";
			v17 = "Close";
			break;
		case 14:
			v21 = 0;
			v3 = 2610;
			v19 = "The server is being updated. Please wait a few minutes and try again.";
			break;
		case 6:
			v21 = 0;
			v3 = 2610;
			v19 = "RuneScape has been updated! Please reload this page.";
			break;
		case 3:
			if (cs2_configs['cfg1414'] == 1) {
				v19 = "Invalid username or password." + "<br>" + "<br>" + "For accounts created after the 24th of November 2010, please use your email address to login. Otherwise please login with your username.";
			} else if (cs2_configs['cfg1414'] == 2) {
				v19 = "Invalid email or password." + "<br>" + "<br>" + "For accounts created after the 24th of November 2010, please use your email address to login. Otherwise please login with your username.";
			} else {
				v19 = "Invalid login or password." + "<br>" + "<br>" + "For accounts created after the 24th of November 2010, please use your email address to login. Otherwise please login with your username.";
			}
			v17 = "Try Again";
			v10 = 1;
			v1 = "Forgotten your password?";
			break;
		case 4:
			v19 = "Your account has been disabled. Check your message centre for details.";
			v10 = 1;
			v1 = "Message Centre";
			break;
		case 11:
			v19 = "Your password is an extremely common choice, and is not secure. You must change it before you can login.";
			v10 = 1;
			v1 = "Change Password";
			break;
		case 18:
			v3 = 2612;
			v19 = "Your account has been locked. If you have not received an account recovery email, please select 'Recover Account'.";
			v10 = 1;
			v1 = "Recover Account";
			break;
		case 30:
			v19 = "This is not a member's account; please choose a 'free' world from the website to play on this account.";
			v10 = 1;
			v1 = "Subscribe";
			break;
		case 31:
			v19 = "You must change your account's display name before you can login.";
			v10 = 1;
			v1 = "Change Display Name";
			break;
		case 19:
			v19 = "Fullscreen is currently a members-only feature. To log in, exit fullscreen via the options menu or use a member's account.";
			v10 = 1;
			v1 = "Subscribe";
			break;
		case 12:
			v19 = "You need a member's account to log in to this world. Please subscribe or use a different world.";
			v10 = 1;
			v1 = "Subscribe";
			break;
		case 40:
			v19 = "You need a member's account to log in to this world. Please subscribe or use a different world.";
			v10 = 1;
			v1 = "Subscribe";
			break;
		case 32:
			v19 = "Your attempt to log into your account was unsuccessful.  Don't worry, it's easy to sort this out quickly.";
			v10 = 1;
			v1 = "Click Here";
			v11 = 0;
			break;
		case 47:
		case 51:
			v19 = "You need to validate your email address to log in.";
			break;
		case 48:
			v19 = "Your game session has now ended." + "<br>" + "<br>" + "To play again, please close your browser tab/window and wait 5 minutes before reloading the game. ";
			break;
		case 53:
			cs2_configs['cfg200'] = cs2method_10608();
			int v13 = cs2_configs['cfg200'];
			script_6716_struct(3,0,0) v16 = script_6716(v13);
			int v24 = v16.intpart_2;
			int v23 = v16.intpart_1;
			int v25 = v16.intpart_0;
			v19 = "Your ban will be lifted in" + "<br>" + (string)cs2method_10379(v25) + " hours, " + (string)cs2method_10379(v23) + " minutes, " + (string)cs2method_10379(v24) + " seconds";
			cs2method_20162(new function<script_6715>() {
				object v0;
				if (cs2method_10038(cs2method_10133(), 50) != 0) {
					return;
				}
				int v2 = 0;
				int v1 = 0;
				int v3 = 0;
				object v4 = "";
				cs2_configs['cfg200'] = cs2method_10461(cs2_configs['cfg200'], 1);
				if (cs2_configs['cfg200'] < 1) {
					v0 = "Your ban has expired. You can log in game now.";
					cs2method_20162(new function<none>() {
					}, "", new WidgetPointer(596,154));
				} else {
					int v7 = cs2_configs['cfg200'];
					script_6716_struct(3,0,0) v8 = script_6716(v7);
					int v6 = v8.intpart_2;
					int v5 = v8.intpart_1;
					int v9 = v8.intpart_0;
					v0 = "Your ban will be lifted in" + "<br>" + (string)cs2method_10379(v9) + " hours, " + (string)cs2method_10379(v5) + " minutes, " + (string)cs2method_10379(v6) + " seconds";
				}
				script_3233(v0);
				return;
			}, "", new WidgetPointer(596,154));
			break;
		case 50:
			v19 = "The Jagex Account Guardian is protecting this account." + "<br>" + "<br>" + "This device is not recognised." + "<br>" + "<br>" + "No new devices can be added for up to 24 hours as too many failed attempts to answer the security questions have been made." + "<br>" + "<br>" + "During this time access will still be granted to any devices already trusted.";
			v3 = 13105;
			break;
		case 38:
			v19 = "Your account has not currently been selected to participate in the HTML5 Beta.";
			break;
		default:
			v19 = "Unexpected server response. Please try using a different world.";
	}
	script_2950(v0, v19, v21, v6, v3, v10, v1, v7, v11, v17);
	cs2method_10345();
	return;
}
