Nevereal Games

Can I do it using the API?

Can I do it using the API?

Report Topic
Nafees #1
  08 Oct 2014 - 10:53
User posted content

NafeesDeveloper Site

Nevereal Member
Group: User
Posts: 56
Joined: 09 Oct 2013
Website: Visit
Its been about a week that I am trying to get the peer to peer multiplayer to work. Everything is done but what is left is that how can all the players know each other? And for that to happen, this is what I am doing: A player starts game, his/her ip will be sent to my website (<website.com>/saveip.htm?<ip address>). But the problem is that I am a game developer not a website designer so I don't even know a bit of HTML or PHP and I also don't want to.

This is what I want to do:

a page of my site is opened with this in the end: ?<ip address> like <website>/page.htm?175.110.182.172 .

Then the page saves the <ip address> in a textfile ON THE WEBSITE.

And writes how many <ip addresses> are written.

And I was just wondering if this is somehow possible using the Nevereal API? If so, how? If no, how can I do this in HTML or PHP?

!!>>If this is in the wrong category, please move it to the right one<<!!
My new signature: :D :)
Quote:
<font color=blue><b>begin</b></font>
sig := TSignature.Create;
sig.Text := 'My new signature!';
<font color=blue><b>end</b></font>;
0
Aidiakapi #2
  08 Oct 2014 - 17:11
User posted content

AidiakapiDeveloper Site

Nevereal Someone
Group: User
Posts: 853
Joined: 21 Aug 2012
Finding each other in P2P networks is a tricky issue. Torrents do it by having tracker servers, that tell people who's seeding and peering/leaching.

It is possible to do using the Nevereal API and FTP, it would however take quite a lot of trickery, since you cannot make an atomic exchange. An example of the problem: player 1 and 2 log in, player 1 downloads file, player 2 downloads file, player 1 adds himself and uploads file, player 2 adds himself and uploads file. Because player 2 downloaded it before player 1 uploaded it, the changes made by player 1 are lost.
There's also some security issues involved, but there are security issues with any P2P network.

In general your problem is solved using a lobby server. With other words, a server dedicated to tracking which players are online, in-game, available for invite, etc.

Next to that, there's an additional issue with P2P networking, which I doubt you fixed, and that's NAT punchthrough. Without solving that issue (and neither HTML/PHP, nor Nevereal API can do this for you) even if you have the IP address of the other party, you won't be able to connect. (Basically, a NAT punchthrough prevents you from having to port forward the router of every player.)

Either way, to make a 'lobby server' with PHP, the only thing you have to remember, is that you should open files in read/write mode, and only close them after doing both the read and the write. Otherwise you'll run into the same atomicity issues that using the Nevereal API gives you.

As for actual code, you should open a file using fopen (http://php.net/manual/en/function.fopen.php) in mode "w+".
Finally a new signature.
0
Luis #3
  17 Oct 2014 - 03:09
User posted content

LuisDeveloper Site

Carpe Diem
Group: Founder
Posts: 273
Joined: 03 Aug 2012
Website: Visit
The way the current Nevereal API is setup is very limiting in HTTP requests, because well, everything has to go through our server (which doesn't mean you can't implement it with our API, it just means you can't implement it on your server). I've been definitely meaning to rewrite the code for the API however to allow for much lower level usability and therefore, increased use, because right now it is very specific for its use!

Edit:
I also went ahead and approved your game. I haven't been active at all on these forums or had any time lately to work on the site, but things should begin to wind down soon!
Post last edited by Luis: 17 Oct 2014 - 03:11
Nevereal Games Webmaster
0
Nafees #4
  03 Nov 2014 - 14:35
User posted content

NafeesDeveloper Site

Nevereal Member
Group: User
Posts: 56
Joined: 09 Oct 2013
Website: Visit
Aidiakapi wrote:
It is possible to do using the Nevereal API and FTP, it would however take quite a lot of trickery, since you cannot make an atomic exchange. An example of the problem: player 1 and 2 log in, player 1 downloads file, player 2 downloads file, player 1 adds himself and uploads file, player 2 adds himself and uploads file. Because player 2 downloaded it before player 1 uploaded it, the changes made by player 1 are lost.
There's also some security issues involved, but there are security issues with any P2P network.
That will help me. Thanks!
BTW, I just noticed that I am the one who has uploaded more games that any other user! From 18 total games, 7 are mine.
My new signature: :D :)
Quote:
<font color=blue><b>begin</b></font>
sig := TSignature.Create;
sig.Text := 'My new signature!';
<font color=blue><b>end</b></font>;
0
Luis #5
  04 Nov 2014 - 03:18
User posted content

LuisDeveloper Site

Carpe Diem
Group: Founder
Posts: 273
Joined: 03 Aug 2012
Website: Visit
Nafees Hassan wrote:
Aidiakapi wrote:
It is possible to do using the Nevereal API and FTP, it would however take quite a lot of trickery, since you cannot make an atomic exchange. An example of the problem: player 1 and 2 log in, player 1 downloads file, player 2 downloads file, player 1 adds himself and uploads file, player 2 adds himself and uploads file. Because player 2 downloaded it before player 1 uploaded it, the changes made by player 1 are lost.
There's also some security issues involved, but there are security issues with any P2P network.
That will help me. Thanks!
BTW, I just noticed that I am the one who has uploaded more games that any other user! From 18 total games, 7 are mine.

Yup! I haven't pursued an advertising campaign for the site yet really, but hopefully more content will be uploaded when I do!
Nevereal Games Webmaster
0
Nafees #6
  11 Nov 2014 - 10:22
User posted content

NafeesDeveloper Site

Nevereal Member
Group: User
Posts: 56
Joined: 09 Oct 2013
Website: Visit
Luis wrote:
Nafees Hassan wrote:
Aidiakapi wrote:
It is possible to do using the Nevereal API and FTP, it would however take quite a lot of trickery, since you cannot make an atomic exchange. An example of the problem: player 1 and 2 log in, player 1 downloads file, player 2 downloads file, player 1 adds himself and uploads file, player 2 adds himself and uploads file. Because player 2 downloaded it before player 1 uploaded it, the changes made by player 1 are lost.
There's also some security issues involved, but there are security issues with any P2P network.
That will help me. Thanks!
BTW, I just noticed that I am the one who has uploaded more games that any other user! From 18 total games, 7 are mine.

Yup! I haven't pursued an advertising campaign for the site yet really, but hopefully more content will be uploaded when I do!
My 8th game will be coming soon (for me, soon is more than a month!) But this soon is less than a month :)
Post last edited by Nafees: 11 Nov 2014 - 11:18
My new signature: :D :)
Quote:
<font color=blue><b>begin</b></font>
sig := TSignature.Create;
sig.Text := 'My new signature!';
<font color=blue><b>end</b></font>;
0
Nafees #7
  09 Dec 2014 - 15:47
User posted content

NafeesDeveloper Site

Nevereal Member
Group: User
Posts: 56
Joined: 09 Oct 2013
Website: Visit
About the post above. I think I posted that before a lot of time, today I wrote my eight game's first line of code! I've named it "Blue Wars".
My new signature: :D :)
Quote:
<font color=blue><b>begin</b></font>
sig := TSignature.Create;
sig.Text := 'My new signature!';
<font color=blue><b>end</b></font>;
0
Luis #8
  19 Dec 2014 - 20:52
User posted content

LuisDeveloper Site

Carpe Diem
Group: Founder
Posts: 273
Joined: 03 Aug 2012
Website: Visit
Nafees Hassan wrote:
About the post above. I think I posted that before a lot of time, today I wrote my eight game's first line of code! I've named it "Blue Wars".

Cool!
Nevereal Games Webmaster
0
0 members and 1 guest are browsing this topic