# 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:
Tahir Akhlaq 2016-06-18 05:59:42 +01:00
commit 37d91480f9
24 changed files with 185 additions and 138 deletions

View file

@ -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
}