[PROGRAM]Orb: YSFlight Proxy Server Script

Note that alterations to the YSFlight .EXE is forbidden
User avatar
Flake
Core Staff
Core Staff
Posts: 4353
Joined: Thu Feb 10, 2011 8:47 pm
Favorite Aircraft: Boeing F/A-18A
Location: Australia
OS: Windows 10 (x64)
Has thanked: 836 times
Been thanked: 1238 times
Contact:

Re: [Development]Orb: YSFlight Proxy Server Script

Post by Flake » Sun Mar 11, 2012 8:03 am

I mean that in the same system, the lag is practically the same as if you were not running the proxy(faster in c#). YSFlight will still be YSFlight I'm afraid and the internet will still be the internet. :/

Last night I got to work on merging the database and core. I nearly fried my fragile little mind because It turns out i needed to create an information container object for each user, and thus i had to make both sides of the program compatible. (not needed in c#, using static classes to control global information.)

Now that's done, I need to support information loading. (user.load())

Pretty much, now the permissions are just going to act as a master override, while the actual information does the work. (permissions were not used at all, ranks did the work. this will change in c#)

User[username].Group[Groupname].Rank["Number"] now returns the users rank. (will keep this structure, but cleaner. No need for number, Rank will return a rank object instead.)

New functions are such as: User[username].Info["Banned"] = True make the system a little easier to see coding wise. (still using sub classing and bools.)

I have the database and core running in parralell at the moment, but they are still fighting to work together. More info to come. (fixed, some perms issues.)

Oh and also, I've made a few settings:

alwaysallowlocalhost: lets the localhost always join even if the password/username is wrong (so you could join the server as "supercooladminguy" rather then your ysfhq username)
localtestmode: bind the port to your computer only, so the server list doesn't show the server online, and only you can connect to it (a warning is displayed on startup if this is set)
useysfhqauthentication: runs that log in script with ysfhq. if this is off, you just join like a normal ysf server.
serverport (can be anything, but atm is 7914. If Using YSFHQ mode, change the port to something hard to guess, or only allow local connections by either not forwarding port 7914, or set blocking in firewall.)
proxyport (can be anything, but atm is 7915) (all these functions work as intended.)
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
Core Staff
Core Staff
Posts: 4353
Joined: Thu Feb 10, 2011 8:47 pm
Favorite Aircraft: Boeing F/A-18A
Location: Australia
OS: Windows 10 (x64)
Has thanked: 836 times
Been thanked: 1238 times
Contact:

Re: [Development]Orb: YSFlight Proxy Server Script

Post by Flake » Sun Mar 11, 2012 8:03 am

I am very many tireds, so this was NOT easy to do:

Image

I've coded in game promotion and demotion in. It works like so:
/promote user group rank reason (will keep these commands.)
/demote user group rank reason

now the cool thing here is "rank" can be any number, and the program catches it and fixes it. for example, -5 becomes 0. 9001 becomes the upper rank. (those are the values i tested in the screenshot.)

but wait! there's more! not into remembering numbers? neither am I really. So i made it that you can look up the number as part of the script. so "/promote testuser YSRAAF AIRCDRE Reason" would do just that, rather then having to do "/promote testuser YSRAAF 7 Reason" (will keep this style.)

Edit: Annnndddddd dropbox updated.
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
Doomsday
Staff
Staff
Posts: 859
Joined: Mon Feb 07, 2011 2:01 am
Favorite Aircraft: PEW PEW PEW PEW
Location: PEW PEW PEW
OS: PEW PEW PEW PEW PEW
Has thanked: 1 time
Been thanked: 115 times

Re: [Development]Orb: YSFlight Proxy Server Script

Post by Doomsday » Sun Mar 11, 2012 8:04 am

Very neat stuff here Flake, keep up the good work.
Image
PEW PEW PEW PEW PEW PEW PEW PEW PEW PEW PEW PEW PEW PEW PEW PEW PEW PEW

Team Awesome# 131

User avatar
Flake
Core Staff
Core Staff
Posts: 4353
Joined: Thu Feb 10, 2011 8:47 pm
Favorite Aircraft: Boeing F/A-18A
Location: Australia
OS: Windows 10 (x64)
Has thanked: 836 times
Been thanked: 1238 times
Contact:

Re: [Development]Orb: YSFlight Proxy Server Script

Post by Flake » Sun Mar 11, 2012 8:05 am

Sorry for the few days off. I have been trying to rack my head around a simple issue:
A way to catch if the program crashes so that the data isn't lost. (Now using a main program in a receive loop. server thread has a master close object, which itereates over every client connected and cleanly disconnects them, destroying the object references and garbage collection destroys them for good. what's left is the receive loop, which can be safely killed anyway, as the socket is not really connected to anything.)

Then i realised something. Everything is threaded anyway! (what that hell does that mean? Dafuq brain!)

Once I close the core, i can run database shutdown before the script exits. (each user is saved on client DC. database is thus shutdown during process individually per user.)

apart from that, I've been experimenting with the datetime module to build crontask capabilities (auto shutdown at x time, for example) (will need to re-implement. DateTime support in c# MUCH better.)

and today, I've completed the database link.

The database can now load and save (not yet saving on server exit, as I haven't coded that part it yet.) (developing in reverse. Confirming the Database works FULLY before linking to proxy with tests first. much cleaner development)

Permissions are stored seperately in their own folders, and user info is much the same. (will instead have user/info.txt which will have all info, groups included, and user/permissions.txt which has that users specific permissions.)

So there are permissions per rank and per user (correct), as well as user information, tie that all in with core/database compatability, and we are ready to start coding the functions that make this script what it is supposed to be!

I am ready to start on: Ban,kick,freeze,mute,deny/allow aircraft/weapons (never done these, need vehicle core. expect in 2.0)... promote and demote are already done!

dropbox updated. Try fiddling with the database settings for each rank or user and give it a go! :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
Core Staff
Core Staff
Posts: 4353
Joined: Thu Feb 10, 2011 8:47 pm
Favorite Aircraft: Boeing F/A-18A
Location: Australia
OS: Windows 10 (x64)
Has thanked: 836 times
Been thanked: 1238 times
Contact:

Re: [Development]Orb: YSFlight Proxy Server Script

Post by Flake » Sun Mar 11, 2012 8:05 am

Worked on the first two basic functions, just ironing out the mess, really.

/info is by far the most complex command you'll ever see. first we need to check the permission.. then this, then that... god. (will recycle from fcraft source, should be MUCH cleaner.)

I've seperated the promote and demote commands out of the command host (will be doing that for all commands in future) (command host will be complete OBLITERATED. very unorganised and stupid idea to store object based commands away from the objects.)

and i ran into real big trouble too:

i was coding liek a bawse and well, i accidently in a for loop:

for User in ServerInfo.UsersOnline:
blah blah blah...

now, i'm a real derp, because User is already the host to all my User data as you could see. (User[name].everything...)

so i quickly changed that to a new name, and everything worked again. (c# smarter then this, shows variable conflicts on the fly. Have adopted a iteratable name standard of "This<X>" eg: foreach(User ThisUser in UserList) User namespace already taken. easy to follow codewise too.)

promote, demote and info can now handle errors in the text (without crashing and fucking shit up) (will be cleaner with non nulls such as UserDB.Nobody)

and info is using basic permissions for now, as well as checking if the user is hidden or not or can even read the other users data.

I need to set an option for the "ServerGroup", ie, the group that runs the server, so that comparisons are made to the right group. The groups are there to look pretty and add prestige, but the servergroup should have the power. (Servergroup will instead be a static group on the server, no group will own the server, however, with group permissions you can "PRETEND" a group owns the server by giving them the same power.)

So yeah...
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
Core Staff
Core Staff
Posts: 4353
Joined: Thu Feb 10, 2011 8:47 pm
Favorite Aircraft: Boeing F/A-18A
Location: Australia
OS: Windows 10 (x64)
Has thanked: 836 times
Been thanked: 1238 times
Contact:

Re: [Development]Orb: YSFlight Proxy Server Script

Post by Flake » Sun Mar 11, 2012 8:06 am

After some hard work all morning, /hide and /unhide (show up as an online user or not) are working in full. (at least the text version anyway) (permissions broken somewhere...)

The server has been crossed over to master group mode (you can specify a master group in the settings, for example, my master group is "YSRAAF") this group inherits the actual power to do things. (completly wiping this idea. see above post.)

One user per username login is now enabled till i swap to an array for users after beta. considering the purpose of the program is to force YSFHQ authentication anyway, it shoulodn't be a problem. (Will continue to do this. Will have user joining function and user rename functions on successful password entry.)

The little commands are proving quite easy to add with the object orientated code structure I've made. :D

The next feature will need to be datetime though. I've been using place holders too long. (and and speeking of those, the placeholder for your ipaddress is done) (C# has these holders built in, no hard work needed.)

after that feature, will be save settings (user settings are saved on the fly with each change made) (user.save() Done in c#.)

Then add to and remove from group (server based group induction)(user.groups.add(Group ThisGroup) needs to be coded c#.)

then all the other commands, from important (eg: BAN) to not that important (eg: say). (done in python, to be done c#. will use fcraft source as a guide if needed.)

Dropbox is updated if you want to have a tinker.

edit: forgot to mention, graceful socket close implemented, and announcements for users joining and leaving are done. (graceful close not graceful, just avoided a mess with try/catch. Can't be done in python. join/leave annouces are fine.)
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
Core Staff
Core Staff
Posts: 4353
Joined: Thu Feb 10, 2011 8:47 pm
Favorite Aircraft: Boeing F/A-18A
Location: Australia
OS: Windows 10 (x64)
Has thanked: 836 times
Been thanked: 1238 times
Contact:

Re: [Development]Orb: YSFlight Proxy Server Script

Post by Flake » Sun Mar 11, 2012 8:06 am

Urgh a very long day coding today.

I've fixed up a few small and big things:

/add and /remove can now add users to groups, users are saved on the fly when one of their permissions/infos are modified. this means the server never needs a graceful shutdown (and i can save a thread there, less coding power needed.) (save on fly is key to success.)

graceful socket catching for dc'd users, but only outside of local test mode. I still will need to fix things there, so i'll need detailed info for when i'm debugging. (never fixed, python is shit yo.)

With a new addition comes a new error though it'd seem, and now i accidently broke /promote/demote...(I don't even know... this is what happens when you parallel code the proxy AND users AND groups AND permissions AND permissions core all together... what a bloody mess...)

that will need to be fixed later. for now, that's enough work.

current commands:

hide/unhide (not working 100%)
add/remove (fine)
promote/demote (think this was fixed...?)
info/info username (fixed.)
players (hidden user issues.)
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
Core Staff
Core Staff
Posts: 4353
Joined: Thu Feb 10, 2011 8:47 pm
Favorite Aircraft: Boeing F/A-18A
Location: Australia
OS: Windows 10 (x64)
Has thanked: 836 times
Been thanked: 1238 times
Contact:

Re: [Development]Orb: YSFlight Proxy Server Script

Post by Flake » Sun Mar 11, 2012 8:07 am

Urgh, moved everything around so I can have a title post...
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
Midnight Rambler
Staff
Staff
Posts: 2120
Joined: Thu Feb 10, 2011 11:08 pm
Favorite Aircraft: F-16
Location: Australia
OS: Windows 10
Has thanked: 259 times
Been thanked: 360 times

Re: [Development]Orb: YSFlight Proxy Server Script

Post by Midnight Rambler » Sun Mar 11, 2012 10:00 am

Cool name :)

When can we predict to have a very basic, simple, server suitable version of orb running? I'm very keen to test it thoroughly on my server to see what kind on lag, delays, saving issues etc... are found.
Image

User avatar
Flake
Core Staff
Core Staff
Posts: 4353
Joined: Thu Feb 10, 2011 8:47 pm
Favorite Aircraft: Boeing F/A-18A
Location: Australia
OS: Windows 10 (x64)
Has thanked: 836 times
Been thanked: 1238 times
Contact:

Re: [Development]Orb: YSFlight Proxy Server Script

Post by Flake » Sun Mar 11, 2012 12:22 pm

I give 3 to 5 weeks. This seems like a simple enough project to finish on paper, but I know it's going to take awhile longer then i think it will. :roll: (if I had of just developed more linearly, this would've actually been done on time.)

In case you're wondering where i got the idea, I've just been picturing Sauruman with the obelisk viewing orb under his fingers. It's great power imagery, if you think about how with this, you can manipulate YSF to so much more.

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
Core Staff
Core Staff
Posts: 4353
Joined: Thu Feb 10, 2011 8:47 pm
Favorite Aircraft: Boeing F/A-18A
Location: Australia
OS: Windows 10 (x64)
Has thanked: 836 times
Been thanked: 1238 times
Contact:

Re: [Development]Orb: YSFlight Proxy Server Script

Post by Flake » Thu Mar 15, 2012 10:36 am

All currently coded features are working again. I needed to fix two lines in the promote/demote modules as to avoid NoAssignedValue errors. (groups with keys that didn't exist, because the format was wrong.) (precisely why I'm leaving the "null" possibility in the dust for parentable classes.)
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
Core Staff
Core Staff
Posts: 4353
Joined: Thu Feb 10, 2011 8:47 pm
Favorite Aircraft: Boeing F/A-18A
Location: Australia
OS: Windows 10 (x64)
Has thanked: 836 times
Been thanked: 1238 times
Contact:

Re: [Development]Orb: YSFlight Proxy Server Script

Post by Flake » Sat Mar 17, 2012 10:58 am

Alright NOW I am really happy!

I am starting to underestimate the raw power of my own genious here *snirk snirk*. I've coded Ban/UnBan and I have private messaging working.

And also: I've coded the first easter egg into the program! I won't give it away, but if you say certain things to certain people, the server picks up on it and sends a reply. ;) (I love me, I love me, I'm the best friend I can be...)
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
Core Staff
Core Staff
Posts: 4353
Joined: Thu Feb 10, 2011 8:47 pm
Favorite Aircraft: Boeing F/A-18A
Location: Australia
OS: Windows 10 (x64)
Has thanked: 836 times
Been thanked: 1238 times
Contact:

Re: [Development]Orb: YSFlight Proxy Server Script

Post by Flake » Tue Mar 27, 2012 7:23 am

Bit of fun today. I coded "Kick" in, cleaned up a little and added the second easter egg. this one is based off of login count, and send messages back to the player each time they log in if it's a special number.

Oh and I've got primitive date functions working. (date time makes this a lot easier... python is shit.)
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
Core Staff
Core Staff
Posts: 4353
Joined: Thu Feb 10, 2011 8:47 pm
Favorite Aircraft: Boeing F/A-18A
Location: Australia
OS: Windows 10 (x64)
Has thanked: 836 times
Been thanked: 1238 times
Contact:

Re: [Development]Orb: YSFlight Proxy Server Script

Post by Flake » Tue Mar 27, 2012 9:50 am

Indev 0.1.0 Released.

Make sure you have Python 2.5 installed, then just execute "_Run.py"
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
Midnight Rambler
Staff
Staff
Posts: 2120
Joined: Thu Feb 10, 2011 11:08 pm
Favorite Aircraft: F-16
Location: Australia
OS: Windows 10
Has thanked: 259 times
Been thanked: 360 times

Re: [Development]Orb: YSFlight Proxy Server Script

Post by Midnight Rambler » Tue Mar 27, 2012 10:37 pm

When I run it, console server is on port 7914.

This is the message I get when I try to join the server:

Image

From my screen:

Image

I run the server on a separate computer running XP and Python 25.
I join from a machine running Vista through my home network on a 192.168.0.## IP address.

Basically, I cannot join.
Image

User avatar
Flake
Core Staff
Core Staff
Posts: 4353
Joined: Thu Feb 10, 2011 8:47 pm
Favorite Aircraft: Boeing F/A-18A
Location: Australia
OS: Windows 10 (x64)
Has thanked: 836 times
Been thanked: 1238 times
Contact:

Re: [Development]Orb: YSFlight Proxy Server Script

Post by Flake » Tue Mar 27, 2012 11:12 pm

Simple error on my part there.

Before, the Displayed Username was stored in a .UsernameDisplayed variable.

I changed that to .Info['DisplayedName'']

Basicly, only ReadUser.py and WriteUser.py were referencing them. :| (confirmed as only references with notepad++) (visual studio 2010 will automatically show these errors in future.)

What you just got was a "VariableUndeclared" error.

Thanks for sharing your bug reports! They DO solve problems!

This is now fixed. Orb updated to Indev 0.1.1
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
Midnight Rambler
Staff
Staff
Posts: 2120
Joined: Thu Feb 10, 2011 11:08 pm
Favorite Aircraft: F-16
Location: Australia
OS: Windows 10
Has thanked: 259 times
Been thanked: 360 times

Re: [Indev_0.1.1]Orb: YSFlight Proxy Server Script

Post by Midnight Rambler » Tue Mar 27, 2012 11:56 pm

Ok, all working now :)

Edit: This may sound stupid, but how do you use the commands?
Image

User avatar
Flake
Core Staff
Core Staff
Posts: 4353
Joined: Thu Feb 10, 2011 8:47 pm
Favorite Aircraft: Boeing F/A-18A
Location: Australia
OS: Windows 10 (x64)
Has thanked: 836 times
Been thanked: 1238 times
Contact:

Re: [Indev_0.1.1]Orb: YSFlight Proxy Server Script

Post by Flake » Wed Mar 28, 2012 12:03 am

I noticed you are using a long username, and currently, I haven't coded a method in to grab the longer username (not really possible i don't think...)

have a username of <= 15 characters, then type "/command" (no way around this unfortunatly. Will need to code a x = y for ysfhq authentication in future.)
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
Core Staff
Core Staff
Posts: 4353
Joined: Thu Feb 10, 2011 8:47 pm
Favorite Aircraft: Boeing F/A-18A
Location: Australia
OS: Windows 10 (x64)
Has thanked: 836 times
Been thanked: 1238 times
Contact:

Re: [Indev_0.1.1]Orb: YSFlight Proxy Server Script

Post by Flake » Fri Mar 30, 2012 8:27 am

I just got an awesome idea.

As part of the login function, YSFlight crops the username to 15 characters.

But... as part of the YSFHQ system, the player sends a text message to log in: ie: "(Username)PASSWORD"

now my system just omits "(USERNAME)" and leaves "PASSWORD". why not do this in reverse and also grab the full username. (this is my thinking, but it's not always that simple. for example, how do you find the breakpoint in username/password in this: "(YSFHQ)(DERPSQD)USERBRO(LOL)THIS(IS)MY(PASSWORD)LOL" it's quite a problem.)

My new plan is to have(on login)

YSF sends "Midnight Ramlbe" in the login. "(Midnight Rambler)Password is received."

Orb then assigns "Midnight Ramlber" to be the recognised name, and "Midnight Ramlbe" is kept as the username in code for legacy purposes. (See above. A solution would be to not allow tags in the username, but people are stupid and would try them anyway...)

Obviously, "Midnight Ramlber Fan 9001" would also login as "Midnight Ramlber" normally anyway, however, 1) you still need to have a successful login, 2) like that's ever going to happen! (I'm thinking for YSFHQ mode, you login as a username like non authenticated, then it asks for your hq username and password (need to enter two things). This then authenticates you, and if you have a linked account already, will notify you of that account and will ask you if you wish to change your server username. this will be in step with the user join and user rename functions. PROBLEM SOLVED.)

This makes it possible for users to have usernames over 15 characters, while maintaining the old security measures, AND not having the user need to send another chat message to log in.
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!

Boom
Contributor
Contributor
Posts: 359
Joined: Sat Dec 10, 2011 10:28 pm
Favorite Aircraft: F-15, F-22
Has thanked: 13 times
Been thanked: 8 times

Re: [Indev_0.1.1]Orb: YSFlight Proxy Server Script

Post by Boom » Fri Mar 30, 2012 8:43 pm

Make sure not to release anything open source if you can. if you do anyone with a tad bit of python experience can get it to print a list of all the hashes (or at least i hope this site uses hashes) (Orb will be closed source until I can developed a .DLL method of YSFHQ authentication. The DLL will be signed thouroughly inside itself to prevent reverse engineering.)

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest