forgot the semicolon ;)
$myipc = @fsockopen($gameip, 15010, $errno, $errstr, $timeout)
also, where the ftp part is, change
if($myipc = @fsockopen($ftpip1, 21, $errno, $errstr, $timeout)) {
to
$myipc = @fsockopen($ftpip1, 21, $errno, $errstr, $timeout);
if($myipc) {
also, where you have
$myipc =...