Re: Can't Send Instance

28 views
Skip to first unread message

Chris McCormick

unread,
May 1, 2018, 5:20:02 AM5/1/18
to pods...@googlegroups.com, Rotartsi
Sick.

On 01/05/18 11:24, Rotartsi wrote:
> I could answer my own question. After thirty minutes of reading through
> the code of asyncore, asynchat, async, and rencode I found that the
> problem was in my program the whole time. I thought that whatever _pack
> returned was just put into the dictionary, but I realized that it was
> supposed to return the arguments passed to __init__!
>
> On Monday, April 30, 2018 at 7:13:55 PM UTC-7, Rotartsi wrote:
>
> I've been trying to send an instance using PodSixNet and pygame.
> If I try to send an instance, I get the following exception:
>
> error: uncaptured python exception, closing channel
> <__main__.TCBSChannel 127.0.0.1:52144 <http://127.0.0.1:52144> at
> 0x1123e5bd8> (<type 'exceptions.TypeError'>:__init__() takes exactly
> 3 arguments (4 given)
> [/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/asyncore.py|read|83]
> ....
>
> I made sure I had
>
>     serializable.register(MultiplayerUnit)
>
> _pack for MultiplayerUnit is
>
> def _pack(self):
>
> print "packing..."
> return (pygame.image.tostring(self.image,"RGB"),
> self.image.get_size(),self.rect.topleft)
>
>
> But, when I try to send it by using
>
>
> multInstance = MultiplayerUnit([0, 0], "red")
>
> client.Send({"action":"test","unit": (multInstance, )})
>
>
> I keep getting the exception. I have no idea what I'm doing wrong!
> Thanks!
>
> --
> You received this message because you are subscribed to the Google
> Groups "PodSixNet" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to podsixnet+...@googlegroups.com
> <mailto:podsixnet+...@googlegroups.com>.
> To post to this group, send email to pods...@googlegroups.com
> <mailto:pods...@googlegroups.com>.
> Visit this group at https://groups.google.com/group/podsixnet.
> For more options, visit https://groups.google.com/d/optout.

--
http://mccormick.cx/
Reply all
Reply to author
Forward
0 new messages