diff --git a/chunkymap-regen.py b/chunkymap-regen.py index bf5eb2a..70b9f77 100644 --- a/chunkymap-regen.py +++ b/chunkymap-regen.py @@ -13,6 +13,58 @@ import traceback #sector_ymax = args.self.maxheight/16 #region server-specific options +def get_dict_from_conf_file(path,assignment_operator="="): + results = None + print ("Checking "+str(path)+" for settings...") + if os.path.isfile(path): + results = {} + ins = open(path, 'r') + line = True + while line: + line = ins.readline() + if line and len(line)>0: + line_strip=line.strip() + if not line_strip[0]=="#": # if not comment + if not line_strip[0]=="-": # ignore yaml arrays + ao_index = line_strip.find(assignment_operator) + if ao_index>=1: # intentionally skip zero-length variable names + if ao_index=3 and len(list_b)>=3: + result = (float(list_a[0]) == float(list_b[0])) and (float(list_a[1]) == float(list_b[1])) and (float(list_a[2]) == float(list_b[2])) + return False + + + class MTChunk: x = None z = None @@ -252,28 +304,6 @@ class MTChunks: ins.close() - def get_dict_from_conf_file(self, path,assignment_operator="="): - results = None - print ("Checking "+str(path)+" for settings...") - if os.path.isfile(path): - results = {} - ins = open(path, 'r') - line = True - while line: - line = ins.readline() - if line and len(line)>0: - line_strip=line.strip() - if not line_strip[0]=="#": # if not comment - if not line_strip[0]=="-": # ignore yaml arrays - ao_index = line_strip.find(assignment_operator) - if ao_index>=1: # intentionally skip zero-length variable names - if ao_index".substr($chunk_assoc[$chunk_luid]["players"][$player_count]["name"], 0, $nonprivate_name_beginning_char_count).""; - } - } //if ($map_dict != null) { // $chunkx_min = $map_dict["chunkx_min"]; // $chunkz_min = $map_dict["chunkz_min"]; @@ -498,6 +507,27 @@ function echo_chunkymap_table() { else { //echo_hold( " "); } + + if (isset($chunk_assoc[$chunk_luid]["players_count"])) { + $nonprivate_name_beginning_char_count = 2; + + for ($player_count=0; $player_count<$chunk_assoc[$chunk_luid]["players_count"]; $player_count++) { + $rel_x = $chunk_assoc[$chunk_luid][ "players" ][ $player_count ]["rel_x"]; + $rel_z = $chunk_assoc[$chunk_luid][ "players" ][ $player_count ]["rel_z"]; + $player_name = $chunk_assoc[$chunk_luid]["players"][$player_count]["name"]; + if (strlen($chunk_assoc[$chunk_luid]["players"][$player_count]["name"])>$nonprivate_name_beginning_char_count) { + $player_name = substr($player_name, 0, $nonprivate_name_beginning_char_count)."*"; + } + //show head full size (not zoomed): + $zoomed_head_w=$character_icon_w;//(int)((float)$character_icon_w*$scale+.5); + $zoomed_head_h=$character_icon_h;//(int)((float)$character_icon_h*$scale+.5); + $rel_x -= (int)($zoomed_head_w/2); + $rel_z -= (int)($zoomed_head_h/2); + echo_hold( "
$player_name
" ); + //$position_offset_x+=$character_icon_w; + } + } + //echo "
".$x.",0,".$z; echo_hold($alignment_comment); echo_hold( "\r\n"); diff --git a/web/images/chunkymap_character-face.png b/web/images/chunkymap_character-face.png new file mode 100644 index 0000000..2297692 Binary files /dev/null and b/web/images/chunkymap_character-face.png differ