Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Sending and receiving variables through internet? How?

Author
Message
Starshyne Emir
7
Years of Service
User Offline
Joined: 27th Nov 2016
Location: Porto Alegre, southern Brazil
Posted: 14th Dec 2018 14:31
How can I send a variable from the computer A to the computer B within a DBPro application (running on both machines) through the Internet?

It can be using TCP/IP or whatever, but please give me the simplest possible example, because I'm a little... too much idiot to read and understand vast extents of code made by other people.
God is real - except if declared as integer.
Ortu
DBPro Master
16
Years of Service
User Offline
Joined: 21st Nov 2007
Location: Austin, TX
Posted: 14th Dec 2018 23:20
I can give some simple code when I get home, but the basics of online multiplayer only barely begins at simple send and recieve.

You are going to run into bigger problems with end user basic networking. NAT/Port forwarding, public vs private ip, firewalls, host discovery... direct peer to peer multiplayer is a recipe for frustration for everyone involved.

give serious thought to a client server setup rather than peer to peer, and good luck!
http://games.joshkirklin.com/sulium

A single player RPG featuring a branching, player driven storyline of meaningful choices and multiple endings alongside challenging active combat and intelligent AI.
Starshyne Emir
7
Years of Service
User Offline
Joined: 27th Nov 2016
Location: Porto Alegre, southern Brazil
Posted: 14th Dec 2018 23:47
Peer to peer may be good enough for me, since what I want isn't realtime action.
Think of it as a P2P chat. The rest I'll invent over time.
God is real - except if declared as integer.
Ortu
DBPro Master
16
Years of Service
User Offline
Joined: 21st Nov 2007
Location: Austin, TX
Posted: 15th Dec 2018 00:14 Edited at: 15th Dec 2018 00:15


compile then run from the command line as shown here.

-s [portnumber] will set up the server host

[ip] [portnumber] will set up a client.

only run 1 instance with -s run as many client instances as you want.

This uses Matrix1 sockets, this is UDP, but TCP works similarly.

http://games.joshkirklin.com/sulium

A single player RPG featuring a branching, player driven storyline of meaningful choices and multiple endings alongside challenging active combat and intelligent AI.

Attachments

Login to view attachments
Starshyne Emir
7
Years of Service
User Offline
Joined: 27th Nov 2016
Location: Porto Alegre, southern Brazil
Posted: 15th Dec 2018 00:34
Thank you very much, Master Ortu.
Your code is easy to understand, I believe I can do something with it.
Gonna estudy it for a while to understand it entirely before start implementing it in my game.

God is real - except if declared as integer.

Login to post a reply

Server time is: 2024-04-24 13:01:37
Your offset time is: 2024-04-24 13:01:37