Add() public method

public Add ( string tablename, object key, object val ) : void
tablename string
key object
val object
return void
Ejemplo n.º 1
0
        public void OnShutdown()
        {
            foreach (Player player in Players.Values)
            {
                if (serverData.ContainsKey("OfflinePlayers", player.SteamID))
                {
                    OfflinePlayer op = serverData.Get("OfflinePlayers", player.SteamID) as OfflinePlayer;
                    op.Update(player);
                    OfflinePlayers[player.GameID] = op;
                }
                else
                {
                    OfflinePlayer op = new OfflinePlayer(player);
                    OfflinePlayers.Add(player.GameID, op);
                }
            }
            foreach (OfflinePlayer op2 in OfflinePlayers.Values)
            {
                serverData.Add("OfflinePlayers", op2.SteamID, op2);
            }
            serverData.Save();

            Util.GetInstance().SaveZones();
            Util.GetInstance().ZoneStore.Save();
        }
Ejemplo n.º 2
0
 public void SaveZones()
 {
     try {
         Logger.LogWarning("Saving " + zones.Count.ToString() + " zone.");
         foreach (var zone in zones.Values)
         {
             ZoneStore.Add("Zones", zone.Name, zone.Serialize());
         }
     } catch (Exception ex) {
         Debug.LogException(ex);
     }
 }