Shared.Message() ?
I'm trying to get the server to print something to a client's console. I found Shared.Message() in ConsoleCommands_Server so that looked hopeful to me but now in testing I cannot seem to get the existing list_players command to print anything. Is that supposed to work? Maybe a game needs to be in progress or other players exist or something?
More importantly How can I get the server to print something to the client's console?
More importantly How can I get the server to print something to the client's console?
Comments
So your code might look like this:
In case you don't want to construct this yourself you can also just use
I think I'm close but no joy. It could just be I'm doing something wrong but the trouble with troubleshooting is my mod acts differently when testing locally launching from launchpad to a published mod loaded on a dedicated server.
@BeigeAlert
When I use your method:
Using Launchpad: Text shows up on screen for a bit (kind of cool) but nothing in the console.
Real Server: Nothing on screen or in console but the text does show up in the log. (close)
@GhoulofGSG9
When I use your method:
Using Launchpad: Text shows up in the console (hooray!) but it shows up twice (meh).
Real Server: Nothing in log or console. (boo)
What other mods are on the server? Might be one of them is overriding the text behavior.
I would suggest to have a look at the Network Message part of my modding guide draft at https://goo.gl/128GvS .
That ServerAdminPrint(client, message) shows the message twice in the console of a local server (assuming you send it to the hosting client) is an expected behavior as the given method prints both into server's and target client's console. At a local server both console are the same so the message shows up twice
Also feel free to join the #modding channel at our discord if you have further project specific questions.
I had not set my mod.settings file to Read-only and (arg!) the publish_id had changed so when I thought I was testing new code on the server, I wasn't. That explains a lot, So frustrating.
I ended up going with
Great stuff. +1