Code Monkey home page Code Monkey logo

quantum-elevators's People

Contributors

jonathan-robertson avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

quantum-elevators's Issues

πŸͺ² Upward warp skips panels in certain situations

  • accurately detect multidim block rotation
  • determine block in-world height from block rotation

Received a report from Oggy#9577 (via Discord) with the following:

So, if you place the Elevator on the 3x3x1 Block ( Point A ) from the Shape menu it will let you travel downwards ( Point B ) , but not upwards onto the elevator placed on the 3x3x1block. ( Error message of No elevator on top floor found).
However, if placing another one above ( Point C ) the 3x3x1block it would let you travel from the very bottom to the very top and then back down onto the 3x3x1 block.

So all in all can travel from A to B, but not from B to A.
B to C to A would work again.

πŸͺ² Multiple players are transported at times when 1 player attempts a warp

  • reportedly difficult to replicate; could be due to lag or to volume of players
  • 1 player was attempting to warp and then somewhere around 10 players all teleported to this first player's panel
    • not 100% sure yet if the effected players ended up at the source panel or the destination panel; probably was the destination panel, though

Thanks to Blight#7410 for reporting this

🏍 Support Vehicles

Challenges

  • Look direction isn't shared with the server while on a vehicle. no longer using look direction, anyway πŸ˜‰
    • maybe use C (wheelie/jump) to go up and X (honk) to go down? Not sure if I can intercept these
  • Increasing elevator multi-dim size doesn't seem to increase the range that BuffsWhenWalkedOn activates

⬅️ Add Pad for Horizontal Movement

πŸ₯… Players would be able to intercept horizontal travel by placing a similar panel at the correct x/y or z/y coordinates.

🏰 Players could raid each others' panels if they aren't locked down. Don't imagine this will be an issue; just lock your panels down lol

πŸ” If a player is attempting to raid with a portable panel... it also exposed the raiders to horizontal travel from the defender's end; risky!

πŸͺ² Block ID is occasionally not read properly

Symptoms

  • elevation helper buff appears when standing on a warp panel, but elevation value remains zero at all times
  • jumping/crouching on a warp panel does not result in being transported even when it should

Much thanks to Grandpa Minion#2643 for reporting this

πŸ’½ Transition Read-Side Load to Write-Side Load

  • Maintain a multi-dim data cache for elevator positions
    • new Dictionary<int(x),Dictionary<int(z),int(y)> ?
    • never loop through contents; only perform direct lookups to help with thread safety
  • Add block coordinates to the structure OnPlace
  • Remove block coordinates from the structure OnDestroy

πŸͺ΄ Force Pads to Snap to Grid

Allowing terrain decoration setting for elevator pads to be enabled would sometimes position the pads too low to the point the system did not detect if players were standing on them.

🌟 Particle effects and warp sounds sometimes stop working

Reported by Grandpa Minion#2643

so i logged in to server and the green buffs have stopped working. > Tested on new panels placed same thing. They still seem to be working but buff is not appearing

Does that β€œwomph” sound still play when warping, or is that gone as well?

dont hear it quiet

If you enable the player panel with the F3 debug menu, does it show that you have any β€œquantum” related buffs attached when not standing on a panel?

image

image

It seems the buff isn't getting stuck, so it may be an issue relating to the buff being properly given (or something else is going on).

πŸ–±οΈUpdate default action (if possible)

Have primary action trigger lock/unlock toggle if owner, or password enter attempt if non-owner and a password can be entered (i.e. you don't have permission yet)

If possible, default action could be Activate - same as LCB, except it would perhaps shine a light or column in its own block and directly vertical to make alignment easier.

↕️ Address Idle Checks

Players sometimes stand directly on the warp panel for extended periods of time.

This could be resolved a few different ways...

  • deal damage to players who are standing on the panel for too long (possibly tied into buff)
    • could result in frustration due to this seeming like
  • transparently stop or severely slow checking for updates when players are looking in a specific direction for too long
    • could result in frustration due to this seeming like it's broken
  • update to use different controls (instead of look) for these panels
    • for example, try integrating jump/crouch again... maybe use crouch & in-air checks
    • would have to force players to stand up if crouched when entering a field and finding that there is no panel underneath
  • force look direction back to neutral if no panels are confirmed to be under or over (without teleporting, if possible)

πŸš€ Quantum Elevator blocks don't work on first launch

  • when starting a brand new game (either dedicated or local), quantum elevator block ids are not properly read into the mod so it starts in a broken state.
  • restarting the server or local game resolved the issue, but we obviously don't want this to be necessary
    • placing at least one quantum block before restarting may've been what fixed this

Acknowledgements

  • Thanks to Shavick#8511 for initially reporting this
  • Thanks to O C#2804 for suggesting an adjustment that ultimately fixed this issue once the reason for it happening was identified
  • Thanks to vivo#0815 for identifying this only happens on first launch

πŸ”‘ Support On-Demand Password Chaining

Summary

Granting and Managing authorization for complex elevator shafts shouldn't be a burden!
Passwords set on the source panel will act as the key for any destination panels you haven't directly interacted with yet.

Problem

A major problem with password protection (and any form of in-game authorization) is that it requires physical access by default.

Examples

Let's say you've got a successful base structured around Quantum Elevators. There's no clean way into the base without using them and no clean way out if you don't have permission to use the elevators.

You already have several teammates - all who must use the elevators to navigate.

Today, a new player joined your team. Maybe a friend or family member, but what matters is you trust this person and want to provide access within your base.

how?

Well... the ground floor is easy: you inform this player of your password, the player enters it, and can then stand on the elevator, but.... ah: having permission to the ground floor doesn't grant permission to the upper floors...

graph LR
    et[Existing Teammates]
    nt[New Teammate]
    ex[External Floors]
    in[Internal Floors]

    et-->|ok|ex
    et-->|ok|in

    nt-->|ok|ex
    nt-->|nope|in

So you temporarily unlock the upper floor so your new buddy can get access to this floor... you then re-lock the elevator and provide him with the password so he can get authorized. Oh, but then all your other teammates have now lost authorization to this floor since unlocking purges the authorized user list.

graph LR
    et[Existing Teammates]
    nt[New Teammate]
    ex[External Floors]
    in[Internal Floors]

    et-->|ok|ex
    et-->|nope|in

    nt-->|ok|ex
    nt-->|ok|in

So you decide instead to permanently unlock internal floors and only lock the shafts exposed to the outside. This is a cute idea until someone breaks in through a hole in the ceiling and you learn that all internal floors (otherwise protected like an onion) are now exposed. Or maybe they break your LCB, then break the external elevator and replace it with one of their own... This would give the hostile players access to your unlocked elevator structure!

This same problem is present in the old idea of adding firewalls and TLS to your edge routers/firewalls and failing to protect your internal networks... so that's a bad idea.

graph LR
    et[Teammates]
    ht[Hostiles]
    ex[External Floors]
    in[Internal Floors]

    et-->|ok|ex
    et-->|unlocked|in

    ht-->|blocked|ex
    ht-->|unlocked|in

Bro, what you need is On-Demand Password Chaining!

Solution

On source check,

If source password is provided, all destinations with same password are also accessible

  • lockable.GetPassword() returns the hash, which can then be compared with others... and automatically entered into them! incredible
  • see ILockable interface for the info on how this might be done
graph TD
    no[Non-Owner]
    l1[Level 1]
    l2[Level 2]
    l3[Level 3]

    nb[Notify Blocked]
    c2{Check Level 2}
    c3{Check Level 3}

    u2[Unlock Level 2]
    u3[Unlock Level 3]

    nh[Nothing Happens]

    no-->|stands on|l1
    l1-->|looks up w/o password|nb
    l1-->|looks up w/ password|c2
    c2-->|unlocked or has same owner & password|u2-->l2
    c2-->|locked and has different/no password|c3

    c3-->|locked and has different/no password|nh
    c3-->|unlocked or has same owner & password|u3-->l3

:x: Fix NRE in CanAccess call

QuantumElevators.CoreLogic.CanAccess(PlatformUserIdentifierAbs internalId, TileEntitySign source, TileEntitySign target)

Should we have to account for corrupted/lost tileEntity owners?
Lots and lots of references happening in this section; may have to harden it against possible null references.
An example of a block causing this is found within my server; more info to come.

2023-02-26T09:59:25 130958.724 ERR [QuantumElevators.EntityAlive_updateCurrentBlockPosAndValue_Patches] EntityAlive_updateCurrentBlockPosAndValue_Patches Postfix failed: handle block pos change for {__instance}.
Object reference not set to an instance of an object
  at QuantumElevators.CoreLogic.CanAccess (PlatformUserIdentifierAbs internalId, TileEntitySign source, TileEntitySign target) [0x00023] in <799b9b6ce1cf41deaed5f89fc083a42a>:0
  at QuantumElevators.CoreLogic.TryGetFloorBelow (PlatformUserIdentifierAbs internalId, Vector3i sourcePos, TileEntitySign source, Vector3i& targetPos) [0x000bc] in <799b9b6ce1cf41deaed5f89fc083a42a>:0
  at QuantumElevators.CoreLogic.Warp (QuantumElevators.Direction direction, EntityPlayer player, Vector3i sourceBlockPos, BlockValue sourceBlockValue) [0x00068] in <799b9b6ce1cf41deaed5f89fc083a42a>:0
  at QuantumElevators.EntityAlive_updateCurrentBlockPosAndValue_Patches.Postfix (EntityAlive __instance, Vector3i ___blockPosStandingOn, BlockValue ___blockValueStandingOn, System.Boolean ___bCrouching, System.Boolean ___bJumping) [0x00091] in <799b9b6ce1cf41deaed5f89fc083a42a>:0
2023-02-26T09:59:25 130958.732 EXC Object reference not set to an instance of an object
  at QuantumElevators.CoreLogic.CanAccess (PlatformUserIdentifierAbs internalId, TileEntitySign source, TileEntitySign target) [0x00023] in <799b9b6ce1cf41deaed5f89fc083a42a>:0
  at QuantumElevators.CoreLogic.TryGetFloorBelow (PlatformUserIdentifierAbs internalId, Vector3i sourcePos, TileEntitySign source, Vector3i& targetPos) [0x000bc] in <799b9b6ce1cf41deaed5f89fc083a42a>:0
  at QuantumElevators.CoreLogic.Warp (QuantumElevators.Direction direction, EntityPlayer player, Vector3i sourceBlockPos, BlockValue sourceBlockValue) [0x00068] in <799b9b6ce1cf41deaed5f89fc083a42a>:0
  at QuantumElevators.EntityAlive_updateCurrentBlockPosAndValue_Patches.Postfix (EntityAlive __instance, Vector3i ___blockPosStandingOn, BlockValue ___blockValueStandingOn, System.Boolean ___bCrouching, System.Boolean ___bJumping) [0x00091] in <799b9b6ce1cf41deaed5f89fc083a42a>:0
UnityEngine.StackTraceUtility:ExtractStringFromException(Object)
Log:Exception(Exception)
QuantumElevators.ModLog`1:Error(String, Exception)
QuantumElevators.EntityAlive_updateCurrentBlockPosAndValue_Patches:Postfix(EntityAlive, Vector3i, BlockValue, Boolean, Boolean)
EntityAlive:DMD<EntityAlive::updateCurrentBlockPosAndValue>(EntityAlive)
EntityAlive:OnUpdateLive()
EntityPlayer:OnUpdateLive()
EntityAlive:OnUpdateEntity()
EntityPlayer:OnUpdateEntity()
World:TickEntity(Entity, Single)
World:TickEntitiesSlice(Int32)
World:TickEntitiesFlush()
GameManager:UpdateTick()
GameManager:gmUpdate()
GameManager:Update()

πŸ” Add Locks

  • Owner can always jump to any owned panels
  • Unlocked panels can be jumped to by anyone
  • Locked source panels cannot be used unless on the approved list (by entering password)
  • Locked destination panels cannot be jumped to unless on the approved list
  • Authorized source will skip over unauthorized sources to reach authorized ones

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.