- 16 Jul 2013 14:53
MrMasochism wrote:The getting information from the online database is dead easy and I will do that work. It'll just require a php file that I can post to to recieve the information requiredI can confirm this.
To prevent multiple code (e.g. for establishing database connection) you simply could put the connection functions in a separate php file stored in a special directory and include it everywhere you need it. Database credentials (username/password etc.) have to be in a directory outside the webservers root directory so that nobody else is able see it directly (when e.g. the php engine stopped working and plain text is showed instead of the script gets executed).Developing a database layout
could be a little bit tricky. When you don't do it right then you could get strong performance issues
when handling lots of data that is e.g. not indexed right or bad structured (because of the table layout). But when you figured out a perfect database layout for your further application its damn easy to fetch data and insert/update/delete something (with the right SQL-queries). When you do queries over multiple tables you could use INNER JOINS etc. and everything is just fine.
X_Amilious_X wrote:so why don't you just have your mod check an SQL database on your website If you can make a mod connect to a sql database let me know. Store the minecraft id (username) and the pokemon id (id of the pokemon). Then just read the database for USERNAME and update their "/saves/worldName/pokemon/" + USERNAME + .comp if it does not contain the pokemonID add it. This would give them the pokemon in every pixelmon game they play. or if you want it to be a one time thing after you update the first time delete the database row. I suggest the latter because it would be less lagg. or even better just give them a small java app that will change the file when its ran. you could make different jars for differnet pokemon. then give them the jar after donation.
Thats horrible. When there are many hundret servers around the world and you need to provide offers and track payments on a central site from customers around the world to split the earnings to the server owners on the one hand and to the mod developers on the other hand you can't do everything on the owners servers or even on the players clients because it's ugly to organize and trace payment routes (to prevent cheating and/or corruption of sensible payment data).
So the best way is to have one (or better more) root/virtual servers and/or a cloud (for load balancing) and you need to get a website running for offers/payments and a database for registering servers using e.g. pixelmon (identified by a random key that is generated when starting the server) and tracking buy/payment transactions. Last but not least you need to provide an API (I would prefer to use JSON - J
otation) to be able to provide the functionality between the mod (pixelmon) and the rewards service that can be accessed from every server that e.g. uses pixelmon.
X_Amilious_X wrote:Doing it like that we will need some encryption in the php file.
But definetly doable
Nope. Because PHP is a serverside
You only need encryption when you e.g. want to sell your php scripts and don't want that someone else can steal/use the code elsewhere.
You can have it simple or complicated but when you want it complex/complicated and with lots of extra special functionality it takes a lot of time and it's not sure that it ever gets ready. So lets talk about what is really needed and how it could be realized.
Also I would suggest to not use OOP but functional programming in scripts because it's likely OOP makes many things more complicated then they need to be (especially in smaller projects) and tend to decrease performance because of objects that need to be constructed every time on every request (in PHP).