| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398 |
- using DeepCore;
- using DeepCore.IO;
- using DeepCore.Reflection;
- using DeepMMO.Attributes;
- using DeepMMO.Data;
- using DeepMMO.Protocol;
- using System;
- using System.Collections.Generic;
- namespace DeepMMO.Server.AreaManager
- {
- // /// <summary>
- // /// 寻找一个Area
- // /// </summary>
- // [ProtocolRoute("*", "AreaManager")]
- // public class LookingForAreaRequest : Request
- // {
- // /// <summary>
- // /// 预期的Area服务地址
- // /// </summary>
- // public string expectAreaName;
- // /// <summary>
- // /// 预期的Area服务地址
- // /// </summary>
- // public string expectAreaNode;
- // /// <summary>
- // /// 预期的场景
- // /// </summary>
- // public int expectSceneTemplateID;
- // /// <summary>
- // /// 预期的具体战斗场景
- // /// </summary>
- // public string expectZoneUUID;
- // }
- //
- // [ProtocolRoute("AreaManager", "*")]
- // public class LookingForAreaResponse : Response
- // {
- // /// <summary>
- // /// 返回Area服务地址
- // /// </summary>
- // public string areaName;
- // /// <summary>
- // /// 返回Area服务地址
- // /// </summary>
- // public string areaNode;
- // /// <summary>
- // /// 返回场景UUID
- // /// </summary>
- // public string zoneUUID;
- // }
- //---------------------------------------------------------------------------------
- [ProtocolRoute("Area", "AreaManager")]
- public class RegistAreaRequest : Request
- {
- public string areaName;
- public string areaNode;
- }
- [ProtocolRoute("AreaManager", "Area")]
- public class RegistAreaResponse : Response { }
- [ProtocolRoute("Area", "AreaManager")]
- public class AreaStateNotify : Notify
- {
- public string areaName;
- public string areaNode;
- public long memoryMB;
- public float cpuPercent;
- public int zoneCount;
- public int roleCount;
- public override string ToString()
- {
- return ("AreaStateNotify:" +
- "\n areaName=" + this.areaName +
- "\n areaNode=" + this.areaNode +
- "\n roleCount=" + this.roleCount +
- "\n zoneCount=" + this.zoneCount +
- "\n cpuPercent=" + this.cpuPercent +
- "\n memoryMB=" + this.memoryMB);
- }
- }
- //---------------------------------------------------------------------------------
- [ProtocolRoute("Logic", "AreaManager")]
- public class RoleEnterZoneRequest : Request
- {
- /// <summary>
- /// 公会UUID.如果赋值代表单位进公会场景.
- /// </summary>
- public string guildUUID;
- /// <summary>
- /// 服务器ID.
- /// </summary>
- public string serverID;
- /// <summary>
- /// 服务器组ID.
- /// </summary>
- public string servergroupID;
- /// <summary>
- /// 预期的Area服务地址
- /// </summary>
- public string expectAreaName;
- /// <summary>
- /// 预期的Area服务地址
- /// </summary>
- public string expectAreaNode;
- /// <summary>
- /// 预期的场景
- /// 如果为空,表示不知道在哪个场景,一般是第一次注册用户
- /// </summary>
- public int expectMapTemplateID;
- /// <summary>
- /// 预期的具体战斗场景
- /// 如果为空,表示没有确定的实体场景
- /// </summary>
- public string expectZoneUUID;
- /// <summary>
- /// 自定义玩家groupKey,groupkey相同进同一场景
- /// </summary>
- public string roomKey;
- /// <summary>
- /// 角色
- /// </summary>
- public string roleUUID;
- public string roleSessionName;
- public string roleSessionNode;
- public string roleLogicName;
- public string roleLogicNode;
- public int roleForce;
- public int roleUnitTemplateID;
- public string roleDisplayName;
- public ZonePosition roleScenePos;
- public ISerializable LastZoneSaveData;
- public ISerializable roleData;
- public string teamID;
- public string reason;
- /// <summary>
- /// 预期线.
- /// </summary>
- public int expectLineIndex;
- /// <summary>
- /// 上一次的公共场景.
- /// </summary>
- public int lastPublicMapID;
- /// <summary>
- /// 上一次的公共场景UUID.
- /// </summary>
- public string lastPublicMapUUID;
- /// <summary>
- /// 公共场景坐标.
- /// </summary>
- public ZonePosition lastPublicPos;
- /// <summary>
- /// 扩展数据.
- /// </summary>
- public HashMap<string, string> ext;
- }
- [ProtocolRoute("AreaManager", "Logic")]
- public class RoleEnterZoneResponse : Response
- {
- [MessageCode("重新进入")]
- public const int CODE_OK_REPLACE = CODE_OK + 1;
- [MessageCode("场景不存在")]
- public const int CODE_ZONE_NOT_EXIST = CODE_ERROR + 1;
- [MessageCode("角色已在场景中")]
- public const int CODE_ROLE_ALREADY_IN_ZONE = CODE_ERROR + 2;
- [MessageCode("场景未开放")]
- public const int CODE_ZONE_NOT_OPEN = CODE_ERROR + 3;
- [MessageCode("场景已关闭")]
- public const int CODE_ZONE_CLOSED = CODE_ERROR + 4;
- [DependOnProperty(nameof(IsSuccess))]
- public int mapTemplateID;
- [DependOnProperty(nameof(IsSuccess))]
- public string zoneUUID;
- [DependOnProperty(nameof(IsSuccess))]
- public int zoneTemplateID;
- [DependOnProperty(nameof(IsSuccess))]
- public int roleUnitTemplateID;
- [DependOnProperty(nameof(IsSuccess))]
- public string roleDisplayName;
- [DependOnProperty(nameof(IsSuccess))]
- public ISerializable roleBattleData;
- [DependOnProperty(nameof(IsSuccess))]
- public ZonePosition roleScenePos;
- [DependOnProperty(nameof(IsSuccess))]
- public string areaName;
- [DependOnProperty(nameof(IsSuccess))]
- public string areaNode;
- [DependOnProperty(nameof(IsSuccess))]
- public string guildUUID;
- }
- //---------------------------------------------------------------------------------
- [ProtocolRoute("Logic", "AreaManager")]
- public class RoleLeaveZoneRequest : Request
- {
- public string zoneUUID;
- public string roleID;
- public bool keepObject;
- public string reason;
- }
- [ProtocolRoute("AreaManager", "Logic")]
- public class RoleLeaveZoneResponse : Response
- {
- [MessageCode("场景不存在")]
- public const int CODE_ZONE_NOT_EXIST = CODE_ERROR + 1;
- [MessageCode("角色不存在")]
- public const int CODE_ROLE_NOT_EXIST = CODE_ERROR + 2;
- /// <summary>
- /// 最后存在场景坐标
- /// </summary>
- public ZonePosition lastScenePos;
- public ISerializable expandData;
- public ISerializable LeaveZoneSaveData;
- public int curHP;
- public int curMP;
- }
- //---------------------------------------------------------------------------------
- [ProtocolRoute("*", "AreaManager -> Area")]
- public class CreateZoneNodeRequest : Request
- {
- public string serverID;
- public string serverGroupID;
- public string expectAreaNode;
- public int mapTemplateID;
- public string managerZoneUUID;
- public string reason;
- public string createRoleID;
- public string teamID;
- public string guildUUID;
- /// <summary>
- /// 自定义玩家roomKey,roomKey相同进同一场景
- /// </summary>
- public string roomKey;
- /// <summary>
- /// 扩展数据.
- /// </summary>
- public ISerializable expandData;
- }
- [ProtocolRoute("Area -> AreaManager", "*")]
- public class CreateZoneNodeResponse : Response
- {
- [MessageCodeAttribute("地图尚未开放!")]
- public const int CODE_ERROR_MAP_NOT_OPEN = 501;
- public string zoneUUID;
- public string areaName;
- public string areaNode;
- public int TemplateID;
- }
- [ProtocolRoute("*", "AreaManager -> Area")]
- public class DestoryZoneNodeRequest : Request
- {
- public string zoneUUID;
- public string reason;
- }
- [ProtocolRoute("Area -> AreaManager", "*")]
- public class DestoryZoneNodeResponse : Response
- {
- }
- [ProtocolRoute("Area -> AreaManager", "*")]
- public class AreaZoneGameOverNotify : Notify
- {
- public string zoneUUID;
- public string reason;
- }
- [ProtocolRoute("Area -> AreaManager", "*")]
- public class AreaZoneDestoryNotify : Notify
- {
- public string zoneUUID;
- public string reason;
- }
- //---------------------------------------------------------------------------------
- //---------------------------------------------------------------------------------
- [ProtocolRoute("*", "AreaManager")]
- public class GetAllRoleRequest : Request
- {
- }
- [ProtocolRoute("AreaManager", "*")]
- public class GetAllRoleResponse : Response
- {
- public HashMap<string, OnlinePlayerData> uuidMap;
- }
- [ProtocolRoute("*", "AreaManager")]
- public class QueryZoneAreaNameRequest : Request
- {
- public string zoneUUID;
- }
- [ProtocolRoute("AreaManager", "*")]
- public class QueryZoneAreaNameResponse : Response
- {
- public string areaName;
- }
- /// <summary>
- /// 获得场景信息快照.
- /// </summary>
- [ProtocolRoute("logic", "AreaManager")]
- public class GetZonesInfoRequest : Request
- {
- public string servergroupID;
- public int mapID;
- }
- /// <summary>
- /// 获得场景信息快照.
- /// </summary>
- [ProtocolRoute("AreaManager", "logic")]
- public class GetZonesInfoResponse : Response
- {
- public List<ZoneInfoSnap> snaps;
- }
- [ProtocolRoute("Logic", "AreaManager")]
- public class GetRolePositionRequest : Request
- {
- // public string zoneUUID;
- public string roleUUID;
- }
- [ProtocolRoute("AreaManager", "Logic")]
- public class GetRolePositionResponse : Response
- {
- public int zoneId;
- public string zoneUUID;
- public float x;
- public float y;
- public float z;
- public int line;
- [MessageCode("场景不存在")]
- public const int CODE_ZONE_NOT_EXIST = CODE_ERROR + 1;
- [MessageCode("角色不存在")]
- public const int CODE_ROLE_NOT_EXIST = CODE_ERROR + 2;
- }
- [ProtocolRoute("Logic", "AreaManager")]
- public class RoleNameChangedNotify : Notify
- {
- public string roleId;
- public string newName;
- }
- [ProtocolRoute("*", "AreaManager -> Area")]
- public class BatchCreateZoneLineRequest : Request
- {
- public List<CreateZoneNodeRequest> zoneList;
- }
- [ProtocolRoute("Area -> AreaManager", "*")]
- public class BatchCreateZoneLineResponse : Response
- {
- public List<ZoneInfoSnap> zoneList;
- }
- /// <summary>
- /// 获得场景信息快照.
- /// </summary>
- [ProtocolRoute("logic", "AreaManager")]
- public class GetBatchZonesInfoRequest : Request
- {
- public string servergroupID;
- public List<int> mapIDList;
- }
- /// <summary>
- /// 获得场景信息快照.
- /// </summary>
- [ProtocolRoute("AreaManager", "logic")]
- public class GetBatchZonesInfoResponse : Response
- {
- public HashMap<int, List<ZoneInfoSnap>> snapDic;
- }
- //当前秘境玩法状态更新通知
- [ProtocolRoute("Area -> AreaManager", "*")]
- public class CurrentSecretPlacePlayTypeUpdateNotify : Notify
- {
- public string zoneUUID;
- public int update;
- public int playID; //玩法ID
- }
- }
|