Code Monkey home page Code Monkey logo

ogar's Introduction

Ogar

A fully functional open source Agar.io server implementation, written in Node.js. Ogar is designed to be used with the latest Agar.io client.

Official Website

The official website for the Ogar Project is ogarproject.com. You can register on our forums to chat with other Ogar users, get support, advertise your server, and more.

Purchased Ogar?

If you've purchased a copy of Ogar, you've probably been ripped off. This post on our website explains why.

Obtaining and Using

If you are on Windows, you can download the latest binary build of Ogar from this page. The binary is the easiest way to get started running an Ogar server. If you'd like to tinker with the source code, you can follow the instructions below (and slightly modify them) to run the source on Windows.

As Ogar is written in Node.js, you must have Node.js, its "ws" and "vector2-node" modules installed to use it (unless you are using the Windows binary). You can usually download Node using your distribution's package manager (for *nix-like systems), or from the Node website. To install the "ws" module that is required, you can:

  • for Windows, run Install Dependecies.bat located in the folder where this file is.
  • for Mac, open your terminal, go to this directory with cd and type in npm install.
  • for Linux, you can use the install script which would also automatically install node.js and ws.

Manual:

~$ git clone git://github.com/OgarProject/Ogar.git Ogar
~$ cd Ogar
~$ npm install
~$ node Ogar

Using the install script:

~$ sudo ogar-linux-script.sh install /your/preferred/directory
~$ sudo -u ogar -H /bin/sh -c "cd; /bin/node src/index.js"

Using sudo -u ogar -H /bin/sh -c "cd; /bin/node src/index.js" to launch the server increases security by running the process as an unprivileged, dedicated user with a limited shell and it is recommended to do so.

Currently, Ogar listens on the following addresses and ports:

  • *:80 - for the master server
  • *:443 - for the game server

Please note that on some systems, you may have to run the process as root or otherwise elevate your privileges to allow the process to listen on the needed ports. If you are getting an EADDRINUSE error, it means that the port required to run Ogar is being used. Usually, Skype is the culprit. To solve this, either close out skype, or change the serverPort value in gameserver.ini to a different port. You will have to change your connection ip to "127.0.0.1:PORT"

Once the game server is running, you can connect (locally) by typing agar.io/?ip=127.0.0.1:443 into your browser's address bar.

Configuring Ogar

Use "gameserver.ini" to modify Ogar's configurations field. Player bots are currently basic and for testing purposes. To use them, change "serverBots" to a value higher than zero in the configuration file. To add/remove bot names, edit the file named "botnames.txt" which is in the same folder as "gameserver.ini". Names should be separated by using the enter key.

Custom Game modes

Ogar has support for custom game modes. To switch between game modes, change the value of "serverGamemode" in the configurations file to the selected game mode id and restart the server. The current supported game modes are:

Id Name
0 Free For All
1 Teams
2 Experimental (As of 6/13/15)
10 Tournament
11 Hunger Games
12 Zombie Mode
13 Team Z
14 Team X
20 Rainbow FFA - Hint: Use with "setAcid(true)"

Console Commands

The current available console commands are listed here. Command names are not case sensitive, but player names are.

  • Addbot [Number]
    • Adds [Number] of bots to the server. If an amount is not specified, 1 bot will be added.
  • Board [String 1] [String 2] [String 3] ...
    • Replaces the text on the leaderboard with the string text.
  • Boardreset
    • Resets the leaderboard to display the proper data for the current gamemode
  • Change [Config setting] [Value]
    • Changes a config setting to a value. Ex. "change serverMaxConnections 32" will change the variable serverMaxConnections to 32. Note that some config values (Like serverGamemode) are parsed before the server starts so changing them mid game will have no effect.
  • Clear
    • Clears the console output
  • Color [Player ID] [Red] [Green] [Blue]
    • Replaces the color of the specified player with this color.
  • Exit
    • Closes the server.
  • Food [X position] [Y position] [Mass]
    • Spawns a food cell at those coordinates. If a mass value is not specified, then the server will default to "foodStartMass" in the config.
  • Gamemode [Id]
    • Changes the gamemode of the server. Warning - This can cause problems.
  • Help
    • Shows List Of Commands
  • Kick [Player ID]
    • Kicks the specified player or bot from the server.
  • Kill [Player ID]
    • Kills all cells belonging to the specified player.
  • Killall
    • Kills all player cells on the map.
  • Mass [Player ID] [Number]
    • Sets the mass of all cells belonging to the specified player to [Number].
  • Name [Player ID] [New Name]
    • Changes the name of the player with the specified id with [New Name].
  • Playerlist
    • Shows a list of connected players, their IP, player ID, the amount of cells they have, total mass, and their position.
  • Pause
    • Pauses/Unpauses the game.
  • Reload
    • Reloads the config file used by the server. However, the following values are not affected: serverPort, serverGamemode, serverBots, serverStatsPort, serverStatsUpdate.
  • Status
    • Shows the amount of players currently connected, time elapsed, memory usage (memory used/memory allocated), and the current gamemode.
  • Tp [Player ID] [X position] [Y position]
    • Teleports the specified player to the specified coordinates.
  • Virus [X position] [Y position] [Mass]
    • Spawns a virus cell at those coordinates. If a mass value is not specified, then the server will default to "virusStartMass" in the config.

Contributing

Please see CONTRIBUTING.md for contribution guidelines.

License

Please see LICENSE.md.

ogar's People

Contributors

agarian avatar albel727 avatar andrews54757 avatar baumandev avatar chuushi avatar darwinkel avatar dooglus avatar ephemerality avatar f0ris avatar fxia22 avatar itzlevvie avatar kadimi avatar krzycho1024 avatar llbraughler avatar luka967 avatar m-byte avatar maixuanhan avatar microcoded avatar mnurzia avatar mrmarktyy avatar porama6400 avatar ramon-balaguer avatar ryush00 avatar scholtes avatar subv3rsion avatar tiberiu02 avatar vram4 avatar xdpoi avatar yoyosh avatar yrsegal avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ogar's Issues

Number of connected players

I started the game server and master server, and I have my client-side mod. But how can I get the number of players at the server right now?

Cannot find module error

I cloned the repo and installed dependencies. when i type "node Ogar --master --game 0" to run the servers. It gives this error. how can I solve this?

module.js:340
throw err;
^
Error: Cannot find module '/Users/sayginburak/Documents/Sites/Ogar/Ogar'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Function.Module.runMain (module.js:497:10)
at startup (node.js:119:16)
at node.js:929:3

It does not work in linux

but i installed mono and wine but I can not get it to work

Why no compatibility to Linux

Ty :)

sorry for my english I'am Spanish

10% Eating Rule

If I understand correctly, the determining factor for i-eat-you-or-you-eat-me is "if the mass of one player is 10% or more than the player they collided with, they eat that player". In Ogar, this is done rather like "if the mass of one player is more than the mass of another player, they eat that player" (for me a bot with just one more mass than me can eat me).

Spectate still not work

When I click that button, the map show nothing, none food, none player and none virus.
Hope to fix it soon. Thank,

Multi core support?

Hey,

Will Ogar support multiple cores in the future? Just curious because I've multi core servers but Ogar is not taking advantage of that.

Split blobs do not move and only the main blob can continue to move.

Herpderp

So during game play you roll around, split yourself into a billion cells and it's all fun and games until you get into a battle.

Imagine this - there we are in heat of battle - I'm in 3 large blobs and avoiding 1 larger blob who I am escaping from when suddenly... 2 of my blobs forget how to run away and they just stay frozen in place while the main blob doesn't even bother looking back to see how they are doing.

At this very moment, it seems that my opponent is unable to split kill me either as the command has no effect. This was expressed to me over mumble by the player.

30 seconds later, one of our buddies who was playing on our other instance of Ogar pipes up on mumble expressing surprise at just experiencing the very same bug.

We look forward to another awesome bug squish.

After around 24 hours of uptime, it goes downhill

Well, after about 24 hours of running, with around 50 or more players always on, things become extremely laggy. I noticed networking just struggles. Servers behind custom routers seem to be fine, but those direct seem to have issues. All our servers are on a 1GB/s ports so networking shouldn't be a problem. I'm not sure if it could be the router based servers closing dead connections and the other ones don't. I'm not sure, but I have a small hunch it's to the with Ogar not closing connections properly or at all? I could be wrong, correct me if I am.

(I've had to resort to Ogar server reboots every 24 hours or so)

P.S: Sorry for second issue thread. :P

Listen to two ports

I changed port on linux one to 443 and another one to 1337, for some reason I can't listen to another port while running another ogar..

[root@centos-agar src]# node index.js
[Game] Ogar - An open source Agar.io server implementation
Error: listen EADDRINUSE
at errnoException (net.js:905:11)
at Server._listen2 (net.js:1043:14)
at listen (net.js:1065:10)
at Server.listen (net.js:1139:5)
at GameServer.startStatsServer (/home/admin/HackForums/Ogar/src/GameServer.js:919:21)
at GameServer.start (/home/admin/HackForums/Ogar/src/GameServer.js:206:10)
at Object. (/home/admin/HackForums/Ogar/src/index.js:25:12)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
[Error] Server could not bind to port! Please close out of Skype or change 'serverPort' in gameserver.ini to a different number.

Firefox freezing when connecting to server

Hello i setted up the server both locally and on a vps.
When i connect to the server instance my browser freezes.
I also tried with the agario mods script on and wiith the script off, both of the times the same bug happens.

The virus can be eaten and disconnect peoples.

When a virus is too much fed, the cell just eats it, grows a lot and players around are disconnected (or kicked ?). Here is what I edited in gameserver.ini, to see if it comes from our server configuration.

borderLeft = 0 borderRight = 9000 borderTop = 0 borderBottom = 9000 spawnInterval = 4 foodSpawnAmount = 15 foodStartAmount = 150 foodMaxAmount = 1500 foodMass = 5 virusMinAmount = 8 virusMaxAmount = 80 virusStartMass = 200 virusBurstMass = 150 ejectMass = 16 ejectMassGain = 12 ejectSpeed = 400 playerMinMassEject = 10 playerMinMassSplit = 3 playerMinMassDecay = 9

prebuilts

What are the windows prebuilts built with, if I may inquire?

How to play?

I installed and configured all correctly, but when i open the website of game only this appears:

https://server-d3vont3ch.c9.io/index.html

what i need to do?

i used this command:

node Ogar --master --game

and this appeared:

[Master] Listening on port 8080
[Game] Listening on port 3000
[Game] Current game mode is Free For All

Not Implemented Error

Hello, i have installed Ogard on my Debian 7 x64 Server and when i go on the port :443 i have a "Not Implemented Error".

How i can fix it ?

Best Regards,
iTouch

client

How can i add my own client so i don't need to go to agar.io to join my server?

Error Linux

When i used linux script i got this:

npm http GET https://registry.npmjs.org/ws
npm http 304 https://registry.npmjs.org/ws
npm http GET https://registry.npmjs.org/options
npm http GET https://registry.npmjs.org/ultron
npm http GET https://registry.npmjs.org/bufferutil
npm http GET https://registry.npmjs.org/utf-8-validate
npm http 304 https://registry.npmjs.org/ultron
npm http 304 https://registry.npmjs.org/options
npm http 304 https://registry.npmjs.org/utf-8-validate
npm http 304 https://registry.npmjs.org/bufferutil
npm http GET https://registry.npmjs.org/bindings
npm http GET https://registry.npmjs.org/nan
npm http 304 https://registry.npmjs.org/bindings
npm http 304 https://registry.npmjs.org/nan

[email protected] install /home/____/Ogar/node_modules/ws/node_modules/bufferutil
node-gyp rebuild

[email protected] install /home/____/Ogar/node_modules/ws/node_modules/utf-8-validate
node-gyp rebuild

gyp: Call to 'node -e "require('nan')"' returned exit status 1. while trying to load binding.gyp
gyp ERR! configure error
gyp ERR! stack Error: gyp failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (/usr/share/node-gyp/lib/configure.js:431:16)
gyp ERR! stack at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack at Process.ChildProcess.handle.onexit (child_process.js:797:12)
gyp ERR! System Linux 3.13.0-24-generic
gyp ERR! command "nodejs" "/usr/bin/node-gyp" "rebuild"
gyp ERR! cwd /home/
___/Ogar/node_modules/ws/node_modules/bufferutil
gyp ERR! node -v v0.10.25
gyp ERR! node-gyp -v v0.10.10
gyp ERR! not ok
npm WARN This failure might be due to the use of legacy binary "node"
npm WARN For further explanations, please read
/usr/share/doc/nodejs/README.Debian

npm WARN optional dep failed, continuing [email protected]
gyp: Call to 'node -e "require('nan')"' returned exit status 1. while trying to load binding.gyp
gyp ERR! configure error
gyp ERR! stack Error: gyp failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (/usr/share/node-gyp/lib/configure.js:431:16)
gyp ERR! stack at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:797:12)
gyp ERR! System Linux 3.13.0-24-generic
gyp ERR! command "nodejs" "/usr/bin/node-gyp" "rebuild"
gyp ERR! cwd /home/_____/Ogar/node_modules/ws/node_modules/utf-8-validate
gyp ERR! node -v v0.10.25
gyp ERR! node-gyp -v v0.10.10
gyp ERR! not ok
npm WARN This failure might be due to the use of legacy binary "node"
npm WARN For further explanations, please read
/usr/share/doc/nodejs/README.Debian

npm WARN optional dep failed, continuing [email protected]
[email protected] node_modules/ws
├── [email protected]
└── [email protected]

Ejected mass goes through cell

I notice that with the standard configuration. I shoot the virus when I am too closed to it, the ejected mass just goes through the virus (Actually, Mother cell in Experiment mode). Same issue when I feed my teammate, especially if he is small.

Another issue, is below code missed update? (this.angle = 1 - this.angle;)

Cell.prototype.calcMovePhys = function(config) {
...
    if ((this.position.x + radius) > config.borderRight) {
        // Flip angle horizontally - Right side
        this.angle = 1 - this.angle;
        X = config.borderRight - radius;
    }
...
};

Random freezing

Has Im playing on my server with bots I suddenly freeze and have to rejoin the server, note the server isnt crashing cause the bots etc are still on it playing I just randomly freeze so do my friends even with out bots we do.
I made the server today. 6/30/2015
Here is a video of what happens. Ignore the webcam in the bottom right I didn't realize it was on.
https://drive.google.com/file/d/0B2E4entgyGxPQWdfRFVLcThwNmM/view?usp=sharing
thats what happens. Thats not a photo im zooming in and out on thats the game and what happens

Cant bind port even if i change it in gameserver.ini

when i try to start ogar using node Ogar it crashes and gives me this:

[Game] Ogar - An open source Agar.io server implementation
Error: listen EADDRINUSE
at exports._errnoException (util.js:746:11)
at Server._listen2 (net.js:1156:14)
at listen (net.js:1182:10)
at Server.listen (net.js:1267:5)
at GameServer.startStatsServer (/Users/Adryd/Ogar/src/GameServer.js:919:21)
at GameServer.start (/Users/Adryd/Ogar/src/GameServer.js:206:10)
at Object. (/Users/Adryd/Ogar/src/index.js:25:12)
at Module._compile (module.js:460:26)
at Object.Module._extensions..js (module.js:478:10)
at Module.load (module.js:355:32)
[Error] Server could not bind to port! Please close out of Skype or change 'serverPort' in gameserver.ini to a different number.

the port that i set it to is not used by any other services
ive changed to port multiple times to random numbers but it didnt do anything either

OS = Mac OS X 10.10.4

Suggestion

Sorry, no idea where.

I want to log stuff into my database (hosting it on a windows vps, since it seems to have issues installing on linux).

Whatsoever.

I hope to see some kind of database connection, outgoing api so it logs the leaderboards into a remote database.. this would be issue as i would need mysql to be open, so i guess if you can somehow make web requests instead so i can make an api that would be better

cells skins

can we add skin for cells ? etc: ayy lmao, Turkey, Reddit

Split cells freeze

Based on vram4's fork, whenever we split and move, your cells will possibly freeze after a while.

flood of spikes

I don't have any data for you unfortunately, but happy to do a tcpdump or something else at your request.

I notice and it seems to be when everyone has disconnected from the server, a client makes a fresh connection there is a megafuckton of spikes everywhere and the game goes a big crazy at that point.

DataView error

I install node.js and ws. Setup my server. Everything okey but i look browser console while i was playing.

This error :

Uncaught RangeError: Offset is outside the bounds of the DataView

repeat count : 560

Disable commands

How can I disable commands, or make them executable by only a specific user?

I'm using it on linux. Hosting private server for my site, but don't want everyone to access the commands.. grr

Can't Connect

i can't connect i always getting the error ERR_NAME_NOT_RESOLVED i tried to use my ip and localhost connection but it won't work :(
image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.