mirror of
https://bitbucket.org/Ioncannon/project-meteor-server.git
synced 2025-07-25 03:48:23 +02:00
Merge branch 'master' of https://bitbucket.org/Ioncannon/ffxiv-classic-server into lua_commands
# Conflicts: # FFXIVClassic Common Class Lib/packages.config # FFXIVClassic Lobby Server/Program.cs # FFXIVClassic Map Server/CommandProcessor.cs # FFXIVClassic Map Server/Program.cs # FFXIVClassic Map Server/actors/Actor.cs
This commit is contained in:
commit
37d91480f9
24 changed files with 185 additions and 138 deletions
|
@ -91,17 +91,17 @@ namespace FFXIVClassic_Map_Server
|
|||
return false;
|
||||
|
||||
input.Trim();
|
||||
input = input.StartsWith("!") ? input.Substring(1) : input;
|
||||
|
||||
var split = input.Split('"')
|
||||
.Select((str, index) => index % 2 == 0
|
||||
? str.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries)
|
||||
: new String[] { str }
|
||||
)
|
||||
input = input.StartsWith("!") ? input.Substring(1) : input;
|
||||
|
||||
var split = input.Split('"')
|
||||
.Select((str, index) => index % 2 == 0
|
||||
? str.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries)
|
||||
: new String[] { str }
|
||||
)
|
||||
.SelectMany(str => str).ToArray();
|
||||
|
||||
split = split.Select(temp => temp.ToLower()).ToArray(); // Ignore case on commands
|
||||
|
||||
split = split.Select(temp => temp.ToLower()).ToArray(); // Ignore case on commands
|
||||
|
||||
var cmd = split?.ElementAt(0);
|
||||
|
||||
if (cmd.Any())
|
||||
|
@ -131,63 +131,63 @@ namespace FFXIVClassic_Map_Server
|
|||
|
||||
LuaEngine.RunGMCommand(player, cmd.ToString(), split.ToArray());
|
||||
return true;
|
||||
}
|
||||
// Debug
|
||||
//SendMessage(client, string.Join(",", split));
|
||||
|
||||
}
|
||||
// Debug
|
||||
//SendMessage(client, string.Join(",", split));
|
||||
|
||||
if (split.Length >= 1)
|
||||
{
|
||||
|
||||
{
|
||||
|
||||
#region !reloaditems
|
||||
if (split[0].Equals("reloaditems"))
|
||||
{
|
||||
Program.Log.Info(String.Format("Got request to reload item gamedata"));
|
||||
SendMessage(client, "Reloading Item Gamedata...");
|
||||
gamedataItems.Clear();
|
||||
gamedataItems = Database.GetItemGamedata();
|
||||
Program.Log.Info(String.Format("Loaded {0} items.", gamedataItems.Count));
|
||||
SendMessage(client, String.Format("Loaded {0} items.", gamedataItems.Count));
|
||||
return true;
|
||||
}
|
||||
if (split[0].Equals("reloaditems"))
|
||||
{
|
||||
Program.Log.Info(String.Format("Got request to reload item gamedata"));
|
||||
SendMessage(client, "Reloading Item Gamedata...");
|
||||
gamedataItems.Clear();
|
||||
gamedataItems = Database.GetItemGamedata();
|
||||
Program.Log.Info(String.Format("Loaded {0} items.", gamedataItems.Count));
|
||||
SendMessage(client, String.Format("Loaded {0} items.", gamedataItems.Count));
|
||||
return true;
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
#region !sendpacket
|
||||
else if (split[0].Equals("sendpacket"))
|
||||
{
|
||||
if (split.Length < 2)
|
||||
return false;
|
||||
|
||||
try
|
||||
{
|
||||
SendPacket(client, "./packets/" + split[1]);
|
||||
return true;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Program.Log.Error("Could not load packet: " + e);
|
||||
}
|
||||
}
|
||||
else if (split[0].Equals("sendpacket"))
|
||||
{
|
||||
if (split.Length < 2)
|
||||
return false;
|
||||
|
||||
try
|
||||
{
|
||||
SendPacket(client, "./packets/" + split[1]);
|
||||
return true;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Program.Log.Error("Could not load packet: " + e);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
#region !property
|
||||
else if (split[0].Equals("property"))
|
||||
{
|
||||
if (split.Length == 4)
|
||||
{
|
||||
ChangeProperty(Utils.MurmurHash2(split[1], 0), Convert.ToUInt32(split[2], 16), split[3]);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
else if (split[0].Equals("property"))
|
||||
{
|
||||
if (split.Length == 4)
|
||||
{
|
||||
ChangeProperty(Utils.MurmurHash2(split[1], 0), Convert.ToUInt32(split[2], 16), split[3]);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
#region !property2
|
||||
else if (split[0].Equals("property2"))
|
||||
{
|
||||
if (split.Length == 4)
|
||||
{
|
||||
ChangeProperty(Convert.ToUInt32(split[1], 16), Convert.ToUInt32(split[2], 16), split[3]);
|
||||
}
|
||||
return true;
|
||||
else if (split[0].Equals("property2"))
|
||||
{
|
||||
if (split.Length == 4)
|
||||
{
|
||||
ChangeProperty(Convert.ToUInt32(split[1], 16), Convert.ToUInt32(split[2], 16), split[3]);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
|
|
|
@ -23,7 +23,7 @@ namespace FFXIVClassic_Map_Server
|
|||
|
||||
if (!File.Exists("./map_config.ini"))
|
||||
{
|
||||
Program.Log.Error("[FILE NOT FOUND]");
|
||||
Program.Log.Error("FILE NOT FOUND");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -39,9 +39,7 @@ namespace FFXIVClassic_Map_Server
|
|||
ConfigConstants.DATABASE_NAME = configIni.GetValue("Database", "database", "");
|
||||
ConfigConstants.DATABASE_USERNAME = configIni.GetValue("Database", "username", "");
|
||||
ConfigConstants.DATABASE_PASSWORD = configIni.GetValue("Database", "password", "");
|
||||
|
||||
Program.Log.Info("[OK]");
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -34,10 +34,6 @@ namespace FFXIVClassic_Map_Server
|
|||
if (!ConfigConstants.Load())
|
||||
startServer = false;
|
||||
|
||||
Assembly assem = Assembly.GetExecutingAssembly();
|
||||
Version vers = assem.GetName().Version;
|
||||
Program.Log.Info("Version: " + vers.ToString());
|
||||
|
||||
//Test DB Connection
|
||||
Program.Log.Info("Testing DB connection... ");
|
||||
using (MySqlConnection conn = new MySqlConnection(String.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD)))
|
||||
|
|
|
@ -116,7 +116,7 @@ namespace FFXIVClassic_Map_Server
|
|||
}
|
||||
|
||||
Console.ForegroundColor = ConsoleColor.White;
|
||||
Program.Log.Debug("Map Server has started @ {0}:{1}", (mServerSocket.LocalEndPoint as IPEndPoint).Address, (mServerSocket.LocalEndPoint as IPEndPoint).Port);
|
||||
Program.Log.Info("Map Server has started @ {0}:{1}", (mServerSocket.LocalEndPoint as IPEndPoint).Address, (mServerSocket.LocalEndPoint as IPEndPoint).Port);
|
||||
Console.ForegroundColor = ConsoleColor.Gray;
|
||||
|
||||
mProcessor = new PacketProcessor(this, mConnectedPlayerList, mConnectionList);
|
||||
|
|
|
@ -302,7 +302,7 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||
zone.BroadcastPacketAroundActor(this, ChangeSpeedPacket);
|
||||
}
|
||||
|
||||
public void generateActorName(int actorNumber)
|
||||
public void GenerateActorName(int actorNumber)
|
||||
{
|
||||
//Format Class Name
|
||||
string className = this.className.Replace("Populace", "Ppl")
|
||||
|
|
|
@ -348,7 +348,7 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||
return;
|
||||
|
||||
Npc npc = new Npc(mActorList.Count + 1, actorClass.actorClassId, location.uniqueId, actorId, location.x, location.y, location.z, location.rot, location.state, location.animId, actorClass.displayNameId, null, actorClass.classPath);
|
||||
npc.loadEventConditions(actorClass.eventConditions);
|
||||
npc.LoadEventConditions(actorClass.eventConditions);
|
||||
|
||||
AddActorToZone(npc);
|
||||
}
|
||||
|
|
|
@ -45,7 +45,7 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||
|
||||
this.actorClassId = classId;
|
||||
|
||||
loadNpcAppearance(classId);
|
||||
LoadNpcAppearance(classId);
|
||||
|
||||
this.classPath = classPath;
|
||||
className = classPath.Substring(classPath.LastIndexOf("/")+1);
|
||||
|
@ -73,7 +73,7 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||
npcWork.pushCommand = 0x271D;
|
||||
npcWork.pushCommandPriority = 1;
|
||||
|
||||
generateActorName((int)actorNumber);
|
||||
GenerateActorName((int)actorNumber);
|
||||
}
|
||||
|
||||
public SubPacket CreateAddActorPacket(uint playerActorId)
|
||||
|
@ -186,7 +186,7 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||
return actorClassId;
|
||||
}
|
||||
|
||||
public void loadNpcAppearance(uint id)
|
||||
public void LoadNpcAppearance(uint id)
|
||||
{
|
||||
using (MySqlConnection conn = new MySqlConnection(String.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD)))
|
||||
{
|
||||
|
@ -288,7 +288,7 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||
}
|
||||
}
|
||||
|
||||
public void loadEventConditions(string eventConditions)
|
||||
public void LoadEventConditions(string eventConditions)
|
||||
{
|
||||
EventList conditions = JsonConvert.DeserializeObject<EventList>(eventConditions);
|
||||
this.eventConditions = conditions;
|
||||
|
|
|
@ -241,7 +241,7 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||
packets.Add(_0x132Packet.BuildPacket(playerActorId, 0x4, "commandContent"));
|
||||
packets.Add(_0x132Packet.BuildPacket(playerActorId, 0x6, "commandJudgeMode"));
|
||||
packets.Add(_0x132Packet.BuildPacket(playerActorId, 0x100, "commandRequest"));
|
||||
packets.Add(_0x132Packet.BuildPacket(playerActorId, 0x100, "widGetCreate"));
|
||||
packets.Add(_0x132Packet.BuildPacket(playerActorId, 0x100, "widgetCreate"));
|
||||
packets.Add(_0x132Packet.BuildPacket(playerActorId, 0x100, "macroRequest"));
|
||||
return packets;
|
||||
}
|
||||
|
@ -386,7 +386,7 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||
for (int i = 0; i < charaWork.additionalCommandAcquired.Length; i++)
|
||||
{
|
||||
if (charaWork.additionalCommandAcquired[i] != false)
|
||||
propPacketUtil.AddProperty(String.Format("charaWork.AdditionalCommandAcquired[{0}]", i));
|
||||
propPacketUtil.AddProperty(String.Format("charaWork.additionalCommandAcquired[{0}]", i));
|
||||
}
|
||||
|
||||
for (int i = 0; i < charaWork.parameterSave.commandSlot_compatibility.Length; i++)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue