ruffle icon indicating copy to clipboard operation
ruffle copied to clipboard

New Club Penguin not supported ruffle player

Open deividbinev12 opened this issue 3 years ago • 15 comments

Describe the bug

https://user-images.githubusercontent.com/80902993/196750362-eb8831bc-c234-41c8-aa41-40d783b669d0.mp4

it's not working, because this is multi files, this is actionsupport 3.0 i know ruffle player multiplayer is not working

Expected behavior

Screenshot 2022-10-19 192944 you know ''Download'' and ''Launch NewCP App'' it's can work with flash player, his server it's working

Affected platform

Browser's extension

Operating system

Windows 11

Browser

Edge

Additional information

from https://newcp.net/en/

deividbinev12 avatar Oct 19 '22 16:10 deividbinev12

Still not working. Direct SWF: https://media1.newcp.net/play/v2/client/club_penguin.swf Right now, it's erroring with Error dispatching event EventObject(EventObject { type: "addedToStage", class: flash.events::Event, ptr: 0xb78470 }) to handler FunctionObject(FunctionObject { ptr: 0xb77fb0 }) : RustError("Attempted to call \"\" with 1 arguments (more than 0 is prohibited)")

Lord-McSweeney avatar Jan 07 '23 05:01 Lord-McSweeney

With #9647, this errors on ERROR ruffle_core::avm2::activation: ReferenceError: Error #1069: Property * not found on XMLList and there is no default value..

Lord-McSweeney avatar Feb 23 '23 02:02 Lord-McSweeney

Now errors: Error: MainContext could not determine the locale for the specified langauge. Make sure that 'null' has been added to the switch..

Lord-McSweeney avatar Mar 16 '23 01:03 Lord-McSweeney

Now errors: Error: MainContext could not determine the locale for the specified langauge. Make sure that 'null' has been added to the switch..

This is related to flashvars not being provided (e.g. lang=en)

AllinolCP avatar Mar 19 '23 04:03 AllinolCP

I investigated this and made some progress, but got stuck at some point with something related to contextView. This game really needs a lot of stuff. What I've found:

  • [ ] -Plang=en as @AllinolCP said
  • [x] decodeURI
  • [x] ExternalInterface.call("window.location.href.toString")
  • [x] XML.parent (#10244)
  • [x] URLRequest.requestHeaders

evilpie avatar Mar 19 '23 12:03 evilpie

This URL works for the page: https://play.newcp.net/eng/index.html#/login

Current errors:

Error dispatching `addedToStage` event : TypeError: Error #1009: Cannot access a property or method of a null object reference. (accessing field: getAVMBridge)
	at com.clubpenguin.main.overlays.mediator::MultipleOverlayViewMediator/onRegister()
	at org.robotlegs.base::MediatorBase/preRegister()
	at org.robotlegs.base::MediatorMap/registerMediator()
	at org.robotlegs.base::MediatorMap/createMediatorUsing()
	at org.robotlegs.base::MediatorMap/onViewAdded()
	at flash.display::DisplayObjectContainer/flash::display::DisplayObjectContainer::addChild()
	at com.clubpenguin.main::MainContext/startup()
	at org.robotlegs.mvcs::Context/checkAutoStartup()
	at org.robotlegs.mvcs::Context()
	at org.robotlegs.mvcs::SignalContext()
	at com.clubpenguin.main::MainContext()
	at com.clubpenguin.main::Main/init()
	at com.clubpenguin.main::Main/onAddedToStageHandler()

Error dispatching `addedToStage` event : TypeError: Error #1009: Cannot access a property or method of a null object reference. (accessing field: addChild)
	at com.clubpenguin.main.command::StartupCommand/execute()
	at org.robotlegs.base::SignalCommandMap/routeSignalToCommand()
	at MethodInfo-392()
	at org.osflash.signals::Signal/dispatch()
	at com.clubpenguin.main::MainContext/startup()
	at org.robotlegs.mvcs::Context/checkAutoStartup()
	at org.robotlegs.mvcs::Context()
	at org.robotlegs.mvcs::SignalContext()	at com.clubpenguin.main::MainContext()
	at com.clubpenguin.main::Main/init()
	at com.clubpenguin.main::Main/onAddedToStageHandler()

I would guess that the first error is because in the declaration

      [Inject]
      public var _model:MainModel;

The [Inject] isn't working correctly. (It should be handled by org.robotlegs, see https://www.oreilly.com/library/view/actionscript-developers-guide/9781449311193/ch04.html).

Lord-McSweeney avatar Apr 03 '23 00:04 Lord-McSweeney

for context Club Penguin uses robotlegs 1.4.0 amd swift suspenders 1.5.1

AllinolCP avatar Apr 19 '23 01:04 AllinolCP

@AllinolCP pointed out on Discord that this is caused because of undocumented behavior in flash.utils.describeType, as describeType should also return <metadata> tags inside <variable> tags (if there is metadata). Example:

  ...
  <variable name="mc" type="flash.display::MovieClip">
    <metadata name="tag">
      <arg key="" value="value"/>
    </metadata>
    <metadata name="someOtherTag"/>
    <metadata name="tag">
      <arg key="dat" value="abcd"/>
    </metadata>
  </variable>
  ...

Which is returned by the property:

      [tag("value")]
      [someOtherTag]
      [tag(dat = "abcd")]
      public var mc:MovieClip;

Lord-McSweeney avatar Apr 29 '23 22:04 Lord-McSweeney

According to Allinol, NCP loads a ZIP file and decompresses it, which takes some time in Ruffle. Next, it needs to load a file; that file is unforunately missing.

So a list of PRs that need to be merged for this:

  • [x] #11275
  • [x] #11360
  • [x] #10811
  • [x] #12157
  • [x] #11005

Lord-McSweeney avatar May 29 '23 23:05 Lord-McSweeney

has this been fixed? i have been waiting a long time but the only thing that is showing is a white screen.

elmemeee avatar Aug 20 '23 21:08 elmemeee

It still has problem with some language related stuff

ERROR core/src/avm2/events.rs:424 Error dispatching event EventObject(EventObject { type: "addedToStage", class: flash.events::Event, ptr: 0x127b638 }) to handler FunctionObject(FunctionObject { ptr: 0x127b130 }) : Error: MainContext could not determine the locale for the specified langauge. Make sure that 'null' has been added to the switch.

SolsticeSpectrum avatar Sep 12 '23 22:09 SolsticeSpectrum

@DarkReaper231 You need to run it directly through the site, it uses flashvars. See https://github.com/ruffle-rs/ruffle/issues/8330#issuecomment-1475094475 @elmemeee If you bump the execution timeout, it gets as far as it would get on Flash. For some reason one of the necessary asset files is missing from the NewCP server.

Lord-McSweeney avatar Sep 13 '23 03:09 Lord-McSweeney

The next issue seems to be that NCP calls External Interface with (function() { ... }) (or something similar, don't exactly remember what) as the argument. Ruffle doesn't support that yet.

Lord-McSweeney avatar Oct 28 '23 01:10 Lord-McSweeney

The next issue seems to be that NCP calls External Interface with (function() { ... }) (or something similar, don't exactly remember what) as the argument. Ruffle doesn't support that yet.

Is there a PR for implementation of it?

SolsticeSpectrum avatar Oct 28 '23 20:10 SolsticeSpectrum

@Lord-McSweeney What's the current status? All PRs that have been waiting for merge have been merged but the game still does not work.

Visiting through https://play.newcp.net/eng/index.html#/login instead of https://newcp.net/plays?force=true#/login no longer solves the issue with missing start_module.

Regarding the missing start_module, I was told this: the game would normally load world.swf instead of start module, however since the file does not exist the game will refuse to continue, it's programmed this way not a fault by ruffle And just to be clear, if Ruffle was to support AS3 -> AS2 LocalConnection communication and ExternalInterface fully, this would go away, I assume.

So when you first load up the game, it runs ExternalInterface (which isn't fully implemented) to get the URL's #path, where normally for world swf it has to be #/login, however since that failed it goes to a fallback which loads start_module.swf

Also seems like ExternalInterface spoofing is merged, idk what it means but yeah.

SolsticeSpectrum avatar Apr 25 '24 12:04 SolsticeSpectrum

With LocalConnection (WIP local branch), this progresses but still doesn't get past a blue screen.

I can see that it's trying to show a login screen, but it just isn't :(

Dinnerbone avatar Jun 14 '24 16:06 Dinnerbone

This isn't directly related to NewCP, but just thought it was worth pointing out. With the recent updates, I figured I'd test another CPPS that uses the AS3 client (https://play.cpimagined.net)

It does, in fact, get all the way to the login screen, but shows an error after a few seconds when trying to login, which I suppose was to be expected. image_2024-06-21_143606923 image_2024-06-21_143652026

ChrisCPI avatar Jun 21 '24 18:06 ChrisCPI

yes, because CPImagined would have to set up the WS proxy, the error shown was just shown to macOS users for some reason

AllinolCP avatar Jun 22 '24 09:06 AllinolCP

With #16834 newcp.net works (assuming that someone sets up the WS proxy). Please open individual issues for any further bugs you find (or other sites if they have issues too, ofc)

Dinnerbone avatar Jun 22 '24 21:06 Dinnerbone