diff --git a/admin.py b/admin.py index 9e6c4af..e386dd3 100644 --- a/admin.py +++ b/admin.py @@ -61,7 +61,15 @@ def serve_executor_post(): output="executor_task triggered" else: try: - exec(the_code) + if 1/2!=0: + ld={} + exec(the_code,globals(),ld) + output=ld.get("output",output) + json_output=ld.get("json_output",json_output) + html_output=ld.get("html_output",html_output) + output_html=ld.get("output_html",output_html) + inspect=ld.get("inspect",inspect) + else: exec(the_code) except DeadlineExceededError: logging.error("Deadline Exceeded") except: log_trace_i("",logging) diff --git a/api.py b/api.py index 1d95007..050fb2c 100644 --- a/api.py +++ b/api.py @@ -979,12 +979,13 @@ def pull_mail_api(**args): else: mails,new_cursor,new_more=Mail.query(Mail.owner==user.k()).order(-Mail.created).fetch_page(page) for mail in mails: - mail_data={"fro":mail.fro,"to":mail.to,"message":mail.info.message,"subject":mail.info.subject,"sent":"%s"%mail.created,"id":mail.k()} + #logging.info("%s"%mail.created) + mail_data={"fro":py3_safe_string(mail.fro),"to":py3_safe_string(mail.to),"message":py3_safe_string(mail.info.message),"subject":py3_safe_string(mail.info.subject),"sent":"%s"%mail.created,"id":mail.k()} if mail.item: mail_data["item"]=simplify_item(mail.info.item) mail_data["taken"]=mail.taken data["mail"].append(mail_data) - if new_cursor: data["cursor"]=new_cursor.urlsafe() + if new_cursor: data["cursor"]=py3_safe_string(new_cursor.urlsafe()) if new_more: data["more"]=True jhtml(self,[data]) @@ -1073,10 +1074,10 @@ def pull_messages_api(**args): else: messages,new_cursor,new_more=query.fetch_page(page) for message in messages: - m_data={"fro":message.fro,"to":message.to,"message":message.info.message,"type":message.type,"id":message.k(),"server":message.server,"date":"%s"%message.created.strftime('%Y-%m-%dT%H:%M:%SZ')} + m_data={"fro":py3_safe_string(message.fro),"to":py3_safe_string(message.to),"message":py3_safe_string(message.info.message),"type":py3_safe_string(message.type),"id":message.k(),"server":py3_safe_string(message.server),"date":"%s"%message.created.strftime('%Y-%m-%dT%H:%M:%SZ')} data["messages"].append(m_data) #logging.info(m_data) - if new_cursor: data["cursor"]=new_cursor.urlsafe() + if new_cursor: data["cursor"]=py3_safe_string(new_cursor.urlsafe()) if new_more: data["more"]=True jhtml(self,[data]) diff --git a/config.py b/config.py index 3e5df15..4ae9abb 100644 --- a/config.py +++ b/config.py @@ -35,15 +35,25 @@ else: #python3 from libraries import stripe3 as stripe from libraries import amazon_ses3 as amazon_ses import _pickle as cPickle + from google.appengine.api import memcache,urlfetch,urlfetch_errors,mail,taskqueue,images,namespace_manager,search,modules from google.appengine.ext import ndb,blobstore,deferred from google.appengine.runtime import DeadlineExceededError from google.appengine.runtime.apiproxy_errors import DeadlineExceededError as DeadlineExceededError2 from google.appengine.datastore.datastore_query import Cursor -from flask import Flask, render_template, request, make_response +def _from_base_type(self, value): + try: + return pickle.loads(value) + except: + return pickle.loads(value,encoding='latin1') +ndb.model.PickleProperty._from_base_type=_from_base_type + +from flask import Flask, render_template, request, make_response, redirect app = Flask(__name__) +# app = ndb.toplevel(app) # sadly doesn't work this way + if 1/2 != 0: app.wsgi_app = wrap_wsgi_app(app.wsgi_app, use_deferred=True) @@ -104,12 +114,14 @@ if is_production: #maps["desertland"]["key"]="jayson_desertland_copy" pass -game_version=786 +game_version=787 SALES=4+5+388+5101+125/20 #donation+manual+macos+steam+sales update_notes=[ "Lunar New Year Event", - "Last Update [19th of January]", + "Last Update [6th of February]", "Switched to Python3", + "All major issues fixed", + ] ip_to_subdomain={ #IMPORTANT: SPECIAL PAGE RULES ARE NEEDED: https://dash.cloudflare.com/b6f5a13bded5fdd273e4a1cd3777162d/adventure.land/page-rules - uss1 / eus1 was best "35.187.255.184":"asia1", diff --git a/design/drops.py b/design/drops.py index cef283d..0cff08b 100644 --- a/design/drops.py +++ b/design/drops.py @@ -41,7 +41,7 @@ drops={ #[0.0001,"redenvelopev3"], [0.00005,"greenenvelope"], #[0.0001,"redenvelopev4"], - #[0.001,"candypop"], + [0.001,"candypop"], ], "main":[ [0.0007,"ringsj"], diff --git a/design/precomputed.py b/design/precomputed.py index 995304a..c20eae6 100644 --- a/design/precomputed.py +++ b/design/precomputed.py @@ -1,2 +1,2 @@ -# Fri Jan 19 2024 21:17:23 GMT+0300 (GMT+03:00) +# Tue Feb 06 2024 23:32:36 GMT+0300 (GMT+03:00) images={"/images/tiles/characters/ninja_turtles.png":{"height":144,"width":312,"type":"png"},"/images/cosmetics/makeup/makeup1.png":{"height":120,"width":1134,"type":"png"},"/images/cosmetics/hairdo/bwhair.png":{"height":120,"width":27,"type":"png"},"/images/cosmetics/beardo/burningeyes1_anim.png":{"height":120,"width":81,"type":"png"},"/images/cosmetics/beardo/burningeyes2_anim.png":{"height":120,"width":81,"type":"png"},"/images/cosmetics/hats/bathat_anim.png":{"height":120,"width":81,"type":"png"},"/images/cosmetics/hats/gcandle_anim.png":{"height":120,"width":81,"type":"png"},"/images/cosmetics/hats/halo_anim.png":{"height":120,"width":81,"type":"png"},"/images/cosmetics/makeup/kunique.png":{"height":120,"width":108,"type":"png"},"/images/cosmetics/skins/mbw.png":{"height":144,"width":81,"type":"png"},"/images/cosmetics/armors/mabw.png":{"height":144,"width":162,"type":"png"},"/images/cosmetics/accessories/kglasses.png":{"height":120,"width":108,"type":"png"},"/images/cosmetics/gravestones/gravestone.png":{"height":64,"width":160,"type":"png"},"/images/tiles/monsters/deep_sea_king.png":{"height":320,"width":318,"type":"png"},"/images/tiles/characters/adversaries.png":{"height":288,"width":324,"type":"png"},"/images/tiles/characters/angel_wingless.png":{"height":288,"width":456,"type":"png"},"/images/tiles/characters/winners_jpa.png":{"height":288,"width":312,"type":"png"},"/images/tiles/characters/winners_jpb.png":{"height":288,"width":312,"type":"png"},"/images/tiles/characters/sheet_winnersa.png":{"height":288,"width":312,"type":"png"},"/images/tiles/characters/sheet_winnersb.png":{"height":288,"width":312,"type":"png"},"/images/tiles/characters/collection1.png":{"height":288,"width":312,"type":"png"},"/images/tiles/characters/collection2.png":{"height":288,"width":312,"type":"png"},"/images/tiles/characters/collection3.png":{"height":288,"width":312,"type":"png"},"/images/tiles/characters/collectionx.png":{"height":288,"width":456,"type":"png"},"/images/tiles/monsters/snowman.png":{"height":144,"width":76,"type":"png"},"/images/tiles/monsters/Dragold.png":{"height":212,"width":156,"type":"png"},"/images/tiles/monsters/blackscorpion.png":{"height":256,"width":176,"type":"png"},"/images/tiles/monsters/coboldProto.png":{"height":200,"width":141,"type":"png"},"/images/tiles/monsters/liger_x.png":{"height":184,"width":150,"type":"png"},"/images/tiles/monsters/tiger.png":{"height":184,"width":150,"type":"png"},"/images/tiles/monsters/slenderman.png":{"height":200,"width":141,"type":"png"},"/images/tiles/monsters/frankenstein.png":{"height":144,"width":76,"type":"png"},"/images/tiles/characters/custom1.png":{"height":288,"width":312,"type":"png"},"/images/tiles/characters/custom2.png":{"height":288,"width":312,"type":"png"},"/images/tiles/characters/custom3.png":{"height":288,"width":312,"type":"png"},"/images/tiles/characters/others/jsonX.png":{"height":200,"width":141,"type":"png"},"/images/tiles/monsters/mecha_gnome.png":{"height":144,"width":78,"type":"png"},"/images/tiles/monsters/harpy_b_1.png":{"height":212,"width":156,"type":"png"},"/images/tiles/monsters/harpy_b_fly_1.png":{"height":212,"width":156,"type":"png"},"/images/tiles/monsters/harpy_a_1.png":{"height":212,"width":156,"type":"png"},"/images/tiles/monsters/harpy_a_fly_1.png":{"height":212,"width":156,"type":"png"},"/images/tiles/characters/others/ship2.png":{"height":64,"width":201,"type":"png"},"/images/tiles/characters/others/newyear_tree.png":{"height":64,"width":144,"type":"png"},"/images/tiles/characters/bonus1.png":{"height":288,"width":312,"type":"png"},"/images/tiles/characters/military2.png":{"height":288,"width":312,"type":"png"},"/images/tiles/characters/military3.png":{"height":288,"width":312,"type":"png"},"/images/tiles/characters/knights.png":{"height":288,"width":312,"type":"png"},"/images/tiles/characters/chara2.png":{"height":288,"width":312,"type":"png"},"/images/tiles/characters/chara3.png":{"height":288,"width":312,"type":"png"},"/images/tiles/characters/chara4.png":{"height":288,"width":312,"type":"png"},"/images/tiles/characters/chara6.png":{"height":288,"width":312,"type":"png"},"/images/tiles/characters/chara7.png":{"height":288,"width":312,"type":"png"},"/images/tiles/characters/chara8.png":{"height":288,"width":312,"type":"png"},"/images/tiles/characters/automatron2.png":{"height":288,"width":312,"type":"png"},"/images/tiles/characters/npc1.png":{"height":288,"width":312,"type":"png"},"/images/tiles/characters/npc3.png":{"height":288,"width":312,"type":"png"},"/images/tiles/characters/npc4.png":{"height":288,"width":312,"type":"png"},"/images/tiles/characters/npc5.png":{"height":288,"width":312,"type":"png"},"/images/tiles/characters/npc6.png":{"height":288,"width":312,"type":"png"},"/images/tiles/characters/dwarf2.png":{"height":288,"width":312,"type":"png"},"/images/tiles/characters/tristone_m.png":{"height":288,"width":312,"type":"png"},"/images/tiles/characters/tristone_f.png":{"height":288,"width":312,"type":"png"},"/images/tiles/characters/mystics.png":{"height":144,"width":312,"type":"png"},"/images/tiles/monsters/creatures1.png":{"height":144,"width":312,"type":"png"},"/images/tiles/monsters/creatures2.png":{"height":424,"width":624,"type":"png"},"/images/tiles/monsters/jrpumpkins.png":{"height":144,"width":155,"type":"png"},"/images/tiles/characters/chara5.png":{"height":288,"width":312,"type":"png"},"/images/tiles/items/chests.png":{"height":288,"width":504,"type":"png"},"/images/tiles/characters/animationc.png":{"height":400,"width":564,"type":"png"},"/images/tiles/characters/animation1i.png":{"height":400,"width":564,"type":"png"},"/images/tiles/characters/animation2.png":{"height":400,"width":564,"type":"png"},"/images/tiles/characters/animation3.png":{"height":400,"width":564,"type":"png"},"/images/tiles/monsters/elemental.png":{"height":512,"width":720,"type":"png"},"/images/tiles/monsters/monster_dknight1.png":{"height":200,"width":141,"type":"png"},"/images/tiles/monsters/monster_dknight2.png":{"height":200,"width":141,"type":"png"},"/images/tiles/monsters/fairies.png":{"height":288,"width":312,"type":"png"},"/images/tiles/monsters/monster_bird1.png":{"height":228,"width":183,"type":"png"},"/images/tiles/monsters/monster_bird2.png":{"height":228,"width":183,"type":"png"},"/images/tiles/monsters/monster_bird3.png":{"height":228,"width":183,"type":"png"},"/images/tiles/monsters/monster_boar.png":{"height":264,"width":195,"type":"png"},"/images/tiles/monsters/monster_cacto.png":{"height":200,"width":141,"type":"png"},"/images/tiles/monsters/rudolphi.png":{"height":264,"width":195,"type":"png"},"/images/tiles/monsters/monster_elk.png":{"height":264,"width":195,"type":"png"},"/images/tiles/monsters/monster_golem1.png":{"height":200,"width":141,"type":"png"},"/images/tiles/monsters/monster_golem2.png":{"height":200,"width":141,"type":"png"},"/images/tiles/monsters/monster_lich.png":{"height":200,"width":141,"type":"png"},"/images/tiles/monsters/monster_lizardman1.png":{"height":200,"width":141,"type":"png"},"/images/tiles/monsters/monster_lizardman2.png":{"height":200,"width":141,"type":"png"},"/images/tiles/monsters/stompy3.png":{"height":200,"width":141,"type":"png"},"/images/tiles/monsters/monster_minotaur.png":{"height":200,"width":141,"type":"png"},"/images/tiles/monsters/monster_phoenix.png":{"height":228,"width":183,"type":"png"},"/images/tiles/monsters/monster_raptor1.png":{"height":200,"width":141,"type":"png"},"/images/tiles/monsters/monster_raptor2.png":{"height":200,"width":141,"type":"png"},"/images/tiles/monsters/grinch.png":{"height":144,"width":82,"type":"png"},"/images/tiles/monsters/monster_treant.png":{"height":200,"width":141,"type":"png"},"/images/tiles/monsters/monster_wolf1.png":{"height":264,"width":195,"type":"png"},"/images/tiles/monsters/monster_wolf2.png":{"height":264,"width":195,"type":"png"},"/images/tiles/monsters/json.png":{"height":228,"width":183,"type":"png"},"/images/tiles/monsters/custom1.png":{"height":512,"width":720,"type":"png"},"/images/tiles/monsters/custom2.png":{"height":512,"width":720,"type":"png"},"/images/tiles/monsters/goos.png":{"height":256,"width":360,"type":"png"},"/images/tiles/monsters/monster1.png":{"height":512,"width":720,"type":"png"},"/images/tiles/monsters/animals1.png":{"height":288,"width":312,"type":"png"},"/images/tiles/monsters/animals2.png":{"height":288,"width":504,"type":"png"},"/images/tiles/monsters/birds1_modded.png":{"height":288,"width":504,"type":"png"},"/images/tiles/monsters/goblinos.png":{"height":288,"width":312,"type":"png"},"/images/tiles/monsters/goblinkingb.png":{"height":212,"width":156,"type":"png"},"/images/tiles/monsters/monsterc6.png":{"height":512,"width":692,"type":"png"},"/images/tiles/monsters/tinyfairies.png":{"height":288,"width":312,"type":"png"},"/images/tiles/monsters/monsterc2.png":{"height":400,"width":564,"type":"png"},"/images/tiles/monsters/robots.png":{"height":288,"width":372,"type":"png"},"/images/tiles/monsters/mage.png":{"height":288,"width":312,"type":"png"},"/images/tiles/monsters/monster2.png":{"height":512,"width":720,"type":"png"},"/images/tiles/monsters/monster3c.png":{"height":512,"width":720,"type":"png"},"/images/tiles/monsters/monster4.png":{"height":512,"width":720,"type":"png"},"/images/tiles/monsters/vampire2d.png":{"height":288,"width":312,"type":"png"},"/images/tiles/monsters/mr_pumpkin.png":{"height":144,"width":80,"type":"png"},"/images/tiles/monsters/cbee.png":{"height":144,"width":78,"type":"png"},"/images/tiles/monsters/iceGolem.png":{"height":200,"width":141,"type":"png"},"/images/tiles/monsters/green.png":{"height":144,"width":80,"type":"png"},"/images/sprites/emblems/emblems.png":{"height":96,"width":480,"type":"png"},"/images/cosmetics/skins/sskin1.png":{"height":288,"width":324,"type":"png"},"/images/cosmetics/skins/mskin1.png":{"height":288,"width":324,"type":"png"},"/images/cosmetics/skins/lskin1.png":{"height":288,"width":324,"type":"png"},"/images/cosmetics/armors/sbody1.png":{"height":288,"width":324,"type":"png"},"/images/cosmetics/armors/mbody1.png":{"height":288,"width":324,"type":"png"},"/images/cosmetics/armors/mbody2.png":{"height":288,"width":324,"type":"png"},"/images/cosmetics/armors/mbody3.png":{"height":288,"width":324,"type":"png"},"/images/cosmetics/armors/mbody4.png":{"height":288,"width":324,"type":"png"},"/images/cosmetics/armors/mbody5.png":{"height":288,"width":324,"type":"png"},"/images/cosmetics/armors/mbody6.png":{"height":288,"width":324,"type":"png"},"/images/cosmetics/armors/sarmor1.png":{"height":288,"width":324,"type":"png"},"/images/cosmetics/armors/sarmor2.png":{"height":288,"width":324,"type":"png"},"/images/cosmetics/armors/marmor1.png":{"height":288,"width":324,"type":"png"},"/images/cosmetics/armors/marmor2.png":{"height":288,"width":324,"type":"png"},"/images/cosmetics/armors/marmor3.png":{"height":288,"width":324,"type":"png"},"/images/cosmetics/armors/marmor4.png":{"height":288,"width":324,"type":"png"},"/images/cosmetics/armors/marmor5.png":{"height":288,"width":324,"type":"png"},"/images/cosmetics/armors/marmor6.png":{"height":288,"width":324,"type":"png"},"/images/cosmetics/armors/marmor7.png":{"height":288,"width":324,"type":"png"},"/images/cosmetics/armors/marmor8.png":{"height":288,"width":324,"type":"png"},"/images/cosmetics/armors/marmor9.png":{"height":288,"width":324,"type":"png"},"/images/cosmetics/armors/marmor10.png":{"height":288,"width":324,"type":"png"},"/images/cosmetics/armors/marmor11.png":{"height":288,"width":324,"type":"png"},"/images/cosmetics/armors/marmor12.png":{"height":288,"width":324,"type":"png"},"/images/cosmetics/armors/larmor1.png":{"height":288,"width":324,"type":"png"},"/images/all_characters/lchar1.png":{"height":288,"width":324,"type":"png"},"/images/all_characters/mchar16.png":{"height":288,"width":324,"type":"png"},"/images/all_characters/schar7.png":{"height":288,"width":324,"type":"png"},"/images/all_characters/xschar2.png":{"height":288,"width":324,"type":"png"},"/images/all_characters/xxschar2.png":{"height":288,"width":324,"type":"png"},"/images/cosmetics/hairdo/hairdo1.png":{"height":120,"width":675,"type":"png"},"/images/cosmetics/hairdo/hairdo2.png":{"height":120,"width":675,"type":"png"},"/images/cosmetics/hairdo/hairdo3.png":{"height":120,"width":675,"type":"png"},"/images/cosmetics/hairdo/hairdo4.png":{"height":120,"width":675,"type":"png"},"/images/cosmetics/hairdo/hairdo5.png":{"height":120,"width":675,"type":"png"},"/images/cosmetics/hairdo/hairdo6.png":{"height":120,"width":675,"type":"png"},"/images/cosmetics/hats/hats1.png":{"height":120,"width":675,"type":"png"},"/images/cosmetics/hats/hats2.png":{"height":120,"width":675,"type":"png"},"/images/cosmetics/hats/hats3.png":{"height":120,"width":675,"type":"png"},"/images/cosmetics/hats/hats4.png":{"height":120,"width":675,"type":"png"},"/images/cosmetics/wings/wings1.png":{"height":144,"width":185,"type":"png"},"/images/cosmetics/wings/wings2.png":{"height":144,"width":128,"type":"png"},"/images/cosmetics/wings/wings3.png":{"height":144,"width":185,"type":"png"},"/images/cosmetics/wings/backpacks.png":{"height":144,"width":185,"type":"png"},"/images/cosmetics/wings/backpack2.png":{"height":144,"width":185,"type":"png"},"/images/cosmetics/tails/wolftail.png":{"height":144,"width":108,"type":"png"},"/images/cosmetics/tails/wolftail2.png":{"height":144,"width":108,"type":"png"},"/images/cosmetics/tails/wolftail3.png":{"height":144,"width":108,"type":"png"},"/images/cosmetics/makeup/smakeup.png":{"height":120,"width":27,"type":"png"},"/images/cosmetics/makeup/malemakeup.png":{"height":120,"width":378,"type":"png"},"/images/cosmetics/makeup/femalemakeupv2.png":{"height":120,"width":351,"type":"png"},"/images/cosmetics/makeup/fmakeup.png":{"height":120,"width":351,"type":"png"},"/images/cosmetics/accessories/eyeglasses.png":{"height":120,"width":1107,"type":"png"},"/images/cosmetics/beardo/beard1.png":{"height":120,"width":1107,"type":"png"},"/images/cosmetics/beardo/mask1.png":{"height":120,"width":675,"type":"png"},"/images/cosmetics/beardo/facemakeup.png":{"height":120,"width":675,"type":"png"},"/images/cosmetics/makeup/male_makeup.png":{"height":120,"width":567,"type":"png"},"/images/cosmetics/makeup/female_makeup.png":{"height":120,"width":621,"type":"png"},"/images/cosmetics/makeup/unisex_makeup.png":{"height":120,"width":648,"type":"png"},"/images/tiles/items/pack_1a.png":{"height":2048,"width":256,"type":"png"},"/images/tiles/items/pack_20vt8.png":{"height":1280,"width":320,"type":"png"},"/images/tiles/items/skills_20v6.png":{"height":260,"width":320,"type":"png"},"/images/tiles/items/custom.png":{"height":180,"width":140,"type":"png"},"/images/tiles/map/castle.png":{"height":512,"width":544,"type":"png"},"/images/tiles/map/custom2.png":{"height":560,"width":752,"type":"png"},"/images/tiles/map/custom.png":{"height":480,"width":480,"type":"png"},"/images/tiles/map/custom_a.png":{"height":320,"width":320,"type":"png"},"/images/tiles/map/doors.png":{"height":256,"width":192,"type":"png"},"/images/tiles/map/dungeon.png":{"height":416,"width":912,"type":"png"},"/images/tiles/map/house.png":{"height":1168,"width":1104,"type":"png"},"/images/tiles/map/inside.png":{"height":816,"width":832,"type":"png"},"/images/tiles/map/outside.png":{"height":832,"width":904,"type":"png"},"/images/tiles/map/puzzle.png":{"height":320,"width":336,"type":"png"},"/images/tiles/map/water_updated.png":{"height":1200,"width":704,"type":"png"},"/images/tiles/map/winter.png":{"height":640,"width":912,"type":"png"},"/images/tiles/map/fort.png":{"height":832,"width":656,"type":"png"},"/images/tiles/map/beach_v2.png":{"height":416,"width":576,"type":"png"},"/images/tiles/map/world.png":{"height":288,"width":432,"type":"png"},"/images/tiles/items/stands.png":{"height":144,"width":78,"type":"png"},"/images/tiles/map/new.png":{"height":480,"width":672,"type":"png"},"/images/tiles/map/dark_dimension.png":{"height":336,"width":464,"type":"png"},"/images/tiles/map/jungle.png":{"height":336,"width":496,"type":"png"},"/images/tiles/map/ship.png":{"height":448,"width":864,"type":"png"},"/images/tiles/map/ashlands.png":{"height":336,"width":640,"type":"png"},"/images/tiles/map/ruins.png":{"height":832,"width":704,"type":"png"},"/images/tiles/map/tree.png":{"height":576,"width":544,"type":"png"},"/images/tiles/map/lights.png":{"height":480,"width":640,"type":"png"}} diff --git a/functions.py b/functions.py index 9fe940a..2b97af3 100644 --- a/functions.py +++ b/functions.py @@ -276,6 +276,7 @@ def selection_info(self,user,domain): return {"type":"content","html":shtml("htmls/contents/selection.html",user=user,domain=domain,server=server,servers=servers,characters=get_characters(user))} def security_threat(request,domain): + return False referer=request.headers.get('Referer') or request.headers.get('Origin') or "" if not referer: return False @@ -1203,7 +1204,7 @@ def select_server(self,user,servers): return servers[0] def get_servers(no_cache=False): - servers=memcache.get("servers") + servers=memcache.get("servers"+(1/2!=0 and "v3" or "")) if not servers or no_cache: servers=[] for server in Server.query(Server.online == True): @@ -1220,7 +1221,7 @@ def set_servers(current=None): if msince(server.last_update)<5 and server.online and not (current and current.k()==server.k()): del server.info.data # otherwise easily exceeds 1MB [13/06/19] servers.append(server) - memcache.set("servers",servers) + memcache.set("servers"+(1/2!=0 and "v3" or ""),servers) def check_servers(): offlines=[]; servers=[] @@ -1242,7 +1243,7 @@ def check_servers(): del server.info.data servers.append(server) logging.info("Server Alive: %s"%server) - memcache.set("servers",servers) + memcache.set("servers"+(1/2!=0 and "v3" or ""),servers) if offlines: send_email(gdi(),"kaansoral@gmail.com",html="%s"%offlines,title="OFFLINE SERVERS DETECTED") enforce_limitations() @@ -1528,6 +1529,14 @@ def to_string_key(element): if is_string(element): return element return element.k() +def py3_safe_string(s): + #Because App Engine is run by a bunch of idiots now. Random things return bytes. Even something like .urlsafe() ... [06/02/24] + if 1/2==0: return s + try: + return s.decode("utf-8") + except: + return s + def str_or_unicode(s): try: return str(s) except: @@ -1743,8 +1752,8 @@ def jhtml(request,jsn=[]): if not request: return if getattr(request,"_cjsons",0): request._cjsons.extend(jsn) - #logging.info("CJSONS %s"%self._cjsons) - request.response.set_data(json.dumps(self._cjsons)) + #logging.info("CJSONS %s"%request._cjsons) + request.response.set_data(json.dumps(request._cjsons)) else: request.response.set_data(json.dumps(jsn)) return request.response @@ -2041,7 +2050,7 @@ def ginspect(o,id="root",force_inspection=0): str+="" elif type(o)==type({}): str+="
User "foldM_" on Discord stumbled onto this issue on NixOS - his solution was to set Steam to launch the game with: LD_LIBRARY_PATH=/lib:$LD_LIBRARY_PATH %command% (from Steam's Game Properties > Launch Options)
+Richard found a fix for this issue, the fix is to use the `--no-sandbox` flag.
+If you find and solve an issue, or just stumble onto an issue you can't solve, please email hello@adventure.land with details
diff --git a/node/server.js b/node/server.js index 5d2354a..ca58062 100644 --- a/node/server.js +++ b/node/server.js @@ -171,7 +171,7 @@ var events = { // SEASONS holidayseason: false, lunarnewyear: true, - valentines: false, + valentines: true, pinkgoo: 0, // every N minutes - 60 snowman: 20 * 60, // 1200 normally - 60 - at sprocess_game_data egghunt: 0, // every N minutes - 60 diff --git a/python3/README.txt b/python3/README.txt index 1fd85ab..08ef87e 100644 --- a/python3/README.txt +++ b/python3/README.txt @@ -8,9 +8,13 @@ The python3 dev_appserver uses Java objects, test it according to your needs and Useful: https://cloud.google.com/appengine/docs/standard/tools/local-devserver-command?tab=python +Useful for testing, creates a copy: node ~/gscripts/create_python3_copy.js + alias run_thegame3="python3.11 /Users/kaan/Desktop/APPENGINE/google-cloud-sdk/bin/dev_appserver.py --storage_path=/Users/kaan/Desktop/DEPLOY/python3/storage/ --blobstore_path=/Users/kaan/Desktop/DEPLOY/python3/storage/blobstore/ --datastore_path=/Users/kaan/Desktop/DEPLOY/python3/storage/new_db.bin --host=0.0.0.0 --port=8083 /Users/kaan/Desktop/DEPLOY/python3/thegame/ --require_indexes --enable_host_checking=False" Suggestions: 1) Invoke /admin/make with your email put in admin.py 2) From /admin/executor - call empty_fill_maps() -3) After getting rid of the initial errors, figure out the rest \ No newline at end of file +3) After getting rid of the initial errors, figure out the rest + +Useful for pulling logs: gcloud app logs tail -v 20240206t194907 \ No newline at end of file diff --git a/python3/app.yaml b/python3/app.yaml index dfbc6c1..b7c7f50 100644 --- a/python3/app.yaml +++ b/python3/app.yaml @@ -1,7 +1,5 @@ -runtime: python312 +runtime: python39 app_engine_apis: true -threadsafe: true -api_version: 1 builtins: - deferred: on @@ -33,6 +31,7 @@ handlers: script: auto env_variables: +# NDB_PY2_UNPICKLE_COMPAT: True NDB_USE_CROSS_COMPATIBLE_PICKLE_PROTOCOL: True MEMCACHE_USE_CROSS_COMPATIBLE_PROTOCOL: True DEFERRED_USE_CROSS_COMPATIBLE_PICKLE_PROTOCOL: True \ No newline at end of file diff --git a/tests.py b/tests.py index 3ec5277..7d884a5 100644 --- a/tests.py +++ b/tests.py @@ -14,7 +14,7 @@ def serve_test(name=""): domain=gdi(request) if name=="hash": start=datetime.now() - logging.info(pbkdf2_hex("test","123456",iterations=160)) + #logging.info(pbkdf2_hex("test","123456",iterations=160)) logging.info(mssince(start)) elif name=="levels": xp=200 @@ -30,6 +30,11 @@ def serve_test(name=""): return html elif name.startswith("pixi_"): return shtml("utility/htmls/tests/%s.html"%name,domain=domain) + elif name=="versions": + html="GAE_ENV: "+os.getenv('GAE_ENV', '')+"