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 / Can DBPro talk to a web site?

Author
Message
ProfessorKill
22
Years of Service
User Offline
Joined: 3rd Nov 2003
Location: Frederick, MD
Posted: 3rd Nov 2003 22:09 Edited at: 3rd Nov 2003 22:09
I posted this in the newbie forum also. Not sure if it belongs there or here. Anyway...

I'm an old school programmer. Been coding every flavor of Basic since 1982. However, that being said, I'm still waiting for my DBPro box to arrive so I'm a -huge- DBPro newbie. I have a quick question for an expert. Can DBPro communicate with a script (Perl, PHP, VBScript, etc.) running at a web site? Meaning, can I write a DBPro client app which talks (send and receive text, commands) with a single web server via URL or IP?

Thanks a lot for any help and/or advice.
Kentaree
23
Years of Service
User Offline
Joined: 5th Oct 2002
Location: Clonmel, Ireland
Posted: 3rd Nov 2003 22:15
Natively, DBPro only supports DirectX's netplay. However, it would be possible to create a .dll for it to do so. I'm not sure if its been done before, but check http://www.codingarea.co.uk/'s plugin list, or search this site for any .dlls that might help you.

Cheers,
Kentaree

I would be unstoppable if I could just get started...
spooky
23
Years of Service
User Offline
Joined: 30th Aug 2002
Location: United Kingdom
Posted: 3rd Nov 2003 22:24 Edited at: 3rd Nov 2003 22:24
This snippet will download a url, be it a basic html page or result of a php query, or whatever.

It basically downloads webpage output to a temp file, then reads it in line-by-line and sticks it in a variable for you to parse or do what you like with it.

So you can effectively run a php script on a webpage by using this method and collect any output at the same time.



Boo!
ProfessorKill
22
Years of Service
User Offline
Joined: 3rd Nov 2003
Location: Frederick, MD
Posted: 3rd Nov 2003 22:36
Hey thanks! That may work out. Do you know if DirectX NetPlay does or does not support client/server comms? P2P yes, but anything like we're discussing?

I'm researching at Microsoft site now. Slow connection. Still waiting for page to load...
krannock
23
Years of Service
User Offline
Joined: 19th May 2003
Location: United Kingdom
Posted: 4th Nov 2003 02:31
DBP does support netplay client server.
Don't know if you can get it to talk with a website tho as it would need DBP code on both ends.

Smile it could be worse....I smiled...it got worse!
ProfessorKill
22
Years of Service
User Offline
Joined: 3rd Nov 2003
Location: Frederick, MD
Posted: 4th Nov 2003 15:19
Quote: "would need DBP code on both ends."


That would be tough. Can't run a DBPro app as a service on my web site.
ProfessorKill
22
Years of Service
User Offline
Joined: 3rd Nov 2003
Location: Frederick, MD
Posted: 4th Nov 2003 15:56
Ok, so you actually can do the whole client/server comms with DirectPlay via "DirectLobby". DirectLobby runs on a remote server and "Lobbyable" clients connect to it. The remote DirectLobby machine connects the clients to a server app.

Sooooo...

I'll need to get my own machine colo'd somewhere or lease dedicated space. Could never do this in a shared hosting environment.

And soooo...

It can be done, but not cheaply. I'm going to have to consider Spooky's solution or try using the MSXML object (dll). I've used it successfully in other apps. Question on that note: Can I access and use any dll from DBPro?
Andy Igoe
23
Years of Service
User Offline
Joined: 6th Oct 2002
Location: United Kingdom
Posted: 4th Nov 2003 22:41
Reading off a webpage is shown above, sending information could be done via execute file command, something like...

execute file "http://developer.thegamecreators.com/?m=forum_view&t=19548&b=1","",""

for instance will load up this forum page. Change the b [board] variable and you'll be calling up different information.

If you have ftp access you could also use that, but clients could use a portspy to read of the login name and password. For read only applications that would be accepteable.

Personally I have the ability to create multiple accounts on my webspace, so I have an account that can only read/write to an otherwise empty directory and my games use that to store their high score charts. Come to think of it, I really should release the updated versions that point to the new webspace... sorry, side issue, million and one things to do as usual

Pneumatic Dryll
ProfessorKill
22
Years of Service
User Offline
Joined: 3rd Nov 2003
Location: Frederick, MD
Posted: 5th Nov 2003 20:37
Quote: "execute file "http://developer.thegamecreators.com/?m=forum_view&t=19548&b=1","",""

for instance will load up this forum page."


So you're saying EXECUTE FILE is a DBPro statement which accepts a Url as one of it's parameters and gets output from an Html page or script? If so, where is the output loaded? Does it go into some variable? Or am I not following?

Thanks a lot
Andy Igoe
23
Years of Service
User Offline
Joined: 6th Oct 2002
Location: United Kingdom
Posted: 5th Nov 2003 20:52
execute file would open a browser to actually open the page. If the page was a script that passed the variable data in the address (after the ?). You could give the script page the page description CLOSE ME when it is finished then use user32.dll to close it like this.



Pneumatic Dryll
ProfessorKill
22
Years of Service
User Offline
Joined: 3rd Nov 2003
Location: Frederick, MD
Posted: 5th Nov 2003 21:03
Ok, I'm following you. However, it is much easier to use the "msxml2.dll" which you get when you install IE 5.5 and/or IE 6. So most people will have it. I suppose I should bundle it with the client application just in case. Have you used this Dll before? It was mainly designed to load and parse XML. Which of course it does. It also works very nicely when you give it a Url (which pints to a script on the web and may include varname/value pairs) and then store the script output in a variable. It never loads a browser. Just runs the script and grabs the output. Follow? This is how I've been coding my "sessionless server" requirements. Didn't know if I could do something like this (or easier) with DBPro's built in statments. Other than "load dll..." I mean.

ProfessorKill
22
Years of Service
User Offline
Joined: 3rd Nov 2003
Location: Frederick, MD
Posted: 6th Nov 2003 03:20
Anyone know where to find a windows Dll's reference? Something which explains the common windows Dll's and how to use their functions.
ProfessorKill
22
Years of Service
User Offline
Joined: 3rd Nov 2003
Location: Frederick, MD
Posted: 6th Nov 2003 03:22
Spooky: Your "download" function works well!
TheOneRing
22
Years of Service
User Offline
Joined: 28th Aug 2003
Location: Right here.
Posted: 6th Nov 2003 17:01
Try http://msdn.microsoft.com. You can look up API commands and what DLL they belong to.
LammaDog
22
Years of Service
User Offline
Joined: 8th Nov 2003
Location: California
Posted: 8th Nov 2003 15:49
Hey ProfessorKill

I have some servers, and I'm thinking along similar lines as you. Perhaps we can help eachother out.

http://www.thegamecreators.com/?m=forum_view&t=19808&b=1
I didn't talk about webased interfacing in this thread, but I've always thought a game server should be able to talk to PHP/MySQL to automatically post scores and clan stats and stuff like that.

You can check us out at http://guardianhosting.net
You can contact me directly at troy@... (but don't forget to keep the forums active )


Troy
ProfessorKill
22
Years of Service
User Offline
Joined: 3rd Nov 2003
Location: Frederick, MD
Posted: 9th Nov 2003 03:05
Troy,

Checked your site. Looks nice.

I put a lot of hours on my project plan today. I'm still thinking about a client/server setup where the server code runs on a web site. I did a lot of DBPro studying today. I may be able to use DBPros built in DX9 client/server functionality and let the players handle their own sessions. Haven't really decided yet.

Don't get me wrong, I'd love to have access to my own dedicated machine, I'm just not ready to lay down a hunsky or so each month for something I can live without.

MD
waffle
23
Years of Service
User Offline
Joined: 9th Sep 2002
Location: Western USA
Posted: 10th Nov 2003 16:31 Edited at: 10th Nov 2003 16:45
hey lamma dog
you said you have a few servers?
I could do a proxy server (small footprint, only 60k) and provide
a .dll that DBC or DBP could use to talk to the proxy. The proxy would simply relay all data to all users currently logged in. In fact, i think I have a version just laying around for testing. It works fine, it just needs some customizing work (removal of things not required by DB or your server). I can't really devote much time to it yet, but it is on my todo list for my own server.

> added this thought too late....

oops... just visited your website, you "sell" server time. Disreguard my post, i thought you simply had a "spare" PC like I do that just happens to be connected to the internet via cable. Thats how I'll setup my server. I'll use my FTP site to maintain up to the minute ISP information for connecting users.

internet gaming group
MicroMan
22
Years of Service
User Offline
Joined: 19th Aug 2003
Location: Stockholm, Sweden
Posted: 12th Nov 2003 03:54 Edited at: 12th Nov 2003 04:00
Can you bind DBP to a particular socket and port with DirextX netplay, and can you use TCP rather than UDP (which I assume they use in Netplay)? If so, it shouldn't be a problem to make DBP talk natively to any internet service from WHOIS to HTTP since many of the so called protocols are in fact plain text commands on top of TCP rather than anything in particular.

So, if you can bind a socket to say port 80 you should be able to have a communication with a website and both send and receive data from it.

Edit:
I just looked in the examples in DB Pro and there's a section on FTP. If DB Pro can use FTP then it can use all the other protocols as well, natively.

It's just a matter of writing code to handle the plain text responses from the website, as well as any data coming up or down the opened pipe.

-----
They SAID that given enough time a million monkeys with typewriters could recreate the collected works of William Shakespeare... Internet sure proved them wrong.
-----
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 12th Nov 2003 09:08
- Can you bind DBP to a particular socket and port with DirextX netplay
Nope

- and can you use TCP rather than UDP (which I assume they use in Netplay)?
Nope

- If so, it shouldn't be a problem to make DBP talk natively to any internet service ...
Yep, it's a problem ATM

- I just looked in the examples in DB Pro and there's a section on FTP. If DB Pro can use FTP then it can use all the other protocols as well, natively.
Nope, not yet


Maybe I should get my 'Stevens' book out, blow the dust off, and write a plug-in ...
MicroMan
22
Years of Service
User Offline
Joined: 19th Aug 2003
Location: Stockholm, Sweden
Posted: 12th Nov 2003 09:31 Edited at: 12th Nov 2003 09:38
Hey hey.... Just a mo... Back... No, you're right. It's a special command for ftp access.

D**nit.

But still, it shouldn't be too hard then to fix since socket streaming rather than datagrams has to be in there in DBP. According to RFC 959 FTP is apparently a streaming protocol that uses TCP and not an UDP...

It's not availible to the DBP coder, then. You're right about that. Perhaps I should study this DirectPlay thing as well, and not just read dusty old RFC's.

-----
They SAID that given enough time a million monkeys with typewriters could recreate the collected works of William Shakespeare... Internet sure proved them wrong.
-----
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 12th Nov 2003 14:32
HTTP is very easy - I recently wrote some code for work to record logs to an apache server
mhack2
22
Years of Service
User Offline
Joined: 10th Oct 2003
Location: USA, Earth, Sol[0,0]
Posted: 12th Nov 2003 17:43
Could somebody please create a dll that will give us access to sending/recieving string.. then we can implement POP3/SMTP, HTTP etc..

Please?

mhack
Ariel
23
Years of Service
User Offline
Joined: 15th Sep 2002
Location: Fort Mitchell, KY
Posted: 12th Nov 2003 19:16
I wrote a TCP and UDP library for DB Pro when it first came out. I no longer use DB Pro, but I've kept the library available. I had a post for this on "realgametools.com" some time ago, but it looks like that web site is gone.

Anyway, you can download it from:
http://www.lordsofvalour.com/tcpudp.zip

I also wrote a string functions library. Not sure if the string functions have been improved lately in DB Pro, but you can check it out at:
http://www.lordsofvalour.com/string.zip

Freeware, have fun.
LammaDog
22
Years of Service
User Offline
Joined: 8th Nov 2003
Location: California
Posted: 13th Nov 2003 03:19
@waffle

Me selling hosting is how I'm available to afford to have extra servers lying around on the net.

Now, I'm not 100% sure what direction I'm going on this game dev thing (besides adding another iron to the fire) and I'm looking hard at a different set of dev tools. However, I wouldn't be opposed to donating some server space to your project. As long as I don't get bumped into a big bandwidth bill.
waffle
23
Years of Service
User Offline
Joined: 9th Sep 2002
Location: Western USA
Posted: 13th Nov 2003 12:50
@lammadog i noticed you don't have an email button

I could do a small footprint (10k or less) generic server that monitors bandwidth and pauses if BW excedes X per minute. Such a generic server would be accessed in TCP with guarenteed packet delivery. A DLL could then be used to access the server. ProfessorKill would then need to resolve how the data was handled and prepare for what if the server pauses or if multiple games are sharing the server..... Currently, I can only do a windows server, i don't have access to a linix PC. That will be part of my todo list for next year. Send me an email if interested.

internet gaming group
ProfessorKill
22
Years of Service
User Offline
Joined: 3rd Nov 2003
Location: Frederick, MD
Posted: 13th Nov 2003 13:44
@Waffle

Sounds like a great plan. Let me know how I can help. Would the server have to necessarily pause if BW gets high? Couldn't it just report to LammaDog (log file or something) and then he could take action. Not sure how pausing would affect players. May lead them to a negative opinion of the game server quality. Not sure. Just thoughts.

@LammaDog

Can you do a windows box?

Mark
LammaDog
22
Years of Service
User Offline
Joined: 8th Nov 2003
Location: California
Posted: 14th Nov 2003 00:03
oops, I use windoze for my home PC, but all our servers are 100% RedHat. What language is your current server written in? Perhaps it wouldn't be too hard to port over?

And, I don't think I'd worry too much about the Bandwidth for something like this. It's just when you start running full client/server games with 8-64 players that it starts really sucking the BW. And we have our MRTG graphs that we monitor anyway.

@Mark, I see you added MSN
@Waffle, I'll drop you an email now, maybe you can add MSN too?

Login to post a reply

Server time is: 2026-07-26 14:30:56
Your offset time is: 2026-07-26 14:30:56