ValveSoftware / halflife

Half-Life 1 engine based games
Other
3.66k stars 616 forks source link

GetServerDetails ServerBrowser #2663

Open afwn90cj93201nixr2e1re opened 5 years ago

afwn90cj93201nixr2e1re commented 5 years ago

Why it's call's too much times? For example for 5 server's (5 ServerResponded send's) it's called 149 times.

afwn90cj93201nixr2e1re commented 5 years ago

So, it's sorting, ok. But maybe we should use local vector/list for that? <int/Server id/, gameserveritem_t*> for not calling every time GetSeverDetails(coz i expect call's only on calling ServerResponded, as a callback, not to get info for sort function).

изображение I mean why we should call api at every compare if we can just save list, and don't call api.