Esempio n. 1
0
 public override void Logic()
 {
     CreaturesContainer.MovingLogic();
     AttacksContainer.Logic();
     NetContainer.Logic();
     mainWorld.Logic(curPlayer);
 }
Esempio 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;
                    }
                }
            }
        }
Esempio n. 3
0
 public NetObject()
 {
     NetContainer.Add(this);
 }