@@ -157,11 +157,8 @@ private bool Attach(bool starting)
157157 }
158158 if ( Core . Config . SetAffinity )
159159 {
160- var threads = serverProcess . Threads ;
161- foreach ( ProcessThread thread in threads )
162- {
163- thread . ProcessorAffinity = Core . Config . ProcessAffinity ;
164- }
160+ serverProcess . ProcessorAffinity = ( IntPtr ) Core . Config . ProcessAffinity ;
161+ Logger . Log ( LogLevel . Info , "Process Affinity: 0x{0}" , serverProcess . ProcessorAffinity . ToString ( "X" ) ) ;
165162 }
166163 return true ;
167164 }
@@ -203,12 +200,7 @@ public void Start()
203200 serverProcess = Process . Start ( startInfo ) ;
204201 serverProcess . EnableRaisingEvents = true ;
205202 serverProcess . Exited += new EventHandler ( ServerProcess_Exited ) ;
206- if ( Core . Config . EnableHighPriority )
207- {
208- serverProcess . PriorityClass = ProcessPriorityClass . High ;
209- }
210- }
211- , 5000 ) ;
203+ } , 5000 ) ;
212204 status = ServerStatus . SteamPending ;
213205 }
214206 else
@@ -220,7 +212,11 @@ public void Start()
220212 {
221213 serverProcess . PriorityClass = ProcessPriorityClass . High ;
222214 }
223-
215+ if ( Core . Config . SetAffinity )
216+ {
217+ serverProcess . ProcessorAffinity = ( IntPtr ) Core . Config . ProcessAffinity ;
218+ Logger . Log ( LogLevel . Info , "Process Affinity: 0x{0}" , serverProcess . ProcessorAffinity . ToString ( "X" ) ) ;
219+ }
224220 status = ServerStatus . Online ;
225221 InvokeEvent ( ServerStarted , this , new StartEventArgs ( false ) ) ;
226222 InjectRconDllIfRequired ( ) ;
0 commit comments