diff --git a/xtrn/tw2/landed.ans b/xtrn/tw2/landed.ans
new file mode 100644
index 0000000000000000000000000000000000000000..e03f9e8f62c129a82b2d19a8d5aba450cbeb93f5
--- /dev/null
+++ b/xtrn/tw2/landed.ans
@@ -0,0 +1,8 @@
+ɹ������������������ͻ�͹TradeWars2/JavaScript Planet Menu�������������������ͻ
+�                 �� ���
+�� � �          ������� 1 take oreDestroy the planet�
+�� � �          ������� 2 take organicsIncrease productivity�
+� ���    �����  ������� 3 take equipmentLeave planet�
+�       �������      �� take Allplanet Report�
+�      ���������     ���
+��������������������ͼ�������������������������������������������������������ͼ
diff --git a/xtrn/tw2/landship.ans b/xtrn/tw2/landship.ans
new file mode 100644
index 0000000000000000000000000000000000000000..d1942b5fbf64994798b2916bbb026890e593bd54
--- /dev/null
+++ b/xtrn/tw2/landship.ans
@@ -0,0 +1,4 @@
+���
+���ۻ
+�����
+�����
diff --git a/xtrn/tw2/maint.js b/xtrn/tw2/maint.js
index e0ade95cf2ca228054787ba2b4708cfc296accfb..dc677c7b58f486e983ef6fdf13c3bf06a6eac044 100644
--- a/xtrn/tw2/maint.js
+++ b/xtrn/tw2/maint.js
@@ -317,7 +317,7 @@ function MoveCabal()
 			}
 		}
 	}
-	db.unlock(Settings.DB,'cabals',LOCK_WRITE);
+	db.unlock(Settings.DB,'cabals');
 }
 
 function CabalAttack(cabal, cabalRecord)
diff --git a/xtrn/tw2/planets.js b/xtrn/tw2/planets.js
index 3f97b993e0190653f2d1615eb982e3ac7db30b01..5c6c6a79116fc59785e0bc4f37f8154a88527fdd 100644
--- a/xtrn/tw2/planets.js
+++ b/xtrn/tw2/planets.js
@@ -77,6 +77,8 @@ function LandOnPlanet()
 		LockedProduction(planet);
 		db.write(Settings.DB,'planets.'+sector.Planet,planet);
 		db.unlock(Settings.DB,'planets.'+sector.Planet);
+		if(user.settings&USER_ANSI)
+			ANSIPlanet(sector.Planet);
 		PlanetReport(sector.Planet);
 		console.attributes="HW";
 		PlanetMenu(sector.Planet);
@@ -187,9 +189,7 @@ function CreatePlanet(sectorNum)
 
 function PlanetReport(planetNum)
 {
-	db.lock(Settings.DB,'planets.'+planetNum,LOCK_WRITE);
-	var planet=db.read(Settings.DB,'planets.'+planetNum);
-	db.unlock(Settings.DB,'planets.'+planetNum,LOCK_WRITE);
+	var planet=db.read(Settings.DB,'planets.'+planetNum,LOCK_READ);
 	console.crlf();
 	console.attributes="HC";
 	console.writeln("Planet: "+planet.Name);
@@ -211,6 +211,21 @@ function PlanetReport(planetNum)
 	console.writeln("You have "+freeholds+" free cargo holds.");
 }
 
+function ANSIPlanet(planetNum)
+{
+	var planet=db.read(Settings.DB, 'planets.'+planetNum,LOCK_READ);
+
+	console.printfile(fname("landed.ans"));
+	console.gotoxy(3,1);
+	console.attributes="HM";
+	console.writeln(planet.Name+ascii(204));
+	if(planet.OccupiedCount > 1) {
+		console.printfile(fname("landship.ans"));
+	}
+	console.gotoxy(1,9);
+	console.attributes="N";
+}
+
 function PlanetMenu(planetNum)
 {
 	var key;
@@ -247,8 +262,12 @@ function PlanetMenu(planetNum)
 				PlanetReport(planetNum);
 				break;
 			case '?':
-				console.crlf();
-				console.printfile(fname("planet.asc"));
+				if(user.settings&USER_ANSI)
+					ANSIPlanet(planetNum);
+				else {
+					console.crlf();
+					console.printfile(fname("planet.asc"));
+				}
 				break;
 			default:
 				var keynum=parseInt(key);
@@ -272,12 +291,12 @@ function DestroyPlanet(planetNum)
 	console.write("Are you sure (Y/N)[N]? ");
 	if(InputFunc(['Y','N'])=='Y') {
 		db.lock(Settings.DB,'planets.'+planetNum,LOCK_WRITE);
+		var planet=db.read(Settings.DB,"planets."+planetNum);
 		secnum=planet.Sector;
 		db.lock(Settings.DB,'sector.'+secnum,LOCK_WRITE);
-		var planet=db.read(Settings.DB,'planets.'+planetNum);
 		if(planet.OccupiedCount > 1) {
 			console.writeln("Another player prevents destroying the planet.");
-			db.unlock(Settings.DB,'planets.'+planetNum,LOCK_WRITE);
+			db.unlock(Settings.DB,'planets.'+planetNum);
 			db.unlock(Settings.DB,'sector.'+secnum);
 			return(false);
 		}
@@ -289,7 +308,7 @@ function DestroyPlanet(planetNum)
 		db.write(Settings.DB,'sectors.'+secnum,sector);
 		db.unlock(Settings.DB,'sector.'+secnum);
 		db.write(Settings.DB,'planets.'+planetNum,planet);
-		db.unlock(Settings.DB,'planets.'+planetNum,LOCK_WRITE);
+		db.unlock(Settings.DB,'planets.'+planetNum);
 		db.push(Settings.DB,'log',{Date:strftime("%a %b %d %H:%M:%S %Z"),Message:"  -  " + player.Alias + " destroyed the planet in sector " + secnum},LOCK_WRITE);
 		console.writeln("Planet destroyed.");
 		return(true);
@@ -326,7 +345,7 @@ function PlanetTakeAll(planetNum, freeholds)
 		}
 	}
 	db.write(Settings.DB,'planets.'+planetNum,planet);
-	db.unlock(Settings.DB,'planets.'+planetNum,LOCK_WRITE);
+	db.unlock(Settings.DB,'planets.'+planetNum);
 	player.Put();
 	return(freeholds);
 }
@@ -374,7 +393,7 @@ function PlanetIncreaseProd(planetNum)
 			player.Credits -= incr*Commodities[keynum].price*20;
 			planet.Production[keynum]+=incr;
 			db.write(Settings.DB,'planets.'+planetNum,planet);
-			db.unlock(Settings.DB,'planets');
+			db.unlock(Settings.DB,'planets.'+planetNum);
 			player.Put();
 			console.writeln("Production of "+Commodities[keynum].name+" increased by "+incr+" for "+incr*Commodities[keynum].price*20+" credits.");
 		}
@@ -403,17 +422,17 @@ function PlanetTakeCommodity(planetNum, commodity, freeholds)
 		max=parseInt(planet.Commodities[commodity]);
 	if(take > max) {
 		console.writeln("They don't have that many.");
-		db.unlock(Settings.DB,'planets.'+planetNum,LOCK_WRITE);
+		db.unlock(Settings.DB,'planets.'+planetNum);
 		return(freeholds);
 	}
 	if(take > freeholds) {
 		console.writeln("You don't have enough free cargo holds.");
-		db.unlock(Settings.DB,'planets.'+planetNum,LOCK_WRITE);
+		db.unlock(Settings.DB,'planets.'+planetNum);
 		return(freeholds);
 	}
 	planet.Commodities[commodity]-=take;
 	db.write(Settings.DB,'planets.'+planetNum,planet);
-	db.unlock(Settings.DB,'planets.'+planetNum,LOCK_WRITE);
+	db.unlock(Settings.DB,'planets.'+planetNum);
 	player.Commodities[commodity]+=take;
 	freeholds -= take;
 	player.Put();
diff --git a/xtrn/tw2/players.js b/xtrn/tw2/players.js
index a1dafa9b6e76895b57075cbc18b6fc171faaf775..3a4be8c0335fdea9019f3c4f0407adc056cb9b87 100644
--- a/xtrn/tw2/players.js
+++ b/xtrn/tw2/players.js
@@ -685,7 +685,7 @@ function MoveTo(to)
 				return(true);
 			}
 		}
-		db.unlock(Settings.DB,'sectors.'+player.Sector,LOCK_WRITE);
+		db.unlock(Settings.DB,'sectors.'+player.Sector);
 		console.writeln("You can't get there from here.");
 	}
 	return(false);
@@ -703,7 +703,7 @@ function LoadPlayer()
 		for(i=1; i<allplayers.length; i++) {
 			player=allplayers[i];
 			if(player.QWKID==system.qwk_id && player.UserNumber == user.number && (!file_exists(system.data_dir+format("user/%04d.tw2",player.UserNumber)))) {
-				db.unlock(Settings.DB,'players',LOCK_WRITE);
+				db.unlock(Settings.DB,'players');
 				DeletePlayer(player);
 				break;
 			}
diff --git a/xtrn/tw2/sectors.js b/xtrn/tw2/sectors.js
index 4f36f11493f6c738ab6fd46e360b5c8b658e2d92..6ba34f545a36ac5220ce011a7eb299cb5f37188a 100644
--- a/xtrn/tw2/sectors.js
+++ b/xtrn/tw2/sectors.js
@@ -363,5 +363,5 @@ function InitializeSectors()
 			sector[prop]=sector_map[i][prop];
 		db.push(Settings.DB,'sectors',sector);
 	}
-	db.unlock(Settings.DB,'sectors',LOCK_WRITE);
+	db.unlock(Settings.DB,'sectors');
 }
diff --git a/xtrn/tw2/tw2.js b/xtrn/tw2/tw2.js
index fed11e076830025fada52a19441d5350bb1434f7..565f57c575cee0255cc51709ac85b0fa43afadcc 100644
--- a/xtrn/tw2/tw2.js
+++ b/xtrn/tw2/tw2.js
@@ -32,8 +32,6 @@ var sector=null;
 var exit_tw2=false;
 
 load("json-client.js");
-load("recordfile.js");
-load("lockfile.js");
 load(startup_path+"filename.js");
 load(fname("gamesettings.js"));
 var db;
@@ -176,10 +174,18 @@ function do_exit()
 	if(player != undefined) {
 		player.Online=false;
 		if(player.Ported || player.Landed) {
+			if(db.status(Settings.DB,'sectors').lock!=undefined)
+				db.unlock(Settings.DB,'sectors');
+			if(db.status(Settings.DB,'sectors.'+player.Sector).lock!=undefined)
+				db.unlock(Settings.DB,'sectors.'+player.Sector);
 			var sector=db.read(Settings.DB,'sectors.'+player.Sector,LOCK_READ);
 			if(player.Ported) {
 				console.writeln("Leaving the port...");
 				player.Ported=false;
+				if(db.status(Settings.DB,'ports').lock!=undefined);
+					db.unlock(Settings.DB,'ports');
+				if(db.status(Settings.DB,'ports.'+sector.Port).lock!=undefined);
+					db.unlock(Settings.DB,'ports.'+sector.Port);
 				db.lock(Settings.DB,'ports.'+sector.Port,LOCK_WRITE);
 				port=db.read(Settings.DB,'ports.'+sector.Port);
 				port.OccupiedBy=0;
@@ -189,13 +195,11 @@ function do_exit()
 			if(player.Landed) {
 				console.writeln("Launching from planet...");
 				player.Landed=false;
-				try {
-					db.lock(Settings.DB,'planets.'+sector.Planet,LOCK_WRITE);
-				}
-				catch (e) {
-					db.push(Settings.DB,'log',{Date:strftime("%a %b %d %H:%M:%S %Z"),Message:"!!! Error locking planets file!\n"+e},LOCK_WRITE);
-					return;
-				}
+				if(db.status(Settings.DB,'planets').lock!=undefined);
+					db.unlock(Settings.DB,'planets');
+				if(db.status(Settings.DB,'planets.'+sector.Planet).lock!=undefined);
+					db.unlock(Settings.DB,'planets.'+sector.Planet);
+				db.lock(Settings.DB,'planets.'+sector.Planet,LOCK_WRITE);
 				var planet=db.read(Settings.DB,'planets.'+sector.Planet);
 				planet.OccupiedCount--;
 				db.write(Settings.DB,'planets.'+sector.Planet,planet);
@@ -307,7 +311,7 @@ try {
 		}
 	}
 }
-catch (e) { log(e.toSource); throw(e); }
+catch (e) { log(e); log(e.toSource); throw(e); }
 }
 
 main();
diff --git a/xtrn/tw2/twint500.js b/xtrn/tw2/twint500.js
index 1f2619d28b986389f6f167aa35274c98c64d9ddc..99377f1687c0ebe0eb4e9bb47d4bae81b480d76a 100644
--- a/xtrn/tw2/twint500.js
+++ b/xtrn/tw2/twint500.js
@@ -12,7 +12,6 @@ var LOCK_READ=1;
 load(fname("gamesettings.js"));
 load(fname("sector_map.js"));
 load(fname("ports_map.js"));
-load("recordfile.js");
 var Settings=new GameSettings();
 var db;