Results 1 to 7 of 7

Thread: ChatProgramLayouts

  1. #1

    Thread Starter
    Hyperactive Member alacritous's Avatar
    Join Date
    Aug 2003
    Posts
    464

    ChatProgramLayouts

    Hello,
    I was just thinking of an idea in my head, of a chat program. Basically its like CounterStrike. Although, I don't know much about the layout of CounterStrike. But basically the plan is, there is one huge server that displays the current servers, and in each server there are clients chatting, talking, etc. So here is the layout:

    HUGE SERVER > Multiple Servers(20+) > Multiple Clients(10+echs)
    echs=each server


    Its basically something like that. The reason I posted this, is because I want to know if that would work. I was thinking about how does a Server conenct to a Server...and basic stuff like that.

    Any ideas are appreciated!
    thanx
    alacritous
    Last edited by alacritous; Aug 25th, 2003 at 03:33 PM.

  2. #2
    Addicted Member
    Join Date
    Aug 2003
    Location
    USA
    Posts
    145
    A Server is really nothing more than a program with multiple sockets open on the program. (Use an array of the winsock control). You'll want another array of sockets to hold the servers that are connected to your servers. All you have to do is develop a sort of protocol so the clients and servers can communicate with your main server.

    There's not alot I can explain, I mean, the way data thats used to communicate is all up to you, so good luck.

  3. #3

    Thread Starter
    Hyperactive Member alacritous's Avatar
    Join Date
    Aug 2003
    Posts
    464
    Hello,
    Thanks for your quite response, but I have a few questions/concerns. I didn't understand what you meant when you said:

    You'll want another array of sockets to hold the servers that are connected to your servers. All you have to do is develop a sort of protocol so the clients and servers can communicate with your main server.

    Can you please elaborate?

    Basically I've already thought of how I'd like to send the data. Once a client connects, it looks at the 'MASSIVE SERVER' for server lists. This will be displayed in a list box. Then, if they click on an item in the listbox, it will connect to that server. In this server they may have a greeting bla bla and stuff and other people chatting. But basically you need to download different versions of 'NORMAL SERVERS' to start a server..some have greets and so forth...basically I'm going to start with a simple chat server then move on to more advanced things. The problem is, I need the 'MASSIVE SERVER' to run 24/7 or close...and I can't really do that...since of course on storms and stuff may get disconnected. But, its not like this is gonig to be the best chat in the world...unless anyone of you would like to help me create it. We can think of a name or anything...just mail me at [email protected] if your interested. Right now I'll start creating it alone.

    The only problem I could think of, is if I can have unlimited 'NORMAL SERVERS' how would I find the ports for them like for instance, 'Winsock.LocalPort = 10101'.

    Any other ideas or correction is appreciated!
    thanx
    alacritous
    Last edited by alacritous; Aug 25th, 2003 at 05:47 PM.

  4. #4

    Thread Starter
    Hyperactive Member alacritous's Avatar
    Join Date
    Aug 2003
    Posts
    464
    Hello,
    I was basically just experimenting with the 'NORMAL SERVER' and 'CONNECTED USER'...since I hadn't done winsock in a few weeks. I got it to work, but there is one problem, I can't get 2 clients/connect users to connect to the 'NORMAL SERVER'. I know you use multiple connections, but how? I've never really done that. Basically after I get that figured out I'll work that out, then I'll be able to create the 'MASTER SERVER', which will probably be the hardest.

    Help IS appreciated =)
    thanx
    alacritous

  5. #5
    VB6, XHTML & CSS hobbyist Merri's Avatar
    Join Date
    Oct 2002
    Location
    Finland
    Posts
    6,654
    Basically from the main server's perspective:

    - I'm listening to the connections port
    - Woah! A connection request! Send a reply to tell to use port 5324
    - The client is happily connected to me!

    From the client's perspective:

    - I gotta connect that darn server. Here I go...
    - Yay! I got connected! He tells me to switch to port 5324... so here I go
    - Connected! He really listens to me what I'm saying


    You should take a look at IRC protocol. RFC 1459 and RFC 2810 - 2813.



    WinSock(0)
    WinSock(1)
    WinSock(2)
    ...

    That's an array. If you didn't happen to know...

  6. #6

    Thread Starter
    Hyperactive Member alacritous's Avatar
    Join Date
    Aug 2003
    Posts
    464
    Hello,
    I got pretty much everything, except for one thing, I still can't get the multiple winsock connections, I know you use arrays, but I can't seem to get it to work. I guess I'll post my code...and you maybe edit it or just tell me what to do (btw its not a school assignment...so). Also, can you have unlimited sockets? If not, I'd like to have 5 to start out with..or 2 and I'll add them...

    thanx a ton,
    alacritous

    http://vbforums.com/attachment.php?s=&postid=1510591
    Size=5kb
    Name=MassiveServerChatProgram.zip

    EDIT: opps, I forgot to delete some code, I was recently working on, if the client leaves it will remove from the listbox...so remove
    VB Code:
    1. Winsock.SendData "EU" & UserName
    2. DoEvents
    On the client side, on the event Winsock_Connect()
    Attached Files Attached Files
    Last edited by alacritous; Aug 26th, 2003 at 04:02 PM.

  7. #7

    Thread Starter
    Hyperactive Member alacritous's Avatar
    Join Date
    Aug 2003
    Posts
    464
    *BUMPER CARS RULE!*

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width