Changeset 233 for binary-improvements/MapRendering
- Timestamp:
- Apr 30, 2015, 1:55:16 AM (10 years ago)
- Location:
- binary-improvements/MapRendering
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
binary-improvements/MapRendering/MapRendering/MapRenderBlockBuffer.cs
r230 r233 74 74 { 75 75 byte[] array = cache.LoadTile (zoomLevel, _fileName); 76 if (array == null || !blockMap.LoadImage (array)) { 76 if (array == null || !blockMap.LoadImage (array) || blockMap.height != Constants.MAP_BLOCK_SIZE || blockMap.width != Constants.MAP_BLOCK_SIZE) { 77 if (array != null) { 78 Log.Error ("Map image tile " + _fileName + " has been corrupted, recreating tile"); 79 } 80 77 81 if (blockMap.height != Constants.MAP_BLOCK_SIZE || blockMap.width != Constants.MAP_BLOCK_SIZE) { 78 82 blockMap.Resize (Constants.MAP_BLOCK_SIZE, Constants.MAP_BLOCK_SIZE); -
binary-improvements/MapRendering/Web/API/GetPlayerInventory.cs
r230 r233 17 17 } 18 18 19 Player p = PersistentContainer.Instance.Players [req.QueryString ["steamid"] ];19 Player p = PersistentContainer.Instance.Players [req.QueryString ["steamid"], false]; 20 20 if (p == null) { 21 21 resp.StatusCode = (int)HttpStatusCode.InternalServerError; -
binary-improvements/MapRendering/Web/API/GetPlayersLocation.cs
r230 r233 16 16 17 17 foreach (string sid in playersList.SteamIDs) { 18 Player p = playersList[sid ];18 Player p = playersList[sid, false]; 19 19 20 20 JSONObject pos = new JSONObject(); -
binary-improvements/MapRendering/Web/API/GetPlayersOnline.cs
r230 r233 1 1 using AllocsFixes.JSON; 2 using AllocsFixes.PersistentData; 2 3 using System; 3 4 using System.Collections.Generic; … … 15 16 foreach (KeyValuePair<int, EntityPlayer> current in w.Players.dict) { 16 17 ClientInfo ci = ConnectionManager.Instance.GetClientInfoForEntityId (current.Key); 17 string ip = string.Empty; 18 if (ci != null) { 19 ip = ci.ip; 20 } 18 Player player = PersistentContainer.Instance.Players [ci.playerId, false]; 21 19 22 20 JSONObject pos = new JSONObject(); 23 pos.Add ("x", new JSONNumber((int)current.Value.GetPosition().x));24 pos.Add ("y", new JSONNumber((int)current.Value.GetPosition().y));25 pos.Add ("z", new JSONNumber((int)current.Value.GetPosition().z));21 pos.Add ("x", new JSONNumber ((int)current.Value.GetPosition ().x)); 22 pos.Add ("y", new JSONNumber ((int)current.Value.GetPosition ().y)); 23 pos.Add ("z", new JSONNumber ((int)current.Value.GetPosition ().z)); 26 24 27 25 JSONObject p = new JSONObject(); 28 p.Add("steamid", new JSONString(ci.playerId)); 29 p.Add("ip", new JSONString(ip)); 30 p.Add("name", new JSONString(current.Value.EntityName)); 31 p.Add("online", new JSONBoolean(true)); 32 p.Add("position", pos); 26 p.Add ("steamid", new JSONString (ci.playerId)); 27 p.Add ("ip", new JSONString (ci != null ? ci.ip : string.Empty)); 28 p.Add ("name", new JSONString (current.Value.EntityName)); 29 p.Add ("online", new JSONBoolean (true)); 30 p.Add ("position", pos); 31 32 p.Add ("experience", new JSONNumber (player != null ? player.Experience : 0)); 33 p.Add ("level", new JSONNumber (player != null ? player.Level : -1)); 34 p.Add ("health", new JSONNumber (current.Value.Health)); 35 p.Add ("stamina", new JSONNumber (current.Value.Stamina)); 36 p.Add ("zombiekills", new JSONNumber (current.Value.KilledZombies)); 37 p.Add ("playerkills", new JSONNumber (current.Value.KilledPlayers)); 38 p.Add ("playerdeaths", new JSONNumber (current.Value.Died)); 39 p.Add ("score", new JSONNumber (current.Value.Score)); 33 40 34 41 players.Add(p);
Note:
See TracChangeset
for help on using the changeset viewer.