Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
QB64PE Chat Server
#11
(05-30-2024, 07:35 PM)Dav Wrote: I never realized until studying this code that CLS can use an image.handle.  That's neat. 

Chat works fine the few times I've connected. 

- Dav
That was added a few versions ago after a suggestion I made to add it. Very handy to not have to _DEST to an image just to clear it and then _DEST back out to the previous destination.
New to QB64pe? Visit the QB64 tutorial to get started.
QB64 Tutorial
Reply
#12
(05-30-2024, 10:30 PM)TerryRitchie Wrote:
(05-30-2024, 07:35 PM)Dav Wrote: I never realized until studying this code that CLS can use an image.handle.  That's neat. 

Chat works fine the few times I've connected. 

- Dav
That was added a few versions ago after a suggestion I made to add it. Very handy to not have to _DEST to an image just to clear it and then _DEST back out to the previous destination.
One of these days, I plan on trying to expand that functionality to everything else (like POINT, PSET, LINE)...   But there's only so many hours in a day!  Between farming, and all this BLEEPING rain and the damage it's did, and trying to catch up to the KotD list, and working on my little chat server toy, and helping folks with posts on the forums and discord and emails and lions and tiggers and bears!  OH MY!!

Soon(tm), I'll try and cycle back around to expanding another keyword to take optional image handles.  Soon, I swear(tm)!!   Big Grin
Reply
#13
Here's an idea Steve: If you could just commute a few thousand Km west every few hours, you could have 30, 40, maybe more hours in your day...
then you could handle those extra little things. The devil makes use of idle hands, you know!
Of all the places on Earth, and all the planets in the Universe, I'd rather live here (Perth, W.A.) Big Grin
Please visit my Website at: http://oldendayskids.blogspot.com/
Reply
#14
Hey Steve, is there a way to eleminate the long no connection hang when the program starts and attempts to open the connection but the server isn't online?  Takes about a minute before the chat program can be terminated when that happens. 

- Dav

Find my programs here in Dav's QB64 Corner
Reply
#15
After taking a break for this for several days, I'm back around to playing around with it once again.  The client (you'd want to grab a copy of the new version from the initial post in this topic as I'm keeping it updated as I go) now no longer follows the rules of Twitter -- 255 characters or less per message.

Now you can send data streams of up to 65535 bytes in size (unsigned integer), and the Input area even tells you how much text you're sending at once.   Now you can REALLY spam the heck out of someone with a long arse message!  Wheeee!!!

And...   

Are you ready for it?

Huh?

Huh?

Are ya???

Okies then....

YOU CAN EVER PASTE JUNK INTO THE CHAT TO SEND!!!

Spamming crap is now easier than ever before!   Copy a bunch of text from somewhere.   CTRL-V and paste it into the chat area.  Hit ENTER!    Viola!   You're now hated by everyone.  

Big Grin



Seriously though, this newest version:
1) Expands data transfers from 250 bytes to 65535 bytes.
2) Adds clipboard posting with CTRL-V.

I'll leave the host up for most of the day today, if anyone wants to pop in and play around with it and test junk out.  It'll probably disappear again tomorrow, as I'm going to try and work on the color enhancements and such then, but folks can play with it for now, if they want.  Smile
Reply
#16
It runs with a small extension: a query as to whether the server should be started.
It bothered me that the server started immediately.  Wink

Code: (Select All)

'Steves Chat Programm - 5. Mai 2024

Option _Explicit
$Color:32
Const Port = "7319", IP = "172.93.60.23"
Const FullPort = "TCP/IP:" + Port
Const FullIP = FullPort + ":" + IP

Dim Shared As Long client 'up to 1000 connections
Dim As String recieved
Dim Shared As String nam
Dim Shared As Long MainDisplay, TextArea, InputArea
Dim Shared As _Float NextPing, server_active
Dim Shared As _Byte TimeStamp 'toggle type display variables
Dim Shared As _Unsigned Long DefaultColor, AudibleAlert

MainDisplay = _NewImage(1280, 720, 32)
TextArea = _NewImage(1280, 600, 32)
InputArea = _NewImage(1280, 120, 32)

DefaultColor = White
TimeStamp = -1
AudibleAlert = -1
Screen MainDisplay

'A query as to whether the server should be started.
Dim As String antwort, yes

Locate 3, 3
Input "Server starten: Yes -- No: ", antwort
If antwort = "yes" Then
  client = _OpenClient(FullIP)
Else
  Locate 5, 3
  Print "Tschuessi!": Sleep 2
  System
End If

Two warnings. I don't understand "Yes" now. - Update: It's clear to me now.

[Image: Chat-Warnung2024-06-05-170059.jpg]
Reply
#17
(05-29-2024, 03:39 PM)SMcNeill Wrote: A work-in-progress, but it's now to the point that it does the very barest of TCP/IP communication back and forth across the internet.

...

I'll leave the host up and running all day, 
Would you post the host so we can play with it between 2 computers on a LAN?
Reply
#18
Feature request added:

You can now type in the command /LIST or /USER or /USERS and get a list of who's currently logged in and online at the moment.

/LIST
/USER
/USERS

^All do the same thing, for convenience's sake -- they give you a list of who's logged in.

NOTE:  This doesn't tell you if they're actually paying attention to their screen or anything.  It just tells you who is online and getting messages that you send.  It doesn't mean they're not on a potty break or something and not at the keyboard to respond to your typing.  Big Grin



Also cleaned up code a bit.   Fixed a few minor display glitches with the system messages and such.

Client is at first post, updated and good to go once again.



@madscijr -- I'll share the host at a later time. Right now, it's in a constant state of flux. For every update here, I do 20 updates to it, tweaking things just this little bit, or that tiny bit, or this HUGE amount.... By the time I posted it, it'd just about be outdated. Wink
Reply
#19
(06-05-2024, 09:42 PM)SMcNeill Wrote: @madscijr -- I'll share the host at a later time.  Right now, it's in a constant state of flux.  For every update here, I do 20 updates to it, tweaking things just this little bit, or that tiny bit, or this HUGE amount....  By the time I posted it, it'd just about be outdated.  Wink

Makes sense! I just dug up an old VB6 peer-to-peer chat program and wanted to compare it to QB64 equivalent. Hmmm... maybe GPT can convert it over... but then I'd have to sign up and all that. Maybe later! Tongue
Reply
#20
Server back offline once again, for the night.  I'll let you guys know when it'll be back later.  Smile
Reply




Users browsing this thread: 1 Guest(s)