Jump to content
MakeWebGames

angel1992

Members
  • Posts

    31
  • Joined

  • Last visited

  • Days Won

    2

angel1992 last won the day on October 6

angel1992 had the most liked content!

Recent Profile Visitors

2,934 profile views

angel1992's Achievements

Explorer

Explorer (4/14)

  • Dedicated Rare
  • Collaborator Rare
  • Reacting Well Rare
  • Conversation Starter Rare
  • First Post Rare

Recent Badges

3

Reputation

  1. // File: ApiClient.cs // Description: Handles all communication with the VTC website API. using System; using System.Net.Http; using System.Text; using System.Threading.Tasks; using Newtonsoft.Json; namespace StarTruckerLogger { public static class ApiClient { // This URL points to your live website's API endpoint. private static readonly string ApiBaseUrl = "https://startruckervtc.co.uk/api.php"; private static readonly HttpClient client = new HttpClient(); // Stores the logged-in user's session data public static UserSession CurrentUser { get; private set; } public static async Task<LoginResult> LoginAsync(string username, string password) { var credentials = new { action = "login", username, password }; var jsonContent = JsonConvert.SerializeObject(credentials); var content = new StringContent(jsonContent, Encoding.UTF8, "application/json"); try { HttpResponseMessage response = await client.PostAsync(ApiBaseUrl, content); string jsonResponse = await response.Content.ReadAsStringAsync(); var result = JsonConvert.DeserializeObject<dynamic>(jsonResponse); if (result.status == "success") { // Store user data upon successful login CurrentUser = new UserSession { UserId = result.data.user_id, Username = result.data.username, VtcId = result.data.vtc_id }; return new LoginResult { Success = true }; } else { return new LoginResult { Success = false, Message = result.message }; } } catch (Exception ex) { return new LoginResult { Success = false, Message = $"API Connection Error: {ex.Message}" }; } } public static async Task<bool> LogJobAsync(string origin, string destination, string cargo, string distance, string pay) { if (CurrentUser == null) return false; // Not logged in var jobData = new { action = "log_job", user_id = CurrentUser.UserId, vtc_id = CurrentUser.VtcId, origin, destination, cargo, distance = double.Parse(distance), pay = double.Parse(pay) }; var jsonContent = JsonConvert.SerializeObject(jobData); var content = new StringContent(jsonContent, Encoding.UTF8, "application/json"); try { var response = await client.PostAsync(ApiBaseUrl, content); return response.IsSuccessStatusCode; } catch { return false; } } } public class LoginResult { public bool Success { get; set; } public string Message { get; set; } } public class UserSession { public int UserId { get; set; } public string Username { get; set; } public int VtcId { get; set; } } } // ------------------------------------------------------------ // StarTruckerLogger © 2025 by TTVytangelofhype // You are free to modify the code, but not to remove credit, // redistribute under your name, or sell it as your own. // ------------------------------------------------------------ using System; using System.IO; namespace StarTruckerLogger { public static class JobLogger { private static string logFilePath = "latest_job.txt"; public static void LogToFile(string logEntry) { File.AppendAllText(logFilePath, logEntry + Environment.NewLine); } public static string[] ReadAll() { return File.Exists(logFilePath) ? File.ReadAllLines(logFilePath) : new string[] { "No log found." }; } } } // ------------------------------------------------------------ // StarTruckerLogger © 2025 by TTVytangelofhype // You are free to modify the code, but not to remove credit, // redistribute under your name, or sell it as your own. // ------------------------------------------------------------ using System; using System.IO; namespace StarTruckerLogger { public static class JobWatcher { private static FileSystemWatcher watcher; public static void StartWatching() { watcher = new FileSystemWatcher { Path = "C:\\Games\\StarTrucker\\logs", Filter = "latest_job.txt", NotifyFilter = NotifyFilters.LastWrite | NotifyFilters.Size, EnableRaisingEvents = true }; watcher.Changed += OnNewJobLogged; } private static void OnNewJobLogged(object sender, FileSystemEventArgs e) { try { Console.WriteLine($"Watcher triggered: {e.FullPath}"); // Debug Line 1 var content = File.ReadAllText(e.FullPath); Console.WriteLine($"New content: {content}"); // Debug Line 2 if (!string.IsNullOrWhiteSpace(content)) { JobLogger.LogToFile($"[MOD] {DateTime.Now} | {content.Trim()}"); } } catch (Exception ex) { Console.WriteLine("Error in watcher: " + ex.Message); } } } } // File: Program.cs // Description: Main entry point for the application. using System; using System.Windows.Forms; namespace StarTruckerLogger { static class Program { [STAThread] static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); // Show the login form as a dialog var loginForm = new LoginForm(); if (loginForm.ShowDialog() == DialogResult.OK) { // If login was successful, open the main application window Application.Run(new MainForm()); } // If login fails or is cancelled, the application will exit. } } } some C# work i been doing backend
  2. Added the FAQ page, but stuck on what to add in the FAQ (would like help on what to add in the FAQ) Reset the Google Recaptcha due to me breaking the code again
  3. btw the forums is licensed and not a illigal copy as i paid a lot for this license
  4. well untill raw furry give us what we want and yes your right but I just thought it be something fun to do to help me get bak in my coding era but we see i know it not ment to be popular that i can work on only if they give us what we need that we request as the game might be low in popurality but it got some steady players on steam small update added forums link to it and tidyed it up coding wise to make it neater
  5. right i think i fixed that and it should be fine Some Updates Added a pop-up box to make sure you're aware this is for Star Trucker only, with two options edited more for the admin panel for staff admins to monitor all jobs, VTCs, and users Added blocked words when registering for the site to save from confusion and impersonation Fixed some issues regarding the VTC; will be adding more to it. You can still upload a picture via PC I hope you like the updates I'm sharing with you, but I'm open to any suggestions or feedback you might have. At some point, I may have to move it into Laravel soon, but I'm debating
  6. are u able to copy the errors and paste them here cause i dont see that issue on my screen and did you sign up before the recapthca or after
  7. so i have added more and fixed a few tings redid the recapthca to v3 due to v2 being a pain added a terms and conditions when you register if yer into reading that (may change it to show before you go to the register page not sure) fixed the VTC's so that they can read and accept or deny applications fixed the contact page to make it more professional and simple with few drop downs like i said this is a fan made project so feedback and suggesstions are welcome
  8. Hello everyone, While archiving files from my earlier years in web development, I rediscovered a Habbo Hotel fansite template I created before the NFT era. Recognising its potential, I have taken the time to update its code to meet more contemporary standards. As I am no longer active in the fansite community, I wish to offer this template to the public. It can be utilised to create a retro-themed fansite or serve as a solid foundation for a new project. This release includes a fully functional admin panel, with all source files and the necessary SQL database available on my GitHub. Please note that I will provide limited support for this template. The codebase is straightforward, making it accessible for those with a basic understanding of web development. I welcome constructive criticism and feedback. For a preview, please refer to the images provided. You can access all the files here: https://github.com/TTVytangelofhype/Habbo-Fansite-Basic-Template
      • 1
      • Like
  9. Ah, yes, I'm aware of that. Thank you for bringing this up. I am in the process of finding a fix as we speak just sorting google recaptcha out still
  10. yeah the google thing now works great just waiting for it to load up on the page now
  11. oh weird mind you i was doing this at 3am adding it in can you provide a screenshot to show that error for me to look at I have fixed the issue as I checked, just working on their captcha for some reason, on with an ad blocker browser still detects the adblocker somewhere
  12. So i love the layout but i misclicked knowing i didn't sign up but i will do now however google dosnt support this so i thought to let you know
  13. Project: Startrucker Live Demo: https://startruckervtc.co.uk/index.php Repository: https://github.com/TTVytangelofhype/StarTruckerLogger Description 'Startrucker' is a personal project that marks my dedicated return to hands-on software development. The primary goal was to build a modern, scalable web application while re-engaging with core development principles and contemporary toolchains like [mention technologies, e.g., Vite, Webpack, Docker]. Seeking Feedback & Contributions As I am actively getting back into coding, I am particularly open to feedback and suggestions. If you see an area for improvement, a better way to implement a feature, or a departure from best practices, your input would be incredibly valuable. Please feel free to: Open an Issue to suggest a feature or report a bug. Submit a Pull Request with any enhancements. Constructive criticism is not just welcomed, it's encouraged! It will contribute directly to my professional growth. P.S i am trying to get hold of the devs for star trucker to provide us with a SDK api to make this more better but this is my first time doing this as i not done coding for a long time
  14. welp thre goes my mccodes license and plugins i brought
  15. I mean it your Code you can add it if you want but I only asked the question now i have an answer I gonna try to implant it in my game
×
×
  • Create New...