yuyuvn / KanColleViewer

Support both Horizontal & Vertical in one version
MIT License
109 stars 52 forks source link

Game doesn't load #38

Closed MirrorCubeSquare closed 9 years ago

MirrorCubeSquare commented 9 years ago

After the web page loaded,the program starts to put the flash screen to the mid but after that, the screen becomes black out(that black loading screen with a white ship) Version :after 3.7.0r550 to 3.8.1r552

OS : win 7

P.S though the screen is blacked out , i can still hear the background sound

wyjtm commented 9 years ago

I also have this problem

yuyuvn commented 9 years ago

try clear your cache

wyjtm commented 9 years ago

clear cache invalid

wyjtm commented 9 years ago

I removed the following code Problem disappears But flash rendering invalid

for (var objs = document.embeds, i = objs.length - 1; i >= 0; i--) {{

    var embedElem = document.createElement('embed');
    var parentElem = objs[i].parentNode;
    embedElem.setAttribute('quality', '{0}');
    embedElem.setAttribute('wmode', '{1}');
    embedElem.setAttribute('type', 'application/x-shockwave-flash');
    embedElem.setAttribute('id', objs[i].getAttribute('id'));
    embedElem.setAttribute('width', objs[i].getAttribute('width'));
    embedElem.setAttribute('height', objs[i].getAttribute('height'));
    embedElem.setAttribute('src', objs[i].getAttribute('src'));
    embedElem.setAttribute('bgcolor', objs[i].getAttribute('bgcolor'));
    embedElem.setAttribute('allowScriptAccess', objs[i].getAttribute('allowScriptAccess'));
    embedElem.setAttribute('base', objs[i].getAttribute('base'));
    parentElem.removeChild(objs[i]);
    parentElem.appendChild(embedElem);
}}

for (objs = document.getElementsByTagName('object'), i = objs.length - 1; i >= 0; i--) {{
    var embedElem = document.createElement('embed');
    var parentElem = objs[i].parentNode;
    embedElem.setAttribute('quality', '{0}');
    embedElem.setAttribute('wmode', '{1}');
    embedElem.setAttribute('id', objs[i].getAttribute('id'));
    embedElem.setAttribute('type', 'application/x-shockwave-flash'); 
    embedElem.setAttribute('width', objs[i].getAttribute('width'));
    embedElem.setAttribute('height', objs[i].getAttribute('height'));       

    for (var c = objs[i].childNodes, j = c.length - 1, set = false; j >= 0; j--) {{
        if ((c[j].tagName == 'PARAM') && (c[j].getAttribute('name').toLowerCase() == 'src'))
            embedElem.setAttribute('src', c[j].getAttribute('value'));
        else if ((c[j].tagName == 'PARAM') && (c[j].getAttribute('name').toLowerCase() == 'movie'))
            embedElem.setAttribute('src', c[j].getAttribute('value'));
        else if ((c[j].tagName == 'PARAM') && (c[j].getAttribute('name').toLowerCase() == 'bgcolor'))
            embedElem.setAttribute('bgcolor', c[j].getAttribute('value'));
        else if ((c[j].tagName == 'PARAM') && (c[j].getAttribute('name').toLowerCase() == 'allowscriptaccess'))
            embedElem.setAttribute('allowScriptAccess', c[j].getAttribute('value'));
        else if ((c[j].tagName == 'PARAM') && (c[j].getAttribute('name').toLowerCase() == 'base'))
            embedElem.setAttribute('base', c[j].getAttribute('value'));
    }}

    parentElem.removeChild(objs[i]);
    parentElem.appendChild(embedElem);
yuyuvn commented 9 years ago

Change the flash quality setting: Flash window to Direct

wyjtm commented 9 years ago

Flash window to Direct
Invalid way

Normally enter the game KanColleViewer Extraction Flash Screen turn into loading screen(Black screen and White boat)

iyomumx commented 9 years ago

Add a placeholder before removeChild like

parentElem.appendChild(document.createTextNode("just a placeholder");
parentElem.removeChild(objs[i]);
parentElem.appendChild(embedElem);

fixed for me

MitsuhaMiyamizu commented 9 years ago

I have this problem,too At first I thought the problem lies in the cache,so I did thorough clean to get all cookie and cache removed.It works for a short while,but when I tried again,this problem showed again.I really suspect that there seems to be existing a problem where the framework handle the flash,maybe the flash quality customization is the key.I don't know,so I get back to use Grabacr07's version.It won't crash like the situation above.Could you please check the plugin again,I hope it can help you to troubleshoot the issues,thanks very much!

MirrorCubeSquare commented 9 years ago

Change the flash quality setting: Flash window to Direct though this works for me, but i believe there are problems lie in the process of rendering flash Other KCV-like browser using same technique for quality changing haven't reported same issue like a alter edition of 74EO repo: https://github.com/tsanie/ElectronicObserver/tree/makai

MitsuhaMiyamizu commented 9 years ago

I tried,but it still happened.I have to come back to Grabacr07's version

asahinobori commented 9 years ago

I have this problem, too. And I use token link to get rid of the problem

jtyuan commented 9 years ago

It happened to me too. My temporary solution is ctrl+wheel down and right click blank area to refresh the page (it wont try to switch to adapted window again), and I can play the game normally. (But the scrollbars wont disappear...)

yuyuvn commented 9 years ago

Try update your flash player to lastest version If not work, edit file KanColleViewer.exe.config: change

<value>var flashQuality = function () {{

to

<value>var flashQuality = function () {{ return;
wyjtm commented 9 years ago
var flashQuality = function () {{ to var flashQuality = function () {{ return; After the change KCV can work normal But............. Flash setting function fails...............................
MitsuhaMiyamizu commented 9 years ago

please do not close the issue until it is really solved,thanks. the really efficient way is add the below line of

parentElem.appendChild(document.createTextNode("just a placeholder");

in front of the second line of:

parentElem.removeChild(objs[i]);

the result seems to be like this:

else if ((c[j].tagName == 'PARAM') && (c[j].getAttribute('name').toLowerCase() == 'base')) embedElem.setAttribute('base', c[j].getAttribute('value')); }}

parentElem.appendChild(document.createTextNode("just a placeholder"); parentElem.removeChild(objs[i]); parentElem.appendChild(embedElem); }} }};

(All the alternation need change the configuration file "KanColleViewer.exe.config") Could you please do not close the problem until it is really solved?That's not the right way to cope with the issue,I think.No offense,this attitude is not helpful enough to solve the problem.

yuyuvn commented 9 years ago

@Kiritoalex I didn't close this issue, just close the dupplication one

MitsuhaMiyamizu commented 9 years ago

OK,I know,sorry for what I said,XDDDD

wyjtm commented 9 years ago

@Kiritoalex

After modifying KCV not start


var flashQuality = function () {{ to var flashQuality = function () {{ return; This method can be normal operation and use KVC But Flash render settings complete failure can not be used
yuyuvn commented 9 years ago

try replace

    flashQuality();
    clearInterval(TimedInject);

to

    clearInterval(TimedInject);
    flashQuality();
wyjtm commented 9 years ago

@yuyuvn

After the change Flash rendering still can not be used

yuyuvn commented 9 years ago

If don't change anything, do flash setting mode work?

wyjtm commented 9 years ago

If don't change anything, game adaptive window After KCV windows will become Black screen + white boat

yuyuvn commented 9 years ago

please upload screen shot of white boat with flash quality setting low and flash quality setting best (default KanColleViewer.exe.config)

wyjtm commented 9 years ago

high

low

They are adaptive window after

P.S.... Before that has entered the game Or enter the game start screen

Screenshot of Black Ships

yuyuvn commented 9 years ago

replace function flashQuality to:

  var flashQuality = function () {{
  for (var objs = document.embeds, i = objs.length - 1; i &gt;= 0; i--) {{

    var embedElem = document.createElement('embed');
    var parentElem = objs[i].parentNode;
    embedElem.setAttribute('quality', '{0}');
    embedElem.setAttribute('wmode', '{1}');
    embedElem.setAttribute('src', objs[i].getAttribute('src'));
    embedElem.setAttribute('base', objs[i].getAttribute('base'));
    embedElem.setAttribute('type', 'application/x-shockwave-flash');
    embedElem.setAttribute('id', objs[i].getAttribute('id'));
    embedElem.setAttribute('width', objs[i].getAttribute('width'));
    embedElem.setAttribute('height', objs[i].getAttribute('height'));
    embedElem.setAttribute('bgcolor', objs[i].getAttribute('bgcolor'));
    embedElem.setAttribute('allowScriptAccess', objs[i].getAttribute('allowScriptAccess'));
    parentElem.removeChild(objs[i]);
    parentElem.appendChild(embedElem);
}}

for (objs = document.getElementsByTagName('object'), i = objs.length - 1; i &gt;= 0; i--) {{
    var embedElem = document.createElement('embed');
    var parentElem = objs[i].parentNode;
    embedElem.setAttribute('quality', '{0}');
    embedElem.setAttribute('wmode', '{1}');
    embedElem.setAttribute('id', objs[i].getAttribute('id'));
    embedElem.setAttribute('type', 'application/x-shockwave-flash'); 
    embedElem.setAttribute('width', objs[i].getAttribute('width'));
    embedElem.setAttribute('height', objs[i].getAttribute('height'));

    for (var c = objs[i].childNodes, j = c.length - 1, set = false; j &gt;= 0; j--) {{
        if ((c[j].tagName == 'PARAM') &amp;&amp; (c[j].getAttribute('name').toLowerCase() == 'src'))
            embedElem.setAttribute('src', c[j].getAttribute('value'));
        else if ((c[j].tagName == 'PARAM') &amp;&amp; (c[j].getAttribute('name').toLowerCase() == 'base'))
            embedElem.setAttribute('base', c[j].getAttribute('value'));
        else if ((c[j].tagName == 'PARAM') &amp;&amp; (c[j].getAttribute('name').toLowerCase() == 'movie'))
            embedElem.setAttribute('src', c[j].getAttribute('value'));
        else if ((c[j].tagName == 'PARAM') &amp;&amp; (c[j].getAttribute('name').toLowerCase() == 'bgcolor'))
            embedElem.setAttribute('bgcolor', c[j].getAttribute('value'));
        else if ((c[j].tagName == 'PARAM') &amp;&amp; (c[j].getAttribute('name').toLowerCase() == 'allowscriptaccess'))
            embedElem.setAttribute('allowScriptAccess', c[j].getAttribute('value'));
    }}

    parentElem.removeChild(objs[i]);
    parentElem.appendChild(embedElem);
}}

}};

wyjtm commented 9 years ago

Not work With no difference before replacement

MitsuhaMiyamizu commented 9 years ago

2015-05-22_142042 Just modify this file like this,you may have misunderstood what we have recommended.

yuyuvn commented 9 years ago

@Kiritoalex Your code missing a ")" character, it will occur error.


Another test: (each time I said try replace, please replace from default KanColleViewer.exe.config) try replace

if (document.getElementById('flashWrap').innerHTML.length &gt; 10) {{

to

if (document.getElementById('flashWrap').innerHTML.length &gt; 300) {{
c933103 commented 9 years ago

See t.cn/R24qcXA , multiple report of initially not working but ok after applying iyomumx's fix.

wyjtm commented 9 years ago

if (document.getElementById('flashWrap').innerHTML.length > 10) {{ to

if (document.getElementById('flashWrap').innerHTML.length > 300) {{

not work

yuyuvn commented 9 years ago

replace

CheckChange();

to

if (document.readyState == 'interactive' || document.readyState == 'complete')
    CheckChange();
wyjtm commented 9 years ago

CheckChange(); to

if (document.readyState == 'interactive' || document.readyState == 'complete') CheckChange();

not work....

yuyuvn commented 9 years ago

change all value of FlashQualityJS to

function kcsFlash_StartFlash(worldServerAddr)
{{
    // Flash パラメータを設定する。
    var flashParams =
    {{
        "id"                : "externalswf",
        "width"             : "800",
        "height"            : "480",
        "wmode"             : "{1}",
        "quality"           : "{0}",
        "bgcolor"           : "#000000",
        "allowScriptAccess" : "always"
    }};

    // Flash の貼り付けに失敗した場合のメッセージを設定する。
    document.getElementById("flashWrap").innerHTML = ConstMessageInfo.InstallFlashMessage;

    // Flash をページに貼り付ける。
    gadgets.flash.embedFlash(
        worldServerAddr + ConstURLInfo.MainFlashURL + "?api_token=" + flashInfo.apiToken + 
                                  "&amp;api_starttime=" + flashInfo.apiStartTime,
        document.getElementById("flashWrap"),
        6,
        flashParams
    );

    // サンクスページ用フラッシュのエリアの高さを変更する。
    document.getElementById("adFlashWrap").style.height = "0px";

    // ワールド選択用フラッシュのエリアの高さを変更する。
    document.getElementById("wsFlashWrap").style.height = "0px";

    // ゲーム用フラッシュのエリアのエリアの高さを変更する。
    document.getElementById("flashWrap").style.height = "480px";

    // ガジェットの高さを調整する。
    gadgets.window.adjustHeight(ConstGadgetInfo.height);
}}
iyomumx commented 9 years ago

change all value of FlashQualityJS works, thx

yuyuvn commented 9 years ago

Fixed in the latest version

wyjtm commented 9 years ago

problem solving thx