protected internal override void OnPurchase(Player p, string msg) { if (msg.Length == 0) { PlayerDB.SetLogoutMessage(p.name, ""); p.Message("&aYour logout message was removed for free."); return; } if (!CheckPrice(p)) { return; } if (msg == PlayerDB.GetLogoutMessage(p)) { p.Message("&WYou already have that logout message."); return; } if (msg.Length > NetUtils.StringSize) { p.Message("&WLogin message must be 64 characters or less."); return; } if (!PlayerOperations.SetLogoutMessage(p, p.name, msg)) { return; } Economy.MakePurchase(p, Price, "%3LogoutMessage: %f" + msg); }
protected internal override void OnPurchase(Player p, string nick) { if (nick.Length == 0) { PlayerOperations.SetNick(p, p.name, ""); p.Message("&aYour nickname was removed for free."); return; } if (!CheckPrice(p)) { return; } if (nick == p.DisplayName) { p.Message("&WYou already have that nickname."); return; } if (nick.Length >= 30) { p.Message("&WNicknames must be under 30 characters."); return; } if (!PlayerOperations.SetNick(p, p.name, nick)) { return; } Economy.MakePurchase(p, Price, "%3Nickname: %f" + nick); }
protected internal override void OnPurchase(Player p, string args) { if (args.Length == 0) { OnStoreCommand(p); return; } string color = Matcher.FindColor(p, args); if (color == null) { return; } string name = Colors.Name(color); if (!CheckPrice(p)) { return; } if (color == p.color) { p.Message("&WYour color is already " + color + name); return; } if (!PlayerOperations.SetColor(p, p.name, name)) { return; } Economy.MakePurchase(p, Price, "%3Color: " + color + name); }
public PlayerOperationsClassLib() { _testClient = new TextTestClient(); _wordRecogniser = new WordRecogniser(); _playerOps = new PlayerOperations(); _testClient.LogInAndConnect("helen", "potato"); }
public static void LoggedIn(string Username, string Password, object obj, EventArgs args) { client = new TextTestClient(); client.LogInAndConnect(Username, Password); while (client.IsConnectedAndLoggedIn() == false) { Thread.Sleep(0); } playerOps = new PlayerOperations(); myWin = new Window("HistMMorpg Client"); //Create a label and put some text in it. tableLayout = new Table(5, 5, false); northEast = new Button("North East"); northWest = new Button("North West"); east = new Button("East"); west = new Button("West"); southEast = new Button("South East"); southWest = new Button("South West"); siege = new Button("Siege"); hire = new Button("Hire"); SetUpDirectionalButtonClicks(); SetUpOperationButtonClicks(); //Add the label to the form tableLayout.Attach(northEast, 0, 1, 0, 1); tableLayout.Attach(northWest, 1, 2, 0, 1); tableLayout.Attach(east, 0, 1, 1, 2); tableLayout.Attach(west, 1, 2, 1, 2); tableLayout.Attach(siege, 2, 3, 1, 2); tableLayout.Attach(southEast, 0, 1, 2, 3); tableLayout.Attach(southWest, 1, 2, 2, 3); tableLayout.Attach(hire, 2, 3, 0, 1); myWin.Add(tableLayout); /*ProtoPlayerCharacter player = playerOps.Profile (client); * profileTable = new ProfileTable (player.playerID, player.firstName + " " + player.familyName, player.ownedFiefs, player.location, player.armyID, Convert.ToString( player.purse)); * tableLayout.Attach (profileTable.getProfileLayout (), 3, 4, 1, 2); * ProtoFief fiefData = playerOps.FiefDetails (client); * fiefTable = new FiefTable (fiefData.fiefID, fiefData.owner, Convert.ToString (fiefData.industry), * fiefData.charactersInFief, fiefData.armies); * tableLayout.Attach (fiefTable.getProfileTable (), 3, 4, 2, 3);*/ //ProfileClickEvent (null, null); //FiefClickEvent (null, null); //Show Everything FiefClickEvent(obj, args); ProfileClickEvent(obj, args); myWin.ShowAll(); }
protected override void SetPlayerData(Player p, string target, string skin) { string rawName = target.RemoveLastPlus(); skin = ParseSkin(p, skin, rawName); if (skin == null) { return; } Player who = PlayerInfo.FindExact(target); if (p == who) { p.Message("Changed your own skin to &c" + skin); } else { PlayerOperations.MessageAction(p, target, who, "λACTOR &Schanged λTARGET skin to &c" + skin); } if (who != null) { who.SkinName = skin; } if (who != null) { Entities.GlobalRespawn(who); } if (skin == rawName) { Server.skins.Remove(target); } else { Server.skins.Update(target, skin); } Server.skins.Save(); }
protected internal override void OnPurchase(Player p, string title) { if (title.Length == 0) { PlayerOperations.SetTitle(p, p.name, ""); p.Message("&aYour title was removed for free."); return; } if (!CheckPrice(p)) { return; } if (title == p.title) { p.Message("&WYou already have that title."); return; } if (!PlayerOperations.SetTitle(p, p.name, title)) { return; } Economy.MakePurchase(p, Price, "%3Title: %f" + title); }
protected override void SetPlayerData(Player p, string target, string msg) { PlayerOperations.SetLoginMessage(p, target, msg); }
protected override void SetPlayerData(Player p, string target, string colName) { PlayerOperations.SetTitleColor(p, target, colName); }
protected override void SetPlayerData(Player p, string target, string nick) { PlayerOperations.SetNick(p, target, nick); }
protected override void SetPlayerData(Player p, string target, string title) { PlayerOperations.SetTitle(p, target, title); }