diff --git a/MCGalaxy/Commands/CPE/CmdEntityRot.cs b/MCGalaxy/Commands/CPE/CmdEntityRot.cs index 4f08bdeae..674f1c7c0 100644 --- a/MCGalaxy/Commands/CPE/CmdEntityRot.cs +++ b/MCGalaxy/Commands/CPE/CmdEntityRot.cs @@ -51,12 +51,8 @@ namespace MCGalaxy.Commands.CPE { if (!ParseArgs(p, args, 1, ref prop, ref angle)) return; Entities.UpdateEntityProp(who, prop, angle); - /*if (model != "humanoid") { - Server.models.AddOrReplace(who.name, model); - } else { - Server.models.Remove(who.name); - } - Server.models.Save();*/ + Server.rotations.AddOrReplace(who.name, who.Rot.RotX + " " + who.Rot.RotZ); + Server.rotations.Save(); } static bool ParseArgs(Player p, string[] args, int i, ref EntityProp prop, ref int angle) { diff --git a/MCGalaxy/Player/Player.Login.cs b/MCGalaxy/Player/Player.Login.cs index a6706fe4f..a4b4afd17 100644 --- a/MCGalaxy/Player/Player.Login.cs +++ b/MCGalaxy/Player/Player.Login.cs @@ -176,12 +176,22 @@ namespace MCGalaxy { } void LoadCpeData() { - string savedSkin = Server.skins.FindData(name); - if (savedSkin != null) SkinName = savedSkin; + string skin = Server.skins.FindData(name); + if (skin != null) SkinName = skin; - string savedModel = Server.models.FindData(name); - if (savedModel != null) Model = savedModel; + string model = Server.models.FindData(name); + if (model != null) Model = model; ModelBB = AABB.ModelAABB(Model, level); + + string rotations = Server.rotations.FindData(name); + if (rotations == null) return; + string[] rotParts = rotations.SplitSpaces(2); + if (rotParts.Length != 2) return; + + Orientation rot = Rot; + byte.TryParse(rotParts[0], out rot.RotX); + byte.TryParse(rotParts[1], out rot.RotZ); + Rot = rot; } void InitPlayerStats(DataTable playerDb) { @@ -200,7 +210,7 @@ namespace MCGalaxy { muted = true; Chat.MessageGlobal(this, DisplayName + " &cis still muted from previously.", false); } - + if (Server.frozen.Contains(name)) { frozen = true; Chat.MessageGlobal(this, DisplayName + " &cis still frozen from previously.", false); diff --git a/MCGalaxy/Server/Server.Fields.cs b/MCGalaxy/Server/Server.Fields.cs index 6e3b133b3..c62942042 100644 --- a/MCGalaxy/Server/Server.Fields.cs +++ b/MCGalaxy/Server/Server.Fields.cs @@ -93,7 +93,7 @@ namespace MCGalaxy { public static CTFGame ctf = null; public static PlayerList bannedIP, whiteList, ircControllers, muted, invalidIds; public static PlayerList ignored, frozen, hidden, agreed, vip, noEmotes, lockdown; - public static PlayerExtList jailed, models, skins, reach, tempBans; + public static PlayerExtList jailed, models, skins, reach, tempBans, rotations; public static readonly List Devs = new List(), Mods = new List(); diff --git a/MCGalaxy/Server/Server.Init.cs b/MCGalaxy/Server/Server.Init.cs index 3c6421bfb..b78bb49c9 100644 --- a/MCGalaxy/Server/Server.Init.cs +++ b/MCGalaxy/Server/Server.Init.cs @@ -72,6 +72,7 @@ namespace MCGalaxy { reach = PlayerExtList.Load("extra/reach.txt"); invalidIds = PlayerList.Load("extra/invalidids.txt"); tempBans = PlayerExtList.Load("text/tempbans.txt"); + rotations = PlayerExtList.Load("extra/rotations.txt"); if (useWhitelist) whiteList = PlayerList.Load("whitelist.txt");