public AreaZoneNode(AreaService svc, CreateZoneNodeRequest create, MapTemplateData map_temp) { Alloc.RecordConstructor(GetType().ToVisibleName() + ":" + map_temp.id); this.log = LoggerFactory.GetLogger(string.Format("{0}-{1}", GetType().Name, create.managerZoneUUID)); this.service = svc; this.create = create; this.map_temp = map_temp; this.uuid = create.managerZoneUUID; this.node = CreateZoneNode(create); }
public async Task <CreateZoneNodeResponse> area_manager_rpc_CreateZone(CreateZoneNodeRequest create) { try { var maptemp = RPGServerTemplateManager.Instance.GetMapTemplate(create.mapTemplateID); if (maptemp == null) { throw new Exception("No MapTemplate : " + create.mapTemplateID); } var zoneUUID = create.managerZoneUUID; if (zoneNodes.ContainsKey(zoneUUID)) { throw new Exception(string.Format("node instance id ({0}) already exist!", zoneUUID)); } AreaZoneNode node = this.CreateZoneNode(create, maptemp); zoneNodes.TryAdd(zoneUUID, node); var z = await node.DoStartAsync(); // log.InfoFormat("Scene Started : {0} : {1}", z.UUID, z.Data); return(new CreateZoneNodeResponse() { areaName = SelfAddress.ServiceName, areaNode = SelfAddress.ServiceNode, zoneUUID = zoneUUID, TemplateID = maptemp.zone_template_id, }); } catch (Exception e) { log.Error("CreateZone failed, error: " + e.Message, e); return(new CreateZoneNodeResponse() { s2c_code = CreateZoneNodeResponse.CODE_ERROR, s2c_msg = e.Message, }); } }
protected virtual AreaZoneNode CreateZoneNode(CreateZoneNodeRequest create, MapTemplateData map) { return(new AreaZoneNode(this, create, map)); }
protected virtual ZoneNode CreateZoneNode(CreateZoneNodeRequest input) { return(RPGServerBattleManager.ZoneFactory.CreateServerZoneNode(this, RPGServerBattleManager.DataRoot, RPGServerBattleManager.NodeConfig)); }
protected virtual SceneData LoadSceneData(CreateZoneNodeRequest input) { return(RPGServerBattleManager.Instance.GetSceneAsCache(this.ZoneTemplateID)); }