grelminar / asss (http://asss.yi.org/asss/)

A Small Subspace Server - main repository

Clone this repository (size: 5.5 MB): HTTPS / SSH
$ hg clone http://bitbucket.org/grelminar/asss/
follow

In r972:c69aa5c4ded7 support was added to Pymod for passing void pointers around as PyCObjects. There is currently no way to extract any relevant data from a PyCObject on the Python side as it is just a wrapper object. Pymod should be updated to include a function that can be called from Python such as asss.void_to_player(obj) that will return a Python player object if the PyCObject that was passed is indeed a player.

Status: wontfix Responsible: d1st0rt Type: enhancement
Milestone: none Component: none Version: none

Attachments

No attachments added for this issue yet.

Comments and changes

#1

d1st0rt

This is going to be really dangerous unless I add something similar to MODMAN_MAGIC to the top of the player structure. Can anybody think of things that would break if I did that?


#2

grelminar

That doesn't sound right. If something is a player, it should be marked as a player and not a void, and then it'll be converted automatically. voids should only be used when there is no appropriate python representation. How did you end up with a PyCObject holding a Player* ?


#3

d1st0rt

I was actually thinking ahead to something I wanted to do down the road in a fork of the hosted game core to essentially get rid of the "hosted" requirement. How I envisioned it in C was that it would change from things like int StartGame(Arena *a, Player *host) to int StartGame(Arena *a, int how, void *clos) and the how parameter would dictate what was contained in the pointer. After some thought I think it is probably a better idea to use a custom union type like Target and have it converted automatically to whatever it should be in Python modules.


#4

d1st0rt

→ Changed status from new to wontfix.

#5

drbrain

→ Changed version from 1.5.0 to nothing.

Removing version: 1.5.0 (automated comment)


Add comment / attachment

Show/hide preview

Verification: Please write the text from the image in the box (letters only)

captcha

Is that you, Humanoid? Is this me?