Debug OXP on Linux/Ubuntu

For discussion of ports to POSIX based systems, especially using GNUStep.

Moderators: another_commander, winston, Getafix

Post Reply
User avatar
DaddyHoggy
Intergalactic Spam Assassin
Intergalactic Spam Assassin
Posts: 8501
Joined: Tue Dec 05, 2006 9:43 pm
Location: Newbury, UK
Contact:

Debug OXP on Linux/Ubuntu

Post by DaddyHoggy »

OK I'm clearly being a dumbass

https://bb.oolite.space/viewtopic.php?t=4589

According to that thread Ahruman states:
On other platforms, I’d suggest starting by reading the included Read Me file.
But I can't find a readme and I don't know how to use/start the oxp/debug - all I want to do is drop a ship I'm testing right in front of me as I launch from a station so I can get a good look at it.

Any help much appreciated.
Selezen wrote:
Apparently I was having a DaddyHoggy moment.
Oolite Life is now revealed here
User avatar
Disembodied
Jedi Spam Assassin
Jedi Spam Assassin
Posts: 6881
Joined: Thu Jul 12, 2007 10:54 pm
Location: Carter's Snort

Post by Disembodied »

Code: Select all

{
   "daddyhoggy_test_ship" = (
       {
           conditions = (
               "status_string equal STATUS_LAUNCHING"
           ); 
           do = (
               "addSystemShips: daddyhoggy 1 1.0"
           ); 
       }
   );
} 
might do the trick as a script.plist. If I've not gucked the whole thing up – always a possibility – this should drop a ship called a daddyhoggy somewhere inside the aegis on launching. To perhaps increase your confidence, I took the code from the wiki...
User avatar
DaddyHoggy
Intergalactic Spam Assassin
Intergalactic Spam Assassin
Posts: 8501
Joined: Tue Dec 05, 2006 9:43 pm
Location: Newbury, UK
Contact:

Post by DaddyHoggy »

Thanks disembodied - I'm not sure my ship will appear but it'll be nice to know it should - the problem I've got is that I've copied and modified the original worm to make my own version (i.e. the Lave Roover) but I thought I'd get clever and add some glows and stuff (not brave enough to try Shaders yet) - but while the worm stuff is obviously in the original xml style format the new glow stuff examples I've found are in the more readable format you've just given me and I'm not sure I've correctly converted between one type and the other or even if you can mix and match (I suspect not!)
Selezen wrote:
Apparently I was having a DaddyHoggy moment.
Oolite Life is now revealed here
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6552
Joined: Wed Feb 28, 2007 7:54 am

Post by another_commander »

DaddyHoggy: To use the debug OXP, you must have the debug console running. On Windows, this is distributed as a separate executable. As far as I can tell, there is no debug console port for Linux yet, although the Python source files are part of the console distribution on Berlios and in theory it can be set up and should work. Someone will have to do it first, though.

Alternatively, you can try what we had done with Ahruman when the debug console was being tested for the first time: One system capable of running the console on one side (Mac or Windows PC), your Linux system running Oolite with debug OXP on the other, connected via TCP/IP. You execute commands on the console computer and see the results on the Linux side.

If this is not feasible, then I guess for now Disembodied's solution should be the best that can be done for Linux.

Edit: In fact, there _is_ a readme in the console package and it states this:
OODebugConsole_Readme.txt wrote:
You can run the python code _as is_ on macs and linux systems, but you need to install the twisted-python library first - http://twistedmatrix.com/trac/wiki/Downloads
So, I guess you can go for it, after all.
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Post by JensAyton »

Detailed instructions for using the debug console under Ubuntu:
  • Put the Debug OXP in your OXP place.
  • Open Synaptic and install “python-twisted” and “python-tk”.
  • Extract the OoDebugConsole_Src.zip archive from the oolite-debug-console package.
  • Open a terminal, cd into the extractedOoDebugConsole_Src folder, and run “python DebugConsole.py”. (A window should appear, saying “waiting for connection…” with exceptionally badly-rendered text.)
  • Run Oolite. The text “Opened connection with Oolite version 1.71.2” should appear in the console. You can now enter JavaScript expressions. For instance, try “P” (short for “player”) or “P.credits = 500000”.
Currently, the debug console does not work with the trunk, even if you fiddle with requires.plist. I’m not certain why.
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6552
Joined: Wed Feb 28, 2007 7:54 am

Post by another_commander »

Ahruman wrote:
Currently, the debug console does not work with the trunk, even if you fiddle with requires.plist. I’m not certain why.
Is this problem Linux specific? I seem to have it working fine with trunk under Windows
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Post by JensAyton »

another_commander wrote:
Ahruman wrote:
Currently, the debug console does not work with the trunk, even if you fiddle with requires.plist. I’m not certain why.
Is this problem Linux specific? I seem to have it working fine with trunk under Windows
Dunno, I just noticed. The log gives me that most helpful of messages – “error: unknown error”.
User avatar
DaddyHoggy
Intergalactic Spam Assassin
Intergalactic Spam Assassin
Posts: 8501
Joined: Tue Dec 05, 2006 9:43 pm
Location: Newbury, UK
Contact:

Post by DaddyHoggy »

Thanks guys - As usual RL has got in the way - forgot I was going on holiday!

Will do precisely what Ahruman suggested as soon as I'm back,
Selezen wrote:
Apparently I was having a DaddyHoggy moment.
Oolite Life is now revealed here
User avatar
Micha
Commodore
Commodore
Posts: 815
Joined: Tue Sep 02, 2008 2:01 pm
Location: London, UK
Contact:

Post by Micha »

The following change to OODebugTCPConsoleClient.m:readData gets it working with the oolite trunk (under Linux). There's probably a more elegant way to write the fix but it works for now. If the same fix works under MacOS perhaps this can go into the trunk.
Of course, the "if (length < 1)" test is superfluous now as well.

Also need to change the max version in the requires.plist of the OXP as well.

Code: Select all

	//while ([_inStream hasBytesAvailable])
	length = [_inStream read:buffer maxLength:kBufferSize];
	while( length > 0 )
	{
		if (length < 1)
		{
			// Under GNUstep, but not OS X (currently), -hasBytesAvailable will return YES when the buffer is in fact empty.
			if ([_inStream streamStatus] == NSStreamStatusReading) break;
			
			[self breakConnectionWithBadStream:_inStream];
			return;
		}
		
		data = [NSData dataWithBytesNoCopy:buffer length:length freeWhenDone:NO];
		OOTCPStreamDecoderReceiveData(_decoder, data);
		length = [_inStream read:buffer maxLength:kBufferSize];
	}
The glass is twice as big as it needs to be.
User avatar
Getafix
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 979
Joined: Tue Apr 01, 2008 12:55 pm
Location: A small ice asteroid, orbiting Oresrati in Galaxy 8 (a.k.a. northwest Armorica).
Contact:

Post by Getafix »

This is to confirm that using Debug.OXP 1.72 and following Ahruman's
instructions, the debug console is working properly for 1.72.2.
Furthermore, if max_version, in 'requires.plist', is changed (e.g. 1.73.99),
the debug console is also functional for trunk revision 2023.
Tested on Ubuntu 8.04 32bit and 64bit.
"Any sufficiently advanced information is indistinguishable from noise." [Newman, Lachmann, Moore]
User avatar
DaddyHoggy
Intergalactic Spam Assassin
Intergalactic Spam Assassin
Posts: 8501
Joined: Tue Dec 05, 2006 9:43 pm
Location: Newbury, UK
Contact:

Post by DaddyHoggy »

Excellent - I'll do Ahruman's fix and put debug.oxp back in my Addons folder then!
Selezen wrote:
Apparently I was having a DaddyHoggy moment.
Oolite Life is now revealed here
User avatar
Diziet Sma
---- E L I T E ----
---- E L I T E ----
Posts: 6311
Joined: Mon Apr 06, 2009 12:20 pm
Location: Aboard the Pitviper S.E. "Blackwidow"

Re: Debug OXP on Linux/Ubuntu

Post by Diziet Sma »

* Deleted to avoid unnecessary humiliation *
Last edited by Diziet Sma on Sat Jun 28, 2014 4:26 pm, edited 1 time in total.
Most games have some sort of paddling-pool-and-water-wings beginning to ease you in: Oolite takes the rather more Darwinian approach of heaving you straight into the ocean, often with a brick or two in your pockets for luck. ~ Disembodied
User avatar
cim
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 4072
Joined: Fri Nov 11, 2011 6:19 pm

Re: Debug OXP on Linux/Ubuntu

Post by cim »

Diziet Sma wrote:
I've made a DebugConsole.py file from the listing at https://github.com/OoliteProject/oolite ... Console.py and made it executable.
When you say "you made a DebugConsole.py file", what exactly do you mean? (If it wasn't using git to check it out, or using the "download zip" button on the right of https://github.com/OoliteProject/oolite-debug-console , then what did you do?)

I'm using exactly that file and it works fine here.

(Other thing to check - you say you're doing "python DebugConsole.py" - what happens if you just do "./DebugConsole.py"?)
User avatar
Diziet Sma
---- E L I T E ----
---- E L I T E ----
Posts: 6311
Joined: Mon Apr 06, 2009 12:20 pm
Location: Aboard the Pitviper S.E. "Blackwidow"

Re: Debug OXP on Linux/Ubuntu

Post by Diziet Sma »

cim wrote:
When you say "you made a DebugConsole.py file", what exactly do you mean? (If it wasn't using git to check it out, or using the "download zip" button on the right of https://github.com/OoliteProject/oolite-debug-console , then what did you do?)
Copy and pasted the listing into a text editor, saved it, made it executable.. nothing different than I've done many times with other listings.
cim wrote:
(Other thing to check - you say you're doing "python DebugConsole.py" - what happens if you just do "./DebugConsole.py"?)
Exactly the same error:

Code: Select all

  File "./DebugConsole.py", line 149
    else:
       ^
SyntaxError: invalid syntax
Most games have some sort of paddling-pool-and-water-wings beginning to ease you in: Oolite takes the rather more Darwinian approach of heaving you straight into the ocean, often with a brick or two in your pockets for luck. ~ Disembodied
User avatar
Diziet Sma
---- E L I T E ----
---- E L I T E ----
Posts: 6311
Joined: Mon Apr 06, 2009 12:20 pm
Location: Aboard the Pitviper S.E. "Blackwidow"

Re: Debug OXP on Linux/Ubuntu

Post by Diziet Sma »

Never mind.. I'm an idiot.

Totally didn't see the "Download zip" button. Downloaded the entire thing, ran that file and all is working correctly. Been so long since I used it, I'd forgotten there were other files necessary for it to work properly.

I'll just go crawl under a rock now.. :oops:
Most games have some sort of paddling-pool-and-water-wings beginning to ease you in: Oolite takes the rather more Darwinian approach of heaving you straight into the ocean, often with a brick or two in your pockets for luck. ~ Disembodied
Post Reply