MCPcopy Create free account
hub / github.com/Frontrooms/3.0-GC / onLogin

Method onLogin

src/main/java/emu/grasscutter/game/player/Player.java:1487–1563  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1485 }
1486
1487 public void onLogin() {
1488 // Quest - Commented out because a problem is caused if you log out while this quest is active
1489 /*
1490 if (getQuestManager().getMainQuestById(351) == null) {
1491 GameQuest quest = getQuestManager().addQuest(35104);
1492 if (quest != null) {
1493 quest.finish();
1494 }
1495 getQuestManager().addQuest(35101);
1496
1497 this.setSceneId(3);
1498 this.getPos().set(GameConstants.START_POSITION);
1499 }
1500 */
1501
1502 // Create world
1503 World world = new World(this);
1504 world.addPlayer(this);
1505
1506 // Multiplayer setting
1507 this.setProperty(PlayerProperty.PROP_PLAYER_MP_SETTING_TYPE, this.getMpSetting().getNumber(), false);
1508 this.setProperty(PlayerProperty.PROP_IS_MP_MODE_AVAILABLE, 1, false);
1509
1510 // Execute daily reset logic if this is a new day.
1511 this.doDailyReset();
1512
1513 // Packets
1514 session.send(new PacketPlayerDataNotify(this)); // Player data
1515 session.send(new PacketStoreWeightLimitNotify());
1516 session.send(new PacketPlayerStoreNotify(this));
1517 session.send(new PacketAvatarDataNotify(this));
1518 session.send(new PacketFinishedParentQuestNotify(this));
1519 session.send(new PacketBattlePassAllDataNotify(this));
1520 session.send(new PacketQuestListNotify(this));
1521 session.send(new PacketCodexDataFullNotify(this));
1522 session.send(new PacketAllWidgetDataNotify(this));
1523 session.send(new PacketWidgetGadgetAllDataNotify());
1524 session.send(new PacketCombineDataNotify(this.unlockedCombines));
1525 this.forgingManager.sendForgeDataNotify();
1526 this.resinManager.onPlayerLogin();
1527 this.cookingManager.sendCookDataNofity();
1528 getTodayMoonCard(); // The timer works at 0:0, some users log in after that, use this method to check if they have received a reward today or not. If not, send the reward.
1529
1530 // Battle Pass trigger
1531 this.getBattlePassManager().triggerMission(WatcherTriggerType.TRIGGER_LOGIN);
1532
1533 this.furnitureManager.onLogin();
1534 // Home
1535 home = GameHome.getByUid(getUid());
1536 home.onOwnerLogin(this);
1537 // Activity
1538 activityManager = new ActivityManager(this);
1539
1540 session.send(new PacketPlayerEnterSceneNotify(this)); // Enter game world
1541 session.send(new PacketPlayerLevelRewardUpdateNotify(rewardedLevels));
1542 session.send(new PacketOpenStateUpdateNotify());
1543
1544 // First notify packets sent

Callers 2

handleMethod · 0.45
handleMethod · 0.45

Calls 15

addPlayerMethod · 0.95
setPropertyMethod · 0.95
getMpSettingMethod · 0.95
doDailyResetMethod · 0.95
getTodayMoonCardMethod · 0.95
getBattlePassManagerMethod · 0.95
getByUidMethod · 0.95
getUidMethod · 0.95
getServerMethod · 0.95
getProfileMethod · 0.95
sendMethod · 0.80

Tested by

no test coverage detected