1
0
mirror of https://github.com/solemnwarning/directplay-lite synced 2024-12-30 16:45:37 +01:00

Allocate async handles correctly.

This commit is contained in:
Daniel Collins 2018-10-14 01:06:00 +01:00
parent 56ab6ea75a
commit f753f42d44
2 changed files with 7 additions and 7 deletions

View File

@ -23,7 +23,7 @@ DPNHANDLE AsyncHandleAllocator::new_enum()
DPNHANDLE AsyncHandleAllocator::new_connect()
{
DPNHANDLE handle = next_connect_id++ | TYPE_ENUM;
DPNHANDLE handle = next_connect_id++ | TYPE_CONNECT;
next_connect_id &= ~TYPE_MASK;
if(next_connect_id == 0)
@ -36,7 +36,7 @@ DPNHANDLE AsyncHandleAllocator::new_connect()
DPNHANDLE AsyncHandleAllocator::new_send()
{
DPNHANDLE handle = next_send_id++ | TYPE_ENUM;
DPNHANDLE handle = next_send_id++ | TYPE_SEND;
next_send_id &= ~TYPE_MASK;
if(next_send_id == 0)
@ -49,7 +49,7 @@ DPNHANDLE AsyncHandleAllocator::new_send()
DPNHANDLE AsyncHandleAllocator::new_pinfo()
{
DPNHANDLE handle = next_pinfo_id++ | TYPE_ENUM;
DPNHANDLE handle = next_pinfo_id++ | TYPE_PINFO;
next_pinfo_id &= ~TYPE_MASK;
if(next_pinfo_id == 0)

View File

@ -27,10 +27,10 @@ class AsyncHandleAllocator
public:
static const DPNHANDLE TYPE_MASK = 0x1C000000;
static const DPNHANDLE TYPE_ENUM = 0x000000000; /* EnumHosts() */
static const DPNHANDLE TYPE_CONNECT = 0x040000000; /* Connect() */
static const DPNHANDLE TYPE_SEND = 0x080000000; /* SendTo() */
static const DPNHANDLE TYPE_PINFO = 0x0C0000000; /* SetPeerInfo() */
static const DPNHANDLE TYPE_ENUM = 0x00000000; /* EnumHosts() */
static const DPNHANDLE TYPE_CONNECT = 0x04000000; /* Connect() */
static const DPNHANDLE TYPE_SEND = 0x08000000; /* SendTo() */
static const DPNHANDLE TYPE_PINFO = 0x0C000000; /* SetPeerInfo() */
AsyncHandleAllocator();