Sign up Calendar Latest Topics
 
 
 


Reply
  Author   Comment  
russjudge

Avatar / Picture

Registered:
Posts: 234
Reply with quote  #1 
Well, I've finally gotten my C# library API based on the Artemis Protocol documentation completed--or at least reasonably functional.

On this initial release, the intent is to offer a simple mechanism for storing Artemis Packets to a SQL database where it would be much easier to perform various queries to make a thorough analysis for reverse engineering the protocol.  

I have tested it and it does work pretty well, but it's kind of like flying the Millennium Falcon--something's always broken.  I think random packets are getting dropped, so I'll have to work to fix that next.  Sometimes the client gives out-of-date readings, sometimes the server doesn't respond.

The API does currently seem to work pretty well for custom clients--my Big Red Button of Death currently uses it--basically if the client doesn't depend on accurate readings, it'll probably mostly work.

All code is uploaded to this Open Source Project.  To use the API, simply download the code. 

To use the Proxy Server for logging to a database, run the project "Proxy.UI.SQLLogger".  By default, it will log the packets to an included Compact SQL database, but it'll be more useful to log to a full SQL database, so I provided SQL Code (here) to create a useful database--you'll need to do a few small tweaks to it (database file location will need changed).  Once you have created that database, you can change the ConnectionString to your new database when you run the Proxy.UI.SQLLogger project.


The code was written without looking at any of the java version ArtClientLib, so it is likely very different in most of its functionality (though the basic TCP/IP communication will likely be similar, since there's only so many ways to perform the communication).

Though the design of the API follows the Artemis Protocol Documentation, I took a few small liberties.  For example, all packets that are subpackets of the GameMessagePacket, ObjectStatusUpdatePacket, and ShipActionPackets are all suffixed with "SubPacket", instead of "Packet" to differentiate it from a normal packet.  A few of the packets have a different name from the documentation--that will probably change.  I had named them as I had thought there purpose was, but since then I have found to be wrong, and haven't changed the packets, yet (at least not until further analysis is completed).

My design is highly modular.  Basically, you can implement the full functionality of the proxy server and only replace the UI with whatever your heart desires--you can use the project Proxy.UI.SQLLogger as a template for implementing your own variation (such as a proxy server that takes other action based on received data--or even intercepts and changes the packet data).  You can also easily implement a custom client, simply by including the dll from the ArtemisComm project and making use of the PacketProcessing class--I am more than happy to assist you if needed, I just haven't written any documentation on its use yet.

The design is essentially meant to include only the components needed.

At this point  I'm going to be working to assist in the reverse engineering of the protocol--fixing the current instability with my C# API will be secondary.


If you wish to use the Proxy server without dealing with the source code, you can obtain the compiled libraries and executable here.


__________________
Russ
https://russjudge.com
Author of:
Artemis Manager
Artemis Mod Loader.
The Big Red Button of Death!
ArtemisSBS-Protocol Sharp
DMX Commander
(and all are free)

Visit my Patreon page and buy me coffee.
russjudge

Avatar / Picture

Registered:
Posts: 234
Reply with quote  #2 
By the way--once I fix the instability of this proxy server, there are tons of applications for it.

But there are a few specific questions I am going to try to get answered:

1. Does every client get an identical copy of every packet the server sends out?

If this is true, then one benefit of the proxy server is that it can hold one connection to the server while any number of clients connect to it.  The server would send one packet, while the proxy server does the work of making copies of that packet for each client, thus taking workload off of the server and (hopefully) improving performance.  If you think about it, without the proxy server, if eight ships are connected, each with six stations, you have 48 clients connected to the server--quite a load.  But if you have one proxy server for each ship, then the server only has eight clients to deal with.  Adding routers to control the level of traffic over the network would help even more.

2. How are different player ships handled in the protocol in PvP games?

__________________
Russ
https://russjudge.com
Author of:
Artemis Manager
Artemis Mod Loader.
The Big Red Button of Death!
ArtemisSBS-Protocol Sharp
DMX Commander
(and all are free)

Visit my Patreon page and buy me coffee.
anwoke8204

Registered:
Posts: 234
Reply with quote  #3 
nice, for the SQL, its it MySQL, SQLite or MSSQL, or does it matter?
russjudge

Avatar / Picture

Registered:
Posts: 234
Reply with quote  #4 
It is specific for MS SQL Server (specifically SQL Server Express), so there may be some issues with creating the database, but the table creation statements should still work.  If there are any issues, simply manually create the database--then run the remaining SQL statements against that database--it should all work.
__________________
Russ
https://russjudge.com
Author of:
Artemis Manager
Artemis Mod Loader.
The Big Red Button of Death!
ArtemisSBS-Protocol Sharp
DMX Commander
(and all are free)

Visit my Patreon page and buy me coffee.
anwoke8204

Registered:
Posts: 234
Reply with quote  #5 
ive never used MS SQL, but from what your saying, if I manually create the database, then the table creation statements should still work for mySQL, correct?  if not how hard would it be to convert it over to mysql?
russjudge

Avatar / Picture

Registered:
Posts: 234
Reply with quote  #6 
mySQL and MS SQL both use standard SQL, so yes, the table creation statements should work without modification.  If mySQL gives an error, it would probably be on the index creation statements, so you could just tweak those to fix any error that mySQL gives.  I don't really know much about mySQL--haven't messed with it in years--so I don't know what might need changed to get the SQL code to work on mySQL.

Or, you can install SQL Server Express for free and run the SQL without modification, other than the lines that specify the database file location.

In either case, you will need to use the correct connection string, AND there is the possibility that the code as written for logging to the database might only work with SQL Server--I used the code I'm familiar with and have never tried it against any database other than SQL Server, so I don't really know if it will work with mySQL, now that I think about it.

The final choice is to use the included SQL Compact edition database--the connectionstring defaults to that database.  The trick you would have there is that you would have to write an interface to it to query the data that gets logged to it.  I didn't finish this out because in a simple test I did using the SQL Server Express database, a LOT of data got stored--over 100,000 rows of data in the Values table--and the game only lasted a few minutes.  I'm not sure the SQL Compact database would be able to handle the amount of data that will need logged to it.

Using SQL Server Express is pretty easy, particularly if you've messed around with SQL before.  Switching from mySQL to SQL Server isn't hard--I've done a little bit with an older version of mySQL on another OS and found it a bit harder to use simply because I had to do everything from the commandline.  The real difference comes with dealing with the administration of the databases--which for this project you won't need to worry with.





__________________
Russ
https://russjudge.com
Author of:
Artemis Manager
Artemis Mod Loader.
The Big Red Button of Death!
ArtemisSBS-Protocol Sharp
DMX Commander
(and all are free)

Visit my Patreon page and buy me coffee.
anwoke8204

Registered:
Posts: 234
Reply with quote  #7 
can sql server express run on linux on a system that doesn't have a gui, its all web based or command line
russjudge

Avatar / Picture

Registered:
Posts: 234
Reply with quote  #8 
You can't install SQL Server Express on Linux, but you have to run my proxy server on Windows, anyhow--you could install both SQL Server Express and my proxy server on the same Windows computer.
__________________
Russ
https://russjudge.com
Author of:
Artemis Manager
Artemis Mod Loader.
The Big Red Button of Death!
ArtemisSBS-Protocol Sharp
DMX Commander
(and all are free)

Visit my Patreon page and buy me coffee.
anwoke8204

Registered:
Posts: 234
Reply with quote  #9 
so the proxy server has to be on a windows machine?  we can't have the database be on a linux machine using mysql?
russjudge

Avatar / Picture

Registered:
Posts: 234
Reply with quote  #10 
The proxy server is written in C#, so you might compile to Linux using the mono project.  A database other than SQL Server might work, but I suspect that the database code I used is specific to SQL Server. 

All source code is available in that open-source project, and the code that updates to the database is pretty straight-forward.  It probably wouldn't take much tweaks to get it to work for a different database.

The code will handle the database being anywhere--it's just a matter of setting the connectionstring correctly.

__________________
Russ
https://russjudge.com
Author of:
Artemis Manager
Artemis Mod Loader.
The Big Red Button of Death!
ArtemisSBS-Protocol Sharp
DMX Commander
(and all are free)

Visit my Patreon page and buy me coffee.
anwoke8204

Registered:
Posts: 234
Reply with quote  #11 
hrm, I wonder if I could get the code to run from a mysql database on a linux server (as our server we use for conventions for dhcp, knowledgebase for all our mission information, etc, is running off linux) but we could still run the program itself on the game masters computer or something like that.  do we just enter where the database is when we run the script?

russjudge

Avatar / Picture

Registered:
Posts: 234
Reply with quote  #12 
Sure--the database can be on a separate server--there's no reason that won't work.  Database location is specified in the connectionstring.  I do that all the time in my line of work--just never bothered with doing it with this application.  The only thing I warn is that my code uses .NET functions that I believe are specific to SQL Server, so might not work for anything but SQL Server (or SQL Server Express).  BUT, if you don't mind diving into C#, the database code itself is pretty straight-forward--just a few SQL insert statements--so someone could change the code if needed pretty easily.
__________________
Russ
https://russjudge.com
Author of:
Artemis Manager
Artemis Mod Loader.
The Big Red Button of Death!
ArtemisSBS-Protocol Sharp
DMX Commander
(and all are free)

Visit my Patreon page and buy me coffee.
anwoke8204

Registered:
Posts: 234
Reply with quote  #13 
Quote:
Originally Posted by russjudge
Sure--the database can be on a separate server--there's no reason that won't work.  Database location is specified in the connectionstring.  I do that all the time in my line of work--just never bothered with doing it with this application.  The only thing I warn is that my code uses .NET functions that I believe are specific to SQL Server, so might not work for anything but SQL Server (or SQL Server Express).  BUT, if you don't mind diving into C#, the database code itself is pretty straight-forward--just a few SQL insert statements--so someone could change the code if needed pretty easily.


I would like to, but I don't know C#, I tried to import the .sql file into mysql but it failed.  I don't know much about programming, and for sql administration for mysql i use phpmyadmin (I am learning the console based commands as well).  so for now will look into sql server express, but would prefer to use mysql later and just have one sql server on our network at conventions instead of 2
russjudge

Avatar / Picture

Registered:
Posts: 234
Reply with quote  #14 
Hmmm..  I didn't set up any queries that would benefit you--my intent was that the database was to be used only by those who could build their own queries, since the data that someone needed would likely be unique to each case.  The the tables are not complex, the will require a rudimentary knowledge of how to join the tables together for your query.

If you are just wanting to use the proxy server portion of the code--you don't need to worry with a database at all.  It will work out-of-the-box without a database.

My latest series of tests on the code--dealing with the instability I noted--showed that the issue might be more network related than an issue with my program.  I have a few ideas that I might try to figure out trying, but I ran a test where client and server ran through this proxy server all on the same machine, and I set the network speed in the Artemis server parameters to its highest setting (500ms).  When I did that, the game ran without a single hitch.  I ran a second game without restarting anything and the instability did surface momentarily, but went away.

When that instability surfaced like crazy, I was running the server on my laptop, connected by WiFi, which has been noted to sometimes give Artemis issues.  I had never encountered the issues, but it is possible that connecting through the proxy simply exaggerated the problem to where I noticed it.

__________________
Russ
https://russjudge.com
Author of:
Artemis Manager
Artemis Mod Loader.
The Big Red Button of Death!
ArtemisSBS-Protocol Sharp
DMX Commander
(and all are free)

Visit my Patreon page and buy me coffee.
Previous Topic | Next Topic
Print
Reply

Quick Navigation:

Easily create a Forum Website with Website Toolbox.