matchmaking support

This commit is contained in:
wish
2022-08-05 07:39:37 +10:00
parent 08a7b91e11
commit 820563dc4c
4 changed files with 118 additions and 16 deletions

View File

@@ -124,7 +124,16 @@ func handleMsgSysCreateAcquireSemaphore(s *Session, p mhfpacket.MHFPacket) {
}
func handleMsgSysAcquireSemaphore(s *Session, p mhfpacket.MHFPacket) {
//pkt := p.(*mhfpacket.MsgSysAcquireSemaphore)
pkt := p.(*mhfpacket.MsgSysAcquireSemaphore)
if sema, exists := s.server.semaphore[pkt.SemaphoreID]; exists {
sema.clients[s] = s.charID
bf := byteframe.NewByteFrame()
bf.WriteUint32(sema.id)
doAckSimpleSucceed(s, pkt.AckHandle, bf.Data())
} else {
doAckSimpleFail(s, pkt.AckHandle, make([]byte, 4))
}
}
func handleMsgSysReleaseSemaphore(s *Session, p mhfpacket.MHFPacket) {