Exemplo n.º 1
0
 public void HandleOrder(EntityCommand entityCommand) //public because it's an interface.
 {
     if (entityCommand.IsValidCommand(Game))
     {
         if (FactionConnections.ContainsKey(entityCommand.RequestingFactionGuid))
         {
             foreach (var item in FactionConnections[entityCommand.RequestingFactionGuid])
             {
                 SendEntityCommandAck(item, entityCommand.CmdID, true);
             }
         }
         var orderableDB = entityCommand.EntityCommanding.GetDataBlob <OrderableDB>();
         orderableDB.AddCommandToList(entityCommand);
         orderableDB.ProcessOrderList(entityCommand.EntityCommanding.StarSysDateTime);
     }
 }
Exemplo n.º 2
0
        public void HandleOrder(EntityCommand entityCommand) //public because it's an interface.
        {
            if (entityCommand.IsValidCommand(Game))
            {
                if (FactionConnections.ContainsKey(entityCommand.RequestingFactionGuid))
                {
                    foreach (var item in FactionConnections[entityCommand.RequestingFactionGuid])
                    {
                        SendEntityCommandAck(item, entityCommand.CmdID, true);
                    }
                }

                entityCommand.EntityCommanding.GetDataBlob <OrderableDB>().ActionList.Add(entityCommand);
                var commandList = entityCommand.EntityCommanding.GetDataBlob <OrderableDB>().ActionList;
                OrderableProcessor.ProcessOrderList(Game, commandList);
            }
        }
Exemplo n.º 3
0
 /// <summary>
 /// Adds the faction netcon link if it's not already there.
 /// </summary>
 /// <param name="faction">Faction.</param>
 /// <param name="netCon">Net con.</param>
 private void AddFactionNetconLink(Entity faction, NetConnection netCon)
 {
     if (!_connectedFactions.ContainsKey(netCon))
     {
         _connectedFactions.Add(netCon, faction.Guid);
     }
     else
     {
         _connectedFactions[netCon] = faction.Guid;
     }
     if (!FactionConnections.ContainsKey(faction.Guid))
     {
         FactionConnections.Add(faction.Guid, new List <NetConnection>());
     }
     if (!FactionConnections[faction.Guid].Contains(netCon))
     {
         FactionConnections[faction.Guid].Add(netCon);
     }
     if (!FactionEntityListners.ContainsKey(faction.Guid))
     {
         FactionEntityListners[faction.Guid] = new NetEntityChangeListner(Game.GlobalManager, faction);
     }
 }