Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void CInputLogin::Entergame(LPDESC d, const char * data)
- {
- LPCHARACTER ch;
- if (!(ch = d->GetCharacter()))
- {
- d->SetPhase(PHASE_CLOSE);
- return;
- }
- PIXEL_POSITION pos = ch->GetXYZ();
- if (!SECTREE_MANAGER::instance().GetMovablePosition(ch->GetMapIndex(), pos.x, pos.y, pos))
- {
- PIXEL_POSITION pos2;
- SECTREE_MANAGER::instance().GetRecallPositionByEmpire(ch->GetMapIndex(), ch->GetEmpire(), pos2);
- sys_err("!GetMovablePosition (name %s %dx%d map %d changed to %dx%d)",
- ch->GetName(),
- pos.x, pos.y,
- ch->GetMapIndex(),
- pos2.x, pos2.y);
- pos = pos2;
- }
- CGuildManager::instance().LoginMember(ch);
- // 캐릭터를 맵에 추가
- ch->Show(ch->GetMapIndex(), pos.x, pos.y, pos.z);
- SECTREE_MANAGER::instance().SendNPCPosition(ch);
- ch->ReviveInvisible(5);
- d->SetPhase(PHASE_GAME);
- if(ch->GetItemAward_cmd()) //게임페이즈 들어가면
- quest::CQuestManager::instance().ItemInformer(ch->GetPlayerID(),ch->GetItemAward_vnum()); //questmanager 호출
- sys_log(0, "ENTERGAME: %s %dx%dx%d %s map_index %d",
- ch->GetName(), ch->GetX(), ch->GetY(), ch->GetZ(), d->GetHostName(), ch->GetMapIndex());
- if (ch->GetHorseLevel() > 0)
- {
- ch->EnterHorse();
- }
- // 플레이시간 레코딩 시작
- ch->ResetPlayTime();
- // 자동 저장 이벤트 추가
- ch->StartSaveEvent();
- ch->StartRecoveryEvent();
- ch->StartCheckSpeedHackEvent();
- CPVPManager::instance().Connect(ch);
- CPVPManager::instance().SendList(d);
- MessengerManager::instance().Login(ch->GetName());
- CPartyManager::instance().SetParty(ch);
- CGuildManager::instance().SendGuildWar(ch);
- building::CManager::instance().SendLandList(d, ch->GetMapIndex());
- marriage::CManager::instance().Login(ch);
- TPacketGCTime p;
- p.bHeader = HEADER_GC_TIME;
- p.time = get_global_time();
- d->Packet(&p, sizeof(p));
- TPacketGCChannel p2;
- p2.header = HEADER_GC_CHANNEL;
- p2.channel = g_bChannel;
- d->Packet(&p2, sizeof(p2));
- ch->SendGreetMessage();
- _send_bonus_info(ch);
- for (int i = 0; i <= PREMIUM_MAX_NUM; ++i)
- {
- int remain = ch->GetPremiumRemainSeconds(i);
- if (remain <= 0)
- continue;
- ch->AddAffect(AFFECT_PREMIUM_START + i, POINT_NONE, 0, 0, remain, 0, true);
- sys_log(0, "PREMIUM: %s type %d %dmin", ch->GetName(), i, remain);
- }
- if (LC_IsEurope())
- {
- ch->block_exp = false;
- if (g_bCheckClientVersion)
- {
- int version = atoi(g_stClientVersion.c_str());
- int date = atoi(d->GetClientVersion());
- sys_log(0, "VERSION CHECK %d %d %s %s", version, date, g_stClientVersion.c_str(), d->GetClientVersion());
- if (!d->GetClientVersion())
- {
- d->DelayedDisconnect(10);
- }
- else
- {
- //if (0 != g_stClientVersion.compare(d->GetClientVersion()))
- if (version > date)
- {
- ch->ChatPacket(CHAT_TYPE_NOTICE, LC_TEXT("클라이언트 버전이 틀려 로그아웃 됩니다. 정상적으로 패치 후 접속하세요."));
- d->DelayedDisconnect(10);
- LogManager::instance().HackLog("VERSION_CONFLICT", ch);
- sys_log(0, "VERSION : WRONG VERSION USER : account:%s name:%s hostName:%s server_version:%s client_version:%s",
- d->GetAccountTable().login,
- ch->GetName(),
- d->GetHostName(),
- g_stClientVersion.c_str(),
- d->GetClientVersion());
- }
- }
- }
- else
- {
- sys_log(0, "VERSION : NO CHECK");
- }
- }
- else
- {
- sys_log(0, "VERSION : NO LOGIN");
- }
- if (LC_IsEurope() == true)
- {
- if (ch->IsGM() == true)
- ch->ChatPacket(CHAT_TYPE_COMMAND, "ConsoleEnable");
- }
- if (ch->GetMapIndex() >= 10000)
- {
- if (CWarMapManager::instance().IsWarMap(ch->GetMapIndex()))
- ch->SetWarMap(CWarMapManager::instance().Find(ch->GetMapIndex()));
- else if (marriage::WeddingManager::instance().IsWeddingMap(ch->GetMapIndex()))
- ch->SetWeddingMap(marriage::WeddingManager::instance().Find(ch->GetMapIndex()));
- else {
- ch->SetDungeon(CDungeonManager::instance().FindByMapIndex(ch->GetMapIndex()));
- }
- }
- else if (CArenaManager::instance().IsArenaMap(ch->GetMapIndex()) == true)
- {
- int memberFlag = CArenaManager::instance().IsMember(ch->GetMapIndex(), ch->GetPlayerID());
- if (memberFlag == MEMBER_OBSERVER)
- {
- ch->SetObserverMode(true);
- ch->SetArenaObserverMode(true);
- if (CArenaManager::instance().RegisterObserverPtr(ch, ch->GetMapIndex(), ch->GetX()/100, ch->GetY()/100))
- {
- sys_log(0, "ARENA : Observer add failed");
- }
- if (ch->IsHorseRiding() == true)
- {
- ch->StopRiding();
- ch->HorseSummon(false);
- }
- }
- else if (memberFlag == MEMBER_DUELIST)
- {
- TPacketGCDuelStart duelStart;
- duelStart.header = HEADER_GC_DUEL_START;
- duelStart.wSize = sizeof(TPacketGCDuelStart);
- ch->GetDesc()->Packet(&duelStart, sizeof(TPacketGCDuelStart));
- if (ch->IsHorseRiding() == true)
- {
- ch->StopRiding();
- ch->HorseSummon(false);
- }
- LPPARTY pParty = ch->GetParty();
- if (pParty != NULL)
- {
- if (pParty->GetMemberCount() == 2)
- {
- CPartyManager::instance().DeleteParty(pParty);
- }
- else
- {
- pParty->Quit(ch->GetPlayerID());
- }
- }
- }
- else if (memberFlag == MEMBER_NO)
- {
- if (ch->GetGMLevel() == GM_PLAYER)
- ch->WarpSet(EMPIRE_START_X(ch->GetEmpire()), EMPIRE_START_Y(ch->GetEmpire()));
- }
- else
- {
- // wtf
- }
- }
- else if (ch->GetMapIndex() == 113)
- {
- // ox 이벤트 맵
- if (COXEventManager::instance().Enter(ch) == false)
- {
- // ox 맵 진입 허가가 나지 않음. 플레이어면 마을로 보내자
- if (ch->GetGMLevel() == GM_PLAYER)
- ch->WarpSet(EMPIRE_START_X(ch->GetEmpire()), EMPIRE_START_Y(ch->GetEmpire()));
- }
- }
- else
- {
- if (CWarMapManager::instance().IsWarMap(ch->GetMapIndex()) ||
- marriage::WeddingManager::instance().IsWeddingMap(ch->GetMapIndex()))
- {
- if (!test_server)
- ch->WarpSet(EMPIRE_START_X(ch->GetEmpire()), EMPIRE_START_Y(ch->GetEmpire()));
- }
- }
- // 청소년 보호
- if (g_TeenDesc) // BufferedPacket 사용 금지
- {
- TPacketGTLogin p;
- p.header = HEADER_GT_LOGIN;
- p.empty = 0;
- p.id = d->GetAccountTable().id;
- g_TeenDesc->Packet(&p, sizeof(p));
- sys_log(0, "TEEN_SEND: (%u, %s)", d->GetAccountTable().id, ch->GetName());
- }
- if (ch->GetHorseLevel() > 0)
- {
- DWORD pid = ch->GetPlayerID();
- if (pid != 0 && CHorseNameManager::instance().GetHorseName(pid) == NULL)
- db_clientdesc->DBPacket(HEADER_GD_REQ_HORSE_NAME, 0, &pid, sizeof(DWORD));
- }
- // 중립맵에 들어갔을때 안내하기
- if (g_noticeBattleZone)
- {
- if (FN_is_battle_zone(ch))
- {
- ch->ChatPacket(CHAT_TYPE_NOTICE, LC_TEXT("이 맵에선 강제적인 대전이 있을수 도 있습니다."));
- ch->ChatPacket(CHAT_TYPE_NOTICE, LC_TEXT("이 조항에 동의하지 않을시"));
- ch->ChatPacket(CHAT_TYPE_NOTICE, LC_TEXT("본인의 주성 및 부성으로 돌아가시기 바랍니다."));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement