8. Find all integer pairs $(x, y)$ such that $x^{2}+3 y^{2}=1998 x$.

Translate the above text into English, please retain the original text's line breaks and format, and output the translation result directly.
8. Let $(x, y)$ be an integer solution of the equation, then $3 \mid x^{2}$. Let $x=3 x_{1}$, then $3 x_{1}^{2}+y^{2}=1998 x$, thus, $3 \mid y^{2}$. Let $y=3 y_{1}$, then $x_{1}^{2}+3 y_{1}^{2}=666 x_{1}$. By analogy, we can set $x=27 m, y=27 n$, and get
$$
m^{2}+3 n^{2}=74 m \Rightarrow(m-37)^{2}+3 n^{2}=37^{2} \text {. }
$$

By analyzing the parity of the above equation, we can see that $m, n$ are both even, so $3 n^{2} \equiv 37^{2}-(m-37)^{2} \equiv 0(\bmod 8)$, hence $4 \mid n$. Let $n=4 r$, then $48 r^{2} \leqslant 37^{2}$, thus $r^{2} \leqslant 28$, so $|r| \leqslant 5$. For $|r|=0,1, \cdots, 5$, calculate the value of $37^{2}-48 r^{2}$, we find that only when $|r|=0,5$, $37^{2}-$ $48 r^{2}$ is a perfect square, so $(x, y)=(0,0),(1998,0),(1458, \pm 540)$ or $(540, \pm 540)$.