Example #1
0
 public ICommand parse(NetCtrlService.Command command, NetCtrlService service)
 {
     ICommand cmd;
     //GetCommand c = new GetCommand(service);
     RestCommand c = new RestCommand(service);
     c.CommnadType = CommandType.C_GET;
     c.Data = new String[] { command.command };
     cmd = c;
     return cmd;
 }
Example #2
0
        public ICommand parse(NetCtrlService.Command command, NetCtrlService service)
        {
            ICommand cmd;
            switch (command.header.type)
            {
                case (uint)CommandType.C_QUERY:
                    {
                        QueryCommand c;
                        getQuery(command.command, out c);
                        cmd = c;
                        break;
                    }
                case (uint)CommandType.C_ACTION:
                    {
                        ActionCommand c;
                        getAction(command.command, out c);
                        cmd = c;
                        break;
                    }
                case (uint)CommandType.C_GET:
                    {
                        GetCommand c = new GetCommand(service);
                        c.Data = new String[] { command.command };
                        cmd = c;
                        break;
                    }
                case (uint)CommandType.C_POST:
                    {
                        PostCommand c = new PostCommand(service);
                        c.Data = new String[] { command.command };
                        cmd = c;
                        break;
                    }
                default:
                    {
                        cmd = null;
                        break;
                    }
            }

            return cmd;
        }
Example #3
0
 public DeleteCommand(NetCtrlService service)
 {
     m_service = service;
 }
Example #4
0
 public RestCommand(NetCtrlService service)
 {
     m_service = service;
 }
Example #5
0
        public TestGame(int processId = 0, string window = "")
        {
            //graphics = new GraphicsDeviceManager(this);
            //graphics.PreferredDepthStencilFormat = DepthFormat.Depth24;
            //graphics.ApplyChanges();
            Content.RootDirectory = "Content";

            // Frame rate is 30 fps by default for Windows Phone.
            TargetElapsedTime = TimeSpan.FromTicks(333333);

            m_core = new Core(this);
            m_scriptExecutor = XmlScriptExecutor.GetInstance(this);
            m_scriptCompiler = new XmlScriptCompilerService(this);
            m_collisionManager = new CollisionManager(this);
            m_sceneManager = new SceneManager(this);
            m_inputManager = new InputManager(this);
            m_animationService = new AnimationService(this);
            // graphics should be inserted last, as they should be updated at the end of a frame
            //RenderManager.TargetWindow target = new RenderManager.TargetWindow();
            //target.ProcessId = processId;
            //target.ChildWndCaption = window;
            //m_renderManager = new RenderManager(this, graphics, target);
            m_renderManager = new RenderManager(this, graphics);
            #if WINDOWS
            m_netCtrl = new NetCtrlService(this);
            #endif
        }
Example #6
0
 public Connection(int port, NetCtrlService service)
 {
     m_port = port;
     m_netCtrl = service;
 }
Example #7
0
 public Worker(TcpClient client, NetCtrlService service, bool isRest)
 {
     m_client = client;
     m_service = service;
     m_bIsRest = isRest;
 }
Example #8
0
 private String parseResource(String[] res, int index, NetCtrlService.RESTGet query, Game game)
 {
     AbstractQuery subQuery = query.query.SubQuery;
     if (subQuery != null)
     {
         if ((index + 1 < res.Length) && res[index + 1] != "")
         {
             subQuery.Data = new String[] {"", res[index]};
             XmlNodeList values = subQuery.executeRest(game);
             if(values != null)
             {
                 foreach (XmlNode node in values)
                 {
                     if (node.LocalName == res[index + 1])
                     {
                         return parseResource(res, index + 1, query, game);
                     }
                 }
             }
         }
         else
         {
             //return
         }
     }
     return String.Empty;
 }