[PROGRAM]Orb: YSFlight Proxy Server Script

Note that alterations to the YSFlight .EXE is forbidden
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:

[PROGRAM]Orb: YSFlight Proxy Server Script

Post by Flake »

Image
Orb: YSFlight Proxy Server Script

NEWS: Orb is now being developed in C# See the later pages of the thread for more info!

Current Stable Version: Orb_0.3.2
Current Test Version: --/--/--


NOTICE: Due to security concerns with YSFHQ, Orb is now being released as closed source to the public. To gain access to the source code, Please PM me or join the Project on SourceForce. Thanks!
Features:
  • Admin:
    • Optional YSFlight Headquarters Authentication Module: Login with your YSFHQ Username.
      Groups Structure: Assign users to groups, promote and demote from the server directly.
      Ability to appear offline on a server.
      Server Security Locks
      Ban/Kick/Mute/Freeze Naughty Users
      Optional YSFHQ Login Mode - Connect with your YSFHQ username and password!
      Run Orb on a different PC to your server for extra speed! (Internal networks only!)
      Detailed Console Log of the Servers happenings.
      Private Messaging (@Username Message)
Planned Features:
  • Admin:
    • Kill Users
      Limit aircraft to certain users only
      Disable Weapons to certain users.
      CronTasks: Repeat a message every hour, a command every minute, etc. (DECREPTED)
      Frequently Change the weather/wind.
    Virtual Airline:
    • Have IFR Flight Plan Generation/Execution
      Have Virtual Traffic Controller.
      YSATC Radar support.
      Virtual Pilots Licences and Traffic Control Licenes.
    Military:
    • Have Artifical Wingmen, commandable via F12 chat messages. (already have made an offline processor for formation flights.)
      Spawn Aircraft/Grounds out of group funds, have creative "command and conquer" style battles. (not as hard to do as you'd think)
      K:D Ratio
    Economy:
    • Funds: make money from flying! VA's make money, Military makes money, crashes lose money, licences cost money.
Readme: Download

Download:
  • Stable Version: Orb_0.3.2
    Test Version: --/--/--
[right]Like Orb? Consider Donating a small ammount to help me pay the bills and keep development going! Image[/right]
Please Provide Your Bug Reports to me via private message/sourceforge! Each bug report will earn bonuses once said bonuses are coded!
Last edited by Flake on Sat Jun 30, 2012 3:58 am, edited 1 time in total.
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: [Development]Orb: YSFlight Proxy Server Script

Post by Flake »

Alrighty. After 7 hours straight work, I've made a very simple YSFlight Proxy Server for now.

Image

The server can do the following:

Have Multiple Clients at once (Via Threaded Coding) (Correct Approach.)
Back and Forth via a select structure in Python (Will change to threading later...) (Two threads now listen independtly to the client sockets, so they also work asynchronously.)
Reject Users based off their username and/or IP Address. (Can be intergrated with YSFHQ in future for "passwordless" log in. The player just visits YSFHQ from the comupter they wish to play from! :D) (Users a password login instead atm. IP Address login would be very nice though...)
Send and Receive Text Messages to players (Possible to have private messages via "With" statements catching the player names. (Done, working.)
Intercept, edit, and resend any packet type (currently only intercepts type 32) (now READS most data types, edits a few, forwards all)
From packet 32 (The YSFlight Text Packet) Commands are available:
Current commands are just testing only, but future commands could include generation of IFR Flight Plans, ATC, etc. (See devlog. should be available in 3.0)

This proxy server is the base end for a predominantly web based control system for ysflight servers. (This will probably be orb 2.0/3.0)
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
FrenchTOZT
CVW-171
CVW-171
Posts: 559
Joined: Tue Feb 08, 2011 3:47 am
Favorite Aircraft: F-65
Location: Live music capitol of the world.
Has thanked: 52 times
Been thanked: 14 times

Re: [Development]Orb: YSFlight Proxy Server Script

Post by FrenchTOZT »

That is actually really awesome, good job.
Image
Team Awesome# Whatever. ALPHA-5 OF THE TA-RANGERS Part of the f**king problem
User avatar
Midnight Rambler
Staff
Staff
Posts: 2136
Joined: Thu Feb 10, 2011 11:08 pm
Favorite Aircraft: F-16
Location: Australia
OS: Windows 11
Has thanked: 267 times
Been thanked: 374 times

Re: [Development]Orb: YSFlight Proxy Server Script

Post by Midnight Rambler »

Sweet! What sort of lag has been found and when is it stable to use on servers?
Image
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: [Development]Orb: YSFlight Proxy Server Script

Post by Flake »

With the select structure it's quite bad but (This is because it's only doing one things at a time.)with the threading it's not really noticable (theres more lag due to my cpu being overloaded with 5 million copies of ysf running then packet data) (asynchronous, much faster and independant.)

Thanks guys. I need to swap to threads between the send and receive next. (done, working.)

EDIT: Stuff is in the dropbox guys. Included is a weathergenerator.gmk, chatinterceptingclient and this server (i've only just started using classes, mmkay? :geek: ) (classes are used more in c#.)
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: [Development]Orb: YSFlight Proxy Server Script

Post by Flake »

Changed the relay to threading, and fixed some doubled socket bugs in that relay as well as the server and client socket timeouts.

The result is LAGLESS (I may as well be flying offline in a replay)

Proof:

Image

EDIT: Dropbox version updated. (./Flake/Proxy/)

Next step: Graceful socket close catching. :ugeek: (never managed to work that out.)
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: [Development]Orb: YSFlight Proxy Server Script

Post by Flake »

MORE WORK! :D

Image

I'm putting off graceful socket closing until the thread cleanup stage as I found it doesn't affect all the other threads anyway. (well, duh.)

I've made the foundations for a the user login database.

Of course, this has a massive permissions net behind it, but I'll need to code permissions changing later. (net will soon use a true/false override WITH the numbers as an underride.)

The framework for simple commands is dropped in and ready to run. such commands are Mute/Unmute, Ban/Unban, Freeze/Unfreeze (prevent join), Kick, Promote, Demote. (freeze can also stop a user midair for all other clients.)

I've also coded an easy to access and edit database structure as you can see, which is fairly consistent across the data types (they are group and user)

I've mashed everything into classes and methods, and it is very efficient.

eg: Group["YSRAAF"].Rank[0].RankName would return what you'd expect. That may not look hard, but it adds a lot of flexibility down on the coding level, as I can just change the value of an input string and get completely different values for completely different groups. (this is good, but if an object is NULL then shit is all fucked up...)

Also, within the classes are subfunctions that are specific to them, so I could type User["Flake"].Ban(); and a ban is applied to that username, or User["Flake"].Promote("YSRAAF") to go up a rank.

The latest version is in the dropbox. I've moved to folders now that the project is growing to be quite large (about 1000+ lines atm)

Next step: Link the database and the proxy server together. :ugeek:
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!
Honey Badger
57th Polyvalent Sq
57th Polyvalent Sq
Posts: 1841
Joined: Thu Jun 30, 2011 8:17 pm
Favorite Aircraft: Anything that gets off the ground
Has thanked: 227 times
Been thanked: 71 times

Re: [Development]Orb: YSFlight Proxy Server Script

Post by Honey Badger »

I would click thanks but it seems to have disappeared. Good work!
User avatar
Midnight Rambler
Staff
Staff
Posts: 2136
Joined: Thu Feb 10, 2011 11:08 pm
Favorite Aircraft: F-16
Location: Australia
OS: Windows 11
Has thanked: 267 times
Been thanked: 374 times

Re: [Development]Orb: YSFlight Proxy Server Script

Post by Midnight Rambler »

Can't wait to give this a go :)

Edit: Would it be possible to change weapon set ups while hosting a server through this system? Say I wanted to turn all weapons off without closing the server and changing the settings, would I just be able to flick a few buttons and have weapons off/on?
Image
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: [Development]Orb: YSFlight Proxy Server Script

Post by Flake »

Of course.

I just need ONE thing before I can start doing that, and that is all the data regarding a join request packet. (nothing exists yet) :|(requests aircraft, start position, loadout, iff. expects .dat data, abs position, velocity, loadout, id.)

In the join request, the client requests to spawn at the startposition, with aircraft, with all the loading info. I can set it to either reject requests with the weapons, or edit the requests to give NONE. There is also a server weapons enabled option but i'll need to double check that it can be sent at anytime. (can do, this is another packet type.)

I'll need to sniff packets to work that all out, though, so it may have to wait. (done)
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: [Development]Orb: YSFlight Proxy Server Script

Post by Flake »

LolsServer.

Image

The above is a driver test for per user settings and permissions module.

In other news, my keyboard is acting up. making it really hard/slow to code. :(
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!
Shutter

Re: [Development]Orb: YSFlight Proxy Server Script

Post by Shutter »

It still doesn't print bacon.
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: [Development]Orb: YSFlight Proxy Server Script

Post by Flake »

A small amount of work tonight as I have been riding all over the top half of the state looking for a new house, Quite sore. (i never got that house...)

I've coded permissions loading into the program now. Permissions can be applied to individual group ranks as well as individual users. The use a simple math system. If the permission ends up being "1" or higher, the user can perform said action. (still going to use this, but will have bool overrides as well.)

1 gives power, 0 has no effect, and -1 takes it away. (will still use.)

So for example, i can assign "cantalk" to all ranks as being 1, but to all users, i make it 0. 1+0 = 1, so the user can talk.
If i wanted to mute that user, i set there "can talk" to -1. 1-1 = 0, so the user can no longer talk. I hope this will make my life a lot easier in future.

Currently, the database side of the program dual loads and creates the user as it is loaded. (create, set defaults, load) so it finds the username, then assigns all the default variables, then overwrites them with whatever permissions are specified in the username file. This way, no variable is left undeclared.

I still need to have the reverse of this coded, that is, dump changed variables back to the file on the fly (I can't wait for server shutdown... what if it crashes? all the data is lost! D:) (user save functions for every variable change will work just fine.), and I also need to seperate the groups loading and permissions loading into seperate folders. I'm thinking for every "x.txt" to load user settings, there should be a "x" folder to go with it, with file names "0.txt" so on, so forth, until the ranks are all given permissions. This would keep things very organised, rather then have a huge group file which is hard to edit (precisely why i dislike bukkit) (Database/Users/<USER>/info.txt/permissions.txt, Database/Groups/<GROUP>/Info.txt/permissions.txt)
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!
Shutter

Re: [Development]Orb: YSFlight Proxy Server Script

Post by Shutter »

NOW we're talking bacon.
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: [Development]Orb: YSFlight Proxy Server Script

Post by Flake »

You guys are going to freaking love this next feature, courtesy of Eric-the freaking wizard-T. (cheers ET.)

He's established a polling service to check usernames and passwords against the YSFHQ database. Don't worry, as this can not possibly be sent to the ysflight server for everyone to see (as it is not even connected to the server yet!)(true story.)

this makes this program functionally safer then YSPS. :D (true story bro.)

the login process is simple. you join the server with your exact YSFHQ Username(The login packet only gives 15chr, need a username 15chr or less. I need to work around this.). after that, it asks you to provide a password. if those match with the YSFHQ database, THEN it will connect to the server on your behalf. pretty sweet huh? :)

Here's a pic of it in action:

Image

EDIT: Dropbox updated. try it for yourself! just run "Core.py" (database not linked (yet))

EDIT2: WHOOPPS turns out i cropped the server message out of the screenshot that went to the flying aircraft. NONE THE LESS, it got the message 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!
Shutter

Re: [Development]Orb: YSFlight Proxy Server Script

Post by Shutter »

Bacon achieved. Give yourself a pat on the back bro.
User avatar
Eric
Senior Veteran
Senior Veteran
Posts: 1547
Joined: Thu Feb 10, 2011 5:30 am
Favorite Aircraft: Super Hornet
Location: Chicago, Illinois
Has thanked: 61 times
Been thanked: 166 times
Contact:

Re: [Development]Orb: YSFlight Proxy Server Script

Post by Eric »

But it's not sending a hashed version of the password and the script is using GET requests instead of POST, so only limited bacon. :geek: (Will need to redo this with C#.)
Check this out (see python port to hash the password locally): http://www.openwall.com/phpass/

Send me a PM and I can show you how to hook everything up to make it more secure.
I make this website.
User avatar
Midnight Rambler
Staff
Staff
Posts: 2136
Joined: Thu Feb 10, 2011 11:08 pm
Favorite Aircraft: F-16
Location: Australia
OS: Windows 11
Has thanked: 267 times
Been thanked: 374 times

Re: [Development]Orb: YSFlight Proxy Server Script

Post by Midnight Rambler »

<3

I'm guessing it'll be possible to join without a HQ account as well...?
Image
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: [Development]Orb: YSFlight Proxy Server Script

Post by Flake »

Massive update. Organised the project into much easier to manage files and modules.(re-organised again. Final, I think.)

Sorted the permissions loading to load from the permissions folder. Undelcared permissions are treated as default. :) (classes now auto manage this.)

Database is fully compatible with the Core, and I just need to link them together. (done.)

After that is done, I'll just need to add some actual functions, then we can roll out beta. (done.)
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
Harm
Newbie
Newbie
Posts: 24
Joined: Wed Feb 22, 2012 2:09 am
Favorite Aircraft: F/A-18C
Location: Annapolis, MD
Been thanked: 1 time

Re: [Development]Orb: YSFlight Proxy Server Script

Post by Harm »

Makes me with I were back home on the flight rig. This is freakin great stuff. I had always hoped for password system back in the ysp days. Sure would have prevented a lot of the havoc wreaked 99% of the time by MRNAMELESSAWESOMEMAVERICK101... :lol:

Flake, you mentioned it being relatively "Lagless" in an earlier post. I'm assuming there's still some distance lag, right? Or are you really able to fly formation and have your partner in crime see you where you actually are? :o
Image
Midshipman, U.S. Navy ----------------Image-------------------Go Navy, Beat Army!
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests