fix: official game table and lists, feedback, museum and books

recordings of the official game (tools/recorder.js) had its game table and
several generic lists in them:

- lib/games.json follows the official table: the print kits, Brady's lab,
  the carnival games (in the room) and the buddy games have their real
  ids, and every game its "Play!" picture
- lists the server has nothing of its own for are answered as the official
  server did (lib/official-lists.json): the Journey Book's facts, and its
  pages and four of the Chamber of Knowledge's books rebuilt from the media
  files; Jam-A-Gram stamps are the official ones
- feedback windows send to the staff panels' feedback, over the game's own
  connection; museum gem donations are taken (cd)
- fact cards and museum exhibits missing from a list are had by their id
  (factDefs), and their arrows do nothing past the list
This commit is contained in:
Burrowdev committed 2026-10-23 21:52:59 +03:00
1 parent 6c273554d7
commit 15f321fb00
12 files changed
+812 -99

No files matched your search

+1 -1
View File
@@ -1,4 +1,4 @@
{
"cards": [1,2,3,4,5,7,8,86,118,119,124,128,152,154,155,201,283,284,329,346,355,356,361,380,382,384,385,387,388,389,390,391,1188,1206,1211,1222,1228,1242,1249,1250,1251,1354,1426,1520,1627,1768,1933,2235,2649,2697,2700,2702,2703,2704,2705,2706,2707,2708,2709,2711,2712,2713,2714,2715,2716,2717,2720,2723,2762,2763,2805,2806,2807,2808,2809,2810,2811,2812,2813,2814,2815,2816,2817,2818,2819,2820,2821,2822,2823,2824,2825,2826,2827,2828,3749,4393,4410,4411,4434,4435,4451,4452,4453,4454,4455,4457,4460,4461,4462,4464,4465,4466,4467,4468,4469,4470,4477,4478,4479,4538,4539,4540,4541,4542,4543,4544,4545,4546,4547,4548,4549,4777,4778,4779,4780,4855,4856,4946,5023,5024,5026,5066,5067,5068,5069,5070,5071,5073,5074,5075,5076,5077,5078,5079,5080,5081,5082,5083,5084,5085,5086,5087,5088,5089,5090,5091,5092,5093,5094,5095,5099,5100,5738,5980,5981,6130,6138,9013,9014,9015,9016,9017,9167,9170,9172,9174,9175,9326,9327,9328,9329,9330,9331,9332],
"stamps": [10,11,12,13,15,16,17,18,19,20,21,22,23]
"stamps": [13,11,2889,2896,1602,2886,1604,12,2877,2885,1603,2894,10,2899,2891,2876,376,2878,2879,2880,2881,2882,2884,2888,2898,2887,2890,377,2892,2893,2895,2900,378,2901,2902]
}
+5 -2
View File
@@ -17,9 +17,12 @@ const {CURRENCIES, hasRoom, addClothing, sendClothingAdded, sendClothingRemoved}
// ECardXtCommManager): a card, a stamp, a short message and perhaps a gift,
// kept in the receiver's inbox (account.ecards) until they delete it.
//
// which cards and stamps exist was a list on the official servers. the ones
// which cards and stamps exist was a list on the official servers. the cards
// offered here were found by looking through the CDN's media files for card
// artwork (tools/find-art.py found what is in lib/ecard-art.json).
// artwork (tools/find-art.py found what is in lib/ecard-art.json); the
// stamps are the official list itself, as a recording of the official game
// has it (lib/official-lists.json, list 44): the ones guessed before were
// partly not stamps at all, and showed nothing.
// ECard.type: what, if anything, comes with the card
const TYPE_PLAIN = 0;
+101 -70
View File
@@ -1,84 +1,118 @@
[
{"id": 4, "swf": "Pachinko", "title": "Gem Ball", "type": 1, "vars": [16, 17, 0], "icon": 4295},
{"id": 5, "swf": "MiniGame_Memory", "title": "Double Up", "type": 1, "vars": [6, 7, 83], "icon": 4291},
{"id": 6, "swf": "MoatMadness", "title": "Overflow", "type": 1, "vars": [8, 9, 80], "icon": 4300},
{"id": 10, "swf": "ParachuteGlider", "title": "Wind Rider", "type": 1, "vars": [12, 13, 79], "start": "seed", "icon": 4311},
{"id": 11, "swf": "Trivia", "title": "Temple of Trivia", "type": 1, "vars": [10, 11, 0], "ready": false, "icon": 4309},
{"id": 12, "swf": "RiverRace", "title": "River Race", "type": 1, "vars": [22, 23, 0], "start": "seed"},
{"id": 13, "swf": "PhantomFighter", "title": "Phantom Fighter", "type": 1, "vars": [14, 15, 84], "icon": 4312},
{"id": 14, "swf": "SpiderShooter", "title": "Spider Zapper", "type": 1, "vars": [18, 19, 82], "start": "seed", "icon": 4305},
{"id": 1, "swf": "PVP_TicTacToe", "title": "Tic Tac Toe", "type": 0, "vars": [63,0,0], "icon": 5063, "card": 5055, "buddy": true},
{"id": 4, "swf": "Pachinko", "title": "Gem Ball", "type": 1, "vars": [16,17,0], "icon": 4295, "card": 58},
{"id": 5, "swf": "MiniGame_Memory", "title": "Double Up", "type": 1, "vars": [6,7,0], "icon": 4291, "card": 61},
{"id": 6, "swf": "MoatMadness", "title": "Overflow", "type": 1, "vars": [8,9,9], "icon": 4300, "card": 59},
{"id": 10, "swf": "ParachuteGlider", "title": "Wind Rider", "type": 1, "vars": [12,13,0], "start": "seed", "icon": 4311, "card": 65},
{"id": 11, "swf": "Trivia", "title": "Temple of Trivia", "type": 1, "vars": [10,11,0], "icon": 4309, "card": 64, "ready": false},
{"id": 12, "swf": "RiverRace", "title": "River Race", "type": 1, "vars": [22,23,0], "start": "seed", "card": 62},
{"id": 13, "swf": "PhantomFighter", "title": "Phantom Fighter", "type": 1, "vars": [14,15,0], "icon": 4312, "card": 60},
{"id": 14, "swf": "SpiderShooter", "title": "Spider Zapper", "type": 1, "vars": [18,19,0], "start": "seed", "icon": 4305, "card": 63},
{"id": 15, "swf": "MicroPopcorn", "title": "Popcorn Machine", "type": 0},
{"id": 16, "swf": "MicroCrane", "title": "The Claw", "type": 0},
{"id": 17, "swf": "MicroSmoothie", "title": "Smoothie Machine", "type": 0},
{"id": 19, "swf": "WindRider", "title": "Sky High", "type": 1, "vars": [26, 27, 0], "icon": 4304},
{"id": 20, "swf": "Twister", "title": "Twister", "type": 1, "vars": [24, 25, 81], "icon": 4310},
{"id": 22, "swf": "DistanceChallenge", "title": "Long Shot", "type": 1, "vars": [20, 21, 0], "icon": 4298},
{"id": 23, "swf": "ArtStudioPrint", "title": "Coloring", "type": 1},
{"id": 26, "swf": "ArtStudioPottery", "title": "Pottery", "type": 1},
{"id": 27, "swf": "MicroPhantom", "title": "Phantom Vortex", "type": 0},
{"id": 28, "swf": "TowerDefense", "title": "Pest Control", "type": 1, "vars": [130, 131, 132], "icon": 4301},
{"id": 30, "swf": "GemBreaker", "title": "Gem Breaker", "type": 1, "vars": [91, 93, 92], "start": "seedAndPlayers", "icon": 4313},
{"id": 34, "swf": "MicroMiraSays", "title": "Mira Says", "type": 1, "vars": [77, 76, 0], "icon": 4299},
{"id": 35, "swf": "FortSmasher", "title": "Fruit Slinger", "type": 1, "vars": [143, 144, 145], "ready": false, "icon": 4294},
{"id": 36, "swf": "MicroHotCocoa", "title": "Hot Cocoa Machine", "type": 0},
{"id": 37, "swf": "SuperSort", "title": "Super Sort", "type": 1, "vars": [31, 32, 37], "icon": 4307},
{"id": 39, "swf": "PillBugs", "title": "Pill Bugs", "type": 1, "vars": [277, 278, 279], "icon": 4303},
{"id": 40, "swf": "BradyExpeditions", "title": "Brady Expeditions", "type": 1},
{"id": 41, "swf": "PhantomsTreasure", "title": "Phantom's Treasure", "type": 1, "vars": [281, 283, 282], "icon": 4302},
{"id": 42, "swf": "FeedingFrenzy", "title": "Eat 'Em Up", "type": 1, "vars": [284, 285, 0], "icon": 4292},
{"id": 43, "swf": "MicroPetWash", "title": "Pet Wash", "type": 0},
{"id": 48, "swf": "FashionShow", "title": "Best Dressed", "type": 1, "vars": [292, 293, 294], "ready": false, "icon": 4288},
{"id": 51, "swf": "ArtStudioPainting", "title": "Painting", "type": 1},
{"id": 52, "swf": "MicroPetSalon", "title": "Pet Stop", "type": 0},
{"id": 55, "swf": "MicroGameInvasion", "title": "Phantom Invasion", "type": 0},
{"id": 18, "swf": "MicroCrane", "title": "The Claw", "type": 0},
{"id": 19, "swf": "WindRider", "title": "Sky High", "type": 1, "vars": [26,27,0], "icon": 4304, "card": 78},
{"id": 20, "swf": "Twister", "title": "Twister", "type": 1, "vars": [24,25,0], "icon": 4310, "card": 79},
{"id": 21, "swf": "FrogFlyer", "title": "Long Shot", "type": 1, "ready": false},
{"id": 22, "swf": "DistanceChallenge", "title": "Long Shot", "type": 1, "vars": [20,21,21], "icon": 4298, "card": 80},
{"id": 23, "swf": "ArtStudioPrint", "title": "Coloring", "type": 1, "card": 58},
{"id": 24, "swf": "ArtStudioColor", "title": "Coloring", "type": 1, "card": 58, "ready": false},
{"id": 25, "swf": "ParachuteGliderTest", "title": "Wind Rider", "type": 1, "card": 65, "ready": false},
{"id": 26, "swf": "ArtStudioPottery", "title": "Pottery", "type": 1, "card": 58},
{"id": 27, "swf": "MicroPhantom", "title": "Phantom Vortex", "type": 0, "card": 69},
{"id": 28, "swf": "TowerDefense", "title": "Pest Control", "type": 1, "vars": [130,131,132], "icon": 4301, "card": 456},
{"id": 29, "swf": "GemBreaker", "title": "Gem Breaker", "type": 1, "start": "seedAndPlayers", "card": 58},
{"id": 30, "swf": "GemBreaker", "title": "Gem Breaker", "type": 1, "vars": [91,32,0], "start": "seedAndPlayers", "icon": 4313, "card": 354},
{"id": 31, "swf": "PVP_ConnectFour", "title": "Four Gems", "type": 0, "icon": 5057, "card": 5049, "buddy": true},
{"id": 32, "swf": "PVP_RockPaperScissor", "title": "Rock Paper Scissors", "type": 0, "icon": 5060, "card": 5052, "buddy": true},
{"id": 34, "swf": "MicroMiraSays", "title": "Mira Says", "type": 1, "vars": [77,76,0], "icon": 4299, "card": 288},
{"id": 35, "swf": "FortSmasher", "title": "Fruit Slinger", "type": 1, "vars": [74,75,0], "icon": 4294, "card": 541, "ready": false},
{"id": 36, "swf": "MicroHotCocoa", "title": "Hot Cocoa Machine", "type": 0, "vars": [95,0,0]},
{"id": 37, "swf": "SuperSort", "title": "Super Sort", "type": 1, "vars": [31,32,37], "icon": 4307, "card": 353},
{"id": 38, "swf": "PVP_ShellGame", "title": "Shell Game", "type": 0, "icon": 5062, "card": 5054, "buddy": true},
{"id": 39, "swf": "PillBugs", "title": "Pill Bugs", "type": 1, "vars": [277,278,279], "icon": 4303, "card": 1098},
{"id": 40, "swf": "BradyChemistrySet", "title": "Brady's Lab", "type": 0, "vars": [115,0,0]},
{"id": 41, "swf": "PhantomsTreasure", "title": "Phantom's Treasure", "type": 1, "vars": [281,283,282], "icon": 4302, "card": 1140},
{"id": 42, "swf": "FeedingFrenzy", "title": "Eat 'Em Up", "type": 1, "vars": [284,0,0], "icon": 4292, "card": 1170},
{"id": 43, "swf": "MicroPetWash", "title": "Pet Wash", "type": 0, "vars": [51,0,0]},
{"id": 45, "swf": "PVP_Marbles", "title": "Marbles", "type": 0, "icon": 5058, "card": 5050, "buddy": true},
{"id": 46, "swf": "OffTheHook", "title": "Off the Hook", "type": 1, "card": 79, "ready": false},
{"id": 47, "swf": "Pinball", "title": "Double Up", "type": 1, "card": 61, "ready": false},
{"id": 48, "swf": "FashionShow", "title": "Best Dressed", "type": 1, "vars": [292,293,294], "icon": 4288, "card": 1205, "ready": false},
{"id": 49, "swf": "Geography", "title": "Geography", "type": 1, "card": 79, "ready": false},
{"id": 51, "swf": "ArtStudioPainting", "title": "Painting", "type": 1, "vars": [78,0,0], "card": 4849},
{"id": 52, "swf": "MicroPetSalon", "title": "Pet Stop", "type": 0, "vars": [280,0,0], "card": 1205},
{"id": 53, "swf": "PVP_Scooped", "title": "Scooped", "type": 0, "icon": 5061, "card": 5053, "buddy": true},
{"id": 54, "swf": "Glide", "title": "Glide", "type": 1, "card": 79, "ready": false},
{"id": 55, "swf": "MicroGameInvasion", "title": "Phantom Invasion", "type": 0, "card": 1205},
{"id": 56, "swf": "ActivityGeography", "title": "Eat 'Em Up", "type": 1, "card": 1205, "ready": false},
{"id": 57, "swf": "MicroCrane", "title": "The Claw", "type": 0},
{"id": 58, "swf": "MicroCrane", "title": "The Claw", "type": 0},
{"id": 59, "swf": "MicroCrane", "title": "The Claw", "type": 0, "icon": 4290},
{"id": 60, "swf": "TouchPool", "title": "Touch Pool", "type": 1, "vars": [310, 308, 309], "icon": 5229},
{"id": 61, "swf": "MicroCrane", "title": "The Claw", "type": 0},
{"id": 62, "swf": "HorseRace", "title": "Jamaa Derby", "type": 1, "vars": [327, 328, 330], "ready": false, "icon": 4297},
{"id": 63, "swf": "MicroPuppy", "title": "Disc Toss", "type": 0, "vars": [313, 314, 315], "pet": 4},
{"id": 64, "swf": "MicroDucky", "title": "Ducky Dash", "type": 0, "vars": [316, 317, 318], "pet": 3},
{"id": 65, "swf": "MicroSnake", "title": "Sssssnake", "type": 0, "vars": [321, 322, 323], "pet": 11},
{"id": 66, "swf": "FashionShow", "title": "Best Dressed", "type": 1, "vars": [292, 293, 294], "ready": false, "icon": 4289},
{"id": 68, "swf": "Skeeball", "title": "Phantom Ball", "type": 1, "tickets": 10},
{"id": 69, "swf": "WhackPhantom", "title": "Whack-A-Phantom", "type": 1, "tickets": 10},
{"id": 70, "swf": "CandyCatcher", "title": "Candy Catch", "type": 1, "tickets": 10},
{"id": 60, "swf": "TouchPool", "title": "Touch Pool", "type": 1, "vars": [310,308,309], "icon": 5229, "card": 5228},
{"id": 61, "swf": "MicroCrane", "title": "The Claw", "type": 0, "card": 65},
{"id": 62, "swf": "HorseRace", "title": "Jamaa Derby", "type": 1, "vars": [327,328,330], "icon": 4297, "card": 1510, "ready": false},
{"id": 63, "swf": "MicroPuppy", "title": "Disc Toss", "type": 0, "vars": [313,314,315], "pet": 4},
{"id": 64, "swf": "MicroDucky", "title": "Ducky Dash", "type": 0, "vars": [316,317,318], "pet": 3},
{"id": 65, "swf": "MicroSnake", "title": "Sssssnake", "type": 0, "vars": [321,322,323], "pet": 11},
{"id": 66, "swf": "FashionShow", "title": "Best Dressed", "type": 1, "vars": [292,293,294], "icon": 4289, "card": 1482, "ready": false},
{"id": 67, "swf": "MicroCrane", "title": "The Claw", "type": 0},
{"id": 68, "swf": "Skeeball", "title": "Phantom Ball", "type": 0, "tickets": 10},
{"id": 69, "swf": "WhackPhantom", "title": "Whack-A-Phantom", "type": 0, "vars": [78,0,0], "tickets": 10, "card": 300},
{"id": 70, "swf": "CandyCatcher", "title": "Candy Catch", "type": 0, "tickets": 10, "card": 300},
{"id": 71, "swf": "MicroCrane", "title": "The Claw", "type": 0},
{"id": 72, "swf": "MicroGameInvasion", "title": "Phantom Invasion", "type": 0},
{"id": 73, "swf": "ArtPrintPlayPortrait", "title": "Painting", "type": 1},
{"id": 74, "swf": "CottonCandy", "title": "Cotton Candy Machine", "type": 0},
{"id": 75, "swf": "MicroCrane", "title": "The Claw", "type": 0},
{"id": 76, "swf": "ArtStudioPrint", "title": "Coloring", "type": 1},
{"id": 77, "swf": "FallingPhantoms", "title": "Falling Phantoms", "type": 1, "vars": [344, 345, 346], "ready": false, "icon": 4293},
{"id": 78, "swf": "DolphinRace", "title": "Splash and Dash", "type": 1, "vars": [357, 358, 360], "ready": false, "icon": 4306},
{"id": 80, "swf": "ShootingGallery", "title": "Carnival Darts", "type": 1, "tickets": 100},
{"id": 81, "swf": "MicroPetSalon", "title": "Pet Stop", "type": 0},
{"id": 82, "swf": "FastFoodies", "title": "Fast Foodies", "type": 1, "vars": [445, 444, 446], "icon": 5727},
{"id": 83, "swf": "HedgeHog", "title": "Hedge Hog", "type": 1, "vars": [349, 350, 351], "icon": 4296},
{"id": 72, "swf": "MicroGameInvasion", "title": "Phantom Invasion", "type": 0, "card": 259},
{"id": 73, "swf": "ArtPrintPlayPortrait", "title": "Painting", "type": 1, "vars": [78,0,0], "card": 1205},
{"id": 74, "swf": "CottonCandy", "title": "Cotton Candy Machine", "type": 0, "vars": [78,0,0]},
{"id": 75, "swf": "MicroCrane", "title": "The Claw", "type": 0, "card": 300},
{"id": 76, "swf": "ArtPrintPlayPortrait", "title": "Painting", "type": 0},
{"id": 77, "swf": "FallingPhantoms", "title": "Falling Phantoms", "type": 1, "vars": [344,345,346], "icon": 4293, "card": 1622, "ready": false},
{"id": 78, "swf": "DolphinRace", "title": "Splash and Dash", "type": 1, "vars": [357,358,360], "icon": 4306, "card": 1804, "ready": false},
{"id": 80, "swf": "ShootingGallery", "title": "Carnival Darts", "type": 0, "tickets": 100},
{"id": 81, "swf": "MicroPetSalon", "title": "Pet Stop", "type": 0, "vars": [57,0,0], "card": 259},
{"id": 82, "swf": "FastFoodies", "title": "Fast Foodies", "type": 1, "vars": [445,444,446], "icon": 5727},
{"id": 83, "swf": "HedgeHog", "title": "Hedge Hog", "type": 1, "vars": [349,350,351], "icon": 4296, "card": 1713},
{"id": 85, "swf": "MicroCrane", "title": "The Claw", "type": 0},
{"id": 86, "swf": "ArtStudioPrint", "title": "Coloring", "type": 1},
{"id": 87, "swf": "BradyChemistrySet", "title": "Brady's Lab", "type": 0},
{"id": 86, "swf": "ArtPrintPlayPortrait", "title": "Painting", "type": 0},
{"id": 87, "swf": "ArtPrintPlayPortrait", "title": "Painting", "type": 0},
{"id": 88, "swf": "SafetyQuiz", "title": "Safety Quiz", "type": 0},
{"id": 94, "swf": "EagleFlap", "title": "Swoopy Eagle", "type": 1, "vars": [378, 377, 0], "icon": 4308},
{"id": 96, "swf": "DunkAPhantom", "title": "Dunk-A-Phantom", "type": 1, "tickets": 10},
{"id": 97, "swf": "SpotOn", "title": "Spot On", "type": 1, "vars": [386, 387, 388], "icon": 4321},
{"id": 89, "swf": "ArtStudioPrint", "title": "Coloring", "type": 0},
{"id": 90, "swf": "BradyExpeditions", "title": "Brady Expeditions", "type": 1},
{"id": 91, "swf": "MicroSmoothie", "title": "Smoothie Machine", "type": 0},
{"id": 92, "swf": "ParachuteGlider2", "title": "Wind Rider", "type": 1, "card": 65, "ready": false},
{"id": 93, "swf": "QuestParachuteGlider", "title": "Wind Rider", "type": 1, "vars": [12,13,0], "card": 65, "ready": false},
{"id": 94, "swf": "EagleFlap", "title": "Swoopy Eagle", "type": 1, "vars": [378,377,0], "icon": 4308, "card": 2647},
{"id": 95, "swf": "ArtPrintPlayPortrait", "title": "Painting", "type": 0},
{"id": 96, "swf": "DunkAPhantom", "title": "Dunk-A-Phantom", "type": 0, "tickets": 10, "card": 300},
{"id": 97, "swf": "SpotOn", "title": "Spot On", "type": 1, "vars": [386,387,388], "icon": 4321, "card": 3561},
{"id": 98, "swf": "MicroCrane", "title": "The Claw", "type": 0, "vars": [5,0,0]},
{"id": 99, "swf": "MicroCrane", "title": "The Claw", "type": 0},
{"id": 100, "swf": "MicroCrane", "title": "The Claw", "type": 0},
{"id": 102, "swf": "TrueFalse", "title": "Best Guess", "type": 1, "vars": [403, 405, 0], "ready": false},
{"id": 101, "swf": "PVP_Memory", "title": "Pairs", "type": 0, "icon": 5059, "card": 5051, "buddy": true},
{"id": 102, "swf": "TrueFalse", "title": "Best Guess", "type": 1, "vars": [403,0,0], "card": 3748, "ready": false},
{"id": 103, "swf": "MicroCrane", "title": "The Claw", "type": 0},
{"id": 104, "swf": "MicroCrane", "title": "The Claw", "type": 0},
{"id": 105, "swf": "MicroCrane", "title": "The Claw", "type": 0},
{"id": 106, "swf": "MicroCrane", "title": "The Claw", "type": 0},
{"id": 104, "swf": "MicroCrane", "title": "The Claw", "type": 0, "card": 300},
{"id": 105, "swf": "MicroCrane", "title": "The Claw", "type": 0, "card": 61},
{"id": 106, "swf": "MicroCrane", "title": "The Claw", "type": 0, "card": 61},
{"id": 107, "swf": "MicroCrane", "title": "The Claw", "type": 0},
{"id": 108, "swf": "PVP_Bowling", "title": "Bowling", "type": 0, "icon": 5056, "card": 5048, "buddy": true},
{"id": 109, "swf": "MicroCrane", "title": "The Claw", "type": 0},
{"id": 110, "swf": "MicroCrane", "title": "The Claw", "type": 0},
{"id": 111, "swf": "MicroGoldPanning", "title": "Long Shot", "type": 0, "vars": [415,0,0], "ready": false},
{"id": 112, "swf": "MicroOatHarvest", "title": "Slingshot", "type": 0, "vars": [415,0,0], "ready": false},
{"id": 113, "swf": "MicroWoodGather", "title": "Slingshot", "type": 0, "vars": [415,0,0], "ready": false},
{"id": 114, "swf": "MicroStoneMining", "title": "Slingshot", "type": 0, "vars": [415,0,0], "ready": false},
{"id": 115, "swf": "MicroBambooHarvest", "title": "Slingshot", "type": 0, "vars": [415,0,0], "ready": false},
{"id": 116, "swf": "MicroCrane", "title": "The Claw", "type": 0},
{"id": 117, "swf": "MicroCrane", "title": "The Claw", "type": 0},
{"id": 118, "swf": "MicroCrane", "title": "The Claw", "type": 0},
{"id": 119, "swf": "MicroCrane", "title": "The Claw", "type": 0},
{"id": 120, "swf": "MicroCrane", "title": "The Claw", "type": 0},
{"id": 121, "swf": "MicroCrane", "title": "The Claw", "type": 0},
{"id": 122, "swf": "ArtPrintPlayPortrait", "title": "Painting", "type": 0},
{"id": 123, "swf": "MicroCrane", "title": "The Claw", "type": 0},
{"id": 124, "swf": "ArtPrintPlayPortrait", "title": "Painting", "type": 0},
{"id": 125, "swf": "MicroCrane", "title": "The Claw", "type": 0},
{"id": 126, "swf": "MicroCrane", "title": "The Claw", "type": 0},
{"id": 127, "swf": "MicroCrane", "title": "The Claw", "type": 0},
@@ -89,9 +123,11 @@
{"id": 132, "swf": "MicroCrane", "title": "The Claw", "type": 0},
{"id": 133, "swf": "MicroCrane", "title": "The Claw", "type": 0},
{"id": 134, "swf": "MicroCrane", "title": "The Claw", "type": 0},
{"id": 136, "swf": "ArtStudioPrint", "title": "Coloring", "type": 1},
{"id": 138, "swf": "FastFoodies", "title": "Fast Foodies", "type": 1, "vars": [445, 444, 446]},
{"id": 139, "swf": "ArtStudioGridDrawing", "title": "Pixel Painting", "type": 1},
{"id": 135, "swf": "ArtPrintPlayPortrait", "title": "Painting", "type": 0},
{"id": 136, "swf": "ArtPrintPlayPortrait", "title": "Painting", "type": 0},
{"id": 137, "swf": "ArtPrintPlayPortrait", "title": "Painting", "type": 0},
{"id": 138, "swf": "FastFoodies", "title": "Fast Foodies", "type": 1, "vars": [445,444,446], "icon": 5727, "card": 5723},
{"id": 139, "swf": "ArtStudioGridDrawing", "title": "Pixel Painting", "type": 1, "card": 5958},
{"id": 140, "swf": "MicroCrane", "title": "The Claw", "type": 0},
{"id": 141, "swf": "MicroCrane", "title": "The Claw", "type": 0},
{"id": 142, "swf": "MicroCrane", "title": "The Claw", "type": 0},
@@ -103,16 +139,11 @@
{"id": 148, "swf": "MicroCrane", "title": "The Claw", "type": 0},
{"id": 149, "swf": "MicroCrane", "title": "The Claw", "type": 0},
{"id": 150, "swf": "MicroCrane", "title": "The Claw", "type": 0},
{"id": 151, "swf": "ArtStudioGridDrawing", "title": "Pixel Painting", "type": 1, "vars": [78,0,0], "card": 5958},
{"id": 152, "swf": "ArtStudioPrint", "title": "Coloring", "type": 0},
{"id": 153, "swf": "MicroCrane", "title": "The Claw", "type": 0},
{"id": 154, "swf": "MicroCrane", "title": "The Claw", "type": 0},
{"id": 155, "swf": "MicroCrane", "title": "The Claw", "type": 0},
{"id": 156, "swf": "MicroCrane", "title": "The Claw", "type": 0},
{"id": 89, "swf": "PVP_TicTacToe", "title": "Tic Tac Toe", "type": 0, "vars": [86, 87, 0], "buddy": true, "card": 5063},
{"id": 90, "swf": "PVP_ConnectFour", "title": "Four Gems", "type": 0, "vars": [86, 87, 0], "buddy": true, "card": 5057},
{"id": 91, "swf": "PVP_RockPaperScissor", "title": "Rock Paper Scissors", "type": 0, "vars": [86, 87, 0], "buddy": true, "card": 5060},
{"id": 92, "swf": "PVP_ShellGame", "title": "Shell Game", "type": 0, "vars": [86, 87, 0], "buddy": true, "card": 5062},
{"id": 93, "swf": "PVP_Memory", "title": "Pairs", "type": 0, "vars": [86, 87, 0], "buddy": true, "card": 5059},
{"id": 95, "swf": "PVP_Scooped", "title": "Scooped", "type": 0, "vars": [86, 87, 0], "buddy": true, "card": 5061},
{"id": 98, "swf": "PVP_Bowling", "title": "Bowling", "type": 0, "vars": [86, 87, 0], "buddy": true, "card": 5056},
{"id": 101, "swf": "PVP_Marbles", "title": "Marbles", "type": 0, "vars": [86, 87, 0], "buddy": true, "card": 5058}
{"id": 158, "swf": "ArtPrintPlayPortrait", "title": "Painting", "type": 1, "vars": [78,0,0], "card": 1205}
]
+19
View File
@@ -19,6 +19,7 @@ const LAYER_EYES = "3";
const MAX_RECYCLED_AT_ONCE = 500;
const MAX_USED_AT_ONCE = 200; // pieces put on or taken off in one message
const RECYCLE_FRACTION = 0.3; // matches recyclePercentage sent at login
const CURRENCY_GEMS = 0; // ItemXtCommManager.currencyUpdateResponse's currency type
module.exports = ({others, sendItemList}) => {
// ItemXtCommManager.itemBuyResponse: [status, shopId, newAmount, currencyType]
@@ -141,6 +142,24 @@ module.exports = ({others, sendItemList}) => {
session.sendXt("ce", -1, 1, account.currency[paid]);
},
// gui.MuseumDonation: [amount], gems given to the museum's causes. the
// reply (currencyDonationResponse) is [1] or [0]; the gems go, and the
// account keeps count of what it has given.
cd(session, roomId, [amount]) {
const {account} = session;
const gems = /^\d{1,9}$/.test(String(amount)) ? Number(amount) : 0;
if (gems < 1 || (account.currency.gems || 0) < gems) {
session.sendXt("cd", -1, 0);
return;
}
account.currency.gems -= gems;
account.gemsDonated = (account.gemsDonated || 0) + gems;
achievements.currencyChanged(account, "gems", -gems);
accounts.save(account);
session.sendXt("cu", -1, CURRENCY_GEMS, account.currency.gems, 0);
session.sendXt("cd", -1, 1);
},
// ItemXtCommManager.requestItemRecycle: [invIdx, ...]. the reply
// (itemRecycleResponse) is [count, newGemTotal, ...recycledInvIdx], and
// the recycling window then waits, behind its spinner, for the item
+13 -10
View File
@@ -17,10 +17,14 @@ const {activeAvatar, addClothing, sendClothingAdded} = require("./player.js");
// game: the room it runs in, the start signal, gem awards, and for some
// games a few messages of their own.
//
// lib/games.json is that table, put back together from what still names the
// ids: arcade-machine den items (gameDefId and a name), the room files (which
// id stands where), the names GameCardPopup has for each game class, and the
// achievement defs (which user vars a game counts in). entries:
// lib/games.json is that table, as a recording of the official game has it
// (its "mi" reply, made with tools/recorder.js): which class each id runs,
// in a window or in the room's place, its user vars and its pictures. it
// was first put back together from what still names the ids (arcade-machine
// den items, the room files, GameCardPopup's names, the achievement defs),
// which had some ids wrong: the print kits, the carnival games (run in the
// room, not in its place), Brady's lab, and the buddy games, given ids of
// other games' as nothing then named theirs. entries:
// id game def id
// swf the game's key in game.IncludeMinigames
// title its name; sent as the id of the localization string that says so
@@ -33,10 +37,9 @@ const {activeAvatar, addClothing, sendClothingAdded} = require("./player.js");
// icon media id of its picture in the HUD's Games window; the games with
// one are the ones that window lists
// buddy true: one of the eight games two players play from a player's
// card (lib/buddygames.js). their ids are ours: nothing in the
// client names them, and the official table is gone.
// card a buddy game's picture, on the card's game tab and in the
// invitation
// card (lib/buddygames.js)
// card the game's title picture on its "Play!" popup; a buddy game's
// in the invitation
//
// every other game is played alone (minPlayers = maxPlayers = 1): the
// multiplayer ones each have a protocol of their own between the players.
@@ -123,8 +126,8 @@ module.exports = ({tell, leaveRoom, findOnline, blocks, watchers}) => {
game.buddy ? 2 : MULTIPLAYER[game.swf] ? MULTIPLAYER[game.swf].max : 1,
0, // max spectators
game.type,
// the game card: the title picture on the "play" popup (not known), and
// for a buddy game the picture in the invitation.
// the game card: the title picture on the "play" popup, and for a buddy
// game the picture in the invitation.
game.card || 0,
...(game.vars || [0, 0, 0]),
game.buddy ? 1 : 0, // ready for player-versus-player: listed on players' cards
+1
View File
@@ -0,0 +1 @@
{"10":{"type":1033,"count":141,"entries":["9329","0","9326","0","9332","0","9330","0","9331","0","9327","0","9328","0","9167","0","9170","0","9172","0","9174","0","9175","0","9176","0","9013","0","9014","0","9015","0","9016","0","9017","0","4452","0","2702","0","4451","0","2706","0","4453","0","2762","0","2711","0","2716","0","2715","0","2723","0","2697","0","2717","0","4478","0","1250","0","1251","0","1354","0","1426","0","1627","0","5738","0","346","0","86","0","124","0","118","0","2805","0","2806","0","2807","0","2808","0","2809","0","2810","0","2811","0","2812","0","2813","0","2814","0","2815","0","2816","0","2817","0","2818","0","2819","0","2820","0","2821","0","2822","0","2823","0","2824","0","2825","0","2826","0","2827","0","2828","0","1","0","4547","0","4542","0","4544","0","4549","0","4540","0","4548","0","4538","0","4539","0","4541","0","4543","0","4545","0","4546","0","2708","0","4470","0","356","0","5077","0","5078","0","5079","0","2705","0","4457","0","4465","0","2703","0","2709","0","5092","0","5093","0","5094","0","5095","0","4856","0","2712","0","2713","0","2714","0","4477","0","6130","0","6138","0","4777","0","4778","0","4779","0","4780","0","4855","0","5980","0","5981","0","4435","0","4946","0","4460","0","4461","0","4462","0","2707","0","4454","0","5088","0","5089","0","5090","0","5091","0","4455","0","2700","0","1188","0","2704","0","4459","0","4467","0","4468","0","4469","0","4393","0","5073","0","5074","0","5075","0","5076","0","4410","0","5084","0","5085","0","5086","0","5087","0","4466","0","5080","0","5081","0","5082","0","5083","0"]},"16":{"type":1023,"count":50,"entries":["551","552","553","554","555","556","557","564","558","569","559","1831","573","560","578","561","576","562","563","579","565","1841","568","574","566","1845","567","570","577","575","1830","571","1844","1826","572","1835","1839","1832","1843","1829","1827","1842","1828","1846","1838","1833","1840","1836","1837","1834"]},"44":{"type":1033,"count":35,"entries":["13","0","11","0","2889","0","2896","0","1602","0","2886","0","1604","0","12","0","2877","0","2885","0","1603","0","2894","0","10","0","2899","0","2891","0","2876","0","376","0","2878","0","2879","0","2880","0","2881","0","2882","0","2884","0","2888","0","2898","0","2887","0","2890","0","377","0","2892","0","2893","0","2895","0","2900","0","378","0","2901","0","2902","0"]},"53":{"type":1033,"count":14,"entries":["1389","1603","1545","1600","1595","1601","1265","1604","1470","1599","1232","1790","2279","3726","2015","0","7061","18253","1185","912","1192","1571","1186","913","1187","914","6189","0"],"note":"not recorded: the Journey Book's pages, found among the media files by their jb_title parts, and each land's name"},"54":{"type":1035,"count":160,"entries":["634","7044","32198","32199","10","459","0","635","7045","32200","32201","10","459","1","636","7046","32202","32203","10","459","2","637","7047","32204","32205","10","459","3","638","7048","32206","32207","10","459","4","639","7049","32208","32209","10","459","5","640","7050","32210","32211","10","459","6","641","7051","32212","32213","10","459","7","642","7052","32214","32215","10","459","8","643","7053","32216","32217","10","459","9","606","6667","31309","31310","14","457","0","607","6666","31311","31312","14","457","1","608","6668","31313","31314","14","457","2","609","6670","31303","31304","14","457","3","610","6665","31307","31308","14","457","4","611","6669","31305","31306","14","457","5","578","6180","30096","30097","14","456","11","577","6181","30094","30095","14","456","10","576","6187","30092","30093","14","456","9","575","6186","30090","30091","14","456","8","574","6179","30088","30089","14","456","7","573","6178","30086","30087","14","456","6","572","6177","30084","30085","14","456","5","571","6176","30082","30083","14","456","4","570","6183","30080","30081","14","456","3","569","6182","30078","30079","14","456","2","568","6185","30076","30077","14","456","1","567","6184","30074","30075","14","456","0","140","775","812","848","10","289","0","141","777","814","850","10","289","1","142","780","817","853","10","289","2","143","125","808","844","10","289","3","144","776","813","849","10","289","4","145","772","809","845","10","289","5","146","774","811","847","10","289","6","147","778","815","851","10","289","7","148","781","818","854","10","289","8","149","779","816","852","10","289","9","150","773","810","846","10","289","10","151","815","832","868","10","291","0","152","821","840","876","10","291","1","153","817","834","871","10","291","2","154","824","843","883","10","291","3","155","820","839","875","10","291","4","156","819","838","873","10","291","5","157","818","835","872","10","291","6","158","822","841","879","10","291","7","159","823","842","880","10","291","8","160","816","833","869","10","291","9","161","784","821","857","10","290","0","162","786","823","859","10","290","1","163","813","830","866","10","290","2","164","788","825","861","10","290","3","165","783","820","856","10","Line truncated
+43
View File
@@ -19,6 +19,7 @@ const badges = require("./badges.js");
const bans = require("./bans.js");
const devices = require("./devices.js");
const chatlog = require("./chatlog.js");
const support = require("./support.js");
const chatFilter = require("./chatfilter.js");
const chatSpam = require("./chatspam.js");
const chatStyles = require("./chatstyles.js");
@@ -128,6 +129,15 @@ const DEF_COMBINED_LIST = 1060;
const DEF_DEN_ROOM = 1040;
const DEF_CURRENCY_EXCHANGE = 1051;
const DEF_DIAMOND = 1054;
// generic lists as the official server answered them (gl), recorded with
// tools/recorder.js: used where this server has none of its own. one was
// not recorded and is made up the same way: the Journey Book's pages (53),
// found among the media files (each has a "jb_title_<land>" part) with the
// name of each land, which opens the book at the page of the land the
// player is in (GuiManager.onJourneyBookMediaListReceived). likewise the
// books of the Chamber of Knowledge (EBookChooser, lists 353-356) and their
// pages, for the four whose pages could be found.
const OFFICIAL_LISTS = require("./official-lists.json");
const SHOP_LIST_TYPES = [DEF_ITEM, DEF_DEN_ITEM, DEF_DEN_ROOM, DEF_COMBINED_LIST, DEF_CURRENCY_EXCHANGE, DEF_DIAMOND];
// a shop's title when its room gives it none (a shop in a land's main room,
// or one opened from elsewhere): what it sells (strings in lib/defpacks.js).
@@ -226,6 +236,11 @@ const sees = (viewer, subject) => (!subject.invisible || roles.isActiveStaff(vie
&& !(viewer.account.hideBlocked && blocks.has(viewer.account, subject.account));
// everyone else in the room who should hear about this player's animal.
const watchers = session => others(session).filter(other => sees(other, session));
// the game's feedback windows by type (FeedbackManager.frameLabelForType;
// the titles are the feedback defs' own), for the panel to say where a
// message came from
const FEEDBACK_KINDS = new Map([[1, "Theatre feedback"], [3, "Feedback"], [4, "Jamaa Journal feedback"], [5, "Feedback"],
[11, "Theatre feedback"], [18, "Jammer Wall feedback"], [19, "Chat feedback"], [21, "Theatre feedback"], [22, "Theatre feedback"]]);
const TYPING_EVERY_MS = 2000; // "typing" passed on at most this often per player (xty)
// tags ("@name") in chat and on Jammer Walls (xmn): the longest player's
@@ -937,6 +952,16 @@ const handlers = {
count = defpacks.petIds().length;
entries = defpacks.petIds().flatMap(id => [id, 1]);
}
// what the official server answered, where this one has nothing of its
// own (lib/official-lists.json, from recordings of the official game:
// the Journey Book's facts and pictures among them)
if ((count === undefined ? entries.length : count) === 0 && Object.hasOwn(OFFICIAL_LISTS, String(Number(listId)))) {
const official = OFFICIAL_LISTS[String(Number(listId))];
if (official.type === type) {
entries = official.entries;
count = official.count;
}
}
// for shops the first unused field is the title's string id; left empty
// it keeps the shop window's own title (Shop.gotItemListCallback).
const title = SHOP_LIST_TYPES.includes(type) ? (session.room && roomInfo.shopTitle(session.room.base, listId)) || SHOP_KIND_TITLES.get(type) : 0;
@@ -1078,6 +1103,24 @@ const handlers = {
}
},
// the game's feedback windows (the purple Help and Feedback buttons, the
// orbs in rooms, the newspaper's and the theatre's: the patched
// gui.FeedbackManager): xfb [the window's feedback type, the text]. it
// goes to the staff panels' feedback (lib/support.js), named by where it
// was written.
xfb(session, roomId, [type, ...text]) {
const where = FEEDBACK_KINDS.get(Number(type)) || "Feedback";
const said = text.join("%").trim();
if (!said) {
return;
}
const result = support.sendFeedback(session.account, "feedback", `${where} (in ${session.room ? session.room.displayName : "the game"}): ${said}`);
// the window has thanked them already; said only when it did not go
if (!result.ok) {
tell(session, result.error === "too_many" ? "You have sent a lot of feedback today. Try again tomorrow." : "That feedback could not be sent.");
}
},
// the patched client's tags (AJClient.resolveMentions): xmn [id, the text
// after each "@", ...] -> "xmn" [.., .., id, then for each text: how many
// of its characters are a player's name (0 for none), the name as it is
+592
View File
@@ -0,0 +1,592 @@
package gui
{
import achievement.AchievementXtCommManager;
import com.sbi.analytics.SBTracker;
import com.sbi.client.KeepAlive;
import com.sbi.popup.SBStandardTitlePopup;
import flash.display.DisplayObjectContainer;
import flash.display.MovieClip;
import flash.events.Event;
import flash.events.MouseEvent;
import flash.external.ExternalInterface;
import flash.net.URLLoader;
import flash.net.URLRequest;
import flash.net.URLRequestHeader;
import flash.utils.ByteArray;
import loader.FeedbackDefHelper;
import loader.MediaHelper;
import localization.LocalizationManager;
public class FeedbackManager
{
public static const TYPE_ASK_BRADY:int = 1;
public static const TYPE_ITEMS:int = 2;
public static const TYPE_HOWL:int = 3;
public static const TYPE_WORK:int = 4;
public static const TYPE_GENERIC:int = 5;
public static const TYPE_FLAGS:int = 6;
public static const TYPE_PETS:int = 7;
public static const TYPE_PARTIES:int = 8;
public static const TYPE_EPIC_ITEMS:int = 9;
public static const TYPE_ARCADE:int = 10;
public static const TYPE_ASK_TIERNEY:int = 11;
public static const TYPE_DONATION:int = 12;
public static const TYPE_CARNIVAL:int = 13;
public static const TYPE_ARTSTUDIO:int = 14;
public static const TYPE_JAMSESSION:int = 15;
public static const TYPE_DIAMOND:int = 16;
public static const TYPE_ADVENTURE:int = 17;
public static const TYPE_DICTIONARY:int = 18;
public static const TYPE_CHAT_EXPERIENCE:int = 19;
public static const TYPE_MASTERPIECES:int = 20;
public static const TYPE_ASK_CAMI:int = 21;
public static const TYPE_ASK_GABBY:int = 22;
private static const TAB_MEDIA_ID:int = 153;
private static const POPUP_MEDIA_ID:int = 457;
private static const TAB_FRAME_LABEL:String = "answer";
private static var _feedbackDefCache:Array;
private static var _feedbackLocs:Array;
private static var _feedbackDefHelpers:Array;
private static var _tabMediaHelper:MediaHelper;
private static var _tabTemplate:MovieClip;
private static var _popupMediaHelper:MediaHelper;
private static var _popup:MovieClip;
private static var _imageUploader:UserImageUpload;
private static var _guiLayer:DisplayLayer;
private static var _worldLayer:DisplayLayer;
private static var _secondaryType:int;
public function FeedbackManager()
{
super();
}
public static function init(param1:DisplayLayer, param2:DisplayLayer) : void
{
_feedbackDefCache = [];
_guiLayer = param1;
_worldLayer = param2;
_popupMediaHelper = new MediaHelper();
_tabMediaHelper = new MediaHelper();
_tabMediaHelper.init(153,mediaHelperCallback,true);
_imageUploader = new UserImageUpload();
_imageUploader.init();
if(ExternalInterface.available)
{
ExternalInterface.addCallback("openFeedback",handleOpenDefaultFeedback);
}
}
public static function setUpOrbs(param1:Array, param2:Array) : void
{
var _loc4_:int = 0;
var _loc3_:Object = null;
var _loc5_:FeedbackDefHelper = null;
_feedbackLocs = param2;
_feedbackDefHelpers = [];
_loc4_ = 0;
while(_loc4_ < param1.length)
{
if(param1[_loc4_] == 0)
{
DarkenManager.showLoadingSpiral(false);
throw new Error("Id == 0");
}
_loc3_ = _feedbackDefCache[param1[_loc4_]];
if(!_loc3_)
{
_loc5_ = new FeedbackDefHelper();
_loc5_.init(param1[_loc4_],onDefReceived);
_feedbackDefHelpers[param1[_loc4_]] = _loc5_;
}
else
{
setUpOrb(_loc3_);
}
_loc4_++;
}
}
public static function openFeedbackPopup(param1:int) : void
{
var _loc3_:FeedbackDefHelper = null;
if(param1 == 0)
{
DarkenManager.showLoadingSpiral(false);
throw new Error("Id == 0");
}
DarkenManager.showLoadingSpiral(true);
if(!_feedbackDefHelpers)
{
_feedbackDefHelpers = [];
}
var _loc2_:Object = _feedbackDefCache[param1];
if(!_loc2_)
{
_loc3_ = new FeedbackDefHelper();
_loc3_.init(param1,onDefReceived);
_feedbackDefHelpers[param1] = _loc3_;
}
else
{
displayFeedbackPopup(_loc2_);
}
}
private static function handleOpenDefaultFeedback() : void
{
openFeedbackPopup(5);
}
private static function onDefReceived(param1:FeedbackDefHelper) : void
{
var _loc5_:Object = param1.def;
var _loc4_:String = LocalizationManager.translateIdOnly(int(_loc5_.defaultStrRef));
var _loc3_:RegExp = /\r\n/g;
_loc4_ = _loc4_.replace(_loc3_,"\n");
_loc3_ = /\r/g;
_loc4_ = _loc4_.replace(_loc3_,"\n");
var _loc2_:Object = {
"id":int(_loc5_.id),
"titleTxt":LocalizationManager.translateIdOnly(int(_loc5_.titleStrRef)),
"defaultTxt":_loc4_,
"thanksTxt":LocalizationManager.translateIdOnly(int(_loc5_.thankStrRef)),
"allowImg":Boolean(int(_loc5_.bAcceptImage)),
"userVarId":int(_loc5_.userVarRef),
"bitIdx":int(_loc5_.bitIndex)
};
_feedbackDefCache[_loc2_.id] = _loc2_;
_feedbackDefHelpers[_loc2_.id] = null;
_loc2_.seen = gMainFrame.userInfo.userVarCache.isBitSet(_loc2_.userVarId,_loc2_.bitIdx);
if(_loc2_.id == 1 || _loc2_.id == 11 || _loc2_.id == 3 || _loc2_.id == 4 || _loc2_.id == 5 || _loc2_.id == 18 || _loc2_.id == 19 || _loc2_.id == 21 || _loc2_.id == 22)
{
displayFeedbackPopup(_loc2_);
}
else
{
setUpOrb(_loc2_);
}
}
private static function setUpOrb(param1:Object) : void
{
var _loc3_:MovieClip = null;
var _loc2_:int = 0;
if(_tabTemplate)
{
_loc3_ = new _tabTemplate.constructor();
_loc3_.def = param1;
_loc2_ = int(_loc3_.id = int(param1.id));
_loc3_.x = _feedbackLocs[_loc2_].x;
_loc3_.y = _feedbackLocs[_loc2_].y;
if(param1.seen)
{
_loc3_.gotoAndPlay("answerDim");
}
else
{
_loc3_.gotoAndPlay("answer");
}
_loc3_.addEventListener("mouseDown",onTabMouseDown,false,0,true);
_worldLayer.addChild(_loc3_);
}
}
private static function mediaHelperCallback(param1:MovieClip) : void
{
var _loc2_:int = 0;
if(param1)
{
if(param1.mediaHelper.id == 153)
{
_loc2_ = int(param1.mediaHelper.id);
_tabTemplate = MovieClip(param1.getChildAt(0));
_tabMediaHelper.destroy();
_tabMediaHelper = null;
}
else if(param1.mediaHelper.id == 457)
{
_popup = param1;
_popupMediaHelper.destroy();
_popupMediaHelper = null;
_popup.x = 900 * 0.5;
_popup.y = 550 * 0.5;
_popup.parent.x = _popup.x;
_popup.parent.y = _popup.y;
displayFeedbackPopup(param1.passback);
}
}
}
private static function onTabMouseDown(param1:MouseEvent) : void
{
param1.stopPropagation();
var _loc2_:MovieClip = MovieClip(param1.currentTarget);
var _loc3_:Object = _loc2_.def;
SBTracker.push();
SBTracker.trackPageview("/game/play/popup/feedback/" + _loc3_.id);
DarkenManager.showLoadingSpiral(true);
if(!_loc3_.seen)
{
_loc2_.gotoAndPlay("answerDim");
}
displayFeedbackPopup(_loc3_);
}
public static function displayFeedbackPopup(param1:Object) : void
{
var _loc3_:Array = null;
var _loc2_:int = int(param1.id);
if(!_popup)
{
_popupMediaHelper.init(457,mediaHelperCallback,param1);
return;
}
if(!param1.seen)
{
param1.seen = true;
AchievementXtCommManager.requestSetUserVar(param1.userVarId,param1.bitIdx);
}
removePopup();
_popup.gotoAndStop(frameLabelForType(_loc2_));
_popup.submitBtn.addEventListener("mouseDown",onMouseDown,false,0,true);
_popup.bx.addEventListener("mouseDown",onMouseDown,false,0,true);
_popup.addEventListener("mouseDown",onMouseDown,false,0,true);
_popup.txt.addEventListener("mouseDown",onMouseDown,false,0,true);
_popup.def = param1;
if(_popup["descTxt"])
{
_loc3_ = param1.defaultTxt.split("|");
LocalizationManager.updateToFit(_popup.descTxt,_loc3_[0]);
LocalizationManager.updateToFit(_popup.txt,_loc3_[1]);
}
else
{
LocalizationManager.updateToFit(_popup.txt,param1.defaultTxt);
}
_popup.defaultTxt = _popup.txt.text;
_popup.titleTxt.text = param1.titleTxt;
if(param1.allowImg)
{
_popup.addFileBtn.visible = true;
_imageUploader.setUploadBtn(_popup.addFileBtn);
_popup.removeFileBtn.addEventListener("mouseDown",onRemoveFileBtn,false,0,true);
}
else
{
if(_popup.addFileBtn)
{
_popup.addFileBtn.visible = false;
}
if(_popup.removeFileBtn)
{
_popup.removeFileBtn.visible = false;
}
}
_popup.txt.maxChars = maxCharsForType(_loc2_);
if(_loc2_ == 18)
{
_popup.txt.restrict = "^ ";
}
else
{
_popup.txt.restrict = null;
}
_popup.visible = true;
_popup.clickedTextBox = false;
KeepAlive.startKATimer(_popup);
DarkenManager.showLoadingSpiral(false);
DarkenManager.darken(DisplayObjectContainer(_popup));
_guiLayer.addChild(DisplayObjectContainer(_popup));
}
private static function frameLabelForType(param1:int) : int
{
switch(param1)
{
case 1:
return 1;
case 3:
case 19:
return 2;
case 4:
case 2:
case 5:
case 6:
case 7:
case 8:
case 9:
case 10:
case 13:
case 15:
case 16:
case 17:
break;
case 11:
return 4;
case 18:
return 6;
case 21:
return 7;
case 22:
return 8;
default:
return 1;
}
return 3;
}
private static function maxCharsForType(param1:int) : int
{
switch(param1)
{
case 1:
case 11:
case 21:
case 22:
return 150;
case 3:
return 50;
case 4:
return 3000;
case 2:
case 9:
case 16:
case 10:
case 17:
case 5:
return 300;
case 12:
case 8:
case 7:
case 15:
case 6:
case 13:
case 14:
break;
case 19:
return 200;
case 18:
return 25;
default:
return 1;
}
return 100;
}
private static function onRemoveFileBtn(param1:MouseEvent) : void
{
param1.stopPropagation();
_imageUploader.resetUploader();
_popup.addFileBtn.visible = true;
}
private static function onMouseDown(param1:MouseEvent) : void
{
var _loc3_:String = null;
var _loc2_:RegExp = null;
param1.stopPropagation();
if(param1.currentTarget == _popup)
{
return;
}
if(param1.currentTarget == _popup.txt)
{
if(!_popup.clickedTextBox)
{
_popup.txt.text = "";
_popup.clickedTextBox = true;
gMainFrame.stage.focus = _popup.txt;
_popup.txt.setSelection(0,0);
}
return;
}
if(param1.currentTarget.name == "submitBtn")
{
_loc3_ = _popup.txt.text;
_loc2_ = /\r\n/g;
_loc3_ = _loc3_.replace(_loc2_,"\n");
_loc2_ = /\r/g;
_loc3_ = _loc3_.replace(_loc2_,"\n");
if(_loc3_.length > 0 && _loc3_ != _popup.defaultTxt || _imageUploader.fileName != "")
{
if(_loc3_ == _popup.def.defaultTxt)
{
_loc3_ = _popup.txt.text = "";
}
setupRequest(_imageUploader,_loc3_,_popup.def.id,_secondaryType,onSendComplete,onSendError);
}
}
removePopup(param1.currentTarget.name == "bx");
}
private static function removePopup(param1:Boolean = true) : void
{
if(_popup)
{
_popup.removeEventListener("mouseDown",onMouseDown);
_popup.bx.removeEventListener("mouseDown",onMouseDown);
_popup.submitBtn.removeEventListener("mouseDown",onMouseDown);
_popup.txt.removeEventListener("mouseDown",onMouseDown);
if(_popup.def && _popup.def.allowImg)
{
_imageUploader.resetUploader();
_popup.addFileBtn.visible = true;
_popup.removeFileBtn.removeEventListener("mouseDown",onRemoveFileBtn);
}
DarkenManager.unDarken(_popup);
_popup.visible = false;
SBTracker.pop();
if(!param1)
{
new SBStandardTitlePopup(_guiLayer,_popup.def.thanksTxt);
}
KeepAlive.stopKATimer(_popup);
}
}
// feedback goes to this server's staff (lib/world.js xfb) over the
// game's own connection, which says who wrote it: it went to the
// official moderation server's "fb", which here answered nothing. a
// museum donation (type 12) is the gems themselves
// (ItemXtCommManager.requestDonateGems): nothing more goes. pictures
// are not taken.
public static function setupRequest(param1:UserImageUpload, param2:String, param3:int, param4:int, param5:Function, param6:Function) : void
{
var _loc7_:String = param2 != null ? param2.split("%").join("").replace(/[\r\n]+/g," ") : "";
if(param3 != 12 && _loc7_.replace(/\s+/g,"").length > 0)
{
gMainFrame.server.setXtObject_Str("xfb",[param3,_loc7_.substr(0,1000)]);
}
if(param5 != null)
{
param5(new Event("complete"));
}
}
public static function createPostData(param1:String, param2:ByteArray, param3:String, param4:Object = null) : ByteArray
{
var _loc5_:String = null;
var _loc7_:int = 0;
var _loc8_:ByteArray = new ByteArray();
_loc8_.endian = "bigEndian";
if(param4 == null)
{
param4 = {};
}
for(var _loc6_:String in param4)
{
writeBoundary(_loc8_,param3);
writeLineBreak(_loc8_);
_loc5_ = "Content-Disposition: form-data; name=\"" + _loc6_ + "\"";
_loc7_ = 0;
while(_loc7_ < _loc5_.length)
{
_loc8_.writeByte(_loc5_.charCodeAt(_loc7_));
_loc7_++;
}
writeLineBreak(_loc8_);
writeLineBreak(_loc8_);
_loc8_.writeUTFBytes(param4[_loc6_]);
writeLineBreak(_loc8_);
}
if(param2)
{
writeBoundary(_loc8_,param3);
writeLineBreak(_loc8_);
_loc5_ = "Content-Disposition: form-data; name=\"image\"; filename=\"" + param1 + "\"";
_loc7_ = 0;
while(_loc7_ < _loc5_.length)
{
_loc8_.writeByte(_loc5_.charCodeAt(_loc7_));
_loc7_++;
}
writeLineBreak(_loc8_);
_loc5_ = "Content-Type: image/jpeg";
_loc7_ = 0;
while(_loc7_ < _loc5_.length)
{
_loc8_.writeByte(_loc5_.charCodeAt(_loc7_));
_loc7_++;
}
writeLineBreak(_loc8_);
writeLineBreak(_loc8_);
_loc8_.writeBytes(param2,0,param2.length);
writeLineBreak(_loc8_);
}
writeBoundary(_loc8_,param3);
writeDoubleDash(_loc8_);
writeLineBreak(_loc8_);
return _loc8_;
}
private static function writeLineBreak(param1:ByteArray) : void
{
param1.writeShort(3338);
}
private static function writeDoubleDash(param1:ByteArray) : void
{
param1.writeShort(11565);
}
private static function writeBoundary(param1:ByteArray, param2:String) : void
{
var _loc3_:int = 0;
writeDoubleDash(param1);
_loc3_ = 0;
while(_loc3_ < param2.length)
{
param1.writeByte(param2.charCodeAt(_loc3_));
_loc3_++;
}
}
private static function onSendComplete(param1:Event) : void
{
trace("w00t!");
}
private static function onSendError(param1:Event) : void
{
trace("Argh! Error sending....");
}
}
}
+22 -2
View File
@@ -809,6 +809,11 @@ package gui
private static function reloadGenericFactPopup(param1:Object) : void
{
// a fact had by its id is in no list: the arrows have nowhere to go
if(param1 == null)
{
return;
}
factCloseHandler(null);
if(param1.type == 18 || param1.type == 12 || param1.type == 17 || param1.type == 9 || param1.type == 19)
{
@@ -824,6 +829,11 @@ package gui
{
var _loc3_:String = null;
var _loc5_:Array = null;
// a fact had by its id is in no list: the arrows have nowhere to go
if(param1 == null)
{
return;
}
_factPopup.index = param1.index;
_factPopup.bitIdx = param1.bitIdx;
while(_factPopup.imgBlock.numChildren > 0)
@@ -1022,10 +1032,12 @@ package gui
}
DarkenManager.showLoadingSpiral(false);
_loc2_ = _genericFactDefList[_genericFactId];
// the fact lists came from the official server; one this server has
// no entry for opens nothing (#1009)
// the fact lists came from the official server, and this one
// answers them empty: the fact is had by its id instead, from the
// CDN's factDefs (requestFactInfo), as the game's other facts are
if(_loc2_ == null)
{
requestFactInfo([_genericFactId]);
return;
}
if(_loc2_.type == 18 || _loc2_.type == 12 || _loc2_.type == 17 || _loc2_.type == 9 || _loc2_.type == 19)
@@ -1063,6 +1075,14 @@ package gui
_museumFactDefIndexList[_loc3_] = _loc2_.id;
_loc3_++;
}
// as above: an exhibit this server's list does not have is had by
// its id. opening nothing left the game behind its spinner.
if(_museumFactDefList[_museumRequest] == null)
{
DarkenManager.showLoadingSpiral(false);
requestFactInfo([_museumRequest]);
return;
}
displayMuseumEngangermentPopup(_museumFactDefList[_museumRequest]);
}
BIN
View File
Binary file not shown.
+14 -14
View File
@@ -11,7 +11,7 @@ const GAME_PORT = 19342;
const BASE = `http://127.0.0.1:${HTTP_PORT}`;
const TOWNSHIP = "jamaa_township.room_main#1";
const {postJson} = harness;
const GAMES = {ticTacToe: 89, fourGems: 90, rockPaperScissors: 91, shellGame: 92, pairs: 93, scooped: 95, bowling: 98, marbles: 101};
const GAMES = {ticTacToe: 1, fourGems: 31, rockPaperScissors: 32, shellGame: 38, pairs: 101, scooped: 53, bowling: 108, marbles: 45};
const arrive = async username => {
const auth = await (await postJson(`${BASE}/authenticate`, {username, password: "KettlePass01"})).json();
@@ -48,22 +48,22 @@ const run = async () => {
const perGame = (told.length - 3) / 8;
assert.strictEqual(perGame, 19);
const first = told.slice(3, 3 + perGame);
assert.deepStrictEqual([first[0], first[2], first[4], first[5], first[7], first[8], first[12], first[17]], ["89", "PVP_TicTacToe", "2", "2", "0", "5063", "1", "5063"]);
assert.deepStrictEqual([first[0], first[2], first[4], first[5], first[7], first[8], first[12], first[17]], ["1", "PVP_TicTacToe", "2", "2", "0", "5055", "1", "5063"]);
// --- invitations
// Ann asks Ben; he says no, and she is told.
a.xt("mp", ann.roomId, GAMES.ticTacToe, 0, "Ben");
assert.deepStrictEqual((await b.nextXt("mp")).slice(2), ["89", "0", "Ann", "1"]);
assert.deepStrictEqual((await b.nextXt("mp")).slice(2), ["1", "0", "Ann", "1"]);
// while that is open neither can be asked, nor ask, anything else.
c.xt("mp", cat.roomId, GAMES.pairs, 0, "Ann");
assert.deepStrictEqual((await c.nextXt("mp")).slice(2), ["93", "1"]);
assert.deepStrictEqual((await c.nextXt("mp")).slice(2), ["101", "1"]);
b.xt("mp", ben.roomId, GAMES.ticTacToe, 1);
assert.deepStrictEqual((await a.nextXt("mp")).slice(2), ["89", "1"]);
assert.deepStrictEqual((await a.nextXt("mp")).slice(2), ["1", "1"]);
// asked again, and taken back.
a.xt("mp", ann.roomId, GAMES.ticTacToe, 0, "Ben");
await b.nextXt("mp");
a.xt("mp", ann.roomId, GAMES.ticTacToe, 1);
assert.deepStrictEqual((await b.nextXt("mp")).slice(2), ["89", "1"]);
assert.deepStrictEqual((await b.nextXt("mp")).slice(2), ["1", "1"]);
// nobody of that name, a game that is not a buddy game, oneself: all "no".
for (const [game, name] of [[GAMES.ticTacToe, "Nobody"], [4, "Ben"], [GAMES.ticTacToe, "Ann"]]) {
a.xt("mp", ann.roomId, game, 0, name);
@@ -301,13 +301,13 @@ const run = async () => {
const bubble = (client, me, word, game) => client.send(`<msg t='sys'><body action='pubMsg' r='${me.roomId}'><txt><![CDATA[${word}%12%${game}]]></txt></body></msg>`);
bubble(a, ann, "on", GAMES.pairs);
for (const client of [a, b, c]) {
assert.deepStrictEqual((await client.untilXt("uc")).slice(1), [ann.roomId, ann.id, "on|93", "12", "0"]);
assert.deepStrictEqual((await client.untilXt("uc")).slice(1), [ann.roomId, ann.id, "on|101", "12", "0"]);
}
// A game that is not the one in the bubble, or a bubble nobody has up: "no".
c.xt("mcp", cat.roomId, GAMES.ticTacToe, 0, "Ann");
assert.deepStrictEqual((await c.untilXt("mp")).slice(2), ["89", "1"]);
assert.deepStrictEqual((await c.untilXt("mp")).slice(2), ["1", "1"]);
c.xt("mcp", cat.roomId, GAMES.pairs, 0, "Ben");
assert.deepStrictEqual((await c.untilXt("mp")).slice(2), ["93", "1"]);
assert.deepStrictEqual((await c.untilXt("mp")).slice(2), ["101", "1"]);
// Ben clicks it: the game starts for the two of them and the bubble goes
// for Cat. Ann hears her own "off" only once the game is over.
b.xt("mcp", ben.roomId, GAMES.pairs, 0, "Ann");
@@ -319,7 +319,7 @@ const run = async () => {
}
// too late for Cat
c.xt("mcp", cat.roomId, GAMES.pairs, 0, "Ann");
assert.deepStrictEqual((await c.untilXt("mp")).slice(2), ["93", "1"]);
assert.deepStrictEqual((await c.untilXt("mp")).slice(2), ["101", "1"]);
// while in it, Ann's client turning the bubble off is not answered yet
bubble(a, ann, "off", 0);
b.xt("rl", pairsRoom, pairsRoom);
@@ -327,8 +327,8 @@ const run = async () => {
assert.deepStrictEqual((await a.untilXt("uc")).slice(1), [ann.roomId, ann.id, "off", "12"]);
// put up and taken down again outside a game: answered at once
bubble(a, ann, "on", GAMES.bowling);
assert.deepStrictEqual((await a.untilXt("uc")).slice(3), ["on|98", "12", "0"]);
assert.deepStrictEqual((await c.untilXt("uc")).slice(3), ["on|98", "12", "0"]);
assert.deepStrictEqual((await a.untilXt("uc")).slice(3), ["on|108", "12", "0"]);
assert.deepStrictEqual((await c.untilXt("uc")).slice(3), ["on|108", "12", "0"]);
bubble(a, ann, "off", 0);
assert.deepStrictEqual((await a.untilXt("uc")).slice(3), ["off", "12"]);
assert.deepStrictEqual((await c.untilXt("uc")).slice(3), ["off", "12"]);
@@ -351,7 +351,7 @@ const run = async () => {
do {
seen = await dee.client.untilXt("uc");
} while (seen[2] !== ann.id);
assert.deepStrictEqual(seen.slice(3), ["on|92", "12", "0"]);
assert.deepStrictEqual(seen.slice(3), ["on|38", "12", "0"]);
bubble(a, ann, "off", 0);
await a.untilXt("uc");
dee.client.socket.destroy();
@@ -367,7 +367,7 @@ const run = async () => {
a.xt("mp", ann.roomId, GAMES.marbles, 0, "Ben");
await b.untilXt("mp");
a.socket.destroy();
assert.deepStrictEqual((await b.untilXt("mp")).slice(2), ["101", "1"]);
assert.deepStrictEqual((await b.untilXt("mp")).slice(2), ["45", "1"]);
// --- a room game played together (lib/minigames.js MULTIPLAYER): Gem
// Breaker offers its waiting list, Ben waits in the room, Cat joins, both
+1
View File
@@ -97,6 +97,7 @@ set -- \
item.Item Item.as \
loader.DenItemHelper DenItemHelper.as \
game.MinigameManager MinigameManager.as \
gui.FeedbackManager FeedbackManager.as \
game.microSmoothie.MicroSmoothie MicroSmoothie.as \
room.DenItemHolder ../tools/decompiled/room/DenItemHolder.as
# not in the game: added before the replace (game.ArtStudioKit is Strawberry