1. The forums will be archived and moved to a read only mode in about 2 weeks (mid march).

Forms data clash between players

Discussion in 'Development' started by Hipster, Nov 12, 2017.

  1. Hipster

    Hipster Zombie

    Messages:
    214
    Okay, so i use blocksniper's api by @Sandertv to send forms, so i am trying to make a server shop plugin, so i store id and metedata of the item player chose in Window.php, but when many players access the shop forms, the data clashes between window, the id changes to the last person who accessed the form, how do i fix this?
     
  2. robske_110 (Tim)

    robske_110 (Tim) Wither Skeleton Poggit Reviewer

    Messages:
    1,342
    GitHub:
    robske110
    Store it in an array where playerID is the index
     
    Hipster likes this.
  3. Hipster

    Hipster Zombie

    Messages:
    214
    and when do i unset the array? how do i know that the player closed the window?
     
  4. robske_110 (Tim)

    robske_110 (Tim) Wither Skeleton Poggit Reviewer

    Messages:
    1,342
    GitHub:
    robske110
    well, I don't think you're storing large amount of data in there so I suggest leaving the data in the array (also a nice selection save) until the player disconnects.
     
    Hipster likes this.
  5. Hipster

    Hipster Zombie

    Messages:
    214
    awesome thanks!
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.