View unanswered posts | View active topics It is currently Mon Apr 20, 2026 9:09 am



Reply to topic  [ 5 posts ] 
 New Stuff for TWXProxy Comments/Flames needed. 
Author Message
Lieutenant J.G.
User avatar

Joined: Sun Mar 13, 2005 3:00 am
Posts: 387
Location: USA
Unread post New Stuff for TWXProxy Comments/Flames needed.
Greetings and Salutations fellow TradeWarrior Developers or tinkerers

I will attach my newest attempt at improving TWXProxy for some comments and suggestions.

Here are some of the additions I have added.
A listening socket on port 5758 that needs a sector # between 1 and Universe Size for
the Sector # to get information from.

For those of you who are Paranoid I think I have disabled external connections
My logic might be wrong but here is the gist of it
On connecting to TWX I grab the Remote address of the connecting socket and if it is
not equal to 127.0.0.1 it disconnects, I am sure this can be spoofed as it is very simple "security".

TWXProxy will call the Database function LoadSector and convert the Sector information to XML.
I used a portion of the XML schema from the Swath Website to convey the information.

I need some feedback on this if anyone wants to test it.
On the socket side of it all is accepts is a string that represents the Sector Index.
There is no additional error checking on whether this is valid input as I think that
TWX will throw an exception if the sector is invalid.

My testing involved running TWXProxy connected to my local database, and an external program
In my case a C# TCPClient that connected to TWX on port 5758 and send the sector # and reads
the results in xml format from TWX.

This is code that I am deciding whether to submit to the SVN server so feed back is needed.

I am looking to add code that will also read the XML to update the database similar to
TWXSyncServer, but not through a server but POSSIBLY between 2 corpies that agree to allow
this.

Please excuse the size as I have a development environment and a few debugging tools add to the size.

In the attached file find TWXProxy.exe and a TWX.XML file that I exported from my database, to allow someone
an idea of how the data is formatted.


Attachments:
File comment: TWXProxy.exe and TWX.XML
TWXProxy.rar [986.42 KiB]
Downloaded 374 times

_________________
Find out just what any people will quietly submit to and you have the exact measure of the injustice and wrong which will be imposed on them. Frederick Douglas
Mon Dec 14, 2009 10:45 am
Profile ICQ
Lieutenant J.G.
User avatar

Joined: Sun Mar 13, 2005 3:00 am
Posts: 387
Location: USA
Unread post Re: New Stuff for TWXProxy Comments/Flames needed.
Hate to reply to my own post but I don't really want to open up another thread

This is about the TWX XML format that Attac and Swath have developed that TWX Proxy never got around to implementing.

Do we want to implement that... My feeble attempt to use parts of the XML spec shows me that it can be done w/o too much
trouble or hair loss but I just used what I wanted and made very little attempt to follow the XSD file. I am having problems finding
an example of using an XSD file to create the XML file. If that is even the correct way to use the XSD file.

My XML experience is limited I did a little work with XML in the KWrite program under KDE/Linux back in the stone age so I am finding that
I have to relearn.

I have strayed from the spec in my implementation by adding an attribute Index to the <Sector> element which corresponds to the sector number which after further review is represented by the field Nr in the original XSD.
The relevant parts of the XSD I used are the SectorData subelement and added some restrictions on the Fuel/Org/Equ triplets where the percentages can't be over 100 and less than 0 I think I have also set up another restriction on the Warp field where the value has to be between 1 and 20000.

My order of elements might not be the "correct" way but we can always fix that later.

Right now this is just to show that we can extend TWXProxy to allow other programs access to the database and in the future possibly having TWXSync like capabilities built in to TWXProxy.

But for now if anyone wants the changes they are under
https://svn.twxscripts.com:8443/svn/mai ... hes/MANIAC



My code has been added to the SVN and while I am not too proud of it; It does seem to work reasonably I am not sure if I have incorporated the Win 7 changes that Elder has committed but will try and merge my code with his and see.

_________________
Find out just what any people will quietly submit to and you have the exact measure of the injustice and wrong which will be imposed on them. Frederick Douglas


Mon Dec 14, 2009 8:09 pm
Profile ICQ
Veteran Op
User avatar

Joined: Thu Jun 02, 2005 2:00 am
Posts: 5558
Location: USA
Unread post Re: New Stuff for TWXProxy Comments/Flames needed.
It would be nice to have an XML query service for various database elements, and if my idea for authorized login/passwords ever works out then it could be added to the XML query so that people could download data from one-another.

The only thing to add to that would be a way of updating (but not overwriting) a person's database off queries.

It would also be nice to have a way of dumping the DB, so ppl could maybe import it into other DBs.

_________________
May the unholy fires of corbomite ignite deep within the depths of your soul...

1. TWGS server @ twgs.navhaz.com
2. The NavHaz Junction - Tradewars 2002 Scripts, Resources and Downloads
3. Open IRC chat @ irc.freenode.net:6667 #twchan
4. Parrothead wrote: Jesus wouldn't Subspace Crawl.

*** SG memorial donations via paypal to: dpocky68@booinc.com
Image


Mon Dec 14, 2009 8:40 pm
Profile ICQ WWW
Commander
User avatar

Joined: Tue Oct 07, 2003 2:00 am
Posts: 1134
Location: Augusta, GA
Unread post Re: New Stuff for TWXProxy Comments/Flames needed.
Making TWX capable of importing and exporting XML data, as in the TWX v2 spec (http://www.swath.net/?page=twx) would be great. It would also make it easier to add collaboration features.

I have another trunk update for tonight (hopefully), and several more to follow. But I'm working almost exclusively on script execution routines, so merging changes shouldn't be too bad.

_________________
Claim to Fame: only guy to ever crack the TW haggle algorithm, and fig/shield/hold price formula, twice.


Wed Dec 16, 2009 5:43 pm
Profile WWW
Veteran Op
User avatar

Joined: Thu Jun 02, 2005 2:00 am
Posts: 5558
Location: USA
Unread post Re: New Stuff for TWXProxy Comments/Flames needed.
When you get the svn commit up, let me/us know. I'd like to try it out.

_________________
May the unholy fires of corbomite ignite deep within the depths of your soul...

1. TWGS server @ twgs.navhaz.com
2. The NavHaz Junction - Tradewars 2002 Scripts, Resources and Downloads
3. Open IRC chat @ irc.freenode.net:6667 #twchan
4. Parrothead wrote: Jesus wouldn't Subspace Crawl.

*** SG memorial donations via paypal to: dpocky68@booinc.com
Image


Wed Dec 16, 2009 7:46 pm
Profile ICQ WWW
Display posts from previous:  Sort by  
Reply to topic   [ 5 posts ] 

Who is online

Users browsing this forum: No registered users and 13 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by wSTSoftware.