cutStringForWidth, subStringForWidth 재 구현
This commit is contained in:
+1
-1
@@ -171,7 +171,7 @@ for($j=0; $j < $gencount; $j++) {
|
||||
$turn = getTurn($general, 1, 0);
|
||||
|
||||
for($i=0; $i < 5; $i++) {
|
||||
$turn[$i] = StringUtil::SubStrForWidth($turn[$i], 0, 20);
|
||||
$turn[$i] = StringUtil::subStringForWidth($turn[$i], 0, 20);
|
||||
$k = $i+1;
|
||||
echo "
|
||||
$k : $turn[$i] <br>";
|
||||
|
||||
+3
-3
@@ -33,7 +33,7 @@ if($command == 46) {
|
||||
$name = str_replace(" ", "", $name);
|
||||
$name = str_replace(" ", "뷁", $name);
|
||||
if($name == "") { $name = "무명"; }
|
||||
$name = StringUtil::SubStrForWidth($name, 0, 12);
|
||||
$name = StringUtil::subStringForWidth($name, 0, 12);
|
||||
|
||||
$db->update('general', [
|
||||
'makenation'=>$name
|
||||
@@ -58,7 +58,7 @@ if($command == 46) {
|
||||
$nationname = str_replace(" ", "", $nationname);
|
||||
$nationname = str_replace(" ", "뷁", $nationname);
|
||||
if($nationname == "") { $nationname = "무명"; }
|
||||
$nationname = StringUtil::SubStrForWidth($nationname, 0, 12);
|
||||
$nationname = StringUtil::subStringForWidth($nationname, 0, 12);
|
||||
|
||||
$query = "update general set makenation='{$nationname}' where level>=5 and nation='{$me['nation']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
@@ -84,7 +84,7 @@ if($command == 46) {
|
||||
$note = str_replace("|", "", $note);
|
||||
$note = str_replace(" ", "", $note);
|
||||
$note = str_replace(" ", "뷁", $note);
|
||||
$note = StringUtil::SubStrForWidth($note, 0, 90);
|
||||
$note = StringUtil::subStringForWidth($note, 0, 90);
|
||||
|
||||
$query = "update diplomacy set reserved='{$note}' where me='{$me['nation']}' and you='$double'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
+1
-1
@@ -423,7 +423,7 @@ function processAI($no) {
|
||||
$colors = GetNationColors();
|
||||
$color = rand() % count($colors);
|
||||
$command = EncodeCommand(0, $type, $color, 46);
|
||||
$nationName = "㉿".StringUtil::SubStr($general['name'], 1);
|
||||
$nationName = "㉿".mb_substr($general['name'], 1);
|
||||
//건국
|
||||
$query = "update general set turn0='$command',makenation='$nationName' where no='{$general['no']}'";
|
||||
MYDB_query($query, $connect) or Error("processAI08 ".MYDB_error($connect),"");
|
||||
|
||||
@@ -787,7 +787,7 @@ function process_55(&$general) {
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$nationcount = MYDB_num_rows($result);
|
||||
|
||||
if($nationcount > 0) { $makename = StringUtil::SubStr("$nationcount".$general['name'], 0, 6); }
|
||||
if($nationcount > 0) { $makename = mb_substr("$nationcount".$general['name'], 0, 6); }
|
||||
else { $makename = $general['name']; }
|
||||
|
||||
if($general['level'] != 0) {
|
||||
|
||||
+3
-3
@@ -400,7 +400,7 @@ function processWar($general, $city) {
|
||||
}
|
||||
|
||||
$render_attacker = [
|
||||
'crewtype' => StringUtil::SubStr(GameUnitConst::byId($general['crewtype'])->name, 0, 2),
|
||||
'crewtype' => mb_substr(GameUnitConst::byId($general['crewtype'])->name, 0, 2),
|
||||
'name'=> $general['name'],
|
||||
'remain_crew' => $general['crew'],
|
||||
'killed_crew' => -$mydeathnum
|
||||
@@ -1276,13 +1276,13 @@ function processWar($general, $city) {
|
||||
}
|
||||
|
||||
$render_attacker = [
|
||||
'crewtype' => StringUtil::SubStr(GameUnitConst::byId($general['crewtype'])->name, 0, 2),
|
||||
'crewtype' => mb_substr(GameUnitConst::byId($general['crewtype'])->name, 0, 2),
|
||||
'name'=> $general['name'],
|
||||
'remain_crew' => $general['crew'],
|
||||
'killed_crew' => -$mydeathnum
|
||||
];
|
||||
$render_defender = [
|
||||
'crewtype' => StringUtil::SubStr(GameUnitConst::byId($oppose['crewtype'])->name, 0, 2),
|
||||
'crewtype' => mb_substr(GameUnitConst::byId($oppose['crewtype'])->name, 0, 2),
|
||||
'name'=> $oppose['name'],
|
||||
'remain_crew' => $oppose['crew'],
|
||||
'killed_crew' => -$opdeathnum
|
||||
|
||||
Reference in New Issue
Block a user