mirror of
https://github.com/Mezeporta/Erupe.git
synced 2025-12-14 16:04:38 +01:00
emulate retail semaphore logic
This commit is contained in:
@@ -22,15 +22,18 @@ type Semaphore struct {
|
||||
|
||||
// Max Players for Semaphore
|
||||
maxPlayers uint16
|
||||
|
||||
host *Session
|
||||
}
|
||||
|
||||
// NewSemaphore creates a new Semaphore with intialized values
|
||||
func NewSemaphore(s *Server, ID string, MaxPlayers uint16) *Semaphore {
|
||||
func NewSemaphore(s *Session, ID string, MaxPlayers uint16) *Semaphore {
|
||||
sema := &Semaphore{
|
||||
name: ID,
|
||||
id: s.NextSemaphoreID(),
|
||||
id: s.GetSemaphoreID(),
|
||||
clients: make(map[*Session]uint32),
|
||||
maxPlayers: MaxPlayers,
|
||||
host: s,
|
||||
}
|
||||
return sema
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user