CommandSigns with MobArena #80


  • New
  • Defect
  • Replied
Open
Assigned to _ForgeUser7307234
  • _ForgeUser7808958 created this issue Dec 4, 2012

    What steps will reproduce the problem?
    1. Setup a MobArena, config, and basically everything you would do normally.
    2. Using the plugin CommandSigns, use the command '/cmds 1 /ma join [ArenaName]' on a sign.

    What happens when you follow these steps? What should happen instead?
    --When you follow the steps, finishing with right clicking the commandsign (the one that should make you join the mobarena game), you are teleported to the Mobarena's spawn (/setwarp spawn), but from there on it doesnt register you as in the mobarena (it doesnt allow you to pick a class, ready up, and even do /ma leave, for it tells you that you arent in an arena).What steps will reproduce the problem?
    1. Setup a MobArena, config, and basically everything you would do normally.
    2. Using the plugin CommandSigns, use the command '/cmds 1 /ma join [ArenaName]' on a sign.

    What happens when you follow these steps? What should happen instead?
    --When you follow the steps, finishing with right clicking the commandsign (the one that should make you join the mobarena game), you are teleported to the Mobarena's spawn (/setwarp spawn), but from there on it doesnt register you as in the mobarena (it doesnt allow you to pick a class, ready up, and even do /ma leave, for it tells you that you arent in an arena).

    What version of the product are you using?
    v1.8.4 for CB 1.4.2-R0.1

    Do you have an error log of what happened?
    No error log; doesnt produce an error, it just happens

  • _ForgeUser7808958 added the tags New Defect Dec 4, 2012
  • _ForgeUser7808958 posted a comment Dec 4, 2012

    My bad about doubling the body of the ticket

  • _ForgeUser9042228 posted a comment Dec 29, 2012

    I presume you're not actually writing '[ArenaName]' on the sign as that variable isn't supported =P

  • Banes_NLNM posted a comment Jan 1, 2013

    Are you saying that the third argument is not supported?

    You name your arenas, for example one of my arenas is named "MobArena" without the quotation marks, and another as "MA2".

    I've set both up with '/cmds 1 /ma join MobArena' and 'cmds 1 /ma join MA2'. The results are identical to the original post. You are teleported into the Lobby, which happens normally when you type '/ma join MobArena'. However you are not considered as part of the Arena, you are unable to do anything related to the arena, as if you never clicked the sign and were just teleported there.

    I've tested with other sign plugins, such as SimpleCommandSigns / HiddenCommandSigns and those work properly, but they aren't exactly what I'm looking for. So whatever is not making the connection seems to point here lol

  • _ForgeUser6333539 posted a comment Jan 11, 2013

    This problem has been recreated in exactly the same way on my server. The only difference is that I'm using CommandSigns v. 1.8.8.1. The problem also persisted in the older versions as well.

  • _ForgeUser9042228 posted a comment Jan 12, 2013

    Okay, this is an odd problem. It's going to require some in-depth searching to find this. Are there any logs you can throw me?

  • _ForgeUser9042228 removed a tag Accepted Jan 12, 2013
  • _ForgeUser9042228 added a tag Waiting Jan 12, 2013
  • blablubb posted a comment Jan 19, 2013

    similiar problem with paintball: http:dev.bukkit.org/server-mods/paintball_pure_war/tickets/86-team-joining-lobby-errors/


    I took a look at your code: I think this "PlayerProxy"-thing is a bit overkill for your silent-stuff you are doing there and could also be done without implementing bukkits Player interface...

    However, from the fast look I took at the code, I am guessing that the problem is inside the CommandHandler class, run method:

    p = new PlayerProxy(p, silent); // you REALLY want to replace the default bukkit player object with your proxyPlayer (for every plugin.., this is no problem IF no other plugin attempts to solve their problems that way..) ? :(
        PluginManager pm = Bukkit.getPluginManager();
        PlayerCommandPreprocessEvent e = new PlayerCommandPreprocessEvent(p, "/" + command);
    
        pm.callEvent(e);
        if (!e.isCancelled())
          Bukkit.dispatchCommand(p, command); // did you know that player.performCommand(someCommand); would also do it?
      }
    

    I guess the problem is somewhere there.. Maybe replace this PlayerProxy-stuff with a class which simple holds a referenz to the player object (instead of implementing its interface), or some static methods for checking your silent/recepient stuff you are doing there and after your checks call the methods on the original object?

    Edit: Okay, I am pretty sure the problem is this playerProxy thing (same for CommandSender proxy):

    You are replacing all player objects with your own..for each command to be executed again..which is also generating a huge memory leak I would say, because each new proxyPlayer object holds a reference to the old one, building a huge chain, like a list of player objects instead of 1 object.. if I got everything right, of course..

    So, in summary: You are replacing the player object with your own, which holds a reference to the original Player object ( / the previous player object..). When the player performs a command, you send this to the original Player object by this:
    <<code>> public boolean performCommand(String command) { return this.originator.performCommand(command); } <<code>>

    So, the "old", original player performs the command, but not the "current" player (the one, you replace the old one with..in your run method above). So the command will very properly use the old, original player object inside it's execution, and not your own. Which would lead to problems inside the other plugin, from which the command comes from, if it stores the player object to compare it later, which then results in false results as the stored player and the player to be compared to are no longer the same. They would normally.. So a check of the form "is a player is some list, which represents that the player is currently playing mobarena/paintball" would return false, even if the "real" players are the same..


    This is just an idea. I only took a fast look at it and I am sure it has some flaws. But I am also sure that this (player replacing) is somehow the problem.



    Edited Jan 19, 2013
  • blablubb removed a tag Waiting Jan 19, 2013
  • blablubb added a tag Replied Jan 19, 2013
  • _ForgeUser9042228 posted a comment Jan 20, 2013

    @blablubbabc: Go

    This is definitely the problem. It's just that CraftBukkit's player is not listed in the interfaces of a CommandSender - it is therefore incompatible with our PlayerProxy, despite it having an identical structure.

    The whole proxy thing is needed if you don't want plugins to have the user's data or be able to send it messages. We act as a middleman controlling what the plugin will do to the player.

    We're currently making a new plugin from CommandSigns. This issue will be addressed and rewritten where possible. Otherwise, we'll have to take out the ability to perform commands silently and all sender data will be given freely to the plugin (may cause permissions issues)

  • blablubb posted a comment Jan 20, 2013

    Ahhh, now I get it! and I see the problem ..

  • _ForgeUser8838919 posted a comment Jan 27, 2013

    I had this problem too, what I did though was using the console to sudo the player and forcing the player to execute the command /ma join <arenaname>

    So ?/#sudo <name> ma join <arena>

  • _ForgeUser12468795 posted a comment Oct 21, 2013

    Here is how u doit get plugin MagicSigns then on the top line do [command] /ma j [arenaname] and then do /ms edit mask and change it how u would like it


To post a comment, please login or register a new account.