OgarProject / Ogar

An open source Agar.io server implementation, written with Node.js.
Other
717 stars 823 forks source link

Stop grow at 625 mass. #422

Closed Lukkez closed 8 years ago

Lukkez commented 8 years ago

How to put premium skins like Parisgamma? i know Parisgamma don't use normal ogar but i want to know how to put this on normal ogar, i making a server for my friends (Parisgamma it's: THIS SERVER)

SEE LATEST COMMENT

BaumanDev commented 8 years ago

I am very excited xD

skyleter commented 8 years ago

Again what the heck do u mean by inserting % + premium on the packet ? where? what line? so please add like this % + premium too to prevent confusing. just that..

BaumanDev commented 8 years ago

Test it out!

skyleter commented 8 years ago

@NatsuTheGreat Im figuring it out with JaraLowell script for test skins premium plus that guy script. Test it you too to help figuring it out, if i got it ill post <3

BaumanDev commented 8 years ago

I am confused af actually.. I don't even know where to put the % - skin

skyleter commented 8 years ago

same the guy did not posted it with <this code>

BaumanDev commented 8 years ago

Ahh I guess he is sticking with tomorrow.

skyleter commented 8 years ago

I dont know, whe're all or almost trying now! :)

HINT: Can get some ideas by agario main_out js ;)

retslac commented 8 years ago

Ok, i quickly made something for you guys to test. This will make all food, players and viruses look like kraken. Have fun with it!

function UpdateNodes(destroyQueue, nodes, nonVisibleNodes, scrambleX, scrambleY) {
    this.destroyQueue = destroyQueue;
    this.nodes = nodes;
    this.nonVisibleNodes = nonVisibleNodes;
    this.scrambleX = scrambleX;
    this.scrambleY = scrambleY;
}

module.exports = UpdateNodes;

UpdateNodes.prototype.build = function() {
    // Calculate nodes sub packet size before making the data view
    var nodesLength = 0;
    for (var i = 0; i < this.nodes.length; i++) {
        var node = this.nodes[i];

        if (typeof node == "undefined") {
            continue;
        }

/////        nodesLength = nodesLength + 20 + (node.getName().length * 2);
/////
        nodesLength = nodesLength + 20 + (node.getName().length * 2) + 8;
/////
    }

    var buf = new ArrayBuffer(3 + (this.destroyQueue.length * 12) + (this.nonVisibleNodes.length * 4) + nodesLength + 8);
    var view = new DataView(buf);

    view.setUint8(0, 16, true); // Packet ID
    view.setUint16(1, this.destroyQueue.length, true); // Nodes to be destroyed

    var offset = 3;
    for (var i = 0; i < this.destroyQueue.length; i++) {
        var node = this.destroyQueue[i];

        if (!node) {
            continue;
        }

        var killer = 0;
        if (node.getKiller()) {
            killer = node.getKiller().nodeId;
        }

        view.setUint32(offset, killer, true); // Killer ID
        view.setUint32(offset + 4, node.nodeId, true); // Node ID

        offset += 8;
    }

    for (var i = 0; i < this.nodes.length; i++) {
        var node = this.nodes[i];

        if (typeof node == "undefined") {
            continue;
        }

        view.setUint32(offset, node.nodeId, true); // Node ID
        view.setInt32(offset + 4, node.position.x + this.scrambleX, true); // X position
        view.setInt32(offset + 8, node.position.y + this.scrambleY, true); // Y position
        view.setUint16(offset + 12, node.getSize(), true); // Mass formula: Radius (size) = (mass * mass) / 100
        view.setUint8(offset + 14, node.color.r, true); // Color (R)
        view.setUint8(offset + 15, node.color.g, true); // Color (G)
        view.setUint8(offset + 16, node.color.b, true); // Color (B)
        /////view.setUint8(offset + 17, node.spiked, true); // Flags
/////
        view.setUint8(offset + 17, (node.spiked | 4), true); // Flags
/////
        offset += 18;

/////
        var skin = "%kraken";
        if (skin) {
            for (var j = 0; j < skin.length; j++) {
                var c = skin.charCodeAt(j);
                if (c){
                    view.setUint8(offset, c, true);
                }
                offset++;
            }
        }
        view.setUint8(offset, 0, true); // End of string
        offset++;
/////

        var name = node.getName();
        if (name) {
            for (var j = 0; j < name.length; j++) {
                var c = name.charCodeAt(j);
                if (c){
                    view.setUint16(offset, c, true);
                }
                offset += 2;
            }
        }

        view.setUint16(offset, 0, true); // End of string
        offset += 2;
    }

    var len = this.nonVisibleNodes.length + this.destroyQueue.length;
    view.setUint32(offset, 0, true); // End
    view.setUint32(offset + 4, len, true); // # of non-visible nodes to destroy

    offset += 8;

    // Destroy queue + nonvisible nodes
    for (var i = 0; i < this.destroyQueue.length; i++) {
        var node = this.destroyQueue[i];

        if (!node) {
            continue;
        }

        view.setUint32(offset, node.nodeId, true);
        offset += 4;
    }
    for (var i = 0; i < this.nonVisibleNodes.length; i++) {
        var node = this.nonVisibleNodes[i];

        if (!node) {
            continue;
        }

        view.setUint32(offset, node.nodeId, true);
        offset += 4;
    }

    return buf;
};
BaumanDev commented 8 years ago

Alright, tomorrow we will get the complete code so only players are skinned? Thank you, you';re the best.

skyleter commented 8 years ago

THANK YOU

skyleter commented 8 years ago

LOOOL IM WITH KRAKEN SKIN, AND FOOD THO

skyleter commented 8 years ago

every1 haves the kraken skin ggggg

BaumanDev commented 8 years ago

OMG THAT IS AMAZING

skyleter commented 8 years ago

lol mothercells, virus, food, cells.

EVERY ONE

is kraken skin

BaumanDev commented 8 years ago

AND IT's so cute too

BaumanDev commented 8 years ago

Do you have the proper complete code yet? @retslac

skyleter commented 8 years ago

^_ He shared all the code at least on updateNodes xD, i contacted Jara Lowell so she can adapt the code for ogarserv or edit it

BaumanDev commented 8 years ago

Imma try something.

JaraLowell commented 8 years ago

Already have that in, but for me not shows no skin at all.

PS it is... view.setUint8(offset + 13, node.spiked | (skin << 2) | (node.agitated << 4), true);

do not forget the agitated bit

skyleter commented 8 years ago

thx

skyleter commented 8 years ago

What the heck... They look like freezed agar bots http://prntscr.com/a1on57

ghost commented 8 years ago

LOL KRAKEN EVERYWHERE

skyleter commented 8 years ago

HOWWWWWW

ghost commented 8 years ago

say wut?

ghost commented 8 years ago

krakens LOOOOL

ghost commented 8 years ago

exactly like in parisgamma?

skyleter commented 8 years ago

:o

ghost commented 8 years ago

< SKIN NAME > after that the skin stays no matter what until you reconnect like that?^

skyleter commented 8 years ago

http://agar.io/?ip=skyleter.tk:4411 come to play its funny lmao

BaumanDev commented 8 years ago

REALLY?????

BaumanDev commented 8 years ago

how did you get the host?

Luka967 commented 8 years ago

-_-... all of you are overfeeding my email... Right. Now that i know how do i send a packet with a skin, I'm already able to send the right packet for every premium skin. Don't expect it soon as I'm in Europe, it's 2am.

BaumanDev commented 8 years ago

Alright.

ghost commented 8 years ago

this is amazing!

skyleter commented 8 years ago

Natsu, add me on skype ;: skyleter and ill help u :-)

BaumanDev commented 8 years ago

For what? xP

ghost commented 8 years ago

@Andrews54757 u got the skins in this format? < SKIN NAME > after that the skin stays no matter what until you reconnect

skyleter commented 8 years ago

how ddi you get the host? \ easy xd

BaumanDev commented 8 years ago

Oh lol. I need a host. xP

BaumanDev commented 8 years ago

I am playing on it right now.

ghost commented 8 years ago

@retslac crasg

BaumanDev commented 8 years ago

He'll fix it tomorrow.

BaumanDev commented 8 years ago

Okay, where did you get the host? xP

skyleter commented 8 years ago

@Agarian was thinking im the only one with the bug.

@NatsuTheGreat go to freenom.com, then get your free domain, set freenom nameserver with target: your vps ip :)

BaumanDev commented 8 years ago

Do you know ehere I can get a free vps? xD

skyleter commented 8 years ago

no sorry :( a friend gave me my vps [friend -i dont wanna say name- if you read this thx :D]

BaumanDev commented 8 years ago

Everything else is working? No bugs?

ghost commented 8 years ago

still can i have the code? also all skins or certain ones?

BaumanDev commented 8 years ago

Yay