[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[pygame] your game in the messenger



Hello

We'd love to include some games as a networked game in http://retroshare.sf.net Instant Messenger V.04
Actually some python games are one of my favourite games.. so I adress to our list.

some games will be the first games we actually integrate, so the interface
is still a little bit up in the air, so if you have any good interface ideas
please send them.

So the proposal for integrating is:

(1) Retroshare provides all the networking, transport etc
    and provides a simple C or C++ API for your python game to communicate with.

(2) Your game is compiled as a static library, and linked into retroshare for
the moment. as we don't have a plugin architecture written yet.

(3) Retroshare has a 'GameLauncher' which will work out who's
   online and organise the players, and pass that information to your pyhton game.

(4) Your pyhton game is Launched in its own window in its own thread, and has
   complete control of that environment. It just uses retroshares API
   to exchange messages with peers.

(5) you can have multiple concurrent py-games if the/your library can
  handle it.

A rough interface could be something like (or a C equivalent) :

class GameInterface
{
   public:
      /* start / stop (called from GameLauncher) */
virtual  startGame(std::string gameId, std::list<std::string>
peerIds); /* in turn order (if applicable) */
virtual  quitGame(std::string gameId);

      /* send/recv msgs */

      bool sendMsg(std::string gameId, std::string peerId, void *data,
uint32_t len); /* NULL peerId = broadcast */
      uint32_t msgAvailable(std::string gameid); /* returns next
message length */
      uint32_t recvMsg(std::string gameId, std::string &fromId, void
*data, uint32_t len); /* returns msg len */

      /* information for pygame ... */
      std::string getPeerName(std::string peerId);

};


Is this approach acceptable to you? Someone interested to see his game in the Instant Messenger launchable?

thanks for a feedback

Mike