-
Re: Poinc - OINC for Python
So I installed Twisted for Python 2.6 and extracted Poinc in Lib, but when I try to run the server example. I get this :
Traceback (most recent call last):
File "C:\Documents and Settings\ATN\Bureaublad\accountserver.py", line 7, in <module>
from twisted.internet import reactor
File "C:\Python25\lib\site-packages\twisted\internet\reactor.py", line 37, in <module>
from twisted.internet import selectreactor
File "C:\Python25\lib\site-packages\twisted\internet\selectreactor.py", line 21, in <module>
from twisted.internet import posixbase
File "C:\Python25\lib\site-packages\twisted\internet\posixbase.py", line 25, in <module>
from twisted.internet import tcp, udp
File "C:\Python25\lib\site-packages\twisted\internet\tcp.py", line 78, in <module>
from twisted.internet import defer, base, address
File "C:\Python25\lib\site-packages\twisted\internet\defer.py", line 17, in <module>
from twisted.python import log, failure, lockfile
File "C:\Python25\lib\site-packages\twisted\python\lockfile.py", line 28, in <module>
from win32api import OpenProcess
ImportError: No module named win32api
EDIT : Oke it works now (needed to install the win32 extensions found here : http://sourceforge.net/projects/pywin32/ ) the server example works great. But the acountserver.py example freezes, is this normal? Is someone planning to write a python server example with registering/logging in? That would be great!
-
Re: Poinc - OINC for Python
BrandonC had the same error when he first ran one of the Poinc examples, and we sorted it the exact same way.
As for a Python Server with registering and logging in, I wrote one for BrandonC's Arcane Tale project. If there are a lot of requests for this, I'll whip up a (written) tutorial when I've got the time. Just a bit shy of doing a Python orientated tutorial, because my Python, whilst adequate, is sometimes clumsy and I'm aware that Mathias will read it. :P
-
Re: Poinc - OINC for Python
Some of the examples might be outdated. I'll see if I can get them updated soon ;)
Quote:
... and I'm aware that Mathias will read it. :P
At your service, good sir! :D
I'll say go for it :)
-
Re: Poinc - OINC for Python
Just a status update: seems like the latest OINC build still has a few problems, so you'll still have to wait a bit :(
Something new in the upcoming Poinc version is the Moo subpackage-- it provides an implementation of the Moo protocol with an interface very close to the OINC aspect of the library, so people with applications that uses Moo can (re)implement their servers/clients in poinc.moo and afterwards, poinc (which should, hopefully, make porting just a bit easier).
Also worth of a note are the new stack features-- you can read/write some general datatypes from messages (like you can in the extension).
-
Re: Poinc - OINC for Python
Quote:
Originally Posted by Mathias
Just a status update: seems like the latest OINC build still has a few problems, so you'll still have to wait a bit :(
What problems are you referring to?
-
Re: Poinc - OINC for Python
The only problem that I get every once in a while is that the app crashed when you close it while being connected, and I've done a lot of tests lately. :)
-
Re: Poinc - OINC for Python
-
Re: Poinc - OINC for Python
-
Re: Poinc - OINC for Python
A bug found in 0.1.985 has been fixed and out comes 0.1.986! Everything should be working properly now :)
-
Re: Poinc - OINC for Python
Quote:
Originally Posted by DizzyDoo
As for a Python Server with registering and logging in, I wrote one for BrandonC's Arcane Tale project. If there are a lot of requests for this, I'll whip up a (written) tutorial when I've got the time. Just a bit shy of doing a Python orientated tutorial, because my Python, whilst adequate, is sometimes clumsy and I'm aware that Mathias will read it. :P
I'd be very interested in seeing an example.
-
Re: Poinc - OINC for Python
Did a quick account server example today for you mdpane (I'll include it with the next release). It can be found here.
-
Re: Poinc - OINC for Python
Thanks, Mathias. I can't peep it on the computer I'm on now, but I'll check it out when I get home. Looks like exactly what I need.
-
Re: Poinc - OINC for Python
For some odd reason, I can't seem to use Tuna's UDPTEST to blast messages using oinc.darkkiller.dk. I'll troubleshoot the problem soon :)
-
Re: Poinc - OINC for Python
I have the same results, I can't get UDP messages to go through, but the send method does work.
(I didn't mention that if you right click the screen it will send a message using SEND rather than BLAST. A bit of a sanity check to validate that the connection is live and data is being transmitted for those times when UDP doesn't seem to work.)
-
Re: Poinc - OINC for Python
Seems to be something with POINC - UDP works fine with server.klikfarm.com.
-
Re: Poinc - OINC for Python
I'm moving the project page (http://aq.darkkiller.dk/oinc/poinc) to Google Code so people can submit patches and so on (and I also won't have to announce new releases!)
New page
-
Re: Poinc - OINC for Python
seems to be a problem in the udp example with people with the same name - or I'm doing something wrong.
-
Re: Poinc - OINC for Python
I'm giving my first look at poinc, excuse me if this was already discussed. I see last poinc version is about 1 month old, is it considered stable/bug-free ? How much of OINC is currently supported ?
-
Re: Poinc - OINC for Python
Poinc should be fully compatible with the newest stable OINC release (1.0b), and it can be considered stable. I'm planning for some new major changes in version 0.2.0 so I can clean up the codebase though, so that's the only thing you might want to watch out for!
I'm always welcome for patches :)
-
Re: Poinc - OINC for Python
Thanks for those good news !
So far Poinc looks very good. But I haven't started making advanced stuff yet. Thank you for the hard work.
What are your future plans for version 0.2 ?
-
Re: Poinc - OINC for Python
So far what needs to be done is:
- The Big Refactor (0.2.0!)
- Add some new still-yet-to-be-announced features
- Tutorials and/or examples
Poinc is pretty much feature complete (I can't add features that aren't in the official OINC protocol), so I don't really have any future plans apart from the roadmap above.
-
Re: Poinc - OINC for Python
I am a complete noob at this but very interested. I installed python, twisted and the win32 package earlier in this thread. But when opening a server.py in the pythonWin and running in the "interactive window" I get this
ImportError: No module named poinc.moo.server
I have very little understanding of all this, but could someone help me out?
Thanks
-
Re: Poinc - OINC for Python
Ah, yeah. You need to run the examples from the root directory (the directory with the poinc directory in it) like this:
C:\Python\python.exe examples\minimal\server.py
or something :)
-
Re: Poinc - OINC for Python
Or install poinc in the libs directory of your python installation
-
Re: Poinc - OINC for Python
Ah ok. If i put them in the root dir it works, although its a bit messy..
How do i install the poinc libs into python Corentin?
HOWEVER, when run through winpython or the IDLE, the program stops responding - although it does work. I'm supposing its doing an infinite loop of the program. This means that to close the program, i have to do it through the task manager, and makes it quite difficult to edit the code and test it as it shuts down the IDLE when i end the process.
Any thoughts on this?
EDIT - If i edit it in the IDLE and run it through command line thats fine really.
What python code would I write in the server program to make the server send something to the client?
Thanks,
love from noob1
-
Re: Poinc - OINC for Python
Just put your poinc folder in the \lib\ directory of your python version (probably something like c:\python26\lib\poinc)
There are some examples of custom servers around (you'll find one in the poinc distribution) that I find really useful, since i'm a python newbie too !
-
Re: Poinc - OINC for Python
Thanks Corentin,
Mathias : Am I missing something? Or is it really essential that we have some kind of wiki that has a list of commands we can call in python (I'm assuming these are functions) and what parameters they can have?
I saw you said that some kind of wiki is down.. Is that what it contains?
It would be nice to get a basic walkthrough on how to start custom coding a server. I can work with the examples given, but don't full understand everything and therefore don't feel very confident in experimenting with it.
Thanks,
Alex
-
Re: Poinc - OINC for Python
I find it difficult to grasp the structure of the code too... I have trouble understanding what is done by twisted and what by poinc, which modules are need and etc...
The_Alee, did you see this link ? It's the best information about pOINC I found. But it's a raw documentation, nothing like a tutorial. I'd love to see a walkthrough, or some basic informations about the structure of POINC.
I haven't had enough time to give an in-depth look yet, and I start to understand a few things, but i'd probably spend much less time on it if such a tut existed.
-
Re: Poinc - OINC for Python
I'm aware of the fact that there aren't many tutorials in regards to using Poinc, but I'm essentially still working on 0.2.0, so I don't want to write a whole lot of tutorials for an API that is going to change.
I do have one around that I might put up for obvious reasons ;)
-
Re: Poinc - OINC for Python
How much is it going to change? :O And why do you need to re-write it?
Also, I'm thinking, im going to have a user login by joining a channel with the name "name | password", have the server check the name and password before letting them join, if its correct it then sets their name to simple "name", and sends the player all the account info (such as what they have in their inventory, class etc. etc.) How would i do this?
> def connectionAccepted(self, welcome):
>> if checkLogin == True:
>>> self.setName('name')
>> else:
>>> self.disconnect('BadLogin')
> def checkLogin(self, name):
>> login = name.value.split(|)
>> ?????
Is that the right kind of thing? I'm a bit lost on the exact syntax and stuff.
Many thanks
EDIT - the forum removed all my lovely nesting :(
-
Re: Poinc - OINC for Python
I managed to help The_Alee with this problem :)
By the way, the library will probably change name to "lacewing", so now, you will probably have to do something along the lines of
Code:
from lacewing import ...
instead of
Code:
from poinc import ...
-
Re: Poinc - OINC for Python
I'm still having trouble understanding poinc :
Where should I store player-related runtime information ? For example X and Y positions, should I just add those values in transport.getPeer() ? Or should I create a new container for those values ?
Thanks for your help
EDIT : For now I just use self.x and self.y in the messageReceived() and loginAccepted() functions. I don't really understand how this can work with multiple connexions, but it seems to work...
-
Re: Poinc - OINC for Python
It should work with multiple connection because you are using containers (each one unique?)
However, presumably you could store all that kind of stuff in an array.
My question is, when will Poinc be updated so we can use it with lacewing? I went to work on some stuff just now, picked up the new lacewing beta - but its incompatible with poinc :(
-
Re: Poinc - OINC for Python
Sorry, I've been in Berlin the past week, so I'll try and answer your questions now :)
Since Poinc just uses the Twisted framework, you should probably look into Twisted if you want to know how everything works.
Basically, the protocol is the connection, and the factory is the "server". An unique protocol instance is made for every connection. You should probably subclass the factory if you want to load some settings at runtime, since you don't want to be loading them for every new connection made :)
Poinc should already be compatible (OINC->Lacewing is merely a name change, no major changes to the protocol), but I'll check it out.
EDIT: Oh, I just realized Jamie has been changing things :O I'll get a new release out ASAP!
EDIT 2: Oh, I just realized Jamie hasn't been changing things :O I'll still try and fix the issue, though.
-
Re: Poinc - OINC for Python
I haven't changed anything in the protocol!
-
Re: Poinc - OINC for Python
Quote:
Originally Posted by Mathias
EDIT: Oh, I just realized Jamie has been changing things :O I'll get a new release out ASAP!
EDIT 2: Oh, I just realized Jamie hasn't been changing things :O I'll still try and fix the issue, though.
xD
LOL
-
Re: Poinc - OINC for Python
0.2.0 is pretty much ready, and can be found at http://code.google.com/p/pylacewing/.
Notice the name change? Yeah, it's now called "pylacewing". Check out the examples to see what you'll have to change to make your code compatible with pylacewing.
-
Re: Poinc - OINC for Python
0.2.1 has been released, and includes some bugfixes for peer messages. A new type, ByteReader, has also been made, and provides the needed functionality for reading and writing binary data easily.
-
Re: Poinc - OINC for Python
With Poinc, I was using a StringIO for my binary messages, I'll try it with your ByteReader now.
Thanks for your work.
-
Re: Poinc - OINC for Python
Per request of izac, I've made some tutorials that explain how to use pylacewing:
http://code.google.com/p/pylacewing/wiki/Tutorials
Tutorial requests are welcome ;)