Esempio n. 1
0
 /// <summary>
 /// Gets the Last editor for a given Signage
 /// </summary>
 /// <param name="sign"></param>
 /// <param name="caller"></param>
 /// <returns></returns>
 private string getPlayerDataForSign(Signage sign, string caller)
 {
     if (sign != null)
     {
         string playerData = "";
         foreach (SignCheckerData data in FindSignById(sign.ToString()))
         {
             playerData = data.ToString();
         }
         if (!string.IsNullOrEmpty(playerData))
         {
             return(playerData);
         }
     }
     return(string.Format(GetLangValue("NoOne", caller)));
 }
Esempio n. 2
0
 /// <summary>
 /// Server hook wich gets called on every edit of an Signage
 /// </summary>
 /// <param name="sign"></param>
 /// <param name="player"></param>
 /// <param name="text"></param>
 void OnSignUpdated(Signage sign, BasePlayer player, string text)
 {
     //Quick check if the Called sign is already in the Datafile
     if (!isAlreadyInStorageData(sign))
     {
         //If not, it gets added
         storedData.signCheckerDatas.Add(new SignCheckerData(player, sign));
     }
     else
     {
         //If it is, we get it from the list, and Edit it to the new "Last editor"-Data
         foreach (SignCheckerData data in FindSignById(sign.ToString()))
         {
             data.userId = player.UserIDString;
             data.name   = player.UserIDString;
         }
     }
     Interface.Oxide.DataFileSystem.WriteObject(this.Name, storedData);
 }
Esempio n. 3
0
 public SignCheckerData(BasePlayer player, Signage sign)
 {
     signId = sign.ToString();
     userId = player.UserIDString;
     name   = player.displayName;
 }
Esempio n. 4
0
 bool isAlreadyInStorageData(Signage sign) => storedData.signCheckerDatas.Any(item => item.signId.Equals(sign.ToString()));