[PROGRAM]Orb: YSFlight Proxy Server Script
- Flake
- 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
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.)
- Flake
- 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
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.
- Doomsday
- Staff
- Posts: 880
- 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: 130 times
Re: [Development]Orb: YSFlight Proxy Server Script
PEW PEW PEW PEW PEW PEW PEW PEW PEW PEW PEW PEW PEW PEW PEW PEW PEW PEW
Team Awesome# 131
- Flake
- 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
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!
- Flake
- 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
/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...
- Flake
- 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
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.
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.)
- Flake
- 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
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.)
- Flake
- 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
- Midnight Rambler
- 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
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.
- Flake
- 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
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.
- Flake
- 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
- Flake
- 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
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...)
- Flake
- 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
Oh and I've got primitive date functions working. (date time makes this a lot easier... python is shit.)
- Flake
- 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
Make sure you have Python 2.5 installed, then just execute "_Run.py"
- Midnight Rambler
- 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
This is the message I get when I try to join the server:
From my screen:
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.
- Flake
- 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
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
- Midnight Rambler
- 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: [Indev_0.1.1]Orb: YSFlight Proxy Server Script
Edit: This may sound stupid, but how do you use the commands?
- Flake
- 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: [Indev_0.1.1]Orb: YSFlight Proxy Server Script
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.)
- Flake
- 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: [Indev_0.1.1]Orb: YSFlight Proxy Server Script
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.
-
- 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
Who is online
Users browsing this forum: No registered users and 3 guests