public JsonResult FormSubmit(string id, string orgId, string siteId, double lat, double lon) { var station = new Station { Category = (short)StationCategory.Normal, IsDel = (short)DeleteStatus.No, Lat = lat, Lon = lon, OrgId = orgId, SiteId = siteId }; var data = false; var isAdd = string.IsNullOrWhiteSpace(id); var module = new StationModule(CurrentUser); if (isAdd) { data = module.Add(station); } if (!isAdd) { station.Id = id; data = module.Modify(station, t => t.Id == id); } return(Json(new { code = 0, msg = "Ok", data = data }, "text/html")); }
public JsonResult Remove(string id) { var module = new StationModule(CurrentUser); var data = module.Remove(id); return(Json(new { code = 0, msg = "Ok", data = data })); }
private void OnCollision(Transform other) { if (other.transform.GetComponent <Fighter>()) { Fighter f = other.transform.GetComponent <Fighter>(); CombatMessageManager.AddMessage("Bullet collision with fighter." + transform.name + " - " + f.name, 0); if (f.data.stats.alliance != stats.alliance) { CombatMessageManager.AddMessage("Bullet collision with enemy fighter." + transform.name + " - " + f.name, 1); GameManager.Instance.fighterBehaviour.ApplyDmg(stats.damage, f); Destroy(gameObject); } } if (other.transform.GetComponent <StationModule>()) { StationModule f = other.transform.GetComponent <StationModule>(); CombatMessageManager.AddMessage("Bullet collision with station." + transform.name + " - " + f.name, 0); if (f.stats.alliance != stats.alliance) { CombatMessageManager.AddMessage("Bullet collision with enemy station." + transform.name + " - " + f.name, 1); GameManager.Instance.fighterBehaviour.ApplyDmg(stats.damage, f); Destroy(gameObject); } } }
public void CreateStation(Faction faction, Vector position) { var assignedStationIds = new List <int>(); for (int i = 0; i <= 4; i++) { var id = GetNextObjectId(); assignedStationIds.Add(id); AddObject(id); } var hqModule = new StationModule(assignedStationIds[0], position, this, AssetTypes.HQ); var hangarModule = new StationModule(assignedStationIds[1], Vector.FromVector(position, 800, 0), this, AssetTypes.HANGAR); var resourceModule = new StationModule(assignedStationIds[2], Vector.FromVector(position, 0, 800), this, AssetTypes.ORE_TRADE); var repairModule = new StationModule(assignedStationIds[3], Vector.FromVector(position, 0, -800), this, AssetTypes.REPAIR_DOCK); Objects[assignedStationIds[0]] = new Station(assignedStationIds[0], new List <StationModule> { hqModule, hangarModule, resourceModule, repairModule }, faction, position, this); Objects[assignedStationIds[1]] = hangarModule; Objects[assignedStationIds[2]] = resourceModule; Objects[assignedStationIds[3]] = repairModule; var zoneId = GetNextZoneId(); Zones.Add(zoneId, new DemiZone(zoneId, new Vector(position.X - 1000, position.Y + 1000), new Vector(position.X + 1000, position.Y - 1000), faction)); Out.WriteLog("Created Station on mapId " + Id); }
public JObject GetData(string orgId, string siteId, int page, int rows) { var count = 0; var module = new StationModule(CurrentUser); var items = module.Page(orgId, siteId, page, rows, out count); var data = TableSiteDataModel.Model.GetJson(items, count, TableSiteHeaderModel.Header); return(data); }
void Start() { m_stationModule = (StationModule)SingletonMgr.ModuleMgr.GetModule(StringMgr.StationModuleName); m_stationInfo = SingletonMgr.GameGlobalInfo.StationInfoList.GetStationInfo(m_stationIndex); m_npcFactory = new NpcFactory(); StartCoroutine(CheckStationEnterStationUpNpcStatus()); StartCoroutine(CheckStationEnterStationDownNpcStatus()); StartCoroutine(CheckStationExitStationUpNpcStatus()); StartCoroutine(CheckStationExitStationDownNpcStatus()); }
public void HandleMessage(ConstructionMessage msg, object extra = null) { Client client = (Client)extra; Player player = client.Player; Assembly a = typeof(StationModule).Assembly; StationModule sm = (StationModule)Activator.CreateInstance(a.GetType("GalaxyShared." + msg.ClassName)); sm.SetDataFromJSON(); if (sm.CanBuild(player)) { Vector3 pos = player.Pos + Vector3.Transform(Vector3.Forward * 3, player.Rotation); ConstructionModule cm = new ConstructionModule(GalaxyServer.Millis, pos, player.Rotation, new Dock()); player.SolarSystem.ConstructionModules.Add(cm); msg.TimeRemaining = cm.BuildTimeRemaining; msg.Guid = cm.Guid; msg.ResourcesNeeded = sm.BuildRequirements; GalaxyServer.AddToSendQueue(client, msg); } }
public override void ReceivePacket(Packet packet) { if (packet == null) { return; } //Npc控制不需要在服务器进行转发给所有的客户端 if (packet == null) { return; } NpcCtrlComplete response = new NpcCtrlComplete(packet.m_data); //站台索引 UInt16 stationIndex = response.m_stationIndex; //0上行,1下行 byte upOrDownFlag = response.m_upOrDownFlag; //0上车,1下车 byte statusFlag = response.m_statusFlag; UnityEngine.Debug.Log("接收到NpcCtrlComplete消息."); //该消息控制屏蔽门状态,因为屏蔽门状态决定了Npc行为 StationModule module = (StationModule)SingletonMgr.ModuleMgr.GetModule(StringMgr.StationModuleName); PingBiMenMgr mgr = (PingBiMenMgr)module.GetDeviceMgr(stationIndex, DeviceType.PingBiMen); if (upOrDownFlag == 0) { //上行 mgr.ShangXingPingBiMenIsOpen = false; if (statusFlag == 0) { //上车 for (int i = 0; i < mgr.ShangXingPingBiMenList.Count; ++i) { ((PingBiMenDevice)mgr.ShangXingPingBiMenList[i]).CanUp = false; } } else if (statusFlag == 1) { //下车 for (int i = 0; i < mgr.ShangXingPingBiMenList.Count; ++i) { ((PingBiMenDevice)mgr.ShangXingPingBiMenList[i]).CanDown = false; } } } else if (upOrDownFlag == 1) { //下行 mgr.XiaXingPingBiMenIsOpen = false; if (statusFlag == 0) { //上车 for (int i = 0; i < mgr.XiaXingPingBiMenList.Count; ++i) { ((PingBiMenDevice)mgr.XiaXingPingBiMenList[i]).CanUp = false; } } else if (statusFlag == 1) { //下车 for (int i = 0; i < mgr.XiaXingPingBiMenList.Count; ++i) { ((PingBiMenDevice)mgr.XiaXingPingBiMenList[i]).CanDown = false; } } } }
void Start() { m_stationModule = TDFramework.SingletonMgr.ModuleMgr.StationModule; }
public void HandleMessage(StationModule sm, object extra = null) { throw new NotImplementedException(); }
void OnGUI() { if (GUILayout.Button("上行屏蔽门打开")) { StationModule module = (StationModule)SingletonMgr.ModuleMgr.GetModule(StringMgr.StationModuleName); PingBiMenMgr mgr = (PingBiMenMgr)module.GetDeviceMgr(0, DeviceType.PingBiMen); mgr.ShangXingPingBiMenIsOpen = true; for (int i = 0; i < mgr.ShangXingPingBiMenList.Count; ++i) { mgr.ShangXingPingBiMenList[i].Open(null); } } if (GUILayout.Button("上行屏蔽门关闭")) { StationModule module = (StationModule)SingletonMgr.ModuleMgr.GetModule(StringMgr.StationModuleName); PingBiMenMgr mgr = (PingBiMenMgr)module.GetDeviceMgr(0, DeviceType.PingBiMen); mgr.ShangXingPingBiMenIsOpen = false; for (int i = 0; i < mgr.ShangXingPingBiMenList.Count; ++i) { mgr.ShangXingPingBiMenList[i].Close(null); } } if (GUILayout.Button("下行屏蔽门打开")) { StationModule module = (StationModule)SingletonMgr.ModuleMgr.GetModule(StringMgr.StationModuleName); PingBiMenMgr mgr = (PingBiMenMgr)module.GetDeviceMgr(0, DeviceType.PingBiMen); mgr.XiaXingPingBiMenIsOpen = true; for (int i = 0; i < mgr.XiaXingPingBiMenList.Count; ++i) { mgr.XiaXingPingBiMenList[i].Open(null); } } if (GUILayout.Button("下行屏蔽门关闭")) { StationModule module = (StationModule)SingletonMgr.ModuleMgr.GetModule(StringMgr.StationModuleName); PingBiMenMgr mgr = (PingBiMenMgr)module.GetDeviceMgr(0, DeviceType.PingBiMen); mgr.XiaXingPingBiMenIsOpen = false; for (int i = 0; i < mgr.XiaXingPingBiMenList.Count; ++i) { mgr.XiaXingPingBiMenList[i].Close(null); } } if (GUILayout.Button("单屏")) { NetworkModule module = (NetworkModule)SingletonMgr.ModuleMgr.GetModule(StringMgr.NetworkModuleName); if (module == null) { return; } PlayerActor u3dPlayerActor = module.GetPlayerActorByU3dId(111); if (u3dPlayerActor != null) { Agent agent = u3dPlayerActor.Agent; ScreenBindCamera screenBindCamera = new ScreenBindCamera() { m_bigScreenIndex = 1, m_smallScreenIndex = 0, m_cameraIndex = 5, m_cameraName = "哈哈哈哈XXXX", m_stationIndex = 5, }; byte[] bytes = screenBindCamera.Packet2Bytes(); UInt16 sendId = TDFramework.SingletonMgr.GameGlobalInfo.ServerInfo.Id; UInt16 u3dId = 111; UInt16 msgLen = (UInt16)bytes.Length; Packet packet = new Packet(sendId, u3dId, TDFramework.SingletonMgr.MessageIDMgr.ScreenBindCameraMessageId, msgLen, bytes); agent.SendPacket(packet.Packet2Bytes()); } } if (GUILayout.Button("切割大屏")) { NetworkModule module = (NetworkModule)SingletonMgr.ModuleMgr.GetModule(StringMgr.NetworkModuleName); if (module == null) { return; } PlayerActor u3dPlayerActor = module.GetPlayerActorByU3dId(111); if (u3dPlayerActor != null) { Agent agent = u3dPlayerActor.Agent; DivisionBigScreen divisionBigScreen = new DivisionBigScreen() { m_bigScreenXDivisionCount = 2, m_bigScreenYDivisionCount = 2 }; byte[] bytes = divisionBigScreen.Packet2Bytes(); UInt16 sendId = TDFramework.SingletonMgr.GameGlobalInfo.ServerInfo.Id; UInt16 u3dId = 111; UInt16 msgLen = (UInt16)bytes.Length; Packet packet = new Packet(sendId, u3dId, TDFramework.SingletonMgr.MessageIDMgr.DivisionBigScreenMessageId, msgLen, bytes); agent.SendPacket(packet.Packet2Bytes()); } } if (GUILayout.Button("切割小屏1")) { NetworkModule module = (NetworkModule)SingletonMgr.ModuleMgr.GetModule(StringMgr.NetworkModuleName); if (module == null) { return; } PlayerActor u3dPlayerActor = module.GetPlayerActorByU3dId(111); if (u3dPlayerActor != null) { Agent agent = u3dPlayerActor.Agent; DivisionSmallScreen divisionSmallScreen = new DivisionSmallScreen() { m_bigScreenIndex = 1, m_smallScreenXDivisionCount = 2, m_smallScreenYDivisionCount = 2, }; byte[] bytes = divisionSmallScreen.Packet2Bytes(); UInt16 sendId = TDFramework.SingletonMgr.GameGlobalInfo.ServerInfo.Id; UInt16 u3dId = 111; UInt16 msgLen = (UInt16)bytes.Length; Packet packet = new Packet(sendId, u3dId, TDFramework.SingletonMgr.MessageIDMgr.DivisionSmallScreenMessageId, msgLen, bytes); agent.SendPacket(packet.Packet2Bytes()); } } if (GUILayout.Button("切割小屏4")) { NetworkModule module = (NetworkModule)SingletonMgr.ModuleMgr.GetModule(StringMgr.NetworkModuleName); if (module == null) { return; } PlayerActor u3dPlayerActor = module.GetPlayerActorByU3dId(111); if (u3dPlayerActor != null) { Agent agent = u3dPlayerActor.Agent; DivisionSmallScreen divisionSmallScreen = new DivisionSmallScreen() { m_bigScreenIndex = 4, m_smallScreenXDivisionCount = 2, m_smallScreenYDivisionCount = 2, }; byte[] bytes = divisionSmallScreen.Packet2Bytes(); UInt16 sendId = TDFramework.SingletonMgr.GameGlobalInfo.ServerInfo.Id; UInt16 u3dId = 111; UInt16 msgLen = (UInt16)bytes.Length; Packet packet = new Packet(sendId, u3dId, TDFramework.SingletonMgr.MessageIDMgr.DivisionSmallScreenMessageId, msgLen, bytes); agent.SendPacket(packet.Packet2Bytes()); } } if (GUILayout.Button("绑定屏幕小屏四分屏1")) { NetworkModule module = (NetworkModule)SingletonMgr.ModuleMgr.GetModule(StringMgr.NetworkModuleName); if (module == null) { return; } PlayerActor u3dPlayerActor = module.GetPlayerActorByU3dId(111); if (u3dPlayerActor != null) { Agent agent = u3dPlayerActor.Agent; ScreenBindCamera screenBindCamera = new ScreenBindCamera() { m_bigScreenIndex = 1, m_smallScreenIndex = 1, m_cameraIndex = 1, m_cameraName = "哈哈哈哈1", m_stationIndex = 5, }; byte[] bytes = screenBindCamera.Packet2Bytes(); UInt16 sendId = TDFramework.SingletonMgr.GameGlobalInfo.ServerInfo.Id; UInt16 u3dId = 111; UInt16 msgLen = (UInt16)bytes.Length; Packet packet = new Packet(sendId, u3dId, TDFramework.SingletonMgr.MessageIDMgr.ScreenBindCameraMessageId, msgLen, bytes); agent.SendPacket(packet.Packet2Bytes()); screenBindCamera = new ScreenBindCamera() { m_bigScreenIndex = 1, m_smallScreenIndex = 2, m_cameraIndex = 2, m_cameraName = "哈哈哈哈2", m_stationIndex = 5, }; bytes = screenBindCamera.Packet2Bytes(); sendId = TDFramework.SingletonMgr.GameGlobalInfo.ServerInfo.Id; u3dId = 111; msgLen = (UInt16)bytes.Length; packet = new Packet(sendId, u3dId, TDFramework.SingletonMgr.MessageIDMgr.ScreenBindCameraMessageId, msgLen, bytes); agent.SendPacket(packet.Packet2Bytes()); screenBindCamera = new ScreenBindCamera() { m_bigScreenIndex = 1, m_smallScreenIndex = 3, m_cameraIndex = 3, m_cameraName = "哈哈哈哈3", m_stationIndex = 5, }; bytes = screenBindCamera.Packet2Bytes(); sendId = TDFramework.SingletonMgr.GameGlobalInfo.ServerInfo.Id; u3dId = 111; msgLen = (UInt16)bytes.Length; packet = new Packet(sendId, u3dId, TDFramework.SingletonMgr.MessageIDMgr.ScreenBindCameraMessageId, msgLen, bytes); agent.SendPacket(packet.Packet2Bytes()); screenBindCamera = new ScreenBindCamera() { m_bigScreenIndex = 1, m_smallScreenIndex = 4, m_cameraIndex = 4, m_cameraName = "哈哈哈哈4", m_stationIndex = 5, }; bytes = screenBindCamera.Packet2Bytes(); sendId = TDFramework.SingletonMgr.GameGlobalInfo.ServerInfo.Id; u3dId = 111; msgLen = (UInt16)bytes.Length; packet = new Packet(sendId, u3dId, TDFramework.SingletonMgr.MessageIDMgr.ScreenBindCameraMessageId, msgLen, bytes); agent.SendPacket(packet.Packet2Bytes()); } } if (GUILayout.Button("绑定屏幕大屏2")) { NetworkModule module = (NetworkModule)SingletonMgr.ModuleMgr.GetModule(StringMgr.NetworkModuleName); if (module == null) { return; } PlayerActor u3dPlayerActor = module.GetPlayerActorByU3dId(111); if (u3dPlayerActor != null) { Agent agent = u3dPlayerActor.Agent; ScreenBindCamera screenBindCamera = new ScreenBindCamera() { m_bigScreenIndex = 2, m_smallScreenIndex = 0, m_cameraIndex = 10, m_cameraName = "哈哈哈哈XXXX", m_stationIndex = 5, }; byte[] bytes = screenBindCamera.Packet2Bytes(); UInt16 sendId = TDFramework.SingletonMgr.GameGlobalInfo.ServerInfo.Id; UInt16 u3dId = 111; UInt16 msgLen = (UInt16)bytes.Length; Packet packet = new Packet(sendId, u3dId, TDFramework.SingletonMgr.MessageIDMgr.ScreenBindCameraMessageId, msgLen, bytes); agent.SendPacket(packet.Packet2Bytes()); } } if (GUILayout.Button("绑定屏幕大屏3")) { NetworkModule module = (NetworkModule)SingletonMgr.ModuleMgr.GetModule(StringMgr.NetworkModuleName); if (module == null) { return; } PlayerActor u3dPlayerActor = module.GetPlayerActorByU3dId(111); if (u3dPlayerActor != null) { Agent agent = u3dPlayerActor.Agent; ScreenBindCamera screenBindCamera = new ScreenBindCamera() { m_bigScreenIndex = 3, m_smallScreenIndex = 0, m_cameraIndex = 14, m_cameraName = "哈哈哈哈XXXX", m_stationIndex = 5, }; byte[] bytes = screenBindCamera.Packet2Bytes(); UInt16 sendId = TDFramework.SingletonMgr.GameGlobalInfo.ServerInfo.Id; UInt16 u3dId = 111; UInt16 msgLen = (UInt16)bytes.Length; Packet packet = new Packet(sendId, u3dId, TDFramework.SingletonMgr.MessageIDMgr.ScreenBindCameraMessageId, msgLen, bytes); agent.SendPacket(packet.Packet2Bytes()); } } if (GUILayout.Button("绑定屏幕小屏四分屏4")) { NetworkModule module = (NetworkModule)SingletonMgr.ModuleMgr.GetModule(StringMgr.NetworkModuleName); if (module == null) { return; } PlayerActor u3dPlayerActor = module.GetPlayerActorByU3dId(111); if (u3dPlayerActor != null) { Agent agent = u3dPlayerActor.Agent; ScreenBindCamera screenBindCamera = new ScreenBindCamera() { m_bigScreenIndex = 4, m_smallScreenIndex = 1, m_cameraIndex = 6, m_cameraName = "哈哈哈哈1", m_stationIndex = 5, }; byte[] bytes = screenBindCamera.Packet2Bytes(); UInt16 sendId = TDFramework.SingletonMgr.GameGlobalInfo.ServerInfo.Id; UInt16 u3dId = 111; UInt16 msgLen = (UInt16)bytes.Length; Packet packet = new Packet(sendId, u3dId, TDFramework.SingletonMgr.MessageIDMgr.ScreenBindCameraMessageId, msgLen, bytes); agent.SendPacket(packet.Packet2Bytes()); screenBindCamera = new ScreenBindCamera() { m_bigScreenIndex = 4, m_smallScreenIndex = 2, m_cameraIndex = 7, m_cameraName = "哈哈哈哈2", m_stationIndex = 5, }; bytes = screenBindCamera.Packet2Bytes(); sendId = TDFramework.SingletonMgr.GameGlobalInfo.ServerInfo.Id; u3dId = 111; msgLen = (UInt16)bytes.Length; packet = new Packet(sendId, u3dId, TDFramework.SingletonMgr.MessageIDMgr.ScreenBindCameraMessageId, msgLen, bytes); agent.SendPacket(packet.Packet2Bytes()); screenBindCamera = new ScreenBindCamera() { m_bigScreenIndex = 4, m_smallScreenIndex = 3, m_cameraIndex = 8, m_cameraName = "哈哈哈哈3", m_stationIndex = 5, }; bytes = screenBindCamera.Packet2Bytes(); sendId = TDFramework.SingletonMgr.GameGlobalInfo.ServerInfo.Id; u3dId = 111; msgLen = (UInt16)bytes.Length; packet = new Packet(sendId, u3dId, TDFramework.SingletonMgr.MessageIDMgr.ScreenBindCameraMessageId, msgLen, bytes); agent.SendPacket(packet.Packet2Bytes()); screenBindCamera = new ScreenBindCamera() { m_bigScreenIndex = 4, m_smallScreenIndex = 4, m_cameraIndex = 9, m_cameraName = "哈哈哈哈4", m_stationIndex = 5, }; bytes = screenBindCamera.Packet2Bytes(); sendId = TDFramework.SingletonMgr.GameGlobalInfo.ServerInfo.Id; u3dId = 111; msgLen = (UInt16)bytes.Length; packet = new Packet(sendId, u3dId, TDFramework.SingletonMgr.MessageIDMgr.ScreenBindCameraMessageId, msgLen, bytes); agent.SendPacket(packet.Packet2Bytes()); } } if (GUILayout.Button("切割大屏8分屏")) { NetworkModule module = (NetworkModule)SingletonMgr.ModuleMgr.GetModule(StringMgr.NetworkModuleName); if (module == null) { return; } PlayerActor u3dPlayerActor = module.GetPlayerActorByU3dId(111); if (u3dPlayerActor != null) { Agent agent = u3dPlayerActor.Agent; DivisionBigScreen divisionBigScreen = new DivisionBigScreen() { m_bigScreenXDivisionCount = 4, m_bigScreenYDivisionCount = 2 }; byte[] bytes = divisionBigScreen.Packet2Bytes(); UInt16 sendId = TDFramework.SingletonMgr.GameGlobalInfo.ServerInfo.Id; UInt16 u3dId = 111; UInt16 msgLen = (UInt16)bytes.Length; Packet packet = new Packet(sendId, u3dId, TDFramework.SingletonMgr.MessageIDMgr.DivisionBigScreenMessageId, msgLen, bytes); agent.SendPacket(packet.Packet2Bytes()); } } if (GUILayout.Button("绑定屏幕大屏1")) { NetworkModule module = (NetworkModule)SingletonMgr.ModuleMgr.GetModule(StringMgr.NetworkModuleName); if (module == null) { return; } PlayerActor u3dPlayerActor = module.GetPlayerActorByU3dId(111); if (u3dPlayerActor != null) { Agent agent = u3dPlayerActor.Agent; ScreenBindCamera screenBindCamera = new ScreenBindCamera() { m_bigScreenIndex = 1, m_smallScreenIndex = 0, m_cameraIndex = 20, m_cameraName = "哈哈哈哈XXXX", m_stationIndex = 5, }; byte[] bytes = screenBindCamera.Packet2Bytes(); UInt16 sendId = TDFramework.SingletonMgr.GameGlobalInfo.ServerInfo.Id; UInt16 u3dId = 111; UInt16 msgLen = (UInt16)bytes.Length; Packet packet = new Packet(sendId, u3dId, TDFramework.SingletonMgr.MessageIDMgr.ScreenBindCameraMessageId, msgLen, bytes); agent.SendPacket(packet.Packet2Bytes()); } } }
public void ApplyDmg(int dmg, StationModule f) { ApplyDmg(dmg, f.stats, f.gameObject, f); }
public void Register(StationModule target) { modules.Add(target.transform); }
internal void DeRegister(StationModule stationModule) { modules.Remove(stationModule.transform); }