Jungle-Team3-Olympus / Pixeller-react

화면단
0 stars 2 forks source link

Reading 'UID' μ—λŸ¬ #100

Open ryyugang opened 2 months ago

ryyugang commented 2 months ago

🐞 Describe

πŸ“„ Logs

ERROR
Cannot read properties of undefined (reading 'uid')
TypeError: Cannot read properties of undefined (reading 'uid')
    at Socket.<anonymous> (http://localhost:3000/static/js/bundle.js:4878:33)
    at Emitter.emit (http://localhost:3000/static/js/bundle.js:299255:20)
    at Socket.emitEvent (http://localhost:3000/static/js/bundle.js:329460:16)
    at Socket.onevent (http://localhost:3000/static/js/bundle.js:329448:12)
    at Socket.onpacket (http://localhost:3000/static/js/bundle.js:329418:14)
    at Emitter.emit (http://localhost:3000/static/js/bundle.js:299255:20)
    at http://localhost:3000/static/js/bundle.js:328755:12

🌏 Environment

localhost ν™˜κ²½μ—μ„œ λͺ©κ²©

πŸ•°οΈ Estimated Time of Completion

γ… γ… 

πŸ™‹πŸ» More

No response

Digit24-dev commented 2 months ago

μ—λŸ¬ μœ„μΉ˜: GameScene.js - constructor - this.socket.on("message", ...

     case "move":
          // console.log(data);
          const user = data.user;

          // 움직인 μœ μ € μ •λ³΄λ§Œ λ°›μ•„μ™€μ„œ κ°±μ‹ ν•΄μ£ΌκΈ°
          if (this.OPlayer[user.uid]) {
            const otherPlayer = this.OPlayer[user.uid];
            if (otherPlayer.x !== user.x || otherPlayer.y !== user.y) {
              otherPlayer.moveTo(user.x, user.y, user.direction);
              otherPlayer.setMoving(true);
            } else {
              otherPlayer.setMoving(false);
            }
          }
          break;