Java-Gaming.org    
Featured games (91)
games approved by the League of Dukes
Games in Showcase (580)
games submitted by our members
Games in WIP (500)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: 1 [2]
  ignore  |  Print  
  Ideas for Online High Score System  (Read 8589 times)
0 Members and 1 Guest are viewing this topic.
Offline miga

Junior Member


Medals: 2
Projects: 1



« Reply #30 - Posted 2012-03-23 22:38:25 »

Sorry, I didn't understand how to dump data.

Edit: I will get that as soon as I find some time. Sorry about that.

Miga's Hobby Programming - http://www.migapro.com
Offline sproingie
« Reply #31 - Posted 2012-03-23 22:54:00 »

I'm really disinclined to work with that html output, sorry.  Use the .dump command I gave you.  If you don't have shell access to run commands like that, I suggest you develop on a machine where you do.
Offline miga

Junior Member


Medals: 2
Projects: 1



« Reply #32 - Posted 2012-03-24 07:55:20 »

Just a quick question. If I put a link to the db file itself, would that work? I downloaded the command line shell. I tried your advise and searched around, but sadly, I can't get to access to my db for lack of my understanding.

Miga's Hobby Programming - http://www.migapro.com
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline sproingie
« Reply #33 - Posted 2012-03-24 17:58:53 »

That would work, sure.
Offline miga

Junior Member


Medals: 2
Projects: 1



« Reply #34 - Posted 2012-03-24 18:11:43 »

http://migapro.com/mine.sdb

Here is the file. I would appreciate if you could point out why I'm wrong. I want to learn from this.

Thanks a lot for your time.

Miga's Hobby Programming - http://www.migapro.com
Offline sproingie
« Reply #35 - Posted 2012-03-24 18:56:05 »

Your version of sqlite is so old, I can't even open the database with recent versions of sqlite.  If I can reproduce this on my own, I'll give it a try, otherwise I think someone else may have to eyeball the sql and see what's wrong with it.
Offline miga

Junior Member


Medals: 2
Projects: 1



« Reply #36 - Posted 2012-03-24 19:06:28 »

Let me try to make a table with the same data using SQLite Administrator program. I see that file is in SQLite 2.1.

Miga's Hobby Programming - http://www.migapro.com
Offline miga

Junior Member


Medals: 2
Projects: 1



« Reply #37 - Posted 2012-03-24 19:25:23 »

Edited:
I'm starting to have a concern that this is an issue from sqlite version and the way I open the file in php. I want to try something before I bother anyone else.

2nd Edit:

After sproingie pointed out my sqlite version is old, I created a sqlite3 file allocated with same data using SQLite Administrator. The results would return the way I wanted correctly (different from the old db). I replaced my old file with that and tested. The php code would not open it. I found out that the problem was the class I was using to manipulate the sqlite file. I used the PDO and it worked perfectly.

sproingie,

Thanks a lot for your help and time. I'm really sorry that after all the hassle, it turned out that the mistake was my php code.

Thanks to everyone who commented and gave me advises.

Miga's Hobby Programming - http://www.migapro.com
Offline sproingie
« Reply #38 - Posted 2012-03-25 04:49:21 »

Glad you found the problem in the end Smiley
Offline loom_weaver

JGO Coder


Medals: 17



« Reply #39 - Posted 2012-03-25 06:36:59 »

Anyone determined to send fake score data can do so, and there's really nothing you can do about it other than move all your game logic server-side.  Even then someone could automate the game with a bot, though that's a harder problem, most people won't bother with it, and you should take it as a good sign of popularity if they do.

That's true. Well, I will be monitoring the table anyways. I will manually delete fake record if I see any suspicious.


I have never used SQLite, so I just read about it.  http://www.sqlite.org/whentouse.html

The only possible issue I found would be the concurrency. It says that the database locks reading/writing when one is in process. Though it says the lock would last for a few dozen milliseconds at most usually. I guess I shouldn't consider this as an issue for this case since there won't be that many people.

All I need is fetch, insert, and delete of a record. So I think I should consider SQLite as my solution, now.

But I do want to add some kind of protection in the code at least protecting from modifying the score board by just passing scores through url.

Some anecdotal experience...

The company I work (Coverity) for uses and used SQLite quite extensively with our product over the course of the last 8 years.  It does not scale well and seems susceptible to both corruption and concurrency issues.

[edit] While I don't know if it's any better in this regard, I would recommend either derby or hsqldb as they're easy to setup, work well with Java, and will get around your original blocker.

[edit] I noticed that sproingle already recommended the above...
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline sproingie
« Reply #40 - Posted 2012-03-25 09:30:53 »

It's safe to say sqlite doesn't scale at all, let alone well.  It's designed to be dedicated entirely to one process, and anything else is just gravy.  What I've never run into in years of using sqlite is data corruption, except when I've shared it over NFS, which is discouraged for very good reason.  SQLite goes to some quite some lengths to ensure proper write behaviors, more than most any other database I've seen.  Since it ultimately is up to the filesystem and device to implement things properly, you can of course get corruption if you use a sloppy filesystem or storage device that actually does write-behind when it claims to do write-through.

All that said, if your database code is java, sqlite is actually not a great fit, there are better alternatives (like h2) and the only reason I'd spec it is for compatibility with Android.

Pages: 1 [2]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

xsi3rr4x (48 views)
2014-04-15 18:08:23

BurntPizza (44 views)
2014-04-15 03:46:01

UprightPath (60 views)
2014-04-14 17:39:50

UprightPath (42 views)
2014-04-14 17:35:47

Porlus (58 views)
2014-04-14 15:48:38

tom_mai78101 (82 views)
2014-04-10 04:04:31

BurntPizza (140 views)
2014-04-08 23:06:04

tom_mai78101 (240 views)
2014-04-05 13:34:39

trollwarrior1 (200 views)
2014-04-04 12:06:45

CJLetsGame (207 views)
2014-04-01 02:16:10
List of Learning Resources
by SHC
2014-04-18 03:17:39

List of Learning Resources
by Longarmx
2014-04-08 03:14:44

Good Examples
by matheus23
2014-04-05 13:51:37

Good Examples
by Grunnt
2014-04-03 15:48:46

Good Examples
by Grunnt
2014-04-03 15:48:37

Good Examples
by matheus23
2014-04-01 18:40:51

Good Examples
by matheus23
2014-04-01 18:40:34

Anonymous/Local/Inner class gotchas
by Roquen
2014-03-11 15:22:30
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!