Advertisement
Guest User

Untitled

a guest
Jul 28th, 2017
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.84 KB | None | 0 0
  1. void CInputLogin::Entergame(LPDESC d, const char * data)
  2. {
  3. LPCHARACTER ch;
  4.  
  5. if (!(ch = d->GetCharacter()))
  6. {
  7. d->SetPhase(PHASE_CLOSE);
  8. return;
  9. }
  10.  
  11. PIXEL_POSITION pos = ch->GetXYZ();
  12.  
  13. if (!SECTREE_MANAGER::instance().GetMovablePosition(ch->GetMapIndex(), pos.x, pos.y, pos))
  14. {
  15. PIXEL_POSITION pos2;
  16. SECTREE_MANAGER::instance().GetRecallPositionByEmpire(ch->GetMapIndex(), ch->GetEmpire(), pos2);
  17.  
  18. sys_err("!GetMovablePosition (name %s %dx%d map %d changed to %dx%d)",
  19. ch->GetName(),
  20. pos.x, pos.y,
  21. ch->GetMapIndex(),
  22. pos2.x, pos2.y);
  23. pos = pos2;
  24. }
  25.  
  26. CGuildManager::instance().LoginMember(ch);
  27.  
  28. // 캐릭터를 맵에 추가
  29. ch->Show(ch->GetMapIndex(), pos.x, pos.y, pos.z);
  30.  
  31. SECTREE_MANAGER::instance().SendNPCPosition(ch);
  32. ch->ReviveInvisible(5);
  33.  
  34. d->SetPhase(PHASE_GAME);
  35.  
  36. if(ch->GetItemAward_cmd()) //게임페이즈 들어가면
  37. quest::CQuestManager::instance().ItemInformer(ch->GetPlayerID(),ch->GetItemAward_vnum()); //questmanager 호출
  38.  
  39. sys_log(0, "ENTERGAME: %s %dx%dx%d %s map_index %d",
  40. ch->GetName(), ch->GetX(), ch->GetY(), ch->GetZ(), d->GetHostName(), ch->GetMapIndex());
  41.  
  42. if (ch->GetHorseLevel() > 0)
  43. {
  44. ch->EnterHorse();
  45. }
  46.  
  47. // 플레이시간 레코딩 시작
  48. ch->ResetPlayTime();
  49.  
  50. // 자동 저장 이벤트 추가
  51. ch->StartSaveEvent();
  52. ch->StartRecoveryEvent();
  53. ch->StartCheckSpeedHackEvent();
  54.  
  55. CPVPManager::instance().Connect(ch);
  56. CPVPManager::instance().SendList(d);
  57.  
  58. MessengerManager::instance().Login(ch->GetName());
  59.  
  60. CPartyManager::instance().SetParty(ch);
  61. CGuildManager::instance().SendGuildWar(ch);
  62.  
  63. building::CManager::instance().SendLandList(d, ch->GetMapIndex());
  64.  
  65. marriage::CManager::instance().Login(ch);
  66.  
  67. TPacketGCTime p;
  68. p.bHeader = HEADER_GC_TIME;
  69. p.time = get_global_time();
  70. d->Packet(&p, sizeof(p));
  71.  
  72. TPacketGCChannel p2;
  73. p2.header = HEADER_GC_CHANNEL;
  74. p2.channel = g_bChannel;
  75. d->Packet(&p2, sizeof(p2));
  76.  
  77. ch->SendGreetMessage();
  78.  
  79. _send_bonus_info(ch);
  80.  
  81. for (int i = 0; i <= PREMIUM_MAX_NUM; ++i)
  82. {
  83. int remain = ch->GetPremiumRemainSeconds(i);
  84.  
  85. if (remain <= 0)
  86. continue;
  87.  
  88. ch->AddAffect(AFFECT_PREMIUM_START + i, POINT_NONE, 0, 0, remain, 0, true);
  89. sys_log(0, "PREMIUM: %s type %d %dmin", ch->GetName(), i, remain);
  90. }
  91.  
  92. if (LC_IsEurope())
  93. {
  94. ch->block_exp = false;
  95. if (g_bCheckClientVersion)
  96. {
  97. int version = atoi(g_stClientVersion.c_str());
  98. int date = atoi(d->GetClientVersion());
  99.  
  100. sys_log(0, "VERSION CHECK %d %d %s %s", version, date, g_stClientVersion.c_str(), d->GetClientVersion());
  101.  
  102. if (!d->GetClientVersion())
  103. {
  104. d->DelayedDisconnect(10);
  105. }
  106. else
  107. {
  108. //if (0 != g_stClientVersion.compare(d->GetClientVersion()))
  109. if (version > date)
  110. {
  111. ch->ChatPacket(CHAT_TYPE_NOTICE, LC_TEXT("클라이언트 버전이 틀려 로그아웃 됩니다. 정상적으로 패치 후 접속하세요."));
  112. d->DelayedDisconnect(10);
  113. LogManager::instance().HackLog("VERSION_CONFLICT", ch);
  114.  
  115. sys_log(0, "VERSION : WRONG VERSION USER : account:%s name:%s hostName:%s server_version:%s client_version:%s",
  116. d->GetAccountTable().login,
  117. ch->GetName(),
  118. d->GetHostName(),
  119. g_stClientVersion.c_str(),
  120. d->GetClientVersion());
  121. }
  122. }
  123. }
  124. else
  125. {
  126. sys_log(0, "VERSION : NO CHECK");
  127. }
  128. }
  129. else
  130. {
  131. sys_log(0, "VERSION : NO LOGIN");
  132. }
  133.  
  134. if (LC_IsEurope() == true)
  135. {
  136. if (ch->IsGM() == true)
  137. ch->ChatPacket(CHAT_TYPE_COMMAND, "ConsoleEnable");
  138. }
  139.  
  140. if (ch->GetMapIndex() >= 10000)
  141. {
  142. if (CWarMapManager::instance().IsWarMap(ch->GetMapIndex()))
  143. ch->SetWarMap(CWarMapManager::instance().Find(ch->GetMapIndex()));
  144. else if (marriage::WeddingManager::instance().IsWeddingMap(ch->GetMapIndex()))
  145. ch->SetWeddingMap(marriage::WeddingManager::instance().Find(ch->GetMapIndex()));
  146. else {
  147. ch->SetDungeon(CDungeonManager::instance().FindByMapIndex(ch->GetMapIndex()));
  148. }
  149. }
  150. else if (CArenaManager::instance().IsArenaMap(ch->GetMapIndex()) == true)
  151. {
  152. int memberFlag = CArenaManager::instance().IsMember(ch->GetMapIndex(), ch->GetPlayerID());
  153. if (memberFlag == MEMBER_OBSERVER)
  154. {
  155. ch->SetObserverMode(true);
  156. ch->SetArenaObserverMode(true);
  157. if (CArenaManager::instance().RegisterObserverPtr(ch, ch->GetMapIndex(), ch->GetX()/100, ch->GetY()/100))
  158. {
  159. sys_log(0, "ARENA : Observer add failed");
  160. }
  161.  
  162. if (ch->IsHorseRiding() == true)
  163. {
  164. ch->StopRiding();
  165. ch->HorseSummon(false);
  166. }
  167. }
  168. else if (memberFlag == MEMBER_DUELIST)
  169. {
  170. TPacketGCDuelStart duelStart;
  171. duelStart.header = HEADER_GC_DUEL_START;
  172. duelStart.wSize = sizeof(TPacketGCDuelStart);
  173.  
  174. ch->GetDesc()->Packet(&duelStart, sizeof(TPacketGCDuelStart));
  175.  
  176. if (ch->IsHorseRiding() == true)
  177. {
  178. ch->StopRiding();
  179. ch->HorseSummon(false);
  180. }
  181.  
  182. LPPARTY pParty = ch->GetParty();
  183. if (pParty != NULL)
  184. {
  185. if (pParty->GetMemberCount() == 2)
  186. {
  187. CPartyManager::instance().DeleteParty(pParty);
  188. }
  189. else
  190. {
  191. pParty->Quit(ch->GetPlayerID());
  192. }
  193. }
  194. }
  195. else if (memberFlag == MEMBER_NO)
  196. {
  197. if (ch->GetGMLevel() == GM_PLAYER)
  198. ch->WarpSet(EMPIRE_START_X(ch->GetEmpire()), EMPIRE_START_Y(ch->GetEmpire()));
  199. }
  200. else
  201. {
  202. // wtf
  203. }
  204. }
  205. else if (ch->GetMapIndex() == 113)
  206. {
  207. // ox 이벤트 맵
  208. if (COXEventManager::instance().Enter(ch) == false)
  209. {
  210. // ox 맵 진입 허가가 나지 않음. 플레이어면 마을로 보내자
  211. if (ch->GetGMLevel() == GM_PLAYER)
  212. ch->WarpSet(EMPIRE_START_X(ch->GetEmpire()), EMPIRE_START_Y(ch->GetEmpire()));
  213. }
  214. }
  215. else
  216. {
  217. if (CWarMapManager::instance().IsWarMap(ch->GetMapIndex()) ||
  218. marriage::WeddingManager::instance().IsWeddingMap(ch->GetMapIndex()))
  219. {
  220. if (!test_server)
  221. ch->WarpSet(EMPIRE_START_X(ch->GetEmpire()), EMPIRE_START_Y(ch->GetEmpire()));
  222. }
  223. }
  224.  
  225. // 청소년 보호
  226. if (g_TeenDesc) // BufferedPacket 사용 금지
  227. {
  228. TPacketGTLogin p;
  229.  
  230. p.header = HEADER_GT_LOGIN;
  231. p.empty = 0;
  232. p.id = d->GetAccountTable().id;
  233.  
  234. g_TeenDesc->Packet(&p, sizeof(p));
  235. sys_log(0, "TEEN_SEND: (%u, %s)", d->GetAccountTable().id, ch->GetName());
  236. }
  237.  
  238. if (ch->GetHorseLevel() > 0)
  239. {
  240. DWORD pid = ch->GetPlayerID();
  241.  
  242. if (pid != 0 && CHorseNameManager::instance().GetHorseName(pid) == NULL)
  243. db_clientdesc->DBPacket(HEADER_GD_REQ_HORSE_NAME, 0, &pid, sizeof(DWORD));
  244. }
  245.  
  246. // 중립맵에 들어갔을때 안내하기
  247. if (g_noticeBattleZone)
  248. {
  249. if (FN_is_battle_zone(ch))
  250. {
  251. ch->ChatPacket(CHAT_TYPE_NOTICE, LC_TEXT("이 맵에선 강제적인 대전이 있을수 도 있습니다."));
  252. ch->ChatPacket(CHAT_TYPE_NOTICE, LC_TEXT("이 조항에 동의하지 않을시"));
  253. ch->ChatPacket(CHAT_TYPE_NOTICE, LC_TEXT("본인의 주성 및 부성으로 돌아가시기 바랍니다."));
  254. }
  255. }
  256. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement