Vegaserver enhancements

A forum for online playing, administration, bugs and feature requests
Eye~R
Hunter
Hunter
Posts: 70
Joined: Sun Jan 19, 2014 5:02 am

Vegaserver enhancements

Post by Eye~R »

I'm lazy, Large amnts of this is c&p from: [WIP] NEW INGAME CONSOLE. As suggested there, I'm bringing it into here...

As anyone experimenting with vegaserver will know, as a beast the multiplayer envronment is kinda insane... That .py server it prequsites execution of, tho functional, doesn't strike me as too great..(Potential Replacement ?) seems to be able to be crashed easily ( by bots that has found forms, usually, and attempt spam) -=- accounts are not generated over HTTPS, and account auth/validation takes place plaintext, too, in fact, all comms between vegaserver and http_accountserver.py take place in an unsavoury fashion(Easy for testing and possibly acceptable on LAN, but unsuitable for "untrusted" environments, like the internet)... I don't seem to note any form of account or server management, either.. Fabrication of an account already existing results in the "original" account being overwritten - Potential for abuse lies within - There appears to be sincere lag in between launching missiles, and them being fired -=- There's no NPC's (bounty hunting missions aside) -=- Long story short, this needs a blast with the spice weasle. Bamn.

Input appreciated.

User chat:
  • * Ideally need some sort of "frequency management" - Can limit broadcast to say a "sub-channel" applicable to all of same faction, or possibly opposing ones, Some sort of buddy/friendlist. Current options are global (server-wide, akin to "normal" IRC operation) or spefcified (To preselected user, akin to IRC's "PM" function)
    * Desperately needs additional functionality to provide basic admin functions, ie:
    • - White/blacklist maintainence (Currently, I don't think provided, in any capacity)
      - Basic sever manipulation / control (Ideally prequisites hierachial structure to users, Don't need everyone with admin...)
      - Some sort of MOTD like functionaly would be good
    * User defined keybinds - Like F1 -> F4 have a selection of comms, F5->F9 could contain user shortcuts to short phrases

Custom Menu:

I wonder if it's possible to push this from the server, as it does the ships/maps in use....

would require following functionality:
  • * Similar in-flight functionality to the mission/cargo/upgrade computer whilst docked. Interplayer realtions requires more than chat, and docked trade... Would be good to donate money to other players, or demand a toll fee for passing thorugh your system(or just existing)...
    * Fleet management (for Faction leaders / fleet commanders)
    • - Needs ability to relay orders to fleet, in terms of movements or targeting... Converge here, fly in formation to there, attack that... Move here, protect this.... Some things (like target priority) once changed would ideally reflect across faction/fleet members HUD. I think might be at least possible to issue optional tasks to faction/fleet members by making the output of this populate a "mission template" and have it offered in applicable players computers. If owning more than one ship in the multiplayer didn't kill the player, I'd suggest this could be used to move a players (unpiloted)fleet around, whilst in flight... Allowing multiple cargo ships to follow pre-plotted course, and user-piloted escort...
    * Faction Management (For faction leaders, or possibly one or two tiers lower)
    • - Needs abiltiy to relay orders to faction, in terms of trade and production goals(Once Nido's Markets apply), and general stratergies. Possibly a per-faction MOTD.
      - Needs ability to admin faction ie: control of faction members, and hierachial positions of
      - Inter-faction relation: ie: treaties, pacts, aliances and inter-faction diplomatics
      - Fabrication and distrobution of resources, and resource management(on a per-user basis for delegation) * Resource Management (For owners of resources)
      - Needs to interface, both on a macro (Universal) level and micro (Individual) level with production facilities(ie: factories, shipyards, fighter bases, research stations) and resource collection/fabrication facilities (mining stations, etc) to enable control over production, in "macro" mode by indicating general intention and allowing some "AI Governer" to specifically set through the chain required to fabricate, and in micro mode allowing the user specific control(Preferably with tiered production lists) over production.
    * Profile management
    • - Allow user to update/edit contact details / password
      - Allow user to repawn with another ship selection (Currently require account refabrication, would be good to eventually have this tied in to the available ships produced by your faction)
      - Import/selection of ship liveries (might be good for additional per-faction markings)
      - Social (see "Social Aspect" below)
Social Aspect:

Social interaction is, basic chat function aside, entirely unaddressed... I'd personally suggest swapping up the chat function with XMPP(not looked into what used current)
Reasons supporting of XMPP:
  • - Free and open source
    - Cross platform
    - Supports encryption via OpenSSL, with additional layers of GPG and OTR
    - Supports vid/voice/text
    - Reliable: Served as backend for Gtalk, Facebook's IM - whatsapp was effectively a broken XMPP implimentation - in personal tests it's been remarkably resilient.
    - Extendable - It could potentially allow for almost any future use you could desire
    - I've already got a server rolling
A "conference" could be used to provide server-wide(or when running cluster, network-wide) in-game chat, another for each faction as they "comms channel" - Another for each bar in each station/dock - maybe even optionally offering vid comms(could be offered in flight, theory, too - but don't think sense offering above audio there), it could handle user's "friends" removing "inane chatter" from the "global channel" ...

For the social tab listed above, could manage your "friends", and possibly using something like PHPBB's framework(ie: access similar, direct from SQL) access some sort of "forum" -=- Frontend similar to, and backend linked to, the "docked" mission/ship/upgrades/cargo/news computer -=- and can via template create tasks(TTL might be clever), or accept others tasks ...

For a loose visual aspect, I'm loosly faced with this...
Image
I'm sure it used to have a border, and some definition to the buttons, but meh - I drew some in, I'm not syaing I think that's how this should look - Just adding some definition for demonstrations...
Image
Next one is pretty much the same beast, but I've highlighted the "three sections" of data output, The left most could potentially hold more data -=- The upper and lower yellow corners on the right side to it's border could function as up/down scroll, with green section being position indicator( Be good to also consider for keyboard control of menu). The upper section containing "mission" I know holds loads more data, but it hides behind the third, lower pane ideally would need to self scroll / loop ...
Image
The buttons on the right hand side need re-organising, The above additions will not entirely fit in with the current menu structure, but fortunately, on some screens the buttons are currently redundant, and I've noticed the buttons can change depending on which section you're currently in, so it should be possible.
I've noticed anothe rmenu in the multiplayer, With no better name, I'm calling it the "bar menu":
Image
About the only thing I've noted to "work" in that is the bounty, not actually encountering another player in the server yet I've not entirely been able to test...
Image
Ideally would need to figure out how to interact this, from the other parts of structure... I've noticed with the previous menu tho, ig goes "out of line" whilst under mouse:
Image
More to come, I'm just too lazy
Last edited by Eye~R on Thu Apr 10, 2014 2:42 am, edited 4 times in total.
Multiplayer Server Offline. Copy ony testing rig semi-funcitonal.
User Signup Offline.
Server Health Shows old data from last snapshot before the server downed.

If you have any issues you can usually find me in #vegastrike on freenode.
klauss
Elite
Elite
Posts: 7243
Joined: Mon Apr 18, 2005 2:40 pm
Location: LS87, Buenos Aires, República Argentina

Re: Vegaserver enhancements

Post by klauss »

Many of the things you mention need extensive engine work.

BUT... while I don't know much about the account server, what you mention certainly sounds bad.

I don't know if ace123 is maintaining the thing, but if now, we could certainly do a rewrite with a modern and python-based framework. We're using python everywhere else, so it seems just right to also use python for the account server, and being in python would mean we could easily make a launch button to launch a server for LAN multiplayer.

Flask sounds like a good candidate to me (easy to use, quick as a start).
Oíd mortales, el grito sagrado...
Call me "Menes, lord of Cats"
Wing Commander Universe
Eye~R
Hunter
Hunter
Posts: 70
Joined: Sun Jan 19, 2014 5:02 am

Re: Vegaserver enhancements

Post by Eye~R »

I take it by "flask" you don't mean the Flux Advanced Security Kernel.....

It's not the fact it's in python that offends me, but I somehow don't think it's wise to have it internet-facing, and not even sanitising user input... would be better IMHO run more contained, and interfaced with(by users/admin at least) via something like php, which can act as a layer of filterance... It would also need to feature some sort of User administration and some form of server administration (more than a button labled "start/stop" - lol ) I've noted the twisted framework(python-based) appears to support XMPP..

A primary reason of making a "click here to start" button (that doesn't actually feature anywhere I've noticed) is actually a poor reason to consider python... Why isn't vegaserver and http_accountserver.py in /etc/init.d/ ?

As for the "Exstensive engine work" - I'm aware - I wish I was able to be more constructive, in terms of fabricating code, but about best can expect from me is segfaults. It really needs doing, tho. From my mind, it's been tweaked to the point of basic functionality, for testing use on local LAN - and then pretty much ignored. Have to jump through hoops to make it log properly. The multiplayer component could potentially elevate the game to legendary status, existing isn't really quite enough - It needs to deliver to the user a rich and rewarding experiance.
Multiplayer Server Offline. Copy ony testing rig semi-funcitonal.
User Signup Offline.
Server Health Shows old data from last snapshot before the server downed.

If you have any issues you can usually find me in #vegastrike on freenode.
klauss
Elite
Elite
Posts: 7243
Joined: Mon Apr 18, 2005 2:40 pm
Location: LS87, Buenos Aires, República Argentina

Re: Vegaserver enhancements

Post by klauss »

Eye~R wrote:I take it by "flask" you don't mean the Flux Advanced Security Kernel.....
No, I mean Flask
Eye~R wrote:It's not the fact it's in python that offends me, but I somehow don't think it's wise to have it internet-facing, and not even sanitising user input... would be better IMHO run more contained, and interfaced with(by users/admin at least) via something like php, which can act as a layer of filterance... It would also need to feature some sort of User administration and some form of server administration (more than a button labled "start/stop" - lol ) I've noted the twisted framework(python-based) appears to support XMPP..
Indeed, and using a real web framework for it would help fix all that.
Eye~R wrote:A primary reason of making a "click here to start" button (that doesn't actually feature anywhere I've noticed) is actually a poor reason to consider python... Why isn't vegaserver and http_accountserver.py in /etc/init.d/ ?
Ehm... the latest account server isn't that. There's one made in php in masterserver, a new thing by ace123.

In any case, php is even worse. The reason to use python is because it enables and simplifies just that button (not that the button is the priority), because python can be launched in stand-alone fashion, whereas php cannot (it needs a web server, something no regular user of the game will have or know how to set up).

So, a python implementation would be accessible to the masses. That's the reason.
Eye~R wrote:As for the "Exstensive engine work" - I'm aware - I wish I was able to be more constructive, in terms of fabricating code, but about best can expect from me is segfaults. It really needs doing, tho. From my mind, it's been tweaked to the point of basic functionality, for testing use on local LAN - and then pretty much ignored. Have to jump through hoops to make it log properly. The multiplayer component could potentially elevate the game to legendary status, existing isn't really quite enough - It needs to deliver to the user a rich and rewarding experiance.
The multiplayer part has no maintainer though. That's a big problem. A while ago, ace123 maintained it. But now he's not so very active, and we're out of maintainers. And it really needs a maintainer ;)
Oíd mortales, el grito sagrado...
Call me "Menes, lord of Cats"
Wing Commander Universe
Eye~R
Hunter
Hunter
Posts: 70
Joined: Sun Jan 19, 2014 5:02 am

Re: Vegaserver enhancements

Post by Eye~R »

Lol - You really don't want me doing it... you not click that "User administration" link ? It looks pretty - but that's 'cause it does nuttin, it leeches the .css - therefore styling - from teh sourceforge page ... Start clicking around on links you'll find it's v. much broken... I could fix it, given time and research, but I'm really not motivated for that. For the more "code related" side, I'm really good at breaking things, that's about it - seen my signup ? Completely failed to make python take note of .css - got as far as noting it somehow prequisites some sort of parser but it rapidly looked like I'd have to learn python to actually make productive use... The intention is that it would of looked similar to the User Administration panel....

I'm not surprised to find the server I'm running isn't "current" - it didn't seem to pack with anything, can't recall it's source now (I'm thinking from another machine way back when compile from source). There a link for this? Why did no-one mention this sooner?
klauss wrote:In any case, php is even worse. The reason to use python is because it enables and simplifies just that button (not that the button is the priority), because python can be launched in stand-alone fashion, whereas php cannot (it needs a web server, something no regular user of the game will have or know how to set up).
Um, Even worse? how? As to teh webserver - Sure, for a LAN or a "deathmatch" style play - For a "Always on, always online" MMO.... it makes sense to integrate heavily with "web technologies" -=- It needs layers the "float around and shoot things" doesn't, because it needs to be more... I'm not saying python is poor of framework to provide such, I'm v. little in understanding about it however. The limited knowledge I has of python could possible enable for me to fabricate a "start/stop" button - But once applied I know not how to use python to sandbox that off to ensure *only* the expected command can be issued , It won't be able to gain read/write access outside of expected environment... I've mitigated the best I can by running as users with de-elevated privlidge levels - but it's not entirely enough or effective. By the time I've worked out how to make python check to see if a user is already existing in database (need to move over to SQL, I set it to file for testing - Doesn't appear to be any documentaion covering conversion - blah - No MOTD, so can't even pre-warn users of change... generated accnts record no contact details - not even signup IP!) and then prompt for their pass before refabricating an account - or issuing a denied error - A competent python dev could of possibly re-written it from scratch... I'm not even sure if hierachical structure would need to be applied in the vegaserver engine, or in the http_accountserver.py -=- I'm even lesser knowledgeable of how to interface with the server - Might be nice to has a front page that relay how many users are currently online, another page that can list off who is in what system, Star-Maps with near real-time updates of locations of users, which factions are owning what resources, where - A web-version of the docked computers " news " computer -=- Panel for users to modify their profile...
Multiplayer Server Offline. Copy ony testing rig semi-funcitonal.
User Signup Offline.
Server Health Shows old data from last snapshot before the server downed.

If you have any issues you can usually find me in #vegastrike on freenode.
klauss
Elite
Elite
Posts: 7243
Joined: Mon Apr 18, 2005 2:40 pm
Location: LS87, Buenos Aires, República Argentina

Re: Vegaserver enhancements

Post by klauss »

Eye~R wrote:Lol - You really don't want me doing it... you not click that "User administration" link ? It looks pretty - but that's 'cause it does nuttin, it leeches the .css - therefore styling - from teh sourceforge page ... Start clicking around on links you'll find it's v. much broken... I could fix it, given time and research, but I'm really not motivated for that. For the more "code related" side, I'm really good at breaking things, that's about it - seen my signup ? Completely failed to make python take note of .css - got as far as noting it somehow prequisites some sort of parser but it rapidly looked like I'd have to learn python to actually make productive use... The intention is that it would of looked similar to the User Administration panel....
I wasn't suggesting it - just saying.
Eye~R wrote:
klauss wrote:In any case, php is even worse. The reason to use python is because it enables and simplifies just that button (not that the button is the priority), because python can be launched in stand-alone fashion, whereas php cannot (it needs a web server, something no regular user of the game will have or know how to set up).
Um, Even worse? how? As to teh webserver - Sure, for a LAN or a "deathmatch" style play - For a "Always on, always online" MMO.... it makes sense to integrate heavily with "web technologies"
That's the thing.

Flask can be turned into a full productive server quite easily too. Slap gunicorn + gevent + nginx, and you have one.
Eye~R wrote:The limited knowledge I has of python could possible enable for me to fabricate a "start/stop" button - But once applied I know not how to use python to sandbox that off to ensure *only* the expected command can be issued , It won't be able to gain read/write access outside of expected environment...
Python is easy to secure, as long as you use frameworks and don't reinvent the wheel.

SQLAlchemy handls all SQL in a safe, SQL-Injection-free way.

Jinja2 handles templates in a safe, XSS-safe way.

Flask itself has some utilities to avoid XSRF, and unless you shoot yourself on the foot quite explicitly by trying to RUN user input, you cannot do remote code execution.
Eye~R wrote:I'm even lesser knowledgeable of how to interface with the server - Might be nice to has a front page that relay how many users are currently online, another page that can list off who is in what system, Star-Maps with near real-time updates of locations of users, which factions are owning what resources, where - A web-version of the docked computers " news " computer -=- Panel for users to modify their profile...
Yes, as I said, we have no multiplayer maintainer - so I have no clue about that either.

Supposedly, there's some interface for that, one just uses it. If not, one can at least parse logs, surely.

In any case, having a real web framework to do all that can only help... right?
Oíd mortales, el grito sagrado...
Call me "Menes, lord of Cats"
Wing Commander Universe
Eye~R
Hunter
Hunter
Posts: 70
Joined: Sun Jan 19, 2014 5:02 am

Re: Vegaserver enhancements

Post by Eye~R »

Looks as if I'm needing to learn python after all - ho-hum - This should be interesting...
Multiplayer Server Offline. Copy ony testing rig semi-funcitonal.
User Signup Offline.
Server Health Shows old data from last snapshot before the server downed.

If you have any issues you can usually find me in #vegastrike on freenode.
ezee
Intrepid Venturer
Intrepid Venturer
Posts: 703
Joined: Tue Feb 11, 2014 12:47 am
Location: FRANCE
Contact:

Re: Vegaserver enhancements

Post by ezee »

@ Eye~R

I like very much your psychedelic menu !
And the yellow/green buttons to moove the slider of the box is a good idea too !
( while actually not implemented in c++ - it's doable )

(There is an effect we can also use with the c++ menu and buttons , it is to change the color
of the border with time . Example : You start at time=0 with a pink border and end with a blue
at time=second*asmanyUwant ) .

I think cool interfaces should be proposed by artists , or just people that wish to share their ideas.
yeah man , your menu is cool !
Animated would be super cool , with a glow effect in the border .
:wink:

Code: Select all

 if (!track.HasWeapons())
            {
                // So what are you going to threaten me with? Exhaustion gas?
                return ThreatLevel::None;
            }
Vegastrike evolved
DEV YOUTUBE CHANNEL
Vegastrike evolved wiki
Eye~R
Hunter
Hunter
Posts: 70
Joined: Sun Jan 19, 2014 5:02 am

Re: Vegaserver enhancements

Post by Eye~R »

lol - ty.

I seem to recall there was a border, and buttons but there isn't now(could just be me).. I threw that together in a few mins in gimp (it'd help if I knew how to use gimp) simply to illustrate it does kinda look "unfinished". I actually wanted to give the black bckgrnd a 40%-60% alpha but neglected to source w/o the menu there. Doesn't look anything like what was in my head when started, but I was roughly aiming for "liquid" / "organic", got part way there, then "lost" the texture I was using on the outside, forcing inside to take new form... I wanted it barely noticable, but to clearly define sections... as was adjusting it's colours considered the upper "missions" section, esp with three "complex part " missions overpopulates and seems to feature no way to retrieve teh data... Auto-scrolling would resolve... Then considered the "left pane" could hold more data, for example in the "buddies" page of menu could hold "buddies" or in "resource mngmt" a list of resources you own - Secting from here obviously effecting certain other "panes" contents... For manu of this, a scroll-bar could have it's uses... -=- Hadn't considered animations, good call. Menu transitioning from one section to another may benefit from animation, too - Something like "desktop cube" would be pretty kewl, as click button to select section, "cube" rotates to face "correct" side to user... We'll worry about the seven buttons later, Most users won't notice the cube has more than six sides. I'll mock more screens later(included with 1'st post), to hopfully better illustrate concepts I make previous, Needs to consider something to graph up menu structure, to work out how this can all fit together in an interface, too... Don't happen to know if any thing like this is already in existence?
Multiplayer Server Offline. Copy ony testing rig semi-funcitonal.
User Signup Offline.
Server Health Shows old data from last snapshot before the server downed.

If you have any issues you can usually find me in #vegastrike on freenode.
ezee
Intrepid Venturer
Intrepid Venturer
Posts: 703
Joined: Tue Feb 11, 2014 12:47 am
Location: FRANCE
Contact:

Re: Vegaserver enhancements

Post by ezee »

You have very good ideas man !
I've found Pyglet that is a python Api that could serve for our experimentations .
http://www.pyglet.org/doc/programming_guide/index.html

I opened a thread to call coders to use it for making tools for VS :
http://forums.vega-strike.org/viewtopic ... 38&t=19956
I started to play with pyglet , and i have good results under windows .

For your project
Hi.

Just a little post to mention I've setup a (mostly default, currently) VegaStrike server.

Account Creation: http://vegastrike.armed.me.uk:8080

Server: VegaStrike.Armed.Me.Uk
Port: 6777
Enjoy.
, that could be a good laboratory :

_Branch a pyglet window to the server to have a custom 3d interface
_Design news menus with shaders , 3d pickable objects , animated sprites etc ...
Being opengl , all the artwork could be reused using XML to store the layout ( like css for html)

As most of coders use python here , i hope some of them will understand all the possibilities offered
by Pyglet Api .

Back to your Menu , i've found it attracting and original .
That is very important because the first minutes are often critical to have an idea about a software.
( we need to do also something for your server's home page :lol: )
While the packaging is not the most important , it must be equal at least to the content of the game.
Vegastrike is an original concept , and your menu system is original too . ( i like the idea of the cube )
A good deal .

I'm ok to start something with pyglet and your textures .
We need to use a new set of fonts for Vegastrike also .
And a menu page for characters setup and visualization ( 2d avatars first , 3D later)
well , we'll see ...
I'll mock more screens later(included with 1'st post),
Cool !
Needs to consider something to graph up menu structure, to work out how this can all fit together in an interface, too... Don't happen to know if any thing like this is already in existence?
Not sure i undestand what you want , but is it something like this ?
Image

From A good technical paper about Menus : http://www.lap.umd.edu/poms/chapter2/chapter2.html
In this chapter menu structure, physical format, and response requirements will be discussed. Menu structure refers to the branching capability of the menu. Menu structure determines the extent to which the current selection affects subsequent options. We will see that some highly constrained menus serve a purpose in determining the proper sequence of transactions between the user and the system.
If you are looking for a UML diagram editor , perhaps this one :
http://alexdp.free.fr/violetumleditor/page.php

Code: Select all

 if (!track.HasWeapons())
            {
                // So what are you going to threaten me with? Exhaustion gas?
                return ThreatLevel::None;
            }
Vegastrike evolved
DEV YOUTUBE CHANNEL
Vegastrike evolved wiki
Eye~R
Hunter
Hunter
Posts: 70
Joined: Sun Jan 19, 2014 5:02 am

Re: Vegaserver enhancements

Post by Eye~R »

Heh, I was acutally after existing menu structure - And "maps" of. Cheers for the link to Violet, tho.
Multiplayer Server Offline. Copy ony testing rig semi-funcitonal.
User Signup Offline.
Server Health Shows old data from last snapshot before the server downed.

If you have any issues you can usually find me in #vegastrike on freenode.
ezee
Intrepid Venturer
Intrepid Venturer
Posts: 703
Joined: Tue Feb 11, 2014 12:47 am
Location: FRANCE
Contact:

Re: Vegaserver enhancements

Post by ezee »

Ah , ok .
I know how menu are done in c++ .
I know they were wrapped to python too .

As exemple , the python code for the last Menu you showed , with the Bounty option :
items=['width', 1.0,
'text', 'Public Computer Menu',
'space', 0., .1,
'button', 'Test',
'button', 'View Score',
'button', 'Bounty Hunt',
'button', 'Exit Menu']
id = dialog_box.dialog(items,callback)
It's only a piece of code , a structure as you asked for .
The file that contains this code is :
https://sourceforge.net/p/vegastrike/co ... omputer.py

You will learn a lot with that file :
if VS.isserver():
import server
logged_in_users=server.getDirector().getCallsignList()
logged_in_users.append('OR, Type in a user:')
items+=['text','Select a player in this system:',
'list','logged_in_users',len(logged_in_users)]+logged_in_users
items+=['row',
'textwidth','Other Player:',0.3,
'textinput','callsign','',
'endrow']
else:
items+=['list','logged_in_users',15,'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o']
items += dialog_box.button_row(1.5,'OK','Cancel')
id = dialog_box.dialog(items,callback)
And if you want to look on the main-menu builder , look at :
https://sourceforge.net/p/vegastrike/co ... in_menu.py

Where you will find members of menu structures and their mapping :
Example with # Button to go back to the main menu (from the credits)
sprite_loc = GUI.GUIRect(8,697,420,47,"pixel",(1024,768))
GUI.GUIRoomButton (credits_guiroom, guiroom, 'XXXMain Menu','Main_Menu',None,sprite_loc,clickHandler=enterMainMenu)
You can try to tweak the existing menu by this way .
It's on your data/bases folder .
:wink:

Code: Select all

 if (!track.HasWeapons())
            {
                // So what are you going to threaten me with? Exhaustion gas?
                return ThreatLevel::None;
            }
Vegastrike evolved
DEV YOUTUBE CHANNEL
Vegastrike evolved wiki
Eye~R
Hunter
Hunter
Posts: 70
Joined: Sun Jan 19, 2014 5:02 am

Re: Vegaserver enhancements

Post by Eye~R »

Yeah.... I need to get that switched over from file -> database. Got a better idea about that that siwtching to database, fabricating a user, Then trying to work out how to populate existing users?

Heh, ty for links - I was meaning more something like the UML map, I'm not looking forwards to building it from scratch.

Co-incidently, from that "bounty menu" python..

Code: Select all

 def callback(dialog,result):
print('id is: ',id)
action,inputs = dialog_box.fromValues(result)
if action=='Test':
print('test clicked!!!!')
if action=='Bounty Hunt':
print('hunting bounty')
runBountyMenu(cp)
if action=='OK' or action=="Exit Menu" or action=="Cancel":
dialog.undraw()
custom.respond(['close'],None,id)
return False
return True 
In actual use I'm sure it doesn't dispaly "Test Clicked" - If it does it's happening somehwere I'm not looking. It appears to accept the bounty, I've been unable to test it's functionality tho.
Multiplayer Server Offline. Copy ony testing rig semi-funcitonal.
User Signup Offline.
Server Health Shows old data from last snapshot before the server downed.

If you have any issues you can usually find me in #vegastrike on freenode.
ezee
Intrepid Venturer
Intrepid Venturer
Posts: 703
Joined: Tue Feb 11, 2014 12:47 am
Location: FRANCE
Contact:

Re: Vegaserver enhancements

Post by ezee »

Yeah , you said that above , only the " Bounty " reacts ...
Your analyse and test are useful for debugging that menu .
It's more easy for me to understand c++ code , but i think i could try to make "test" reacts ,
and use it for our own tests ( with database ? :wink: )

Code: Select all

 if (!track.HasWeapons())
            {
                // So what are you going to threaten me with? Exhaustion gas?
                return ThreatLevel::None;
            }
Vegastrike evolved
DEV YOUTUBE CHANNEL
Vegastrike evolved wiki
ezee
Intrepid Venturer
Intrepid Venturer
Posts: 703
Joined: Tue Feb 11, 2014 12:47 am
Location: FRANCE
Contact:

Re: Vegaserver enhancements

Post by ezee »

:idea: I think i got it ( about the test )

The fonction that is mapped to the test button :
(in data/modules/computer.py )
def callback(dialog,result):
print 'id is: ',id
action,inputs = dialog_box.fromValues(result)
if action=='Test':
print 'test clicked!!!!'

if action=='Bounty Hunt':
print 'hunting bounty'
runBountyMenu(cp)
if action=='OK' or action=="Exit Menu" or action=="Cancel":
dialog.undraw()
custom.respond(['close'],None,id)
return False
return True
Easy : if action=='Test': print in stdout (or stderr ?) test clicked!!!!
edit : can you verify that please :?:

Now compare with the Bounty button :
if action=='Bounty Hunt':
print 'hunting bounty'
runBountyMenu(cp)
Not only a message in the stdout , but also a call to runBountyMenu(cp)
As experience , add this line to the test block :
( data/modules/computer.py :wink: )
if action=='Test':
print 'test clicked!!!!
runBountyMenu(cp)
You should have the Bounty's menu appear .
And we know now where to map a function to a button in this menu !
8)

Code: Select all

 if (!track.HasWeapons())
            {
                // So what are you going to threaten me with? Exhaustion gas?
                return ThreatLevel::None;
            }
Vegastrike evolved
DEV YOUTUBE CHANNEL
Vegastrike evolved wiki
Eye~R
Hunter
Hunter
Posts: 70
Joined: Sun Jan 19, 2014 5:02 am

Re: Vegaserver enhancements

Post by Eye~R »

Heh, didn't consider it'd output there - was expected "in session". Yeah, it outputs stdout(I think, cld be err - or both)
Multiplayer Server Offline. Copy ony testing rig semi-funcitonal.
User Signup Offline.
Server Health Shows old data from last snapshot before the server downed.

If you have any issues you can usually find me in #vegastrike on freenode.
ezee
Intrepid Venturer
Intrepid Venturer
Posts: 703
Joined: Tue Feb 11, 2014 12:47 am
Location: FRANCE
Contact:

Re: Vegaserver enhancements

Post by ezee »

Nice .

I think we could try to use SQlite3 to deal with database management of users etc ...
It is a python module , uses files to store his data but can dump his bases/tables in .sql format .
Can use images and metadata too .

A tutorial here :
http://zetcode.com/db/sqlitepythontutorial/

Code: Select all

 if (!track.HasWeapons())
            {
                // So what are you going to threaten me with? Exhaustion gas?
                return ThreatLevel::None;
            }
Vegastrike evolved
DEV YOUTUBE CHANNEL
Vegastrike evolved wiki
jackS
Minister of Information
Minister of Information
Posts: 1895
Joined: Fri Jan 31, 2003 9:40 pm
Location: The land of tenure (and diaper changes)

Re: Vegaserver enhancements

Post by jackS »

klauss wrote:
The multiplayer part has no maintainer though. That's a big problem. A while ago, ace123 maintained it. But now he's not so very active, and we're out of maintainers. And it really needs a maintainer ;)
Given that he was, last I checked, still working for a startup with ~20 people, I don't think he's likely to become active again any time soon :)
Eye~R
Hunter
Hunter
Posts: 70
Joined: Sun Jan 19, 2014 5:02 am

Re: Vegaserver enhancements

Post by Eye~R »

ezee wrote:I think we could try to use SQlite3 to deal with database management of users
Installed. Would accessing it directly mean it's unable to be accessed by something like PostgreSQL? would further require (IMHO) interaction from web - Allowing users to adjust facets of their profile w/o being in game.
ezee wrote:I started to play with pyglet , and i have good results under windows .
For your project

, that could be a good laboratory :
Added Pygelt. If you're after a testbed, I might be able to provide one, I have another server that should be up-to par (Tho it's running CentOS, I had hell trying to compile VS in that(dependancy issues)I couldn't see why the server component req'd GUI elements(I do now)). I had someone helping me with this, I gave up on current and just used 'buntu 'cause it's in their repos, But he's vanished of recent. But back to my point, That server is currently unable to provide for the functionality of which I'm renting it, so before I get a refund, can get more use outta it...
ezee wrote:Vegastrike is an original concept , and your menu system is original too . ( i like the idea of the cube )
I could only wish. The "cube thing" is what happens when I rotate between workspaces(Consider it like several monitor, but only one physical display), it's a fairly common affair in linux. Vegastrike.. Kinda concept leeches of the likes of Elite(Which is actually why I like it, I wanted a "21'st century Elite")

ezee wrote:We need to use a new set of fonts for Vegastrike also .

Um, what's wrong with the existing? how does this occur? by which I mean is the font pulled from the local users system(like .css) or is it supplied by the server? Need a "unique" one? I sense I tap "font" into google, I'm getting too much back....

Back to the "menu thing"... I threw the .py into Umbrello, expecting it to graph it for me, it came back with:
Image
From the code, I was expecting something more alike:
Image
I've learned enough of umbrello to manually do:
Image
I'll soon have the existing structure graphed, then can see about remodelling to fit new requirements...
Multiplayer Server Offline. Copy ony testing rig semi-funcitonal.
User Signup Offline.
Server Health Shows old data from last snapshot before the server downed.

If you have any issues you can usually find me in #vegastrike on freenode.
TBeholder
Elite Venturer
Elite Venturer
Posts: 753
Joined: Sat Apr 15, 2006 2:40 am
Location: chthonic safety

Re: Vegaserver enhancements

Post by TBeholder »

Eye~R wrote:The "cube thing" is what happens when I rotate between workspaces(Consider it like several monitor, but only one physical display), it's a fairly common affair in linux. Vegastrike.. Kinda concept leeches of the likes of Elite(Which is actually why I like it, I wanted a "21'st century Elite")
IMO it's an absolutely pointless "bells&whistles" widget function, but ability to do it in generic way would be quite valuable in itself - that is, to display things with pseudo-3D angle/perspective on Python interface level, rather than having bells & whistles hardcoded.
Eye~R wrote: Um, what's wrong with the existing? how does this occur? by which I mean is the font pulled from the local users system(like .css) or is it supplied by the server? Need a "unique" one?
Reference to local system by definition makes things non-uniform - not that it's bad, but for fallback and debug purpose could as well supply some common free font, mainly for windoze and tarball versions (packages would refer to external font package anyway).
Eye~R wrote:I've learned enough of umbrello to manually do:
Image
I'll soon have the existing structure graphed, then can see about remodelling to fit new requirements...
That main menu uses baseinterface is good, but... The main "to-do" here is having only one interface necessary for all in-flight and base functonality (which would remove inconveniences like no ship stats in flight and no nav screen on base). That is, moving the rest of features like nav map from special case pop-up with special binding to common base interface, so that the binding only activates the special room (which could later have code to handle unit-sensitive choice on its own, and thus client-side in multiplayer), without stopping simulation (or better with a special confvar equivalent to simulate_while_docked for optional convenience) in single-player mode.
Then there would be only two special rooms (Intro and Menu) and arbitrary variety of ship/base rooms.
"Two Eyes Good, Eleven Eyes Better." -Michele Carter
ezee
Intrepid Venturer
Intrepid Venturer
Posts: 703
Joined: Tue Feb 11, 2014 12:47 am
Location: FRANCE
Contact:

Re: Vegaserver enhancements

Post by ezee »

About the Fonts :

I'm talking about the fonts that VS engine uses :
//Font object.
44 //Right now, this only supports the GLUT outline font.
45 //We try to choose the best options for a given Font size. May or may not do
46 //antialiasing. The line width goes up as the font size goes up. You can
47 //add extra line width to make a bolder look, or use negative line width to give it
48 //a lighter look. http://spacetechs.free.fr/VEGASTRIKEDEV ... ource.html
Alternatives : http://www.opengl.org/archives/resource ... /fonts.htm

For SQLite3 <=> postgresql etc... , i don't know now .


But php can use SQLite3 also :
http://www.php.net/manual/fr/book.sqlite3.php

I need to do more investigation , and know more about your host server specs .
The only experience i have in that domain is my experimentations in my Apache local server , with drupal .
And some PHP scripting , but very basic .

So someone that has a solid knowledge with php , python , and general web protocols is needed in this MMo VS project's team.
EDIT : WWW2 is the guy we need i think :
Ace123 said :
Added masterserver thanks to www.
https://sourceforge.net/p/vegastrike/code/12545/
Perhaps your future best 8) friend :
http://forums.vega-strike.org/viewtopic.php?f=8&t=14886


I am okay to experiment with you some ideas in your 2nd server .
:wink:

edit : forgot to say " nice work ! " with umbrello .
:D

I'm going to explore the c++ server code to understand how to upgrade the player struct
to hold 2d picture ( avatar ) for example . see ya .

REEDIT :
:idea: Hey , there is a lot of things i have ignored until now .
I was only looking to vsserver , but there is much more .
A pretty cool thing for our project is here ( in php , so SQlite3 could be used:
https://sourceforge.net/p/vegastrike/co ... er/api.txt

Code: Select all

server.php
---------------------------
Start Broadcast server 
---------------------------

server -> masterserver
methode	post request with the get comand ?type=new


string  name		name of the server
string	maxplayers	max numbers of players that the server can handel
bool	password	set to true if the server heft password protecion
string	port		the tcp port that the server use in multiplay.
string	mod		This gift with mod are in user


--------------
Server resopnts
--------------
masterserver -> server 

name		The name that the server gift the the masterserver
sesion_id	A random string use as a session token
timeoute	This is the time that a server min one's connect to the master
		server. 
XML formate:
<NewServer>
   <name>[servername]</name>
   <sesion_id>[sesion id]</sesion_id>
   <timeoute>[server timeoute]</timeout>
</NewServer>

---------------------------
Update server stats
---------------------------
server -> masterserver
methode	post request with the get comand ?type=update

string	name		The name of the server.
string	sesion_id	The sesion id that server get form the mester server.
string	current_players	Current number of players that are on the server.

--------------
Server resopnts
--------------
masterserver -> server 


<ServerUpdate>
	<succes/>
</ServerUpdate>

--------------
Master server errors
--------------
masterserver -> server
methode http respons with a xml payload


Errors:
		TIMEOUT		The server is to late with his responds.
XML formate

<error>
 <errorcode>[errorcode]</errorcode>
<error>
--------------------------------------------------------------------------------
Client.php

----------------------
get serverlist
----------------------
This is a simpel http GET requst form the server to the client.
The requst use a filter comad like: "?mod=<mod>"
And your get a out put like this.

<ServerList>
  <server>
    <name>server 1</name>
    <ipadress>138.159.66.24:8932</ipadress>
    <password>false</password>
    <MaxPlayers>30</MaxPlayers>
    <CurrentPlayers>20<CurrentPlayers>
    <mod>VS</mod>
  </server>
  <server>
    <name>server 2</name>
    <ipadress>13.59.6.4:8977</ipadress>
    <password>false</password>
    <MaxPlayers>30</MaxPlayers>
    <CurrentPlayers>20<CurrentPlayers>
    <mod>SW</mod>
  </server>
  <server>
    <name>server 3</name>
    <ipadress>138.159.66.24:9598</ipadress>
    <password>true</password>
    <MaxPlayers>10</MaxPlayers>
    <CurrentPlayers>9<CurrentPlayers>
    <mod>VT</mod>
  </server>
  ...
  <server>
    <name>server n</name>
    <ipadress>21.58.6.99:4522</ipadress>
    <password>false</password>
    <MaxPlayers>30</MaxPlayers>
    <CurrentPlayers>20<CurrentPlayers>
    <mod>WCU</mod>
  </server>
</ServerList>

name	 	The name of the server
ipadress	The ipadress and the tcp port of the server.
password	Set to true if the server is password protect else set to false.
MaxPlayers	The max number of players that the server can handel.
CurrentPlayers	The number of players that are current on the server.
Are you already using this server.php file ? :
https://sourceforge.net/p/vegastrike/co ... server.php

I definitivly want to try that solution in my apache environment , i'll checkout tonight :
https://sourceforge.net/p/vegastrike/co ... terserver/

Cool ... :wink:
edit : In fact , it's a broadcast system for vs servers .
That is not what i'm looking for .
So i'm back to c++ with VsAcctserver this time :
https://sourceforge.net/p/vegastrike/co ... etworking/
I guess here are the stuffs we will use ...
Like that :
#ifndef __ACCTSERVER_H
#define __ACCTSERVER_H

#define NO_UNIT_STUFF
#include <vector>

#include "configxml.h"
#include "networking/accountsxml.h"
#include "networking/lowlevel/packet.h"
#include "networking/lowlevel/netui.h"
#include "networking/lowlevel/vsnet_socketset.h"

typedef vector< Account* >::iterator VI;

/** Class that manages player accounts
* - Receives authentication request packets
* - Returns a packet with LOGIN_ACCEPT or LOGIN_ERROR and with player name
*/

/**
* This class should also :
* - manage accounts info (ships descriptions...)
* - handle future web subscriptions
*/


class AccountServer
{
SocketSet _sock_set;

NetUITCP NetworkToClient;
ServerSocket *Network;
//TCPNetUI * Network; // Network Interface
list< SOCKETALT >Socks; //List of active sockets on which we can receive requests
list< SOCKETALT >DeadSocks; //List of sockets to close

int newaccounts;
int keeprun;
//SOCKETALT conn_sock;
Packet packet;

double savetime;
double curtime;

public: AccountServer();
~AccountServer();

void startMsg();
void start(); //Starts the server
void save(); //Saves new accounts if there are
void recvMsg( SOCKETALT sock ); //Receive message
void sendAuthorized( SOCKETALT sock, Account *acct ); //Send authorization and related data
void sendUnauthorized( SOCKETALT sock, Account *acct ); //Send unauthorizated connection
void sendAlreadyConnected( SOCKETALT sock, Account *acct );
void sendServerData( SOCKETALT sock, Account *acct );

void writeSave( const char *buffer, unsigned int bufferlen );
void removeDeadSockets();
};

#endif
:wink:

I NEED TO KNOW :
Do you actually use "Data\cgi-accountserver" to run your server ?
The script say :
# This file is not executable for safety if these files are placed in a real cgi-bin directory.
But where should they be placed in a remote server ?
:roll:
Ok , i have run the server on my EasyPhp environment , registered as user , and get
the msg :
To play, start up the game, click on 'Multiplayer', type in your login and password, and then click 'Join Game'
I understand that the remote server must be able to run python , and that'a all .
The cgi-deals are fakes ?
nah... found answers here : http://python.about.com/od/cgiformswith ... st_cgi.htm
Starting HTTP server on port 8080...
/cgi-bin/register_submit.py
127.0.0.1 - - [17/Apr/2014 21:44:35] "POST /cgi-bin/register_submit.py HTTP/1.1" 200 -

Code: Select all

 if (!track.HasWeapons())
            {
                // So what are you going to threaten me with? Exhaustion gas?
                return ThreatLevel::None;
            }
Vegastrike evolved
DEV YOUTUBE CHANNEL
Vegastrike evolved wiki
ezee
Intrepid Venturer
Intrepid Venturer
Posts: 703
Joined: Tue Feb 11, 2014 12:47 am
Location: FRANCE
Contact:

Re: Vegaserver enhancements

Post by ezee »

back to your main/initial wish :
* Desperately needs additional functionality to provide basic admin functions, ie:
- White/blacklist maintainence (Currently, I don't think provided, in any capacity)
- Basic server manipulation / control (Ideally prequisites hierachial structure to users, Don't need everyone with admin...)
- Some sort of MOTD like functionaly would be good
I've found the critical part of c++ that concern the user login .
Very instructive , we can see how messaging is done between server and acctserver for exemple .
It's located in netserver.cpp line 683 :
case CMD_LOGIN:
if (!clt) break;
COUT<<">>> LOGIN REQUEST --------------------------------------"<<endl;
//Authenticate client
//Need to give the IP address of incoming message in UDP mode to store it
//in the Client struct
if (!acctserver) {
this->localLogin( clt, packet ); //NETFIXME--right now assume acctserver
} else if (!acct_con) {
this->sendLoginUnavailable( clt );
} else {
SOCKETALT tmpsock;
const AddressIP *iptmp;
WaitListEntry entry;
NetBuffer netbuf( packet.getData(), packet.getDataLength() );
std::string user = netbuf.getString();
std::string passwd = netbuf.getString();
//This must be a TCP client
entry.tcp = true;
entry.type = WaitListEntry::CONNECTING;
entry.t = clt;
if ( user.empty() ) {
sendLoginError( clt );
break;
}
if (clt->loginstate != Client::CONNECTED)
break;
if ( waitList.find( user ) != waitList.end() ) {
sendLoginAlready( clt );
break;
}
iptmp = &clt->cltadr;
tmpsock = clt->tcp_sock;

//Redirect the login request packet to account server
COUT<<"Redirecting login request to account server on socket "<<*acct_sock<<endl
<<"*** Packet to copy length : "<<packet.getDataLength()<<endl;
char redirectcommand[2] = {ACCT_LOGIN, '\0'};
std::string redirect( redirectcommand );
for (unsigned int i = 0; i < _Universe->numPlayers(); i++) {
Cockpit *cp = _Universe->AccessCockpit( i );
if (cp->savegame && cp->savegame->GetCallsign() == user) {
COUT<<"Cannot login player "<<user<<": already exists on this server!";
sendLoginAlready( clt );
user = "";
}
}
if ( !user.empty() ) {
addSimpleString( redirect, user );
addSimpleString( redirect, passwd );
if ( !acct_sock->sendstr( redirect ) ) {
//NETFIXME is this in http format or binary format
perror( "FATAL ERROR sending redirected login request to ACCOUNT SERVER : " );
COUT<<"SOCKET was : "<<acct_sock<<endl;
this->sendLoginUnavailable( clt );
break;
}
this->waitList[user] = (entry);
clt->loginstate = Client::WAITLISTED;

getSimpleChar( redirect );
clt->callsign = getSimpleString( redirect );
clt->passwd = getSimpleString( redirect );
}
}
COUT<<"<<< LOGIN REQUEST --------------------------------------"<<endl;
break;
followed by :
case CMD_ADDCLIENT: //Add the client to the game
COUT<<">>> ADD REQUEST =( serial #"<<packet.getSerial()<<" )= --------------------------------------"<<endl;
//COUT<<"Received ADDCLIENT request"<<endl;
this->addClient( clt );
COUT<<"<<< ADD REQUEST --------------------------------------------------------------"<<endl;
break;
In this addClient() func , possibly room to send the MessageOfTheDay .

Code: Select all

 if (!track.HasWeapons())
            {
                // So what are you going to threaten me with? Exhaustion gas?
                return ThreatLevel::None;
            }
Vegastrike evolved
DEV YOUTUBE CHANNEL
Vegastrike evolved wiki
Eye~R
Hunter
Hunter
Posts: 70
Joined: Sun Jan 19, 2014 5:02 am

Re: Vegaserver enhancements

Post by Eye~R »

ezee wrote:I NEED TO KNOW :
Do you actually use "Data\cgi-accountserver" to run your server ?
The script say :

# This file is not executable for safety if these files are placed in a real cgi-bin directory.



But where should they be placed in a remote server ?
:roll:
Heh - Isn't it great.

I'm using the cgi-accountserver, But I've had to add this myself, it didn't come with the package in ubuntu's repos and I couldn't seem to locate it within the sourceforge, I've a copy kicking around from trying to compile the stand-alone game on CentOS and dropped that in place, kinda works. As for more where it hides, It's in /usr/share/games/vegastrike/cgi-accountserver/ and the .py HTTP server(run as it's own user with no privlidges beyond the directory for users) takes care of the cgi-bin fabrication somehow within it's own magic. The actual accountserver itself I don't really mind being in python, as that has no real need to be directly interfaced by the user - but the python HTTP server is a risk, it doesn't stand up to assault at all. it's somehow been used to fabricate a ½GB index.html in /var/www/html/....
ezee wrote:Perhaps your future best 8) friend :
viewtopic.php?f=8&t=14886
Um, yeah. I can offer hosting, if you'll front the cost of the domain, the infrastructure to back up email services(can has a domain for free, but it'll be of my "armed.me.uk" - Mail is already taken, as is Vegastrike) and as with all of my services, it's a gift. There are no adverts, as I'm not trying to make money. This also means I won't be collecting or underselling your data (It's priceless, the more people realise this the better - Stop giving it away).
(18:35:12) EyeR(Freenode): is you the same "www2" from the forums?
(18:35:47) www2: yes
(18:37:43) EyeR(Freenode): Concerning yur post re: Account Server-NG -=- How far did you get with that?
(19:56:41) www2 [~www2@53567E26.cm-6-7b.dynamic.ziggo.nl] entered the room.
Or maybe not, But it's only been a month and ten days awaiting a reply, who knows?.

So the Server/MasterServer thing a dead end?
ezee wrote:I understand that the remote server must be able to run python , and that'a all .
Heh unfortunately, it seems to have the same prequisites as vegastrike itself,
[root@Iris ~]# vegaserver
vegaserver: /lib64/libm.so.6: version `GLIBC_2.15' not found (required by vegaserver)
vegaserver: /usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.15' not found (required by vegaserver)
vegaserver: /lib64/libc.so.6: version `GLIBC_2.15' not found (required by vegaserver)
vegaserver: /lib64/libc.so.6: version `GLIBC_2.14' not found (required by vegaserver)
vegaserver: /usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.15' not found (required by /usr/lib64/libboost_python.so.1.50.0)
vegaserver: /lib64/libc.so.6: version `GLIBC_2.14' not found (required by /usr/lib64/libpng15.so.15)
vegaserver: /lib64/libc.so.6: version `GLIBC_2.14' not found (required by /usr/lib64/libopenal.so.1)
vegaserver: /lib64/libc.so.6: version `GLIBC_2.14' not found (required by /usr/lib64/libpython2.7.so.1.0)
libstdc++6 is present, as is Glibc 2.14 and 2.15 - in x64 and x86 but it still throws errors, Still never got that going...
ezee wrote:
In this addClient() func , possibly room to send the MessageOfTheDay .
Great. When the client 1'st connects it spams some text, I was hoping to be able to replace that. More important IMHO is some sort of heiarchial structure for the users
From the code:

Code: Select all

f (cp->savegame && cp->savegame->GetCallsign() == user) {
COUT<<"Cannot login player "<<user<<": already exists on this server!";
sendLoginAlready( clt );
When logging in as an already existing user, the message relayed to the user (or retained in the logs) doesn't clearly indicate that this is that issue. (I've managed to crash the local instance and the server hasn't realised the disconneciton - took a while to work that one out)
Multiplayer Server Offline. Copy ony testing rig semi-funcitonal.
User Signup Offline.
Server Health Shows old data from last snapshot before the server downed.

If you have any issues you can usually find me in #vegastrike on freenode.
ezee
Intrepid Venturer
Intrepid Venturer
Posts: 703
Joined: Tue Feb 11, 2014 12:47 am
Location: FRANCE
Contact:

Re: Vegaserver enhancements

Post by ezee »

Okay .
So what are you first objectives now ?

I want to be able to connect to your server , and help buddies to do the same .
Then work on my local apache system with python menus for example ?
And update the clients could consist on download new python modules ( kind of client_menu.py )+ data/Textures
( for the visual interface )

Can you draw me the kind of hierarchy you have in mind for the users ?
I will then translate that in code .

I also know that we must create the SQL database , and the tables .
What i don't know yet is what the program do when we set " create_user " to true .
I will trace that.
edit : :!: trace :
def check_password(self, username, password, can_create=False):
username=username.replace(' ','_')
c = self.conn.cursor() #self.dict_cursor
c.execute('SELECT user_id, user_password FROM ' +
self.user_table + ' WHERE username=%s',
(username,) )
result = c.fetchone()
if result and result[0]:
return self.compare_password(result[1], password)
else:
if self.create_user and can_create:
maxquery = self.conn.cursor()
maxquery.execute('SELECT MAX(user_id) FROM ' + self.user_table)
answer_row = maxquery.fetchone()
user_id = answer_row[0]+1
c = self.conn.cursor()
c.execute('INSERT INTO '+self.user_table +
' (username, user_id, user_password) VALUES ' +
' (%s, '+str(int(user_id))+', %s)',
(username, self.hash_password(password))
)
return True
That confirm the fact that the 'user_table': 'phpbb_users' was designed as read only
by default ( users used their forum's ID ) , but can be set to write also .
So to add a user , we must set :
mysql_dbconfig = {
'type': 'mysql',
'host': '127.0.0.1', #'mysql4-v.sourceforge.net'
'port': '3306',
'passwd': '',
'user': 'user_admin',
'db': 'vegastrike',
'user_table': 'phpbb_users',
'account_table': 'accounts',
'create_user':True,
}
About the fields for the tables , they seem to be :

_1 user_table

FIELDS:
username = string
user_id int
user_password= string

_2 account_table

FIELDS:
username = string
modname = string
csv = string
savegame = string
logged_in_server = boolean
Last edited by ezee on Tue Apr 22, 2014 2:03 am, edited 5 times in total.

Code: Select all

 if (!track.HasWeapons())
            {
                // So what are you going to threaten me with? Exhaustion gas?
                return ThreatLevel::None;
            }
Vegastrike evolved
DEV YOUTUBE CHANNEL
Vegastrike evolved wiki
ezee
Intrepid Venturer
Intrepid Venturer
Posts: 703
Joined: Tue Feb 11, 2014 12:47 am
Location: FRANCE
Contact:

Re: Vegaserver enhancements

Post by ezee »

So i'm doing the reverse engineering on the db.py module to find out the fields that we must
create for the tables .

I will edit that post 'til i have the complete information .

_1 user_table
c.execute('INSERT INTO '+self.user_table +
' (username, user_id, user_password) VALUES ' +
' (%s, '+str(int(user_id))+', %s)',
(username, self.hash_password(password)) )

FIELDS:
username = string
user_id int
user_password= string

_2 account_table
c.execute('INSERT INTO '+self.account_table +
' (username, modname, csv, savegame, logged_in_server)'+
' VALUES (%s, %s, %s, %s, 0)',
FIELDS:
username = string
modname = string
csv = string
savegame = string
logged_in_server = boolean
Last edited by ezee on Tue Apr 22, 2014 2:03 am, edited 1 time in total.

Code: Select all

 if (!track.HasWeapons())
            {
                // So what are you going to threaten me with? Exhaustion gas?
                return ThreatLevel::None;
            }
Vegastrike evolved
DEV YOUTUBE CHANNEL
Vegastrike evolved wiki
Post Reply