mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-06-12 16:43:17 -04:00
* Addition of the basic Games Launcher - used to organise networked games with peers.
* New external interface for launcher (rsiface/rsgame.h) * changed pqiservice type Ids from int -> uint32_t. * added NO_DELETE option to pqistreamer. * added HASHDATA flag for BinInterfaces git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@301 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
ad8562467f
commit
0712590a99
13 changed files with 1527 additions and 12 deletions
|
@ -282,12 +282,15 @@ virtual int notifyEvent(NetInterface *ni, int event) { return 0; }
|
|||
/********************** Binary INTERFACE ****************************
|
||||
* This defines the binary interface used by Network/loopback/file
|
||||
* interfaces
|
||||
*
|
||||
* Flags are passed to BinInterfaces, and serialisers
|
||||
*/
|
||||
|
||||
#define BIN_FLAGS_NO_CLOSE 0x0001
|
||||
#define BIN_FLAGS_READABLE 0x0002
|
||||
#define BIN_FLAGS_WRITEABLE 0x0004
|
||||
#define BIN_FLAGS_NO_DELETE 0x0008
|
||||
#define BIN_FLAGS_HASHDATA 0x0010
|
||||
|
||||
class BinInterface
|
||||
{
|
||||
|
|
|
@ -43,7 +43,7 @@ int p3ServiceServer::addService(pqiService *ts)
|
|||
pqioutput(PQL_DEBUG_BASIC, pqiservicezone,
|
||||
"p3ServiceServer::addService()");
|
||||
|
||||
std::map<int, pqiService *>::iterator it;
|
||||
std::map<uint32_t, pqiService *>::iterator it;
|
||||
it = services.find(ts -> getType());
|
||||
if (it != services.end())
|
||||
{
|
||||
|
@ -74,7 +74,7 @@ int p3ServiceServer::incoming(RsRawItem *item)
|
|||
pqioutput(PQL_DEBUG_BASIC, pqiservicezone, out.str());
|
||||
}
|
||||
|
||||
std::map<int, pqiService *>::iterator it;
|
||||
std::map<uint32_t, pqiService *>::iterator it;
|
||||
it = services.find(item -> PacketId() & 0xffffff00);
|
||||
if (it == services.end())
|
||||
{
|
||||
|
@ -117,7 +117,7 @@ RsRawItem *p3ServiceServer::outgoing()
|
|||
rrit = services.begin();
|
||||
}
|
||||
|
||||
std::map<int, pqiService *>::iterator sit = rrit;
|
||||
std::map<uint32_t, pqiService *>::iterator sit = rrit;
|
||||
// run to the end.
|
||||
RsRawItem *item;
|
||||
|
||||
|
@ -162,7 +162,7 @@ int p3ServiceServer::tick()
|
|||
pqioutput(PQL_DEBUG_ALL, pqiservicezone,
|
||||
"p3ServiceServer::tick()");
|
||||
|
||||
std::map<int, pqiService *>::iterator it;
|
||||
std::map<uint32_t, pqiService *>::iterator it;
|
||||
|
||||
// from the beginning to where we started.
|
||||
for(it = services.begin();it != services.end(); it++)
|
||||
|
|
|
@ -65,12 +65,12 @@ virtual ~pqiService() { return; }
|
|||
virtual int receive(RsRawItem *) = 0;
|
||||
virtual RsRawItem * send() = 0;
|
||||
|
||||
int getType() { return type; }
|
||||
uint32_t getType() { return type; }
|
||||
|
||||
virtual int tick() { return 0; }
|
||||
|
||||
private:
|
||||
int type;
|
||||
uint32_t type;
|
||||
};
|
||||
|
||||
#include <map>
|
||||
|
@ -90,8 +90,8 @@ int tick();
|
|||
|
||||
private:
|
||||
|
||||
std::map<int, pqiService *> services;
|
||||
std::map<int, pqiService *>::iterator rrit;
|
||||
std::map<uint32_t, pqiService *> services;
|
||||
std::map<uint32_t, pqiService *>::iterator rrit;
|
||||
|
||||
};
|
||||
|
||||
|
|
|
@ -294,7 +294,10 @@ int pqistreamer::queue_outpqi(RsItem *pqi)
|
|||
{
|
||||
out_data.push_back(ptr);
|
||||
}
|
||||
delete pqi;
|
||||
if (!(bio_flags & BIN_FLAGS_NO_DELETE))
|
||||
{
|
||||
delete pqi;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
|
@ -310,7 +313,10 @@ int pqistreamer::queue_outpqi(RsItem *pqi)
|
|||
pqi -> print(out);
|
||||
pqioutput(PQL_ALERT, pqistreamerzone, out.str());
|
||||
|
||||
delete pqi;
|
||||
if (!(bio_flags & BIN_FLAGS_NO_DELETE))
|
||||
{
|
||||
delete pqi;
|
||||
}
|
||||
return 1; // keep error internal.
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue