void GooRoomClient::InitializeClient(GooRoomClientRPCInterface* gooroomClientRPCReceiver) { ASSERT_RELEASE(m_IsInitialized == false); ASSERT_RELEASE(m_IsStarted == false); STRING resourceFullPath = this->GetWritableFilePath(RESOURCE_MANAGER_FILENAME); m_GooRoomResourceVersionManager.InitializeDataFromFile(resourceFullPath.c_str()); m_GooRoomClientRPCInterface = gooroomClientRPCReceiver; m_ThreadController.Initialize(DEFAULT_NUMBER_OF_THREADS); m_ThreadController.AddWorkerRoutine(&m_ScheduledTaskWorkerRoutine); m_ThreadController.AddWorkerRoutine(&m_GameTaskWorkerRoutine); m_ThreadController.AddWorkerRoutine(&m_NetworkWorkerRoutine); // NOTE : // RenderingTaskWorkerRoutine is managed by Cocos2d main thread // DO NOT ADD this m_RenderingTaskWorkerRoutine // connect to server //m_ClientObject.InitializeClient(SERVER_CONNECT_ADDRESS, SERVER_CONNECT_PORT); static_cast<SCPacketHandler*>(m_CSConnection->GetPacketHandler())->SetGooRoomClientRPCReceiver(gooroomClientRPCReceiver); static_cast<FCPacketHandler*>(m_CFConnection->GetPacketHandler())->SetGooRoomClientRPCReceiver(gooroomClientRPCReceiver); m_CFConnectionFactory.SetGooRoomClientRPCInterface(m_GooRoomClientRPCInterface); // m_CFResponseConnectType = CFResponseConnectType_Login; StageInfoDictionary::Instance().Initialize(); m_IsInitialized = true; }
void GameClient::InitializeClient(GameClientRPCInterface* gameClientRPCReceiver) { ASSERT_RELEASE(m_IsInitialized == false); ASSERT_RELEASE(m_IsStarted == false); SpellDictionary::Initialize(); SpellAbilityApplier::Initialize(); ItemDataDictionary::Initialize(); ItemAbilityApplier::Initialize(); m_ThreadController.Initialize(DEFAULT_NUMBER_OF_THREADS); m_ThreadController.AddWorkerRoutine(&m_ScheduledTaskWorkerRoutine); m_ThreadController.AddWorkerRoutine(&m_GameTaskWorkerRoutine); m_ThreadController.AddWorkerRoutine(&m_NetworkWorkerRoutine); // NOTE : // RenderingTaskWorkerRoutine is managed by Cocos2d main thread // DO NOT ADD this m_RenderingTaskWorkerRoutine // connect to server //m_ClientObject.InitializeClient(SERVER_CONNECT_ADDRESS, SERVER_CONNECT_PORT); m_ClientPacketHandler.SetGameClientRPCReceiver(gameClientRPCReceiver); m_FCPacketHandler.SetGameClientRPCReceiver(gameClientRPCReceiver); m_IsInitialized = true; }
void GooRoomClient::StartClient() { ASSERT_RELEASE(m_IsInitialized == true); ASSERT_RELEASE(m_IsStarted == false); m_ClientTimer.Start(); m_ThreadController.Start(); }
Dx::~Dx() { ASSERT_RELEASE(m_uavBackbuffer); ASSERT_RELEASE(m_rtvBackbuffer); ASSERT_DELETE(m_cogD3d); ASSERT_DELETE(m_cogFx); ASSERT_DELETE(m_cogCb); ASSERT_DELETE(m_cogSS); ASSERT_DELETE(m_cogTex); ASSERT_DELETE(m_cogGeo); ASSERT_DELETE(m_cogFov); }
HRESULT Dx::init() { HRESULT hr = S_FALSE; m_cogD3d = new CogD3d(*m_win); hr = m_cogD3d->init(); D3d d3d = m_cogD3d->getD3d(); if(SUCCEEDED(hr)) { ID3D11Texture2D* backbufferTex; HRESULT hr = d3d.swapChain->GetBuffer(0, __uuidof(ID3D11Texture2D), (LPVOID*)&backbufferTex); if(SUCCEEDED(hr)) { hr = d3d.device->CreateUnorderedAccessView(backbufferTex, NULL, &m_uavBackbuffer); } if(SUCCEEDED(hr)) { hr = d3d.device->CreateRenderTargetView(backbufferTex, NULL, &m_rtvBackbuffer); } ASSERT_RELEASE(backbufferTex); } if(SUCCEEDED(hr)) { Singleton<Ant>::get().init(d3d.device, m_win->getWidth(), m_win->getHeight()); } if(SUCCEEDED(hr)) { m_cogFx = new CogFx(); hr = m_cogFx->init(d3d.device); } if(SUCCEEDED(hr)) { m_cogCb = new CogCb(); hr = m_cogCb->init(d3d.device); CbPerInstance cbPerInstance; cbPerInstance.screenWidth = m_win->getWidth(); cbPerInstance.screenHeight = m_win->getHeight(); m_cogCb->mapCbPerInstance(d3d.devcon, cbPerInstance); } if(SUCCEEDED(hr)) { m_cogSS = new CogSS(); hr = m_cogSS->init(d3d.device); } if(SUCCEEDED(hr)) { m_cogTex = new CogTex(); hr = m_cogTex->init(d3d.device); } if(SUCCEEDED(hr)) { m_cogGeo = new CogGeo(); hr = m_cogGeo->init(d3d.device, d3d.devcon); } if(SUCCEEDED(hr)) { m_cogFov = new CogFov(m_win->getWidth(), m_win->getHeight(), (float)RADIAN(45.0f)); hr = m_cogFov->init(d3d.device, d3d.devcon); } return hr; }
void InitializeHandlerMap() { if( m_HandlerMap != nullptr ) { return; } m_HandlerMap = new PacketHandlerFunction[GCS_Protocol_Max]; BindHandlerFunction(GCS_Protocol_Error, &AutoGenerateHandlerName::CSProtocolErrorHandler);BindHandlerFunction(GCS_Request_LinkUser, &AutoGenerateHandlerName::CSRequestLinkUserHandler); BindHandlerFunction(GCS_Request_CreateStage, &AutoGenerateHandlerName::CSRequestCreateStageHandler); BindHandlerFunction(GCS_Request_JoinStage, &AutoGenerateHandlerName::CSRequestJoinStageHandler); BindHandlerFunction(GCS_Request_AutomatchWaitingJoinStage, &AutoGenerateHandlerName::CSRequestAutomatchWaitingJoinStageHandler); BindHandlerFunction(GCS_Notify_PlayerJump, &AutoGenerateHandlerName::CSNotifyPlayerJumpHandler); BindHandlerFunction(GCS_Notify_PlayerBeginBoost, &AutoGenerateHandlerName::CSNotifyPlayerBeginBoostHandler); BindHandlerFunction(GCS_Notify_PlayerDuringBoost, &AutoGenerateHandlerName::CSNotifyPlayerDuringBoostHandler); BindHandlerFunction(GCS_Notify_PlayerEndBoost, &AutoGenerateHandlerName::CSNotifyPlayerEndBoostHandler); BindHandlerFunction(GCS_Notify_PlayerChargeBoost, &AutoGenerateHandlerName::CSNotifyPlayerChargeBoostHandler); BindHandlerFunction(GCS_Request_PlayerChargeActiveItem, &AutoGenerateHandlerName::CSRequestPlayerChargeActiveItemHandler); BindHandlerFunction(GCS_Request_PlayerUseActiveItem, &AutoGenerateHandlerName::CSRequestPlayerUseActiveItemHandler); BindHandlerFunction(GCS_Notify_PlayerFrozen, &AutoGenerateHandlerName::CSNotifyPlayerFrozenHandler); BindHandlerFunction(GCS_Notify_PlayerDefrozen, &AutoGenerateHandlerName::CSNotifyPlayerDefrozenHandler); BindHandlerFunction(GCS_Request_PlayerGoalIn, &AutoGenerateHandlerName::CSRequestPlayerGoalInHandler); BindHandlerFunction(GCS_Request_PlayerExitStage, &AutoGenerateHandlerName::CSRequestPlayerExitStageHandler); BindHandlerFunction(GCS_Request_ReJoinToUserPlayingStage, &AutoGenerateHandlerName::CSRequestReJoinToUserPlayingStageHandler); BindHandlerFunction(GCS_Notify_ChangeUserState, &AutoGenerateHandlerName::CSNotifyChangeUserStateHandler); BindHandlerFunction(GCS_Request_EndWaitingRoom, &AutoGenerateHandlerName::CSRequestEndWaitingRoomHandler); BindHandlerFunction(GCS_Request_RegisterGameFriend, &AutoGenerateHandlerName::CSRequestRegisterGameFriendHandler); BindHandlerFunction(GCS_Request_InviteUser, &AutoGenerateHandlerName::CSRequestInviteUserHandler); BindHandlerFunction(GCS_Notify_MapEventTakeEffectByActor, &AutoGenerateHandlerName::CSNotifyMapEventTakeEffectByActorHandler); BindHandlerFunction(GCS_Notify_MapEventEffectTakeEffectOnPlayer, &AutoGenerateHandlerName::CSNotifyMapEventEffectTakeEffectOnPlayerHandler); BindHandlerFunction(GCS_Notify_ChatMessage, &AutoGenerateHandlerName::CSNotifyChatMessageHandler); BindHandlerFunction(GCS_Request_SelectCharacter, &AutoGenerateHandlerName::CSRequestSelectCharacterHandler); BindHandlerFunction(GCS_Request_BuyCharacter, &AutoGenerateHandlerName::CSRequestBuyCharacterHandler); BindHandlerFunction(GCS_Request_UpgradeCharacter, &AutoGenerateHandlerName::CSRequestUpgradeCharacterHandler); BindHandlerFunction(GCS_Notify_StopAndDropPlayerDown, &AutoGenerateHandlerName::CSNotifyStopAndDropPlayerDownHandler); // Validity Check for(INT i=0; i<GCS_Protocol_Max; ++i) { if( m_HandlerMap[i]==nullptr) { ASSERT_RELEASE(false); // To Do : Error Log } } }
void InitializeHandlerMap() { if( m_HandlerMap != nullptr ) { return; } m_HandlerMap = new PacketHandlerFunction[GCS_Protocol_Max]; BindHandlerFunction(GCS_Protocol_Error, &AutoGenerateHandlerName::CSProtocolErrorHandler);BindHandlerFunction(GCS_Request_Session, &AutoGenerateHandlerName::CSRequestSessionHandler); BindHandlerFunction(GCS_Request_Heartbeat, &AutoGenerateHandlerName::CSRequestHeartbeatHandler); BindHandlerFunction(GCS_Request_CreatePlayer, &AutoGenerateHandlerName::CSRequestCreatePlayerHandler); BindHandlerFunction(GCS_Request_LogInWithOTP, &AutoGenerateHandlerName::CSRequestLogInWithOTPHandler); BindHandlerFunction(GCS_Request_LogOutUserAccount, &AutoGenerateHandlerName::CSRequestLogOutUserAccountHandler); BindHandlerFunction(GCS_Request_CreateStage, &AutoGenerateHandlerName::CSRequestCreateStageHandler); BindHandlerFunction(GCS_Request_GetStagePlayInfoList, &AutoGenerateHandlerName::CSRequestGetStagePlayInfoListHandler); BindHandlerFunction(GCS_Request_JoinClanCommunityStage, &AutoGenerateHandlerName::CSRequestJoinClanCommunityStageHandler); BindHandlerFunction(GCS_Request_JoinRunningStage, &AutoGenerateHandlerName::CSRequestJoinRunningStageHandler); BindHandlerFunction(GCS_Request_ExitStage, &AutoGenerateHandlerName::CSRequestExitStageHandler); BindHandlerFunction(GCS_Request_RejoinCurrentStage, &AutoGenerateHandlerName::CSRequestRejoinCurrentStageHandler); BindHandlerFunction(GCS_Request_MoveActor, &AutoGenerateHandlerName::CSRequestMoveActorHandler); BindHandlerFunction(GCS_Request_TeleportActor, &AutoGenerateHandlerName::CSRequestTeleportActorHandler); BindHandlerFunction(GCS_Request_BeginCast, &AutoGenerateHandlerName::CSRequestBeginCastHandler); BindHandlerFunction(GCS_Request_EndCast, &AutoGenerateHandlerName::CSRequestEndCastHandler); BindHandlerFunction(GCS_Request_DropItemToField, &AutoGenerateHandlerName::CSRequestDropItemToFieldHandler); BindHandlerFunction(GCS_Request_PickUpItemFromField, &AutoGenerateHandlerName::CSRequestPickUpItemFromFieldHandler); BindHandlerFunction(GCS_Request_RegisterStashItemToInventory, &AutoGenerateHandlerName::CSRequestRegisterStashItemToInventoryHandler); BindHandlerFunction(GCS_Request_UnRegisterStashItemFromInventory, &AutoGenerateHandlerName::CSRequestUnRegisterStashItemFromInventoryHandler); BindHandlerFunction(GCS_Request_SwapInventorySlot, &AutoGenerateHandlerName::CSRequestSwapInventorySlotHandler); BindHandlerFunction(GCS_Request_UseItem, &AutoGenerateHandlerName::CSRequestUseItemHandler); BindHandlerFunction(GCS_Request_EquipItem, &AutoGenerateHandlerName::CSRequestEquipItemHandler); BindHandlerFunction(GCS_Request_UnEquipItem, &AutoGenerateHandlerName::CSRequestUnEquipItemHandler); BindHandlerFunction(GCS_Request_SendMessageToStagePlayers, &AutoGenerateHandlerName::CSRequestSendMessageToStagePlayersHandler); // Validity Check for(INT i=0; i<GCS_Protocol_Max; ++i) { if( m_HandlerMap[i]==nullptr) { ASSERT_RELEASE(false); // To Do : Error Log } } }
void InitializeHandlerMap() { if( m_HandlerMap != nullptr ) { return; } m_HandlerMap = new PacketHandlerFunction[GDS_Protocol_Max]; BindHandlerFunction(GDS_Protocol_Error, &AutoGenerateHandlerName::DSProtocolErrorHandler);BindHandlerFunction(GDS_Response_Connect, &AutoGenerateHandlerName::DSResponseConnectHandler); // Validity Check for(INT i=0; i<GDS_Protocol_Max; ++i) { if( m_HandlerMap[i]==nullptr) { ASSERT_RELEASE(false); // To Do : Error Log } } }
void InitializeHandlerMap() { if( m_HandlerMap != nullptr ) { return; } m_HandlerMap = new PacketHandlerFunction[GFD_Protocol_Max]; BindHandlerFunction(GFD_Protocol_Error, &AutoGenerateHandlerName::FDProtocolErrorHandler);BindHandlerFunction(GFD_Request_CreateUserAccount, &AutoGenerateHandlerName::FDRequestCreateUserAccountHandler); // Validity Check for(INT i=0; i<GFD_Protocol_Max; ++i) { if( m_HandlerMap[i]==nullptr) { ASSERT_RELEASE(false); // To Do : Error Log } } }
void SpellAbilityApplier::Initialize() { SpellAbilityApplier& applier = Instance(); ASSERT_DEBUG(applier.m_SpellAbilityBeginFunctions.empty()); ASSERT_DEBUG(applier.m_SpellAbilityTickFunctions.empty()); ASSERT_DEBUG(applier.m_SpellAbilityClearFunctions.empty()); applier.m_SpellAbilityBeginFunctions.resize(SpellAbility_Max,nullptr); applier.m_SpellAbilityTickFunctions.resize(SpellAbility_Max,nullptr); applier.m_SpellAbilityClearFunctions.resize(SpellAbility_Max,nullptr); applier.m_SpellAbilityBeginFunctions[SpellAbility_Slow] = &SpellAbilityApplier::SpellAbilityBegin_Slow; applier.m_SpellAbilityTickFunctions[SpellAbility_Slow] = &SpellAbilityApplier::SpellAbilityTick_Slow; applier.m_SpellAbilityClearFunctions[SpellAbility_Slow] = &SpellAbilityApplier::SpellAbilityClear_Slow; applier.m_SpellAbilityBeginFunctions[SpellAbility_Freeze] = &SpellAbilityApplier::SpellAbilityBegin_Freeze; applier.m_SpellAbilityTickFunctions[SpellAbility_Freeze] = &SpellAbilityApplier::SpellAbilityTick_Freeze; applier.m_SpellAbilityClearFunctions[SpellAbility_Freeze] = &SpellAbilityApplier::SpellAbilityClear_Freeze; applier.m_SpellAbilityBeginFunctions[SpellAbility_KnockBack] = &SpellAbilityApplier::SpellAbilityBegin_KnockBack; applier.m_SpellAbilityTickFunctions[SpellAbility_KnockBack] = &SpellAbilityApplier::SpellAbilityTick_KnockBack; applier.m_SpellAbilityClearFunctions[SpellAbility_KnockBack] = &SpellAbilityApplier::SpellAbilityClear_KnockBack; ASSERT_RELEASE(applier.m_SpellAbilityBeginFunctions.size()==SpellAbility_Max); ASSERT_RELEASE(applier.m_SpellAbilityTickFunctions.size()==SpellAbility_Max); ASSERT_RELEASE(applier.m_SpellAbilityClearFunctions.size()==SpellAbility_Max); for( INT i = 0; i<SpellAbility_Max; ++i ) { if(applier.m_SpellAbilityBeginFunctions[i]==nullptr) { ASSERT_RELEASE(applier.m_SpellAbilityBeginFunctions[i]!=nullptr); } if(applier.m_SpellAbilityTickFunctions[i]==nullptr) { ASSERT_RELEASE(applier.m_SpellAbilityTickFunctions[i]!=nullptr); } if(applier.m_SpellAbilityClearFunctions[i]==nullptr) { ASSERT_RELEASE(applier.m_SpellAbilityClearFunctions[i]!=nullptr); } } }
TimerDx::~TimerDx() { ASSERT_RELEASE( m_start ); ASSERT_RELEASE( m_stop ); ASSERT_RELEASE( m_disjoint ); }
void RenderingTaskWorkerRoutine::AddTask(Task* task) { ASSERT_RELEASE(task!=nullptr); m_TaskQueue.Push(task); }