Giter Site home page Giter Site logo

bravo's Introduction

Bravo

Bravo is a elegant, speedy, and extensible implementation of the Minecraft Alpha/Beta/"Modern" protocol. Only the server side is implemented. Bravo also has a few tools useful for examining the wire protocols and disk formats in Minecraft.

Features

Standard Features

  • Console
  • Login and handshake
  • Geometry ("chunk") transfer
  • Location updates
  • Passage of time (day/night)
  • Block construction and deconstruction
  • Entities
    • Players
    • Pickups
    • Tiles
      • Chests
      • Furnaces
      • Signs
  • Lighting
  • Save controls
  • Server-side inventories

Extended Features

  • Pluggable architecture
    • Commands
      • Inventory control
      • Teleports
      • Time of day
    • Terrain generation
      • Erosion
      • Simplex noise, 2D and 3D
      • Water table
    • Seasons
      • Spring
      • Winter
    • Physics
      • Sand, gravel
      • Water, lava
      • Redstone
  • Chat commands
  • IP ban list

Installing

Bravo currently requires Python 2.6 or any newer Python 2.x. It is known to work on CPython and PyPy.

Bravo ships with a standard setup.py. You will need setuptools/distribute, but most distributions already provide it for you. Bravo depends on the following external libraries from PyPI:

  • construct, version 2.03 or later
  • Twisted, version 11.0 or later

If installing modular Twisted, Twisted Conch is required.

For IRC support, Twisted Words is required; it is usually called python-twisted-words or twisted-words in package managers.

For web service support, Twisted Web must be installed; it is generally called python-twisted-web or twisted-web.

Windows

Windows is no longer directly supported. Though if python and dependencies are installed, it should work just fine. Due note, as of this writing, Twisted only supports Win32 so make sure to only use Win32 python packages.

Debian & Ubuntu

Debian and its derivatives, like Ubuntu, have Twisted in their package managers.

$ sudo aptitude install python-twisted

If you are tight on space, you can install only part of Twisted.

$ sudo aptitude install python-twisted-core python-twisted-bin python-twisted-conch

A Note about Ubuntu

If you are using Ubuntu 10.04 LTS, you will need a more recent Twisted than Ubuntu provides. There is a PPA at http://launchpad.net/~twisted-dev/+archive/ppa which provides recent versions of all Twisted packages.

Fedora

Twisted can be installed from the standard Fedora repository.

$ sudo yum install python-twisted python-twisted-conch

Gentoo

Gentoo does carry a Construct new enough for Bravo, but it does have to be unmasked.

# emerge twisted twisted-conch

LFS/Virtualenv/Standalone

If, for some reason, you are installing to a very raw or unmanaged place, and you want to ensure that everything is built from the latest source available on PyPI, we highly recommend pip for installing Bravo, since it handles all dependencies for you.

$ pip install Bravo

Bravo can also optionally use Ampoule to offload some of its inner calculations to a separate process, improving server response times. Ampoule will be automatically detected and is completely optional.

$ pip install ampoule

Running

Bravo includes a twistd plugin, so it's quite easy to run. Just copy bravo.ini.example to bravo.ini, and put it in one of these locations:

  • /etc/bravo/
  • ~/.bravo/
  • Your working directory

And then run the Twisted plugin:

$ twistd -n bravo

Contributing

Contributing is easy! Just send me your code. Diffs are appreciated, in git format; Github pull requests are excellent.

Things to consider:

  • I will be rather merciless about your code during review, especially if it adds lots of new features.
  • Some things are better off outside of the main tree, especially if they are moving very fast compared to Bravo itself.
  • Unit tests are necessary for new code, especially feature-laden code. If your code is absolutely not testable, it's not really going to be very fun to maintain. See the above point.
  • Bravo is MIT/X11. Your contributions will be under that same license. If this isn't acceptable, then your code cannot be merged. This is really the only hard condition.

FAQ

The FAQ moved to readthedocs; see http://bravo.readthedocs.org/en/latest/introduction.html#q-a.

License

Bravo is MIT/X11-licensed. See the LICENSE file for the actual text of the license.

bravo's People

Contributors

actown avatar alucas avatar barsch avatar ceymard avatar d4l3k avatar dequis avatar dliverman avatar entityreborn avatar espes avatar gwylim avatar hikari-no-yume avatar jdshu avatar jeppeklitgaard avatar justinnoah avatar lucianu avatar mariusschiffer avatar masterofjokers avatar matejcik avatar mathuin avatar mcsakoff avatar mostawesomedude avatar mythmon avatar oal avatar ryaned avatar squiddy avatar tktech 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

bravo's Issues

Block Names in blocks.py

Starting with yellow-cloth, block names are incorrect. If you look at my pull request, I have to use 'yellow-cloth' in the provides statement in order to give sandstone in the sand stone recipe.

Spawning.

Original spawn spot is high above the clouds on most, if not all generated maps. When a player saves above ground, their spawn spot is equally as high. If they are near bedrock, they seem to spawn lower then their actual spawn spot is located. If on bedrock, you are pretty much SOL as you fall through the bedrock.

Items and Blocks

I can't seem to recreate this issue at the moment, but I did at one point have something from the items list replace something from the blocks list in my inventory. In slot 0 was dirt, I picked up string (from my fork) and it replaced the dirt in slot 0. I have since tried to reproduce that bug in your current HEAD, d23cc9 and my current head (not pushed yet atm.) with no luck. This is good, but it also means that this may occur in the future.

Empty files make NBT sad

We need to verify ourselves that NBT files are valid. One easy thing to do is ensure that files are non-empty before passing them into NBT. Filepath lets us check filesize easily, so this should be a breeze.

PiP

"PIP install Bravo"

The above isn't working anymore.

Home Command/Plugin

First off, if one were to use this command it would first put them where they spawned after the logged out, the second usage sends them to the original spawn point.

Bug or Feature?

python 2.5 compatibility - alpha.py

alpha.py uses property decorators that are not in python 2.5.

example:
@y.setter

a simple fix is just to use the old property builtin.

def y_getter(self):
    return self._y

def y_setter(self, value):
    self._y = value
    if not 0.1 < (self.stance - self.y) < 1.65:
        self.stance = self.y + 1.0
y = property(y_getter, y_setter)


def yaw_getter(self):
    return degrees(self.theta)

def yaw_setter(self, value):
    self.theta = radians(value)
yaw = property(yaw_getter, yaw_setter)


def pitch_getter(self):
    return degrees(self.phi)

def pitch_setter(self, value):
    self.phi = radians(value)
pitch = property(pitch_getter, pitch_setter)

Protocols need entity dicts

Basically, protocols need to keep track of which entities they have initialized. Is this stupid? Yes, but we really have no choice.

Snow on Water and Lava

Decided to break a block of ice to make some water, had logged off for 15 minutes or so. Come back and apparently the server put Snow ontop of the water. Same for the lava.

Requested traceback.

Traceback (most recent call last):
File "./main.py", line 8, in
reactor.run()
File "/usr/lib64/python2.6/site-packages/twisted/internet/base.py", line 1128, in run
self.mainLoop()
File "/usr/lib64/python2.6/site-packages/twisted/internet/base.py", line 1140, in mainLoop
self.doIteration(t)
File "/usr/lib64/python2.6/site-packages/twisted/internet/selectreactor.py", line 140, in doSelect
_logrun(selectable, _drdw, selectable, method, dict)
--- ---
File "/usr/lib64/python2.6/site-packages/twisted/python/log.py", line 84, in callWithLogger
return callWithContext({"system": lp}, func, _args, *_kw)
File "/usr/lib64/python2.6/site-packages/twisted/python/log.py", line 69, in callWithContext
return context.call({ILogContext: newCtx}, func, _args, *_kw)
File "/usr/lib64/python2.6/site-packages/twisted/python/context.py", line 59, in callWithContext
return self.currentContext().callWithContext(ctx, func, _args, *_kw)
File "/usr/lib64/python2.6/site-packages/twisted/python/context.py", line 37, in callWithContext
return func(args,*kw)
File "/usr/lib64/python2.6/site-packages/twisted/internet/selectreactor.py", line 156, in _doReadOrWrite
self._disconnectSelectable(selectable, why, method=="doRead")
File "/usr/lib64/python2.6/site-packages/twisted/internet/posixbase.py", line 190, in _disconnectSelectable
selectable.readConnectionLost(f)
File "/usr/lib64/python2.6/site-packages/twisted/internet/tcp.py", line 509, in readConnectionLost
self.connectionLost(reason)
File "/usr/lib64/python2.6/site-packages/twisted/internet/tcp.py", line 520, in connectionLost
protocol.connectionLost(reason)
File "/home/Actown/Games/mcserver/beta/protocol.py", line 357, in connectionLost
if self.username in self.factory.players:
exceptions.AttributeError: AlphaProtocol instance has no attribute 'username'

Plugins

setup.py isn't grabbing the plugins when installing, it doesn't grab serializers or tests either.

Immediate Terrain Generation

Bravo should probably begin generating terrain as soon as the server starts rather than waiting for a player to connect to begin.

Tool Request: Map gen.

Talked about this at work, but here is what I would like to see.
A tool that outputs a map in a specific directory so that we dont override the current world/
For example: "./tool (size of x/y for a square) (what generator to use from plugins) (dir to output to)"
This tool should also print out statistics for a few things, time to do one chunk, and time to do all the chunks.

Near impossible installation on windows

Yes, yes, I know that I should use Linux. Fact is, though I dislike it, windows dominates the market. Currently installation of all modules bravo needs, then setting them up, then getting bravo to work, is almost plain impossible. We need a guide and ways to simplify installation. Getting users to install mingw32 is good, if we can get setup.py to work as well. Links to appropriate downloads would also be an alternative.

TODO: Server-Side inventory.

Check to make sure the client has said item compared to the save. Also make sure the client can pick-up items and make changes accordingly in its inventory file.

Windows reserves filename "aux" - aux.rst problem

On windows, certain filenames are reserved for system usage. aux.rst uses a reserved filename aux, so if any program, including git, tries to create it, the program fails. I can't patch this since I cannot download aux.rst to patch

Document configuration

Already we are running into the issue where people don't know how to bravo.ini. Fix that.

json import error

When starting bravo I get the following error:

File "/usr/lib64/python2.6/site-packages/Bravo-1.0-py2.6.egg/bravo/serializers/json.py", line 12, in <module>
    raise ImportError("Couldn't find a JSON library!")
ImportError: Couldn't find a JSON library!

I think it's because in json.py there is an "import json", which in this case refers to json.py instead of json the library.

Best Regards
tw00

Mob entities + Hooks

We need some mob entities, such as creeper, as well as hooks to be run when an entity is created.

termios not available on Win32

This is just a symptom of two larger issues: Win32 testing is sporadic, and we need to properly do TTY detection. I don't care about the first, but the second is very important. We should be prepared to fallback to either a lame terminal on Win32, or a completely absent terminal on a non-TTY piped I/O.

XML-RPC

More XML-RPC calls need to be made available.

XML-RPC calls might allow:
Get a list of commands
Run those commands
Get a list of players
possibly more....

Snow should be subject to physics

Specifically, snow should drop when blocks beneath it are mined. This should be pretty trivial to implement as an addon/mod to NoFloatingSnow.

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.