main.cs 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. //-----------------------------------------------------------------------------
  2. // Copyright (c) 2012 GarageGames, LLC
  3. //
  4. // Permission is hereby granted, free of charge, to any person obtaining a copy
  5. // of this software and associated documentation files (the "Software"), to
  6. // deal in the Software without restriction, including without limitation the
  7. // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
  8. // sell copies of the Software, and to permit persons to whom the Software is
  9. // furnished to do so, subject to the following conditions:
  10. //
  11. // The above copyright notice and this permission notice shall be included in
  12. // all copies or substantial portions of the Software.
  13. //
  14. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  15. // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  16. // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  17. // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  18. // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  19. // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
  20. // IN THE SOFTWARE.
  21. //-----------------------------------------------------------------------------
  22. //---------------------------------------------------------------------------------------------
  23. // TCP Debugger
  24. // To use the debugger, first call "dbgSetParameters(port, password);" from one instance of
  25. // your game. Then, in another instance (either on the same system, or a different one) call
  26. // "startDebugger();". Then use the gui to connect to the first instance with the port and
  27. // password you first passed to dbgSetParameters.
  28. //---------------------------------------------------------------------------------------------
  29. function initializeDebugger()
  30. {
  31. echo(" % - Initializing Debugger");
  32. // Load the scripts.
  33. exec("./scripts/debugger.ed.cs");
  34. // And the guis.
  35. exec("./gui/breakConditionDlg.ed.gui");
  36. exec("./gui/connectDlg.ed.gui");
  37. exec("./gui/editWatchDlg.ed.gui");
  38. exec("./gui/findDlg.ed.gui");
  39. exec("./gui/debugger.ed.gui");
  40. exec("./gui/watchDlg.ed.gui");
  41. }
  42. function destroyDebugger()
  43. {
  44. if (isObject(TCPDebugger))
  45. TCPDebugger.delete();
  46. }
  47. function startDebugger()
  48. {
  49. // Clean up first.
  50. destroyDebugger();
  51. // Create a TCP object named TCPDebugger.
  52. new TCPObject(TCPDebugger);
  53. // Used to get unique IDs for breakpoints and watch expressions.
  54. $DbgBreakId = 0;
  55. $DbgWatchSeq = 1;
  56. // Set up the GUI.
  57. DebuggerConsoleView.setActive(false);
  58. $GameCanvas.pushDialog(DebuggerGui);
  59. }