Dev env localhost: how to sandbox into God mode?


#1

I’m not sure how it’s properly called… I just forked it and set my developer environment, and got it working with much ease. Awesome job there!

Now, there must be a simple way I could play as a “God Player” with all gems and levels opened. Isn’t there? I couldn’t find out how.


How do you achieve "God Mode"?
Can I cheat ? Or skip levels in some way?
#2

Subscription, perhaps?


#3

Not sure about simple but you could probably just modify the database record for your player


Make code editor larger?
#4

You can pretend to buy a subscription or gems using Stripe’s test mode cards. I think they have a link to the instructions from the test mode label that shows up.


#5

That worked great, thanks! :slight_smile:

Any other such simple solution for getting play levels and hero levels?


#6

You could comment out this line to not lock any levels: https://github.com/codecombat/codecombat/blob/master/app/views/play/CampaignView.coffee#L142

If the line numbers change, it’s this one:

  level.locked = not me.ownsLevel level.original

#7

Commenting out

level.locked = not me.ownsLevel level.original

worked great!

Now just missing hero levels… :stuck_out_tongue_winking_eye:


#8

You can get that by doing a test Stripe purchase of a subscription.


#9

Hmm, sorry I’m sure I’ll feel even dumber after this, but how does a subscription help with that? I just did it, but can’t see any difference. Nor could I find a list of what subscriptions actually do, other than this:

Get access to new levels, heroes, items, and bonus gems with a CodeCombat subscription!

I meant my hero is at level 1 and I can’t equip any item until I keep playing to get XP or hack in DB.


#10

Hmm, right. You could open up your local Mongo console and do something like this:

var me = db.users.findOne({slug: 'my-username-slug'});
me.points = 9001;
db.users.save(me);

#11

Perfect, thanks!

To whoever might read this later, the mongo that comes with CodeCombat by default is under ~/coco/bin/mongo so, to complement your hints:

$ cd ~/coco/bin/mongo
$ ./mongo
> use coco
> var me = db.users.findOne({"email": "caue.rego@gmail.com"})
> me.points = 23456
> db.users.save(me)

#12

@nick, commenting out this line of code seems to be causing some uncaught type error


#13

Also need to make sure that items aren’t locked, maybe by making ownsItem always return true.


#14

I dont get it. How to get in the code