mirror of
https://bitbucket.org/Ioncannon/project-meteor-server.git
synced 2025-04-02 19:42:05 -04:00
Merge in Relative warps
This commit is contained in:
commit
10d4d7c148
@ -24,8 +24,8 @@ namespace FFXIVClassic_Lobby_Server
|
|||||||
class CommandProcessor
|
class CommandProcessor
|
||||||
{
|
{
|
||||||
private Dictionary<uint, ConnectedPlayer> mConnectedPlayerList;
|
private Dictionary<uint, ConnectedPlayer> mConnectedPlayerList;
|
||||||
private static WorldManager mWorldManager = Server.getWorldManager();
|
private static WorldManager mWorldManager = Server.GetWorldManager();
|
||||||
private static Dictionary<uint, Item> gamedataItems = Server.getItemGamedataList();
|
private static Dictionary<uint, Item> gamedataItems = Server.GetGamedataItems();
|
||||||
|
|
||||||
// For the moment, this is the only predefined item
|
// For the moment, this is the only predefined item
|
||||||
// TODO: make a list/enum in the future so that items can be given by name, instead of by id
|
// TODO: make a list/enum in the future so that items can be given by name, instead of by id
|
||||||
@ -99,58 +99,27 @@ namespace FFXIVClassic_Lobby_Server
|
|||||||
/// Teleports player to a location on a predefined list
|
/// Teleports player to a location on a predefined list
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="client">The current player</param>
|
/// <param name="client">The current player</param>
|
||||||
/// <param name="entranceId">Predefined list: <ffxiv_database>\server_zones_spawnlocations</param>
|
/// <param name="id">Predefined list: <ffxiv_database>\server_zones_spawnlocations</param>
|
||||||
public void doWarp(ConnectedPlayer client, string entranceId)
|
public void doWarp(ConnectedPlayer client, uint id)
|
||||||
{
|
{
|
||||||
uint id;
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
if (entranceId.ToLower().StartsWith("0x"))
|
|
||||||
id = Convert.ToUInt32(entranceId, 16);
|
|
||||||
else
|
|
||||||
id = Convert.ToUInt32(entranceId);
|
|
||||||
}
|
|
||||||
catch(FormatException e)
|
|
||||||
{return;}
|
|
||||||
|
|
||||||
FFXIVClassic_Map_Server.WorldManager.ZoneEntrance ze = mWorldManager.getZoneEntrance(id);
|
FFXIVClassic_Map_Server.WorldManager.ZoneEntrance ze = mWorldManager.getZoneEntrance(id);
|
||||||
|
|
||||||
if (ze == null)
|
if (ze == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (client != null)
|
if (client != null)
|
||||||
mWorldManager.DoZoneChange(client.getActor(), ze.zoneId, ze.privateAreaName, ze.spawnType, ze.spawnX, ze.spawnY, ze.spawnZ, 0.0f);
|
mWorldManager.DoZoneChange(client.getActor(), ze.zoneId, ze.privateAreaName, ze.spawnType, ze.spawnX, ze.spawnY, ze.spawnZ, ze.spawnRotation);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
foreach (KeyValuePair<uint, ConnectedPlayer> entry in mConnectedPlayerList)
|
foreach (KeyValuePair<uint, ConnectedPlayer> entry in mConnectedPlayerList)
|
||||||
{
|
{
|
||||||
mWorldManager.DoZoneChange(entry.Value.getActor(), ze.zoneId, ze.privateAreaName, ze.spawnType, ze.spawnX, ze.spawnY, ze.spawnZ, 0.0f);
|
mWorldManager.DoZoneChange(entry.Value.getActor(), ze.zoneId, ze.privateAreaName, ze.spawnType, ze.spawnX, ze.spawnY, ze.spawnZ, ze.spawnRotation);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void doWarp(ConnectedPlayer client, string zone, string privateArea, string sx, string sy, string sz)
|
public void doWarp(ConnectedPlayer client, uint zoneId, string privateArea, float x, float y, float z, float r)
|
||||||
{
|
{
|
||||||
uint zoneId;
|
|
||||||
float x,y,z;
|
|
||||||
|
|
||||||
x = Single.Parse(sx);
|
|
||||||
y = Single.Parse(sy);
|
|
||||||
z = Single.Parse(sz);
|
|
||||||
|
|
||||||
if (zone == null)
|
|
||||||
{
|
|
||||||
if (client != null)
|
|
||||||
mWorldManager.DoZoneChange(client.getActor(), 0, privateArea, 0x2, x, y, z, 0.0f);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (zone.ToLower().StartsWith("0x"))
|
|
||||||
zoneId = Convert.ToUInt32(zone, 16);
|
|
||||||
else
|
|
||||||
zoneId = Convert.ToUInt32(zone);
|
|
||||||
|
|
||||||
if (mWorldManager.GetZone(zoneId) == null)
|
if (mWorldManager.GetZone(zoneId) == null)
|
||||||
{
|
{
|
||||||
if (client != null)
|
if (client != null)
|
||||||
@ -159,13 +128,12 @@ namespace FFXIVClassic_Lobby_Server
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (client != null)
|
if (client != null)
|
||||||
mWorldManager.DoZoneChange(client.getActor(), zoneId, privateArea, 0x2, x, y, z, 0.0f);
|
mWorldManager.DoZoneChange(client.getActor(), zoneId, privateArea, 0x2, x, y, z, r);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
foreach (KeyValuePair<uint, ConnectedPlayer> entry in mConnectedPlayerList)
|
foreach (KeyValuePair<uint, ConnectedPlayer> entry in mConnectedPlayerList)
|
||||||
{
|
{
|
||||||
mWorldManager.DoZoneChange(entry.Value.getActor(), zoneId, privateArea, 0x2, x, y, z, 0.0f);
|
mWorldManager.DoZoneChange(entry.Value.getActor(), zoneId, privateArea, 0x2, x, y, z, r);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -351,6 +319,141 @@ namespace FFXIVClassic_Lobby_Server
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void parseWarp(ConnectedPlayer client, string[] split)
|
||||||
|
{
|
||||||
|
float x = 0, y = 0, z = 0, r = 0.0f;
|
||||||
|
uint zoneId = 0;
|
||||||
|
string privatearea = null;
|
||||||
|
|
||||||
|
if (split.Length == 2) // Predefined list
|
||||||
|
{
|
||||||
|
// TODO: Handle !warp Playername
|
||||||
|
#region !warp (predefined list)
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (split[1].ToLower().StartsWith("0x"))
|
||||||
|
zoneId = Convert.ToUInt32(split[1], 16);
|
||||||
|
else
|
||||||
|
zoneId = Convert.ToUInt32(split[1]);
|
||||||
|
}
|
||||||
|
catch{return;}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
doWarp(client, zoneId);
|
||||||
|
}
|
||||||
|
else if (split.Length == 4)
|
||||||
|
{
|
||||||
|
#region !warp X Y Z
|
||||||
|
if (split[1].StartsWith("@"))
|
||||||
|
{
|
||||||
|
split[1] = split[1].Replace("@", string.Empty);
|
||||||
|
|
||||||
|
if (String.IsNullOrEmpty(split[1]))
|
||||||
|
split[1] = "0";
|
||||||
|
|
||||||
|
try { x = Single.Parse(split[1]) + client.getActor().positionX; }
|
||||||
|
catch{return;}
|
||||||
|
|
||||||
|
split[1] = x.ToString();
|
||||||
|
}
|
||||||
|
if (split[2].StartsWith("@"))
|
||||||
|
{
|
||||||
|
split[2] = split[2].Replace("@", string.Empty);
|
||||||
|
|
||||||
|
if (String.IsNullOrEmpty(split[2]))
|
||||||
|
split[2] = "0";
|
||||||
|
|
||||||
|
try { y = Single.Parse(split[2]) + client.getActor().positionY; }
|
||||||
|
catch{return;}
|
||||||
|
|
||||||
|
split[2] = y.ToString();
|
||||||
|
}
|
||||||
|
if (split[3].StartsWith("@"))
|
||||||
|
{
|
||||||
|
split[3] = split[3].Replace("@", string.Empty);
|
||||||
|
|
||||||
|
if (String.IsNullOrEmpty(split[3]))
|
||||||
|
split[3] = "0";
|
||||||
|
|
||||||
|
try { z = Single.Parse(split[3]) + client.getActor().positionZ; }
|
||||||
|
catch{return;}
|
||||||
|
|
||||||
|
split[3] = z.ToString();
|
||||||
|
}
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
x = Single.Parse(split[1]);
|
||||||
|
y = Single.Parse(split[2]);
|
||||||
|
z = Single.Parse(split[3]);
|
||||||
|
}
|
||||||
|
catch{return;}
|
||||||
|
|
||||||
|
zoneId = client.getActor().zoneId;
|
||||||
|
r = client.getActor().rotation;
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
sendMessage(client, String.Format("Warping to: ZoneID: {0} X: {1}, Y: {2}, Z: {3}", zoneId, x, x, y));
|
||||||
|
doWarp(client, zoneId, privatearea, x, y, z, r);
|
||||||
|
}
|
||||||
|
else if (split.Length == 5)
|
||||||
|
{
|
||||||
|
#region !warp Zone X Y Z
|
||||||
|
try
|
||||||
|
{
|
||||||
|
x = Single.Parse(split[2]);
|
||||||
|
y = Single.Parse(split[3]);
|
||||||
|
z = Single.Parse(split[4]);
|
||||||
|
}
|
||||||
|
catch{return;}
|
||||||
|
|
||||||
|
if (split[1].ToLower().StartsWith("0x"))
|
||||||
|
{
|
||||||
|
try { zoneId = Convert.ToUInt32(split[1], 16); }
|
||||||
|
catch{return;}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
try { zoneId = Convert.ToUInt32(split[1]); }
|
||||||
|
catch{return;}
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
sendMessage(client, String.Format("Warping to: ZoneID: {0} X: {1}, Y: {2}, Z: {3}", zoneId, x, x, y));
|
||||||
|
doWarp(client, zoneId, privatearea, x, y, z, r);
|
||||||
|
}
|
||||||
|
else if (split.Length == 6)
|
||||||
|
{
|
||||||
|
#region !warp Zone Instance X Y Z
|
||||||
|
try
|
||||||
|
{
|
||||||
|
x = Single.Parse(split[3]);
|
||||||
|
y = Single.Parse(split[4]);
|
||||||
|
z = Single.Parse(split[5]);
|
||||||
|
}
|
||||||
|
catch{return;}
|
||||||
|
|
||||||
|
if (split[1].ToLower().StartsWith("0x"))
|
||||||
|
{
|
||||||
|
try { zoneId = Convert.ToUInt32(split[1], 16); }
|
||||||
|
catch{return;}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
try { zoneId = Convert.ToUInt32(split[1]); }
|
||||||
|
catch{return;}
|
||||||
|
}
|
||||||
|
|
||||||
|
privatearea = split[2];
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
sendMessage(client, String.Format("Warping to: ZoneID: {0} X: {1}, Y: {2}, Z: {3}", zoneId, x, x, y));
|
||||||
|
doWarp(client, zoneId, privatearea, x, y, z, r);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
return; // catch any invalid warps here
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// We only use the default options for SendMessagePacket.
|
/// We only use the default options for SendMessagePacket.
|
||||||
/// May as well make it less unwieldly to view
|
/// May as well make it less unwieldly to view
|
||||||
@ -639,14 +742,7 @@ namespace FFXIVClassic_Lobby_Server
|
|||||||
#region !warp
|
#region !warp
|
||||||
else if (split[0].Equals("warp"))
|
else if (split[0].Equals("warp"))
|
||||||
{
|
{
|
||||||
if (split.Length == 2) // Predefined list
|
parseWarp(client, split);
|
||||||
doWarp(client, split[1]);
|
|
||||||
else if (split.Length == 4) // X/Y/Z
|
|
||||||
doWarp(client, null, null, split[1], split[2], split[3]);
|
|
||||||
else if (split.Length == 5) // Zone + X/Y/Z
|
|
||||||
doWarp(client, split[1], null, split[2], split[3], split[4]);
|
|
||||||
else if (split.Length == 6) // Zone + instance + X/Y/Z
|
|
||||||
doWarp(client, split[1], split[2], split[3], split[4], split[5]);
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
@ -188,7 +188,7 @@ namespace FFXIVClassic_Lobby_Server
|
|||||||
subpacket.debugPrintSubPacket();
|
subpacket.debugPrintSubPacket();
|
||||||
client.queuePacket(_0x2Packet.buildPacket(player.actorID), true, false);
|
client.queuePacket(_0x2Packet.buildPacket(player.actorID), true, false);
|
||||||
|
|
||||||
Server.getWorldManager().DoLogin(player.getActor());
|
Server.GetWorldManager().DoLogin(player.getActor());
|
||||||
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
@ -267,7 +267,7 @@ namespace FFXIVClassic_Lobby_Server
|
|||||||
if (ownerActor == null)
|
if (ownerActor == null)
|
||||||
{
|
{
|
||||||
//Is it a instance actor?
|
//Is it a instance actor?
|
||||||
ownerActor = Server.getWorldManager().GetActorInWorld(player.getActor().eventCurrentOwner);
|
ownerActor = Server.GetWorldManager().GetActorInWorld(player.getActor().eventCurrentOwner);
|
||||||
if (ownerActor == null)
|
if (ownerActor == null)
|
||||||
{
|
{
|
||||||
//Is it a Director?
|
//Is it a Director?
|
||||||
@ -298,7 +298,7 @@ namespace FFXIVClassic_Lobby_Server
|
|||||||
Actor updateOwnerActor = Server.getStaticActors(player.getActor().eventCurrentOwner);
|
Actor updateOwnerActor = Server.getStaticActors(player.getActor().eventCurrentOwner);
|
||||||
if (updateOwnerActor == null)
|
if (updateOwnerActor == null)
|
||||||
{
|
{
|
||||||
updateOwnerActor = Server.getWorldManager().GetActorInWorld(player.getActor().eventCurrentOwner);
|
updateOwnerActor = Server.GetWorldManager().GetActorInWorld(player.getActor().eventCurrentOwner);
|
||||||
|
|
||||||
if (player.getActor().currentDirector != null && player.getActor().eventCurrentOwner == player.getActor().currentDirector.actorId)
|
if (player.getActor().currentDirector != null && player.getActor().eventCurrentOwner == player.getActor().currentDirector.actorId)
|
||||||
updateOwnerActor = player.getActor().currentDirector;
|
updateOwnerActor = player.getActor().currentDirector;
|
||||||
|
@ -239,13 +239,14 @@ namespace FFXIVClassic_Map_Server.Properties {
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized string similar to Teleports the player to the specified location
|
/// Looks up a localized string similar to Teleports the player to the specified location
|
||||||
///
|
///
|
||||||
|
///*Note: You can teleport relative to your current position by putting a @ in front of a value, cannot be combined with a zone id or instance name
|
||||||
|
///
|
||||||
///*Syntax: warp <location list>
|
///*Syntax: warp <location list>
|
||||||
/// warp <X coordinate> <Y coordinate> <Z coordinate>
|
/// warp <X coordinate> <Y coordinate> <Z coordinate>
|
||||||
/// warp <zone id> <X coordinate> <Y coordinate> <Z coordinate>
|
/// warp <zone id> <X coordinate> <Y coordinate> <Z coordinate>
|
||||||
/// warp <zone id> <instance> <X coordinate> <Y coordinate> <Z coordinate>
|
/// warp <zone id> <instance> <X coordinate> <Y coordinate> <Z coordinate>
|
||||||
///<location list> is a pre-defined list of locations from the server database
|
///<location list> is a pre-defined list of locations from the server database
|
||||||
///<zone id> is the zone's id as defined in the server database
|
///<zone id> is the [rest of string was truncated]";.
|
||||||
///<instance> is an instanced copy of the desired zone that's only visible to the current player.
|
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static string CPwarp {
|
public static string CPwarp {
|
||||||
get {
|
get {
|
||||||
|
@ -206,6 +206,8 @@ Server Administration: givecurrency, giveitem, givekeyitem, removecurrency, remo
|
|||||||
<data name="CPwarp" xml:space="preserve">
|
<data name="CPwarp" xml:space="preserve">
|
||||||
<value>Teleports the player to the specified location
|
<value>Teleports the player to the specified location
|
||||||
|
|
||||||
|
*Note: You can teleport relative to your current position by putting a @ in front of a value, cannot be combined with a zone id or instance name
|
||||||
|
|
||||||
*Syntax: warp <location list>
|
*Syntax: warp <location list>
|
||||||
warp <X coordinate> <Y coordinate> <Z coordinate>
|
warp <X coordinate> <Y coordinate> <Z coordinate>
|
||||||
warp <zone id> <X coordinate> <Y coordinate> <Z coordinate>
|
warp <zone id> <X coordinate> <Y coordinate> <Z coordinate>
|
||||||
|
@ -330,7 +330,7 @@ namespace FFXIVClassic_Lobby_Server
|
|||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
public static WorldManager getWorldManager()
|
public static WorldManager GetWorldManager()
|
||||||
{
|
{
|
||||||
return mWorldManager;
|
return mWorldManager;
|
||||||
}
|
}
|
||||||
@ -340,7 +340,7 @@ namespace FFXIVClassic_Lobby_Server
|
|||||||
return mConnectedPlayerList;
|
return mConnectedPlayerList;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Dictionary<uint, Item> getItemGamedataList()
|
public static Dictionary<uint, Item> GetGamedataItems()
|
||||||
{
|
{
|
||||||
return gamedataItems;
|
return gamedataItems;
|
||||||
}
|
}
|
||||||
|
@ -374,20 +374,10 @@ namespace FFXIVClassic_Map_Server
|
|||||||
//Add player to new zone and update
|
//Add player to new zone and update
|
||||||
Area newArea;
|
Area newArea;
|
||||||
|
|
||||||
if (destinationZoneId != 0)
|
|
||||||
{
|
|
||||||
if (destinationPrivateArea == null)
|
if (destinationPrivateArea == null)
|
||||||
newArea = GetZone(destinationZoneId);
|
newArea = GetZone(destinationZoneId);
|
||||||
else
|
else
|
||||||
newArea = GetZone(destinationZoneId).getPrivateArea(destinationPrivateArea, 0);
|
newArea = GetZone(destinationZoneId).getPrivateArea(destinationPrivateArea, 0);
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (destinationPrivateArea == null)
|
|
||||||
newArea = GetZone(player.zoneId);
|
|
||||||
else
|
|
||||||
newArea = GetZone(player.zoneId).getPrivateArea(destinationPrivateArea, 0);
|
|
||||||
}
|
|
||||||
//This server does not contain that zoneId
|
//This server does not contain that zoneId
|
||||||
if (newArea == null)
|
if (newArea == null)
|
||||||
return;
|
return;
|
||||||
|
@ -49,7 +49,7 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||||||
{
|
{
|
||||||
List<LuaParam> lParams;
|
List<LuaParam> lParams;
|
||||||
|
|
||||||
Player player = Server.getWorldManager().GetPCInWorld(playerActorId);
|
Player player = Server.GetWorldManager().GetPCInWorld(playerActorId);
|
||||||
lParams = LuaEngine.doActorOnInstantiate(player, this);
|
lParams = LuaEngine.doActorOnInstantiate(player, this);
|
||||||
|
|
||||||
if (lParams == null)
|
if (lParams == null)
|
||||||
|
@ -703,34 +703,34 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||||||
{
|
{
|
||||||
if (msgParams.Length == 0)
|
if (msgParams.Length == 0)
|
||||||
{
|
{
|
||||||
queuePacket(GameMessagePacket.buildPacket(Server.getWorldManager().GetActor().actorId, actorId, sourceActor.actorId, textIdOwner.actorId, textId, log));
|
queuePacket(GameMessagePacket.buildPacket(Server.GetWorldManager().GetActor().actorId, actorId, sourceActor.actorId, textIdOwner.actorId, textId, log));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
queuePacket(GameMessagePacket.buildPacket(Server.getWorldManager().GetActor().actorId, actorId, sourceActor.actorId, textIdOwner.actorId, textId, log, LuaUtils.createLuaParamList(msgParams)));
|
queuePacket(GameMessagePacket.buildPacket(Server.GetWorldManager().GetActor().actorId, actorId, sourceActor.actorId, textIdOwner.actorId, textId, log, LuaUtils.createLuaParamList(msgParams)));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void sendGameMessage(Actor textIdOwner, ushort textId, byte log, params object[] msgParams)
|
public void sendGameMessage(Actor textIdOwner, ushort textId, byte log, params object[] msgParams)
|
||||||
{
|
{
|
||||||
if (msgParams.Length == 0)
|
if (msgParams.Length == 0)
|
||||||
queuePacket(GameMessagePacket.buildPacket(Server.getWorldManager().GetActor().actorId, actorId, textIdOwner.actorId, textId, log));
|
queuePacket(GameMessagePacket.buildPacket(Server.GetWorldManager().GetActor().actorId, actorId, textIdOwner.actorId, textId, log));
|
||||||
else
|
else
|
||||||
queuePacket(GameMessagePacket.buildPacket(Server.getWorldManager().GetActor().actorId, actorId, textIdOwner.actorId, textId, log, LuaUtils.createLuaParamList(msgParams)));
|
queuePacket(GameMessagePacket.buildPacket(Server.GetWorldManager().GetActor().actorId, actorId, textIdOwner.actorId, textId, log, LuaUtils.createLuaParamList(msgParams)));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void sendGameMessage(Actor textIdOwner, ushort textId, byte log, string customSender, params object[] msgParams)
|
public void sendGameMessage(Actor textIdOwner, ushort textId, byte log, string customSender, params object[] msgParams)
|
||||||
{
|
{
|
||||||
if (msgParams.Length == 0)
|
if (msgParams.Length == 0)
|
||||||
queuePacket(GameMessagePacket.buildPacket(Server.getWorldManager().GetActor().actorId, actorId, textIdOwner.actorId, textId, customSender, log));
|
queuePacket(GameMessagePacket.buildPacket(Server.GetWorldManager().GetActor().actorId, actorId, textIdOwner.actorId, textId, customSender, log));
|
||||||
else
|
else
|
||||||
queuePacket(GameMessagePacket.buildPacket(Server.getWorldManager().GetActor().actorId, actorId, textIdOwner.actorId, textId, customSender, log, LuaUtils.createLuaParamList(msgParams)));
|
queuePacket(GameMessagePacket.buildPacket(Server.GetWorldManager().GetActor().actorId, actorId, textIdOwner.actorId, textId, customSender, log, LuaUtils.createLuaParamList(msgParams)));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void sendGameMessage(Actor textIdOwner, ushort textId, byte log, uint displayId, params object[] msgParams)
|
public void sendGameMessage(Actor textIdOwner, ushort textId, byte log, uint displayId, params object[] msgParams)
|
||||||
{
|
{
|
||||||
if (msgParams.Length == 0)
|
if (msgParams.Length == 0)
|
||||||
queuePacket(GameMessagePacket.buildPacket(Server.getWorldManager().GetActor().actorId, actorId, textIdOwner.actorId, textId, displayId, log));
|
queuePacket(GameMessagePacket.buildPacket(Server.GetWorldManager().GetActor().actorId, actorId, textIdOwner.actorId, textId, displayId, log));
|
||||||
else
|
else
|
||||||
queuePacket(GameMessagePacket.buildPacket(Server.getWorldManager().GetActor().actorId, actorId, textIdOwner.actorId, textId, displayId, log, LuaUtils.createLuaParamList(msgParams)));
|
queuePacket(GameMessagePacket.buildPacket(Server.GetWorldManager().GetActor().actorId, actorId, textIdOwner.actorId, textId, displayId, log, LuaUtils.createLuaParamList(msgParams)));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void broadcastWorldMessage(ushort worldMasterId, params object[] msgParams)
|
public void broadcastWorldMessage(ushort worldMasterId, params object[] msgParams)
|
||||||
|
@ -43,7 +43,7 @@ namespace FFXIVClassic_Map_Server.lua
|
|||||||
Script script = new Script();
|
Script script = new Script();
|
||||||
((ScriptLoaderBase)script.Options.ScriptLoader).ModulePaths = new string[] { "./scripts/?", "./scripts/?.lua" };
|
((ScriptLoaderBase)script.Options.ScriptLoader).ModulePaths = new string[] { "./scripts/?", "./scripts/?.lua" };
|
||||||
script.Globals["getStaticActor"] = (Func<string, Actor>)Server.getStaticActors;
|
script.Globals["getStaticActor"] = (Func<string, Actor>)Server.getStaticActors;
|
||||||
script.Globals["getWorldMaster"] = (Func<Actor>)Server.getWorldManager().GetActor;
|
script.Globals["getWorldMaster"] = (Func<Actor>)Server.GetWorldManager().GetActor;
|
||||||
script.Globals["getItemGamedata"] = (Func<uint, Item>)Server.getItemGamedata;
|
script.Globals["getItemGamedata"] = (Func<uint, Item>)Server.getItemGamedata;
|
||||||
script.DoFile(luaPath);
|
script.DoFile(luaPath);
|
||||||
DynValue result = script.Call(script.Globals["onInstantiate"], target);
|
DynValue result = script.Call(script.Globals["onInstantiate"], target);
|
||||||
@ -82,9 +82,9 @@ namespace FFXIVClassic_Map_Server.lua
|
|||||||
{
|
{
|
||||||
Script script = new Script();
|
Script script = new Script();
|
||||||
((ScriptLoaderBase)script.Options.ScriptLoader).ModulePaths = new string[] { "./scripts/?", "./scripts/?.lua" };
|
((ScriptLoaderBase)script.Options.ScriptLoader).ModulePaths = new string[] { "./scripts/?", "./scripts/?.lua" };
|
||||||
script.Globals["getWorldManager"] = (Func<WorldManager>)Server.getWorldManager;
|
script.Globals["getWorldManager"] = (Func<WorldManager>)Server.GetWorldManager;
|
||||||
script.Globals["getStaticActor"] = (Func<string, Actor>)Server.getStaticActors;
|
script.Globals["getStaticActor"] = (Func<string, Actor>)Server.getStaticActors;
|
||||||
script.Globals["getWorldMaster"] = (Func<Actor>)Server.getWorldManager().GetActor;
|
script.Globals["getWorldMaster"] = (Func<Actor>)Server.GetWorldManager().GetActor;
|
||||||
script.Globals["getItemGamedata"] = (Func<uint, Item>)Server.getItemGamedata;
|
script.Globals["getItemGamedata"] = (Func<uint, Item>)Server.getItemGamedata;
|
||||||
script.DoFile(luaPath);
|
script.DoFile(luaPath);
|
||||||
|
|
||||||
@ -125,9 +125,9 @@ namespace FFXIVClassic_Map_Server.lua
|
|||||||
{
|
{
|
||||||
Script script = new Script();
|
Script script = new Script();
|
||||||
((ScriptLoaderBase)script.Options.ScriptLoader).ModulePaths = new string[] { "./scripts/?", "./scripts/?.lua" };
|
((ScriptLoaderBase)script.Options.ScriptLoader).ModulePaths = new string[] { "./scripts/?", "./scripts/?.lua" };
|
||||||
script.Globals["getWorldManager"] = (Func<WorldManager>)Server.getWorldManager;
|
script.Globals["getWorldManager"] = (Func<WorldManager>)Server.GetWorldManager;
|
||||||
script.Globals["getStaticActor"] = (Func<string, Actor>)Server.getStaticActors;
|
script.Globals["getStaticActor"] = (Func<string, Actor>)Server.getStaticActors;
|
||||||
script.Globals["getWorldMaster"] = (Func<Actor>)Server.getWorldManager().GetActor;
|
script.Globals["getWorldMaster"] = (Func<Actor>)Server.GetWorldManager().GetActor;
|
||||||
script.Globals["getItemGamedata"] = (Func<uint, Item>)Server.getItemGamedata;
|
script.Globals["getItemGamedata"] = (Func<uint, Item>)Server.getItemGamedata;
|
||||||
script.DoFile(luaPath);
|
script.DoFile(luaPath);
|
||||||
|
|
||||||
@ -158,9 +158,9 @@ namespace FFXIVClassic_Map_Server.lua
|
|||||||
{
|
{
|
||||||
Script script = new Script();
|
Script script = new Script();
|
||||||
((ScriptLoaderBase)script.Options.ScriptLoader).ModulePaths = new string[] { "./scripts/?", "./scripts/?.lua" };
|
((ScriptLoaderBase)script.Options.ScriptLoader).ModulePaths = new string[] { "./scripts/?", "./scripts/?.lua" };
|
||||||
script.Globals["getWorldManager"] = (Func<WorldManager>)Server.getWorldManager;
|
script.Globals["getWorldManager"] = (Func<WorldManager>)Server.GetWorldManager;
|
||||||
script.Globals["getStaticActor"] = (Func<string, Actor>)Server.getStaticActors;
|
script.Globals["getStaticActor"] = (Func<string, Actor>)Server.getStaticActors;
|
||||||
script.Globals["getWorldMaster"] = (Func<Actor>)Server.getWorldManager().GetActor;
|
script.Globals["getWorldMaster"] = (Func<Actor>)Server.GetWorldManager().GetActor;
|
||||||
script.Globals["getItemGamedata"] = (Func<uint, Item>)Server.getItemGamedata;
|
script.Globals["getItemGamedata"] = (Func<uint, Item>)Server.getItemGamedata;
|
||||||
script.DoFile(luaPath);
|
script.DoFile(luaPath);
|
||||||
|
|
||||||
@ -175,9 +175,9 @@ namespace FFXIVClassic_Map_Server.lua
|
|||||||
{
|
{
|
||||||
Script script = new Script();
|
Script script = new Script();
|
||||||
((ScriptLoaderBase)script.Options.ScriptLoader).ModulePaths = new string[] { "./scripts/?", "./scripts/?.lua" };
|
((ScriptLoaderBase)script.Options.ScriptLoader).ModulePaths = new string[] { "./scripts/?", "./scripts/?.lua" };
|
||||||
script.Globals["getWorldManager"] = (Func<WorldManager>)Server.getWorldManager;
|
script.Globals["getWorldManager"] = (Func<WorldManager>)Server.GetWorldManager;
|
||||||
script.Globals["getStaticActor"] = (Func<string, Actor>)Server.getStaticActors;
|
script.Globals["getStaticActor"] = (Func<string, Actor>)Server.getStaticActors;
|
||||||
script.Globals["getWorldMaster"] = (Func<Actor>)Server.getWorldManager().GetActor;
|
script.Globals["getWorldMaster"] = (Func<Actor>)Server.GetWorldManager().GetActor;
|
||||||
script.Globals["getItemGamedata"] = (Func<uint, Item>)Server.getItemGamedata;
|
script.Globals["getItemGamedata"] = (Func<uint, Item>)Server.getItemGamedata;
|
||||||
script.DoFile(FILEPATH_PLAYER);
|
script.DoFile(FILEPATH_PLAYER);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user