barneygale / mark2

minecraft server wrapper, written in python with twisted
Other
105 stars 27 forks source link

move code into "mark2" package #73

Closed barneygale closed 11 years ago

barneygale commented 11 years ago

Yo. Root is getting cluttered. Lets move all codey things into a 'mark2' folder. Exceptions:

edk0 commented 11 years ago

sounds good. I don't see anything wrong with moving launcher into the mark2 package too, really - the mark2 executable file could just import mark2.launcher.

should we split the client into a separate package or something? It's somewhat limiting having to fit all that stuff in one file.

punkeel commented 11 years ago

please reopen Hi, Would it be possible, then, to "make" an API using mark2 ? Thanks in advance, PunKeel'

edk0 commented 11 years ago

what would such an API do? mark2 is really intended as a program rather than an API but there's nothing to stop you doing import mk2 in an environment that has it installed (which isn't a thing yet, but will be once we merge the setuptools branch).

punkeel commented 11 years ago

Like get a server "object" and getPlayers(), update(), start(), stop() it, and so on :) edit or specify a RAM per server

edk0 commented 11 years ago

I think such a thing would be a wrapper around mark2 rather than something we could simply expose from existing stuff. You could do something similar by making a Manager then sending events to its EventDispatcher, but that would be fairly hacky at the moment (you'd have to eat the initial ServerStart with a high-priority event handler, for example).

What's your use case?

punkeel commented 11 years ago

Just a simple web panel interacting with server :) (but "need" to manage ram and maybe slots, or level-name)

I asked an API to just pip install mark2 and have a script that manages this :)

I can "try" (and succeed !) to implement this, and pull-request .. For the moment, i'll keep the hackish-way