Jump to content

Is there a way to broadcast a message to everyone with the dedicated server ?


Recommended Posts

Hello everyone!

 

Is there a way to broadcast a message to everyone with the dedicated server ?

 

i plan to restart the server at midnight, and i want 5 minutes before the server restart, to broadcast a warning.

 

 

i'm running ubuntu.

Link to comment
Share on other sites

@Pyromailmann, But... okay, the scenario he was talking about is this: when you run the dedicated server program, it brings up a console window (aka a shell), which prints out stuff like the in-game log. Using -console in the launch options for the dedicated server allows you to type console commands into that shell. Nofew was asking why -console wasn't on by default.

Link to comment
Share on other sites

...press "Y" for global chat...

...press "U" for whisper...

 

O___O

 

I want to broadcast the mesage while i'm not on the server itself or in the screen session... just a warning that the server will restart. 

 

I am looking at something that will connect to the screen session in the background, then broadcast the message, then detatch the screen session.

Link to comment
Share on other sites

Blargle-blah. c_announce doesn't work. It just says "attempt to call a nil value" a few times. I'm entering:

c_announce("Testing, testing...")

-- What am I doing wrong? c_announce("testing, testing..." 0) returns the same thing, as does inserting a comma in the appropriate spot. x.x

Link to comment
Share on other sites

@Nofew, That's weird... are you sure you're not leaving something out? For example, it can say that if you forget the trailing parenthesis. I guess show us the log after you try to use it?

 

It's defined in scripts/consolecommands.lua, which should definitely be loading...

Link to comment
Share on other sites

I've got a vague notion that it might /need/ another parameter even if it never uses it. I think I've seen this error before for that reason, but can't remember where or how I got past it..

c_announce("Testing announcementstuffs, don't panic!")

[03:33:29]: ConsoleInput: "c_announce("Testing"

[03:33:29]: attempt to call a nil value

[03:33:29]: ConsoleInput: "announcementstuffs,"

[03:33:29]: attempt to call a nil value

[03:33:29]: ConsoleInput: "don't"

[03:33:29]: attempt to call a nil value

[03:33:29]: ConsoleInput: "panic!")"

[03:33:29]: attempt to call a nil value

Link to comment
Share on other sites

@Nofew, Something really weird is happening to the quotes there, as you can see it's splitting up the command into 4 separate commands, as if you had done something like this:

c_announce("1") c_announce("2") c_announce("3"), c_announce("4")

... as for why that's happening, maybe it's a Linux shell thing? (derp just read the top post without looking at names) The command would definitely have worked if you had typed it in-game that way. I guess... try escaping the quotes? So:

c_announce(\"Testing announcementstuffs, don\'t panic!\")

Edit: might need to escape the single quote too, so I added it there

Link to comment
Share on other sites

I'm running Windows. I thought of escaping them too, but the way it was working suggests that the quotes aren't at fault. Regardless, I tried it (with a string that doesn't contain a singular quote) and got this:

c_announce(\"Let me see if this works now...\")

[03:52:58]: ConsoleInput: "c_announce(\"Let"

[03:52:58]: attempt to call a nil value

[03:52:58]: ConsoleInput: "me"

[03:52:58]: attempt to call a nil value

[03:52:58]: ConsoleInput: "see"

[03:52:58]: attempt to call a nil value

[03:52:58]: ConsoleInput: "if"

[03:52:58]: attempt to call a nil value

[03:52:58]: ConsoleInput: "this"

[03:52:58]: attempt to call a nil value

[03:52:58]: ConsoleInput: "works"

[03:52:58]: attempt to call a nil value

[03:52:58]: ConsoleInput: "now...\")"

[03:52:58]: attempt to call a nil value

EDIT: The command: c_announce("Debugging...") works just fine! Maybe the thingy just hates spaces..

c_announce("Debugging...")

[04:02:29]: ConsoleInput: "c_announce("Debugging...")"

[04:02:29]: [Announcement] Debugging...

Link to comment
Share on other sites

@Nofew, Okay, so after testing it myself, I think this is a bug in the way it's handling console commands in the shell. It splits the command by space, regardless of what's going on in the command. So while c_announce("test") works, and c_announce("test",1) works, c_announce("test", 1) does not. It didn't seem to let me escape the spaces, either.

 

So I think that's why this isn't enabled by default :p. @MarkL you might want to look at this behavior for -console on dedicated server shells.

Link to comment
Share on other sites

  • Developer

@Nofew, Okay, so after testing it myself, I think this is a bug in the way it's handling console commands in the shell. It splits the command by space, regardless of what's going on in the command. So while c_announce("test") works, and c_announce("test",1) works, c_announce("test", 1) does not. It didn't seem to let me escape the spaces, either.

 

So I think that's why this isn't enabled by default :razz:. @MarkL you might want to look at this behavior for -console on dedicated server shells.

 

Thanks for reminding me,  I'll fix that darn space issue.

 

EDIT:

 

Fixed in the next build.

 

Link to comment
Share on other sites

While we are on the topic of console commands. I summoned deerclops and when I tried to use TheInput:GetWorldEntityUnderMouse():Remove()​ with ctrl first it did not work. Using the command without the ctrl crashed my game. Is this a bug?

Link to comment
Share on other sites

@jrose78, Use this instead:

c_select() c_sel():Remove()

it uses a different function that retrieves the client's mouse position instead.

 

As for the crash... it might be nice if it got fixed, but since it only happens if you mess with the console, I don't think it'd be high priority at any time in the near future. But I've encountered that as well.

Link to comment
Share on other sites

@jrose78, Use this instead:

c_select() c_sel():Remove()

it uses a different function that retrieves the client's mouse position instead.

 

As for the crash... it might be nice if it got fixed, but since it only happens if you mess with the console, I don't think it'd be high priority at any time in the near future. But I've encountered that as well.

 

Thanks Rezecib!

Link to comment
Share on other sites

I'd been getting around this by using underscores for spaces in announcements.

 

I also opened a ticket with my host, killservers, as I'd assumed the problem was in their web-console passing things to the console not in the console itself.  Looks like I owe them an apology on that ticket......

 

Glad to here Mark's getting it fixed, but I think I'll try the suggestion to use /32 and see if that passes through correctly, and if not, back to underscored announcements.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

Please be aware that the content of this thread may be outdated and no longer applicable.

×
  • Create New...