Is there a way to directly communitcate with anouther client without having to message the server first, Like say I wanted to print something to the other persons console, Can I do that?
Yes, but depending on what your trying to do its most likely to much work for what its worth.
What are you trying to do?
I just want to send a message to the user to print in there chatbox, As this will be happening alot I just though I could do it directly to take the load off the server, How is it possible?
no, the server exists for this reason, have the server be the manager of everything and tell clients information.
What I mean is, Is there a way to print to the users chatbox without having to use net libary?
You’d have to use an external networking module (a binary one), which would have to connect the players directly.
Simply it’s not worth it. Just do it in a proper way, chat messages are nothing for the server compared to networking in some addons.
You could use the User Message library, the lesser known and objectively better way to send information from server to client and vice versa.
Thats not what I ment, I ment without setting anything up on the server, Just call a function on client like
for k , v in pairs(players.GetAll()) do v:ChatPrint("Some message") end
Just use net messages, man. The performance cost is negligible at worst, and I doubt anything in your plugin would be more efficient by bypassing the server.
Clients do not create a connection with each other. No matter what you do, client -> client communication goes through a (I guess you could use a web server?) server.
I know it goes trough the server, But can I do it without setting any up server side, So just call a function client side and it will automatically send to the other client without needing messages? Im trying to write a useful addon for myself that does this but cannot figure it out…
There is no built-in client function to directly communicate a message to another player without making a function on the server to do it for you.
There’s a reason that communications are set up the way that they are. Here’s a short allegory to explain why;
Imagine a world like ours, where people can use their phones to talk to eachother, but with one very small exception; in order to be able to call a specific other person’s phone, you have to register for a connection ticket between you and that person. This kind of thing takes many days to go through processing, but after you get it then you can freely make calls with that person as much as you want. Obviously, right off the bat, you realize that meeting a new person and having to make a call with them is very time consuming and difficult. And you can’t just get a connection ticket from everyone else on the planet, since you can only get one at a time. So obviously this is a difficult system for communication.
However, a large corporation comes in with a solution; you register one ticket with their phone, and they will redirect your call to whoever you like who is already registered with them. Basically, instead of you calling person A, you call the company, tell them you want to talk to person A, and then they call person A for you and redirect all voices into their phones between the two of you. This system is great because if you have a group of five people who all want to be able to call each other at any time, normally they would each have to register for a connection ticket for the other four members. But by going through the company, any one person only has to register for a single ticket with the company, and then they can all use it as a go-between to talk to eachother. Obviously this solution is slightly slower, and the company is able to hear your conversations, but it’s generally a much better solution than just registering a ticket for everyone else.
What I just described was the relationship between clients and a server; the people with cell phones are clients, and the company is a server. The time it takes to register for a connection ticket is the overhead for creating a new connection between two computers. You want to avoid this overhead as much as possible, which is why instead of direct communication, you go through the server to communicate to other users on the network.
Or in short, only a server<->client relationship exists, not a client<->client relationship. For clients to speak to each other, they must first talk to the server (who must allow them to talk to each other).
thanks guys, Some useful information here
If clients and clients could talk to each other, nigger shit we could abuse that to hell.
DHTML Meatspin baby