Jump to content
MakeWebGames

URBANZ

Members
  • Posts

    533
  • Joined

  • Last visited

  • Days Won

    48

Everything posted by URBANZ

  1. This can be true in certain circumstances but from running analytics only spike i got is when i first added the code. but with adding an entry to the database every page load would definitely increase database size and personally just find unnecessary when analytics works so much better. also the data would be very inaccurate without extensive checking as 1 user could just be refreshing the page this would give you no actual data to go from. each person has their own opinion but i will always stick to analytics
  2. personally this is a bad idea as you would then need to store the page views which then could become something that slows the game down. This is why analytics exists.
  3. This is very true to alter the loaded template is a massive pain which is why i use this way as works very well. yes i know you can return the tpl but decided it to make it an all in 1 for posting here and for loading the module page i didnt do this as it dont have its own page, for my game it is a hook for moduleManager so dont have to repeat a page i already have. instead it uses the current page the user is on and replaces the tpl and then if the admin is viewing it displays the page its meant to with a banner saying its in maintenance. I find this way better instead of redirecting as users could refresh the page for example and would display the page it needs to when its out of maintenance.
  4. Ive just stripped my version down so will post up the the way i do it, i havent included the ACP part as that is unique to my game but you could always build this part yourself. @Dayo this might save you some time. Just note i did it this way as wanted a banner displayed to the admin when page is in maintenance. CREATE TABLE `core_maintenance` ( `CM_id` int(11) NOT NULL, `CM_module` varchar(25) CHARACTER SET latin1 NOT NULL, `CM_reason` text CHARACTER SET latin1 NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; START OF HOOK FILE <?php function getMaintenance($id = null) { global $db; $cpages = $db->prepare(" SELECT CM_id as 'user', CM_module as 'module', CM_reason as 'reason' FROM core_maintenance " . ($id ? " WHERE CM_module = :id" : "") ); if($id): $cpages->bindParam(':id', $id); endif; $cpages->execute(); if(!$id): $cpages = $cpages->fetchAll(PDO::FETCH_ASSOC); else: $cpages = $cpages->fetch(PDO::FETCH_ASSOC); endif; return $cpages; } new Hook("alterGlobalTemplate", function ($template) { global $user; if(getMaintenance($_GET['page'])): if($user->info->U_userLevel != 2): $template->mainTemplate->pageMain = str_replace('<{game}>', '<div class="panel panel-default"> <div class="panel-heading">{page}</div> <div class="panel-body"> <h2>{page} is temporarily down for maintenance</h2> <p> Sorry for the inconvenience but weโ€™re performing some maintenance at the moment. {page} will be back online shortly! </p> <p> โ€” {game_name} Staff</p> <a href="/" style="margin-top: 10px;" class="btn btn-default"> <span class="glyphicon glyphicon-home"></span> Go Home </a> </div> </div>', $template->mainTemplate->pageMain); else: $content = strpos($template->mainTemplate->pageMain, '<{alerts}>'); $template->mainTemplate->pageMain = substr_replace($template->mainTemplate->pageMain, '<div class="alert alert-info"> <a href="/">This page is currently under maintenance click here to change settings or publish!</a> </div> ', $content, 0); endif; endif; });
  5. yes it would i do have something like this already running in my game, i may release it at some point works totally as a standalone with no editing of other files, also is hooked up to my bug tracking class so can see status and reports of each module that may need work also sends notifications when it has either detected an error or a user has issued a report on that module.
  6. Yes haha always keep hold of everything, finding it is a different thing though lol got old drives using IDE that still need to move to my NAS that will have alot of stuff dating back over 10 years. will go through it at some point and post it up here.
  7. i have downloaded and checked. it is becuase the module is packaged with a folder inside. the files need to be in the root of the archive and not inside a folder to install
  8. all the modules are there the file names might just be different Ajax chat is not included as this is a paid module but the addon is included as this was a free module some of the modules are addons and just contain txt files as they are additions to either other free modules or paid modules. same for other modules they might just be 1 php file which are included how they are packaged on MCCodes marketplace
  9. it must be something wrong with the detective file itself as everything thats needed is in the database so no need to touch anything there. Where did you download GL from on here or did you download from GitHub?
  10. to clarify a bit you need to check your "settings" table and check in that table for the "detectiveCost" field in that table. then after you have verified if that exists check the current value.
  11. have you checked your settings table to make sure the "detectiveCost" exists in mysql, it should auto create but could be a chance it hasnt or set to null
  12. mccodes has been set to read only for a long time and people that dont have accounts can't see the download link. i have downloaded a full backup of MCCv2 modules off the marketplace and attached it below for anyone wanting any of the free modules listed on mccodes website. @jedigunz i know you was looking for all of these mcc.zip
  13. i agree Ionos is a good host but i wouldnt agree with any shared hosting from them due to them having a custom control panel, also as you just said adding crons via SSH definitely not beginner friendly to use, some people even get confused about using cPanel crontab let alone using SSH. Also another issue is you are tied to a contract with ionos so if you dont enjoy the hosting you cant just bail. i use ionos but for 1 of my dedicated servers which i use plesk on which is so much nicer. also when it comes to shared hosting just use https://makewebgames.io/store/category/2-hosting/ very cheap and also ran by dave what else could you ask for lol.
  14. main issue you will face is not being able to run the default crons due to using a free host and these are known to not allow crons at certain intervals. i would personally move to a host that allows 1, 5 min crons or you could look at using timestamp crons instead if you are going to stay to free hosting. Only 1 i found was by Sniko but would need converted to V1 for you as currently is made for V2 https://makewebgames.io/applications/core/interface/file/attachment.php?id=3566
  15. This is 50% true as most engines that people use are very badly coded but also was released pre 2010. On the other side of things you do have engines that can be used as a nice stable base for a game GLv2 with some modifications of course, engines are there for a base after all not to be used as a complete solution. This is good but 1 main reason these engines have not moved to newer tech like React, Node or Laravel as frameworks is alot of users learn coding from these engines and they have to be simple to extend this is the main reason users still use MCC and GRPG as they are simple and even non developers can use them or understand the basics. Over the years there has been plenty of advanced engines come from members of MWG they were all excellent but 1 main issue is they are good for actual developers but for people that are learning and trying to have a game not so much. Also a bit off topic does not have anything to do with the original post if you want to talk about it more in depth create a new post.
  16. haha was thinking the same, think someone smoked too much weed today. Also they are running RC Engine in other words a massive shit show.
  17. I kinda of get what your saying so a rank restriction on certain actions within the game? if so as games use RankID as kind of a level in itself why wouldnt user rank >= rank required work as you could just say define a rank in crimes table and check if its the same or greater? might have misunderstood but think thats what you want.
  18. haha i did go crazy on this tbf. i did look at alot of options like VUE, React etc but definitely not come across Capacitor before reminds me of cordova but just a nicer library might do some more research into this. For building alot of the tech stack definitely would have saved alot of time especially on the mobile side of things but also with mobile it is a hybrid app ive made as takes advantage of native features. Everything ive done in native is (Payments, Game Center, Notifictions, Auth, Chat) but uses webview for normal view of most features as the development time for fully native plus updating features would just be a massive pain. so opted for this route and gave me an excuse to use some languages i dont use as much anymore lol. For the database originally was going for a full NoSQL DB but with the project i definitely needed to stay to a relational DB so opted to use caching with redis instead, Redis is just amazing in general. Centrifugo was definitely set from the beginning of the project needed the realtime messaging server. PHP 8 is great main thing was keeping everything upto date and the new features save alot of development time like match for example is a function i didnt know i needed but definitely after using it wouldnt go back so many very nice features and just things they have updated like inheritance etc. Definitely an update people should be using.
  19. thankyou ๐Ÿ™‚ here is 1 of my features live some maybe have already seen it, colours might be a bit off due to screen recording to gif
  20. Thought i would post up about my game that i will be releasing very soon. Its based on GL i say that losely as was stripped down and reworked. Some technology the site uses: Bootstrap 4 (will update to BS5 when full release candidate) PHP8 (Full Support) Javascript Centrifugo Redis (MySQL Cache) then mobile side for apps (will post app screen later) Flutter Dart Objective-C Java main reason behind the choices is 1 app source for both just some code dedicated for each platform (payments, app center, notifications) anyway here is some screenshots some things have been blanked as want to keep them for release as uses a new kind of game play.
  21. you could use $this->page->modules this gets the modules loaded by the script
  22. i would agree with @sniko this was one of the first things i changed when using GL i will post a full example at some point but i use an extra table also for ip storage i use inet_aton storage for this you can change that data type if you wish if you are not storing ips like i do. main idea is to store the IP, Agent and hash and check each of them, also with the created value is to check if its longer than 1 hour if it is invalidate the code and make them resend again.
  23. this is very true MTG this is why i do extra checks that is just 1 check for file exensions then stop executions in certain directories. but i know what you mean if people fail to do this it is easy to execute code
  24. there is yes but has been alot of alterations since, will be releasing shortly after my game is released.
  25. personally in my game i just use for the output to save on database space and get rid of the whole FastImage class also. public function getProfilePicture() { $pic = glob("images/avatars/" . $this->info->U_id . ".{jpg,jpeg,png,gif}", GLOB_BRACE); $pic = ($pic ? $pic[0] : "images/avatars/default.png"); return $pic; } for the upload i check all file extensions and also i stop any execution in the images directory if this system was to ever fail
×
×
  • Create New...