IZone.cs 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. namespace Pomelo
  6. {
  7. public class ZoneConfig
  8. {
  9. /// <summary>
  10. /// 启动路径
  11. /// </summary>
  12. public string startPath;
  13. /// <summary>
  14. /// 资源路径
  15. /// </summary>
  16. public string assetPath;
  17. }
  18. public interface IZone
  19. {
  20. //开启场景控制器
  21. void Start(ZoneConfig zoneConfig);
  22. //关闭场景控制器
  23. void Stop();
  24. void SetCallBack(string gameSrvId);
  25. //创建副本
  26. void CreateZone(string playerId, string gameServerId, int mapTemplateId, string instanceId, bool forceCreate, string data, Action<int> cb, Action<Exception> err);
  27. //销毁副本
  28. void DestroyZone(string instanceId, Action<Exception, object> cb);
  29. //玩家进入副本
  30. void PlayerEnter(string playerId, string instanceId, string data, Action<Exception, object> cb);
  31. //玩家离开副本
  32. void PlayerLeave(string playerId, string instanceId, bool keepObject, Action<Exception, object> cb);
  33. //玩家网络状况改变
  34. void PlayerNetStateChanged(string playerId, string state);
  35. //清理所有的玩家
  36. void ClearAllPlayers(Action<Exception, object> cb);
  37. //获取所有玩家数量
  38. void GetAllPlayerCount(Action<Exception, int> cb);
  39. // 接收玩家数据包
  40. void PlayerReceive(string playerId, byte[] msg);
  41. // 获取服务器状态
  42. void GetServerState(string serverID, Action<Exception, object> cb);
  43. //游戏服注册
  44. void RegisterGameServer(int serverId, int crossId, Action<Exception, string> cb);
  45. //获取单位血量
  46. void GetUnitHP(string instanceId, int objectId, Action<Exception, int> cb);
  47. }
  48. }