May 23, 2013, 01:24:49 PM

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - Malkierian

Pages: [1]
1
Plugins / [b38] TDSMPermissions 1.0! Now released!
« on: November 06, 2011, 10:12:51 PM »
Yes, that's right, with the imminent release of TDSM b36, Permissions will be available for all to use.  Here are the current features:

  • Multiple inherited groups
  • Group ranks
  • Group prefixes and suffixes
  • Build permissions (per group/per user)
  • Chat colors
  • Built-in chat formatting support
  • Restrict auto-download (for authentication)
  • Negative permission nodes
  • Global/semi-global nodes
  • Custom server nodes for server commands
  • Chat color, prefix, suffix and separator allow for multiple groups, and are all assigned to user based off of group rank

Still coming:
  • Separate user/group files
  • Graphical permissions file(s) editor
  • In-game commands

Now, how to use it?  Well, I made it to be almost exactly like Minecraft permissions plugins:

Groups:

the file starts out as such:
Code: [Select]
*groups:*Obviously.  I mean, really, how else would it start?  Unicorns?

The next node can be anything, but usually the name of the group would be useful:
Code: [Select]
groups:
    *Guest:*

After that, you start getting into the group information.  Usually, info is first:
Code: [Select]
groups:
    Guest:
        *info:*
Which can contain any of the following: default, prefix, suffix, separator, build, color, rank
  • Default is whether the group is the one guests are assigned to before registering; default value is false
  • Prefix is the chat prefix (before the player's message); default is blank
  • Suffix is the chat suffix (after the player's message); default is blank
  • Separator is the text between the prefix and the player's message.  Default is ": "
  • Build is whether the group/player is able to affect the environment at all; default is false
  • Color is the user's/group's chat color; default is 255, 255, 255.  This can be specified either as a three number string (255, 255, 255) or as a hash string ('#ffffff').  Hex can be lowercase or uppercase, but must be in single quotes, as # is the comment character in yaml
  • Rank is the group's rank.  Not applicable in User Info; default is -1

The other nodes that a group can have are permissions and inheritance.  Inheritance is a group that the group inherits permissions from.  Permissions is where the permission nodes are put.

The other nodes that a user can have are permissions and groups.  Groups is kind of required, otherwise a lot of the functionality is moot.  Obviously, that's where you put the groups the user is a part of.  Permissions are any extra permission nodes you want only the user to have access to.

So, all that being said, here is a simple example:

Code: [Select]
groups:
    Guest:
        info:
            default: true
            prefix: '[Guest] '
            suffix: ' - says a loser'
            rank: 1
            color: 200,200,200
        inheritance:
        permissions:
            - tdsm.who
    Member:
        info:
            prefix: '[Member] '
            build: true
            rank: 2
        inheritance:
            - Guest
        permissions:
            - tdsm.time
    Sponsor:
        info:
            prefix: '[Sponsor] '
            build: true
            rank: 4
        inheritance:
        permissions:
            - tdsm.give
    Moderator:
        info:
            prefix: '[Moderator] '
            build: true
            rank: 3
            color: 200,200,0
        inheritance:
            - Member
        permissions:
            - tdsm.kick
            - tdsm.ban
    Admin:
        info:
            prefix: '[Admin] '
            build: true
            rank: 4
            color: '#aa1111'
            separator: '~ '
        inheritance:
            - Sponsor
        permissions:
            - '*'
users:
    Herpina:
        info:
            color: '#ff0055'
        groups:
            - Admin
        permissions:
            - -tdsm.spawnboss
    Derpina:
        info:
            prefix: 'Herpaderp'
        groups:
            - Moderator
            - Sponsor
        permissions:
            - tdsm.op

Please note, there must be an extra newline at the end of the file, or it doesn't work right.  I'm trying to fix that right now.

Also note, the "- -tdsm.spawnboss".  That is a negative node.  Because Herpina is part of the Admin group, she inherits ALL nodes, both from plugins and from the server.  But suppose you don't want Herpina to be able to spawn bosses using the /spawnboss command.  You do a regular node, "- tdsm.spawnboss" and put a - right in front of it.  Make sure the space is between the two dashes.

Next note is that any info block values specified for a player are used BEFORE the group's info, e.g. Herpina is part of the Admin group, but her chat color ('ff0055') will be used instead of Admin's ('aa1111'), and Derpina's prefix will be Herpaderp, despite being part of the Sponsor and Moderator groups.

Finally, remember that you MUST use spaces for all your spacing.  YAML does not handle tabs at all, you will have errors.

DOWNLOAD
ZIP

Download and extract contents, as they are, into your server plugins folder.  This download contains the plugin, the example .yml, and the required YaTools library.

Oh, one more thing.  Server commands and their nodes can be found here:  http://wiki.tdsm.org/index.php?title=Permissions_Nodes

2
Announcements / Upcoming permissions system!
« on: August 25, 2011, 03:57:47 PM »
OK, so we've had a lot of requests lately, and feel the need to institute some kind of framework for permissions (as well as a default plugin that will use this framework, distributed from now on along with the server), and I felt it would be good to post on here explaining what we were thinking of doing, and get feedback from the users and plugin developers as to what they were hoping for in a system, to try to bring an overall good product to the table within the next release or two.

So, to avoid a lot of the very technical, down and dirty things, basically what we're wanting to do is to setup an interface inside the server that will hold the data for player registrations, groups and nodes, and setup an external plugin to load those settings into the interface.  What we were looking to get from you guys is suggestions on storage methods for node/other entry, and also what else to put into the plugin besides loading into the framework (like prefixes/suffixes for chat, etc).

A lot of the backend is still up in the air, as we're having trouble deciding just how to store these things in memory, the methods for access and setting, etc.  But at the very least we're planning on having the option for registering nodes to a command within the command registration system, or registering the command without a node and being able to handle permission checks on the plugin side (for commands that have dynamic output based on the node the player has who called it), and that would be via a player.hasPermissions("node") type of method.

3
Information / TDSM Command Line Arguments
« on: July 15, 2011, 03:57:07 PM »
Most of these are self-explanatory as to what they're used for.  I'll explain what you need to feed each on in terms of variable types.  Type them exactly as shown before the = sign, and separate all arguments and values by a space.

-maxplayers = integer value; default is 4; max is 255
-ip = string of the ip address (form xxx.xxx.xxx.xxx) to accept connections from; default is 0.0.0 (any)
-port = integer value for the port to communicate on; default is 7777
-message = MOTD/Greeting message, a string
-worldpath = File path (either relative to the server or absolute) to the world data, must include file name (i.e. world1.wld)
-password = String, represents password to use to allow connections to the server; default null
-allowupdates = true/false, true to allow automatic update feature to run on startup; default true
-npcdoorcancel = true/false true to keep NPCs from opening doors, false to allow; default false
-seed = integer, custom seed to use; default -1
-mapsize = small/medium/large, when not using custom world generation, these generate new worlds in the default manner; default small
-usecustomtiles = true/false, true to use custom tile size when generating a world; default false
-maxtilesx = integer representing the maximum number of tiles per row horizontally; default 4200
-maxtilesy = integer representing the maximum number of tiles per column vertically; default 1200
-numdungeons = integer, the number of dungeons to generate while making a world if customworldgen is true; default 1, max 3
-customworldgen = true/false, whether to use numdungeons and numislands while making a new world; default false
-numislands = integer, number of floating islands to generate while making a new world if customworldgen is true; default 6, max unknown
-whitelist = true/false, whether to use the whitelist for granting/blocking server access; default false
-pidfile = string, path to the PID File (use unknown to me :P); default null
-simpleloop = true/false, whether to use the in-testing simple server loop instead of the normal one; default false

Now, how you would use these is as follows:  say I wanted to start a server using port 7850, map size large, with two dungeons and 10 floating islands, using the simple server loop.  You would call the program as follows (don't forget to add "mono " before it if not using Windows):

Terraria_Server.exe -port 7850 -mapsize large -numdungeons 2 -numislands 10 -customworldgen true -simpleloop true

You must remember to set customworldgen to true if you want to use your numdungeons and numislands values.

Also note that using these arguments changes the values saved in server.properties, so if you're only doing one server, you only need to use them as you change them.  For multiple servers off of the same file, it's recommended to have a start script for each that includes the desired arguments.

4
Announcements / Some more chat changes
« on: July 06, 2011, 10:25:10 AM »
Hey everyone.  Due to TDSM's growing popularity (however slowly) we've decided to add a couple of channels to the IRC group.  We now have #TDSM, which is for general help, #TDSMdev, which is for plugin and development talk (you will be kicked if you break that rule!), and #TDSMOT, for those who want to simply socialize around TDSM.  Please be mindful of these differences as you choose your help channel (help with getting your server running, for example, would belong in #TDSM).

EDIT:  We've also added #TDSMGit for Git repository changes (pushes, commits, etc).  This is all this is for, there will be NO chat allowed in this channel.

5
Bugs / Two new bugs
« on: June 29, 2011, 10:22:51 PM »
Which, if you had still been on IRC, DeathCradle, you would have found out about.

First one:  On Windows, with debugmode = false, clients now freeze while connecting at "Requesting world information".

Second one:  One of two things happened:  A) You uploaded b15 without changing its version number, or B) You uploaded the b14 executable as the "b15" update, either of which results in an infinite update loop.

6
Programming / player.SetLocation issues?
« on: June 28, 2011, 05:22:26 PM »
Is there supposed to be another way of setting a player's position besides Player.SetLocation?  Because setting the location that way doesn't seem to be working right now. (Already tested to see that the Location being fed to it has coordinates different from the player's current position).

7
General Discussion / IRC channel
« on: June 28, 2011, 03:17:18 PM »
Hey, guys, with DeathCradle's permission, I have set up an IRC channel for us to talk on.  Dev talk, really (as any help questions could be useful to other users if posted on the forums).  But, if anyone can help, I'm sure they'd be willing to.

So anyway, join it!  #TDSM on esper.net

8
I'm sure many of you programmers out there would cringe at the phrase "nested structs".  I certainly do.  But in my efforts to get a Warp plugin going, I'm having trouble storing the warps in code.  Here's what I need:

List of usernames, each with their own lists of warps (which have names and locations).
The nested structs look like this:
Code: [Select]
private struct warpStruct
        {
            string name;
            Vector2 loc;
        };

        private struct userWarpStruct
        {
            int warpIndex = 0;
            string name;
            warpStruct[] warps;
        }

        private struct warpListStruct
        {
            userWarpStruct[] user;
            int userIndex = 0;
        };
This is the only way I can currently think of to accomplish the ability to search something for user Molokai, then find warp Dungeon and its corresponding location, in a single listing.  But the pragmatist in me says there HAS to be a better way of doing this.  I thought of possibly using Dictionary entries, but I'm at a loss as to how to nest Dictionary entries, as it were.

Any thoughts?

9
Programming / onPlayerCommand issue
« on: June 28, 2011, 12:26:53 PM »
OK, so I'm trying to make a warp plugin, and I can't seem to figure this error out.  This is my onPlayerCommand override:
Code: [Select]
public override void onPlayerCommand(PlayerCommandEvent Event)
        {
            if (isEnabled == false) { return; }
            string[] commands = Event.getMessage().ToLower().Split(' '); //Split into sections (to lower case to work with it better)
            if (commands.Length > 0)
            {
                if (commands[0] != null && commands[0].Trim().Length > 0) //If it is not nothing, and the string is actually something
                {
                    if (commands[0].Equals("/warp"))
                    {
                        Player sendingPlayer = Event.getPlayer();
                        if(commands[1] == null)
                        {
                            Program.tConsole.WriteLine("[Warp]" + Event.getPlayer().name + "Player used Plugin Command: ");
                            sendingPlayer.sendMessage("Warp plugin, For Build: #" + ServerProtocol, 255, 255f, 255f, 255f);
                            sendingPlayer.sendMessage("For help, type /warp help", 255, 255f, 255f, 255f);
                        }
                        else if(commands[1].Equals("+"))
                        {
                            if(commands[2] == null)
                                sendingPlayer.sendMessage("Add warp error: format must be /warp + <warpname>", 255, 255f, 255f, 255f);
                            else
                            {
                                xml.writeWarp(sendingPlayer, commands[2]);
                            }
                        }
                        else if(commands[1].Equals("-"))
                        {
                            if(commands[2] == null)
                                sendingPlayer.sendMessage("Remove warp error: format must be /warp - <warpname>", 255, 255f, 255f, 255f);
                            else
                            {
                                xml.delWarp(sendingPlayer, commands[2]);
                            }
                        }
                        else if(commands[2] == null)
                        {
                            xml.warp(sendingPlayer, commands[1]);
                        }
                    }
                }
            }
        }
And the error I get is:
Code: [Select]
Error Passing Event PLAYER_COMMAND to Warp
System.IndexOutOfRangeException: Index was outside the bounds of the array.
   at Warp.Warp.onPlayerCommand(PlayerCommandEvent Event)
   at Terraria_Server.Plugin.PluginManager.processHook(Hooks Hook, Event Event)
Molokai Sent Command: /warp +
No such command!
I'll keep working, but anyone got any idea what's happening?

10
Programming / Possible missing classes
« on: June 27, 2011, 04:48:11 PM »
I can't seem to find the PlayerLogin or PlayerLogout classes in Terraria_Server.Events.  Are they supposed to be part of PlayerStateUpdate, or are we actually missing things?

11
Programming / Standards for permissions
« on: June 27, 2011, 11:47:25 AM »
I've been thinking about the permissions thing, and how there's no linking of usernames to accounts on Terraria, and a friend reminded me about Steam IDs, and so I ask, does Terraria transmit any Steam information back and forth that we could tie into to get true permissions (making game names irrelevant and possible to have permissions across name accounts)?

12
Programming / Following the Exit command trail
« on: June 26, 2011, 11:03:48 PM »
OK, so, in lieu of someone here adding it, I started to look into adding the code for a restart command myself, but a little help would be awesome (I'm still a little new to the whole OOP scene).

I went to Command.cs, and found Exit().  Followed its reference to Server.stopServer(), then went to Netplay.stopServer().  That sets Statics.IsActive to false, which kicks the server out of the loop in Program.Main().  I then looked into the updater to see how it starts the new server, and am I right in assuming that you start a new instance of the server and let the one that downloaded the update exit?  Is there a way that you could do either one of two things here?

1) Arrange in Mac and Linux for it to somehow run through mono (I don't know if Process.Start can take arguments or anything) so you don't have update restart issues?  (I think on my last update on my server it errored out because it wasn't run with mono, and therefore didn't work).

2) Make it so it's able to restart instead of having to call another instance of itself and then exiting?

13
Requesting Assistance / REQUEST: Restart function for the server
« on: June 25, 2011, 12:57:35 PM »
I'd love to be able to have a command you can put in the console to restart the server instead of having to quit and run it again.

Pages: [1]

SimplePortal 2.3.3 © 2008-2010, SimplePortal