/
NLObP
/
AAEmu
Обзор
Документация
Войти
/
NLObP
/
AAEmu
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
develop
AAEmu.Game/Core/Packets/Proxy/FinishStatePacket.cs
82 строки
4 KB
Roger Barreto
Adding Dictionary, Cleaning all warnings (#1109)
10 дек 2024, 19:51
Не верифицирован
10 дек 2024, 19:51
7605fdd
Код
Авторство
О чём код?
using AAEmu.Commons.Network; using AAEmu.Game.Core.Managers.World; using AAEmu.Game.Core.Network.Game; using AAEmu.Game.Core.Packets.G2C; namespace AAEmu.Game.Core.Packets.Proxy; public class FinishStatePacket : GamePacket { private readonly bool[] _scAccountInitPacket = [false, true]; private readonly byte[] _scLevelRestrictionInitPacket = [0, 15, 15, 15, 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, 15]; public FinishStatePacket() : base(PPOffsets.FinishStatePacket, 2) { } public override void Read(PacketStream stream) { var state = stream.ReadInt32(); switch (state) { case 0: Connection.SendPacket(new ChangeStatePacket(1)); // Connection.SendPacket(new SCHackGuardRetAddrsRequestPacket(false, false)); // HG_REQ? // TODO - config files var levelname = string.Empty; if (Connection.ActiveChar != null) { levelname = ZoneManager.Instance.GetZoneByKey(Connection.ActiveChar.Transform.ZoneId)?.Name ?? "w_hanuimaru_1"; } else { levelname = "w_hanuimaru_1"; } Connection.SendPacket(new SetGameTypePacket(levelname, 0, 1)); // TODO - level Connection.SendPacket(new SCInitialConfigPacket()); // Test URLs // Original Trion values // Client treats these as folders and will add a trailing slash (/) with whatever it needs // For example, opening the Wiki would send http://localhost/aaemu/platform/login var authUrl = "http://localhost/aaemu/login"; // "https://session.draft.integration.triongames.priv"; var platformUrl = "http://localhost/aaemu/platform"; // "http://archeage.draft.integration.triongames.priv/commerce/pruchase/credits/purchase-credits-flow.action"; var commerceUrl = "http://localhost/aaemu/shop"; // "" ; // It seems this packet can be ignored if you don't use the wiki/shop Connection.SendPacket(new SCTrionConfigPacket( true, authUrl, platformUrl, commerceUrl) ); // TODO - config files Connection.SendPacket(new SCAccountInfoPacket( (int)Connection.Payment.Method, Connection.Payment.Location, Connection.Payment.StartTime, Connection.Payment.EndTime) ); Connection.SendPacket(new SCChatSpamDelayPacket()); Connection.SendPacket(new SCAccountAttributeConfigPacket(_scAccountInitPacket)); // TODO Connection.SendPacket(new SCLevelRestrictionConfigPacket(10, 10, 10, 10, 10, _scLevelRestrictionInitPacket)); // TODO - config files break; case 1: Connection.SendPacket(new ChangeStatePacket(2)); break; case 2: Connection.SendPacket(new ChangeStatePacket(3)); break; case 3: case 4: case 5: case 6: Connection.SendPacket(new ChangeStatePacket(state + 1)); break; case 7: Connection.SendPacket(new SCUpdatePremiumPointPacket(1, 1, 1)); break; default: Logger.Info("Unknown state: {0}", state); break; } } }