AJS-development / OpenAgar

An open source web game
Other
45 stars 20 forks source link

Statistics.js Error #76

Closed fayizan closed 7 years ago

fayizan commented 7 years ago

I tried open agar today but got an error

screenshot_51

Andrews54757 commented 7 years ago

Thats @LegitSoulja debugging. @fayizan overhauls are coming.

Andrews54757 commented 7 years ago

https://github.com/AJS-development/OpenAgar/pull/77

fayizan commented 7 years ago

ohh ok and wow Just read #77 Interesting

segg21 commented 7 years ago

@Andrews54757 as you know, I've been resting before my surgery. I am not doing any debugging. This is an issue I assume that should be checked out.

Besides, you got the magic eye with figuring out. With my projects (Specifically).

segg21 commented 7 years ago

He could've also done this when I updated php then reverted. It shouldn't be an issue no more, since I postponed making php compatible. (A lot of work).

Other than that, I haven't touched the API.

fayizan commented 7 years ago

phixed ?

segg21 commented 7 years ago

@fayizan looks like something was failing. I checked, made a few changes to what I thought may be a problem.

Should be fixed, idk. Can't test atm. Also that error, only thing you have to do is re-run OpenAgar.

It's failing to update your server information, do to some new API/code changes, that I don't see any issues with. Just ignore, but however should be fixed.

segg21 commented 7 years ago

@Andrews54757 are you strictly using POST? Cause GET has been disabled for API requests. Could also be the issue.

fayizan commented 7 years ago

I tried but the error is still there : |

screenshot_63

segg21 commented 7 years ago

@fayizan just re-run again, as soon as it crash. You have like 5 seconds to do so.

I cannot figure out this update issue.

fayizan commented 7 years ago

Re-Run or Reinstall ?

fayizan commented 7 years ago

bcoz I tried running it again but it shows the same error

segg21 commented 7 years ago

Reinstalling would be pointless. Re-run after that error to bypass it.

fayizan commented 7 years ago

ohh ok got it

segg21 commented 7 years ago

@Andrews54757 take a look at OAStats/Update when you get a chance. Idk what the problem is, because I'm not getting a precise error, only JSON. It can be anything.

fayizan commented 7 years ago

ok I rerun after the error and its running

fayizan commented 7 years ago

lol wat is this @LegitSoulja

screenshot_65

fayizan commented 7 years ago

screenshot_66

segg21 commented 7 years ago

@fayizan few reasons

Any logged console messages?

segg21 commented 7 years ago

And yes, that update error will occur because I cannot figure out the issue. Just ignore for now.

fayizan commented 7 years ago

This is logged in console : | screenshot_67

segg21 commented 7 years ago

@fayizan yeah, idk. Some connection or ping issue.

Andrew should be available shortly. He'll be able to debug the server, however I can't.

It's hard for me to point out exactly what's going on.

fayizan commented 7 years ago

@LegitSoulja ok I will wait no problem : )

Andrews54757 commented 7 years ago

@fayizan Yes, the stats error. I will fix it soon

Andrews54757 commented 7 years ago

@LegitSoulja Its because of slickinject

segg21 commented 7 years ago

@Andrews54757 oh. Right...

No changes was made.
Andrews54757 commented 7 years ago

@fayizan Fixed. Please update

fayizan commented 7 years ago

@Andrews54757 wow thanks for the new client update and it look awesome : ) but a error screenshot_76

Andrews54757 commented 7 years ago

@fayizan I think I fixed it. Update

fayizan commented 7 years ago

another error while connecting on browser image updated

screenshot_78

Andrews54757 commented 7 years ago

@fayizan connect with ws://

fayizan commented 7 years ago

I did and connected but the cell isnt drawing : |

Andrews54757 commented 7 years ago

press play

fayizan commented 7 years ago

ok found the problem, changing clientconfig value wont allow me to spawn

Andrews54757 commented 7 years ago

@fayizan Fixed the stats's http problem (reload server)

Andrews54757 commented 7 years ago

Also, clientconfig is not implemented yet

fayizan commented 7 years ago

omg works so smooth and fine but the camera view is cancer XD pls fix

Andrews54757 commented 7 years ago

whats wrong with the camera

Andrews54757 commented 7 years ago

@fayizan Our camera code:

    function moveCamera() {
        let total = 0;
        let tX = 0;
        let tY = 0;
        playerCells.forEach((id) => {
            const node = allNodes[id];
            if (!node) return;
            total += node.size;
            tX += node.x;
            tY += node.y;
        });

        tX = tX / playerCells.length;
        tY = tY / playerCells.length;

        let newViewZoom = total;
        newViewZoom = Math.min(64 / newViewZoom, 1) ** 0.4 * viewRange();
        viewZoom = (9 * viewZoom + newViewZoom) / 10;
        //var x = Math.floor((stage.pivot.x + tX) / 2);
        // var y = Math.floor((stage.pivot.y + tY) / 2)

        //(0,0) for us is center of the screen (getDim is the size of the screen)
        stage.position.x = getDim().width >> 1;
        stage.position.y = getDim().height >> 1;
        // scale
        stage.scale.set(viewZoom, viewZoom);

        // remember, center anchor/origon is 0.5 

        //    stage.pivot.set(tX, tY);

        stage.pivot.x = (stage.pivot.x + tX) / 2;
        stage.pivot.y = (stage.pivot.y + tY) / 2;

        viewBox.width = renderer.width / viewZoom;
        viewBox.height = renderer.height / viewZoom;
        viewBox.x = tX - (viewBox.width >> 1);
        viewBox.y = tY - (viewBox.height >> 1);
    }
    function viewRange() {
        let ratio;
        ratio = Math.max(renderer.height / (1750 * config.resolution), renderer.width / (1750 * config.resolution));
        return ratio;
    }
Andrews54757 commented 7 years ago

Also fixed the opnagar.us/server issue. Stupid htaccess

segg21 commented 7 years ago

@Andrews54757 without it, will be no security. You just gotta learn .htaccess more. I only know about 60% of it except Regex (Confusing).

I don't acknowledge this method though. I suggest a custom routing system. Use PHP to manage, whilst .htaccess will always report back to index if link is not a folder/file/directory.

/server/test would get read as GET["server"] whilst the value is test.

I'll implement, if really needed. We could however expand this further in the future.

And that camera bug, I think it's when your cells go out of view it acts up, and possibly break. Reproduce by eating a virus. I pointed that out a while ago.

Andrews54757 commented 7 years ago

@LegitSoulja No, its not because it goes out of range. Its something to do with pixi

Andrews54757 commented 7 years ago

Ah, divide by zero error. Interesting

Andrews54757 commented 7 years ago

@LegitSoulja @fayizan Fixed the camera bug. Also includes the virus bug

fayizan commented 7 years ago

Thanks @Andrews54757