mirror of
https://bitbucket.org/Ioncannon/project-meteor-server.git
synced 2025-07-25 03:48:23 +02:00
Merge branch 'master' into develop
# Conflicts: # FFXIVClassic Map Server/CommandProcessor.cs
This commit is contained in:
commit
fec348136e
55 changed files with 37771 additions and 35959 deletions
|
@ -102,7 +102,6 @@ namespace FFXIVClassic_Lobby_Server
|
|||
public void doWarp(ConnectedPlayer client, uint id)
|
||||
{
|
||||
WorldManager worldManager = Server.GetWorldManager();
|
||||
|
||||
FFXIVClassic_Map_Server.WorldManager.ZoneEntrance ze = worldManager.getZoneEntrance(id);
|
||||
|
||||
if (ze == null)
|
||||
|
@ -119,10 +118,9 @@ namespace FFXIVClassic_Lobby_Server
|
|||
}
|
||||
}
|
||||
|
||||
public void doWarp(ConnectedPlayer client, uint zoneId, string privateArea, float x, float y, float z, float r)
|
||||
public void doWarp(ConnectedPlayer client, uint zoneId, string privateArea, byte spawnType, float x, float y, float z, float r)
|
||||
{
|
||||
WorldManager worldManager = Server.GetWorldManager();
|
||||
|
||||
if (worldManager.GetZone(zoneId) == null)
|
||||
{
|
||||
if (client != null)
|
||||
|
@ -131,12 +129,12 @@ namespace FFXIVClassic_Lobby_Server
|
|||
}
|
||||
|
||||
if (client != null)
|
||||
worldManager.DoZoneChange(client.getActor(), zoneId, privateArea, 0x2, x, y, z, r);
|
||||
worldManager.DoZoneChange(client.getActor(), zoneId, privateArea, spawnType, x, y, z, r);
|
||||
else
|
||||
{
|
||||
foreach (KeyValuePair<uint, ConnectedPlayer> entry in mConnectedPlayerList)
|
||||
{
|
||||
worldManager.DoZoneChange(entry.Value.getActor(), zoneId, privateArea, 0x2, x, y, z, r);
|
||||
worldManager.DoZoneChange(entry.Value.getActor(), zoneId, privateArea, spawnType, x, y, z, r);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -149,7 +147,7 @@ namespace FFXIVClassic_Lobby_Server
|
|||
client.queuePacket(BasePacket.createPacket(SendMessagePacket.buildPacket(client.actorID, client.actorID, SendMessagePacket.MESSAGE_TYPE_GENERAL_INFO, "", String.Format("{0}\'s position: ZoneID: {1}, X: {2}, Y: {3}, Z: {4}, Rotation: {5}", p.customDisplayName, p.zoneId, p.positionX, p.positionY, p.positionZ, p.rotation)), true, false));
|
||||
}
|
||||
else
|
||||
{
|
||||
{
|
||||
foreach (KeyValuePair<uint, ConnectedPlayer> entry in mConnectedPlayerList)
|
||||
{
|
||||
Player p = entry.Value.getActor();
|
||||
|
@ -397,7 +395,7 @@ namespace FFXIVClassic_Lobby_Server
|
|||
#endregion
|
||||
|
||||
sendMessage(client, String.Format("Warping to: ZoneID: {0} X: {1}, Y: {2}, Z: {3}", zoneId, x, y, z));
|
||||
doWarp(client, zoneId, privatearea, x, y, z, r);
|
||||
doWarp(client, zoneId, privatearea, 0x00, x, y, z, r);
|
||||
}
|
||||
else if (split.Length == 5)
|
||||
{
|
||||
|
@ -423,7 +421,7 @@ namespace FFXIVClassic_Lobby_Server
|
|||
#endregion
|
||||
|
||||
sendMessage(client, String.Format("Warping to: ZoneID: {0} X: {1}, Y: {2}, Z: {3}", zoneId, x, y, z));
|
||||
doWarp(client, zoneId, privatearea, x, y, z, r);
|
||||
doWarp(client, zoneId, privatearea, 0x2, x, y, z, r);
|
||||
}
|
||||
else if (split.Length == 6)
|
||||
{
|
||||
|
@ -451,12 +449,42 @@ namespace FFXIVClassic_Lobby_Server
|
|||
#endregion
|
||||
|
||||
sendMessage(client, String.Format("Warping to: ZoneID: {0} X: {1}, Y: {2}, Z: {3}", zoneId, x, y, z));
|
||||
doWarp(client, zoneId, privatearea, x, y, z, r);
|
||||
doWarp(client, zoneId, privatearea, 0x2, x, y, z, r);
|
||||
}
|
||||
else
|
||||
return; // catch any invalid warps here
|
||||
}
|
||||
|
||||
private void doWeather(ConnectedPlayer client, string weatherID, string value)
|
||||
{
|
||||
ushort weather = Convert.ToUInt16(weatherID);
|
||||
|
||||
if (client != null)
|
||||
{
|
||||
client.queuePacket(BasePacket.createPacket(SetWeatherPacket.buildPacket(client.actorID, weather, Convert.ToUInt16(value)), true, false));
|
||||
}
|
||||
|
||||
/*
|
||||
* WIP: Change weather serverside, currently only clientside
|
||||
*
|
||||
uint currentZoneID;
|
||||
if (client != null)
|
||||
{
|
||||
currentZoneID = client.getActor().zoneId;
|
||||
|
||||
foreach (KeyValuePair<uint, ConnectedPlayer> entry in mConnectedPlayerList)
|
||||
{
|
||||
// Change the weather for everyone in the same zone
|
||||
if (currentZoneID == entry.Value.getActor().zoneId)
|
||||
{
|
||||
BasePacket weatherPacket = BasePacket.createPacket(SetWeatherPacket.buildPacket(entry.Value.actorID, weather), true, false);
|
||||
entry.Value.queuePacket(weatherPacket);
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// We only use the default options for SendMessagePacket.
|
||||
/// May as well make it less unwieldly to view
|
||||
|
@ -525,12 +553,49 @@ namespace FFXIVClassic_Lobby_Server
|
|||
else if (split[1].Equals("setgraphic"))
|
||||
sendMessage(client, Resources.CPsetgraphic);
|
||||
*/
|
||||
}
|
||||
if (split.Length == 3)
|
||||
{
|
||||
if(split[1].Equals("test"))
|
||||
{
|
||||
if (split[2].Equals("weather"))
|
||||
sendMessage(client, Resources.CPtestweather);
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region !test
|
||||
else if (split[0].Equals("test"))
|
||||
{
|
||||
if (split.Length == 1)
|
||||
{
|
||||
// catch invalid commands
|
||||
sendMessage(client, Resources.CPhelp);
|
||||
}
|
||||
else if (split.Length >= 2)
|
||||
{
|
||||
#region !test weather
|
||||
if (split[1].Equals("weather"))
|
||||
{
|
||||
try
|
||||
{
|
||||
doWeather(client, split[2], split[3]);
|
||||
return true;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Log.error("Could not change weather: " + e);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region !mypos
|
||||
else if (split[0].Equals("mypos"))
|
||||
{
|
||||
|
|
|
@ -64,7 +64,7 @@ namespace FFXIVClassic_Map_Server.Properties {
|
|||
/// Looks up a localized string similar to Adds the specified currency to the current player's inventory
|
||||
///
|
||||
///*Syntax: givecurrency <quantity>
|
||||
/// givecurrency <quantity> <type>
|
||||
/// givecurrency <type> <quantity>
|
||||
///<type> is the specific type of currency desired, defaults to gil if no type specified.
|
||||
/// </summary>
|
||||
public static string CPgivecurrency {
|
||||
|
@ -105,7 +105,8 @@ namespace FFXIVClassic_Map_Server.Properties {
|
|||
///
|
||||
///Available commands:
|
||||
///Standard: mypos, music, warp
|
||||
///Server Administration: givecurrency, giveitem, givekeyitem, removecurrency, removekeyitem, reloaditems, reloadzones.
|
||||
///Server Administration: givecurrency, giveitem, givekeyitem, removecurrency, removekeyitem, reloaditems, reloadzones
|
||||
///Test: test weather.
|
||||
/// </summary>
|
||||
public static string CPhelp {
|
||||
get {
|
||||
|
@ -117,7 +118,7 @@ namespace FFXIVClassic_Map_Server.Properties {
|
|||
/// Looks up a localized string similar to Changes the currently playing background music
|
||||
///
|
||||
///*Syntax: music <music id>
|
||||
///<music id> is the key item's specific id as defined in the server database.
|
||||
///<music id> is the music's specific id as defined in the client.
|
||||
/// </summary>
|
||||
public static string CPmusic {
|
||||
get {
|
||||
|
@ -176,7 +177,7 @@ namespace FFXIVClassic_Map_Server.Properties {
|
|||
/// Looks up a localized string similar to Removes the specified currency from the current player's inventory
|
||||
///
|
||||
///*Syntax: removecurrency <quantity>
|
||||
/// removecurrency <quantity> <type>
|
||||
/// removecurrency <type> <quantity>
|
||||
///<type> is the specific type of currency desired, defaults to gil if no type specified.
|
||||
/// </summary>
|
||||
public static string CPremovecurrency {
|
||||
|
@ -236,6 +237,18 @@ namespace FFXIVClassic_Map_Server.Properties {
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Changes the current weather
|
||||
///
|
||||
///*Syntax: test weather <weather id>
|
||||
///<weather id> is the weather's specific id as defined in the client.
|
||||
/// </summary>
|
||||
public static string CPtestweather {
|
||||
get {
|
||||
return ResourceManager.GetString("CPtestweather", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Teleports the player to the specified location
|
||||
///
|
||||
|
|
|
@ -121,7 +121,7 @@
|
|||
<value>Adds the specified currency to the current player's inventory
|
||||
|
||||
*Syntax: givecurrency <quantity>
|
||||
givecurrency <quantity> <type>
|
||||
givecurrency <type> <quantity>
|
||||
<type> is the specific type of currency desired, defaults to gil if no type specified</value>
|
||||
</data>
|
||||
<data name="CPgiveitem" xml:space="preserve">
|
||||
|
@ -144,13 +144,14 @@
|
|||
|
||||
Available commands:
|
||||
Standard: mypos, music, warp
|
||||
Server Administration: givecurrency, giveitem, givekeyitem, removecurrency, removekeyitem, reloaditems, reloadzones</value>
|
||||
Server Administration: givecurrency, giveitem, givekeyitem, removecurrency, removekeyitem, reloaditems, reloadzones
|
||||
Test: test weather</value>
|
||||
</data>
|
||||
<data name="CPmusic" xml:space="preserve">
|
||||
<value>Changes the currently playing background music
|
||||
|
||||
*Syntax: music <music id>
|
||||
<music id> is the key item's specific id as defined in the server database</value>
|
||||
<music id> is the music's specific id as defined in the client</value>
|
||||
</data>
|
||||
<data name="CPmypos" xml:space="preserve">
|
||||
<value>Prints out your current location
|
||||
|
@ -173,7 +174,7 @@ Server Administration: givecurrency, giveitem, givekeyitem, removecurrency, remo
|
|||
<value>Removes the specified currency from the current player's inventory
|
||||
|
||||
*Syntax: removecurrency <quantity>
|
||||
removecurrency <quantity> <type>
|
||||
removecurrency <type> <quantity>
|
||||
<type> is the specific type of currency desired, defaults to gil if no type specified</value>
|
||||
</data>
|
||||
<data name="CPremoveitem" xml:space="preserve">
|
||||
|
@ -202,6 +203,12 @@ Server Administration: givecurrency, giveitem, givekeyitem, removecurrency, remo
|
|||
|
||||
*Syntax: sendpacket <slot> <wid> <eid> <vid> <cid>
|
||||
<w/e/v/c id> are as defined in the client game data</value>
|
||||
</data>
|
||||
<data name="CPtestweather" xml:space="preserve">
|
||||
<value>Changes the current weather
|
||||
|
||||
*Syntax: test weather <weather id>
|
||||
<weather id> is the weather's specific id as defined in the client</value>
|
||||
</data>
|
||||
<data name="CPwarp" xml:space="preserve">
|
||||
<value>Teleports the player to the specified location
|
||||
|
|
|
@ -479,7 +479,7 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||
queuePacket(SetActorIsZoningPacket.buildPacket(actorId, actorId, false));
|
||||
queuePacket(_0x10Packet.buildPacket(actorId, 0xFF));
|
||||
queuePacket(SetMusicPacket.buildPacket(actorId, zone.bgmDay, 0x01));
|
||||
queuePacket(SetWeatherPacket.buildPacket(actorId, SetWeatherPacket.WEATHER_CLEAR));
|
||||
queuePacket(SetWeatherPacket.buildPacket(actorId, SetWeatherPacket.WEATHER_CLEAR, 1));
|
||||
|
||||
queuePacket(SetMapPacket.buildPacket(actorId, zone.regionId, zone.actorId));
|
||||
|
||||
|
@ -522,6 +522,7 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||
BasePacket areaMasterSpawn = zone.getSpawnPackets(actorId);
|
||||
BasePacket debugSpawn = world.GetDebugActor().getSpawnPackets(actorId);
|
||||
BasePacket worldMasterSpawn = world.GetActor().getSpawnPackets(actorId);
|
||||
BasePacket weatherDirectorSpawn = new WeatherDirector(this, 8003).getSpawnPackets(actorId);
|
||||
BasePacket directorSpawn = null;
|
||||
|
||||
if (currentDirector != null)
|
||||
|
@ -550,6 +551,9 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||
packet.debugPrintSubPacket();
|
||||
queuePacket(packet);
|
||||
}
|
||||
|
||||
playerSession.queuePacket(weatherDirectorSpawn);
|
||||
|
||||
/*
|
||||
#region hardcode
|
||||
BasePacket reply10 = new BasePacket("./packets/login/login10.bin"); //Item Storage, Inn Door created
|
||||
|
|
|
@ -21,9 +21,11 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||
this.weatherId = weatherId;
|
||||
|
||||
this.displayNameId = 0;
|
||||
this.customDisplayName = String.Format("weatherDire_{0}", zone.zoneName, zone.actorId);
|
||||
|
||||
this.actorName = String.Format("weatherDire_{0}@{0:04x}", zone.zoneName, zone.actorId);
|
||||
this.customDisplayName = String.Format("weatherDire_{0}_{1}", player.zone.zoneName, "07");
|
||||
|
||||
this.actorName = String.Format("weatherDire_{0}_{1}@{2:x3}{3:x2}", player.zone.zoneName, "04", player.zoneId, 0);
|
||||
|
||||
this.className = "Debug";
|
||||
}
|
||||
|
||||
|
|
|
@ -26,9 +26,9 @@ namespace FFXIVClassic_Map_Server.lua
|
|||
player.playerSession.queuePacket(SetMusicPacket.buildPacket(player.actorId, musicID, playMode), true, false);
|
||||
}
|
||||
|
||||
public void setWeather(uint weatherID)
|
||||
public void setWeather(ushort weatherID)
|
||||
{
|
||||
player.playerSession.queuePacket(SetWeatherPacket.buildPacket(player.actorId, weatherID), true, false);
|
||||
player.playerSession.queuePacket(SetWeatherPacket.buildPacket(player.actorId, weatherID, 1), true, false);
|
||||
}
|
||||
|
||||
public void getParameter(string paramName)
|
||||
|
|
|
@ -1,43 +1,49 @@
|
|||
using FFXIVClassic_Lobby_Server.packets;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send
|
||||
{
|
||||
class SetWeatherPacket
|
||||
{
|
||||
//TODO: Fix these ids!
|
||||
public const uint WEATHER_CLEAR = 0x011F41;
|
||||
public const uint WEATHER_FINE = 0x011F42;
|
||||
public const uint WEATHER_CLOUDY = 0x011F3;
|
||||
public const uint WEATHER_FOGGY = 0x011F4;
|
||||
public const uint WEATHER_WINDY = 0x011F5; //NOT SUPPORTED in v1.23
|
||||
public const uint WEATHER_BLUSTERY = 0x011F6;
|
||||
public const uint WEATHER_RAINY = 0x011F7;
|
||||
public const uint WEATHER_SHOWERY = 0x011F8; //NOT SUPPORTED in v1.23
|
||||
public const uint WEATHER_THUNDERY = 0x011F9; //NOT SUPPORTED in v1.23
|
||||
public const uint WEATHER_STORMY = 0x011FA;
|
||||
public const uint WEATHER_DUSTY = 0x011FB; //NOT SUPPORTED in v1.23
|
||||
public const uint WEATHER_SANDY = 0x011FC;
|
||||
public const uint WEATHER_IFRIT = 0x011F4E;
|
||||
public const uint WEATHER_GARUDA = 0x011F5C;
|
||||
public const uint WEATHER_BLISTERIN = 0x011FD; //NOT SUPPORTED in v1.23
|
||||
public const uint WEATHER_SNOWY = 0x011FE; //NOT SUPPORTED in v1.23
|
||||
public const uint WEATHER_WINTRY = 0x011FF; //NOT SUPPORTED in v1.23
|
||||
public const uint WEATHER_GLOOMY = 0x01200;
|
||||
public const uint WEATHER_PREDALAMUD = 0x011F5F;
|
||||
public const uint WEATHER_DALAMUD = 0x011F5E;
|
||||
public const uint WEATHER_SCARYDALAMUD = 0x011F60;
|
||||
|
||||
public const ushort OPCODE = 0x000D;
|
||||
public const uint PACKET_SIZE = 0x28;
|
||||
|
||||
public static SubPacket buildPacket(uint playerActorID, long weatherId)
|
||||
{
|
||||
return new SubPacket(OPCODE, 0, playerActorID, BitConverter.GetBytes(weatherId));
|
||||
}
|
||||
}
|
||||
}
|
||||
using FFXIVClassic_Lobby_Server.packets;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send
|
||||
{
|
||||
class SetWeatherPacket
|
||||
{
|
||||
public const ushort WEATHER_CLEAR = 8001;
|
||||
public const ushort WEATHER_FAIR = 8002;
|
||||
public const ushort WEATHER_CLOUDY = 8003;
|
||||
public const ushort WEATHER_FOGGY = 8004;
|
||||
public const ushort WEATHER_WINDY = 8005;
|
||||
public const ushort WEATHER_BLUSTERY = 8006;
|
||||
public const ushort WEATHER_RAINY = 8007;
|
||||
public const ushort WEATHER_SHOWERY = 8008;
|
||||
public const ushort WEATHER_THUNDERY = 8009;
|
||||
public const ushort WEATHER_STORMY = 8010;
|
||||
public const ushort WEATHER_DUSTY = 8011;
|
||||
public const ushort WEATHER_SANDY = 8012;
|
||||
public const ushort WEATHER_HOT = 8013;
|
||||
public const ushort WEATHER_BLISTERING = 8014; //Bowl Of Embers Weather
|
||||
public const ushort WEATHER_SNOWY = 8015;
|
||||
public const ushort WEATHER_WINTRY = 8016;
|
||||
public const ushort WEATHER_GLOOMY = 8017;
|
||||
|
||||
public const ushort WEATHER_SEASONAL = 8027; //Snow in Black Shroud, nothing elsewhere
|
||||
public const ushort WEATHER_PRIMAL = 8028; //Howling Eye and Thornmarch Weather
|
||||
public const ushort WEATHER_SEASONAL_FIREWORKS = 8029; //Plays fireworks between 20:00 - 21:00 ET
|
||||
public const ushort WEATHER_DALAMUD = 8030;
|
||||
public const ushort WEATHER_AURORA = 8031;
|
||||
public const ushort WEATHER_DALAMUD_THUNDER = 8032;
|
||||
|
||||
public const ushort WEATHER_DAY = 8065; //Force skybox to show Day + Fair regardless of current ET
|
||||
public const ushort WEATHER_TWILIGHT = 8066; //Force skybox to show Twilight + Clear regardless of current ET
|
||||
|
||||
public const ushort OPCODE = 0x000D;
|
||||
public const uint PACKET_SIZE = 0x28;
|
||||
|
||||
public static SubPacket buildPacket(uint playerActorID, ushort weatherId, ushort transitionTime)
|
||||
{
|
||||
ulong combined = (ulong)(weatherId | (transitionTime << 16));
|
||||
return new SubPacket(OPCODE, 0, playerActorID, BitConverter.GetBytes(combined));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue