[REQ] OBSCURE COORDINATES IN DEBUG MENU

Discussion in 'Archived: Plugin Requests' started by alexander_q, Dec 3, 2011.

  1. Offline

    alexander_q

    Plugin category: RPG, Security

    Suggested name: ObscureCoordinates

    A bit about me: I run a survival server wherein people can use gold as upkeep for towny block protection, but PVP is forced on everywhere, and TNT will work if launched from outside. People drop money if carrying it when they die, and there is a limit to how much they can store in their personal and town accounts, so people tend to have vaults. Inventories also drop upon logout.

    What I want: A plugin that either obscures the coordinates a client sees on the debug menu (by perhaps multiplying them by a random number) or hides them altogether. Preferably a server mod, but Spout if necessary. Perhaps an option to disable the debug menu altogether.

    Why I want it: I want people on my server to be forced to use more conventional means of navigation, including map, compass and landmarks. Getting lost introduces new narrative to the game (finding one's bearings, launching rescue missions, mining for redstone again), which is required to keep players motivated.

    Ideas for permissions: One permission node that prevents the coordinate obscuration for Ops.

    Devs who might be interested in this: @Rahazan
     
  2. Sorry, no way for as far as I know. Spout could do that, but then you have to get your users to use Spout.
     
  3. Offline

    alexander_q

    Are you aware if spout has ever done it?
     
  4. Offline

    Borch

    Ok, just some theory: Write a server side mod that intercepts every incoming or outgoing packet. Whenever there are some coordinates in it, add 1000 to the X and Z value if it's an incoming packet, subtract 1000 if it's outgoing. So for the client, everything is shifted by 1000 blocks. Since translation happens back and forth, neither the client nor the server should notice that the other one is "thinking" in different coordinates.
    Now instead of using 1000, create two random values for every client on connect.


    If everything that in some way deals with coordinates gets shifted, could there be any problems? Biome colors would be off on the client I guess. What else would break?
     
  5. Offline

    acuddlyheadcrab

    You might be able to just use location.setX() and so on...

    EDIT: Nope, you can't
     
  6. Offline

    Rahazan

    Yeah, it should be possible using Spout (players will need to have SpoutCraft installed I think). Even entirely blocking out the F3 debug screen. If you properly format your request, I'm sure someone (if not me) will try to create it.
     
  7. Offline

    alexander_q

    Thanks guys. I was just sounding out if such a thing were possible or had already been accomplished before I got too excited. I have reformatted the request.
     
  8. Offline

    Gathiat

    I'd love to use that plugin. Imho coordinates shallow the depth of the game on both PVP and RPG oriented servers.
     
  9. Offline

    Atomic Fusion

    My inner troll can't wait until someone, if not myself, just modifies Spoutcraft so that these sorts of blocks (especially texturepack ones) don't work.
     
  10. Offline

    turt2live

    I can try it, but yes, packet hooking would be required and I have always steered clear of that.

    I'll give it a shot, no promises on functional working plugin code though.
     
  11. Offline

    turt2live

    After a lot of beating Google on the head and pouring over the Bukkit API I haven't found a way to do it.

    So sadly, I won't be able to complete this plugin :(
     
  12. Offline

    KingWar92

    Decompile craftbukkit, change some things in code and recompile ?
     
  13. Offline

    turt2live

    Not without at least $20 pay.

    I'm not spending my time going over Bukkit source code and re-writing/editing parts of it.
     
  14. Offline

    mindless728

    that really wouldn't even work either as the co-ords would just be shifted, as he wants people to not use the coords in game to find things, and since they are related by just -1000 it would easy to navigate. You would really need to just scramble the numbers (more or less just send random co-ords), but this isn't possible without a modification to the client

    TBH the better strategy is to make a rule that you can't use co-ords for movement and ban people who give out co-ords, as you won't be able to get people to install either SpoutCraft or a different client mod
     
  15. Offline

    Borch

    @mindless728 It would help to read my entire post. I started off with 1000 as an example and said that a random value should be chosen for every client on every connect. So it wouldn't help to write down coordinates as next time you connect they would be different. You'd have to figure out the shifting every time you connect and translate the coordinates you wrote down.
    Making a rule however is pointless as there is no way to figure out if people still do it.
     
  16. Offline

    Daniel Heppner

    There's plenty of clients on HackForums that pretend to be SpoutCraft.

    You could shift all the blocks on the server by however many you want, but it wouldn't help unless it was random. Say you write down the coords for your house. Now you walk 10 blocks. The difference of the first coords and the second ones will still be 10, even if you shift everything by 1000. Look at it like this: a = 1 + 1000, b = 5 + 1000, b - a = 4. Get it? Lastly, the server does not tell the client what the coords are. The client figures it out relative to spawn. So if you randomly changed the coords, the player would be randomly jumping around the map. The reason that you can shift everything by 1000 blocks is because you can tell the client that spawn is in a different position, but then you can actually teleport them somewhere else when they spawn, but then you get the problem I outlined above. I hope this made sense.

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

    Borch

    @Daniel Heppner
    I don't get why you think the player would jump around or get teleported. You modify coordinates in the packets that are being sent/received, you do not inject any new packets that would teleport the player anywhere.


    Example (sorry if this is still a mess, I tried explaining in more detail, but I'm not a native speaker)
    In unshifted server coordinates, you are located at for example 5,10,5 as this is the location where you logged of last time. Now you connect again, the server randomly generates two integers for X and Z shifting, and for sake of simplicity we say its 1000 and 1000. So the server sends you a 0x0D packet after connecting and tells you your position. In the outgoing queue the packet gets modified by applying the shifting, so the packet that actually gets sent contains 1005,10,1005 for your position. The client then has to reply with another 0x0D packet, confirming the coordinates. So the client puts 1005,10,1005 into this packet, the server receives the packet, in the receive-queue you undo the shifting, so the packet reads 5,10,5 again when the server finally handles it -- no problem here. Same goes for the "spawn location" packet (0x06). Spawn might be at 0,0,0 server side, coords get shifted again in the send queue. Same goes for entity spawns, teleports, player respawns, chunk loading, etc. No weird teleports, no jumping around. Everything is in the right spot client side relative to each other. And next time you connect, the shifting might be -4053/5145....
    (Actually thinking about it some more, the shifting had to be a multiple of 16 because chunk loading might be off otherwise, as well as multi block change packets (0x34) which have to lie withing one chunk)


    And yes, it means that everything still is in the same spot relative to each other but really, every time you connect you had to walk to some reference point you picked once, figure out the shifting, and then apply the correct shifting to all the locations you wrote down. Also, players could not tell each other the location of certain places that easily. Yes it is possible, but not "just like that". The question would be if this makes it complicated enough to stop most people from doing it, and if the price of having wrong biome colors is worth it.
    It's probably not, but still, I think it would work technically. Like others said before, you can't prevent the client from knowing where it is located because that's just essential to everything, so you have to think of ways to make it harder to work with the information the client has.
    Basically you have the choice between a shitty kinda-solution and no solution at all.
     
  18. Offline

    acuddlyheadcrab

    I've tried the shifting thing via Player.setLocation(randomInteger); and other methods, but it really does just teleport the player across the map (Or something like that. It was a while ago so I don't remember exactly).

    Would shifting the spawn point to random locations do anything useful? I doubt it but im still not sure.
     
    Daniel Heppner likes this.
  19. Offline

    Daniel Heppner

    Actually, what if you just moved the spawn around randomly? I wonder if the client has to relog in order to see where the new spawn point is...
     

Share This Page