示例#1
0
        void DNF_PluginsClass_ReceiveNormalIM(object sender, ReceiveNormalIM e)
        {
            Random rnd = new Random();

            switch (e.Message)
            {
            case "@d4":
                SendMessage(e.Sender, e.SendName + ",您摇出的数字是:" + rnd.Next(1, 5).ToString());
                break;

            case "@d6":
                SendMessage(e.Sender, e.SendName + ",您摇出的数字是:" + rnd.Next(1, 7).ToString());
                break;

            case "@d8":
                SendMessage(e.Sender, e.SendName + ",您摇出的数字是:" + rnd.Next(1, 9).ToString());
                break;

            case "@d10":
                SendMessage(e.Sender, e.SendName + ",您摇出的数字是:" + rnd.Next(1, 11).ToString());
                break;

            case "@d12":
                SendMessage(e.Sender, e.SendName + ",您摇出的数字是:" + rnd.Next(1, 13).ToString());
                break;

            case "@d20":
                SendMessage(e.Sender, e.SendName + ",您摇出的数字是:" + rnd.Next(1, 21).ToString());
                break;
            }
        }
示例#2
0
        void ServerTurnCheck_ReceiveNormalIM(object sender, ReceiveNormalIM e)
        {
            if (db == null)
            {
                db = new SDK_Db(this);
            }
            db.ReadData();
            if (db.GetObject("fb_Data") != null)
            {
                sData.fb_Data = db.GetObject("fb_Data").ToString();
            }
            if (db.GetObject("bb_Data") != null)
            {
                sData.bb_Data = db.GetObject("bb_Data").ToString();
            }
            db.AddObject("fb_Data", sData.fb_Data);
            db.AddObject("bb_Data", sData.bb_Data);
            db.SavaData();

            string[] Arg = e.Message.Split(' ');
            switch (Arg[0].ToLower())
            {
            case "@turn":    //赛季更新查询
                if (Arg.Length == 2)
                {
                    SendMessage(e.Sender, sc.GetGameTurn(Arg[1]));
                }
                else
                {
                    SendMessage(e.Sender, e.SendName + "," + "参数错误。\r赛季更新检测的使用方法:@turn 项目名称(BB,FB)\r例:@turn BB");
                }
                break;

            case "@status":    //夜间更新查询
                if (Arg.Length == 2)
                {
                    SendMessage(e.Sender, sc.GetGameStatus(Arg[1]));
                }
                else
                {
                    SendMessage(e.Sender, e.SendName + "," + "参数错误。\r夜间更新检测的使用方法:@status 项目名称(BB,FB)\r例:@status BB");
                }
                break;

            case "@season":    //赛季更新时间查询
                if (Arg.Length == 2)
                {
                    SendMessage(e.Sender, sc.GetGameSeason(Arg[1]));
                }
                else
                {
                    SendMessage(e.Sender, e.SendName + "," + "参数错误。\r赛季更新检测的使用方法:@season 关键字名称(XBA,DW,TOM)\r例:@season XBA");
                }
                break;

            case "@check":    //查询夜间更新是否执行
                if (Arg.Length == 2)
                {
                    SendMessage(e.Sender, sc.GetGameCheck(Arg[1]));
                }
                else
                {
                    SendMessage(e.Sender, e.SendName + "," + "参数错误。\r查询夜间更新是否执行的使用方法:@check 项目名称(BB,FB)\r例:@check BB");
                }
                break;
            }
        }