Program.cs 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. using CommonAI.Zone;
  2. using CommonAIServer.Connector;
  3. using CommonNetwork.Sockets;
  4. using System;
  5. using System.Collections.Generic;
  6. using System.IO;
  7. using System.Linq;
  8. using System.Text;
  9. using System.Windows.Forms;
  10. namespace ZeusServerTestClient
  11. {
  12. static class Program
  13. {
  14. /// <summary>
  15. /// 应用程序的主入口点。
  16. /// </summary>
  17. [STAThread]
  18. static void Main(string[] args)
  19. {
  20. Application.EnableVisualStyles();
  21. Application.SetCompatibleTextRenderingDefault(false);
  22. Application.Run(startWinForm());
  23. }
  24. private static FormLauncher startWinForm()
  25. {
  26. ClientLoader loader = new ClientLoader();
  27. TemplateManager.setFactory(new ZeusCommon.Plugin.ZeusZoneFactory());
  28. loader.Init(new DirectoryInfo(Application.StartupPath + "/mpq"));
  29. return new FormLauncher(
  30. "file://H:\\projects\\morefuntek\\Zeus\\GameEditors\\GameEditor\\data\\",
  31. "test", // player_uuid
  32. "107", // room_id
  33. typeof(NetSession).FullName, "127.0.0.1:19999", // connect_driver, connect_string
  34. 33, // update interval
  35. 10, // sync range
  36. 3, 0, 107, // unit_template_id, force, scene_id
  37. loader, false, false);
  38. }
  39. private class ClientLoader : TestClientLoader
  40. {
  41. public override CommonAI.ZoneServer.CreateUnitInfoR2B GenUnitInfoR2B(int unitID)
  42. {
  43. CommonAI.ZoneServer.CreateUnitInfoR2B ret = new CommonAI.ZoneServer.CreateUnitInfoR2B();
  44. ret.UnitTemplateID = unitID;
  45. return ret;
  46. }
  47. public override Type ZoneFactoryType
  48. {
  49. get { return typeof(ZeusCommon.Plugin.ZeusZoneFactory); }
  50. }
  51. }
  52. }
  53. }