Jump to content


  • Content Count

  • Joined

  • Last visited

  • Days Won


Everything posted by Alan

  1. 163 errors 513 warnings 171 weak warnings 179 typos And that's the so-called reformatted code... I thought the RC engine was commercial - though by the looks of it, one fails to see why. Cyclomatic complexity suggests in excess of 51 with one tool, and 21 in another ... both of which are far higher than I'd be happy with - not to mention 9 functions in 940 odd lines of code ... suggesting ~100 lines per function -- too many to fit on most screens (yes, some do, some not). Saying all that, there are a number of potential bottlenecks - running it through xdebug's profiler would probably be helpful, though I have an inkling as to where the problem may lie, but without seeing the database not to mention a quick peek at /proc - it's not easy to point a definitive finger at a particular bit of code. With limited knowledge of the environment, database etc; I'd be looking to explain all queries, and more importantly run through a profiler to see what function(s) are taking the time -- it may also be worth looking into any sessions and how they are being stored as php does like to cause all manner of issues from time to time with session. Assuming your version is low (because of the mysql) calls - it's probably worth investing some time upgrading to a recent version, and deploying an opcache though that may be a little tricky for some. Oh and slightly easier to read? No ... ... use a proper formatting tool or refactor the code -- PHPCS springs to mind (untested).
  2. Alan

    WC: Ruthless

    One example of different methods -- https://codepen.io/thegrumpyscot/pen/bPoexd
  3. Alan

    Help Wanted

    Well obviously I did - otherwise why would I respond? I stand by initial point: in any situation, if somebody asks for help they have to be prepared to provide some form of access and not waste people's time. A remote session, whether by TeamViewer or similar technology, is a form of access as it grants the ability for the helper to see information which would not be otherwise available to them. I've no issue with them even as the viewer only however when I'm in called to fix issues, those issues usually require a more hands-on approach as often the person or persons requesting the help have exhausted other avenues.
  4. Alan

    Help Wanted

    Clearly you misunderstood the point of the post; not that I wasted 20-30 minutes; but that owner/admins have to be prepared to provide access to files/data etc.
  5. Alan

    Vouch for meh

    I think I'm in the same position. And yes, I would and have vouched for him.
  6. Alan

    Help Wanted

    Interesting problem I encountered this morning; and this is a warning to people here about asking for help. If you have a project that suffers from some issue, be it a code problem, a data problem, a spam problem etc and think you need help from one of the developers here, then be prepared to give them what they need; i.e.; access to your code, access to your data etc. Otherwise how are they going to fix your issue? I dislike wasting my time in signing up to somebody's project with a view to looking to see the problem for myself so that I might be able to advise on how to fix it only to be told that the owner can't possibly share the credentials with me. I won't mention the individual in question as that is irrelevant however I've wasted a good 20-30 minutes of my time; for nothing. Yes, I realize that trust is something that is earned however you have take a risk now and again. Just don't waste out time by inviting us into discussions then backing out as you've not thought things through.
  7. Alan

    The Marketplace

    Bugger ... The plugins are causing a number of problems in-as-much-as getting the urls in-place; I suspect I may have to document how to manually add urls to your project as it seems just too complex to try and work out where to put them. I guess there is a reasonable case for this in that you may want a module to be only visible for players of level 5 and above for example which just can't be done that I can see. Any thoughts?
  8. Alan

    The Marketplace

    Well modules must be openly named, I see no need to restrict people to use *my* naming convention; to a certain extent the same holds true for the namespace. Yes, I suspect modules will need to *extend* an AbstractBaseModule as this will provide them with the necessary facilities (ie access to core services, the render engine etc). As for registration, I'm thinking something along the lines of a JSON registration file which contains a relative link to the module's routes.php file as well as pointers to any schema change. This would mean that for the system to work I only need load the module's routes.php file during initialisation. Thereafter; only if any of the module's components are need it will be autoloaded.
  9. Alan

    The Marketplace

    Bit of a mix; I'm using a micro-framework; and adding the elements I need to it: DI, logging, database, image processing etc. It means that the core is very light so problems can be diagnosed more quickly as there is less code to have to hunt through.
  10. Alan

    The Marketplace

    Well that is the general idea - what I'm doing is making a very small core "engine", linked to a marketplace that permits developers to upload modules and optionally set prices. The core engine would be free as would a number of the modules on the marketplace.Initially of course, it will be only my own modules however once I've fully designed the core components, I'll open-source it and see if we can get other developers in to help make some of the modules.
  11. Alan

    The Marketplace

    Had a thought last night about using composer as the plugin system -- it's an oddity, but actually it makes a lot of sense in that you are not duplicating code; however I'm a) not sue how to create a "project" for composer, and b) how it would handle things like registration of routes, templates, functions etc. ... Obviously going to have to have another play. Anybody had any experience in this line?
  12. Alan

    The Marketplace

    The plugin system seems to be a winner - there's a couple of caveats that I'm unsure about; specifically I'm having to use reflection to determine the module's identity, and thus path in order to extend the template paths -- not sure how that will work in an "under load" environment; though it could be replaced with the same type of mechanism I use for auto-loading of custom modules. Routing also looks suspiciously or rather potentially slow (currently using a glob), I suspect that can easily be replaced with a simple custom composer script. Next stage is to grant plugins the ability to request alterations to the database structure; this will allow things like the addition of attributes on the player record. The template system is such that while there are a core set of templates; each module will normally extend those to suit. Of course, you are free to override *any* template and in fact you will need to make minor changes to templates when you add certain modules; (ie - positioning links to modules exactly where you want them).
  13. Alan

    The Marketplace

    Well, with the apparent lack of action on games here - I've decided it may be time to create my own. It's a tricky thing creating a new game; as it has to cater for so many different needs; so my first port is a marketplace for modules and templates that can be easily pulled into the game complete with dependencies. The image below is representative of the current work so far. (N.B. module names, brief descriptions, icons, prices and stars are all for my own testing). The core game itself is a while off completion yet - getting it to work with the complexity of the plugins system is causing some interesting headaches, but it looks very possible. Once I've got the core working with a basic set of mods - some of which will be dependant on others like the casino games - I need to design a number of templates which may be a task suitable for some of the peeps here - its primarily Bootstrap 4 based with modules having their own specific overrides, graphics, even typefaces etc. Nothing too fancy, but it allows for fantastic customisation. Anyway, enough rambling ... here's a quick preview of the Marketplace home page (or at least the top part of it!). Oh and before anybody points it out - yes I'm aware I forgot to correctly name the slots module!
  14. Think of it like British Rail -- always late That being said - there are other projects that are being released; you need only look around.
  15. Alan

    Orginal gRPG

    It's sad to see such poor quality of code in this day and age. A quick look reveals a vast number of inconsistencies, suspect design concepts and downright dangerous code. imo this should not have been published as it harms both the owners and potentially the community in suggesting that code like this is acceptable. Saying all that, it is not beyond the realms of possibility to revamp the code; to create something that is at least consistent with itself, however the process takes potentially more effort than the project is worth. For any budding grpg authors you may be better advised using a different code base or designing your own from scratch. Again, while perhaps critical, I'm actually glad to see that people are publishing code; as only be reading, modifying and updating code do we in turn become better at the craft.
  16. Probably Deus Ex. It was ahead of its time in giving the player the illusion of choice - although, a close second is Dungeon Siege; the spiders gave me nightmares; even now - you hear that chittering noise from something and start looking around as your heart rate climbs. Scary stuff.
  17. Alan


    Potentially you could use something like TinyFileManager although SSH/(S)FTP is going to be a better solution.
  18. As one who has done similar though not quite so spectacularly I see no need to apologise; we all have different persona's from time to time that we sit behind, now and again they need to be changed to address changing circumstances.
  19. Bolton ... I went there once; it was closed. 😄
  20. Alan

    Plugin System

    That's quite a decent package - Might need to compare that to a feature-flags library. Good shout.
  21. Alan

    Plugin System

    Has anybody come across a stable (packagist based ideally, though native git would suffice) generic plugin system for PHP that permits things like hooks - so database migrations could be run? I'm not looking for anything framework specific - ie Laravel, as while it may be a good choice for some people, there are too many restrictions for my tastes.
  22. Alan

    Text Based RPG Gaming

    Why different? It is easy to come up with a base-line product; making it flexible is the key and how many people are now working in and around the programming industry that cut their teeth with projects like V1/V2 McCodes. Yes, it was a flawed product, and lazy devs didn't bother to change the look and feel much or get mods which fitted their genre, however there are plenty of us who ran/run successful projects based albeit loosely on those venerable code-bases. Take for example a new install of V2. It takes around 3-4 hours to "skin" it nicely and fix some of the more obvious fubars; switch over to a decent DB backend and address some of the interesting database issues. Securing it properly and addressing the more esoteric bugs takes a little time, as does finding some high-quality mods but they do exists - and some of us (myself included) still write the occasional one. Laziness does come into it I agree, however taking a little time to plan before jumping in feet first - and to ensure you have adequate tests and logging in place pays dividends quite quickly. Maybe if people here collaborated a little more - something that did happen 5/6 years ago, then more groundwork could be laid for better projects. So, Yes, as a community it would be good to develop something together, but different - why not stick to something that people can get to grips with and have a wealth of experienced people to discuss their issues/ideas with. [Append] In fact - all that is really needed is a solid foundation, ideally with replaceable code components; authentication, database abstraction, dependency injection, some form of sane plugin system, and let people grow the system from there - you would need to have some form of database manipulation system in place which becomes a little tricky of you consider multiple/mixed back-ends (MySQL,Mongo/PostgreSQL,CouchDB,Redis etc) however those things have been solved in other environments. Dropping the reliance on a specific framework is trickier - I'd be open for pointers on that one; though I suspect relying on PSR7/17 techniques my be the solution to that one.
  23. My learned friend above is quite right; using PHP Storm can be a lifesaver in reducing the number of bugs reaching production; although I'd still point out that testing is ultimately key as many errors have been seen that escape Storm's otherwise beady eye. Test, test and test again. Use PHPUnit for writing tests; use Xdebug for profiling your application; between the two you can produce test coverage in excess of 100% which makes future modifications, upgrades, additions etc a lot safer.
  • Create New...