Sending Fake Air Blocks (Or anything else)

Discussion in 'Plugin Development' started by Quantum64, Dec 6, 2013.

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

    Quantum64

    So I need to send blocks to a single player, say a bridge forms just for them, or perhaps a hole appears in a wall for that player. I've got the blocks being sent with the sendBlockChange packet, but if a player tries to walk across the bridge they get kicked for flying, and if they attempt to walk through the hole, they lag back and start glitching out. Is there any way to correct this?
     
  2. Offline

    RawCode

    what about actually changing world but not sending changes to other players?

    in other case you will need custom netclienthandler (ASM\reflections basecode modification(outside API))
     
    NathanWolf likes this.
  3. Offline

    NathanWolf

    I think you would also need to special-case this server-side somehow. You've spoofed the client, but the server still knows what "reality" is and won't let you walk over air or through walls.

    I'm not sure the best way to handle this, though- I'm curious to know because this sounds like a neat trick :)
     
    Quantum64 likes this.
  4. Offline

    RawCode

  5. Offline

    Garris0n

    For the record, you can disable the fly kick.
     
  6. Offline

    Quantum64

    Can't disable fly, people would hack.
    I simply need a hole to be there for one player, but not another, I am using ProtocolLib to process and send packets.
    I think thats the right idea. I need the server to realise that there are changed blocks just for a single client, but this is the problem... How do I do that?

    Oh and here is a bit of background info on what i'm tring to do. I am making an anventureish server, where all players will be hidden, except the players on your "team" to complete the map. There will be a VERY few number of blocks that need to be changed, so I thought it silly to have a separate instance of the map for every team. I just need a door to open and things like that to advance in the map for every "team" of players.

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

    NathanWolf


    I'm honestly not sure that's possible- I don't know that you can override collision detection at that level.

    I think your best bet may be something like what RawCode first suggested- make the changes to the world but don't show them to other players (basically the opposite of what you're trying to do). Or, maybe as a first step- make the changes, then send packets to all the other players to "undo" those changes. (would probably be glitchy)
     
  8. Offline

    Quantum64

    Anything's possible if you modify the CB source code Muahahahaha. I feel like that approach would overcomplicate the entire issue. There must be a way to override the server collision, because collision is 100% handled on the client side. I know this for a fact because I have studied the AABB collision the MC client uses. The server is simply correcting possible collision glitches by moving the player back to a non-collided spot, or attempting to stop those nasty noclip hackers.
     
  9. Offline

    RawCode

  10. Offline

    Garris0n

    You don't need to send packets, you can just use sendBlockChange in the API. As for the hacking, the default server flykick is nothing more than a minor annoyance for anybody with even the most trivial of fly mods, let alone a hacked client, so if you're worried about hackers you should be using NoCheatPlus. And as for the actual issue, you basically have to reverse it. Have the server be air and tell all players except the player who can walk through that there are blocks there. As for the bridge, there's not really a good way to do that.
     
  11. Offline

    Quantum64

    I'm only looking for noclip on a few blocks, and as that plugin is not open source, I can learn nothing of how it works.

    Thanks for the advice! NoCheatPlus would completely destroy the concepts of my map... oh well, i'll just put up with the hackers for now. I'll try to do that, I just thought there might be an easier way to do that. I'll look into the CB source and find out exactly what causes there corrections, then look for a way to avoid it.
     
  12. Offline

    Garris0n

    Just decompile it. http://jd.benow.ca/

    The simple way to avoid it really is just to disable the default fly kick. It does next to nothing to stop hackers anyway.

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

    RawCode

    it is not obfuscated, you can decompile it with anything (including jd gui for eclipce) for valid source code.

    it replace netclienthandler for specific player serverside without actually changing server JAR
     
  14. Offline

    NathanWolf

    Anything except getting anyone else to run any of your plugins. If you're modifying the CB source you don't even really need to be making a plugin to begin with, just hack your code right in :D

    Not to belabor the point, but what you said is totally contradictory (collision is handled 100% client side, but corrected by the server... that's not 100% then!) :)

    Collision detection (and basically everything else) is handled 100% server-side. The server is the authority on everything. The client does its own collision detection (and movement, block breaking, etc) to give the appearance of actions being instantaneous, so you don't notice lag (for the most part...).

    The client is basically simulating what it expects will happen given the current state- but none of that actually happens until the server says it happened. The server is not "correcting" anything - it is telling the client what happened, which hopefully matches the client's predictions enough so you don't notice any "correction" happening.

    The player isn't "lagging" or "glitching out" when they try to walk through your invisible wall- the client is out of sync with the server and trying to do something that isn't possible.

    Anyway, that aside - good luck if you go the "mod CB" route :)

    Maybe others have better ideas, but it sounds like making the changes and hiding them from the players you don't want to see them might be the best way to go.

    However, no matter which way you go there's the opportunity for glitching- if a player tries to follow you across your magic invisible bridge, they'll probably fall through it client-side, but the server will think they're walking on it, and their player will probably freak out.

    If there *is* a way to override collision checks on a per-player basis, that would be awesome to know :D
     
  15. Offline

    Quantum64

    Anyone else wanna take a stab at this?
     
  16. Offline

    Plo124

    Quantum64
    I think the simplest solution is to do the opposite for all other players, e.g.

    For the hole in the wall, just place the block there, but delete the block for the player its meant to be for.

    The bridge, make it actually there for the player, but delete it for all the others, however, if they walk on it, they will start clipping and glitching and eventually get to the other side.
     
  17. Offline

    Quantum64

    Yea that seems to be the only thing so do
     
Thread Status:
Not open for further replies.

Share This Page