Beispiel #1
0
 public MeHandle(JSONAPI api) : base(api)
 {
 }
Beispiel #2
0
 public GameHandle(JSONAPI api) : base(api)
 {
 }
Beispiel #3
0
 public APIStub(JSONAPI api)
 {
     this.api = api;
 }
Beispiel #4
0
 public BotHandle(JSONAPI api) : base(api)
 {
 }
Beispiel #5
0
 public ChatHandle(JSONAPI api) : base(api)
 {
 }
Beispiel #6
0
        public Hashtable parseResult(NameValueCollection res)
        {
            Hashtable reqData = new Hashtable();

            reqData["secretKey"] = this.apiKey;
            reqData["apiVersion"] = this.Version.ToString();

            JSONAPI reqHandler = new JSONAPI(this.apiKey, this.Version);

            Hashtable result = new Hashtable();
            switch ((string)res["cmd"])
            {
                default:
                    throw new Exception(string.Format("{0} is not a valid cmd.", res["cmd"]));
                case "me:playerInfo":
                    result = reqHandler.Me.getPlayerInfo(Me);
                    break;
                case "me:gameStats":
                    result = reqHandler.Me.getGameStats(Me);
                    break;
                case "me:items":
                    result = reqHandler.Me.getItems(Me);
                    break;
                case "me:allStats":
                    result = reqHandler.Me.getAllStats(Me);
                    break;
                case "chat:send":
                    LuaAPI.SendChatMessage(
                        LuaAPI.cs(res["msg"]),
                        LuaAPI.cs(res["chatType"]),
                        LuaAPI.cs(res["language"]),
                        LuaAPI.cs(res["channel"])
                        );
                    break;
                case "game:getScreenshots":
                    result = reqHandler.Game.getScreenshots(getScreenshotDir());
                    break;
                case "game:takeScreenshot":
                    result = reqHandler.Game.takeScreenshot(getScreenshotDir());
                    break;
                case "bot:start":
                    result = reqHandler.Bot.start();
                    break;
                case "chat:logs":
                    result = reqHandler.Chat.logs(chatLogs, res["EventName"]);
                    break;
                case "bot:isRunning":
                    result = reqHandler.Bot.isRunning();
                    break;
                case "bot:stop":
                    result = reqHandler.Bot.stop();
                    break;

            }
            reqData["result"] = result;

            return reqData;
        }
Beispiel #7
0
        public Hashtable parseResult(NameValueCollection res)
        {
            Hashtable reqData = new Hashtable();

            reqData["secretKey"]  = this.apiKey;
            reqData["apiVersion"] = this.Version.ToString();


            JSONAPI reqHandler = new JSONAPI(this.apiKey, this.Version);

            Hashtable result = new Hashtable();

            switch ((string)res["cmd"])
            {
            default:
                throw new Exception(string.Format("{0} is not a valid cmd.", res["cmd"]));

            case "me:playerInfo":
                result = reqHandler.Me.getPlayerInfo(Me);
                break;

            case "me:gameStats":
                result = reqHandler.Me.getGameStats(Me);
                break;

            case "me:items":
                result = reqHandler.Me.getItems(Me);
                break;

            case "me:allStats":
                result = reqHandler.Me.getAllStats(Me);
                break;

            case "chat:send":
                LuaAPI.SendChatMessage(
                    LuaAPI.cs(res["msg"]),
                    LuaAPI.cs(res["chatType"]),
                    LuaAPI.cs(res["language"]),
                    LuaAPI.cs(res["channel"])
                    );
                break;

            case "game:getScreenshots":
                result = reqHandler.Game.getScreenshots(getScreenshotDir());
                break;

            case "game:takeScreenshot":
                result = reqHandler.Game.takeScreenshot(getScreenshotDir());
                break;

            case "bot:start":
                result = reqHandler.Bot.start();
                break;

            case "chat:logs":
                result = reqHandler.Chat.logs(chatLogs, res["EventName"]);
                break;

            case "bot:isRunning":
                result = reqHandler.Bot.isRunning();
                break;

            case "bot:stop":
                result = reqHandler.Bot.stop();
                break;
            }
            reqData["result"] = result;


            return(reqData);
        }
Beispiel #8
0
 public BotHandle(JSONAPI api)
     : base(api)
 {
 }
Beispiel #9
0
 public APIStub(JSONAPI api)
 {
     this.api = api;
 }
Beispiel #10
0
 public MeHandle(JSONAPI api)
     : base(api)
 {
 }
Beispiel #11
0
 public GameHandle(JSONAPI api)
     : base(api)
 {
 }
Beispiel #12
0
 public ChatHandle(JSONAPI api)
     : base(api)
 {
 }