Sign in to follow this  
Tano_ITA

Private Message without a server?

Recommended Posts

Hello again, I've a sever where two or more player can chat without problems, but i need to create a private chat system. So I have thought "If i create a dynamic private server in each client, i can pass all private message directly to private server and not to the principal server!". So i've created this system and that's work fine! But! The main problem is when i try to open my private server on my client. That's because to open a Listen Server i need to open a port on my router! And i can't do that automatically. So now i ask to you what's the best way to create a private message system. 1. Using a private server on clients. 2. Pass all private message to the server. How work MSN? Anyone have some suggest? Thanks a lot!

Share this post


Link to post
Share on other sites
What is the mechanism for the multi-user chat so far? Is that a server that lets many players chat in a "chat room" type thing? And you want to create a PM type system without having to spawn loads of mini-servers?

I will assume now that your current server manages a list of sockets for each client connected (this also assumes you are using TCP/IP instead of a UDP broadcast over a LAN). Why not prepend an identifier of the target user to the message sent from the other user, and have the server read this and forward the message only to that client. In cases where no identifier is present, the server forwards the message to all connected clients.

Share this post


Link to post
Share on other sites
Just have the server allow you to send messages to a particular other client, instead of forwarding it to every connected client. If you're behind a router you're likely not able to expose public TCP servers, plus it would mean that you would need to know the IP of the other users which is probably not desirable.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this