mirror of
https://github.com/solero/houdini.git
synced 2024-11-25 06:57:24 +00:00
Prevent players double joining match making system
This commit is contained in:
parent
eee531f2bc
commit
a21c272c8b
@ -57,9 +57,10 @@ class MatchMaking:
|
|||||||
mm.tick -= 1
|
mm.tick -= 1
|
||||||
|
|
||||||
def add_penguin(self, p):
|
def add_penguin(self, p):
|
||||||
mm = MatchMaker(penguin=p, tick=self._match_every)
|
if p not in self._penguins:
|
||||||
self._penguins.append(mm)
|
mm = MatchMaker(penguin=p, tick=self._match_every)
|
||||||
self._penguins.sort(key=operator.attrgetter('penguin.' + self._match_by))
|
self._penguins.append(mm)
|
||||||
|
self._penguins.sort(key=operator.attrgetter('penguin.' + self._match_by))
|
||||||
|
|
||||||
def remove_penguin(self, p):
|
def remove_penguin(self, p):
|
||||||
self._penguins = [mm for mm in self._penguins if mm.penguin != p]
|
self._penguins = [mm for mm in self._penguins if mm.penguin != p]
|
||||||
|
Loading…
Reference in New Issue
Block a user