PlaneShift
Development => Development Deliberation => Topic started by: lemongrove on January 09, 2008, 11:32:51 pm
-
Hi,
I have some skills at Java programming & web development. If this is any use?
I did think about offering to help with the coding, but my C++ is really poor, and I don't know much about OpenGL.
thanks
Paul
-
Yes. I am sure we would have a use for some Java application programmer. Right now we are missing a fair number of tools and was considering Java as a platform to develop those tools on.
-
Fine, tools are no problem. Let me know the requirements spec. And I can get right onto it.
Best regards Paul
-
Thought I better add, I terms of interacting with C code. In the past I've done this by connecting to ports etc, I'm good network wise, and file wise for getting data into Java tools. But I'm not too good with JNI native interfaces into C. You'll have to take care of this bit, should you need it.
-
Do you know if Java ( or applets ) have any capability to connect to a mysql database?
-
http://dev.mysql.com/usingmysql/java/ <--- looks it maybe...
-
Yes sure, I can connect to any database that you have a JDBC driver for. I have much experience doing this. Its easy to do, MySQL comes with a JDBC driver.
*edit*
Though as for Java applets, let me know what you have in mind. I have some Swing (GUI) experience which is okay for running desktop tool stuff (its stable). I have a lot of experience running up browser interfaces using DHTML run up by Servlets. Its easy to install on your server as well. But if you want to run a Swing GUI inside a browser, this used to be a bit buggy about 5 years ago last time I tried anything complicated with it. About the time of Java 4.0 I think it was. I don't have any experience of the new native Widget GUI stuff, but I'm not sure if thats properly portable yet.
Best regards Paul
-
It seems to me that a client application will be better suited at least initially. Right now we have many database tables and trying to enter data in them is not always easy and can be prone to mistakes because of all the keys into different tables. Initially I'd like to be able to present a nice interface to these tables. I will have to take a look and see what Crystal Space supports in terms of Java as well. But I could see this application expanding out to where we can load character models for NPC's and customize them.
Right now, just having a nice tool to be able to update tables with new items easily would be a great help :)
-
Do you have a schema I can see? Are you aware of 'Navicat' its a great interface into MySQL? I use this in my business work. I does all kind of useful things. Upload spreadsheets and do all kinds of things that PHP MyAdmin sometimes had problems with.
1. You want this interface to be used on local PCs only by approved folks with security clearance for remote MySQL access onto the server to edit characters on the server?
2. Or to access characters on a local client machine stored on locally on a PC with MySQL running locally?
3. How is character data currently stored schema wise?
4. Will this be a text only interface for editing and type checking character attributes?
Best regards
PR
-
you might want to take a look here http://planeshift.svn.sourceforge.net/viewvc/planeshift/trunk/src/server/database/mysql/
-
1. yes
3. the svn data can answer that simply. http://xrl.us/pssvnguide
4. managing the database and all that that entails... if you can figure out how manage sc_pathpoint generally you win bonus point
the svn has copy of the exsisting wc there as well.
-
I had a scan
http://planeshift.svn.sourceforge.net/viewvc/*checkout*/planeshift/stable/data/races/quickpaths.xml?revision=23&content-type=text%2Fplain
SVN is some kind of repository? I only ever used Sourcesafe. In reality I've never used SVN?
Do I read you want me to try to compile the a server locally to get access to the tables locally? I'm confused how you are writing the SQL queries? By hand?
Best regs
PR
-
Your best bet to start is to take a look at:
http://planeshift.svn.sourceforge.net/viewvc/planeshift/www/webconsole/
This is our 'web console' written in PHP that attempts to provide some tools to access the database in a meaningful way. Basically it's hiding the schema of the database so that the rest of the team can add the content to the game. Right now its very poorly done and the settings team is always having issues with it.
It is a bit of a mess but it's something to start on. I can take some screen shots and give you an idea of what it is.
-
the initial inserts for the most part, yes. after the the webclient, or wc, builds them. /www is the current webclient. it is a php based site. that builds up the queries.
no you don't have to build the server. mostly you just have to pay attention to the sql directory in server. you will be able to setup the sql portion easily... skip the compile portions of the walkthrough and just pay attention on how to setup the sql portion. it will give you an idea of what you will have to hook into.
yes it is a code reposioty. pretty simple to use. i can an i crash compilers on hello world code, as the joke goes.
-
lemongrove: You'll also want to check out this thread (http://hydlaa.com/smf/index.php?topic=29466.0) to give you a better idea of what is needed in this "web console" project, and maybe even the PlaneShift build channel on irc://irc.freenode.net/#planeshift-build as well. I have both psserver and webconsole up and running on localhost and have somewhat interest in what acraig needs as well.
SVN is some kind of repository? I only ever used Sourcesafe. In reality I've never used SVN?
SVN is a repository; SourceForge did away with CVS.
-
A point that made me smile :)
"This is comparible to writing something like phpMyAdmin or a similar MySQL type of interface?"
To Clarify Steuben's point - the Webclient formulates SQL queries for you currently, and adds revision information into the SVN? The Webclient directly alters the tables or you upload the SQL queries manually into MySQL?
The webconsole then seems to be many things? A GM tool, a character editing software for NPCs, a quest configuration tool. In fact a wrapper for all that is linked to the Database game wise? Its a tall order, and would need to be cut into pieces that could be worked on, by a head developer on PS.
I'm a Newb with capital 'N' @ PHP. But it looks like a Servlet-esque server side scripting language. I can figure out whats going on I guess.
I have started writing and re-writing this response * 10. I scanned through 'Aerig' docs. Though a login @ browse only or screenshots would help.
1. Taking ACraigs earlier point - Do you want the webconcole re-written in-whole or in-part with a client-side Java GUI? *EDIT* I notice as I scan the PHP. That PHP uses specific commands to interact with MySQL, so it may offer limited 'lifting' of queries.
2. Or do you want a re-write of the PHP code in Serverside Java. I don't know about the limitations of PHP vrs Servlets.
I need to know if you a proposing a re-write of the PHP existing console or a new Client side tool?
I worked on a help-desk solution some years ago that attempted to replicate a large Java GUI for 'emergency' work by employees when at home. The content was all Scripted in --Java Servlets and JSP server side-- and piped back in HTML, with the usual splattering of Javascript on the client side. it got really complicated and the s/house eventually gave it up for lost. But I can see the advantages that non-tech. users can just login and forget about trying to compile are install any programs to adjust in-game settings. I have experience at this. Problems were always HTML layout making the HTML experience feel like a GUI. IMO HTML=HTML dont try.
I'll carry on looking over this material as free-time permits.
Best regards
PR
-
the live wc is independant of the svn. it hooks straight into the db. so any changes made to the db a server restart away. very little of the server data is in the svn.
yes the wc is many things excepting a gm tool. they don't have access. but if you look at the wc, and compare it to the actual data base there is a lot that is not touched by it.... >.> <.< http://viscosa.dyndns.org/serverconsole/index.php login of vengeance and password keith will give you an idea of what we have already.
it isn't as tall an order as it seems, just broad. that it looks like java can hook into a sql db the php won't be required.
don't get any grand ideas yet. the wc is basically just a better interface for the db.
-
I need to know if you a proposing a re-write of the PHP existing console or a new Client side tool?
There is only one major issue with a client side tool, the password and user name for direct access to the server database would then be sent to any one that has access and possibly they could get that out of the source. This leaves many loop holes that I dont think the dev team is willing to allow. Right now very few devs have that info and use the server side console for access to the database.
-
Many thanks Steuben. That helped to see. Yes, in Java, you hook up to the driver, and normally use standard SQL syntax. Though my experience is that complex queries don't always work. Simple non-compound queries seem always to. But sometimes I have found complex queries are only possible if run as a set of simple queries one after the other. Depends on the JDBC driver. Has an advantage that once we need to run a Super-clustered 10 server database we are tied only by which DBs have a good JDBC driver.
I think you can easily limit people from accessing the database from within the MySQL admin console by machine network address, passwords aside. Though I know that will only be useful if everyones on static IPs!
1. What I can't understand is this - If you are worried about people changing DB data, why does it matter if they are doing it from within a Client side web app, or from a client side GUI? Its the same thing?
2. So the new Web console would need to write Control Version Changes into the SVN? Or just into some internal log?
3. How does change control work here is the SVN not allowing 2 users concurrent changing of database data?
4. Normally in the past I have just accessed the DB directly and made the changes requested. Rather than trying to second-guess the way its working currently can you fill me in please?
5. Changes come after server restart? I'm guessing you are writing to a 'Test' database initially. On my server that I work with currently, MySQL stuff once changed goes in immediately.
Many thanks
PR
-
1. What I can't understand is this - If you are worried about people changing DB data, why does it matter if they are doing it from within a Client side web app, or from a client side GUI? Its the same thing?
Not all devs have the same access to the current app as i understand, not all devs have the same need to edit the database
2. So the new Web console would need to write Control Version Changes into the SVN? Or just into some internal log?
the current console has no such thing and i dont think it would be good for us considering the small amount of space there is for Planeshift to use on the host server
4. Normally in the past I have just accessed the DB directly and made the changes requested. Rather than trying to second-guess the way its working currently can you fill me in please?
Currently either a dev with access can do it with the current webconsole or a higher up dev with direct access can do the change, Currently very few devs have direct access.
5. Changes come after server restart? I'm guessing you are writing to a 'Test' database initially. On my server that I work with currently, MySQL stuff once changed goes in immediately.
right now the server does not pick up the new data till it crashes or restarts, there is no test database for this, if they need tests they can do them locally [for coding devs]
[i am not a dev for this game i am just telling what i know to hope help you understand it better]
-
Ok Caarie
Many thanks for reply. Its a big picture, I'm sure I'll understand more presently. The DB adminstrator can restrict with logins get access to which tables/data in MYSQL Admin so that should can help stop people running riot. Whether via a webapp or directly with MySQL logins. With the space thing, I wish I was a millionaire! I would donate! By direct access you mean a login to MySQL itself I guess. Weird that changes come after a restart, I run MySQL locally and on my server which my business runs on, and both update instantly. Perhaps its been set up that way? I would help to keep an eye on whats been changed!
Many thanks
PR
-
What happens is that our server application caches a large amount of data on startup. For example, it will load in all of the item_stats table from mysql into memory. So if a settings persons comes along and changes an item, then that change won't go into affect until the server application restarts and caches in the item_stats table again.
We need to be a bit careful when using the word 'server' here. Since it can relate to many different things such as the webserver, the mysql server, the physical server itself, the PlaneShift server application.
In most cases when people say "The Server", they mean the "PlaneShift server application" that the client connect to.
-
So the 'C' code server application, caches in memory many of the data changes made by game designers, and writes these to the database on restart. How are these game designers working with the C App, is there another interface to this part of the system? Does it log them into a replay journal in case of crash?
But my app. would be writing directly into the MySQL DB. so changes would be immediate. Unless you wish me to write them to the PS Server instead. Which would be a different story. Currently surely the PHP app. is also writing directly to the DB so changes are immediate also?
So it seems that a server based Webapp is what the Req. Spec. is heading towards?
I was thinking that if you want to replace the PHP WC then you will need to install Java on the server. Or on a server. Then the easiest thing to do is to simply run up Tomcat on port 8080 or pick one port no, (on a windows box anyway..). This will give you the required Java servlets and a way of testing them. But as I understand it the server is stretched currently anyway? Using Apache with Tomcat gets complicated as you have to start using Connectors behind Apache to pass requests through to the Servlets. I have no experience of this. But then you can go straight to port 80..
Best regs PR
-
But my app. would be writing directly into the MySQL DB. so changes would be immediate. Unless you wish me to write them to the PS Server instead. Which would be a different story. Currently surely the PHP app. is also writing directly to the DB so changes are immediate also?
The changes are made NOW not later, it is a matter of when the server [the psserver] notices the changes have happened.
You are only to make a way for the changes to enter the database, how they are handled from there will be up to the ps devs.
Also the server that laanx runs on is linux not windows so anything that you do has to be able to run there.
-
Ok, perhaps need to take a step back and provide a more complete overall picture.
PlaneShift is composed of 3 major parts:
1) The server application
2) The client application
3) The MySQL database.
* When the server starts up it reads a lot of data from the MySQL database. Things such as Item definitions or spell definitions, quests etc.
* As player's connect to the server application with their clients the server gets their information from the database and some 'magic' happens and the player is connected and playing.
* When the player disconnects the server application writes the character information back to the database.
This is the overall 'big picture' on how things work.
Now the other side of this is the settings development team that create the item definitions and spells definitions and quests and npcs and such. They write up the details for it and then using our web console interface ( the stuff written in php ) the data is inserted into the same MySQL database that the Server Application uses. So when we say the changes are not picked up right away it's because the Server application has already cached quest data in. So any changes the settings team has made will not come into affect until the server application restarts and the data is cached in again. However, this is outside the scope of the problem at the moment so you don't have to worry about this.
The main goal of this 'tool' is to provide a nice interface for the settings team to enter in their quest data, npc data, item details that makes sense and limits possible errors. Basically think of this tool as a content creation and management system.
I still need to figure out the best way to do this. Right now I see 3 main ways to do this:
1) Stick with the PHP. Pro: Easy to do and already some work there. Con: Not powerful enough
2) Develop a Java client. Pro: Powerful and can work with Crystal Space ( I think ). Con: Will be a fair bit of development work
3) Develop our own C++ client. Pro: Very powerful Con: Will take even longer time to develop.
I am thinking if we can get some people to develop a Java client application we can get people to develop a server side application to work with the client. This would solve several problems about database access and security issues.
-
Ok thanks ACraig
Thats a v. good overview. You need to decide what you want. Yes, there are full Java bindings for CrystalSpace as there are for OpenGL with JOGL and LWJOGL etc etc. If having graphical character creation facilities would be desirable. Lots of work has been done PHP wise, its not worth throwing unless you envisage something considerably more advantageous.
Once you know what you want let me know.
All the best
PR
-
I'd like to think of the PHP stuff as a guide to what we want to do but I don't have too much pain in tossing it all in a pile and tossing that pile into the sun and tossing that sun into a black hole.
I will try to get a few simple Use cases together this weekend to get an idea of what sort of tool we are designing here. From there we can decide where to go. Having it linked into Crystalspace would be a great plus and we will see what the use cases will show to see if that should be done sooner or later.
Right now I am leaning towards a Java client connected to a server app ( using a TCP socket ).
-
Acraig,
If your short on tools for PlaneShift I would most definately love to help you out, I'm a hobbyist Java developer - mostly Java Microedition (mobile game addict *lol*), although I am very new to the game I would be most willing to come onboard if your considering Java.
Let me know what tools you are most desperate for and I'll see what I can do :)