mirror of
https://github.com/Mezeporta/Erupe.git
synced 2025-12-14 07:55:33 +01:00
fix DeleteSemaphore variable naming
This commit is contained in:
@@ -10,7 +10,7 @@ import (
|
||||
|
||||
// MsgSysDeleteSemaphore represents the MSG_SYS_DELETE_SEMAPHORE
|
||||
type MsgSysDeleteSemaphore struct {
|
||||
AckHandle uint32
|
||||
SemaphoreID uint32
|
||||
}
|
||||
|
||||
// Opcode returns the ID associated with this packet type.
|
||||
@@ -20,7 +20,7 @@ func (m *MsgSysDeleteSemaphore) Opcode() network.PacketID {
|
||||
|
||||
// Parse parses the packet from binary
|
||||
func (m *MsgSysDeleteSemaphore) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
m.AckHandle = bf.ReadUint32()
|
||||
m.SemaphoreID = bf.ReadUint32()
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
@@ -55,12 +55,11 @@ func releaseRaviSemaphore(s *Session, sema *Semaphore) {
|
||||
|
||||
func handleMsgSysDeleteSemaphore(s *Session, p mhfpacket.MHFPacket) {
|
||||
pkt := p.(*mhfpacket.MsgSysDeleteSemaphore)
|
||||
sem := pkt.AckHandle
|
||||
if s.server.semaphore != nil {
|
||||
destructEmptySemaphores(s)
|
||||
s.server.semaphoreLock.Lock()
|
||||
for id, sema := range s.server.semaphore {
|
||||
if sema.id == sem {
|
||||
if sema.id == pkt.SemaphoreID {
|
||||
if strings.HasPrefix(id, "hs_l0u3B5") {
|
||||
releaseRaviSemaphore(s, sema)
|
||||
s.server.semaphoreLock.Unlock()
|
||||
|
||||
Reference in New Issue
Block a user