Jump to content
MakeWebGames

angel1992

Members
  • Posts

    31
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by angel1992

  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
  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
  16. quick question alltough it nice to see this added for free can we set the days when it goes live and when it dosnt go live
  17. um it not live but i am working on it issue got fixed forgot to clear my cache
  18. forgive me i forgot login.php <?php /** * MCCodes Version 2.0.5b * Copyright (C) 2005-2012 Dabomstew * All rights reserved. * * Redistribution of this code in any form is prohibited, except in * the specific cases set out in the MCCodes Customer License. * * This code license may be used to run one (1) game. * A game is defined as the set of users and other game database data, * so you are permitted to create alternative clients for your game. * * If you did not obtain this code from MCCodes.com, you are in all likelihood * using it illegally. Please contact MCCodes to discuss licensing options * in this case. * * File: login.php * Signature: 4a7c1670deb7175782714a27e72bfc16 * Date: Fri, 20 Apr 12 08:50:30 +0000 */ require_once('globals_nonauth.php'); $login_csrf = request_csrf_code('login'); print <<<EOF <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>{$set['game_name']}</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <script type="text/javascript" src="js/login.js"></script> <link href="css/login.css" type="text/css" rel="stylesheet" /> </head> <body onload="getme();"> <center> <table width="970" border="0" cellpadding="0" cellspacing="0" class="table2"> <tr> <td class="lgrad"></td> <td class="center"><img src="title.jpg" alt="Mccodes Version 2" /><br /> <!-- Begin Main Content --> EOF; $IP = str_replace(array('/', '\\', '\0'), '', $_SERVER['REMOTE_ADDR']); if (file_exists('ipbans/' . $IP)) { die( "<span style='font-weight: bold; color:red;'> Your IP has been banned, there is no way around this. </span></body></html>"); } $year = date('Y'); echo "<h3>&gt; {$set['game_name']} Log-In</h3> <table width='80%'> <tr> <td width='50%'> <fieldset> <legend>About {$set['game_name']}</legend> " . nl2br($set['game_description']) . " </fieldset> </td> <td>"; echo <<<EOF <fieldset> <legend>Login</legend> <form action='authenticate.php' method='POST' name='login' onsubmit='return saveme();'> Username: <input type='text' name='username' /><br /> Password: <input type='password' name='password' /><br /> Remember me?<br /> <input type='radio' value='ON' name='save' /> Yes <input type='radio' value='OFF' name='save' /> No<br /> <input type='hidden' name='verf' value='{$login_csrf}' /> <input type='submit' value='Submit'> </form> </fieldset> EOF; echo "</td></tr></table><br /> <h3><a href='register.php'>REGISTER NOW!</a></h3><br /> <i><center>Powered by codes made by Dabomstew (&copy {$year}). Game Copyright &copy;{$year} {$set['game_owner']}.</center></i>"; print <<<OUT </td> <td class="rgrad"></td> </tr> <tr> <td colspan="3"> <table cellpadding="0" cellspacing="0" border="0" width="100%"> <tr> <td class="dgradl">&nbsp;</td> <td class="dgrad">&nbsp;</td> <td class="dgradr">&nbsp;</td> </tr> </table> </td> </tr> </table> </body> </html> OUT; loggedin.php <?php /** * MCCodes Version 2.0.5b * Copyright (C) 2005-2012 Dabomstew * All rights reserved. * * Redistribution of this code in any form is prohibited, except in * the specific cases set out in the MCCodes Customer License. * * This code license may be used to run one (1) game. * A game is defined as the set of users and other game database data, * so you are permitted to create alternative clients for your game. * * If you did not obtain this code from MCCodes.com, you are in all likelihood * using it illegally. Please contact MCCodes to discuss licensing options * in this case. * * File: loggedin.php * Signature: 348279378970838959d2e96c262b5301 * Date: Fri, 20 Apr 12 08:50:30 +0000 */ $housequery = 1; require_once('globals.php'); if (file_exists($_SERVER['DOCUMENT_ROOT'] . '/installer.php') && $ir['user_level'] == 2) { echo ' <span style="font-weight: bold; font-size: 42px; color: red;"> WARNING: you have not deleted installer.php from the server. <br /> We suggest you do this immediately. </span> '; } echo ' <b>Welcome, ' . $ir['username'] . '!</b> <br /> <em>Your last visit was: ' . $lv . '.</em> '; $exp = (int) ($ir['exp'] / $ir['exp_needed'] * 100); if ($ir['hospital']) { $geninf = '<tr><td colspan="2"><font color="red">You are in Hospital for ' . $ir['hospital'] . ' minute(s)</font></td></tr>'; } elseif ($ir['jail']) { $geninf = '<tr><td colspan="2"><font color="red">You are in Jail for ' . $ir['jail'] . ' minute(s)</font></td></tr>'; } else { $geninf = ''; } echo " <table cellspacing='1' cellpadding='3' class='table' width='70%'> <tr> <td colspan='2' class='h'><b>General Information</b></td> </tr> {$geninf} <tr> <td><b>Name:</b> {$ir['username']}</td> <td><b>Crystals:</b> {$cm}</td> </tr> <tr> <td><b>Level:</b> {$ir['level']}</td> <td><b>Exp:</b> {$exp}%</td> </tr> <tr> <td><b>Money:</b> $fm</td> <td><b>HP:</b> {$ir['hp']}/{$ir['maxhp']}</td> </tr> <tr> <td><b>Property:</b> {$ir['hNAME']}</td> <td><b>Days Old:</b> {$ir['daysold']}</td> </tr> "; $ts = $ir['strength'] + $ir['agility'] + $ir['guard'] + $ir['labour'] + $ir['IQ']; $ir['strank'] = get_rank($ir['strength'], 'strength'); $ir['agirank'] = get_rank($ir['agility'], 'agility'); $ir['guarank'] = get_rank($ir['guard'], 'guard'); $ir['labrank'] = get_rank($ir['labour'], 'labour'); $ir['IQrank'] = get_rank($ir['IQ'], 'IQ'); $tsrank = get_rank($ts, 'strength+agility+guard+labour+IQ'); $ir['strength'] = number_format($ir['strength']); $ir['agility'] = number_format($ir['agility']); $ir['guard'] = number_format($ir['guard']); $ir['labour'] = number_format($ir['labour']); $ir['IQ'] = number_format($ir['IQ']); $ts = number_format($ts); echo " <tr> <td class='h' colspan='2'><b>Stats Info</b></td></tr> <tr> <td><b>Strength:</b> {$ir['strength']} [Ranked: {$ir['strank']}]</td> <td><b>Agility:</b> {$ir['agility']} [Ranked: {$ir['agirank']}]</td> </tr> <tr> <td><b>Guard:</b> {$ir['guard']} [Ranked: {$ir['guarank']}]</td> <td><b>Labour:</b> {$ir['labour']} [Ranked: {$ir['labrank']}]</td> </tr> <tr> <td><b>IQ: </b> {$ir['IQ']} [Ranked: {$ir['IQrank']}]</td> <td><b>Total stats:</b> {$ts} [Ranked: $tsrank]</td> </tr> </table> "; $q = $db->query("SELECT `content` FROM `papercontent`"); $news = $db->fetch_single($q); $db->free_result($q); echo $set['game_name'] . ' Latest News: <br /> ' . nl2br($news) . ' <br /> '; $h->endpage();
  19. was thinking the same thing but i on opera GX but i looking at the code and i don't see the issue yet
  20. So i am getting backinto mccodes after number of years away from it due to making game servers and working non stop did all my useal things set hings up set everything up right removed the csrf token that keeps bugging me for weird reasons not sure why mccodes need a csrf token anyway but when the stuff was made i go to the login page log in as the useal user and pass hit login and it just refreshes back to the login page dosnt load anything else now i am on a new host that i got any one got any ideas why it not logging in at all or why it refeshes when you hit login
  21. love the site and how you labeled it out so it tells us what no longer supported and what is and when it was last updated good job love it so far
  22. angel1992

    (SOLD)

    I have to agree with others $30 on the same engine and all was changed was the layout and bugs left in it. I be surprized if someone buys this off you for that price personally I wouldn't touch this with a 10 foot barge pole myself but good luck selling it
  23. how can u tell
  24. um hi think i back not sure let last made 2012 wow i been gone all these years rip hi btw
  25. I mean it great and all but surely it not worth it at this current Time cause i sure the goverment will somehow get access to sensitive data but nether the less it does help you and protect you in a way right?
×
×
  • Create New...