Core/PacketIO: Implemented splash screen opcodes
Port From (https://github.com/TrinityCore/TrinityCore/commit/14b8d7d8393bb99ef66ec833bf89c3d6ce7683ab)
This commit is contained in:
@@ -331,6 +331,7 @@ namespace Game.DataStorage
|
||||
UiMapAssignmentStorage = ReadDB2<UiMapAssignmentRecord>("UiMapAssignment.db2", HotfixStatements.SEL_UI_MAP_ASSIGNMENT);
|
||||
UiMapLinkStorage = ReadDB2<UiMapLinkRecord>("UiMapLink.db2", HotfixStatements.SEL_UI_MAP_LINK);
|
||||
UiMapXMapArtStorage = ReadDB2<UiMapXMapArtRecord>("UiMapXMapArt.db2", HotfixStatements.SEL_UI_MAP_X_MAP_ART);
|
||||
UISplashScreenStorage = ReadDB2<UISplashScreenRecord>("UISplashScreen.db2", HotfixStatements.SEL_UI_SPLASH_SCREEN, HotfixStatements.SEL_UI_SPLASH_SCREEN_LOCALE);
|
||||
UnitPowerBarStorage = ReadDB2<UnitPowerBarRecord>("UnitPowerBar.db2", HotfixStatements.SEL_UNIT_POWER_BAR, HotfixStatements.SEL_UNIT_POWER_BAR_LOCALE);
|
||||
VehicleStorage = ReadDB2<VehicleRecord>("Vehicle.db2", HotfixStatements.SEL_VEHICLE);
|
||||
VehicleSeatStorage = ReadDB2<VehicleSeatRecord>("VehicleSeat.db2", HotfixStatements.SEL_VEHICLE_SEAT);
|
||||
@@ -715,6 +716,7 @@ namespace Game.DataStorage
|
||||
public static DB6Storage<UiMapAssignmentRecord> UiMapAssignmentStorage;
|
||||
public static DB6Storage<UiMapLinkRecord> UiMapLinkStorage;
|
||||
public static DB6Storage<UiMapXMapArtRecord> UiMapXMapArtStorage;
|
||||
public static DB6Storage<UISplashScreenRecord> UISplashScreenStorage;
|
||||
public static DB6Storage<UnitPowerBarRecord> UnitPowerBarStorage;
|
||||
public static DB6Storage<VehicleRecord> VehicleStorage;
|
||||
public static DB6Storage<VehicleSeatRecord> VehicleSeatStorage;
|
||||
|
||||
@@ -74,6 +74,26 @@ namespace Game.DataStorage
|
||||
public uint UiMapID;
|
||||
}
|
||||
|
||||
public sealed class UISplashScreenRecord
|
||||
{
|
||||
public uint Id;
|
||||
public string Header;
|
||||
public string TopLeftFeatureTitle;
|
||||
public string TopLeftFeatureDesc;
|
||||
public string BottomLeftFeatureTitle;
|
||||
public string BottomLeftFeatureDesc;
|
||||
public string RightFeatureTitle;
|
||||
public string RightFeatureDesc;
|
||||
public int AllianceQuestID;
|
||||
public int HordeQuestID;
|
||||
public sbyte ScreenType;
|
||||
public int TextureKitID;
|
||||
public int SoundKitID;
|
||||
public int PlayerConditionID;
|
||||
public int CharLevelConditionID;
|
||||
public int RequiredTimeEventPassed; // serverside TimeEvent table, see ModifierTreeType::HasTimeEventPassed
|
||||
}
|
||||
|
||||
public sealed class UnitPowerBarRecord
|
||||
{
|
||||
public uint Id;
|
||||
|
||||
@@ -464,6 +464,25 @@ namespace Game
|
||||
Global.ScriptMgr.OnConversationLineStarted(convo, conversationLineStarted.LineID, _player);
|
||||
}
|
||||
|
||||
[WorldPacketHandler(ClientOpcodes.RequestLatestSplashScreen)]
|
||||
void HandleRequestLatestSplashScreen(RequestLatestSplashScreen requestLatestSplashScreen)
|
||||
{
|
||||
UISplashScreenRecord splashScreen = null;
|
||||
foreach (var itr in CliDB.UISplashScreenStorage.Values)
|
||||
{
|
||||
PlayerConditionRecord playerCondition = CliDB.PlayerConditionStorage.LookupByKey(itr.CharLevelConditionID);
|
||||
if (playerCondition != null)
|
||||
if (!ConditionManager.IsPlayerMeetingCondition(_player, playerCondition))
|
||||
continue;
|
||||
|
||||
splashScreen = itr;
|
||||
}
|
||||
|
||||
SplashScreenShowLatest splashScreenShowLatest = new();
|
||||
splashScreenShowLatest.UISplashScreenID = splashScreen != null ? splashScreen.Id : 0;
|
||||
SendPacket(splashScreenShowLatest);
|
||||
}
|
||||
|
||||
[WorldPacketHandler(ClientOpcodes.ChatUnregisterAllAddonPrefixes)]
|
||||
void HandleUnregisterAllAddonPrefixes(ChatUnregisterAllAddonPrefixes packet)
|
||||
{
|
||||
|
||||
@@ -1263,6 +1263,25 @@ namespace Game.Networking.Packets
|
||||
LineID = _worldPacket.ReadUInt32();
|
||||
}
|
||||
}
|
||||
|
||||
class RequestLatestSplashScreen : ClientPacket
|
||||
{
|
||||
public RequestLatestSplashScreen(WorldPacket packet) : base(packet) { }
|
||||
|
||||
public override void Read() { }
|
||||
}
|
||||
|
||||
class SplashScreenShowLatest : ServerPacket
|
||||
{
|
||||
public SplashScreenShowLatest() : base(ServerOpcodes.SplashScreenShowLatest, ConnectionType.Instance) { }
|
||||
|
||||
public override void Write()
|
||||
{
|
||||
_worldPacket.WriteUInt32(UISplashScreenID);
|
||||
}
|
||||
|
||||
public uint UISplashScreenID;
|
||||
}
|
||||
|
||||
class DisplayGameError : ServerPacket
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user