Permalink
Browse files

Some ENet changes

  • Loading branch information...
1 parent a7d778a commit c2c9f6e1669e03824c79904de3f5d8a9c68ceb80 @matpow2 matpow2 committed Apr 2, 2012
Showing with 5 additions and 1 deletion.
  1. +1 −0 enet/enet.pyx
  2. +2 −0 pyspades/protocol.py
  3. +2 −1 pyspades/server.py
View
@@ -920,6 +920,7 @@ cdef class Host:
"""
global current_host
current_host = self
+ cdef int result
if self._enet_host:
event = Event()
result = enet_host_service(
@@ -125,6 +125,8 @@ def update(self):
if event is None:
break
event_type = event.type
+ if event_type == enet.EVENT_TYPE_NONE:
+ break
peer = event.peer
is_client = peer in self.clients
if is_client:
View
@@ -1427,7 +1427,8 @@ class ServerProtocol(BaseProtocol):
respawn_waves = False
def __init__(self, *arg, **kw):
- # +2 to allow masterserver connection AND disconnect events when full
+ # +2 to allow server->master and master->server connection since enet
+ # peers are allocated for both clients and hosts.
self.max_connections = self.max_players + 2
BaseProtocol.__init__(self, *arg, **kw)
self.entities = []

0 comments on commit c2c9f6e

Please sign in to comment.