Ørb# (Orb Sharp) Development Log

YSFlight addon development, questions, tutorials, & more!
User avatar
Flake
VFA-49
VFA-49
Posts: 4375
Joined: Thu Feb 10, 2011 8:47 pm
Favorite Aircraft: Boeing F/A-18A
Location: Australia
OS: Windows 10 (x64)
Has thanked: 861 times
Been thanked: 1279 times
Contact:

Re: [0.3.2]Orb: YSFlight Proxy Server Script

Post by Flake »

Been a while.

With the current project organisation, I was able to reorient myself with the project and pick back up to work on what I needed in less then 5 minutes. Organisation really pays off huh?

I've now got the permissions sub object linked with groups, ranks and users. It's all pretty well organised, which I am quite pleased with.

IF you look at the checklist, next is "permissions core" which tests permissions and decides if functions can be performed or not. I've already done a pseudo checklist for it so it seems to be in good order, i just need to change the pseudo code to c# working code, shouldn't take long.

The big problem I see is permissions core is very complex and a very big security feature. because of its complexity, I need to be sure that there are no security loopholes for server users... This will be checked in Orb C# Release Candidate.

After that, I need to do the packet sniffer which, with soji's help and previous packet sniffing experience with python orb, should be a cake walk.

IF I can keep up my current rate of progress, orb will be fully ported to c# in about a month.

Please forgive that the checklist is not updated to reflect the completion of permissions database object, no photoshop on this pc, will be corrected later.

SO in summary: Next is permissions core, then packet host then proxy service... then I roll out release candidate 1.0 for bug checking, and then we can use the first version of orb stably on servers.

EDIT: Had a look into Double.PositiveInfinity and Double.NegativeInfinity. This will help with permissions core flow, as -inf will be "NO" and negativeinf + positiveinf = NaN, which I can also just play off as "eh, i guess it must be NO then." as it should be, as that's the only REAL way a NaN can occur. accordingly: <1 = no, -inf = NO, NaN = NO, +inf + yes. This will work perfectly, as it will be a line by line test now rather then nested ifs, much safer and faster too.

The reason I'm doing this is to control power effectively. consider a banned user in the admin group. they have the power to do all admin functions, but if I set the banned group to have -inf (FALSE) for all permissions, that will override and they won't be able to do anything. IF an admin is stupid enough to assign themselves a bugged group, the server owner will physically need to edit the database to fix their stupidity, or another admin will need to fix it for them. This is the same sort of permissions system that fcraft for minecraft classic uses, and, in my experience, this is the best and safest/smartest way to do it.
I am an accountant working full-time (and some). I'm not here as often as I would like to be. Send a message if you need me. There are a few people in the community who can get in contact with me urgently if you need - don't be afraid to ask. I just don't check here as frequently as I used to. Sorry!
User avatar
Flake
VFA-49
VFA-49
Posts: 4375
Joined: Thu Feb 10, 2011 8:47 pm
Favorite Aircraft: Boeing F/A-18A
Location: Australia
OS: Windows 10 (x64)
Has thanked: 861 times
Been thanked: 1279 times
Contact:

Re: [0.3.2]Orb: YSFlight Proxy Server Script

Post by Flake »

Permissions core got a detailed test and all seems well.

That's enough for today, We're now ready to start the proxy side of the program!

Image
I am an accountant working full-time (and some). I'm not here as often as I would like to be. Send a message if you need me. There are a few people in the community who can get in contact with me urgently if you need - don't be afraid to ask. I just don't check here as frequently as I used to. Sorry!
User avatar
Flake
VFA-49
VFA-49
Posts: 4375
Joined: Thu Feb 10, 2011 8:47 pm
Favorite Aircraft: Boeing F/A-18A
Location: Australia
OS: Windows 10 (x64)
Has thanked: 861 times
Been thanked: 1279 times
Contact:

Re: [0.3.2]Orb: YSFlight Proxy Server Script

Post by Flake »

Prep work before starting the development of Packet Host today.

Cleaning up a lot of old code to use events which is much cleaner then variables with while loops suspending every 100 ms or so to test. I LOVE EVENTS!

As C# is the first language I've ever used that had them, i had to learn what the hell they are and i have to say, worth the investment.

made gui and console work more the way i want them too, and now I have an input structure for the gui to send commands to the main thread, and vica versa.

This will be mandatory in the testing stages.

EDIT: You know, i just realised that I'm flying blind when it comes to the packet organisation...

As it stands, I have the packet object (a byte array), and packet data objects (size, type, data). But i think I will add a packet type object for each type as vincentweb did for YSPS. with that I can do Type1Packet.Username or Type1Packet.ToPacket(); (would give me a byte array packet ready to send) or even Type1Packet.ToPacketData(); (size, type, data). The functions would be standard to all packet types, with specific values being properties to the packets. this will keep me on track! :D Something to rack my brain over as I get organised for the next stage of development.
I am an accountant working full-time (and some). I'm not here as often as I would like to be. Send a message if you need me. There are a few people in the community who can get in contact with me urgently if you need - don't be afraid to ask. I just don't check here as frequently as I used to. Sorry!
User avatar
wingzfan99
Core Staff
Core Staff
Posts: 692
Joined: Thu Feb 10, 2011 8:03 pm
Favorite Aircraft: Boeing 757-200
Location: Chicago, Illinois
Has thanked: 49 times
Been thanked: 55 times
Contact:

Re: [0.3.2]Orb: YSFlight Proxy Server Script

Post by wingzfan99 »

OfficerFlake wrote: As it stands, I have the packet object (a byte array), and packet data objects (size, type, data). But i think I will add a packet type object for each type as vincentweb did for YSPS. with that I can do Type1Packet.Username or Type1Packet.ToPacket(); (would give me a byte array packet ready to send) or even Type1Packet.ToPacketData(); (size, type, data). The functions would be standard to all packet types, with specific values being properties to the packets. this will keep me on track! :D Something to rack my brain over as I get organised for the next stage of development.
Consider using inherited classes or interfaces for this. It really keeps the code clean and makes it way easier to add more features later on.
Wingzfan "The Budgetman" 99
Treasurer, YSFHQ

Founder and Admin of the site once known as YSUpload
User avatar
Flake
VFA-49
VFA-49
Posts: 4375
Joined: Thu Feb 10, 2011 8:47 pm
Favorite Aircraft: Boeing F/A-18A
Location: Australia
OS: Windows 10 (x64)
Has thanked: 861 times
Been thanked: 1279 times
Contact:

Re: [0.3.2]Orb: YSFlight Proxy Server Script

Post by Flake »

Heh I don't even know how to interface...

They'll all be sharing a common class though for the conversion functions (- specialised types, as each packet generation will obviously be unique to the type)
I am an accountant working full-time (and some). I'm not here as often as I would like to be. Send a message if you need me. There are a few people in the community who can get in contact with me urgently if you need - don't be afraid to ask. I just don't check here as frequently as I used to. Sorry!
User avatar
Flake
VFA-49
VFA-49
Posts: 4375
Joined: Thu Feb 10, 2011 8:47 pm
Favorite Aircraft: Boeing F/A-18A
Location: Australia
OS: Windows 10 (x64)
Has thanked: 861 times
Been thanked: 1279 times
Contact:

Re: [0.3.2]Orb: YSFlight Proxy Server Script

Post by Flake »

Learned to use inheritable classes today, though I haven't got a use for it yet.

Reworked the netcode class structure.

Before, it went like this:
  • Start listening for clients
  • Get a new client
  • Create a new client object for it and listen again.
and the new client...
  • do login stuff and etc.
  • Create the host object (controls data sent and received from host.
  • tell host to start sending/receiving
  • start sending receiving itself.
Problem is the structure in which things are created... not very organised.

I changed it today to go:
  • Start listening for clients
  • get a new client
  • create a container object for the client.
  • create a client object for that connection
  • create a host object for that connection
  • initialise both the client and host
  • start both the client and host talking to each other.
tit fixes a lot of birdnesting and ambiguitities too.

Now, I can just have a Orb.Server.NetObject.Client.ProcessPacket(Packet ThisPacket) rather then something like Network.Packets.Processpacket(Socket InSocket, Socket Outsocket, Packet ThisPacket) etc. etc.

It keeps things more organised and it's a lot easier to imagine the structure each object takes.

Having an issue at current in regards to clients not closing cleanly. I need to look further into my receive and subsequent close functions to be sure this is all okay.

First step of packet processing is working tops though. Using a Switch/Case structure to handle each packet type, and in turn, separate functions to handle the conversion of raw packets to specialised packets with easily extractable data. It makes the processpacket.cs code a lot cleaner and easier to manage.

Tomorrow or later, I'll look at the close function for the clients, and get that sorted out, and I'll look at the other packets in the order that come to YSF. I'm aiming to create my own server, by testing packet by packet rather then rely on proxy.

I want to share my dropbox in a read only format... I need to figure that out too.
I am an accountant working full-time (and some). I'm not here as often as I would like to be. Send a message if you need me. There are a few people in the community who can get in contact with me urgently if you need - don't be afraid to ask. I just don't check here as frequently as I used to. Sorry!
User avatar
Flake
VFA-49
VFA-49
Posts: 4375
Joined: Thu Feb 10, 2011 8:47 pm
Favorite Aircraft: Boeing F/A-18A
Location: Australia
OS: Windows 10 (x64)
Has thanked: 861 times
Been thanked: 1279 times
Contact:

Re: [0.3.2]Orb: YSFlight Proxy Server Script

Post by Flake »

Seems dropbox ain't gunna happen with this, support non existant yet for read only and I'm not going to just royally fuck myself by sharing the code and having it able to be overwritten or deleted.

I may consider taking the time to learn subversion and share that way, but looks like you'll need to get updated source by request only.

I am of course, happy to share this project with anyone (but please don't go and make runaway projects with it, I've poured a lot of hard work into this!) You will need Visual Studio or an appropriate development environment (I acquired VS legally of course, it only cost me a thousand bucks but totally worth it for a small project.)

Here's the source: Download! or if that don't work, try this one: Alternate Download
I am an accountant working full-time (and some). I'm not here as often as I would like to be. Send a message if you need me. There are a few people in the community who can get in contact with me urgently if you need - don't be afraid to ask. I just don't check here as frequently as I used to. Sorry!
User avatar
Flake
VFA-49
VFA-49
Posts: 4375
Joined: Thu Feb 10, 2011 8:47 pm
Favorite Aircraft: Boeing F/A-18A
Location: Australia
OS: Windows 10 (x64)
Has thanked: 861 times
Been thanked: 1279 times
Contact:

Re: [0.3.2]Orb: YSFlight Proxy Server Script

Post by Flake »

I was intending to get the packet handler to also learn the packet types as I built it, meaning I could port to server only mode as soon as it's got data on all packets, but I will wait until 2.0 for that... That means I just need to copy across what I have for python orb and the next step will be done.

After that, it's the same old: basic admin commands like mute, kick, ban, and basic user info tracking, then we'll start on release candidate and look for errors.

EDIT: Orb will also get a name change to "Orb #" (Orb Sharp). Call it orb of course for simplicity. I think Release candidate will be ready in a months time or less at this rate. The majorty of structural development is now out of the way.
I am an accountant working full-time (and some). I'm not here as often as I would like to be. Send a message if you need me. There are a few people in the community who can get in contact with me urgently if you need - don't be afraid to ask. I just don't check here as frequently as I used to. Sorry!
User avatar
Flake
VFA-49
VFA-49
Posts: 4375
Joined: Thu Feb 10, 2011 8:47 pm
Favorite Aircraft: Boeing F/A-18A
Location: Australia
OS: Windows 10 (x64)
Has thanked: 861 times
Been thanked: 1279 times
Contact:

Re: [0.3.2]Orb: YSFlight Proxy Server Script

Post by Flake »

Fixed those socket disconnect errors...

I was looking for packets that have a size of "0" to be a signal to check if a socket is closed. Matter of fact, new packet object will never return anything less then 4 (the size of a type byte array).

Changed that to type 0 instead (never used). it helped but was still getting errors. Changed my final check to close a socket to be if x || y is closed, rather then &&. The ysflight sockets don't close at the same time, as this is working in proxy mode. only one end will close, I have to close the other. Seems quite reliable now, and always disconnects even if I force close YSF or exit gracefully. :D

Onto packet sniffing for the evening :)
I am an accountant working full-time (and some). I'm not here as often as I would like to be. Send a message if you need me. There are a few people in the community who can get in contact with me urgently if you need - don't be afraid to ask. I just don't check here as frequently as I used to. Sorry!
User avatar
Flake
VFA-49
VFA-49
Posts: 4375
Joined: Thu Feb 10, 2011 8:47 pm
Favorite Aircraft: Boeing F/A-18A
Location: Australia
OS: Windows 10 (x64)
Has thanked: 861 times
Been thanked: 1279 times
Contact:

Re: [0.3.2]Orb: YSFlight Proxy Server Script

Post by Flake »

Good progress so far today.

Tackling packet types one by one in the log in process.

Also, just learned the wonder of extension methods, so doing away with Network.Packet.PacketToBytes(ThisPacket) and instead doing ThisPacket.Serialise() and other much easier things, makes the code easier to look at.

Using a common packet for basic packet ops now for all specialised types such as size.
I am an accountant working full-time (and some). I'm not here as often as I would like to be. Send a message if you need me. There are a few people in the community who can get in contact with me urgently if you need - don't be afraid to ask. I just don't check here as frequently as I used to. Sorry!
User avatar
Flake
VFA-49
VFA-49
Posts: 4375
Joined: Thu Feb 10, 2011 8:47 pm
Favorite Aircraft: Boeing F/A-18A
Location: Australia
OS: Windows 10 (x64)
Has thanked: 861 times
Been thanked: 1279 times
Contact:

Re: [0.3.2]Orb: YSFlight Proxy Server Script

Post by Flake »

Image

Here's how thing are at current. I'm just reading and sorting packets from the client at this stage. The packet above is an aircraft list packet. :D

After that aircraft list packet, it's final login packet and ground objects, and then I have the client side of the login mapped.
I am an accountant working full-time (and some). I'm not here as often as I would like to be. Send a message if you need me. There are a few people in the community who can get in contact with me urgently if you need - don't be afraid to ask. I just don't check here as frequently as I used to. Sorry!
User avatar
Flake
VFA-49
VFA-49
Posts: 4375
Joined: Thu Feb 10, 2011 8:47 pm
Favorite Aircraft: Boeing F/A-18A
Location: Australia
OS: Windows 10 (x64)
Has thanked: 861 times
Been thanked: 1279 times
Contact:

Re: [0.3.2]Orb: YSFlight Proxy Server Script

Post by Flake »

Interpretting all of the client logon process, and the subsequent keeping alive of the client.

Now working on interpreting chat messages from the client.
I am an accountant working full-time (and some). I'm not here as often as I would like to be. Send a message if you need me. There are a few people in the community who can get in contact with me urgently if you need - don't be afraid to ask. I just don't check here as frequently as I used to. Sorry!
User avatar
Flake
VFA-49
VFA-49
Posts: 4375
Joined: Thu Feb 10, 2011 8:47 pm
Favorite Aircraft: Boeing F/A-18A
Location: Australia
OS: Windows 10 (x64)
Has thanked: 861 times
Been thanked: 1279 times
Contact:

Re: [0.3.2]Orb: YSFlight Proxy Server Script

Post by Flake »

42south got a very special visitor this afternoon:

Image

The sevvice held up perfectly well, despite my computer lagging like it was on fire from the ammount of YSF's I had open.

The very first test of Packet editing is taking place with Type32 (chat) now being edited into the signature "orb" message format. :D
I am an accountant working full-time (and some). I'm not here as often as I would like to be. Send a message if you need me. There are a few people in the community who can get in contact with me urgently if you need - don't be afraid to ask. I just don't check here as frequently as I used to. Sorry!
User avatar
Flake
VFA-49
VFA-49
Posts: 4375
Joined: Thu Feb 10, 2011 8:47 pm
Favorite Aircraft: Boeing F/A-18A
Location: Australia
OS: Windows 10 (x64)
Has thanked: 861 times
Been thanked: 1279 times
Contact:

Re: [0.3.2]Orb: YSFlight Proxy Server Script

Post by Flake »

Here's the first test version: It has no database functions included. It just server as a gateway between you and the YSF server, and changes your chat messages. It's designed to confirm the stability of the program. Give it a go, no installation required. Just double click Orb.Exe and fire away. :)

Image
I am an accountant working full-time (and some). I'm not here as often as I would like to be. Send a message if you need me. There are a few people in the community who can get in contact with me urgently if you need - don't be afraid to ask. I just don't check here as frequently as I used to. Sorry!
User avatar
Ray
Contributor
Contributor
Posts: 100
Joined: Mon Aug 27, 2012 6:47 pm
Favorite Aircraft: F22 Raptor
Location: United Kingdom
Been thanked: 1 time

Re: [0.3.2]Orb: YSFlight Proxy Server Script

Post by Ray »

Just been watching the orb video, looks like a pretty amazing project.

Keep up the good work Flake!

I'll add Orb to the next newsletter
YSFHQ Web Team
User avatar
Flake
VFA-49
VFA-49
Posts: 4375
Joined: Thu Feb 10, 2011 8:47 pm
Favorite Aircraft: Boeing F/A-18A
Location: Australia
OS: Windows 10 (x64)
Has thanked: 861 times
Been thanked: 1279 times
Contact:

Re: Ø# (Orb Sharp) Development Log

Post by Flake »

Seems no-one had issues with the latest Orb Test for 42South Server. Which is awesome, because it proves the program stability. This is great news.

As you might have heard, my computer fragged itself recently, so I just finished re-installing windows, and now am getting my development environment back up again.

Dropbox has done it's job, again and again and again. Orb code files have been restored from the online backup. Visual Studio Ultimate is being installed right now, ready to pick back up work.

The next week will now consist of getting windows, itunes, ysflight, teamspeak, VAC all ready for VNAF Airfest in a fortnights time.

After that, it's back to work on the project. :D
I am an accountant working full-time (and some). I'm not here as often as I would like to be. Send a message if you need me. There are a few people in the community who can get in contact with me urgently if you need - don't be afraid to ask. I just don't check here as frequently as I used to. Sorry!
User avatar
Flake
VFA-49
VFA-49
Posts: 4375
Joined: Thu Feb 10, 2011 8:47 pm
Favorite Aircraft: Boeing F/A-18A
Location: Australia
OS: Windows 10 (x64)
Has thanked: 861 times
Been thanked: 1279 times
Contact:

Re: Ørb# (Orb Sharp) Development Log

Post by Flake »

Already back to work.

As an aside: Today I've purchased a new helmet, visors, gloves, boots, and track racing leathers for my motorcycling... Take a guess what I'll be getting up to soon. ;)

More packets being identified. Type 7 is actually smoke color. I thought it was acknowledge option... derrrr. It makes so much sense now. That's being implemented. Skipping over the type 11 at current (flight data) I'll build that one last. About to start work on type 8 (join request).

I also learned a little something: the server can force and aircraft do unjoin by sending a remove aircraft packet. That's pretty cool, as now I can make things more direct in regards to kick user, force damage etc. etc.
I am an accountant working full-time (and some). I'm not here as often as I would like to be. Send a message if you need me. There are a few people in the community who can get in contact with me urgently if you need - don't be afraid to ask. I just don't check here as frequently as I used to. Sorry!
User avatar
wingzfan99
Core Staff
Core Staff
Posts: 692
Joined: Thu Feb 10, 2011 8:03 pm
Favorite Aircraft: Boeing 757-200
Location: Chicago, Illinois
Has thanked: 49 times
Been thanked: 55 times
Contact:

Re: Ørb# (Orb Sharp) Development Log

Post by wingzfan99 »

Reading through this, it's really cool to see how the puzzle of the packet types is coming together.
Wingzfan "The Budgetman" 99
Treasurer, YSFHQ

Founder and Admin of the site once known as YSUpload
User avatar
Flake
VFA-49
VFA-49
Posts: 4375
Joined: Thu Feb 10, 2011 8:47 pm
Favorite Aircraft: Boeing F/A-18A
Location: Australia
OS: Windows 10 (x64)
Has thanked: 861 times
Been thanked: 1279 times
Contact:

Re: Ørb# (Orb Sharp) Development Log

Post by Flake »

Some noob things they're real hardcore and is attacking YSFlight servers with modified versions of my source code.

Such a fucking shame, I thought I could trust people with this. No new public releases will be released, only private to those whom join a group I will set up later.

To whomever is the mad cunt, grow up dickhead, you're ruining a good thing for everyone. :roll:
I am an accountant working full-time (and some). I'm not here as often as I would like to be. Send a message if you need me. There are a few people in the community who can get in contact with me urgently if you need - don't be afraid to ask. I just don't check here as frequently as I used to. Sorry!
User avatar
Varren
Banned
Banned
Posts: 453
Joined: Wed Mar 06, 2013 6:31 pm
Favorite Aircraft: Anything with wings.
Has thanked: 19 times
Been thanked: 45 times

Re: Ørb# (Orb Sharp) Development Log

Post by Varren »

OfficerFlake wrote:To whomever is the mad cunt, grow up dickhead, you're ruining a good thing for everyone. :roll:
Confirmed for Fanjet.
Image
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 14 guests