Ejemplo n.º 1
0
 public override void Logic()
 {
     CreaturesContainer.MovingLogic();
     AttacksContainer.Logic();
     NetContainer.Logic();
     mainWorld.Logic(curPlayer);
 }
Ejemplo n.º 2
0
        private void Server_DataReceived(string ID, byte[] Data)
        {
            //Console.WriteLine(ID + ": " + Network.ConvertBytesToString(Data));
            string received = Network.ConvertBytesToString(Data);

            if (received == "getAllCreatures")
            {
                string data = NetContainer.GetAllCreatures(ID);
                server.SendData(ID, Network.ConvertStringToBytes(data));
            }
            else
            {
                foreach (var player in connectedPlayers)
                {
                    if (player.playerId == ID)
                    {
                        player.ParceFromServer(Network.ConvertBytesToString(Data));
                        break;
                    }
                }
            }
        }
Ejemplo n.º 3
0
 public NetObject()
 {
     NetContainer.Add(this);
 }