Example #1
0
 public System.Object ClientCommunication(Version serverversion, ICommunicateable communicator, bool full, System.Object obj)
 {
     try
     {
         if (serverversion.Major > 0)
         {
             if (full)
             {
                 IsComputer = communicator.ReceiveBool();
                 IsYou      = communicator.ReceiveBool();
                 ValueHistory.ClientCommunication(serverversion, communicator, full, obj);
             }
             if (IsYou && !full)
             {
                 communicator.SendString(Company);
                 communicator.SendString(Name);
             }
             else
             {
                 Company = communicator.ReceiveString();
                 Name    = communicator.ReceiveString();
             }
             Deposit.ClientCommunication(serverversion, communicator, full, obj);
             Capital = communicator.ReceiveDouble();
             ValueHistory.AddHistory(Value);
         }
         return(this);
     }
     catch (System.Exception ex)
     {
         throw ex;
     }
 }
Example #2
0
 public System.Object ServerCommunication(Version clientversion, ICommunicateable communicator, bool full, System.Object obj)
 {
     try
     {
         if (clientversion.Major > 0)
         {
             communicator.SendInt(this.Count);
             if (this.Count > 0)
             {
                 foreach (Player player in this)
                 {
                     communicator.SendInt(player.Id);
                     bool containplayer = communicator.ReceiveBool();
                     if (!containplayer)
                     {
                         player.ServerCommunication(clientversion, communicator, true, obj);
                     }
                     else
                     {
                         player.ServerCommunication(clientversion, communicator, false, obj);
                     }
                 }
             }
         }
         return(this);
     }
     catch (System.Exception ex)
     {
         throw ex;
     }
 }