ruffle-rs / ruffle

A Flash Player emulator written in Rust
https://ruffle.rs
Other
15.77k stars 820 forks source link

https://www.crazymonkeygames.com/Monster-Master.html not working as expected #11114

Open GoBonnies21 opened 1 year ago

GoBonnies21 commented 1 year ago

Describe the bug

This is a card game. When I drag the cards on to the opponents cards, they do not deal damage. I am able to deal damage to the opponents life points if they have an empty field, as expected.

Expected behavior

Expected to open up dice roll menu on attack of an opponent

Affected platform

Browser's extension

Operating system

Mac Ventura 13.3.1 (a)

Browser

Microsoft Edge Version 112.0.1722.68 (Official build) (x86_64)

Additional information

Player Info

Allows script access: true Renderer: wgpu Adapter Backend: Gl Adapter Name: "ANGLE (ATI Technologies Inc., AMD Radeon Pro 560 OpenGL Engine, OpenGL 4.1)" Adapter Device Type: Other Adapter Driver Name: "" Adapter Driver Info: "" Enabled features: Features(TEXTURE_ADAPTER_SPECIFIC_FORMAT_FEATURES | PUSH_CONSTANTS) Available features: Features(CLEAR_TEXTURE) Current limits: Limits { max_texture_dimension_1d: 16384, max_texture_dimension_2d: 16384, max_texture_dimension_3d: 2048, max_texture_array_layers: 256, max_bind_groups: 4, max_bindings_per_bind_group: 640, max_dynamic_uniform_buffers_per_pipeline_layout: 8, max_dynamic_storage_buffers_per_pipeline_layout: 0, max_sampled_textures_per_shader_stage: 16, max_samplers_per_shader_stage: 16, max_storage_buffers_per_shader_stage: 0, max_storage_textures_per_shader_stage: 0, max_uniform_buffers_per_shader_stage: 11, max_uniform_buffer_binding_size: 16384, max_storage_buffer_binding_size: 0, max_vertex_buffers: 8, max_buffer_size: 268435456, max_vertex_attributes: 16, max_vertex_buffer_array_stride: 255, min_uniform_buffer_offset_alignment: 256, min_storage_buffer_offset_alignment: 256, max_inter_stage_shader_components: 60, max_compute_workgroup_storage_size: 0, max_compute_invocations_per_workgroup: 0, max_compute_workgroup_size_x: 0, max_compute_workgroup_size_y: 0, max_compute_workgroup_size_z: 0, max_compute_workgroups_per_dimension: 0, max_push_constant_size: 96 } Surface quality: high Surface samples: 4 Surface size: Extent3d { width: 750, height: 562, depth_or_array_layers: 1 }

Page Info

Page URL: https://www.crazymonkeygames.com/Monster-Master.html SWF URL: https://www.crazymonkeygames.com/swf-nr2kjn-jekb/monstermaster.swf

Browser Info

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36 Edg/112.0.1722.68 Platform: MacIntel Has touch support: false

Ruffle Info

Version: 0.1.0 Name: nightly 2023-05-15 Channel: nightly Built: 2023-05-15T00:19:10.557Z Commit: d0f8061c852e34a0c5d5b16d721c11da492ef5b2 Is extension: true

Metadata

width: 800 height: 600 frameRate: 25 numFrames: 5 swfVersion: 8 backgroundColor: #000000 isActionScript3: false uncompressedLength: 413297

LuisMayo commented 1 year ago

Hi!

I've been taking a look at this bug if that's okay for you guys. I'm no rust developer so I don't know how far I'll go but I have reached some conclusions.

Decompiling the game code we see that for the drop login to work it does some string manipulation over _droptarget.

I'll leave a code snippet here, please note that this code snippet has been edited to add logging (trace)

 function targetCard()
   {
      var card = null;
      trace("End Value before loop:");
      var end = this._droptarget.indexOf("/cardLayer");
      trace(end);
      if(end > -1)
      {
         var i = 0;
         while(i < 3)
         {
            end = this._droptarget.indexOf("/",end) + 1;
            trace("End value after one iteration");
            trace(end);
            i++;
         }
         trace("Target Value");
         var target = this._droptarget.substr(0,end);
         trace(target);
         card = eval(target);
         trace("DropTarget Value:");
         trace(this._droptarget);
      }
      return card;
   }

This is just basic string manipulation to get a desired substring of the _droptarget value.

And here lies the problem. Ruffle and Flash Player seem to have different readings of the _droptarget value.

This is Flash's output:

trace: DropTarget Value:
trace: /stageManager/depthChild1/cardLayer/depthChild78/depthChild1/summoningTimeLabel

And this is Ruffle's output:

DropTarget Value:
/stageManager/depthChild1/cardLayer/depthChild78

For whatever reason ruffle doesn't seem to return the full path, but just bits of it.

Thanks!

RStryke commented 7 months ago

Can confirm this is still an issue. I'm running windows 10 and using the website package.