[0.3.2]Orb: YSFlight Proxy Server Script

Discuss released YSFlight programs (3rd-party applications), for example -- Orb and YSPS.

Moderators: YSUpload Admins, YSUpload TOS Moderators

[0.3.2]Orb: YSFlight Proxy Server Script

Postby OfficerFlake » Sun Mar 11, 2012 3:24 am

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: --/--/--

Like Orb? Consider Donating a small ammount to help me pay the bills and keep development going! Image


10[/hr]

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 OfficerFlake on Fri Jun 29, 2012 11:58 pm, edited 1 time in total.
Image
YSFlight Phillip Island International Airshow Host
User avatar
OfficerFlake
Marquez Fanboy
Marquez Fanboy
Senior Veteran
Senior Veteran
 
Posts: 2125
Joined: Thu Feb 10, 2011 4:47 pm
Location: YCNK
Has thanked: 224 times
Been thanked: 273 times
National Flag:
Australia
Favorite Aircraft: Boeing F/A-18A Hornet

Re: [Development]Orb: YSFlight Proxy Server Script

Postby OfficerFlake » Sun Mar 11, 2012 3:52 am

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)
Image
YSFlight Phillip Island International Airshow Host
User avatar
OfficerFlake
Marquez Fanboy
Marquez Fanboy
Senior Veteran
Senior Veteran
 
Posts: 2125
Joined: Thu Feb 10, 2011 4:47 pm
Location: YCNK
Has thanked: 224 times
Been thanked: 273 times
National Flag:
Australia
Favorite Aircraft: Boeing F/A-18A Hornet

Re: [Development]Orb: YSFlight Proxy Server Script

Postby FrenchTOZT » Sun Mar 11, 2012 3:53 am

That is actually really awesome, good job.
Image
Team Awesome# Whatever. ALPHA-5 OF THE TA-RANGERS Part of the f**king problem
The fine hat connoisseur of the YSHQ community. Image
User avatar
FrenchTOZT
Team Awesome
Team Awesome
Veteran
Veteran
 
Posts: 556
Joined: Mon Feb 07, 2011 11:47 pm
Location: Live music capitol of the world.
Has thanked: 65 times
Been thanked: 19 times
National Flag:
Norway
Favorite Aircraft: F-65

Re: [Development]Orb: YSFlight Proxy Server Script

Postby Midnight Rambler » Sun Mar 11, 2012 3:54 am

Sweet! What sort of lag has been found and when is it stable to use on servers?
RED TA-RANGER - POWER NUMBER 68
Owner and administrator of the 42South Server
Had an issue on the server? Want to add a new pack? Send me a PM or post it today!

Image
User avatar
Midnight Rambler
Senior Veteran
Senior Veteran
 
Posts: 1650
Joined: Thu Feb 10, 2011 7:08 pm
Location: Australia
Has thanked: 265 times
Been thanked: 358 times
National Flag:
Australia
Favorite Aircraft: F-16

Re: [Development]Orb: YSFlight Proxy Server Script

Postby OfficerFlake » Sun Mar 11, 2012 3:55 am

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#.)
Image
YSFlight Phillip Island International Airshow Host
User avatar
OfficerFlake
Marquez Fanboy
Marquez Fanboy
Senior Veteran
Senior Veteran
 
Posts: 2125
Joined: Thu Feb 10, 2011 4:47 pm
Location: YCNK
Has thanked: 224 times
Been thanked: 273 times
National Flag:
Australia
Favorite Aircraft: Boeing F/A-18A Hornet

Re: [Development]Orb: YSFlight Proxy Server Script

Postby OfficerFlake » Sun Mar 11, 2012 3:55 am

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.)
Image
YSFlight Phillip Island International Airshow Host
User avatar
OfficerFlake
Marquez Fanboy
Marquez Fanboy
Senior Veteran
Senior Veteran
 
Posts: 2125
Joined: Thu Feb 10, 2011 4:47 pm
Location: YCNK
Has thanked: 224 times
Been thanked: 273 times
National Flag:
Australia
Favorite Aircraft: Boeing F/A-18A Hornet

Re: [Development]Orb: YSFlight Proxy Server Script

Postby OfficerFlake » Sun Mar 11, 2012 3:56 am

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:
Image
YSFlight Phillip Island International Airshow Host
User avatar
OfficerFlake
Marquez Fanboy
Marquez Fanboy
Senior Veteran
Senior Veteran
 
Posts: 2125
Joined: Thu Feb 10, 2011 4:47 pm
Location: YCNK
Has thanked: 224 times
Been thanked: 273 times
National Flag:
Australia
Favorite Aircraft: Boeing F/A-18A Hornet

Re: [Development]Orb: YSFlight Proxy Server Script

Postby Honey Badger » Sun Mar 11, 2012 3:56 am

I would click thanks but it seems to have disappeared. Good work!
Image
User avatar
Honey Badger
57th Polyvalent Sq
57th Polyvalent Sq
Senior Veteran
Senior Veteran
 
Posts: 1854
Joined: Thu Jun 30, 2011 4:17 pm
Location: Alagaësia
Has thanked: 267 times
Been thanked: 82 times
National Flag:
United States of America
Favorite Aircraft: F-22

Re: [Development]Orb: YSFlight Proxy Server Script

Postby Midnight Rambler » Sun Mar 11, 2012 3:57 am

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?
RED TA-RANGER - POWER NUMBER 68
Owner and administrator of the 42South Server
Had an issue on the server? Want to add a new pack? Send me a PM or post it today!

Image
User avatar
Midnight Rambler
Senior Veteran
Senior Veteran
 
Posts: 1650
Joined: Thu Feb 10, 2011 7:08 pm
Location: Australia
Has thanked: 265 times
Been thanked: 358 times
National Flag:
Australia
Favorite Aircraft: F-16

Re: [Development]Orb: YSFlight Proxy Server Script

Postby OfficerFlake » Sun Mar 11, 2012 3:58 am

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)
Image
YSFlight Phillip Island International Airshow Host
User avatar
OfficerFlake
Marquez Fanboy
Marquez Fanboy
Senior Veteran
Senior Veteran
 
Posts: 2125
Joined: Thu Feb 10, 2011 4:47 pm
Location: YCNK
Has thanked: 224 times
Been thanked: 273 times
National Flag:
Australia
Favorite Aircraft: Boeing F/A-18A Hornet

Re: [Development]Orb: YSFlight Proxy Server Script

Postby OfficerFlake » Sun Mar 11, 2012 3:58 am

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. :(
Image
YSFlight Phillip Island International Airshow Host
User avatar
OfficerFlake
Marquez Fanboy
Marquez Fanboy
Senior Veteran
Senior Veteran
 
Posts: 2125
Joined: Thu Feb 10, 2011 4:47 pm
Location: YCNK
Has thanked: 224 times
Been thanked: 273 times
National Flag:
Australia
Favorite Aircraft: Boeing F/A-18A Hornet

Re: [Development]Orb: YSFlight Proxy Server Script

Postby Shutter » Sun Mar 11, 2012 3:58 am

It still doesn't print bacon.
Shutter
 

Re: [Development]Orb: YSFlight Proxy Server Script

Postby OfficerFlake » Sun Mar 11, 2012 3:59 am

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)
Image
YSFlight Phillip Island International Airshow Host
User avatar
OfficerFlake
Marquez Fanboy
Marquez Fanboy
Senior Veteran
Senior Veteran
 
Posts: 2125
Joined: Thu Feb 10, 2011 4:47 pm
Location: YCNK
Has thanked: 224 times
Been thanked: 273 times
National Flag:
Australia
Favorite Aircraft: Boeing F/A-18A Hornet

Re: [Development]Orb: YSFlight Proxy Server Script

Postby Shutter » Sun Mar 11, 2012 3:59 am

NOW we're talking bacon.
Shutter
 

Re: [Development]Orb: YSFlight Proxy Server Script

Postby OfficerFlake » Sun Mar 11, 2012 3:59 am

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.
Image
YSFlight Phillip Island International Airshow Host
User avatar
OfficerFlake
Marquez Fanboy
Marquez Fanboy
Senior Veteran
Senior Veteran
 
Posts: 2125
Joined: Thu Feb 10, 2011 4:47 pm
Location: YCNK
Has thanked: 224 times
Been thanked: 273 times
National Flag:
Australia
Favorite Aircraft: Boeing F/A-18A Hornet

Re: [Development]Orb: YSFlight Proxy Server Script

Postby Shutter » Sun Mar 11, 2012 4:00 am

Bacon achieved. Give yourself a pat on the back bro.
Shutter
 

Re: [Development]Orb: YSFlight Proxy Server Script

Postby Eric » Sun Mar 11, 2012 4:00 am

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.
Visit the YSFHQ Engineering Blog to learn about how YSFlight Headquarters is built better.
User avatar
Eric
Director of Technology
Director of Technology
Senior Veteran
Senior Veteran
 
Posts: 1208
Joined: Thu Feb 10, 2011 1:30 am
Location: Chicago, Illinois
Has thanked: 84 times
Been thanked: 237 times
National Flag:
United States of America
Favorite Aircraft: UCAV

Re: [Development]Orb: YSFlight Proxy Server Script

Postby Midnight Rambler » Sun Mar 11, 2012 4:01 am

<3

I'm guessing it'll be possible to join without a HQ account as well...?
RED TA-RANGER - POWER NUMBER 68
Owner and administrator of the 42South Server
Had an issue on the server? Want to add a new pack? Send me a PM or post it today!

Image
User avatar
Midnight Rambler
Senior Veteran
Senior Veteran
 
Posts: 1650
Joined: Thu Feb 10, 2011 7:08 pm
Location: Australia
Has thanked: 265 times
Been thanked: 358 times
National Flag:
Australia
Favorite Aircraft: F-16

Re: [Development]Orb: YSFlight Proxy Server Script

Postby OfficerFlake » Sun Mar 11, 2012 4:01 am

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.)
Image
YSFlight Phillip Island International Airshow Host
User avatar
OfficerFlake
Marquez Fanboy
Marquez Fanboy
Senior Veteran
Senior Veteran
 
Posts: 2125
Joined: Thu Feb 10, 2011 4:47 pm
Location: YCNK
Has thanked: 224 times
Been thanked: 273 times
National Flag:
Australia
Favorite Aircraft: Boeing F/A-18A Hornet

Re: [Development]Orb: YSFlight Proxy Server Script

Postby Harm » Sun Mar 11, 2012 4:02 am

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!
User avatar
Harm
Newbie
Newbie
 
Posts: 24
Joined: Tue Feb 21, 2012 10:09 pm
Location: Annapolis, MD
Has thanked: 2 times
Been thanked: 1 time
National Flag:
United States of America
Favorite Aircraft: F/A-18C

Next

Return to Programs

Who is online

Users browsing this forum: No registered users and 0 guests