View file game/2/f_say.dat

File size: 3.23Kb
<?php
// сказать текст всем
	if (strpos($say,"/g.php?sid=")!==false) $say=substr($say,0,strpos($say,"/g.php?sid="));
	if ($translit) {
		include "f_translit.dat";
		$say=trans($say);
		}
	$s=$to.$say;
	// UTF-8 русские буквы
	$s=str_replace("\xd0\x81","Ё",$s);
	$s=str_replace("\xd1\x91","ё",$s);
	$s=preg_replace("/\xd0([\x90-\xbf])/e","chr(ord('\\1')+48)",$s);
	$s=preg_replace("/\xd1([\x80-\x8f])/e","chr(ord('\\1')+112)",$s);

	$s=str_replace('\\',"",$s);
	$s=str_replace('"',"",$s);
	$s=str_replace("'","",$s);
	$s=preg_replace('/([^ -}А-я#])|\$|&/e',"",$s);
	$s=preg_replace('/(с|c)(у|y)(ч)?(к|k)(а|a)/i',"[бип]",$s);
	$s=preg_replace('/пидор/i',"[бип]",$s);
	$s=preg_replace('/пид(о|o|a|а)(р|p)(а|a)(з|c|с)/i',"[бип]",$s);
	$s=preg_replace('/\w*(х|x)(у|y)\w*/i',"[бип]",$s);
	$s=preg_replace('/\w*пизд\w*/i',"[бип]",$s);
	$s=preg_replace('/\w*(е|e)б(а|a)\w*/i',"[бип]",$s);
	$s=preg_replace('/\w*бля\w*/i',"[бип]",$s);
	$s=str_replace("|","",$s);
	$s=str_replace("<","",$s);
	$s=str_replace(">","",$s);
	$s=str_replace(".ru","",$s);
	$s=str_replace(".org","",$s);
	$s=str_replace(".net","",$s);
	$s=str_replace(".com","",$s);
	$s=str_replace(".ua","",$s);
	$s=str_replace("waps.ru","bigwap.org",$s);
	
$jad=explode("|",$l_i[$loc][$login]["char"]);
if (time()<$jad[17]) {
                     $s=str_replace("к", "o", $s);
            $s=str_replace("К", "Щ", $s);
            $s=str_replace("а", "и", $s);
            $s=str_replace("А", "И", $s);
            $s=str_replace("В", "P", $s);
           // $s=str_replace("м", "m", $s);
            $s=str_replace("М", "П", $s);
            $s=str_replace("о", "у", $s);
            $s=str_replace("О", "У", $s);
            $s=str_replace("р", "з", $s);
            $s=str_replace("Р", "З", $s);
            $s=str_replace("Н", "Ф", $s);
            $s=str_replace("с", "х", $s);
            $s=str_replace("С", "Х", $s);
            $s=str_replace("у", "а", $s);
            $s=str_replace("У", "А", $s);
            $s=str_replace("е", "ю", $s);
            $s=str_replace("Е", "Ю", $s);
            $s=str_replace("х", "д", $s);
            $s=str_replace("Х", "Ж", $s);
            $s=str_replace("Т", "Г", $s);
            $s=str_replace("Ь", "ь", $s);
            $s=str_replace("З", "Ч", $s);
            $s=str_replace("и", "ы", $s);
}
$say=substr($s,0,250);
if ($l_i[$loc][$login]['ban']>time()) {addjournal($loc,$login,"Бан!"); return;}
	if (crc32($say)==$l_i[$loc][$login]["lsay1"]) {addjournal($loc,$login,"Вы это уже говорили! Измените текст"); return;}
	$l_i[$loc][$login]["macrol"]="say|$say||";
	// добавим всем, включая себя, в журнал что сказали
	$b=0;
	if ($char[8]) {$ts=explode("|",$l_i[$loc][$login]["skills"]); if (rand(0,100)<=$ts[21]*10) $b=1;}
	if (!$char[8]) {addjournal($loc,"all",$char[0]." говорит: ".$say); 
	$l_i[$loc][$login]["lsay1"]=crc32($say);
}
		else foreach (array_keys($l_i[$loc]) as $i) if (substr($i,0,2)=='u.'){
		$skills=explode("|",$l_i[$loc][$i]["skills"]);
		if ($b || rand(0,100)<=$skills[21]*20){ addjournal($loc,$i,$char[0]." говорит: ".$say);
	$l_i[$loc][$login]["lsay1"]=crc32($say);
 }
			else {
	$l_i[$loc][$login]["lsay1"]=crc32($say);
				$stmp = preg_replace("/[A-ZА-Я]/","O",$say);
				$stmp = preg_replace("/[a-zа-я]/","o",$stmp);
				addjournal($loc,$i,$char[0]." говорит: ".$stmp);
				}
		}