Skip to content
This repository has been archived by the owner on Dec 26, 2017. It is now read-only.

Commit

Permalink
Disable request editing in IV display example
Browse files Browse the repository at this point in the history
  • Loading branch information
trisk committed Aug 14, 2016
1 parent d29081c commit 8bce4e3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions example.pokemonIVdisplay.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ changeCase = require 'change-case'

server = new PokemonGoMITM port: 8081
# Always get the full inventory
.addRequestHandler "GetInventory", (data) ->
data.last_timestamp_ms = 0
data
#.addRequestHandler "GetInventory", (data) ->
# data.last_timestamp_ms = 0
# data

# Append IV% to existing Pokémon names
.addResponseHandler "GetInventory", (data) ->
Expand Down

2 comments on commit 8bce4e3

@rastapasta
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for spotting!

@BRZ420
Copy link

@BRZ420 BRZ420 commented on 8bce4e3 Aug 17, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't it better to disable it in lib, and enable only with specific parameter:

server = new PokemonGoMITM port: 8081, request_editing = true

I currently manually edit after each update:

     handlers = [].concat @requestHandlers[action] or [], @requestHandlers['*'] or []
     for handler in handlers
-      data = handler(data, action) or data
+      ret = handler(data, action)
+      if ret
+        console.error 'Request editing is DISABLED: ', ret

Please sign in to comment.