mirror of
https://github.com/Mezeporta/Erupe.git
synced 2025-12-16 08:55:31 +01:00
Change project dir structure
This commit is contained in:
90
server/channelserver/channel_server.go
Normal file
90
server/channelserver/channel_server.go
Normal file
@@ -0,0 +1,90 @@
|
||||
package channelserver
|
||||
|
||||
import (
|
||||
"database/sql"
|
||||
"fmt"
|
||||
"net"
|
||||
"sync"
|
||||
|
||||
"github.com/Andoryuuta/Erupe/config"
|
||||
"go.uber.org/zap"
|
||||
)
|
||||
|
||||
// Config struct allows configuring the server.
|
||||
type Config struct {
|
||||
Logger *zap.Logger
|
||||
DB *sql.DB
|
||||
ErupeConfig *config.Config
|
||||
}
|
||||
|
||||
// Server is a MHF channel server.
|
||||
type Server struct {
|
||||
sync.Mutex
|
||||
logger *zap.Logger
|
||||
db *sql.DB
|
||||
erupeConfig *config.Config
|
||||
acceptConns chan net.Conn
|
||||
deleteConns chan net.Conn
|
||||
sessions map[net.Conn]*Session
|
||||
listenAddr string
|
||||
listener net.Listener // Listener that is created when Server.Start is called.
|
||||
}
|
||||
|
||||
// NewServer creates a new Server type.
|
||||
func NewServer(config *Config) *Server {
|
||||
s := &Server{
|
||||
logger: config.Logger,
|
||||
db: config.DB,
|
||||
erupeConfig: config.ErupeConfig,
|
||||
acceptConns: make(chan net.Conn),
|
||||
deleteConns: make(chan net.Conn),
|
||||
sessions: make(map[net.Conn]*Session),
|
||||
}
|
||||
return s
|
||||
}
|
||||
|
||||
// Start starts the server in a new goroutine.
|
||||
func (s *Server) Start() error {
|
||||
l, err := net.Listen("tcp", fmt.Sprintf(":%d", s.erupeConfig.Channel.Port))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
s.listener = l
|
||||
|
||||
go s.acceptClients()
|
||||
go s.manageSessions()
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (s *Server) acceptClients() {
|
||||
for {
|
||||
conn, err := s.listener.Accept()
|
||||
if err != nil {
|
||||
// TODO(Andoryuuta): Implement shutdown logic to end this goroutine cleanly here.
|
||||
fmt.Println(err)
|
||||
continue
|
||||
}
|
||||
s.acceptConns <- conn
|
||||
}
|
||||
}
|
||||
|
||||
func (s *Server) manageSessions() {
|
||||
for {
|
||||
select {
|
||||
case newConn := <-s.acceptConns:
|
||||
session := NewSession(s, newConn)
|
||||
|
||||
s.Lock()
|
||||
s.sessions[newConn] = session
|
||||
s.Unlock()
|
||||
|
||||
session.Start()
|
||||
|
||||
case delConn := <-s.deleteConns:
|
||||
s.Lock()
|
||||
delete(s.sessions, delConn)
|
||||
s.Unlock()
|
||||
}
|
||||
}
|
||||
}
|
||||
446
server/channelserver/handler_table.go
Normal file
446
server/channelserver/handler_table.go
Normal file
@@ -0,0 +1,446 @@
|
||||
package channelserver
|
||||
|
||||
import (
|
||||
"github.com/Andoryuuta/Erupe/network"
|
||||
"github.com/Andoryuuta/Erupe/network/mhfpacket"
|
||||
)
|
||||
|
||||
type handlerFunc func(s *Session, p mhfpacket.MHFPacket)
|
||||
|
||||
var handlerTable map[network.PacketID]handlerFunc
|
||||
|
||||
func init() {
|
||||
handlerTable = make(map[network.PacketID]handlerFunc)
|
||||
handlerTable[network.MSG_HEAD] = handleMsgHead
|
||||
handlerTable[network.MSG_SYS_reserve01] = handleMsgSysReserve01
|
||||
handlerTable[network.MSG_SYS_reserve02] = handleMsgSysReserve02
|
||||
handlerTable[network.MSG_SYS_reserve03] = handleMsgSysReserve03
|
||||
handlerTable[network.MSG_SYS_reserve04] = handleMsgSysReserve04
|
||||
handlerTable[network.MSG_SYS_reserve05] = handleMsgSysReserve05
|
||||
handlerTable[network.MSG_SYS_reserve06] = handleMsgSysReserve06
|
||||
handlerTable[network.MSG_SYS_reserve07] = handleMsgSysReserve07
|
||||
handlerTable[network.MSG_SYS_ADD_OBJECT] = handleMsgSysAddObject
|
||||
handlerTable[network.MSG_SYS_DEL_OBJECT] = handleMsgSysDelObject
|
||||
handlerTable[network.MSG_SYS_DISP_OBJECT] = handleMsgSysDispObject
|
||||
handlerTable[network.MSG_SYS_HIDE_OBJECT] = handleMsgSysHideObject
|
||||
handlerTable[network.MSG_SYS_reserve0C] = handleMsgSysReserve0C
|
||||
handlerTable[network.MSG_SYS_reserve0D] = handleMsgSysReserve0D
|
||||
handlerTable[network.MSG_SYS_reserve0E] = handleMsgSysReserve0E
|
||||
handlerTable[network.MSG_SYS_EXTEND_THRESHOLD] = handleMsgSysExtendThreshold
|
||||
handlerTable[network.MSG_SYS_END] = handleMsgSysEnd
|
||||
handlerTable[network.MSG_SYS_NOP] = handleMsgSysNop
|
||||
handlerTable[network.MSG_SYS_ACK] = handleMsgSysAck
|
||||
handlerTable[network.MSG_SYS_TERMINAL_LOG] = handleMsgSysTerminalLog
|
||||
handlerTable[network.MSG_SYS_LOGIN] = handleMsgSysLogin
|
||||
handlerTable[network.MSG_SYS_LOGOUT] = handleMsgSysLogout
|
||||
handlerTable[network.MSG_SYS_SET_STATUS] = handleMsgSysSetStatus
|
||||
handlerTable[network.MSG_SYS_PING] = handleMsgSysPing
|
||||
handlerTable[network.MSG_SYS_CAST_BINARY] = handleMsgSysCastBinary
|
||||
handlerTable[network.MSG_SYS_HIDE_CLIENT] = handleMsgSysHideClient
|
||||
handlerTable[network.MSG_SYS_TIME] = handleMsgSysTime
|
||||
handlerTable[network.MSG_SYS_CASTED_BINARY] = handleMsgSysCastedBinary
|
||||
handlerTable[network.MSG_SYS_GET_FILE] = handleMsgSysGetFile
|
||||
handlerTable[network.MSG_SYS_ISSUE_LOGKEY] = handleMsgSysIssueLogkey
|
||||
handlerTable[network.MSG_SYS_RECORD_LOG] = handleMsgSysRecordLog
|
||||
handlerTable[network.MSG_SYS_ECHO] = handleMsgSysEcho
|
||||
handlerTable[network.MSG_SYS_CREATE_STAGE] = handleMsgSysCreateStage
|
||||
handlerTable[network.MSG_SYS_STAGE_DESTRUCT] = handleMsgSysStageDestruct
|
||||
handlerTable[network.MSG_SYS_ENTER_STAGE] = handleMsgSysEnterStage
|
||||
handlerTable[network.MSG_SYS_BACK_STAGE] = handleMsgSysBackStage
|
||||
handlerTable[network.MSG_SYS_MOVE_STAGE] = handleMsgSysMoveStage
|
||||
handlerTable[network.MSG_SYS_LEAVE_STAGE] = handleMsgSysLeaveStage
|
||||
handlerTable[network.MSG_SYS_LOCK_STAGE] = handleMsgSysLockStage
|
||||
handlerTable[network.MSG_SYS_UNLOCK_STAGE] = handleMsgSysUnlockStage
|
||||
handlerTable[network.MSG_SYS_RESERVE_STAGE] = handleMsgSysReserveStage
|
||||
handlerTable[network.MSG_SYS_UNRESERVE_STAGE] = handleMsgSysUnreserveStage
|
||||
handlerTable[network.MSG_SYS_SET_STAGE_PASS] = handleMsgSysSetStagePass
|
||||
handlerTable[network.MSG_SYS_WAIT_STAGE_BINARY] = handleMsgSysWaitStageBinary
|
||||
handlerTable[network.MSG_SYS_SET_STAGE_BINARY] = handleMsgSysSetStageBinary
|
||||
handlerTable[network.MSG_SYS_GET_STAGE_BINARY] = handleMsgSysGetStageBinary
|
||||
handlerTable[network.MSG_SYS_ENUMERATE_CLIENT] = handleMsgSysEnumerateClient
|
||||
handlerTable[network.MSG_SYS_ENUMERATE_STAGE] = handleMsgSysEnumerateStage
|
||||
handlerTable[network.MSG_SYS_CREATE_MUTEX] = handleMsgSysCreateMutex
|
||||
handlerTable[network.MSG_SYS_CREATE_OPEN_MUTEX] = handleMsgSysCreateOpenMutex
|
||||
handlerTable[network.MSG_SYS_DELETE_MUTEX] = handleMsgSysDeleteMutex
|
||||
handlerTable[network.MSG_SYS_OPEN_MUTEX] = handleMsgSysOpenMutex
|
||||
handlerTable[network.MSG_SYS_CLOSE_MUTEX] = handleMsgSysCloseMutex
|
||||
handlerTable[network.MSG_SYS_CREATE_SEMAPHORE] = handleMsgSysCreateSemaphore
|
||||
handlerTable[network.MSG_SYS_CREATE_ACQUIRE_SEMAPHORE] = handleMsgSysCreateAcquireSemaphore
|
||||
handlerTable[network.MSG_SYS_DELETE_SEMAPHORE] = handleMsgSysDeleteSemaphore
|
||||
handlerTable[network.MSG_SYS_ACQUIRE_SEMAPHORE] = handleMsgSysAcquireSemaphore
|
||||
handlerTable[network.MSG_SYS_RELEASE_SEMAPHORE] = handleMsgSysReleaseSemaphore
|
||||
handlerTable[network.MSG_SYS_LOCK_GLOBAL_SEMA] = handleMsgSysLockGlobalSema
|
||||
handlerTable[network.MSG_SYS_UNLOCK_GLOBAL_SEMA] = handleMsgSysUnlockGlobalSema
|
||||
handlerTable[network.MSG_SYS_CHECK_SEMAPHORE] = handleMsgSysCheckSemaphore
|
||||
handlerTable[network.MSG_SYS_OPERATE_REGISTER] = handleMsgSysOperateRegister
|
||||
handlerTable[network.MSG_SYS_LOAD_REGISTER] = handleMsgSysLoadRegister
|
||||
handlerTable[network.MSG_SYS_NOTIFY_REGISTER] = handleMsgSysNotifyRegister
|
||||
handlerTable[network.MSG_SYS_CREATE_OBJECT] = handleMsgSysCreateObject
|
||||
handlerTable[network.MSG_SYS_DELETE_OBJECT] = handleMsgSysDeleteObject
|
||||
handlerTable[network.MSG_SYS_POSITION_OBJECT] = handleMsgSysPositionObject
|
||||
handlerTable[network.MSG_SYS_ROTATE_OBJECT] = handleMsgSysRotateObject
|
||||
handlerTable[network.MSG_SYS_DUPLICATE_OBJECT] = handleMsgSysDuplicateObject
|
||||
handlerTable[network.MSG_SYS_SET_OBJECT_BINARY] = handleMsgSysSetObjectBinary
|
||||
handlerTable[network.MSG_SYS_GET_OBJECT_BINARY] = handleMsgSysGetObjectBinary
|
||||
handlerTable[network.MSG_SYS_GET_OBJECT_OWNER] = handleMsgSysGetObjectOwner
|
||||
handlerTable[network.MSG_SYS_UPDATE_OBJECT_BINARY] = handleMsgSysUpdateObjectBinary
|
||||
handlerTable[network.MSG_SYS_CLEANUP_OBJECT] = handleMsgSysCleanupObject
|
||||
handlerTable[network.MSG_SYS_reserve4A] = handleMsgSysReserve4A
|
||||
handlerTable[network.MSG_SYS_reserve4B] = handleMsgSysReserve4B
|
||||
handlerTable[network.MSG_SYS_reserve4C] = handleMsgSysReserve4C
|
||||
handlerTable[network.MSG_SYS_reserve4D] = handleMsgSysReserve4D
|
||||
handlerTable[network.MSG_SYS_reserve4E] = handleMsgSysReserve4E
|
||||
handlerTable[network.MSG_SYS_reserve4F] = handleMsgSysReserve4F
|
||||
handlerTable[network.MSG_SYS_INSERT_USER] = handleMsgSysInsertUser
|
||||
handlerTable[network.MSG_SYS_DELETE_USER] = handleMsgSysDeleteUser
|
||||
handlerTable[network.MSG_SYS_SET_USER_BINARY] = handleMsgSysSetUserBinary
|
||||
handlerTable[network.MSG_SYS_GET_USER_BINARY] = handleMsgSysGetUserBinary
|
||||
handlerTable[network.MSG_SYS_NOTIFY_USER_BINARY] = handleMsgSysNotifyUserBinary
|
||||
handlerTable[network.MSG_SYS_reserve55] = handleMsgSysReserve55
|
||||
handlerTable[network.MSG_SYS_reserve56] = handleMsgSysReserve56
|
||||
handlerTable[network.MSG_SYS_reserve57] = handleMsgSysReserve57
|
||||
handlerTable[network.MSG_SYS_UPDATE_RIGHT] = handleMsgSysUpdateRight
|
||||
handlerTable[network.MSG_SYS_AUTH_QUERY] = handleMsgSysAuthQuery
|
||||
handlerTable[network.MSG_SYS_AUTH_DATA] = handleMsgSysAuthData
|
||||
handlerTable[network.MSG_SYS_AUTH_TERMINAL] = handleMsgSysAuthTerminal
|
||||
handlerTable[network.MSG_SYS_reserve5C] = handleMsgSysReserve5C
|
||||
handlerTable[network.MSG_SYS_RIGHTS_RELOAD] = handleMsgSysRightsReload
|
||||
handlerTable[network.MSG_SYS_reserve5E] = handleMsgSysReserve5E
|
||||
handlerTable[network.MSG_SYS_reserve5F] = handleMsgSysReserve5F
|
||||
handlerTable[network.MSG_MHF_SAVEDATA] = handleMsgMhfSavedata
|
||||
handlerTable[network.MSG_MHF_LOADDATA] = handleMsgMhfLoaddata
|
||||
handlerTable[network.MSG_MHF_LIST_MEMBER] = handleMsgMhfListMember
|
||||
handlerTable[network.MSG_MHF_OPR_MEMBER] = handleMsgMhfOprMember
|
||||
handlerTable[network.MSG_MHF_ENUMERATE_DIST_ITEM] = handleMsgMhfEnumerateDistItem
|
||||
handlerTable[network.MSG_MHF_APPLY_DIST_ITEM] = handleMsgMhfApplyDistItem
|
||||
handlerTable[network.MSG_MHF_ACQUIRE_DIST_ITEM] = handleMsgMhfAcquireDistItem
|
||||
handlerTable[network.MSG_MHF_GET_DIST_DESCRIPTION] = handleMsgMhfGetDistDescription
|
||||
handlerTable[network.MSG_MHF_SEND_MAIL] = handleMsgMhfSendMail
|
||||
handlerTable[network.MSG_MHF_READ_MAIL] = handleMsgMhfReadMail
|
||||
handlerTable[network.MSG_MHF_LIST_MAIL] = handleMsgMhfListMail
|
||||
handlerTable[network.MSG_MHF_OPRT_MAIL] = handleMsgMhfOprtMail
|
||||
handlerTable[network.MSG_MHF_LOAD_FAVORITE_QUEST] = handleMsgMhfLoadFavoriteQuest
|
||||
handlerTable[network.MSG_MHF_SAVE_FAVORITE_QUEST] = handleMsgMhfSaveFavoriteQuest
|
||||
handlerTable[network.MSG_MHF_REGISTER_EVENT] = handleMsgMhfRegisterEvent
|
||||
handlerTable[network.MSG_MHF_RELEASE_EVENT] = handleMsgMhfReleaseEvent
|
||||
handlerTable[network.MSG_MHF_TRANSIT_MESSAGE] = handleMsgMhfTransitMessage
|
||||
handlerTable[network.MSG_SYS_reserve71] = handleMsgSysReserve71
|
||||
handlerTable[network.MSG_SYS_reserve72] = handleMsgSysReserve72
|
||||
handlerTable[network.MSG_SYS_reserve73] = handleMsgSysReserve73
|
||||
handlerTable[network.MSG_SYS_reserve74] = handleMsgSysReserve74
|
||||
handlerTable[network.MSG_SYS_reserve75] = handleMsgSysReserve75
|
||||
handlerTable[network.MSG_SYS_reserve76] = handleMsgSysReserve76
|
||||
handlerTable[network.MSG_SYS_reserve77] = handleMsgSysReserve77
|
||||
handlerTable[network.MSG_SYS_reserve78] = handleMsgSysReserve78
|
||||
handlerTable[network.MSG_SYS_reserve79] = handleMsgSysReserve79
|
||||
handlerTable[network.MSG_SYS_reserve7A] = handleMsgSysReserve7A
|
||||
handlerTable[network.MSG_SYS_reserve7B] = handleMsgSysReserve7B
|
||||
handlerTable[network.MSG_SYS_reserve7C] = handleMsgSysReserve7C
|
||||
handlerTable[network.MSG_CA_EXCHANGE_ITEM] = handleMsgCaExchangeItem
|
||||
handlerTable[network.MSG_SYS_reserve7E] = handleMsgSysReserve7E
|
||||
handlerTable[network.MSG_MHF_PRESENT_BOX] = handleMsgMhfPresentBox
|
||||
handlerTable[network.MSG_MHF_SERVER_COMMAND] = handleMsgMhfServerCommand
|
||||
handlerTable[network.MSG_MHF_SHUT_CLIENT] = handleMsgMhfShutClient
|
||||
handlerTable[network.MSG_MHF_ANNOUNCE] = handleMsgMhfAnnounce
|
||||
handlerTable[network.MSG_MHF_SET_LOGINWINDOW] = handleMsgMhfSetLoginwindow
|
||||
handlerTable[network.MSG_SYS_TRANS_BINARY] = handleMsgSysTransBinary
|
||||
handlerTable[network.MSG_SYS_COLLECT_BINARY] = handleMsgSysCollectBinary
|
||||
handlerTable[network.MSG_SYS_GET_STATE] = handleMsgSysGetState
|
||||
handlerTable[network.MSG_SYS_SERIALIZE] = handleMsgSysSerialize
|
||||
handlerTable[network.MSG_SYS_ENUMLOBBY] = handleMsgSysEnumlobby
|
||||
handlerTable[network.MSG_SYS_ENUMUSER] = handleMsgSysEnumuser
|
||||
handlerTable[network.MSG_SYS_INFOKYSERVER] = handleMsgSysInfokyserver
|
||||
handlerTable[network.MSG_MHF_GET_CA_UNIQUE_ID] = handleMsgMhfGetCaUniqueID
|
||||
handlerTable[network.MSG_MHF_SET_CA_ACHIEVEMENT] = handleMsgMhfSetCaAchievement
|
||||
handlerTable[network.MSG_MHF_CARAVAN_MY_SCORE] = handleMsgMhfCaravanMyScore
|
||||
handlerTable[network.MSG_MHF_CARAVAN_RANKING] = handleMsgMhfCaravanRanking
|
||||
handlerTable[network.MSG_MHF_CARAVAN_MY_RANK] = handleMsgMhfCaravanMyRank
|
||||
handlerTable[network.MSG_MHF_CREATE_GUILD] = handleMsgMhfCreateGuild
|
||||
handlerTable[network.MSG_MHF_OPERATE_GUILD] = handleMsgMhfOperateGuild
|
||||
handlerTable[network.MSG_MHF_OPERATE_GUILD_MEMBER] = handleMsgMhfOperateGuildMember
|
||||
handlerTable[network.MSG_MHF_INFO_GUILD] = handleMsgMhfInfoGuild
|
||||
handlerTable[network.MSG_MHF_ENUMERATE_GUILD] = handleMsgMhfEnumerateGuild
|
||||
handlerTable[network.MSG_MHF_UPDATE_GUILD] = handleMsgMhfUpdateGuild
|
||||
handlerTable[network.MSG_MHF_ARRANGE_GUILD_MEMBER] = handleMsgMhfArrangeGuildMember
|
||||
handlerTable[network.MSG_MHF_ENUMERATE_GUILD_MEMBER] = handleMsgMhfEnumerateGuildMember
|
||||
handlerTable[network.MSG_MHF_ENUMERATE_CAMPAIGN] = handleMsgMhfEnumerateCampaign
|
||||
handlerTable[network.MSG_MHF_STATE_CAMPAIGN] = handleMsgMhfStateCampaign
|
||||
handlerTable[network.MSG_MHF_APPLY_CAMPAIGN] = handleMsgMhfApplyCampaign
|
||||
handlerTable[network.MSG_MHF_ENUMERATE_ITEM] = handleMsgMhfEnumerateItem
|
||||
handlerTable[network.MSG_MHF_ACQUIRE_ITEM] = handleMsgMhfAcquireItem
|
||||
handlerTable[network.MSG_MHF_TRANSFER_ITEM] = handleMsgMhfTransferItem
|
||||
handlerTable[network.MSG_MHF_MERCENARY_HUNTDATA] = handleMsgMhfMercenaryHuntdata
|
||||
handlerTable[network.MSG_MHF_ENTRY_ROOKIE_GUILD] = handleMsgMhfEntryRookieGuild
|
||||
handlerTable[network.MSG_MHF_ENUMERATE_QUEST] = handleMsgMhfEnumerateQuest
|
||||
handlerTable[network.MSG_MHF_ENUMERATE_EVENT] = handleMsgMhfEnumerateEvent
|
||||
handlerTable[network.MSG_MHF_ENUMERATE_PRICE] = handleMsgMhfEnumeratePrice
|
||||
handlerTable[network.MSG_MHF_ENUMERATE_RANKING] = handleMsgMhfEnumerateRanking
|
||||
handlerTable[network.MSG_MHF_ENUMERATE_ORDER] = handleMsgMhfEnumerateOrder
|
||||
handlerTable[network.MSG_MHF_ENUMERATE_SHOP] = handleMsgMhfEnumerateShop
|
||||
handlerTable[network.MSG_MHF_GET_EXTRA_INFO] = handleMsgMhfGetExtraInfo
|
||||
handlerTable[network.MSG_MHF_UPDATE_INTERIOR] = handleMsgMhfUpdateInterior
|
||||
handlerTable[network.MSG_MHF_ENUMERATE_HOUSE] = handleMsgMhfEnumerateHouse
|
||||
handlerTable[network.MSG_MHF_UPDATE_HOUSE] = handleMsgMhfUpdateHouse
|
||||
handlerTable[network.MSG_MHF_LOAD_HOUSE] = handleMsgMhfLoadHouse
|
||||
handlerTable[network.MSG_MHF_OPERATE_WAREHOUSE] = handleMsgMhfOperateWarehouse
|
||||
handlerTable[network.MSG_MHF_ENUMERATE_WAREHOUSE] = handleMsgMhfEnumerateWarehouse
|
||||
handlerTable[network.MSG_MHF_UPDATE_WAREHOUSE] = handleMsgMhfUpdateWarehouse
|
||||
handlerTable[network.MSG_MHF_ACQUIRE_TITLE] = handleMsgMhfAcquireTitle
|
||||
handlerTable[network.MSG_MHF_ENUMERATE_TITLE] = handleMsgMhfEnumerateTitle
|
||||
handlerTable[network.MSG_MHF_ENUMERATE_GUILD_ITEM] = handleMsgMhfEnumerateGuildItem
|
||||
handlerTable[network.MSG_MHF_UPDATE_GUILD_ITEM] = handleMsgMhfUpdateGuildItem
|
||||
handlerTable[network.MSG_MHF_ENUMERATE_UNION_ITEM] = handleMsgMhfEnumerateUnionItem
|
||||
handlerTable[network.MSG_MHF_UPDATE_UNION_ITEM] = handleMsgMhfUpdateUnionItem
|
||||
handlerTable[network.MSG_MHF_CREATE_JOINT] = handleMsgMhfCreateJoint
|
||||
handlerTable[network.MSG_MHF_OPERATE_JOINT] = handleMsgMhfOperateJoint
|
||||
handlerTable[network.MSG_MHF_INFO_JOINT] = handleMsgMhfInfoJoint
|
||||
handlerTable[network.MSG_MHF_UPDATE_GUILD_ICON] = handleMsgMhfUpdateGuildIcon
|
||||
handlerTable[network.MSG_MHF_INFO_FESTA] = handleMsgMhfInfoFesta
|
||||
handlerTable[network.MSG_MHF_ENTRY_FESTA] = handleMsgMhfEntryFesta
|
||||
handlerTable[network.MSG_MHF_CHARGE_FESTA] = handleMsgMhfChargeFesta
|
||||
handlerTable[network.MSG_MHF_ACQUIRE_FESTA] = handleMsgMhfAcquireFesta
|
||||
handlerTable[network.MSG_MHF_STATE_FESTA_U] = handleMsgMhfStateFestaU
|
||||
handlerTable[network.MSG_MHF_STATE_FESTA_G] = handleMsgMhfStateFestaG
|
||||
handlerTable[network.MSG_MHF_ENUMERATE_FESTA_MEMBER] = handleMsgMhfEnumerateFestaMember
|
||||
handlerTable[network.MSG_MHF_VOTE_FESTA] = handleMsgMhfVoteFesta
|
||||
handlerTable[network.MSG_MHF_ACQUIRE_CAFE_ITEM] = handleMsgMhfAcquireCafeItem
|
||||
handlerTable[network.MSG_MHF_UPDATE_CAFEPOINT] = handleMsgMhfUpdateCafepoint
|
||||
handlerTable[network.MSG_MHF_CHECK_DAILY_CAFEPOINT] = handleMsgMhfCheckDailyCafepoint
|
||||
handlerTable[network.MSG_MHF_GET_COG_INFO] = handleMsgMhfGetCogInfo
|
||||
handlerTable[network.MSG_MHF_CHECK_MONTHLY_ITEM] = handleMsgMhfCheckMonthlyItem
|
||||
handlerTable[network.MSG_MHF_ACQUIRE_MONTHLY_ITEM] = handleMsgMhfAcquireMonthlyItem
|
||||
handlerTable[network.MSG_MHF_CHECK_WEEKLY_STAMP] = handleMsgMhfCheckWeeklyStamp
|
||||
handlerTable[network.MSG_MHF_EXCHANGE_WEEKLY_STAMP] = handleMsgMhfExchangeWeeklyStamp
|
||||
handlerTable[network.MSG_MHF_CREATE_MERCENARY] = handleMsgMhfCreateMercenary
|
||||
handlerTable[network.MSG_MHF_SAVE_MERCENARY] = handleMsgMhfSaveMercenary
|
||||
handlerTable[network.MSG_MHF_READ_MERCENARY_W] = handleMsgMhfReadMercenaryW
|
||||
handlerTable[network.MSG_MHF_READ_MERCENARY_M] = handleMsgMhfReadMercenaryM
|
||||
handlerTable[network.MSG_MHF_CONTRACT_MERCENARY] = handleMsgMhfContractMercenary
|
||||
handlerTable[network.MSG_MHF_ENUMERATE_MERCENARY_LOG] = handleMsgMhfEnumerateMercenaryLog
|
||||
handlerTable[network.MSG_MHF_ENUMERATE_GUACOT] = handleMsgMhfEnumerateGuacot
|
||||
handlerTable[network.MSG_MHF_UPDATE_GUACOT] = handleMsgMhfUpdateGuacot
|
||||
handlerTable[network.MSG_MHF_INFO_TOURNAMENT] = handleMsgMhfInfoTournament
|
||||
handlerTable[network.MSG_MHF_ENTRY_TOURNAMENT] = handleMsgMhfEntryTournament
|
||||
handlerTable[network.MSG_MHF_ENTER_TOURNAMENT_QUEST] = handleMsgMhfEnterTournamentQuest
|
||||
handlerTable[network.MSG_MHF_ACQUIRE_TOURNAMENT] = handleMsgMhfAcquireTournament
|
||||
handlerTable[network.MSG_MHF_GET_ACHIEVEMENT] = handleMsgMhfGetAchievement
|
||||
handlerTable[network.MSG_MHF_RESET_ACHIEVEMENT] = handleMsgMhfResetAchievement
|
||||
handlerTable[network.MSG_MHF_ADD_ACHIEVEMENT] = handleMsgMhfAddAchievement
|
||||
handlerTable[network.MSG_MHF_PAYMENT_ACHIEVEMENT] = handleMsgMhfPaymentAchievement
|
||||
handlerTable[network.MSG_MHF_DISPLAYED_ACHIEVEMENT] = handleMsgMhfDisplayedAchievement
|
||||
handlerTable[network.MSG_MHF_INFO_SCENARIO_COUNTER] = handleMsgMhfInfoScenarioCounter
|
||||
handlerTable[network.MSG_MHF_SAVE_SCENARIO_DATA] = handleMsgMhfSaveScenarioData
|
||||
handlerTable[network.MSG_MHF_LOAD_SCENARIO_DATA] = handleMsgMhfLoadScenarioData
|
||||
handlerTable[network.MSG_MHF_GET_BBS_SNS_STATUS] = handleMsgMhfGetBbsSnsStatus
|
||||
handlerTable[network.MSG_MHF_APPLY_BBS_ARTICLE] = handleMsgMhfApplyBbsArticle
|
||||
handlerTable[network.MSG_MHF_GET_ETC_POINTS] = handleMsgMhfGetEtcPoints
|
||||
handlerTable[network.MSG_MHF_UPDATE_ETC_POINT] = handleMsgMhfUpdateEtcPoint
|
||||
handlerTable[network.MSG_MHF_GET_MYHOUSE_INFO] = handleMsgMhfGetMyhouseInfo
|
||||
handlerTable[network.MSG_MHF_UPDATE_MYHOUSE_INFO] = handleMsgMhfUpdateMyhouseInfo
|
||||
handlerTable[network.MSG_MHF_GET_WEEKLY_SCHEDULE] = handleMsgMhfGetWeeklySchedule
|
||||
handlerTable[network.MSG_MHF_ENUMERATE_INV_GUILD] = handleMsgMhfEnumerateInvGuild
|
||||
handlerTable[network.MSG_MHF_OPERATION_INV_GUILD] = handleMsgMhfOperationInvGuild
|
||||
handlerTable[network.MSG_MHF_STAMPCARD_STAMP] = handleMsgMhfStampcardStamp
|
||||
handlerTable[network.MSG_MHF_STAMPCARD_PRIZE] = handleMsgMhfStampcardPrize
|
||||
handlerTable[network.MSG_MHF_UNRESERVE_SRG] = handleMsgMhfUnreserveSrg
|
||||
handlerTable[network.MSG_MHF_LOAD_PLATE_DATA] = handleMsgMhfLoadPlateData
|
||||
handlerTable[network.MSG_MHF_SAVE_PLATE_DATA] = handleMsgMhfSavePlateData
|
||||
handlerTable[network.MSG_MHF_LOAD_PLATE_BOX] = handleMsgMhfLoadPlateBox
|
||||
handlerTable[network.MSG_MHF_SAVE_PLATE_BOX] = handleMsgMhfSavePlateBox
|
||||
handlerTable[network.MSG_MHF_READ_GUILDCARD] = handleMsgMhfReadGuildcard
|
||||
handlerTable[network.MSG_MHF_UPDATE_GUILDCARD] = handleMsgMhfUpdateGuildcard
|
||||
handlerTable[network.MSG_MHF_READ_BEAT_LEVEL] = handleMsgMhfReadBeatLevel
|
||||
handlerTable[network.MSG_MHF_UPDATE_BEAT_LEVEL] = handleMsgMhfUpdateBeatLevel
|
||||
handlerTable[network.MSG_MHF_READ_BEAT_LEVEL_ALL_RANKING] = handleMsgMhfReadBeatLevelAllRanking
|
||||
handlerTable[network.MSG_MHF_READ_BEAT_LEVEL_MY_RANKING] = handleMsgMhfReadBeatLevelMyRanking
|
||||
handlerTable[network.MSG_MHF_READ_LAST_WEEK_BEAT_RANKING] = handleMsgMhfReadLastWeekBeatRanking
|
||||
handlerTable[network.MSG_MHF_ACCEPT_READ_REWARD] = handleMsgMhfAcceptReadReward
|
||||
handlerTable[network.MSG_MHF_GET_ADDITIONAL_BEAT_REWARD] = handleMsgMhfGetAdditionalBeatReward
|
||||
handlerTable[network.MSG_MHF_GET_FIXED_SEIBATU_RANKING_TABLE] = handleMsgMhfGetFixedSeibatuRankingTable
|
||||
handlerTable[network.MSG_MHF_GET_BBS_USER_STATUS] = handleMsgMhfGetBbsUserStatus
|
||||
handlerTable[network.MSG_MHF_KICK_EXPORT_FORCE] = handleMsgMhfKickExportForce
|
||||
handlerTable[network.MSG_MHF_GET_BREAK_SEIBATU_LEVEL_REWARD] = handleMsgMhfGetBreakSeibatuLevelReward
|
||||
handlerTable[network.MSG_MHF_GET_WEEKLY_SEIBATU_RANKING_REWARD] = handleMsgMhfGetWeeklySeibatuRankingReward
|
||||
handlerTable[network.MSG_MHF_GET_EARTH_STATUS] = handleMsgMhfGetEarthStatus
|
||||
handlerTable[network.MSG_MHF_LOAD_PARTNER] = handleMsgMhfLoadPartner
|
||||
handlerTable[network.MSG_MHF_SAVE_PARTNER] = handleMsgMhfSavePartner
|
||||
handlerTable[network.MSG_MHF_GET_GUILD_MISSION_LIST] = handleMsgMhfGetGuildMissionList
|
||||
handlerTable[network.MSG_MHF_GET_GUILD_MISSION_RECORD] = handleMsgMhfGetGuildMissionRecord
|
||||
handlerTable[network.MSG_MHF_ADD_GUILD_MISSION_COUNT] = handleMsgMhfAddGuildMissionCount
|
||||
handlerTable[network.MSG_MHF_SET_GUILD_MISSION_TARGET] = handleMsgMhfSetGuildMissionTarget
|
||||
handlerTable[network.MSG_MHF_CANCEL_GUILD_MISSION_TARGET] = handleMsgMhfCancelGuildMissionTarget
|
||||
handlerTable[network.MSG_MHF_LOAD_OTOMO_AIROU] = handleMsgMhfLoadOtomoAirou
|
||||
handlerTable[network.MSG_MHF_SAVE_OTOMO_AIROU] = handleMsgMhfSaveOtomoAirou
|
||||
handlerTable[network.MSG_MHF_ENUMERATE_GUILD_TRESURE] = handleMsgMhfEnumerateGuildTresure
|
||||
handlerTable[network.MSG_MHF_ENUMERATE_AIROULIST] = handleMsgMhfEnumerateAiroulist
|
||||
handlerTable[network.MSG_MHF_REGIST_GUILD_TRESURE] = handleMsgMhfRegistGuildTresure
|
||||
handlerTable[network.MSG_MHF_ACQUIRE_GUILD_TRESURE] = handleMsgMhfAcquireGuildTresure
|
||||
handlerTable[network.MSG_MHF_OPERATE_GUILD_TRESURE_REPORT] = handleMsgMhfOperateGuildTresureReport
|
||||
handlerTable[network.MSG_MHF_GET_GUILD_TRESURE_SOUVENIR] = handleMsgMhfGetGuildTresureSouvenir
|
||||
handlerTable[network.MSG_MHF_ACQUIRE_GUILD_TRESURE_SOUVENIR] = handleMsgMhfAcquireGuildTresureSouvenir
|
||||
handlerTable[network.MSG_MHF_ENUMERATE_FESTA_INTERMEDIATE_PRIZE] = handleMsgMhfEnumerateFestaIntermediatePrize
|
||||
handlerTable[network.MSG_MHF_ACQUIRE_FESTA_INTERMEDIATE_PRIZE] = handleMsgMhfAcquireFestaIntermediatePrize
|
||||
handlerTable[network.MSG_MHF_LOAD_DECO_MYSET] = handleMsgMhfLoadDecoMyset
|
||||
handlerTable[network.MSG_MHF_SAVE_DECO_MYSET] = handleMsgMhfSaveDecoMyset
|
||||
handlerTable[network.MSG_MHF_reserve010F] = handleMsgMhfReserve010F
|
||||
handlerTable[network.MSG_MHF_LOAD_GUILD_COOKING] = handleMsgMhfLoadGuildCooking
|
||||
handlerTable[network.MSG_MHF_REGIST_GUILD_COOKING] = handleMsgMhfRegistGuildCooking
|
||||
handlerTable[network.MSG_MHF_LOAD_GUILD_ADVENTURE] = handleMsgMhfLoadGuildAdventure
|
||||
handlerTable[network.MSG_MHF_REGIST_GUILD_ADVENTURE] = handleMsgMhfRegistGuildAdventure
|
||||
handlerTable[network.MSG_MHF_ACQUIRE_GUILD_ADVENTURE] = handleMsgMhfAcquireGuildAdventure
|
||||
handlerTable[network.MSG_MHF_CHARGE_GUILD_ADVENTURE] = handleMsgMhfChargeGuildAdventure
|
||||
handlerTable[network.MSG_MHF_LOAD_LEGEND_DISPATCH] = handleMsgMhfLoadLegendDispatch
|
||||
handlerTable[network.MSG_MHF_LOAD_HUNTER_NAVI] = handleMsgMhfLoadHunterNavi
|
||||
handlerTable[network.MSG_MHF_SAVE_HUNTER_NAVI] = handleMsgMhfSaveHunterNavi
|
||||
handlerTable[network.MSG_MHF_REGIST_SPABI_TIME] = handleMsgMhfRegistSpabiTime
|
||||
handlerTable[network.MSG_MHF_GET_GUILD_WEEKLY_BONUS_MASTER] = handleMsgMhfGetGuildWeeklyBonusMaster
|
||||
handlerTable[network.MSG_MHF_GET_GUILD_WEEKLY_BONUS_ACTIVE_COUNT] = handleMsgMhfGetGuildWeeklyBonusActiveCount
|
||||
handlerTable[network.MSG_MHF_ADD_GUILD_WEEKLY_BONUS_EXCEPTIONAL_USER] = handleMsgMhfAddGuildWeeklyBonusExceptionalUser
|
||||
handlerTable[network.MSG_MHF_GET_TOWER_INFO] = handleMsgMhfGetTowerInfo
|
||||
handlerTable[network.MSG_MHF_POST_TOWER_INFO] = handleMsgMhfPostTowerInfo
|
||||
handlerTable[network.MSG_MHF_GET_GEM_INFO] = handleMsgMhfGetGemInfo
|
||||
handlerTable[network.MSG_MHF_POST_GEM_INFO] = handleMsgMhfPostGemInfo
|
||||
handlerTable[network.MSG_MHF_GET_EARTH_VALUE] = handleMsgMhfGetEarthValue
|
||||
handlerTable[network.MSG_MHF_DEBUG_POST_VALUE] = handleMsgMhfDebugPostValue
|
||||
handlerTable[network.MSG_MHF_GET_PAPER_DATA] = handleMsgMhfGetPaperData
|
||||
handlerTable[network.MSG_MHF_GET_NOTICE] = handleMsgMhfGetNotice
|
||||
handlerTable[network.MSG_MHF_POST_NOTICE] = handleMsgMhfPostNotice
|
||||
handlerTable[network.MSG_MHF_GET_BOOST_TIME] = handleMsgMhfGetBoostTime
|
||||
handlerTable[network.MSG_MHF_POST_BOOST_TIME] = handleMsgMhfPostBoostTime
|
||||
handlerTable[network.MSG_MHF_GET_BOOST_TIME_LIMIT] = handleMsgMhfGetBoostTimeLimit
|
||||
handlerTable[network.MSG_MHF_POST_BOOST_TIME_LIMIT] = handleMsgMhfPostBoostTimeLimit
|
||||
handlerTable[network.MSG_MHF_ENUMERATE_FESTA_PERSONAL_PRIZE] = handleMsgMhfEnumerateFestaPersonalPrize
|
||||
handlerTable[network.MSG_MHF_ACQUIRE_FESTA_PERSONAL_PRIZE] = handleMsgMhfAcquireFestaPersonalPrize
|
||||
handlerTable[network.MSG_MHF_GET_RAND_FROM_TABLE] = handleMsgMhfGetRandFromTable
|
||||
handlerTable[network.MSG_MHF_GET_CAFE_DURATION] = handleMsgMhfGetCafeDuration
|
||||
handlerTable[network.MSG_MHF_GET_CAFE_DURATION_BONUS_INFO] = handleMsgMhfGetCafeDurationBonusInfo
|
||||
handlerTable[network.MSG_MHF_RECEIVE_CAFE_DURATION_BONUS] = handleMsgMhfReceiveCafeDurationBonus
|
||||
handlerTable[network.MSG_MHF_POST_CAFE_DURATION_BONUS_RECEIVED] = handleMsgMhfPostCafeDurationBonusReceived
|
||||
handlerTable[network.MSG_MHF_GET_GACHA_POINT] = handleMsgMhfGetGachaPoint
|
||||
handlerTable[network.MSG_MHF_USE_GACHA_POINT] = handleMsgMhfUseGachaPoint
|
||||
handlerTable[network.MSG_MHF_EXCHANGE_FPOINT_2_ITEM] = handleMsgMhfExchangeFpoint2Item
|
||||
handlerTable[network.MSG_MHF_EXCHANGE_ITEM_2_FPOINT] = handleMsgMhfExchangeItem2Fpoint
|
||||
handlerTable[network.MSG_MHF_GET_FPOINT_EXCHANGE_LIST] = handleMsgMhfGetFpointExchangeList
|
||||
handlerTable[network.MSG_MHF_PLAY_STEPUP_GACHA] = handleMsgMhfPlayStepupGacha
|
||||
handlerTable[network.MSG_MHF_RECEIVE_GACHA_ITEM] = handleMsgMhfReceiveGachaItem
|
||||
handlerTable[network.MSG_MHF_GET_STEPUP_STATUS] = handleMsgMhfGetStepupStatus
|
||||
handlerTable[network.MSG_MHF_PLAY_FREE_GACHA] = handleMsgMhfPlayFreeGacha
|
||||
handlerTable[network.MSG_MHF_GET_TINY_BIN] = handleMsgMhfGetTinyBin
|
||||
handlerTable[network.MSG_MHF_POST_TINY_BIN] = handleMsgMhfPostTinyBin
|
||||
handlerTable[network.MSG_MHF_GET_SENYU_DAILY_COUNT] = handleMsgMhfGetSenyuDailyCount
|
||||
handlerTable[network.MSG_MHF_GET_GUILD_TARGET_MEMBER_NUM] = handleMsgMhfGetGuildTargetMemberNum
|
||||
handlerTable[network.MSG_MHF_GET_BOOST_RIGHT] = handleMsgMhfGetBoostRight
|
||||
handlerTable[network.MSG_MHF_START_BOOST_TIME] = handleMsgMhfStartBoostTime
|
||||
handlerTable[network.MSG_MHF_POST_BOOST_TIME_QUEST_RETURN] = handleMsgMhfPostBoostTimeQuestReturn
|
||||
handlerTable[network.MSG_MHF_GET_BOX_GACHA_INFO] = handleMsgMhfGetBoxGachaInfo
|
||||
handlerTable[network.MSG_MHF_PLAY_BOX_GACHA] = handleMsgMhfPlayBoxGacha
|
||||
handlerTable[network.MSG_MHF_RESET_BOX_GACHA_INFO] = handleMsgMhfResetBoxGachaInfo
|
||||
handlerTable[network.MSG_MHF_GET_SEIBATTLE] = handleMsgMhfGetSeibattle
|
||||
handlerTable[network.MSG_MHF_POST_SEIBATTLE] = handleMsgMhfPostSeibattle
|
||||
handlerTable[network.MSG_MHF_GET_RYOUDAMA] = handleMsgMhfGetRyoudama
|
||||
handlerTable[network.MSG_MHF_POST_RYOUDAMA] = handleMsgMhfPostRyoudama
|
||||
handlerTable[network.MSG_MHF_GET_TENROUIRAI] = handleMsgMhfGetTenrouirai
|
||||
handlerTable[network.MSG_MHF_POST_TENROUIRAI] = handleMsgMhfPostTenrouirai
|
||||
handlerTable[network.MSG_MHF_POST_GUILD_SCOUT] = handleMsgMhfPostGuildScout
|
||||
handlerTable[network.MSG_MHF_CANCEL_GUILD_SCOUT] = handleMsgMhfCancelGuildScout
|
||||
handlerTable[network.MSG_MHF_ANSWER_GUILD_SCOUT] = handleMsgMhfAnswerGuildScout
|
||||
handlerTable[network.MSG_MHF_GET_GUILD_SCOUT_LIST] = handleMsgMhfGetGuildScoutList
|
||||
handlerTable[network.MSG_MHF_GET_GUILD_MANAGE_RIGHT] = handleMsgMhfGetGuildManageRight
|
||||
handlerTable[network.MSG_MHF_SET_GUILD_MANAGE_RIGHT] = handleMsgMhfSetGuildManageRight
|
||||
handlerTable[network.MSG_MHF_PLAY_NORMAL_GACHA] = handleMsgMhfPlayNormalGacha
|
||||
handlerTable[network.MSG_MHF_GET_DAILY_MISSION_MASTER] = handleMsgMhfGetDailyMissionMaster
|
||||
handlerTable[network.MSG_MHF_GET_DAILY_MISSION_PERSONAL] = handleMsgMhfGetDailyMissionPersonal
|
||||
handlerTable[network.MSG_MHF_SET_DAILY_MISSION_PERSONAL] = handleMsgMhfSetDailyMissionPersonal
|
||||
handlerTable[network.MSG_MHF_GET_GACHA_PLAY_HISTORY] = handleMsgMhfGetGachaPlayHistory
|
||||
handlerTable[network.MSG_MHF_GET_REJECT_GUILD_SCOUT] = handleMsgMhfGetRejectGuildScout
|
||||
handlerTable[network.MSG_MHF_SET_REJECT_GUILD_SCOUT] = handleMsgMhfSetRejectGuildScout
|
||||
handlerTable[network.MSG_MHF_GET_CA_ACHIEVEMENT_HIST] = handleMsgMhfGetCaAchievementHist
|
||||
handlerTable[network.MSG_MHF_SET_CA_ACHIEVEMENT_HIST] = handleMsgMhfSetCaAchievementHist
|
||||
handlerTable[network.MSG_MHF_GET_KEEP_LOGIN_BOOST_STATUS] = handleMsgMhfGetKeepLoginBoostStatus
|
||||
handlerTable[network.MSG_MHF_USE_KEEP_LOGIN_BOOST] = handleMsgMhfUseKeepLoginBoost
|
||||
handlerTable[network.MSG_MHF_GET_UD_SCHEDULE] = handleMsgMhfGetUdSchedule
|
||||
handlerTable[network.MSG_MHF_GET_UD_INFO] = handleMsgMhfGetUdInfo
|
||||
handlerTable[network.MSG_MHF_GET_KIJU_INFO] = handleMsgMhfGetKijuInfo
|
||||
handlerTable[network.MSG_MHF_SET_KIJU] = handleMsgMhfSetKiju
|
||||
handlerTable[network.MSG_MHF_ADD_UD_POINT] = handleMsgMhfAddUdPoint
|
||||
handlerTable[network.MSG_MHF_GET_UD_MY_POINT] = handleMsgMhfGetUdMyPoint
|
||||
handlerTable[network.MSG_MHF_GET_UD_TOTAL_POINT_INFO] = handleMsgMhfGetUdTotalPointInfo
|
||||
handlerTable[network.MSG_MHF_GET_UD_BONUS_QUEST_INFO] = handleMsgMhfGetUdBonusQuestInfo
|
||||
handlerTable[network.MSG_MHF_GET_UD_SELECTED_COLOR_INFO] = handleMsgMhfGetUdSelectedColorInfo
|
||||
handlerTable[network.MSG_MHF_GET_UD_MONSTER_POINT] = handleMsgMhfGetUdMonsterPoint
|
||||
handlerTable[network.MSG_MHF_GET_UD_DAILY_PRESENT_LIST] = handleMsgMhfGetUdDailyPresentList
|
||||
handlerTable[network.MSG_MHF_GET_UD_NORMA_PRESENT_LIST] = handleMsgMhfGetUdNormaPresentList
|
||||
handlerTable[network.MSG_MHF_GET_UD_RANKING_REWARD_LIST] = handleMsgMhfGetUdRankingRewardList
|
||||
handlerTable[network.MSG_MHF_ACQUIRE_UD_ITEM] = handleMsgMhfAcquireUdItem
|
||||
handlerTable[network.MSG_MHF_GET_REWARD_SONG] = handleMsgMhfGetRewardSong
|
||||
handlerTable[network.MSG_MHF_USE_REWARD_SONG] = handleMsgMhfUseRewardSong
|
||||
handlerTable[network.MSG_MHF_ADD_REWARD_SONG_COUNT] = handleMsgMhfAddRewardSongCount
|
||||
handlerTable[network.MSG_MHF_GET_UD_RANKING] = handleMsgMhfGetUdRanking
|
||||
handlerTable[network.MSG_MHF_GET_UD_MY_RANKING] = handleMsgMhfGetUdMyRanking
|
||||
handlerTable[network.MSG_MHF_ACQUIRE_MONTHLY_REWARD] = handleMsgMhfAcquireMonthlyReward
|
||||
handlerTable[network.MSG_MHF_GET_UD_GUILD_MAP_INFO] = handleMsgMhfGetUdGuildMapInfo
|
||||
handlerTable[network.MSG_MHF_GENERATE_UD_GUILD_MAP] = handleMsgMhfGenerateUdGuildMap
|
||||
handlerTable[network.MSG_MHF_GET_UD_TACTICS_POINT] = handleMsgMhfGetUdTacticsPoint
|
||||
handlerTable[network.MSG_MHF_ADD_UD_TACTICS_POINT] = handleMsgMhfAddUdTacticsPoint
|
||||
handlerTable[network.MSG_MHF_GET_UD_TACTICS_RANKING] = handleMsgMhfGetUdTacticsRanking
|
||||
handlerTable[network.MSG_MHF_GET_UD_TACTICS_REWARD_LIST] = handleMsgMhfGetUdTacticsRewardList
|
||||
handlerTable[network.MSG_MHF_GET_UD_TACTICS_LOG] = handleMsgMhfGetUdTacticsLog
|
||||
handlerTable[network.MSG_MHF_GET_EQUIP_SKIN_HIST] = handleMsgMhfGetEquipSkinHist
|
||||
handlerTable[network.MSG_MHF_UPDATE_EQUIP_SKIN_HIST] = handleMsgMhfUpdateEquipSkinHist
|
||||
handlerTable[network.MSG_MHF_GET_UD_TACTICS_FOLLOWER] = handleMsgMhfGetUdTacticsFollower
|
||||
handlerTable[network.MSG_MHF_SET_UD_TACTICS_FOLLOWER] = handleMsgMhfSetUdTacticsFollower
|
||||
handlerTable[network.MSG_MHF_GET_UD_SHOP_COIN] = handleMsgMhfGetUdShopCoin
|
||||
handlerTable[network.MSG_MHF_USE_UD_SHOP_COIN] = handleMsgMhfUseUdShopCoin
|
||||
handlerTable[network.MSG_MHF_GET_ENHANCED_MINIDATA] = handleMsgMhfGetEnhancedMinidata
|
||||
handlerTable[network.MSG_MHF_SET_ENHANCED_MINIDATA] = handleMsgMhfSetEnhancedMinidata
|
||||
handlerTable[network.MSG_MHF_SEX_CHANGER] = handleMsgMhfSexChanger
|
||||
handlerTable[network.MSG_MHF_GET_LOBBY_CROWD] = handleMsgMhfGetLobbyCrowd
|
||||
handlerTable[network.MSG_SYS_reserve180] = handleMsgSysReserve180
|
||||
handlerTable[network.MSG_MHF_GUILD_HUNTDATA] = handleMsgMhfGuildHuntdata
|
||||
handlerTable[network.MSG_MHF_ADD_KOURYOU_POINT] = handleMsgMhfAddKouryouPoint
|
||||
handlerTable[network.MSG_MHF_GET_KOURYOU_POINT] = handleMsgMhfGetKouryouPoint
|
||||
handlerTable[network.MSG_MHF_EXCHANGE_KOURYOU_POINT] = handleMsgMhfExchangeKouryouPoint
|
||||
handlerTable[network.MSG_MHF_GET_UD_TACTICS_BONUS_QUEST] = handleMsgMhfGetUdTacticsBonusQuest
|
||||
handlerTable[network.MSG_MHF_GET_UD_TACTICS_FIRST_QUEST_BONUS] = handleMsgMhfGetUdTacticsFirstQuestBonus
|
||||
handlerTable[network.MSG_MHF_GET_UD_TACTICS_REMAINING_POINT] = handleMsgMhfGetUdTacticsRemainingPoint
|
||||
handlerTable[network.MSG_SYS_reserve188] = handleMsgSysReserve188
|
||||
handlerTable[network.MSG_MHF_LOAD_PLATE_MYSET] = handleMsgMhfLoadPlateMyset
|
||||
handlerTable[network.MSG_MHF_SAVE_PLATE_MYSET] = handleMsgMhfSavePlateMyset
|
||||
handlerTable[network.MSG_SYS_reserve18B] = handleMsgSysReserve18B
|
||||
handlerTable[network.MSG_MHF_GET_RESTRICTION_EVENT] = handleMsgMhfGetRestrictionEvent
|
||||
handlerTable[network.MSG_MHF_SET_RESTRICTION_EVENT] = handleMsgMhfSetRestrictionEvent
|
||||
handlerTable[network.MSG_SYS_reserve18E] = handleMsgSysReserve18E
|
||||
handlerTable[network.MSG_SYS_reserve18F] = handleMsgSysReserve18F
|
||||
handlerTable[network.MSG_MHF_GET_TREND_WEAPON] = handleMsgMhfGetTrendWeapon
|
||||
handlerTable[network.MSG_MHF_UPDATE_USE_TREND_WEAPON_LOG] = handleMsgMhfUpdateUseTrendWeaponLog
|
||||
handlerTable[network.MSG_SYS_reserve192] = handleMsgSysReserve192
|
||||
handlerTable[network.MSG_SYS_reserve193] = handleMsgSysReserve193
|
||||
handlerTable[network.MSG_SYS_reserve194] = handleMsgSysReserve194
|
||||
handlerTable[network.MSG_MHF_SAVE_RENGOKU_DATA] = handleMsgMhfSaveRengokuData
|
||||
handlerTable[network.MSG_MHF_LOAD_RENGOKU_DATA] = handleMsgMhfLoadRengokuData
|
||||
handlerTable[network.MSG_MHF_GET_RENGOKU_BINARY] = handleMsgMhfGetRengokuBinary
|
||||
handlerTable[network.MSG_MHF_ENUMERATE_RENGOKU_RANKING] = handleMsgMhfEnumerateRengokuRanking
|
||||
handlerTable[network.MSG_MHF_GET_RENGOKU_RANKING_RANK] = handleMsgMhfGetRengokuRankingRank
|
||||
handlerTable[network.MSG_MHF_ACQUIRE_EXCHANGE_SHOP] = handleMsgMhfAcquireExchangeShop
|
||||
handlerTable[network.MSG_SYS_reserve19B] = handleMsgSysReserve19B
|
||||
handlerTable[network.MSG_MHF_SAVE_MEZFES_DATA] = handleMsgMhfSaveMezfesData
|
||||
handlerTable[network.MSG_MHF_LOAD_MEZFES_DATA] = handleMsgMhfLoadMezfesData
|
||||
handlerTable[network.MSG_SYS_reserve19E] = handleMsgSysReserve19E
|
||||
handlerTable[network.MSG_SYS_reserve19F] = handleMsgSysReserve19F
|
||||
handlerTable[network.MSG_MHF_UPDATE_FORCE_GUILD_RANK] = handleMsgMhfUpdateForceGuildRank
|
||||
handlerTable[network.MSG_MHF_RESET_TITLE] = handleMsgMhfResetTitle
|
||||
handlerTable[network.MSG_SYS_reserve202] = handleMsgSysReserve202
|
||||
handlerTable[network.MSG_SYS_reserve203] = handleMsgSysReserve203
|
||||
handlerTable[network.MSG_SYS_reserve204] = handleMsgSysReserve204
|
||||
handlerTable[network.MSG_SYS_reserve205] = handleMsgSysReserve205
|
||||
handlerTable[network.MSG_SYS_reserve206] = handleMsgSysReserve206
|
||||
handlerTable[network.MSG_SYS_reserve207] = handleMsgSysReserve207
|
||||
handlerTable[network.MSG_SYS_reserve208] = handleMsgSysReserve208
|
||||
handlerTable[network.MSG_SYS_reserve209] = handleMsgSysReserve209
|
||||
handlerTable[network.MSG_SYS_reserve20A] = handleMsgSysReserve20A
|
||||
handlerTable[network.MSG_SYS_reserve20B] = handleMsgSysReserve20B
|
||||
handlerTable[network.MSG_SYS_reserve20C] = handleMsgSysReserve20C
|
||||
handlerTable[network.MSG_SYS_reserve20D] = handleMsgSysReserve20D
|
||||
handlerTable[network.MSG_SYS_reserve20E] = handleMsgSysReserve20E
|
||||
handlerTable[network.MSG_SYS_reserve20F] = handleMsgSysReserve20F
|
||||
}
|
||||
910
server/channelserver/handlers.go
Normal file
910
server/channelserver/handlers.go
Normal file
@@ -0,0 +1,910 @@
|
||||
package channelserver
|
||||
|
||||
import (
|
||||
"github.com/Andoryuuta/Erupe/network"
|
||||
"github.com/Andoryuuta/Erupe/network/mhfpacket"
|
||||
"github.com/Andoryuuta/byteframe"
|
||||
)
|
||||
|
||||
func handleMsgHead(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgSysReserve01(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgSysReserve02(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgSysReserve03(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgSysReserve04(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgSysReserve05(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgSysReserve06(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgSysReserve07(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgSysAddObject(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgSysDelObject(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgSysDispObject(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgSysHideObject(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgSysReserve0C(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgSysReserve0D(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgSysReserve0E(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgSysExtendThreshold(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgSysEnd(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgSysNop(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgSysAck(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgSysTerminalLog(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgSysLogin(s *Session, p mhfpacket.MHFPacket) {
|
||||
pkt := p.(*mhfpacket.MsgSysLogin)
|
||||
|
||||
bf := byteframe.NewByteFrame()
|
||||
bf.WriteUint16(uint16(network.MSG_SYS_ACK))
|
||||
bf.WriteUint32(pkt.AckHandle)
|
||||
bf.WriteUint64(0x000000005E00B9C2) // Timestamp?
|
||||
s.cryptConn.SendPacket(bf.Data())
|
||||
}
|
||||
|
||||
func handleMsgSysLogout(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgSysSetStatus(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgSysPing(s *Session, p mhfpacket.MHFPacket) {
|
||||
pkt := p.(*mhfpacket.MsgSysPing)
|
||||
|
||||
bf := byteframe.NewByteFrame()
|
||||
bf.WriteUint16(uint16(network.MSG_SYS_ACK))
|
||||
ack := mhfpacket.MsgSysAck{
|
||||
AckHandle: pkt.AckHandle,
|
||||
Unk0: 0,
|
||||
Unk1: 0,
|
||||
}
|
||||
ack.Build(bf)
|
||||
s.cryptConn.SendPacket(bf.Data())
|
||||
}
|
||||
|
||||
func handleMsgSysCastBinary(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgSysHideClient(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgSysTime(s *Session, p mhfpacket.MHFPacket) {
|
||||
pkt := p.(*mhfpacket.MsgSysTime)
|
||||
|
||||
bf := byteframe.NewByteFrame()
|
||||
bf.WriteUint16(uint16(network.MSG_SYS_TIME))
|
||||
resp := mhfpacket.MsgSysTime{
|
||||
Unk0: pkt.Unk0,
|
||||
Timestamp: pkt.Timestamp,
|
||||
}
|
||||
resp.Build(bf)
|
||||
s.cryptConn.SendPacket(bf.Data())
|
||||
}
|
||||
|
||||
func handleMsgSysCastedBinary(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgSysGetFile(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgSysIssueLogkey(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgSysRecordLog(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgSysEcho(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgSysCreateStage(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgSysStageDestruct(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgSysEnterStage(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgSysBackStage(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgSysMoveStage(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgSysLeaveStage(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgSysLockStage(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgSysUnlockStage(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgSysReserveStage(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgSysUnreserveStage(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgSysSetStagePass(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgSysWaitStageBinary(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgSysSetStageBinary(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgSysGetStageBinary(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgSysEnumerateClient(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgSysEnumerateStage(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgSysCreateMutex(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgSysCreateOpenMutex(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgSysDeleteMutex(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgSysOpenMutex(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgSysCloseMutex(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgSysCreateSemaphore(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgSysCreateAcquireSemaphore(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgSysDeleteSemaphore(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgSysAcquireSemaphore(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgSysReleaseSemaphore(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgSysLockGlobalSema(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgSysUnlockGlobalSema(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgSysCheckSemaphore(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgSysOperateRegister(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgSysLoadRegister(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgSysNotifyRegister(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgSysCreateObject(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgSysDeleteObject(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgSysPositionObject(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgSysRotateObject(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgSysDuplicateObject(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgSysSetObjectBinary(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgSysGetObjectBinary(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgSysGetObjectOwner(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgSysUpdateObjectBinary(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgSysCleanupObject(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgSysReserve4A(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgSysReserve4B(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgSysReserve4C(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgSysReserve4D(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgSysReserve4E(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgSysReserve4F(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgSysInsertUser(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgSysDeleteUser(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgSysSetUserBinary(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgSysGetUserBinary(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgSysNotifyUserBinary(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgSysReserve55(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgSysReserve56(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgSysReserve57(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgSysUpdateRight(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgSysAuthQuery(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgSysAuthData(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgSysAuthTerminal(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgSysReserve5C(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgSysRightsReload(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgSysReserve5E(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgSysReserve5F(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfSavedata(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfLoaddata(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfListMember(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfOprMember(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfEnumerateDistItem(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfApplyDistItem(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfAcquireDistItem(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfGetDistDescription(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfSendMail(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfReadMail(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfListMail(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfOprtMail(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfLoadFavoriteQuest(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfSaveFavoriteQuest(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfRegisterEvent(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfReleaseEvent(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfTransitMessage(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgSysReserve71(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgSysReserve72(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgSysReserve73(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgSysReserve74(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgSysReserve75(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgSysReserve76(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgSysReserve77(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgSysReserve78(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgSysReserve79(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgSysReserve7A(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgSysReserve7B(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgSysReserve7C(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgCaExchangeItem(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgSysReserve7E(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfPresentBox(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfServerCommand(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfShutClient(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfAnnounce(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfSetLoginwindow(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgSysTransBinary(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgSysCollectBinary(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgSysGetState(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgSysSerialize(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgSysEnumlobby(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgSysEnumuser(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgSysInfokyserver(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfGetCaUniqueID(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfSetCaAchievement(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfCaravanMyScore(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfCaravanRanking(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfCaravanMyRank(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfCreateGuild(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfOperateGuild(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfOperateGuildMember(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfInfoGuild(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfEnumerateGuild(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfUpdateGuild(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfArrangeGuildMember(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfEnumerateGuildMember(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfEnumerateCampaign(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfStateCampaign(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfApplyCampaign(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfEnumerateItem(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfAcquireItem(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfTransferItem(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfMercenaryHuntdata(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfEntryRookieGuild(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfEnumerateQuest(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfEnumerateEvent(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfEnumeratePrice(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfEnumerateRanking(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfEnumerateOrder(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfEnumerateShop(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfGetExtraInfo(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfUpdateInterior(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfEnumerateHouse(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfUpdateHouse(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfLoadHouse(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfOperateWarehouse(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfEnumerateWarehouse(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfUpdateWarehouse(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfAcquireTitle(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfEnumerateTitle(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfEnumerateGuildItem(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfUpdateGuildItem(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfEnumerateUnionItem(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfUpdateUnionItem(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfCreateJoint(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfOperateJoint(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfInfoJoint(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfUpdateGuildIcon(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfInfoFesta(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfEntryFesta(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfChargeFesta(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfAcquireFesta(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfStateFestaU(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfStateFestaG(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfEnumerateFestaMember(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfVoteFesta(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfAcquireCafeItem(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfUpdateCafepoint(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfCheckDailyCafepoint(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfGetCogInfo(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfCheckMonthlyItem(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfAcquireMonthlyItem(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfCheckWeeklyStamp(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfExchangeWeeklyStamp(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfCreateMercenary(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfSaveMercenary(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfReadMercenaryW(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfReadMercenaryM(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfContractMercenary(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfEnumerateMercenaryLog(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfEnumerateGuacot(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfUpdateGuacot(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfInfoTournament(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfEntryTournament(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfEnterTournamentQuest(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfAcquireTournament(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfGetAchievement(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfResetAchievement(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfAddAchievement(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfPaymentAchievement(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfDisplayedAchievement(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfInfoScenarioCounter(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfSaveScenarioData(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfLoadScenarioData(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfGetBbsSnsStatus(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfApplyBbsArticle(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfGetEtcPoints(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfUpdateEtcPoint(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfGetMyhouseInfo(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfUpdateMyhouseInfo(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfGetWeeklySchedule(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfEnumerateInvGuild(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfOperationInvGuild(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfStampcardStamp(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfStampcardPrize(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfUnreserveSrg(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfLoadPlateData(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfSavePlateData(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfLoadPlateBox(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfSavePlateBox(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfReadGuildcard(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfUpdateGuildcard(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfReadBeatLevel(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfUpdateBeatLevel(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfReadBeatLevelAllRanking(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfReadBeatLevelMyRanking(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfReadLastWeekBeatRanking(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfAcceptReadReward(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfGetAdditionalBeatReward(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfGetFixedSeibatuRankingTable(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfGetBbsUserStatus(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfKickExportForce(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfGetBreakSeibatuLevelReward(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfGetWeeklySeibatuRankingReward(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfGetEarthStatus(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfLoadPartner(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfSavePartner(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfGetGuildMissionList(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfGetGuildMissionRecord(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfAddGuildMissionCount(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfSetGuildMissionTarget(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfCancelGuildMissionTarget(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfLoadOtomoAirou(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfSaveOtomoAirou(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfEnumerateGuildTresure(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfEnumerateAiroulist(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfRegistGuildTresure(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfAcquireGuildTresure(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfOperateGuildTresureReport(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfGetGuildTresureSouvenir(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfAcquireGuildTresureSouvenir(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfEnumerateFestaIntermediatePrize(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfAcquireFestaIntermediatePrize(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfLoadDecoMyset(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfSaveDecoMyset(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfReserve010F(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfLoadGuildCooking(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfRegistGuildCooking(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfLoadGuildAdventure(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfRegistGuildAdventure(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfAcquireGuildAdventure(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfChargeGuildAdventure(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfLoadLegendDispatch(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfLoadHunterNavi(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfSaveHunterNavi(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfRegistSpabiTime(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfGetGuildWeeklyBonusMaster(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfGetGuildWeeklyBonusActiveCount(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfAddGuildWeeklyBonusExceptionalUser(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfGetTowerInfo(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfPostTowerInfo(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfGetGemInfo(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfPostGemInfo(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfGetEarthValue(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfDebugPostValue(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfGetPaperData(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfGetNotice(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfPostNotice(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfGetBoostTime(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfPostBoostTime(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfGetBoostTimeLimit(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfPostBoostTimeLimit(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfEnumerateFestaPersonalPrize(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfAcquireFestaPersonalPrize(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfGetRandFromTable(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfGetCafeDuration(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfGetCafeDurationBonusInfo(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfReceiveCafeDurationBonus(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfPostCafeDurationBonusReceived(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfGetGachaPoint(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfUseGachaPoint(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfExchangeFpoint2Item(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfExchangeItem2Fpoint(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfGetFpointExchangeList(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfPlayStepupGacha(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfReceiveGachaItem(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfGetStepupStatus(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfPlayFreeGacha(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfGetTinyBin(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfPostTinyBin(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfGetSenyuDailyCount(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfGetGuildTargetMemberNum(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfGetBoostRight(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfStartBoostTime(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfPostBoostTimeQuestReturn(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfGetBoxGachaInfo(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfPlayBoxGacha(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfResetBoxGachaInfo(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfGetSeibattle(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfPostSeibattle(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfGetRyoudama(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfPostRyoudama(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfGetTenrouirai(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfPostTenrouirai(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfPostGuildScout(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfCancelGuildScout(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfAnswerGuildScout(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfGetGuildScoutList(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfGetGuildManageRight(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfSetGuildManageRight(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfPlayNormalGacha(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfGetDailyMissionMaster(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfGetDailyMissionPersonal(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfSetDailyMissionPersonal(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfGetGachaPlayHistory(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfGetRejectGuildScout(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfSetRejectGuildScout(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfGetCaAchievementHist(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfSetCaAchievementHist(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfGetKeepLoginBoostStatus(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfUseKeepLoginBoost(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfGetUdSchedule(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfGetUdInfo(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfGetKijuInfo(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfSetKiju(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfAddUdPoint(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfGetUdMyPoint(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfGetUdTotalPointInfo(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfGetUdBonusQuestInfo(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfGetUdSelectedColorInfo(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfGetUdMonsterPoint(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfGetUdDailyPresentList(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfGetUdNormaPresentList(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfGetUdRankingRewardList(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfAcquireUdItem(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfGetRewardSong(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfUseRewardSong(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfAddRewardSongCount(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfGetUdRanking(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfGetUdMyRanking(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfAcquireMonthlyReward(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfGetUdGuildMapInfo(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfGenerateUdGuildMap(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfGetUdTacticsPoint(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfAddUdTacticsPoint(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfGetUdTacticsRanking(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfGetUdTacticsRewardList(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfGetUdTacticsLog(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfGetEquipSkinHist(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfUpdateEquipSkinHist(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfGetUdTacticsFollower(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfSetUdTacticsFollower(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfGetUdShopCoin(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfUseUdShopCoin(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfGetEnhancedMinidata(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfSetEnhancedMinidata(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfSexChanger(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfGetLobbyCrowd(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgSysReserve180(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfGuildHuntdata(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfAddKouryouPoint(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfGetKouryouPoint(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfExchangeKouryouPoint(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfGetUdTacticsBonusQuest(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfGetUdTacticsFirstQuestBonus(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfGetUdTacticsRemainingPoint(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgSysReserve188(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfLoadPlateMyset(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfSavePlateMyset(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgSysReserve18B(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfGetRestrictionEvent(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfSetRestrictionEvent(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgSysReserve18E(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgSysReserve18F(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfGetTrendWeapon(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfUpdateUseTrendWeaponLog(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgSysReserve192(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgSysReserve193(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgSysReserve194(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfSaveRengokuData(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfLoadRengokuData(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfGetRengokuBinary(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfEnumerateRengokuRanking(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfGetRengokuRankingRank(s *Session, p mhfpacket.MHFPacket) {
|
||||
pkt := p.(*mhfpacket.MsgMhfGetRengokuRankingRank)
|
||||
|
||||
bf := byteframe.NewByteFrame()
|
||||
bf.WriteUint16(uint16(network.MSG_SYS_ACK))
|
||||
bf.WriteUint32(pkt.AckHandle)
|
||||
bf.WriteBytes([]byte{0x01, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00})
|
||||
s.cryptConn.SendPacket(bf.Data())
|
||||
}
|
||||
|
||||
func handleMsgMhfAcquireExchangeShop(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgSysReserve19B(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfSaveMezfesData(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfLoadMezfesData(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgSysReserve19E(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgSysReserve19F(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfUpdateForceGuildRank(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgMhfResetTitle(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgSysReserve202(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgSysReserve203(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgSysReserve204(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgSysReserve205(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgSysReserve206(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgSysReserve207(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgSysReserve208(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgSysReserve209(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgSysReserve20A(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgSysReserve20B(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgSysReserve20C(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgSysReserve20D(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgSysReserve20E(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
func handleMsgSysReserve20F(s *Session, p mhfpacket.MHFPacket) {}
|
||||
433
server/channelserver/session.go
Normal file
433
server/channelserver/session.go
Normal file
@@ -0,0 +1,433 @@
|
||||
package channelserver
|
||||
|
||||
import (
|
||||
"encoding/hex"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"net"
|
||||
"sync"
|
||||
|
||||
"github.com/Andoryuuta/Erupe/network"
|
||||
"github.com/Andoryuuta/Erupe/network/mhfpacket"
|
||||
"github.com/Andoryuuta/byteframe"
|
||||
)
|
||||
|
||||
// Session holds state for the channel server connection.
|
||||
type Session struct {
|
||||
sync.Mutex
|
||||
server *Server
|
||||
rawConn net.Conn
|
||||
cryptConn *network.CryptConn
|
||||
}
|
||||
|
||||
// NewSession creates a new Session type.
|
||||
func NewSession(server *Server, conn net.Conn) *Session {
|
||||
s := &Session{
|
||||
server: server,
|
||||
rawConn: conn,
|
||||
cryptConn: network.NewCryptConn(conn),
|
||||
}
|
||||
return s
|
||||
}
|
||||
|
||||
// Start starts the session packet read&handle loop.
|
||||
func (s *Session) Start() {
|
||||
go func() {
|
||||
fmt.Println("Channel server got connection!")
|
||||
// Unlike the sign and entrance server,
|
||||
// the client DOES NOT initalize the channel connection with 8 NULL bytes.
|
||||
|
||||
for {
|
||||
pkt, err := s.cryptConn.ReadPacket()
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
fmt.Println("Error on channel server readpacket")
|
||||
return
|
||||
}
|
||||
|
||||
s.handlePacketGroup(pkt)
|
||||
|
||||
}
|
||||
}()
|
||||
}
|
||||
|
||||
var loadDataCount int
|
||||
var getPaperDataCount int
|
||||
|
||||
func (s *Session) handlePacketGroup(pktGroup []byte) {
|
||||
defer func() {
|
||||
if r := recover(); r != nil {
|
||||
fmt.Println("Recovered from panic.")
|
||||
}
|
||||
}()
|
||||
|
||||
bf := byteframe.NewByteFrameFromBytes(pktGroup)
|
||||
opcode := network.PacketID(bf.ReadUint16())
|
||||
|
||||
if opcode != network.MSG_SYS_END {
|
||||
fmt.Printf("Opcode: %s\n", opcode)
|
||||
fmt.Printf("Data:\n%s\n", hex.Dump(pktGroup))
|
||||
}
|
||||
|
||||
switch opcode {
|
||||
case network.MSG_MHF_ENUMERATE_EVENT:
|
||||
fallthrough
|
||||
case network.MSG_MHF_ENUMERATE_QUEST:
|
||||
fallthrough
|
||||
case network.MSG_MHF_ENUMERATE_RANKING:
|
||||
fallthrough
|
||||
case network.MSG_MHF_READ_MERCENARY_W:
|
||||
fallthrough
|
||||
case network.MSG_MHF_GET_ETC_POINTS:
|
||||
fallthrough
|
||||
case network.MSG_MHF_READ_GUILDCARD:
|
||||
fallthrough
|
||||
case network.MSG_MHF_READ_BEAT_LEVEL:
|
||||
fallthrough
|
||||
case network.MSG_MHF_GET_EARTH_STATUS:
|
||||
fallthrough
|
||||
case network.MSG_MHF_GET_EARTH_VALUE:
|
||||
fallthrough
|
||||
case network.MSG_MHF_GET_WEEKLY_SCHEDULE:
|
||||
fallthrough
|
||||
case network.MSG_MHF_LIST_MEMBER:
|
||||
fallthrough
|
||||
case network.MSG_MHF_LOAD_PLATE_DATA:
|
||||
fallthrough
|
||||
case network.MSG_MHF_LOAD_PLATE_BOX:
|
||||
fallthrough
|
||||
case network.MSG_MHF_LOAD_FAVORITE_QUEST:
|
||||
fallthrough
|
||||
case network.MSG_MHF_LOAD_PARTNER:
|
||||
fallthrough
|
||||
case network.MSG_MHF_GET_TOWER_INFO:
|
||||
fallthrough
|
||||
case network.MSG_MHF_LOAD_OTOMO_AIROU:
|
||||
fallthrough
|
||||
case network.MSG_MHF_LOAD_DECO_MYSET:
|
||||
fallthrough
|
||||
case network.MSG_MHF_LOAD_HUNTER_NAVI:
|
||||
fallthrough
|
||||
case network.MSG_MHF_GET_UD_SCHEDULE:
|
||||
fallthrough
|
||||
case network.MSG_MHF_GET_UD_INFO:
|
||||
fallthrough
|
||||
case network.MSG_MHF_GET_UD_MONSTER_POINT:
|
||||
fallthrough
|
||||
case network.MSG_MHF_GET_RAND_FROM_TABLE:
|
||||
fallthrough
|
||||
case network.MSG_MHF_ACQUIRE_MONTHLY_REWARD:
|
||||
fallthrough
|
||||
case network.MSG_MHF_LOAD_PLATE_MYSET:
|
||||
fallthrough
|
||||
case network.MSG_MHF_LOAD_RENGOKU_DATA:
|
||||
fallthrough
|
||||
case network.MSG_MHF_ENUMERATE_SHOP:
|
||||
fallthrough
|
||||
case network.MSG_MHF_LOAD_SCENARIO_DATA:
|
||||
fallthrough
|
||||
case network.MSG_MHF_GET_BOOST_TIME_LIMIT:
|
||||
fallthrough
|
||||
case network.MSG_MHF_GET_BOOST_RIGHT:
|
||||
fallthrough
|
||||
case network.MSG_MHF_GET_REWARD_SONG:
|
||||
fallthrough
|
||||
case network.MSG_MHF_GET_GACHA_POINT:
|
||||
fallthrough
|
||||
case network.MSG_MHF_GET_KOURYOU_POINT:
|
||||
fallthrough
|
||||
case network.MSG_MHF_GET_ENHANCED_MINIDATA:
|
||||
|
||||
ackHandle := bf.ReadUint32()
|
||||
|
||||
data, err := ioutil.ReadFile(fmt.Sprintf("bin_resp/%s_resp.bin", opcode.String()))
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
bfw := byteframe.NewByteFrame()
|
||||
bfw.WriteUint16(uint16(network.MSG_SYS_ACK))
|
||||
bfw.WriteUint32(ackHandle)
|
||||
bfw.WriteBytes(data)
|
||||
s.cryptConn.SendPacket(bfw.Data())
|
||||
|
||||
case network.MSG_MHF_INFO_FESTA:
|
||||
ackHandle := bf.ReadUint32()
|
||||
_ = bf.ReadUint32()
|
||||
|
||||
data, err := ioutil.ReadFile(fmt.Sprintf("bin_resp/%s_resp.bin", opcode.String()))
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
bfw := byteframe.NewByteFrame()
|
||||
bfw.WriteUint16(uint16(network.MSG_SYS_ACK))
|
||||
bfw.WriteUint32(ackHandle)
|
||||
bfw.WriteBytes(data)
|
||||
s.cryptConn.SendPacket(bfw.Data())
|
||||
|
||||
case network.MSG_MHF_LOADDATA:
|
||||
ackHandle := bf.ReadUint32()
|
||||
|
||||
data, err := ioutil.ReadFile(fmt.Sprintf("bin_resp/%s_resp%d.bin", opcode.String(), loadDataCount))
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
bfw := byteframe.NewByteFrame()
|
||||
bfw.WriteUint16(uint16(network.MSG_SYS_ACK))
|
||||
bfw.WriteUint32(ackHandle)
|
||||
bfw.WriteBytes(data)
|
||||
s.cryptConn.SendPacket(bfw.Data())
|
||||
|
||||
loadDataCount++
|
||||
if loadDataCount > 1 {
|
||||
loadDataCount = 0
|
||||
}
|
||||
case network.MSG_MHF_GET_PAPER_DATA:
|
||||
ackHandle := bf.ReadUint32()
|
||||
|
||||
data, err := ioutil.ReadFile(fmt.Sprintf("bin_resp/%s_resp%d.bin", opcode.String(), getPaperDataCount))
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
bfw := byteframe.NewByteFrame()
|
||||
bfw.WriteUint16(uint16(network.MSG_SYS_ACK))
|
||||
bfw.WriteUint32(ackHandle)
|
||||
bfw.WriteBytes(data)
|
||||
s.cryptConn.SendPacket(bfw.Data())
|
||||
|
||||
getPaperDataCount++
|
||||
if getPaperDataCount > 7 {
|
||||
getPaperDataCount = 0
|
||||
}
|
||||
default:
|
||||
// Get the packet parser and handler for this opcode.
|
||||
mhfPkt := mhfpacket.FromOpcode(opcode)
|
||||
if mhfPkt == nil {
|
||||
fmt.Println("Got opcode which we don't know how to parse, can't parse anymore for this group")
|
||||
return
|
||||
}
|
||||
|
||||
// Parse and handle the packet
|
||||
mhfPkt.Parse(bf)
|
||||
handlerTable[opcode](s, mhfPkt)
|
||||
break
|
||||
}
|
||||
|
||||
// If there is more data on the stream that the .Parse method didn't read, then read another packet off it.
|
||||
remainingData := bf.DataFromCurrent()
|
||||
if len(remainingData) >= 2 && (opcode == network.MSG_SYS_TIME || opcode == network.MSG_MHF_INFO_FESTA || opcode == network.MSG_SYS_EXTEND_THRESHOLD) {
|
||||
s.handlePacketGroup(remainingData)
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
func handlePacket(cc *network.CryptConn, pkt []byte) {
|
||||
defer func() {
|
||||
if r := recover(); r != nil {
|
||||
fmt.Println("Recovered from panic.")
|
||||
}
|
||||
}()
|
||||
|
||||
bf := byteframe.NewByteFrameFromBytes(pkt)
|
||||
opcode := network.PacketID(bf.ReadUint16())
|
||||
|
||||
if opcode == network.MSG_SYS_EXTEND_THRESHOLD {
|
||||
opcode = network.PacketID(bf.ReadUint16())
|
||||
}
|
||||
|
||||
fmt.Printf("Opcode: %s\n", opcode)
|
||||
switch opcode {
|
||||
case network.MSG_SYS_PING:
|
||||
ackHandle := bf.ReadUint32()
|
||||
_ = bf.ReadUint16()
|
||||
|
||||
bfw := byteframe.NewByteFrame()
|
||||
bfw.WriteUint16(uint16(network.MSG_SYS_ACK))
|
||||
bfw.WriteUint32(ackHandle)
|
||||
bfw.WriteUint32(0)
|
||||
bfw.WriteUint32(0)
|
||||
cc.SendPacket(bfw.Data())
|
||||
case network.MSG_SYS_TIME:
|
||||
_ = bf.ReadUint8()
|
||||
timestamp := bf.ReadUint32() // unix timestamp, e.g. 1577105879
|
||||
|
||||
bfw := byteframe.NewByteFrame()
|
||||
bfw.WriteUint16(uint16(network.MSG_SYS_TIME))
|
||||
bfw.WriteUint8(0)
|
||||
bfw.WriteUint32(timestamp)
|
||||
cc.SendPacket(bfw.Data())
|
||||
case network.MSG_SYS_LOGIN:
|
||||
ackHandle := bf.ReadUint32()
|
||||
charID0 := bf.ReadUint32()
|
||||
loginTokenNumber := bf.ReadUint32()
|
||||
hardcodedZero0 := bf.ReadUint16()
|
||||
requestVersion := bf.ReadUint16()
|
||||
charID1 := bf.ReadUint32()
|
||||
hardcodedZero1 := bf.ReadUint16()
|
||||
loginTokenLength := bf.ReadUint16() // hardcoded to 0x11
|
||||
loginTokenString := bf.ReadBytes(17)
|
||||
|
||||
_ = ackHandle
|
||||
_ = charID0
|
||||
_ = loginTokenNumber
|
||||
_ = hardcodedZero0
|
||||
_ = requestVersion
|
||||
_ = charID1
|
||||
_ = hardcodedZero1
|
||||
_ = loginTokenLength
|
||||
_ = loginTokenString
|
||||
|
||||
bfw := byteframe.NewByteFrame()
|
||||
bfw.WriteUint16(uint16(network.MSG_SYS_ACK))
|
||||
bfw.WriteUint32(ackHandle)
|
||||
bfw.WriteUint64(0x000000005E00B9C2) // Timestamp?
|
||||
cc.SendPacket(bfw.Data())
|
||||
|
||||
case network.MSG_MHF_ENUMERATE_EVENT:
|
||||
fallthrough
|
||||
case network.MSG_MHF_ENUMERATE_QUEST:
|
||||
fallthrough
|
||||
case network.MSG_MHF_ENUMERATE_RANKING:
|
||||
fallthrough
|
||||
case network.MSG_MHF_READ_MERCENARY_W:
|
||||
fallthrough
|
||||
case network.MSG_MHF_GET_ETC_POINTS:
|
||||
fallthrough
|
||||
case network.MSG_MHF_READ_GUILDCARD:
|
||||
fallthrough
|
||||
case network.MSG_MHF_READ_BEAT_LEVEL:
|
||||
fallthrough
|
||||
case network.MSG_MHF_GET_EARTH_STATUS:
|
||||
fallthrough
|
||||
case network.MSG_MHF_GET_EARTH_VALUE:
|
||||
fallthrough
|
||||
case network.MSG_MHF_GET_WEEKLY_SCHEDULE:
|
||||
fallthrough
|
||||
case network.MSG_MHF_LIST_MEMBER:
|
||||
fallthrough
|
||||
case network.MSG_MHF_LOAD_PLATE_DATA:
|
||||
fallthrough
|
||||
case network.MSG_MHF_LOAD_PLATE_BOX:
|
||||
fallthrough
|
||||
case network.MSG_MHF_LOAD_FAVORITE_QUEST:
|
||||
fallthrough
|
||||
case network.MSG_MHF_LOAD_PARTNER:
|
||||
fallthrough
|
||||
case network.MSG_MHF_GET_TOWER_INFO:
|
||||
fallthrough
|
||||
case network.MSG_MHF_LOAD_OTOMO_AIROU:
|
||||
fallthrough
|
||||
case network.MSG_MHF_LOAD_DECO_MYSET:
|
||||
fallthrough
|
||||
case network.MSG_MHF_LOAD_HUNTER_NAVI:
|
||||
fallthrough
|
||||
case network.MSG_MHF_GET_UD_SCHEDULE:
|
||||
fallthrough
|
||||
case network.MSG_MHF_GET_UD_INFO:
|
||||
fallthrough
|
||||
case network.MSG_MHF_GET_UD_MONSTER_POINT:
|
||||
fallthrough
|
||||
case network.MSG_MHF_GET_RAND_FROM_TABLE:
|
||||
fallthrough
|
||||
case network.MSG_MHF_ACQUIRE_MONTHLY_REWARD:
|
||||
fallthrough
|
||||
case network.MSG_MHF_GET_RENGOKU_RANKING_RANK:
|
||||
fallthrough
|
||||
case network.MSG_MHF_LOAD_PLATE_MYSET:
|
||||
fallthrough
|
||||
case network.MSG_MHF_LOAD_RENGOKU_DATA:
|
||||
fallthrough
|
||||
case network.MSG_MHF_ENUMERATE_SHOP:
|
||||
fallthrough
|
||||
case network.MSG_MHF_LOAD_SCENARIO_DATA:
|
||||
fallthrough
|
||||
case network.MSG_MHF_GET_BOOST_TIME_LIMIT:
|
||||
fallthrough
|
||||
case network.MSG_MHF_GET_BOOST_RIGHT:
|
||||
fallthrough
|
||||
case network.MSG_MHF_GET_REWARD_SONG:
|
||||
fallthrough
|
||||
case network.MSG_MHF_GET_GACHA_POINT:
|
||||
fallthrough
|
||||
case network.MSG_MHF_GET_KOURYOU_POINT:
|
||||
fallthrough
|
||||
case network.MSG_MHF_GET_ENHANCED_MINIDATA:
|
||||
|
||||
ackHandle := bf.ReadUint32()
|
||||
|
||||
data, err := ioutil.ReadFile(fmt.Sprintf("bin_resp/%s_resp.bin", opcode.String()))
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
bfw := byteframe.NewByteFrame()
|
||||
bfw.WriteUint16(uint16(network.MSG_SYS_ACK))
|
||||
bfw.WriteUint32(ackHandle)
|
||||
bfw.WriteBytes(data)
|
||||
cc.SendPacket(bfw.Data())
|
||||
|
||||
case network.MSG_MHF_INFO_FESTA:
|
||||
ackHandle := bf.ReadUint32()
|
||||
_ = bf.ReadUint32()
|
||||
|
||||
data, err := ioutil.ReadFile(fmt.Sprintf("bin_resp/%s_resp.bin", opcode.String()))
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
bfw := byteframe.NewByteFrame()
|
||||
bfw.WriteUint16(uint16(network.MSG_SYS_ACK))
|
||||
bfw.WriteUint32(ackHandle)
|
||||
bfw.WriteBytes(data)
|
||||
cc.SendPacket(bfw.Data())
|
||||
|
||||
case network.MSG_MHF_LOADDATA:
|
||||
ackHandle := bf.ReadUint32()
|
||||
|
||||
data, err := ioutil.ReadFile(fmt.Sprintf("bin_resp/%s_resp%d.bin", opcode.String(), loadDataCount))
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
bfw := byteframe.NewByteFrame()
|
||||
bfw.WriteUint16(uint16(network.MSG_SYS_ACK))
|
||||
bfw.WriteUint32(ackHandle)
|
||||
bfw.WriteBytes(data)
|
||||
cc.SendPacket(bfw.Data())
|
||||
|
||||
loadDataCount++
|
||||
if loadDataCount > 1 {
|
||||
loadDataCount = 0
|
||||
}
|
||||
case network.MSG_MHF_GET_PAPER_DATA:
|
||||
ackHandle := bf.ReadUint32()
|
||||
|
||||
data, err := ioutil.ReadFile(fmt.Sprintf("bin_resp/%s_resp%d.bin", opcode.String(), getPaperDataCount))
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
bfw := byteframe.NewByteFrame()
|
||||
bfw.WriteUint16(uint16(network.MSG_SYS_ACK))
|
||||
bfw.WriteUint32(ackHandle)
|
||||
bfw.WriteBytes(data)
|
||||
cc.SendPacket(bfw.Data())
|
||||
|
||||
getPaperDataCount++
|
||||
if getPaperDataCount > 7 {
|
||||
getPaperDataCount = 0
|
||||
}
|
||||
default:
|
||||
fmt.Printf("Data:\n%s\n", hex.Dump(pkt))
|
||||
break
|
||||
}
|
||||
|
||||
remainingData := bf.DataFromCurrent()
|
||||
if len(remainingData) >= 2 && (opcode == network.MSG_SYS_TIME || opcode == network.MSG_MHF_INFO_FESTA) {
|
||||
handlePacket(cc, remainingData)
|
||||
}
|
||||
}
|
||||
*/
|
||||
57
server/entranceserver/crypto.go
Normal file
57
server/entranceserver/crypto.go
Normal file
@@ -0,0 +1,57 @@
|
||||
package entranceserver
|
||||
|
||||
import (
|
||||
"encoding/binary"
|
||||
)
|
||||
|
||||
var (
|
||||
_bin8Key = []byte{0x01, 0x23, 0x34, 0x45, 0x56, 0xAB, 0xCD, 0xEF}
|
||||
_sum32Table0 = []byte{0x7A, 0xAA, 0x97, 0x53, 0x66, 0x12, 0xDE, 0xDE, 0x35}
|
||||
_sum32Table1 = []byte{0x35, 0x7A, 0xAA, 0x97, 0x53, 0x66, 0x12}
|
||||
)
|
||||
|
||||
// CalcSum32 calculates the custom MHF "sum32" checksum of the given data.
|
||||
func CalcSum32(data []byte) uint32 {
|
||||
tableIdx0 := byte(len(data) & 0xFF)
|
||||
tableIdx1 := byte(data[len(data)>>1])
|
||||
|
||||
out := make([]byte, 4)
|
||||
for i := 0; i < len(data); i++ {
|
||||
tableIdx0++
|
||||
tableIdx1++
|
||||
|
||||
tmp := byte((_sum32Table0[tableIdx1%9] ^ _sum32Table1[tableIdx0%7]) ^ data[i])
|
||||
out[i&3] = (out[i&3] + tmp) & 0xFF
|
||||
|
||||
}
|
||||
|
||||
return binary.BigEndian.Uint32(out)
|
||||
}
|
||||
|
||||
// EncryptBin8 encrypts the given data using MHF's "binary8" encryption.
|
||||
func EncryptBin8(data []byte, key byte) []byte {
|
||||
curKey := uint32(((54323 * uint(key)) + 1) & 0xFFFFFFFF)
|
||||
|
||||
var output []byte
|
||||
for i := 0; i < len(data); i++ {
|
||||
tmp := (_bin8Key[i&7] ^ byte((curKey>>13)&0xFF))
|
||||
output = append(output, data[i]^tmp)
|
||||
curKey = uint32(((54323 * uint(curKey)) + 1) & 0xFFFFFFFF)
|
||||
}
|
||||
|
||||
return output
|
||||
}
|
||||
|
||||
// DecryptBin8 decrypts the given MHF "binary8" data.
|
||||
func DecryptBin8(data []byte, key byte) []byte {
|
||||
curKey := uint32(((54323 * uint(key)) + 1) & 0xFFFFFFFF)
|
||||
|
||||
var output []byte
|
||||
for i := 0; i < len(data); i++ {
|
||||
tmp := (data[i] ^ byte((curKey>>13)&0xFF))
|
||||
output = append(output, tmp^_bin8Key[i&7])
|
||||
curKey = uint32(((54323 * uint(curKey)) + 1) & 0xFFFFFFFF)
|
||||
}
|
||||
|
||||
return output
|
||||
}
|
||||
73
server/entranceserver/crypto_test.go
Normal file
73
server/entranceserver/crypto_test.go
Normal file
@@ -0,0 +1,73 @@
|
||||
package entranceserver
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/hex"
|
||||
"fmt"
|
||||
"testing"
|
||||
)
|
||||
|
||||
var tests = []struct {
|
||||
data []byte
|
||||
sum uint32
|
||||
encryptedData []byte
|
||||
encryptionKey byte
|
||||
}{
|
||||
{
|
||||
[]byte{0x4C, 0x6F, 0x72, 0x65, 0x6D, 0x20},
|
||||
0xAE6CA2C,
|
||||
[]byte{0x7E, 0x4C, 0x1D, 0x16, 0x9D, 0x46},
|
||||
0x55,
|
||||
},
|
||||
{
|
||||
[]byte{0x69, 0x70, 0x73, 0x75, 0x6D, 0x20, 0x64, 0x6F, 0x6C, 0x6F, 0x72, 0x20, 0x73, 0x69, 0x74, 0x20, 0x61, 0x6D, 0x65, 0x74, 0x2C, 0x20},
|
||||
0xCE5F1E96,
|
||||
[]byte{0x41, 0x65, 0xFF, 0x74, 0x64, 0x45, 0xB8, 0xB1, 0x18, 0xB0, 0x94, 0xA3, 0xF8, 0xD, 0xBF, 0x3C, 0xC8, 0x24, 0xE2, 0xEC, 0x3B, 0xCE},
|
||||
0x7A,
|
||||
},
|
||||
{
|
||||
[]byte{0x63, 0x6F, 0x6E, 0x73, 0x65, 0x63, 0x74, 0x65, 0x74, 0x75, 0x72, 0x20, 0x61, 0x64, 0x69, 0x70, 0x69, 0x73, 0x63, 0x69, 0x6E, 0x67, 0x20, 0x65, 0x6C, 0x69, 0x74, 0x2C, 0x20},
|
||||
0xF3EECEBB,
|
||||
[]byte{0xE, 0xBB, 0x19, 0xA5, 0xB9, 0x34, 0xFE, 0x51, 0x0, 0x61, 0x2D, 0x38, 0xB2, 0x98, 0xC2, 0xE0, 0x17, 0xDE, 0x6E, 0xE3, 0x6C, 0x1E, 0x19, 0xB6, 0x8C, 0x57, 0x32, 0x32, 0xD8},
|
||||
0xF8,
|
||||
},
|
||||
}
|
||||
|
||||
func TestSum32(t *testing.T) {
|
||||
for k, test := range tests {
|
||||
testname := fmt.Sprintf("sum32_test_%d", k)
|
||||
t.Run(testname, func(t *testing.T) {
|
||||
gotSum := CalcSum32(test.data)
|
||||
|
||||
if gotSum != test.sum {
|
||||
t.Errorf("got sum32 0x%X, want 0x%X", gotSum, test.sum)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func TestEncryptBin8(t *testing.T) {
|
||||
for k, test := range tests {
|
||||
testname := fmt.Sprintf("encrypt_bin8_test_%d", k)
|
||||
t.Run(testname, func(t *testing.T) {
|
||||
gotEncData := EncryptBin8(test.data, test.encryptionKey)
|
||||
|
||||
if !bytes.Equal(gotEncData, test.encryptedData) {
|
||||
t.Errorf("got\n\t%s\nwant\n\t%s", hex.Dump(gotEncData), hex.Dump(test.encryptedData))
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func TestDecryptBin8(t *testing.T) {
|
||||
for k, test := range tests {
|
||||
testname := fmt.Sprintf("decrypt_bin8_test_%d", k)
|
||||
t.Run(testname, func(t *testing.T) {
|
||||
gotDecData := DecryptBin8(test.encryptedData, test.encryptionKey)
|
||||
|
||||
if !bytes.Equal(gotDecData, test.data) {
|
||||
t.Errorf("got\n\t%s\nwant\n\t%s", hex.Dump(gotDecData), hex.Dump(test.data))
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
120
server/entranceserver/entrance_server.go
Normal file
120
server/entranceserver/entrance_server.go
Normal file
@@ -0,0 +1,120 @@
|
||||
package entranceserver
|
||||
|
||||
import (
|
||||
"database/sql"
|
||||
"encoding/hex"
|
||||
"fmt"
|
||||
"io"
|
||||
"net"
|
||||
"sync"
|
||||
|
||||
"github.com/Andoryuuta/Erupe/config"
|
||||
"github.com/Andoryuuta/Erupe/network"
|
||||
"go.uber.org/zap"
|
||||
)
|
||||
|
||||
// Server is a MHF entrance server.
|
||||
type Server struct {
|
||||
sync.Mutex
|
||||
logger *zap.Logger
|
||||
erupeConfig *config.Config
|
||||
db *sql.DB
|
||||
listener net.Listener
|
||||
isShuttingDown bool
|
||||
}
|
||||
|
||||
// Config struct allows configuring the server.
|
||||
type Config struct {
|
||||
Logger *zap.Logger
|
||||
DB *sql.DB
|
||||
ErupeConfig *config.Config
|
||||
}
|
||||
|
||||
// NewServer creates a new Server type.
|
||||
func NewServer(config *Config) *Server {
|
||||
s := &Server{
|
||||
logger: config.Logger,
|
||||
erupeConfig: config.ErupeConfig,
|
||||
db: config.DB,
|
||||
}
|
||||
return s
|
||||
}
|
||||
|
||||
// Start starts the server in a new goroutine.
|
||||
func (s *Server) Start() error {
|
||||
|
||||
l, err := net.Listen("tcp", fmt.Sprintf(":%d", s.erupeConfig.Entrance.Port))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
s.listener = l
|
||||
|
||||
go s.acceptClients()
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// Shutdown exits the server gracefully.
|
||||
func (s *Server) Shutdown() {
|
||||
s.logger.Debug("Shutting down")
|
||||
|
||||
s.Lock()
|
||||
s.isShuttingDown = true
|
||||
s.Unlock()
|
||||
|
||||
// This will cause the acceptor goroutine to error and exit gracefully.
|
||||
s.listener.Close()
|
||||
}
|
||||
|
||||
//acceptClients handles accepting new clients in a loop.
|
||||
func (s *Server) acceptClients() {
|
||||
for {
|
||||
conn, err := s.listener.Accept()
|
||||
if err != nil {
|
||||
// Check if we are shutting down and exit gracefully if so.
|
||||
s.Lock()
|
||||
shutdown := s.isShuttingDown
|
||||
s.Unlock()
|
||||
|
||||
if shutdown {
|
||||
break
|
||||
} else {
|
||||
continue
|
||||
}
|
||||
}
|
||||
|
||||
// Start a new goroutine for the connection so that we don't block other incoming connections.
|
||||
go s.handleEntranceServerConnection(conn)
|
||||
}
|
||||
}
|
||||
|
||||
func (s *Server) handleEntranceServerConnection(conn net.Conn) {
|
||||
// Client initalizes the connection with a one-time buffer of 8 NULL bytes.
|
||||
nullInit := make([]byte, 8)
|
||||
n, err := io.ReadFull(conn, nullInit)
|
||||
if err != nil {
|
||||
s.logger.Warn("Failed to read 8 NULL init", zap.Error(err))
|
||||
return
|
||||
} else if n != len(nullInit) {
|
||||
s.logger.Warn("io.ReadFull couldn't read the full 8 byte init.")
|
||||
return
|
||||
}
|
||||
|
||||
// Create a new encrypted connection handler and read a packet from it.
|
||||
cc := network.NewCryptConn(conn)
|
||||
pkt, err := cc.ReadPacket()
|
||||
if err != nil {
|
||||
s.logger.Warn("Error reading packet", zap.Error(err))
|
||||
return
|
||||
}
|
||||
|
||||
s.logger.Debug("Got entrance server command:\n", zap.String("raw", hex.Dump(pkt)))
|
||||
|
||||
data := makeResp(s.erupeConfig.Entrance.Entries)
|
||||
cc.SendPacket(data)
|
||||
|
||||
// Close because we only need to send the response once.
|
||||
// Any further requests from the client will come from a new connection.
|
||||
conn.Close()
|
||||
}
|
||||
86
server/entranceserver/make_resp.go
Normal file
86
server/entranceserver/make_resp.go
Normal file
@@ -0,0 +1,86 @@
|
||||
package entranceserver
|
||||
|
||||
import (
|
||||
"encoding/binary"
|
||||
"net"
|
||||
|
||||
"github.com/Andoryuuta/Erupe/config"
|
||||
"github.com/Andoryuuta/byteframe"
|
||||
)
|
||||
|
||||
func paddedString(x string, size uint) []byte {
|
||||
out := make([]byte, size)
|
||||
copy(out, x)
|
||||
|
||||
// Null terminate it.
|
||||
out[len(out)-1] = 0
|
||||
return out
|
||||
}
|
||||
|
||||
func encodeServerInfo(serverInfos []config.EntranceServerInfo) []byte {
|
||||
bf := byteframe.NewByteFrame()
|
||||
|
||||
for serverIdx, si := range serverInfos {
|
||||
bf.WriteUint32(binary.LittleEndian.Uint32(net.ParseIP(si.IP).To4()))
|
||||
bf.WriteUint16(16 + uint16(serverIdx))
|
||||
bf.WriteUint16(si.Unk2)
|
||||
bf.WriteUint16(uint16(len(si.Channels)))
|
||||
bf.WriteUint8(si.Type)
|
||||
bf.WriteUint8(si.Season)
|
||||
bf.WriteUint8(si.Unk6)
|
||||
bf.WriteBytes(paddedString(si.Name, 66))
|
||||
bf.WriteUint32(si.AllowedClientFlags)
|
||||
|
||||
for channelIdx, ci := range si.Channels {
|
||||
bf.WriteUint16(ci.Port)
|
||||
bf.WriteUint16(16 + uint16(channelIdx))
|
||||
bf.WriteUint16(ci.MaxPlayers)
|
||||
bf.WriteUint16(ci.CurrentPlayers)
|
||||
bf.WriteUint16(ci.Unk4)
|
||||
bf.WriteUint16(ci.Unk5)
|
||||
bf.WriteUint16(ci.Unk6)
|
||||
bf.WriteUint16(ci.Unk7)
|
||||
bf.WriteUint16(ci.Unk8)
|
||||
bf.WriteUint16(ci.Unk9)
|
||||
bf.WriteUint16(ci.Unk10)
|
||||
bf.WriteUint16(ci.Unk11)
|
||||
bf.WriteUint16(ci.Unk12)
|
||||
bf.WriteUint16(ci.Unk13)
|
||||
}
|
||||
}
|
||||
|
||||
return bf.Data()
|
||||
}
|
||||
|
||||
func makeHeader(data []byte, respType string, entryCount uint16, key byte) []byte {
|
||||
bf := byteframe.NewByteFrame()
|
||||
bf.WriteBytes([]byte(respType))
|
||||
bf.WriteUint16(entryCount)
|
||||
bf.WriteUint16(uint16(len(data)))
|
||||
if len(data) > 0 {
|
||||
bf.WriteUint32(CalcSum32(data))
|
||||
bf.WriteBytes(data)
|
||||
}
|
||||
|
||||
dataToEncrypt := bf.Data()
|
||||
|
||||
bf = byteframe.NewByteFrame()
|
||||
bf.WriteUint8(key)
|
||||
bf.WriteBytes(EncryptBin8(dataToEncrypt, key))
|
||||
return bf.Data()
|
||||
}
|
||||
|
||||
func makeResp(servers []config.EntranceServerInfo) []byte {
|
||||
rawServerData := encodeServerInfo(servers)
|
||||
|
||||
bf := byteframe.NewByteFrame()
|
||||
bf.WriteBytes(makeHeader(rawServerData, "SV2", uint16(len(servers)), 0x00))
|
||||
|
||||
// TODO(Andoryuuta): Figure out what this user data is.
|
||||
// Is it for the friends list at the world selection screen?
|
||||
// If so, how does it work without the entrance server connection being authenticated?
|
||||
bf.WriteBytes(makeHeader([]byte{}, "USR", 0, 0x00))
|
||||
|
||||
return bf.Data()
|
||||
|
||||
}
|
||||
20
server/launcherserver/handler.go
Normal file
20
server/launcherserver/handler.go
Normal file
@@ -0,0 +1,20 @@
|
||||
package launcherserver
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
)
|
||||
|
||||
// ServerHandler is a handler function akin to http.Handler's ServeHTTP,
|
||||
// but has an additional *Server argument.
|
||||
type ServerHandler func(*Server, http.ResponseWriter, *http.Request)
|
||||
|
||||
// ServerHandlerFunc is a small type that implements http.Handler and
|
||||
// wraps a calling ServerHandler with a *Server argument.
|
||||
type ServerHandlerFunc struct {
|
||||
server *Server
|
||||
f ServerHandler
|
||||
}
|
||||
|
||||
func (shf ServerHandlerFunc) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||
shf.f(shf.server, w, r)
|
||||
}
|
||||
98
server/launcherserver/launcher_server.go
Normal file
98
server/launcherserver/launcher_server.go
Normal file
@@ -0,0 +1,98 @@
|
||||
package launcherserver
|
||||
|
||||
import (
|
||||
"context"
|
||||
"database/sql"
|
||||
"fmt"
|
||||
"net/http"
|
||||
"os"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/Andoryuuta/Erupe/config"
|
||||
"github.com/gorilla/handlers"
|
||||
"github.com/gorilla/mux"
|
||||
"go.uber.org/zap"
|
||||
)
|
||||
|
||||
// Config struct allows configuring the server.
|
||||
type Config struct {
|
||||
Logger *zap.Logger
|
||||
DB *sql.DB
|
||||
ErupeConfig *config.Config
|
||||
UseOriginalLauncherFiles bool
|
||||
}
|
||||
|
||||
// Server is the MHF launcher HTTP server.
|
||||
type Server struct {
|
||||
sync.Mutex
|
||||
logger *zap.Logger
|
||||
erupeConfig *config.Config
|
||||
db *sql.DB
|
||||
httpServer *http.Server
|
||||
useOriginalLauncherFiles bool
|
||||
isShuttingDown bool
|
||||
}
|
||||
|
||||
// NewServer creates a new Server type.
|
||||
func NewServer(config *Config) *Server {
|
||||
s := &Server{
|
||||
logger: config.Logger,
|
||||
erupeConfig: config.ErupeConfig,
|
||||
db: config.DB,
|
||||
useOriginalLauncherFiles: config.UseOriginalLauncherFiles,
|
||||
httpServer: &http.Server{},
|
||||
}
|
||||
return s
|
||||
}
|
||||
|
||||
// Start starts the server in a new goroutine.
|
||||
func (s *Server) Start() error {
|
||||
// Set up the routes responsible for serving the launcher HTML, serverlist, unique name check, and JP auth.
|
||||
r := mux.NewRouter()
|
||||
|
||||
// Universal serverlist.xml route
|
||||
s.setupServerlistRoutes(r)
|
||||
|
||||
// Change the launcher HTML routes if we are using the custom launcher instead of the original.
|
||||
if s.useOriginalLauncherFiles {
|
||||
s.setupOriginalLauncherRotues(r)
|
||||
} else {
|
||||
s.setupCustomLauncherRotues(r)
|
||||
}
|
||||
|
||||
s.httpServer.Addr = fmt.Sprintf(":%d", s.erupeConfig.Launcher.Port)
|
||||
s.httpServer.Handler = handlers.LoggingHandler(os.Stdout, r)
|
||||
|
||||
serveError := make(chan error, 1)
|
||||
go func() {
|
||||
if err := s.httpServer.ListenAndServe(); err != nil {
|
||||
// Send error if any.
|
||||
serveError <- err
|
||||
}
|
||||
}()
|
||||
|
||||
// Get the error from calling ListenAndServe, otherwise assume it's good after 250 milliseconds.
|
||||
select {
|
||||
case err := <-serveError:
|
||||
return err
|
||||
case <-time.After(250 * time.Millisecond):
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
// Shutdown exits the server gracefully.
|
||||
func (s *Server) Shutdown() {
|
||||
s.logger.Debug("Shutting down")
|
||||
|
||||
s.Lock()
|
||||
s.isShuttingDown = true
|
||||
s.Unlock()
|
||||
|
||||
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
|
||||
defer cancel()
|
||||
if err := s.httpServer.Shutdown(ctx); err != nil {
|
||||
// Just warn because we are shutting down the server anyway.
|
||||
s.logger.Warn("Got error on httpServer shutdown", zap.Error(err))
|
||||
}
|
||||
}
|
||||
79
server/launcherserver/routes.go
Normal file
79
server/launcherserver/routes.go
Normal file
@@ -0,0 +1,79 @@
|
||||
package launcherserver
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"html"
|
||||
"net/http"
|
||||
|
||||
"github.com/gorilla/mux"
|
||||
//"github.com/julienschmidt/httprouter"
|
||||
)
|
||||
|
||||
func serverList(s *Server, w http.ResponseWriter, r *http.Request) {
|
||||
fmt.Fprintf(w,
|
||||
`<?xml version="1.0"?><server_groups><group idx='0' nam='Erupe' ip='%s' port="%d"/></server_groups>`,
|
||||
s.erupeConfig.HostIP,
|
||||
s.erupeConfig.Entrance.Port,
|
||||
)
|
||||
}
|
||||
|
||||
func serverUniqueName(w http.ResponseWriter, r *http.Request) {
|
||||
// TODO(Andoryuuta): Implement checking for unique character name.
|
||||
fmt.Fprintf(w, `<?xml version="1.0" encoding="ISO-8859-1"?><uniq code="200">OK</uniq>`)
|
||||
}
|
||||
|
||||
func jpLogin(w http.ResponseWriter, r *http.Request) {
|
||||
// HACK(Andoryuuta): Return the given password back as the `skey` to defer the login logic to the sign server.
|
||||
resultJSON := fmt.Sprintf(`{"result": "Ok", "skey": "%s", "code": "000", "msg": ""}`, r.FormValue("pw"))
|
||||
|
||||
fmt.Fprintf(w,
|
||||
`<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html>
|
||||
<body onload="doPost();">
|
||||
<script type="text/javascript">
|
||||
function doPost(){
|
||||
parent.postMessage(document.getElementById("result").getAttribute("value"), "http://cog-members.mhf-z.jp");
|
||||
}
|
||||
</script>
|
||||
<input id="result" value="%s"/>
|
||||
</body>
|
||||
</html>`, html.EscapeString(resultJSON))
|
||||
|
||||
}
|
||||
|
||||
func (s *Server) setupServerlistRoutes(r *mux.Router) {
|
||||
// TW
|
||||
twServerList := r.Host("mhf-n.capcom.com.tw").Subrouter()
|
||||
twServerList.HandleFunc("/server/unique.php", serverUniqueName) // Name checking is also done on this host.
|
||||
twServerList.Handle("/server/serverlist.xml", ServerHandlerFunc{s, serverList})
|
||||
|
||||
// JP
|
||||
jpServerList := r.Host("srv-mhf.capcom-networks.jp").Subrouter()
|
||||
jpServerList.Handle("/serverlist.xml", ServerHandlerFunc{s, serverList})
|
||||
}
|
||||
|
||||
func (s *Server) setupOriginalLauncherRotues(r *mux.Router) {
|
||||
// TW
|
||||
twMain := r.Host("mhfg.capcom.com.tw").Subrouter()
|
||||
twMain.PathPrefix("/").Handler(http.FileServer(http.Dir("./www/tw/")))
|
||||
|
||||
// JP
|
||||
jpMain := r.Host("cog-members.mhf-z.jp").Subrouter()
|
||||
jpMain.PathPrefix("/").Handler(http.FileServer(http.Dir("./www/jp/")))
|
||||
|
||||
// JP Launcher does additional auth over HTTP that the TW launcher doesn't.
|
||||
jpAuth := r.Host("www.capcom-onlinegames.jp").Subrouter()
|
||||
jpAuth.HandleFunc("/auth/launcher/login", jpLogin) //.Methods("POST")
|
||||
jpAuth.PathPrefix("/auth/").Handler(http.StripPrefix("/auth/", http.FileServer(http.Dir("./www/jp/auth/"))))
|
||||
|
||||
}
|
||||
|
||||
func (s *Server) setupCustomLauncherRotues(r *mux.Router) {
|
||||
// TW
|
||||
twMain := r.Host("mhfg.capcom.com.tw").Subrouter()
|
||||
twMain.PathPrefix("/g6_launcher/").Handler(http.StripPrefix("/g6_launcher/", http.FileServer(http.Dir("./www/erupe/"))))
|
||||
|
||||
// JP
|
||||
jpMain := r.Host("cog-members.mhf-z.jp").Subrouter()
|
||||
jpMain.PathPrefix("/launcher/").Handler(http.StripPrefix("/launcher/", http.FileServer(http.Dir("./www/erupe"))))
|
||||
}
|
||||
137
server/signserver/dsgn_resp.go
Normal file
137
server/signserver/dsgn_resp.go
Normal file
@@ -0,0 +1,137 @@
|
||||
package signserver
|
||||
|
||||
import "github.com/Andoryuuta/byteframe"
|
||||
|
||||
func paddedString(x string, size uint) []byte {
|
||||
out := make([]byte, size)
|
||||
copy(out, x)
|
||||
|
||||
// Null terminate it.
|
||||
out[len(out)-1] = 0
|
||||
return out
|
||||
}
|
||||
|
||||
func uint8PascalString(bf *byteframe.ByteFrame, x string) {
|
||||
bf.WriteUint8(uint8(len(x) + 1))
|
||||
bf.WriteNullTerminatedBytes([]byte(x))
|
||||
}
|
||||
|
||||
func uint16PascalString(bf *byteframe.ByteFrame, x string) {
|
||||
bf.WriteUint16(uint16(len(x) + 1))
|
||||
bf.WriteNullTerminatedBytes([]byte(x))
|
||||
}
|
||||
|
||||
func makeSignInFailureResp(respID RespID) []byte {
|
||||
bf := byteframe.NewByteFrame()
|
||||
bf.WriteUint8(uint8(respID))
|
||||
return bf.Data()
|
||||
}
|
||||
|
||||
func (session *Session) makeSignInResp(username string) []byte {
|
||||
bf := byteframe.NewByteFrame()
|
||||
|
||||
// delete me:
|
||||
//bf.WriteUint8(8)
|
||||
//return bf.Data()
|
||||
|
||||
bf.WriteUint8(1) // resp_code
|
||||
bf.WriteUint8(0) // file/patch server count
|
||||
bf.WriteUint8(4) // entrance server count
|
||||
bf.WriteUint8(1) // character count
|
||||
bf.WriteUint32(0xFFFFFFFF) // login_token_number
|
||||
bf.WriteBytes(paddedString("logintokenstrng", 16)) // login_token (16 byte padded string)
|
||||
bf.WriteUint32(1576761190)
|
||||
|
||||
// file patch server PascalStrings here
|
||||
|
||||
// Array(this.entrance_server_count, PascalString(Byte, "utf8")),
|
||||
uint8PascalString(bf, "localhost:53310")
|
||||
uint8PascalString(bf, "")
|
||||
uint8PascalString(bf, "")
|
||||
uint8PascalString(bf, "mhf-n.capcom.com.tw")
|
||||
|
||||
///////////////////////////
|
||||
// Characters:
|
||||
|
||||
/*
|
||||
tab = '123456789ABCDEFGHJKLMNPQRTUVWXYZ'
|
||||
def make_uid_str(cid):
|
||||
out = ''
|
||||
for i in range(6):
|
||||
v = (cid>>5*i)
|
||||
out += tab[v&0x1f]
|
||||
return out
|
||||
|
||||
def make_cid_int(uid):
|
||||
v = 0
|
||||
for c in uid[::-1]:
|
||||
idx = tab.find(c)
|
||||
if idx == -1:
|
||||
raise Exception("not in tab")
|
||||
v |= idx
|
||||
v = v<<5
|
||||
return v>>5
|
||||
*/
|
||||
bf.WriteUint32(469153291) // character ID 469153291
|
||||
bf.WriteUint16(999) // Exp, HR[x] is split by 0, 1, 30, 50, 99, 299, 998, 999
|
||||
|
||||
//44.204
|
||||
|
||||
/*
|
||||
0=大劍/Big sword
|
||||
1=重弩/Heavy crossbow
|
||||
2=大錘/Sledgehammer
|
||||
3=長槍/Spear
|
||||
4=單手劍/One-handed sword
|
||||
5=輕弩/Light crossbow
|
||||
6=雙劍/Double sword
|
||||
7=太刀/Tadao
|
||||
8=狩獵笛/Hunting flute
|
||||
9=銃槍/Shotgun
|
||||
10=弓/bow
|
||||
11=穿龍棍/Wear a dragon stick
|
||||
12=斬擊斧F/Chopping Axe F
|
||||
13=---
|
||||
default=不明/unknown
|
||||
*/
|
||||
bf.WriteUint16(7) // Weapon, 0-13.
|
||||
|
||||
bf.WriteUint32(1576761172) // Last login date, unix timestamp in seconds.
|
||||
bf.WriteUint8(1) // Sex, 0=male, 1=female.
|
||||
bf.WriteUint8(0) // Is new character, 1 replaces character name with ?????.
|
||||
grMode := uint8(0)
|
||||
bf.WriteUint8(1) // GR level if grMode == 0
|
||||
bf.WriteUint8(grMode) // GR mode.
|
||||
bf.WriteBytes(paddedString(username, 16)) // Character name
|
||||
bf.WriteBytes(paddedString("0", 32)) // unk str
|
||||
if grMode == 1 {
|
||||
bf.WriteUint16(55) // GR level override.
|
||||
bf.WriteUint8(0) // unk
|
||||
bf.WriteUint8(0) // unk
|
||||
}
|
||||
|
||||
//////////////////////////
|
||||
|
||||
bf.WriteUint8(0) // friends_list_count
|
||||
bf.WriteUint8(0) // guild_members_count
|
||||
bf.WriteUint8(0) // notice_count
|
||||
bf.WriteUint32(0xDEADBEEF) // some_last_played_character_id
|
||||
bf.WriteUint32(14) // unk_flags
|
||||
uint8PascalString(bf, "") // unk_data_blob PascalString
|
||||
|
||||
bf.WriteUint16(51728)
|
||||
bf.WriteUint16(20000)
|
||||
uint16PascalString(bf, "1000672925")
|
||||
|
||||
bf.WriteUint8(0)
|
||||
|
||||
bf.WriteUint16(51729)
|
||||
bf.WriteUint16(1)
|
||||
bf.WriteUint16(20000)
|
||||
uint16PascalString(bf, "203.191.249.36:8080")
|
||||
|
||||
bf.WriteUint32(1578905116)
|
||||
bf.WriteUint32(0)
|
||||
|
||||
return bf.Data()
|
||||
}
|
||||
51
server/signserver/respid.go
Normal file
51
server/signserver/respid.go
Normal file
@@ -0,0 +1,51 @@
|
||||
package signserver
|
||||
|
||||
//revive:disable
|
||||
|
||||
type RespID uint16
|
||||
|
||||
//go:generate stringer -type=RespID
|
||||
const (
|
||||
SIGN_UNKNOWN RespID = iota
|
||||
SIGN_SUCCESS
|
||||
SIGN_EFAILED // Authentication server communication failed
|
||||
SIGN_EILLEGAL // Incorrect input, authentication has been suspended
|
||||
SIGN_EALERT // Authentication server process error
|
||||
SIGN_EABORT // The internal procedure of the authentication server ended abnormally
|
||||
SIGN_ERESPONSE // Procedure terminated due to abnormal certification report
|
||||
SIGN_EDATABASE // Database connection failed
|
||||
SIGN_EABSENCE
|
||||
SIGN_ERESIGN
|
||||
SIGN_ESUSPEND_D
|
||||
SIGN_ELOCK
|
||||
SIGN_EPASS
|
||||
SIGN_ERIGHT
|
||||
SIGN_EAUTH
|
||||
SIGN_ESUSPEND // This account is temporarily suspended. Please contact customer service for details
|
||||
SIGN_EELIMINATE // This account is permanently suspended. Please contact customer service for details
|
||||
SIGN_ECLOSE
|
||||
SIGN_ECLOSE_EX // Login process is congested. <br> Please try to sign in again later
|
||||
SIGN_EINTERVAL
|
||||
SIGN_EMOVED
|
||||
SIGN_ENOTREADY
|
||||
SIGN_EALREADY
|
||||
SIGN_EIPADDR // Region block because of IP address.
|
||||
SIGN_EHANGAME
|
||||
SIGN_UPD_ONLY
|
||||
SIGN_EMBID
|
||||
SIGN_ECOGCODE
|
||||
SIGN_ETOKEN
|
||||
SIGN_ECOGLINK
|
||||
SIGN_EMAINTE
|
||||
SIGN_EMAINTE_NOUPDATE
|
||||
|
||||
// Couldn't find names for the following:
|
||||
UNK_32
|
||||
UNK_33
|
||||
UNK_34
|
||||
UNK_35
|
||||
|
||||
SIGN_XBRESPONSE
|
||||
SIGN_EPSI
|
||||
SIGN_EMBID_PSI
|
||||
)
|
||||
120
server/signserver/session.go
Normal file
120
server/signserver/session.go
Normal file
@@ -0,0 +1,120 @@
|
||||
package signserver
|
||||
|
||||
import (
|
||||
"database/sql"
|
||||
"encoding/hex"
|
||||
"net"
|
||||
"sync"
|
||||
|
||||
"github.com/Andoryuuta/Erupe/network"
|
||||
"github.com/Andoryuuta/byteframe"
|
||||
"go.uber.org/zap"
|
||||
)
|
||||
|
||||
// Session holds state for the sign server connection.
|
||||
type Session struct {
|
||||
sync.Mutex
|
||||
logger *zap.Logger
|
||||
sid int
|
||||
server *Server
|
||||
rawConn *net.Conn
|
||||
cryptConn *network.CryptConn
|
||||
}
|
||||
|
||||
func (s *Session) fail() {
|
||||
s.server.Lock()
|
||||
delete(s.server.sessions, s.sid)
|
||||
s.server.Unlock()
|
||||
|
||||
}
|
||||
|
||||
func (s *Session) work() {
|
||||
for {
|
||||
pkt, err := s.cryptConn.ReadPacket()
|
||||
if err != nil {
|
||||
s.fail()
|
||||
return
|
||||
}
|
||||
|
||||
err = s.handlePacket(pkt)
|
||||
if err != nil {
|
||||
s.fail()
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func (s *Session) handlePacket(pkt []byte) error {
|
||||
sugar := s.logger.Sugar()
|
||||
|
||||
bf := byteframe.NewByteFrameFromBytes(pkt)
|
||||
reqType := string(bf.ReadNullTerminatedBytes())
|
||||
switch reqType {
|
||||
case "DLTSKEYSIGN:100":
|
||||
fallthrough
|
||||
case "DSGN:100":
|
||||
err := s.handleDSGNRequest(bf)
|
||||
if err != nil {
|
||||
return nil
|
||||
}
|
||||
case "DELETE:100":
|
||||
loginTokenString := string(bf.ReadNullTerminatedBytes())
|
||||
_ = loginTokenString
|
||||
characterID := bf.ReadUint32()
|
||||
|
||||
sugar.Infof("Got delete request for character ID: %v\n", characterID)
|
||||
sugar.Infof("remaining unknown data:\n%s\n", hex.Dump(bf.DataFromCurrent()))
|
||||
default:
|
||||
sugar.Infof("Got unknown request type %s, data:\n%s\n", reqType, hex.Dump(bf.DataFromCurrent()))
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (s *Session) handleDSGNRequest(bf *byteframe.ByteFrame) error {
|
||||
|
||||
reqUsername := string(bf.ReadNullTerminatedBytes())
|
||||
reqPassword := string(bf.ReadNullTerminatedBytes())
|
||||
reqUnk := string(bf.ReadNullTerminatedBytes())
|
||||
|
||||
s.server.logger.Info(
|
||||
"Got sign in request",
|
||||
zap.String("reqUsername", reqUsername),
|
||||
zap.String("reqPassword", reqPassword),
|
||||
zap.String("reqUnk", reqUnk),
|
||||
)
|
||||
|
||||
// TODO(Andoryuuta): remove plaintext password storage if this ever becomes more than a toy project.
|
||||
var (
|
||||
id int
|
||||
password string
|
||||
)
|
||||
err := s.server.db.QueryRow("SELECT id, password FROM users WHERE username = $1", reqUsername).Scan(&id, &password)
|
||||
var serverRespBytes []byte
|
||||
switch {
|
||||
case err == sql.ErrNoRows:
|
||||
s.logger.Info("Account not found", zap.String("reqUsername", reqUsername))
|
||||
serverRespBytes = makeSignInFailureResp(SIGN_EAUTH)
|
||||
break
|
||||
case err != nil:
|
||||
serverRespBytes = makeSignInFailureResp(SIGN_EABORT)
|
||||
s.logger.Warn("Got error on SQL query", zap.Error(err))
|
||||
break
|
||||
default:
|
||||
if reqPassword == password {
|
||||
s.logger.Info("Passwords match!")
|
||||
serverRespBytes = s.makeSignInResp(reqUsername)
|
||||
} else {
|
||||
s.logger.Info("Passwords don't match!")
|
||||
serverRespBytes = makeSignInFailureResp(SIGN_EPASS)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
err = s.cryptConn.SendPacket(serverRespBytes)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
119
server/signserver/sign_server.go
Normal file
119
server/signserver/sign_server.go
Normal file
@@ -0,0 +1,119 @@
|
||||
package signserver
|
||||
|
||||
import (
|
||||
"database/sql"
|
||||
"fmt"
|
||||
"io"
|
||||
"net"
|
||||
"sync"
|
||||
|
||||
"github.com/Andoryuuta/Erupe/config"
|
||||
"github.com/Andoryuuta/Erupe/network"
|
||||
"go.uber.org/zap"
|
||||
)
|
||||
|
||||
// Config struct allows configuring the server.
|
||||
type Config struct {
|
||||
Logger *zap.Logger
|
||||
DB *sql.DB
|
||||
ErupeConfig *config.Config
|
||||
}
|
||||
|
||||
// Server is a MHF sign server.
|
||||
type Server struct {
|
||||
sync.Mutex
|
||||
logger *zap.Logger
|
||||
erupeConfig *config.Config
|
||||
sid int
|
||||
sessions map[int]*Session
|
||||
db *sql.DB
|
||||
listener net.Listener
|
||||
isShuttingDown bool
|
||||
}
|
||||
|
||||
// NewServer creates a new Server type.
|
||||
func NewServer(config *Config) *Server {
|
||||
s := &Server{
|
||||
logger: config.Logger,
|
||||
erupeConfig: config.ErupeConfig,
|
||||
sid: 0,
|
||||
sessions: make(map[int]*Session),
|
||||
db: config.DB,
|
||||
}
|
||||
return s
|
||||
}
|
||||
|
||||
// Start starts the server in a new goroutine.
|
||||
func (s *Server) Start() error {
|
||||
l, err := net.Listen("tcp", fmt.Sprintf(":%d", s.erupeConfig.Sign.Port))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
s.listener = l
|
||||
|
||||
go s.acceptClients()
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// Shutdown exits the server gracefully.
|
||||
func (s *Server) Shutdown() {
|
||||
s.logger.Debug("Shutting down")
|
||||
|
||||
s.Lock()
|
||||
s.isShuttingDown = true
|
||||
s.Unlock()
|
||||
|
||||
// This will cause the acceptor goroutine to error and exit gracefully.
|
||||
s.listener.Close()
|
||||
}
|
||||
|
||||
func (s *Server) acceptClients() {
|
||||
for {
|
||||
conn, err := s.listener.Accept()
|
||||
if err != nil {
|
||||
// Check if we are shutting down and exit gracefully if so.
|
||||
s.Lock()
|
||||
shutdown := s.isShuttingDown
|
||||
s.Unlock()
|
||||
|
||||
if shutdown {
|
||||
break
|
||||
} else {
|
||||
panic(err)
|
||||
}
|
||||
}
|
||||
|
||||
go s.handleConnection(s.sid, conn)
|
||||
s.sid++
|
||||
}
|
||||
}
|
||||
|
||||
func (s *Server) handleConnection(sid int, conn net.Conn) {
|
||||
s.logger.Info("Got connection to sign server", zap.String("remoteaddr", conn.RemoteAddr().String()))
|
||||
|
||||
// Client initalizes the connection with a one-time buffer of 8 NULL bytes.
|
||||
nullInit := make([]byte, 8)
|
||||
_, err := io.ReadFull(conn, nullInit)
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
conn.Close()
|
||||
return
|
||||
}
|
||||
|
||||
// Create a new session.
|
||||
session := &Session{
|
||||
logger: s.logger,
|
||||
server: s,
|
||||
rawConn: &conn,
|
||||
cryptConn: network.NewCryptConn(conn),
|
||||
}
|
||||
|
||||
// Add the session to the server's sessions map.
|
||||
s.Lock()
|
||||
s.sessions[sid] = session
|
||||
s.Unlock()
|
||||
|
||||
// Do the session's work.
|
||||
session.work()
|
||||
}
|
||||
Reference in New Issue
Block a user