Ejemplo n.º 1
0
 /// <summary>
 /// Sets <see cref="RemoteServiceSettings"/> to specified service.
 /// </summary>
 /// <param name="settings"><see cref="RemoteServiceSettings"/> object to set as settings.</param>
 internal static void SetServiceSettings( RemoteServiceSettings settings )
 {
     if ( settings != null && m_ActiveConnections.ContainsKey(settings.ServiceUniqueID) )
     {
         InnerNetworkClient client = m_ActiveConnections[settings.ServiceUniqueID];
         client.RemoteServiceSettings = settings;
         client.Send
             (
                 new SetSettingsResponse(SetSettingsResponse.Accepted).ToPacket()
             );
         m_ActiveConnections[settings.ServiceUniqueID] = client;
         Logger.WriteLine(Source.InnerNetwork, "{0} (0x{1}) settings update done.", client.ServiceType, client.ServiceID.ToString("x2"));
     }
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Creates <see cref="Packet"/> that contains provided <see cref="RemoteServiceSettings"/> data.
 /// </summary>
 /// <param name="settings"><see cref="RemoteServiceSettings"/> to create <see cref="Packet"/> from.</param>
 /// <returns><see cref="Packet"/> that contains provided <see cref="RemoteServiceSettings"/> data.</returns>
 public Packet ToPacket( RemoteServiceSettings settings )
 {
     Packet p = new OPPacket(Opcodes);
     settings.Write(ref p);
     return p;
 }