Valhalla Legends Forums Archive | General Programming | VB with websites

AuthorMessageTime
Anubis
Hi, I've been making a chat server/client (in VB6) and I've been having trouble getting it to work over networks (If I'm on a network and my friend is on a different network, it wont connect.) Is there a way to do something like WebBot (Where it connects and sends/recieves data on a website)? If anyone can give me any help on this that would be great. Also, if anyone could give me some sample code that would be nice too :) I'm new to using VB with websites... Thanks
July 28, 2003, 5:07 AM
Camel
You are probably way in over your head, but I'll give you the benefit of the doubt and try to answer your question anyways.

There are basicly two approaches you can take: one is to use HTTP Push and Pulls to immediately send data as it is updated, and the other is to store all of the information in a database that a script will read and create html for. You will need some program -- be it a custom server or custom bot -- to have access to the database and update the database with chat/the userlist as they change. One alternative to this would be to use BotNet; I wont get too detailed on this method.

If you are new to any of these concepts, I suggest you do some research on SQL databases, PHP, and possibly even ODBC (unless you are going to use MySQL).
July 28, 2003, 6:12 PM
Adron
[quote author=Camel link=board=5;threadid=2114;start=0#msg16273 date=1059415973]
There are basicly two approaches you can take: one is to use HTTP Push and Pulls to immediately send data as it is updated,
[/quote]

Could you explain this method some more? What ways are there for pushing updates to a client? Like, know any better method for updating an image than pushing animated gif frames down to the client?
July 28, 2003, 6:24 PM
Camel
[quote author=Adron link=board=5;threadid=2114;start=0#msg16276 date=1059416689]
[quote author=Camel link=board=5;threadid=2114;start=0#msg16273 date=1059415973]
There are basicly two approaches you can take: one is to use HTTP Push and Pulls to immediately send data as it is updated,
[/quote]

Could you explain this method some more? What ways are there for pushing updates to a client? Like, know any better method for updating an image than pushing animated gif frames down to the client?
[/quote]

One can do that? Wouldn't the browser not draw the picture until it's finished downloading, which would never happen?

Well, to answer your question, no I don't know a better method, per say. I would probably have the picture just refresh itself automaticly. If the browser refuses to download the picture because it wants to cache the image, you might try adding a random unused number at the end of the url, ex: http://www.domain.com/images/picture.php?seed=<random>, and then using JavaScript to update the url of the picture with a new random seed on a timer.
July 28, 2003, 9:04 PM
Adron
Well, if you look at my avatar you'll see a gif that keeps sending down frames to the browser... The problem is that because of their slow computers, some people complain that it's using 100% of their CPU after 30 seconds.
July 28, 2003, 9:06 PM
Camel
[quote author=Adron link=board=5;threadid=2114;start=0#msg16297 date=1059426395]
Well, if you look at my avatar you'll see a gif that keeps sending down frames to the browser... The problem is that because of their slow computers, some people complain that it's using 100% of their CPU after 30 seconds.
[/quote]

Right, that was what I was concerned with. I havn't played around with HTTP Push at all, but perhaps it is possible to send some command that will cause the client's browser to refresh the image? Then you would be able to send that, for example, every 30 seconds or whever the song changed or something.

[edit] Oh yeah, and how did you draw the spectrum? Is it winamp, and if so is there an sendmessage command or something?
July 28, 2003, 9:14 PM
Adron
Hmm. I suppose I could actually send a Refresh header. I wonder if a browser will refresh an image though? I'm not sure if it only works for html pages...

I drew the spectrum "by hand" from raw spectrum data received from the Winamp plugin interface.
July 28, 2003, 9:30 PM
Camel
[quote author=Adron link=board=5;threadid=2114;start=0#msg16307 date=1059427859]
Hmm. I suppose I could actually send a Refresh header. I wonder if a browser will refresh an image though? I'm not sure if it only works for html pages...

I drew the spectrum "by hand" from raw spectrum data received from the Winamp plugin interface.
[/quote]

Possibly -- if the browser isn't crap, I dont see why it wouldn't...
Could you perhaps just assemble as many frames of the gif as is required to get the title to cycle once, and then have it loop?

Ahh, that makes sense. You must have been really bored, though. ;)
July 28, 2003, 9:36 PM
Adron
Not all that bored, it was rather interesting. I learned:

How to write an ISAPI plugin

How to write a Winamp plugin

How to have a memory DC where I alternately write using GDI functions and touch the memory directly

How to compress data using the Lempel-Ziv algorithm (implemented compressor)

How to encode a GIF



I'd say 75-90% of the code was new and interesting things. A very good learning project. Very much more interesting than anything that has a GUI.
July 28, 2003, 9:38 PM
Adron
Hmmbtw, by "by hand" I mean that I write it pixel by pixel in a loop...

And it's displaying data live from my Winamp - I'm seeing it moving in sync with the music.
July 28, 2003, 9:40 PM
Camel
[quote author=Adron link=board=5;threadid=2114;start=0#msg16310 date=1059428296]
Not all that bored, it was rather interesting. I learned:

How to write an ISAPI plugin

How to write a Winamp plugin

How to have a memory DC where I alternately write using GDI functions and touch the memory directly

How to compress data using the Lempel-Ziv algorithm (implemented compressor)

How to encode a GIF



I'd say 75-90% of the code was new and interesting things. A very good learning project. Very much more interesting than anything that has a GUI.
[/quote]

Ever used OpenGL? It's phuuuuuuuuun.
[me=Camel]considers rendering a frame with OpenGL and then dumping it to a streaming online picture...[/me]
Hey Adron, you interested in doing that? PM me.
July 28, 2003, 9:41 PM
Adron
What nice thing could I do with OpenGL? I'm a little sceptical mostly because I associate OpenGL with producing 3D graphics - lots of graphics at high speed - which would totally kill bandwidth if put as a streaming gif...
July 28, 2003, 9:50 PM
Camel
I was thinking more along the lines of expanding the winamp thing -- it's easy to produce cool looking small images with OpenGL because of the effects it provides. One need not draw frames at high speeds.
July 28, 2003, 9:58 PM
Adron
Hmmm... I like to draw this one at "realtime" speed so I see it move to the music. Any example of what I could do with OpenGL?
July 28, 2003, 10:01 PM
Camel
[quote author=Adron link=board=5;threadid=2114;start=0#msg16316 date=1059429666]
Hmmm... I like to draw this one at "realtime" speed so I see it move to the music. Any example of what I could do with OpenGL?
[/quote]

Meh, AIM me and I'll send you a screenshot or something.
July 28, 2003, 10:07 PM
Adron
Well, I don't have AIM....
July 28, 2003, 10:08 PM
Camel
ICQ? MSN? Yahoo?
July 28, 2003, 10:29 PM
Adron
Couldn't you just simply post a link to it? That way everyone can see an example too...
July 28, 2003, 10:30 PM
Camel
Well here's an extremely simple project I did to prove a friend wrong and win $5. He wrote a Boids! program (simulates flocking birds) with Java, and argued that it would be easier to do it in C with OpenGL.
This really doesnt do justice to the power of OpenGL, but it does prove a point: OpenGL isn't that hard to use.

There was no need to add any special effects such as those one might use in a winamp plugin.

[img]http://camel.ik0ns.com:84/images/boids.jpg[/img]

[edit] Here's another screenshot -- each color is a "team" of birds that is avoiding eachother:
[img]http://camel.ik0ns.com:84/images/boids2.jpg[/img]
July 28, 2003, 10:38 PM
Adron
Hmm, it isn't immediately obvious how it would apply to Winamp? Of course, I could make generic graphics, but I can do that just using GDI - no need for OpenGL to do that?
July 28, 2003, 10:40 PM
Camel
[quote author=Adron link=board=5;threadid=2114;start=15#msg16325 date=1059432035]
Hmm, it isn't immediately obvious how it would apply to Winamp? Of course, I could make generic graphics, but I can do that just using GDI - no need for OpenGL to do that?
[/quote]

You could, but it would be much easier to do it using OpenGL. One of the things it does rather well is "glowing orbs" which can be used to produce a huge variety of effects.

[edit] Oh yeah, and it can do teapots. I mean, come on...teapots! Resistance is futile!
July 28, 2003, 10:47 PM
Adron
I used to mess around with 3d studio max, but .. it got boring. What's a "glowing orb"?
July 28, 2003, 10:53 PM
Adron
Do you have any more info for that birds program btw? It would be interesting to see the algorithm for how they fly...
July 28, 2003, 10:54 PM
Camel
[quote author=Adron link=board=5;threadid=2114;start=15#msg16327 date=1059432819]
I used to mess around with 3d studio max, but .. it got boring. What's a "glowing orb"?
[/quote]
It's like a luminous ball of light. They are extremely over-used in Unreal Tournament. If you've ever tried to set up a PLBot in counterstrike, you might recognize them as the yellow "nodes" used to tell the bots where they can go. I'll see if I can get you a screenshot.

[quote author=Adron link=board=5;threadid=2114;start=15#msg16328 date=1059432897]
Do you have any more info for that birds program btw? It would be interesting to see the algorithm for how they fly...
[/quote]
I dont do it properly as I was just proving him wrong on the OpenGL part. I only glanced at his code, but it looked like it went through a loop for every bird and then another loop to find out all of the birds within a pact or something. It would then locate the centermost bird of the pact, and follow it around. The white circle represents a barrier that the birds must avoid.
With my code, the birds just turn based on obstacles and the direction of birds immediately surrounding them.
July 28, 2003, 11:00 PM
Adron
Ah. I like doing simulations. I might make a streaming simulation of flying birds instead, if I get the right algorithm.... ;)

The slowdown is a rather serious problem though. Trying to see if it works with Refresh will be interesting.
July 28, 2003, 11:05 PM
Camel
[quote author=Adron link=board=5;threadid=2114;start=15#msg16330 date=1059433533]
Ah. I like doing simulations. I might make a streaming simulation of flying birds instead, if I get the right algorithm.... ;)

The slowdown is a rather serious problem though. Trying to see if it works with Refresh will be interesting.
[/quote]

Right, that's sort of what I was thinking of. I was a little more interested in having the picture reacting to the music though. It's not imperative to update immedately. Imagine having it update really quickly, but only taking one in every, say, 50 frames and sending that. Then stop drawing the other 49 frames. :)
July 28, 2003, 11:26 PM
CaBAM
Wow, i just noticed how much the subject changed...
July 29, 2003, 4:38 AM

Search