mirror of
https://github.com/OpenFusionProject/OpenFusion.git
synced 2024-12-23 03:40:05 +00:00
Added nano summon feature
This commit is contained in:
parent
bb1ce5c28d
commit
795107a274
@ -10,6 +10,7 @@ enum SHARDPACKETID {
|
||||
P_CL2FE_REQ_PC_ENTER = 318767105,
|
||||
P_CL2FE_REQ_PC_LOADING_COMPLETE = 318767245,
|
||||
P_CL2FE_REP_LIVE_CHECK = 318767221,
|
||||
P_CL2FE_REQ_NANO_ACTIVE = 318767119,
|
||||
P_CL2FE_REQ_PC_MOVE = 318767107,
|
||||
P_CL2FE_REQ_PC_STOP = 318767108,
|
||||
P_CL2FE_REQ_PC_JUMP = 318767109,
|
||||
@ -21,6 +22,7 @@ enum SHARDPACKETID {
|
||||
P_CL2FE_REQ_PC_EXIT = 318767106,
|
||||
|
||||
// shard 2 client
|
||||
P_FE2CL_REP_NANO_ACTIVE_SUCC = 822083624,
|
||||
P_FE2CL_REP_PC_ENTER_SUCC = 822083586,
|
||||
P_FE2CL_REP_PC_LOADING_COMPLETE_SUCC = 822083833,
|
||||
P_FE2CL_REQ_LIVE_CHECK = 822083792,
|
||||
|
20
src/NanoManager.cpp
Normal file
20
src/NanoManager.cpp
Normal file
@ -0,0 +1,20 @@
|
||||
#include "CNShardServer.hpp"
|
||||
#include "CNStructs.hpp"
|
||||
#include "NanoManager.hpp"
|
||||
#include "PlayerManager.hpp"
|
||||
|
||||
void NanoManager::init() {
|
||||
REGISTER_SHARD_PACKET(P_CL2FE_REQ_NANO_ACTIVE, nanoSummonHandler);
|
||||
}
|
||||
|
||||
void NanoManager::nanoSummonHandler(CNSocket* sock, CNPacketData* data) {
|
||||
sP_CL2FE_REQ_NANO_ACTIVE* nano = (sP_CL2FE_REQ_NANO_ACTIVE*)data->buf;
|
||||
PlayerView plr = PlayerManager::players[sock];
|
||||
|
||||
// Send to client
|
||||
sP_FE2CL_REP_NANO_ACTIVE_SUCC* resp = (sP_FE2CL_REP_NANO_ACTIVE_SUCC*)xmalloc(sizeof(sP_FE2CL_REP_NANO_ACTIVE_SUCC));
|
||||
resp->iActiveNanoSlotNum = nano->iNanoSlotNum;
|
||||
sock->sendPacket(new CNPacketData((void*)resp, P_FE2CL_REP_NANO_ACTIVE_SUCC, sizeof(sP_FE2CL_REP_NANO_ACTIVE_SUCC), sock->getFEKey()));
|
||||
|
||||
std::cout << U16toU8(plr.plr.PCStyle.szFirstName) << U16toU8(plr.plr.PCStyle.szLastName) << " requested to summon nano slot: " << nano->iNanoSlotNum << std::endl;
|
||||
}
|
11
src/NanoManager.hpp
Normal file
11
src/NanoManager.hpp
Normal file
@ -0,0 +1,11 @@
|
||||
#ifndef _NM_HPP
|
||||
#define _NM_HPP
|
||||
|
||||
#include "CNShardServer.hpp"
|
||||
|
||||
namespace NanoManager {
|
||||
void init();
|
||||
void nanoSummonHandler(CNSocket* sock, CNPacketData* data);
|
||||
}
|
||||
|
||||
#endif
|
@ -2,6 +2,7 @@
|
||||
#include "CNShardServer.hpp"
|
||||
#include "PlayerManager.hpp"
|
||||
#include "ChatManager.hpp"
|
||||
#include "NanoManager.hpp"
|
||||
|
||||
#include "settings.hpp"
|
||||
|
||||
@ -28,6 +29,7 @@ int main() {
|
||||
std::cout << "[INFO] Intializing Packet Managers..." << std::endl;
|
||||
PlayerManager::init();
|
||||
ChatManager::init();
|
||||
NanoManager::init();
|
||||
|
||||
std::cout << "[INFO] Starting Server Threads..." << std::endl;
|
||||
CNLoginServer loginServer(settings::LOGINPORT);
|
||||
|
Loading…
Reference in New Issue
Block a user