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