Email System (Release)

Discussion and information relevant to creating special missions, new ships, skins etc.

Moderators: winston, another_commander

Post Reply
QCS
Dangerous
Dangerous
Posts: 112
Joined: Sun Feb 22, 2015 6:52 pm

Re: Email System (Release)

Post by QCS »

The "Small fix on good service level" item in the shop seems to create emails (shown in F4 as unread) but when opening the Email system, no mail is there.

Log (excerpt):

JavaScript warning (GalCopAdminServices 1.4.4): Unknown expansion key [maint_itemname_EQ_SERVICE_LEVEL_SMALL_FIX_4] in string.
oolite.oxp.phkb.EmailSystem.oxz/Scripts/galcopadmin.js, line 409.

---
Edit:
When my escorts (EscortDeck/EscortPack OXP) kill a fugitive with a bounty, the email states (no bounty).
User avatar
phkb
Impressively Grand Sub-Admiral
Impressively Grand Sub-Admiral
Posts: 4814
Joined: Tue Jan 21, 2014 10:37 pm
Location: Writing more OXPs, because the world needs more OXPs.

Re: Email System (Release)

Post by phkb »

Vincentz wrote:
How about sending an email when getting Cargo, Passenger Parcel contracts?
Wildeblood wrote:
The contracts should already be creating emails for Oolite 1.81
Wildeblood is correct, you'll get emails about contracts (and scooped escape pods) in 1.81.
Vincentz wrote:
Sends email to archive
I'm not sure about the archive function. The problem is not technical (it's not that hard to do), but practical. Archived emails have to be stored and retrieved. All that storage is in your save game file, and when the save game is loaded all that data has to go into memory somewhere. Having thousands, or even hundreds, of archived email is a massive resource drain, both in memory allocation and save game size.

The reason I made most of the automated emails expire automatically is to keep the size of the mailbox down. Regular playing should mean only 1 or 2 pages of emails are being stored and retrieved.

I'm not necessarily against the idea, but I'm not sure of the best way to implement it that ensures a reasonable memory footprint.

What do others think? Would an archive system be valuable? Should it have a hard limit of, say, 100 emails? That way, if you want to archive more, you have to delete some archived emails. Or if you archive more than 100, the oldest archived emails are dropped? Other ideas?
QCS wrote:
The "Small fix on good service level" item
What OXP is that from?
QCS wrote:
When my escorts (EscortDeck/EscortPack OXP) kill a fugitive with a bounty, the email states (no bounty).
Interesting. That would mean the shipKilledOther function is getting called when your escorts kill a ship, but it's not providing details of the ship that was killed (the whom parameter). I'll have to look into the Export Pack OXP and see what it's doing.
User avatar
Wildeblood
---- E L I T E ----
---- E L I T E ----
Posts: 2407
Joined: Sat Jun 11, 2011 6:07 am
Location: Western Australia

Re: Email System (Release)

Post by Wildeblood »

phkb wrote:
QCS wrote:
The "Small fix on good service level" item
What OXP is that from?
One of Norby's, Hardships possibly.
User avatar
Norby
---- E L I T E ----
---- E L I T E ----
Posts: 2577
Joined: Mon May 20, 2013 9:53 pm
Location: Budapest, Hungary (Mainly Agricultural Democracy, TL10)
Contact:

Re: Email System (Release)

Post by Norby »

phkb wrote:
QCS wrote:
The "Small fix on good service level" item
What OXP is that from?
ShipVersion
User avatar
phkb
Impressively Grand Sub-Admiral
Impressively Grand Sub-Admiral
Posts: 4814
Joined: Tue Jan 21, 2014 10:37 pm
Location: Writing more OXPs, because the world needs more OXPs.

Re: Email System (Release)

Post by phkb »

Thanks Wildeblood and Norby. I'll check it out.
User avatar
phkb
Impressively Grand Sub-Admiral
Impressively Grand Sub-Admiral
Posts: 4814
Joined: Tue Jan 21, 2014 10:37 pm
Location: Writing more OXPs, because the world needs more OXPs.

Re: Email System (Release)

Post by phkb »

Version 1.4.5 has been released. In this version:
  • Added some more equipment key exclusions for the maintenance email (ShipVersion OXP items)
  • Added some special cases for ShipVersion repair equipment items.
  • Switched from shipKilledOther to shipTargetDestroyed to better monitor for ships destroyed by the player
  • Small bug fixes and tweaks.
Hopefully this will play nicely with ShipVersion now - let me know if you discover a problem.
User avatar
CdrC64
Average
Average
Posts: 10
Joined: Fri Feb 27, 2015 5:01 am
Location: Vetitice
Contact:

Re: Email System (Release)

Post by CdrC64 »

phkb wrote:
Version 1.4.5 has been released. In this version:
Hi phkb,

I'm having some issues downloading this from inside the game. I believe the version number in manifest.plist is still set to 1.4.4

Regards,

Glenn
User avatar
phkb
Impressively Grand Sub-Admiral
Impressively Grand Sub-Admiral
Posts: 4814
Joined: Tue Jan 21, 2014 10:37 pm
Location: Writing more OXPs, because the world needs more OXPs.

Re: Email System (Release)

Post by phkb »

Thanks for the report, Glenn. I'll get an update posted later this evening.

Edit: OK, Version 1.4.6 is released, which fixes the manifest version number issue, and another small issue with the "maint_itemname" errors in the log file.
User avatar
Wildeblood
---- E L I T E ----
---- E L I T E ----
Posts: 2407
Joined: Sat Jun 11, 2011 6:07 am
Location: Western Australia

Re: Email System (Release)

Post by Wildeblood »

You're some kind of workaholic, phkb.
User avatar
phkb
Impressively Grand Sub-Admiral
Impressively Grand Sub-Admiral
Posts: 4814
Joined: Tue Jan 21, 2014 10:37 pm
Location: Writing more OXPs, because the world needs more OXPs.

Re: Email System (Release)

Post by phkb »

I like to code. And Oolite is part of my pain management strategy.
User avatar
phkb
Impressively Grand Sub-Admiral
Impressively Grand Sub-Admiral
Posts: 4814
Joined: Tue Jan 21, 2014 10:37 pm
Location: Writing more OXPs, because the world needs more OXPs.

Re: Email System (Release)

Post by phkb »

Version 1.4.7 has just been release and is available via the download manager or via links in the first post. This version fixes an issue with the Combat Simulator OXP, where invalid emails were being sent after destroying simulator ships.
User avatar
Norby
---- E L I T E ----
---- E L I T E ----
Posts: 2577
Joined: Mon May 20, 2013 9:53 pm
Location: Budapest, Hungary (Mainly Agricultural Democracy, TL10)
Contact:

Re: Email System (Release)

Post by Norby »

Here is a fix for a timelimit problem in galcopadmin.js. When I bought a ship with 30 equipment:

Code: Select all

17:33:40.427 [script.javaScript.timeLimit] OperationCallback (OOJSEngineTimeManagement.m:229): ***** ERROR: Script "GalCopAdminServices" ran for 1.80469 seconds and has been terminated.
17:33:40.427 [script.javaScript.stackTrace] OOJSDumpStack (OOJavaScriptEngine.m:811):  0 (galcopadmin.js:924) <anonymous function>
I measured the running time of the important part in debug console:

Code: Select all

var a=console.getProfile(function(){
var equip,ship=player.ship;for (var i = 0; i < ship.equipment.length; i++) {
	if ("EQ_HULL_REPAIR".indexOf(ship.equipment[i].equipmentKey) == -1) {
		if (ship.equipment[i].isPortableBetweenShips == false) {
			equip += "- " + ship.equipment[i].name + "\n";
			added = true
		}
	}
}});log(this.name,a.javaScriptTime+" : "+a.totalTime);

0.003686000000003631 : 3.788045  
Almost 4 seconds due to the access of the equipment array is very slow.

You can fix it like this:

Code: Select all

var a=console.getProfile(function(){
var equip,e=player.ship.equipment,i;for (i = 0; i < e.length; i++) {
	var q = e[i];
	if ("EQ_HULL_REPAIR".indexOf(q.equipmentKey) == -1) {
		if (q.isPortableBetweenShips == false) {
			equip += "- " + q.name + "\n";
			added = true
		}
	}
}log(this.name,"i="+i);});
log(this.name,a.javaScriptTime+" : "+a.totalTime);

i=30

0.0004270000000001165 : 0.013895
270 times faster. :)
User avatar
phkb
Impressively Grand Sub-Admiral
Impressively Grand Sub-Admiral
Posts: 4814
Joined: Tue Jan 21, 2014 10:37 pm
Location: Writing more OXPs, because the world needs more OXPs.

Re: Email System (Release)

Post by phkb »

Norby wrote:
270 times faster
:shock: :shock:

Wow. OK, well, new version will be out soon. Thanks for taking the time to find and debug the issue Norby.
User avatar
Wildeblood
---- E L I T E ----
---- E L I T E ----
Posts: 2407
Joined: Sat Jun 11, 2011 6:07 am
Location: Western Australia

Re: Email System (Release)

Post by Wildeblood »

phkb wrote:
Norby wrote:
270 times faster
:shock: :shock:

Wow.
I think if you go back to the first page of this thread, I was harping on about avoiding player.ship.equipment as much as possible. :D
User avatar
phkb
Impressively Grand Sub-Admiral
Impressively Grand Sub-Admiral
Posts: 4814
Joined: Tue Jan 21, 2014 10:37 pm
Location: Writing more OXPs, because the world needs more OXPs.

Re: Email System (Release)

Post by phkb »

Version 1.4.11 is now up which incorporates the changes Norby supplied to improve performance.
Wildeblood wrote:
I think if you go back to the first page of this thread, I was harping on about avoiding player.ship.equipment as much as possible
My apologies for not taking your advice sooner. Got there in the end, though.
Post Reply