Skip to content

Commit

Permalink
Merge branch 'testbuild_39'
Browse files Browse the repository at this point in the history
  • Loading branch information
LIPtoH committed Jan 27, 2020
2 parents 5db3e87 + ca16530 commit 68daba4
Show file tree
Hide file tree
Showing 17 changed files with 681 additions and 389 deletions.
22 changes: 11 additions & 11 deletions TS SE Tool/CustomClasses/ProfileData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,23 +20,23 @@ namespace TS_SE_Tool
public class ProfileData
{
public string CompanyName { get; set; }
public int CachedExperiencePoints { get; set; }
public int CachedDistance { get; set; }
public uint CachedExperiencePoints { get; set; }
public uint CachedDistance { get; set; }
//user_data
//public uint SomeTime { get; set; } //0
public double RoadsExplored { get; set; } //4
public int DeliveriesFinished { get; set; } //5
public int OwnedGaradesSmall { get; set; } //7
public int OwnedGaradesLarge { get; set; } //8
public int GameTimeSpent { get; set; } //9
public int RealTimeSpent { get; set; } //10
public uint DeliveriesFinished { get; set; } //5
public uint OwnedGaradesSmall { get; set; } //7
public uint OwnedGaradesLarge { get; set; } //8
public ulong GameTimeSpent { get; set; } //9
public uint RealTimeSpent { get; set; } //10
public List<string> OwnedTruckList = new List<string>(); // 12
public int OwnedTrucks { get; set; } //6
public int OwnedTrailers { get; set; } //16
public uint OwnedTrucks { get; set; } //6
public uint OwnedTrailers { get; set; } //16
//End
public string ProfileName { get; set; }
public int CreationTime { get; set; }
public int SaveTime { get; set; }
public uint CreationTime { get; set; }
public uint SaveTime { get; set; }

public int[] getPlayerLvl()
{
Expand Down
76 changes: 11 additions & 65 deletions TS SE Tool/DataManipulation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1532,14 +1532,14 @@ private void CheckProfileInfoData()
if (tempProfileFileInMemory[line].StartsWith(" cached_experience:"))
{
chunkOfline = tempProfileFileInMemory[line].Split(new char[] { ' ' });
ProfileDataV.CachedExperiencePoints = int.Parse(chunkOfline[2]);
ProfileDataV.CachedExperiencePoints = uint.Parse(chunkOfline[2]);
continue; //searching
}

if (tempProfileFileInMemory[line].StartsWith(" cached_distance:"))
{
chunkOfline = tempProfileFileInMemory[line].Split(new char[] { ' ' });
ProfileDataV.CachedDistance = int.Parse(chunkOfline[2]);
ProfileDataV.CachedDistance = uint.Parse(chunkOfline[2]);
continue; //searching
}

Expand All @@ -1562,49 +1562,49 @@ private void CheckProfileInfoData()
if (tempProfileFileInMemory[line].StartsWith(" user_data[5]:"))
{
chunkOfline = tempProfileFileInMemory[line].Split(new char[] { ' ' });
ProfileDataV.DeliveriesFinished = int.Parse(chunkOfline[2]);
ProfileDataV.DeliveriesFinished = uint.Parse(chunkOfline[2]);
continue; //searching
}

if (tempProfileFileInMemory[line].StartsWith(" user_data[7]:"))
{
chunkOfline = tempProfileFileInMemory[line].Split(new char[] { ' ' });
ProfileDataV.OwnedGaradesSmall = int.Parse(chunkOfline[2]);
ProfileDataV.OwnedGaradesSmall = uint.Parse(chunkOfline[2]);
continue; //searching
}

if (tempProfileFileInMemory[line].StartsWith(" user_data[8]:"))
{
chunkOfline = tempProfileFileInMemory[line].Split(new char[] { ' ' });
ProfileDataV.OwnedGaradesLarge = int.Parse(chunkOfline[2]);
ProfileDataV.OwnedGaradesLarge = uint.Parse(chunkOfline[2]);
continue; //searching
}

if (tempProfileFileInMemory[line].StartsWith(" user_data[9]:"))
{
chunkOfline = tempProfileFileInMemory[line].Split(new char[] { ' ' });
ProfileDataV.GameTimeSpent = int.Parse(chunkOfline[2]);
ProfileDataV.GameTimeSpent = ulong.Parse(chunkOfline[2]);
continue; //searching
}

if (tempProfileFileInMemory[line].StartsWith(" user_data[10]:"))
{
chunkOfline = tempProfileFileInMemory[line].Split(new char[] { ' ' });
ProfileDataV.RealTimeSpent = int.Parse(chunkOfline[2]);
ProfileDataV.RealTimeSpent = uint.Parse(chunkOfline[2]);
continue; //searching
}

if (tempProfileFileInMemory[line].StartsWith(" user_data[6]:"))
{
chunkOfline = tempProfileFileInMemory[line].Split(new char[] { ' ' });
ProfileDataV.OwnedTrucks = int.Parse(chunkOfline[2].Trim('"'));
ProfileDataV.OwnedTrucks = uint.Parse(chunkOfline[2].Trim('"'));
continue; //searching
}

if (tempProfileFileInMemory[line].StartsWith(" user_data[16]:"))
{
chunkOfline = tempProfileFileInMemory[line].Split(new char[] { ' ' });
ProfileDataV.OwnedTrailers = int.Parse(chunkOfline[2]);
ProfileDataV.OwnedTrailers = uint.Parse(chunkOfline[2]);
continue; //searching
}

Expand Down Expand Up @@ -1654,14 +1654,14 @@ private void CheckProfileInfoData()
if (tempProfileFileInMemory[line].StartsWith(" creation_time:"))
{
chunkOfline = tempProfileFileInMemory[line].Split(new char[] { ' ' });
ProfileDataV.CreationTime = int.Parse(chunkOfline[2]);
ProfileDataV.CreationTime = uint.Parse(chunkOfline[2]);
continue; //searching
}

if (tempProfileFileInMemory[line].StartsWith(" save_time:"))
{
chunkOfline = tempProfileFileInMemory[line].Split(new char[] { ' ' });
ProfileDataV.SaveTime = int.Parse(chunkOfline[2]);
ProfileDataV.SaveTime = uint.Parse(chunkOfline[2]);
continue; //searching
}
}
Expand Down Expand Up @@ -1867,60 +1867,6 @@ private void PrepareEvents()
}
}

private void PrintAddedJobs()
{
foreach (JobAdded tempJobData in AddedJobsList)
{
string SourceCityName = CitiesList.Find(x => x.CityName == tempJobData.SourceCity).CityNameTranslated;
string SourceCompanyName = tempJobData.SourceCompany;
CompaniesLngDict.TryGetValue(SourceCompanyName, out SourceCompanyName);

string DestinationCityName = CitiesList.Find(x => x.CityName == tempJobData.DestinationCity).CityNameTranslated;
string DestinationCompanyName = tempJobData.DestinationCompany;
CompaniesLngDict.TryGetValue(DestinationCompanyName, out DestinationCompanyName);

#region WriteLog
//Write log
string jobdata = "", tempStr = "";

jobdata += "\r\nLoad of " + tempJobData.Cargo;
jobdata += " of " + tempJobData.UnitsCount + " units";

if (tempJobData.Type == 0)
tempStr = "Normal";
else if (tempJobData.Type == 1)
tempStr = "Heavy";
else if (tempJobData.Type == 2)
tempStr = "Double";

jobdata += "\r\nIn " + tempStr + " trailer ";
jobdata += tempJobData.TrailerDefinition;
jobdata += " with " + tempJobData.TrailerVariant + " appearance";

tempStr = FreightMarketJob.Urgency.ToString();

if (UrgencyLngDict.TryGetValue(tempStr, out string value))
if (value != null && value != "")
tempStr = value;

jobdata += "\r\nUrgency " + tempStr;
jobdata += "\r\nMinimum travel distance of " + tempJobData.Distance + " km ";
jobdata += "in " + tempJobData.CompanyTruck;
jobdata += "\r\nJob valid for " + (tempJobData.ExpirationTime - InGameTime) + " minutes";

if (tempJobData.Ferrytime > 0 || tempJobData.Ferryprice > 0)
{
jobdata += "\r\nExtra time on ferry - " + tempJobData.Ferrytime;
jobdata += "and it will cost " + tempJobData.Ferryprice;
}

LogWriter("Job from:" + SourceCityName + " | " + SourceCompanyName + " To " + DestinationCityName + " | " + DestinationCompanyName +
"\r\n-----------" + jobdata + "\r\n-----------");

#endregion
}
}

private void AddCargo(bool JobEditing )
{
if (comboBoxFreightMarketSourceCity.SelectedIndex < 0 || comboBoxFreightMarketSourceCompany.SelectedIndex < 0 || comboBoxFreightMarketDestinationCity.SelectedIndex < 0 || comboBoxFreightMarketDestinationCompany.SelectedIndex < 0 || comboBoxFreightMarketCargoList.SelectedIndex < 0 || comboBoxFreightMarketUrgency.SelectedIndex < 0 || comboBoxFreightMarketTrailerDef.SelectedIndex < 0 || comboBoxFreightMarketTrailerVariant.SelectedIndex < 0)
Expand Down
Loading

0 comments on commit 68daba4

Please sign in to comment.