@@ -136,14 +136,10 @@ public function setPrimary(SetPrimaryAllocationRequest $request, Server $server,
136136 */
137137 public function addNew (NewAllocationRequest $ request , Server $ server ): array
138138 {
139- Log::info ('addNew() ' );
140139 $ topRange = config ('pterodactyl.allocation.stop ' ,0 );
141140 $ bottomRange = config ('pterodactyl.allocation.start ' ,0 );
142- Log::error ($ bottomRange );
143- Log::error ($ topRange );
144141
145142 if ($ server ->allocation_limit <= $ server ->allocations ->count ()) {
146- Log::error ('You have created the maximum number of allocations! ' );
147143 throw new DisplayException (
148144 'You have created the maximum number of allocations! '
149145 );
@@ -153,17 +149,15 @@ public function addNew(NewAllocationRequest $request, Server $server): array
153149
154150 if (!$ allocation ) {
155151 if ($ server ->node ->allocations ()->where ('ip ' ,$ server ->allocation ->ip )->where ([['port ' , '>= ' , $ bottomRange ], ['port ' , '<= ' , $ topRange ],])->count () >= $ topRange -$ bottomRange +1 || !config ('allocation.enabled ' , false )) {
156- Log::error ('No allocations available! ' );
157152 throw new DisplayException (
158153 'No more allocations available! '
159154 );
160155 }
161- Log:: info ( ' Creating new allocation... ' );
156+
162157 $ allPorts = $ server ->node ->allocations ()->select (['port ' ])->where ('ip ' ,$ server ->allocation ->ip )->get ()->pluck ('port ' )->toArray ();
163158
164159 do {
165160 $ port = rand ($ bottomRange , $ topRange );
166- Log::info ('Picking port.... ' );
167161 } while (array_search ($ port , $ allPorts ));
168162
169163 $ this ->assignmentService ->handle ($ server ->node ,[
0 commit comments