![]() |
|
This thread is locked; no one can reply to it.
![]() ![]() |
1
2
|
Anyone made a small multiplayer (network) game? |
AMCerasoli
Member #11,955
May 2010
![]() |
By a dedicated server I mean that... a dedicated server... a VPS is some kind of dedicated server too, but I don't have neither of two. The thing is I don't want to pay 16 E/month for a dedicated server just to show an online score of my game (inside the game The file just contain a name and a score... and are saved like this: 1.dat , 2.dat , 3.dat etc... I know that 1.dat contains the better score so if the client beat that score, the game sends a new 1.dat file overwriting the old one. This should be done constantly... But I know there must be a hide problem I haven't think much of it. bamccaig said: You should have to beat a high score to make the list, not just match it. Yes I think I'm going to do that, it's the less controversial option. Quote: You could use a VPS instead, or your own desktop if it is accessible from the Internet I can't because I have a dynamic IP, and I can't use No-IP or something similar. Quote: I'm beginning to think that you're currently using some Web space provided for cheap with only FTP access and no direct access to the server.
Oh Yhea Quote: If that's too much then you're probably SOL unless you can convince somebody else with a server to spare you a database.
Quote: I'm currently paying $11/month for a VPS with more than enough power for this.
Quote: If that's too much then you're probably SOL unless you can convince somebody else with a server to spare you a database.
Quote: I'm currently paying $11/month for a VPS with more than enough power for this.
Quote: If that's too much then you're probably SOL unless you can convince somebody else with a server to spare you a database.
Quote: I'm currently paying $11/month for a VPS with more than enough power for this. Hm... I think I might have one ahahahahahaha.... Edit: I have a better Idea, to relieve the task of the game, I can just send the file (from the game) each time the player reach a new better score, this way I delete the possibility of hackings. Then from my computer I run another program which load the files and order them, and in the game show the first 12 but in the web page I could show all the people that have played my game! COOL!.
|
bamccaig
Member #7,536
July 2006
![]() |
AMCERASOLI said:
Oh Yhea
That actually changes everything... If you have access to an Internet-accessible MySQL database (or server with MySQL and a Web-accessible Web server) then just use the database. AMCERASOLI said: I have a better Idea, to relieve the task of the game, I can just send the file (from the game) each time the player reach a new better score, this way I delete the possibility of hackings. Then from my computer I run another program which load the files and order them, and in the game show the first 12 but in the web page I could show all the people that have played my game! COOL!.
I'd still opt for the RDBMS solution... That sounds like it will be very ugly and hard to manage. Imagine how unhappy your users will be if their awesome high scores aren't recorded properly. Especially if you make them pay for the game. -- acc.js | al4anim - Allegro 4 Animation library | Allegro 5 VS/NuGet Guide | Allegro.cc Mockup | Allegro.cc <code> Tag | Allegro 4 Timer Example (w/ Semaphores) | Allegro 5 "Winpkg" (MSVC readme) | Bambot | Blog | C++ STL Container Flowchart | Castopulence Software | Check Return Values | Derail? | Is This A Discussion? Flow Chart | Filesystem Hierarchy Standard | Clean Code Talks - Global State and Singletons | How To Use Header Files | GNU/Linux (Debian, Fedora, Gentoo) | rot (rot13, rot47, rotN) | Streaming |
AMCerasoli
Member #11,955
May 2010
![]() |
bamccaig said: That actually changes everything... If you have access to an Internet-accessible MySQL database (or server with MySQL and a Web-accessible Web server) then just use the database. It will work so much more reliably than any kind of FTP solution. Hmm.. I didn't know that, thanks again man! I'm going to study that.
|
bamccaig
Member #7,536
July 2006
![]() |
If you can't access the MySQL database from the Internet (i.e., it may only listen on the loopback interface) then you can always write a Web application interface using PHP, for example. Then just make simple HTTP requests to the server and have your PHP code process them. That, of course, depends on your server supporting PHP (or another server-side technology), but if you have MySQL then you almost certainly have PHP too. -- acc.js | al4anim - Allegro 4 Animation library | Allegro 5 VS/NuGet Guide | Allegro.cc Mockup | Allegro.cc <code> Tag | Allegro 4 Timer Example (w/ Semaphores) | Allegro 5 "Winpkg" (MSVC readme) | Bambot | Blog | C++ STL Container Flowchart | Castopulence Software | Check Return Values | Derail? | Is This A Discussion? Flow Chart | Filesystem Hierarchy Standard | Clean Code Talks - Global State and Singletons | How To Use Header Files | GNU/Linux (Debian, Fedora, Gentoo) | rot (rot13, rot47, rotN) | Streaming |
AMCerasoli
Member #11,955
May 2010
![]() |
I'll check out that, there is a way to know if their accept connection from internet besides talking directly with them?, there isn't another term besides loopback, you know they use to use more commercial words... Because at the moment I have no MySQL but if I want I can activate it(paying a little bit more)... They have this: Quote:
Aruba.it has also activated the offer for the MySql support: technically it is an DBMS (Database Management System) or rather, a management system for Database, practically it is a fast Database with high performance, that allows you to create dynamic websites with backend MySql. The service can be used only by domians hosted by our hosting services or Dedicated Servers. You can increase the disk space with (100Mb) additional packages of 100Mb each. The predefinited interaction language is PHP, but it is possible, thanks to the MyODBC drivers, to interact with it also by ASP pages, too. What do you think?
|
Oscar Giner
Member #2,207
April 2002
![]() |
If you already have php there, you don't need a DBMS for such a simple task. Just store the scores in a file and use PHP to lock it when you want to update it. Pseudocode:
[edit] Disclaimer: I omited error checking for simplicity -- |
Thomas Fjellstrom
Member #476
June 2000
![]() |
You can also use a SQLite or BerklyDB (bdb) database instead of mysql. Both are file backed, so you don't need a DB server. -- |
AMCerasoli
Member #11,955
May 2010
![]() |
Seems great, but my hosting provider doesn't support SQLite, only MySql and Microsoft SQL server. I have just a simple hosing service. For that reason I was talking about FTP, I'm going to study the PHP and HTTP possibility though, this is just to be able to offer an online table in-game at the first moment, but if the game success I might rent a VPS and use ENet and I would add another online options. Thanks.
|
Thomas Fjellstrom
Member #476
June 2000
![]() |
AMCERASOLI said: Seems great, but my hosting provider doesn't support SQLite Its a php module, you could probably upload it yourself and just use it. Same with BDB. Both are based on (more or less) simple files. -- |
bamccaig
Member #7,536
July 2006
![]() |
Thomas Fjellstrom said: Its a php module, you could probably upload it yourself and just use it. Same with BDB. Both are based on (more or less) simple files.
I doubt he could install the module if it isn't already installed. If he could then he could do a lot more than he's letting on. -- acc.js | al4anim - Allegro 4 Animation library | Allegro 5 VS/NuGet Guide | Allegro.cc Mockup | Allegro.cc <code> Tag | Allegro 4 Timer Example (w/ Semaphores) | Allegro 5 "Winpkg" (MSVC readme) | Bambot | Blog | C++ STL Container Flowchart | Castopulence Software | Check Return Values | Derail? | Is This A Discussion? Flow Chart | Filesystem Hierarchy Standard | Clean Code Talks - Global State and Singletons | How To Use Header Files | GNU/Linux (Debian, Fedora, Gentoo) | rot (rot13, rot47, rotN) | Streaming |
ImLeftFooted
Member #3,935
October 2003
![]() |
Oscar Giner said:
insert_score_submited_by_player($score_array, $POST[$score]); // I don't actually remember how to acess post variables :P
It's $_POST or $_REQUEST if you don't care whether it's GET or POST. |
Matthew Leverton
Supreme Loser
January 1999
![]() |
AMCERASOLI said: Seems great, but my hosting provider doesn't support SQLite Are you sure? It comes bundled with PHP5, and you'd have to explicitly disable for it not to work. |
AMCerasoli
Member #11,955
May 2010
![]() |
Well, actually I haven't but I saw a post in their web page but now seeing again they seems to have suport for SQLite... The problem was they took a lot of time to pass from 4 to 5 and the internet is plagued by people complaining... They have support for: libxml xsl xmlwriter dom xmlreader xml wddx tokenizer session pcre SimpleXML SPL PDO SQLite standard Reflection posix pdo_sqlite pdo_mysql mysqli <--- WTF mysql mime_magic mhash mcrypt json imap iconv hash gettext gd ftp filter exif date curl ctype calendar bz2 bcmath zlib cgi pdf ionCube Loader
But know they're complaining why they don't support PHP-SOAP or something... I don't even know what it's and don't what to know to be honest But I'm going to try to do what Oscar Giner suggested me, I'm going to use something like libCurl to send a request and process it. Send the actual score of the player, if it's better run the script to erase the old one from the list (the file) and retrieve the "socres.dat" file, and if isn't just retrieve the "scores.dat" file anyway to keep the list actualized. Retrieving the list is what I don't know how to do it, I'm new in all this but I'm reading... A library like libCurl should keep me away from sockets, headers and things like that, right?
|
Derezo
Member #1,666
April 2001
![]() |
MySQLi is just a more enhanced version of the MySQL drivers that supports bindings and procedures and such. I just recently started using CodeIgniter and am really liking it. They have a great community, as well. "He who controls the stuffing controls the Universe" |
AMCerasoli
Member #11,955
May 2010
![]() |
And they have a lot of documents too, even videotutorials. I have another idea... What if I set up a server on my machine, and constantly send my IP address to my current host server, then the game would connect to the host server read the file called something like "what_is_your_IP_now.dat" and then connect with my dedicated server at home... This way I could start learning ENet insted of PHP and libCurl
|
ImLeftFooted
Member #3,935
October 2003
![]() |
{"name":"Screen_shot_2011-04-14_at_1.17.58_AM.png","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/0\/4\/0479217ec8bb51f3b851b05a7b598c9a.png","w":443,"h":566,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/0\/4\/0479217ec8bb51f3b851b05a7b598c9a"} You add new track by touching and dragging. Just the beginning and end of the drag are used to calculate a run of track. I'm going to work on the network code soon, once I get a bit more UI. Here's a cropped full res shot: |
AMCerasoli
Member #11,955
May 2010
![]() |
YHEAAAAA!!! Nice man!!! Try to make it commercial, you know good graphics, sound, etc... That game has potential and being online even more. You have the iPhone SDK? I'm starting to think that I'm the only one that don't have it...
|
TeaRDoWN
Member #8,518
April 2007
![]() |
Wow, this thread took off like a rocket. Fun to see that I'm not all alone. |
AMCerasoli
Member #11,955
May 2010
![]() |
I have checked again and no I have not SQLite, would be dangerous if I show people the result from phpinfo()?.
|
Vanneto
Member #8,643
May 2007
|
Not really, no. In capitalist America bank robs you. |
Thomas Fjellstrom
Member #476
June 2000
![]() |
AMCERASOLI said: I have checked again and no I have not SQLite That list you posted has pdo_sqlite in it. Its there. Note, it is not a SERVER based SQL system. No server required, just a simple bit of PHP code (or C/C++, or Perl, or Python) to access it. -- |
AMCerasoli
Member #11,955
May 2010
![]() |
I don't know, that list was from another guy too... My PHP version is 5.2.12 check out this... http://62.149.131.186/ver.php But there is no problem, I'm not going to use SQLite nor some database language, I don't need those features for such simple task. I could use the CGI too I think they allow be to upload binaries since I have a "cgi-bin" folder, but I'm going to use PHP. Let's see. I still need to read a lot, there is a lot of people that say that PHP wins against the CGI but since I already know C++ I would prefer to use it, but I don't know... Basically I don't know what I'm talking about Quote:
Quote: I'm looking to setup a PHP script that will take a highscore along with some type of key to validate it. The application will then call the script and upload the highscores. Or if there is any other solution available, that would be great. Maybe even running remote MySQL queries directly from the application.... No that would be less than ideal. This is because the user would be able to detect the MySQL login / password and put in their own data, which would be bad. Using a PHP (or even a CGI program written in C++, maybe, so it can reuse code from the app itself) script to update high scores, list servers etc, is definitely the way to go. It's much easier to code this sort of high-score updater or server-list manager in PHP than it would be in C++ (well, if you know PHP anyway).
|
|
1
2
|