public Boolean onYCommand(String YSender, YingCommandInfo YCommand, String YLabel, String[] YArgs)
        {
            getYConsole().sendYMessage("Restarting the server");

            getYServer().YStop();
            System.Diagnostics.Process.Start(System.Reflection.Assembly.GetExecutingAssembly().Location);
            Application.Current.Shutdown();

            return(true);
        }
Example #2
0
        public Boolean onYCommand(String YSender, YingCommandInfo YCommand, String YLabel, String[] YArgs)
        {
            getYConsole().sendYMessage("--------- YingHelp: Index ---------");
            foreach (KeyValuePair <String, YingCommandInfo> y in getYCommandManager().getYCommands())
            {
                getYConsole().sendYMessage($"/{y.Key}: {y.Value.getYDescribe()}");
            }

            return(true);
            //throw new NotImplementedException();
        }
Example #3
0
        public Boolean onYCommand(String YSender, YingCommandInfo YCommand, String YLabel, String[] YArgs)
        {
            getYConsole().sendYMessage(JsonConvert.SerializeObject(getYServer().getYService()));

            /*getYConsole().sendYMessage($"There are {getYServer().getYClients().Count}/20020604 players online:");
             * foreach (KeyValuePair<String, YingBehavior> y in getYServer().getYClients())
             * {
             *  getYConsole().sendYMessage(y.Key + " | " + y.Value.StartTime);
             * }*/
            return(true);
        }
Example #4
0
        public Boolean onYCommand(String YSender, YingCommandInfo YCommand, String YLabel, String[] YArgs)
        {
            getYConsole().sendYMessage("Stopping the server");

            getYServer().YStop();

            getYPluginManager().YDisableAll();

            Application.Current.Shutdown();

            //YingApp.Main.Current.Shutdown();

            return(true);
        }
Example #5
0
    {///tell <player> <private message ...>
        public Boolean onYCommand(String YSender, YingCommandInfo YCommand, String YLabel, String[] YArgs)
        {
            if (YArgs.Length == 0)
            {
                return(false);
            }

            getYServer().getYService().BroadcastAsync(JsonMapper.ToJson(new YingStruct()
            {
                ytype = YingStruct.YingType.Ying,
                ydata = new YingStruct.YingData()
                {
                    ycode    = 0,
                    ysender  = YSender,
                    ymessage = String.Join(" ", YArgs),
                    ydata    = null
                }
            }), () => { });

            return(true);
        }
Example #6
0
        public bool onYCommand(String YSender, YingCommandInfo YCommand, String YLabel, String[] YArgs)
        {
            /*YingMail.ysend("*****@*****.**", new StreamReader(getYFiles().getYResource("Ying.yresources.yhtml.Ying.html")).ReadToEnd().Replace("{{yname}}", "烟雨城").Replace("{{ycode}}", $"zyy{Convert.ToString(getYTimeStamp())}"));
             * getYConsole().sendYMessage(new YingResolver.YingQQMusicResolver("https://y.qq.com/n/yqq/song/001yBMfz2G4weP.html").YUrl);
             *
             *
             * if (YArgs.Count() > 0)
             * {
             *  getYDataBaseManager().getYConnection().Insert(new zyy_users
             *  {
             *      yusername = "******",
             *      ypassword = "******",
             *      yopenid = "zyy6ea4d76f01544568a486e3c1aa2a5",
             *      yemail = "*****@*****.**"
             *  });
             *
             *  getYDataBaseManager().getYConnection().Insert(new zyy_yggdrasil_profile
             *  {
             *      yyid = "zyy6ea4d76f01544568a486e3c1aa2a5",
             *      yname = "Zhang Ying Ying"
             *  });
             *
             *  getYDataBaseManager().getYConnection().Insert(new zyy_yggdrasil_texture
             *  {
             *      yprofileId = "zyy6ea4d76f01544568a486e3c1aa2a5",
             *      yprofileName = "Ying Ying",
             *      yskin = "zyy.com",
             *      yskinmetadata = "STEVE",
             *      ytimestamp = getYTimeStamp()
             *  });
             *
             *
             *
             * }*/

            if (YArgs.Length < 1)
            {
                return(false);
            }
            else
            {
                switch (YArgs[0])
                {                   //          0       1   2       3
                case "ysettings":   // Ying ysettings set ykey yvalue
                    if (YArgs.Length == 1)
                    {
                        getYConsole().sendYMessage("可用的属性列表");
                        getYConsole().sendYMessage("键           值                       描述");
                        getYDataBaseManager().getYConnection().Table <zyy_settings>().ToList().ForEach((y) => {
                            getYConsole().sendYMessage($"{y.ykey}     {y.yvalue}               {y.ydescription}");
                        });
                    }
                    else if (YArgs.Length > 1)
                    {
                        if (YArgs[1] == "set")
                        {
                            if (YArgs.Length > 2)
                            {
                                getYDataBaseManager().getYConnection().Table <zyy_settings>().ToList().ForEach((y) => {
                                    if (y.ykey == YArgs[2])
                                    {
                                        getYDataBaseManager().getYConnection().InsertOrReplace(new zyy_settings
                                        {
                                            yid          = y.yid,
                                            ykey         = y.ykey,
                                            yvalue       = YArgs[3],
                                            ydescription = y.ydescription
                                        });
                                    }
                                });

                                getYSettings(true);
                            }
                        }
                    }
                    break;

                default:
                    break;
                }

                /*else
                 *  getYConsole().sendYMessage("正确用法", YingWindows.YingLogType.YWarn);*/
            }

            return(false);
        }
Example #7
0
 public Boolean onYCommand(String YSender, YingCommandInfo YCommand, String YLabel, String[] YArgs)
 {
     return(false);
 }