IZone.cs 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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 onNetReconnect(string connetorId, IFastSession session);
  24. //关闭场景控制器
  25. void Stop();
  26. void SetCallBack(string gameSrvId);
  27. //创建副本
  28. void CreateZone(string playerId, string gameServerId, int mapTemplateId, string instanceId, bool forceCreate, string data, Action<int> cb, Action<Exception> err);
  29. //销毁副本
  30. void DestroyZone(string instanceId, Action<Exception, object> cb);
  31. //玩家进入副本
  32. void PlayerEnter(string playerId, string instanceId, string data, Action<Exception, object> cb);
  33. //玩家离开副本
  34. void PlayerLeave(string playerId, string instanceId, bool keepObject, Action<Exception, object> cb);
  35. //玩家网络状况改变
  36. void PlayerNetStateChanged(string playerId, string state);
  37. //清理所有的玩家
  38. void ClearAllPlayers(Action<Exception, object> cb);
  39. //获取所有玩家数量
  40. void GetAllPlayerCount(Action<Exception, int> cb);
  41. // 接收玩家数据包
  42. void PlayerReceive(string playerId, byte[] msg);
  43. // 获取服务器状态
  44. void GetServerState(string serverID, Action<Exception, object> cb);
  45. //游戏服注册
  46. void RegisterGameServer(int serverId, int crossId, Action<Exception, string> cb);
  47. //获取单位血量
  48. void GetUnitHP(string instanceId, int objectId, Action<Exception, int> cb);
  49. }
  50. }