Exemple #1
0
 public override void Action(CommandCaller caller, string input, string[] args)
 {
     if (NetData.IsPlayerServerOwner(PlayerData.MyPlayer))
     {
         if (args.Length > 0)
         {
             string name = string.Join(" ", args);
             if (name.Length <= 20)
             {
                 DUtils.Chat($"Changed {Main.worldName}'s name to '{name}'!", true, Color.CornflowerBlue.R, Color.CornflowerBlue.G, Color.CornflowerBlue.B);
                 Main.worldName = name;
             }
             if (name.Length > 20)
             {
                 Main.NewText("ERROR: You cannot have a name longer than 20 characters.");
             }
         }
         else
         {
             Main.NewText("ERROR: You have not specified a name.");
         }
     }
     else
     {
         Main.NewText("ERROR: You are not the server host.");
     }
 }
 public override bool AcceptClientChanges(ModConfig pendingConfig, int whoAmI, ref string message)
 {
     if (NetData.IsPlayerServerOwner(MyPlayer))
     {
         return(true);
     }
     else
     {
         message = "You are not the server host, and thus can't change global configs.";
         return(false);
     }
 }