How to test your plugin without having a friend

Discussion in 'Plugin Development' started by GreatBlitz, May 8, 2014.

Thread Status:
Not open for further replies.
  1. Offline

    GreatBlitz

    Often, one needs to test a plugin which requires multiple people like TagAPI where you need to see someone else's name tag.What does one do in such cases? When none of your friends are online?
     
  2. Offline

    Schaakmatth

    Ask for public server
     
  3. Offline

    IkBenHarm

    GreatBlitz
    log in twice, with another account
     
  4. Offline

    AdamQpzm

    Easiest 2 options would be:

    1) Have another account. They're not actually all that expensive.

    2) Use offline mode. While it's not supported by bukkit, I don't see a real problem with having an offline mode local server that's purely for testing. Either way, you'll likely run into a time sooner rather than later that you want to test but the Mojang servers are down :p Of course, you'll likely run into problems if you want to test UUID stuff.
     
  5. Offline

    RawCode

    you can earn money for second account in single workday...
     
  6. Offline

    danielh112

    I have used this plugin in the past not sure if it will do what you need it to but give it a go
    http://dev.bukkit.org/bukkit-plugins/virtualplayers/
     
  7. Offline

    xMrPoi

    Some people don't have jobs.

    I put my server to offline mode and then attempt to log in with a random account with MagicLauncher. It asks you if you'd like to play in offline, and I click yes.

    You can do this or get a friend to do it. From personal experience, it's easier to do it in offline mode because you already know the commands and what you're trying to test.

    If you're trying to test a large plugin that needs beta testing, you could possibly find a server and ask them if you could test it on their server.
     
  8. Offline

    1Rogue Retired Staff

    I have a batch script that I use to launch with whatever name I want (for offline mode testing servers only). I'll edit it in here when I get back to my home computer.
     
    ZeusAllMighty11 likes this.
  9. Offline

    GreatBlitz

    IkBenHarm
    I didn't get you.
    AdamQpzm
    1. I'm only 13 so no, my parents bought me an account only I requested them a lot.
    2. Okay so I put the server in offline mode but how do I get a player?
    RawCode
    I'm 13 -.-
    xMrPoi
    That is always an option, nice idea.
    1Rogue
    Thanks a lot!
    Wait, so by launch you mean the server or the client?
    When you reply next can you explain this stuff?
    danielh112
    I just saw the plugin page. Might come in handy later on, but not now because I need an actual player to be "seen" in the game. Ty anyway!

    Thanks all of you guys!
     
  10. Offline

    1Rogue Retired Staff


    Using windows:

    Code:
    @ECHO OFF
     
    set USERNAME=Testing
    set VERSION=1.7.5
    set MCDIR=%APPDATA%/.minecraft/
    set GAMEDIR=%MCDIR%/versions/%VERSION%/
    set NATIVES=%GAMEDIR%/natives/
     
    java -Djava.library.path=%NATIVES% ^
    -cp %GAMEDIR%/%VERSION%.jar;^
    %MCDIR%/libraries/java3d/vecmath/1.3.1/vecmath-1.3.1.jar;^
    %MCDIR%/libraries/net/sf/trove4j/trove4j/3.0.3/trove4j-3.0.3.jar;^
    %MCDIR%/libraries/com/ibm/icu/icu4j-core-mojang/51.2/icu4j-core-mojang-51.2.jar;^
    %MCDIR%/libraries/net/sf/jopt-simple/jopt-simple/4.5/jopt-simple-4.5.jar;^
    %MCDIR%/libraries/com/paulscode/codecjorbis/20101023/codecjorbis-20101023.jar;^
    %MCDIR%/libraries/com/paulscode/codecwav/20101023/codecwav-20101023.jar;^
    %MCDIR%/libraries/com/paulscode/libraryjavasound/20101123/libraryjavasound-20101123.jar;^
    %MCDIR%/libraries/com/paulscode/librarylwjglopenal/20100824/librarylwjglopenal-20100824.jar;^
    %MCDIR%/libraries/com/paulscode/soundsystem/20120107/soundsystem-20120107.jar;^
    %MCDIR%/libraries/io/netty/netty-all/4.0.10.Final/netty-all-4.0.10.Final.jar;^
    %MCDIR%/libraries/com/google/guava/guava/15.0/guava-15.0.jar;^
    %MCDIR%/libraries/org/apache/commons/commons-lang3/3.1/commons-lang3-3.1.jar;^
    %MCDIR%/libraries/commons-io/commons-io/2.4/commons-io-2.4.jar;^
    %MCDIR%/libraries/net/java/jinput/jinput/2.0.5/jinput-2.0.5.jar;^
    %MCDIR%/libraries/net/java/jutils/jutils/1.0.0/jutils-1.0.0.jar;^
    %MCDIR%/libraries/com/google/code/gson/gson/2.2.4/gson-2.2.4.jar;^
    %MCDIR%/libraries/com/mojang/authlib/1.2/authlib-1.2.jar;^
    %MCDIR%/libraries/org/apache/logging/log4j/log4j-api/2.0-beta9/log4j-api-2.0-beta9.jar;^
    %MCDIR%/libraries/org/apache/logging/log4j/log4j-core/2.0-beta9/log4j-core-2.0-beta9.jar;^
    %MCDIR%/libraries/org/lwjgl/lwjgl/lwjgl/2.9.1/lwjgl-2.9.1.jar;^
    %MCDIR%/libraries/org/lwjgl/lwjgl/lwjgl_util/2.9.1/lwjgl_util-2.9.1.jar;^
    %MCDIR%/libraries/org/lwjgl/lwjgl/lwjgl-platform/2.9.1/lwjgl-platform-2.9.1-natives-windows.jar;^
    %MCDIR%/libraries/net/java/jinput/jinput-platform/2.0.5/jinput-platform-2.0.5-natives-windows.jar ^
    net.minecraft.client.main.Main --username=%USERNAME% --version %VERSION% --gameDir %MCDIR% --assetsDir %MCDIR%/assets --userProperties {} --accessToken offline
    Just save it as a bat file. All you need to really change is the VERSION and USERNAME variables to change how the game launches.
     
    ZeusAllMighty11 and LordVakar like this.
  11. Offline

    Garris0n

    If you're a kid, go mow a lawn or two. Or shovel some snow. Or find some other "kid" way to earn money. Perhaps even get a job at a fast food restaurant or grocery store. If you're an adult, you probably have bigger problems than Minecraft accounts.
     
  12. Offline

    AdamQpzm

    1Rogue Adding in a /p parameter to one or two of those set commands might go a long way ;) Other than that, useful batch

    EDIT: Also, the first one in your classpath assumes 1.7.5 even though you have a version variable. :)
     
  13. Offline

    1Rogue Retired Staff


    Fixed, I added in the version variable for flexibility here, I had it hardcoded before
     
    AdamQpzm likes this.
  14. Offline

    xMrPoi

    This is true. But he still shouldn't have assumed that everyone has a job that they can freely buy a few accounts with.
     
  15. Offline

    Garris0n

    I don't see how he assumed that.
     
  16. Offline

    codename_B

    Offline mode.
     
  17. Offline

    Garris0n

    I have to keep mine in online mode because people know about my test server and might bypass the whitelist...
    Also I can't switch between online and offline anymore.
     
  18. Offline

    rsod

    Copy your server, change port, delete all user configuration, change to offline mode, start server, start multiple instances of cracked launcher and you're done.
     
  19. Offline

    Garris0n

    I'd have to delete my entire test database and re-do all ranks every time I wanted to use offline mode. I don't do my testing with normal plugins. I prefer using my custom ones which require said database for admin permissions. And, again, it's insecure.
     
  20. Offline

    RawCode

    changing port on test server is good way to get rid of unwanted visitors on tests.

    UUID stuff will require multiple valid acounts to test.

    if you really want to test stuff, you are free to alter code of mojang launcher to allow any nickname and any password to pass verification.

    also there are mods about changing nickname at runtime (outdated) since nickname stored inside simple string field and can be changed without any issues.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 8, 2016
  21. Offline

    rsod

    well, if you "prefer" to use your database and care so much about "security", go ahead and buy extra accounts.
     
  22. Offline

    Smerfa

    You can also write plugin to connect online-mode and offline-mode
    So premium players are logged as premium. (With UUID, and everything)
    pirate (Yep, no-premium is't real :p) players are logged as no-premium

    And then nobody can login to your premium nickname, and just use whitelist for pirate (no-premium)


    PS: and use plugins like LogIt, AuthMe, xAuth for (only) pirate players :p
     
  23. Offline

    Garris0n

    It's easier to just leave my custom system on than switch between it depending on what plugins I'm working on.

    And I already have bought extra accounts.
     
Thread Status:
Not open for further replies.

Share This Page