示例#1
0
 public void InitializeRecipient(NetworkRecipient recipient)
 {
     if (GetNetworkActor().IsServer())
     {
         entitys_by_id.Values.Process(e => e.SendConstructReplay(recipient));
     }
 }
示例#2
0
 public void SendConstructReplay(NetworkRecipient recipient)
 {
     if (GetNetworkActor().IsServer())
     {
         constructor.SendConstructorReplay(constructor_system, recipient, constructor_arguments, this);
     }
 }
示例#3
0
 public override void SendFullUpdate(NetworkRecipient recipient)
 {
     if (GetNetworkActor().IsServer())
     {
         GetSyncronizer().CreateMessage(MessageType.FullUpdateConstant, NetDeliveryMethod.ReliableUnordered, delegate(Buffer buffer) {
             buffer.WriteByte(GetIndex());
             buffer.WriteCollection(constant_by_values.Values, c => WriteConstant(c, buffer));
         }).Send(recipient);
     }
 }
示例#4
0
            public void SendConstructorReplay(System system, NetworkRecipient recipient, object[] arguments, Entity spawned_entity)
            {
                Syncronizer  syncronizer = system.GetSyncronizer();
                NetworkActor actor       = syncronizer.GetNetworkActor();

                syncronizer.CreateMessage(MessageType.InvokeSystemMethod, NetDeliveryMethod.ReliableOrdered, delegate(Buffer buffer) {
                    buffer.WriteSystemReference(system);
                    buffer.WriteSystemMethod(this);

                    WriteArguments(arguments, buffer);

                    if (actor.IsServer())
                    {
                        buffer.WriteInt32(spawned_entity.GetId());
                        spawned_entity.WriteSync(buffer);
                    }
                }).Send(recipient);
            }
示例#5
0
 public void SendFullUpdate(NetworkRecipient recipient)
 {
     constant_managers.Process(m => m.SendFullUpdate(recipient));
 }
示例#6
0
 public void Send(NetworkRecipient recipient)
 {
     recipient.Send(envelope);
 }