Approved [v1.12] SendRaw

Discussion in 'Plugin Releases' started by efreak, Apr 29, 2012.

  1. efreak TShock Plugin Developer

    What does it do?
    Sendraw allows you to broadcast raw messages to the server, without having them prefixed by (Server Broadcast). It also allows you to impersonate other users.
    Permissions:
    sendraw - allows users to use /sendraw
    sendcolor - allows users to use /sendcolor*
    sendrgb - allows users to use /sendrgb*
    sendas - allows users to use /sendas

    Commands:
    /sendraw [message] - [message] is broadcast to the server as a normal message
    /sendcolor* [color] [message] - [message] is broadcast in the color specified. Valid colors are defined by the C# color table (official docs). Primary and secondary colors are all in there.
    /sendrgb* [R] [G] [B.] [message] - [message] is broadcast in text color defined by rgb values.
    /sendas [player name] [message] - [message] is broadcast to the server as though [player name] has said it, with the correct group color, prefix, and suffix

    To Do:
    Perhaps hardcode it so sendas can only be used by superadmins? Not sure.
    A command to replace /sendwhite and /sendred that allows you to choose from some basic colors
    A command to further customize the color by allowing you to choose the exact rgb for it.
    Allow you to use sendas using players who are not currently logged in (I think this may require looking at the database, not sure).
    Send a note to the log every time this command is used.

    Downloads:
    Latest version
    Source Code
    VS project (.zip)
    *You'll probably want to set up shortcommands for these commands with prefixes and whatnot, with individual permissions, rather than giving people permission to use this.

    June 12:
    updated to api 1.12.
    I will not be working on this anymore, other than committing drop-in code replacements that compile as-is. If you would like to take over development, contact me with your github username and I'll give you access to the repository.
    June 22:
    Fixed internal api version number
  2. Olink TShock Developer

    Just a tip: Host your code on github, then you only need one link for source and project.
  3. efreak TShock Plugin Developer

    Done, but I'm keeping the multiple links for easy copy/paste (for myself and any others who require direct links for terminals). When I get home to VS, I'll set it up with git properly and unlink the files from my dropbox. If anyone else wants access to commits, ask (I'm incredibly lazy, and may not update the api myself).
  4. efreak TShock Plugin Developer

    Have added basic support for SendColor (recognizes the built-in colors) and SendRGB (for sending custom rgb colors, recommend you use shortcommands with this one). Will check for errors, etc at home, have no c# IDE here other than github's built-in editor (which is a nice change from notepad).
  5. efreak TShock Plugin Developer

    Created sendrgb and sendcolor to replace sendwhite and sendred.
  6. popstarfreas Active Member

    what if my server uses something different than a colon? like "guy: hi" would come up but i set the structure as "guy - says - hi"
  7. efreak TShock Plugin Developer

    I believe that's defined in the config file, in which case you need to recompile it with line 95 changed appropriately. Alternatively, you could just use sendrgb and specify the color manually with his name. I'll look and see if I can find the code that parses the config file and see how it works, but I won't have much time for the next couple of weeks. In the meantime, I can recompile it for you with that setting if you like, just let me know what your prefix is. I also have plans to add actions.
  8. Snirk Immington TShock Plugin Developer

    You can code it to use the config's stuff. Here's the psuedocode:
    PHP:

    args
    .Player.SendMessage(string.Format(Config.ChatFormatply.Group.Prefixply.Nameply.Group.Suffixmessage), ply.Group.R,ply.Group.B,ply.Group.G);
    args.Handled true; return;
    Olink likes this.
  9. popstarfreas Active Member

    ok well one thing with /sendcolor and /sendrgb is that there is a slight space before it. my prefix is " - says - " including the spaces before and after the -
  10. Olink TShock Developer

    Snirk Immington likes this.
  11. efreak TShock Plugin Developer

    API updated to 1.12 (untested as I'm no longer actually running a server, but I didn't make any code changes and it compiled fine)

    I will not be developing this project anymore. If you would like to take over, tell me your github username and I'll add you to the repository (or fork it and give me a link, I'll post it up there). I will try to maintain the api version, but since I'm no longer running a server for myself, it may be a bit slow; send my username an email at efreakbnc.net if I miss one.
  12. Wolfe Member

    I laughed a little...

    Edit: The latest version link still leads to an outdated version.
  13. SpIit Member

    Works fine with ignoreversion but API version is misleading...
  14. efreak TShock Plugin Developer

    Hmm. I recompiled it with newer .DLLs. I'll look at it again in a few minutes.

    Edit: I forgot to update the internal api version. Doing that now.

    Edit2: Done. Try it now.
  15. Alrof Member

    This is a great plugin
  16. popstarfreas Active Member

    Ok so what if i changed the chat format structure?
    "ChatFormat": "[{1}] <{2}>{3} : {4}",
    How do I add in those?
  17. Alrof Member

    What about /chat color 255,255,255 (RGB)
    And /set prefix "prefix"

    ???
  18. cccdfern Member

    Code:
    /sendcolor* [color] [message] - [message] is broadcast in the color specified. Valid colors are defined by the C# color table (official docs). Primary and secondary colors are all in there.
    /sendrgb* [R] [G] [B.] [message] - [message] is broadcast in text color defined by rgb values.
    You sir need to read the things in front of you; as to the other, it seems the idea here is to send a good global message, without adding 'broadcast' to the text, ie adding a prefix wouldn't do much for it.
  19. Alrof Member

    i did read this but this has too be done per mesage
    i was talking about seting it permalanly
  20. Wolfe Member

    Make a short command for it.

Share This Page