You can download PHPInSimMod - PRISM 0.5.0 from that link. Please use this thread to talk about this release.
Thank you.
PHPInSimMod (PRISM) 0.5.0.0
Version changed to 0.5.0.0
Increased to INSIM_VERSION 7
Added all new features from 0.6M
New Packets (IS_JRR, IS_OCO, IS_UCO)
Added Zbyte to IS_OBH
Updated IS_SSH packet. Renamed property BMP to Name (Backwards Compatible breaking for anyone who used IS_SSH)
Added TINY_ALC and SMALL_ALC to get and set allowed cars (replaces /cars)
Many thanks to Povo for helping with adding the new packets
PHPInSimMod (PRISM) 0.5.0.1
Version changed to 0.5.0.1
Move betterButtonManager readme to docs folder
Fixes by FlameCZE
Added Rockingham PTH files
Updated docs/insim.md to version 0.6M
Updated IS_OCO documentation according to InSim.txt version 0.6M
PHPInSimMod (PRISM) 0.5.0.2
Version changed to 0.5.0.2
Fixes PHP 7 compatibility
Fixes MST, MSX, MSL, & MTC multi-line color issues mentioned in Issue #4
PHPInSimMod (PRISM) 0.5.0.3
Version changed to 0.5.0.3
Fixes TCP Connection crashes
Fixes the occasional crash caused when isRelay() is called when $host is equal to null
PHPInSimMod (PRISM) 0.5.0.4
Version changed to 0.5.0.4
Fixes LFS Errors when insim tries to send ISP_MTC and TINY_NCI while ISF_LOCAL is set
Forces ISF_REQ_JOIN query in initial setup to only accept yes or no
PHPInSimMod (PRISM) 0.5.0.5
Version changed to 0.5.0.5
Adds ability to select text/background colors when printing to console(Thanks cargame.nl/Dave)
Example:
<?php console("this is my exampletext", true, "light_green", "black") ?>
To use this on Windows you will need to download and install ANSICon. To install, extract the zipped download, open command prompt, and cd to the x64 or x86 depending on your OS. and run ansicon.exe -i
This should work out of the box on Linux if you use /bin/bash or even /bin/sh
Fixes Minor issue with the translation engine
Fixes another issue with PHP 7 compatibility(PLC Packet Values aren't treated correctly as they were previously defined. worked fine in PHP 5.6)
PHPInSimMod (PRISM) 0.5.0.6
Version changed to 0.5.0.6
Add Missing variable to PlayerHandler so getPlayerbyUName actually works now
PHPInSimMod (PRISM) 0.5.0.7
Version changed to 0.5.0.7
Move GUI Folder into the data directory for Dygear
Add LANG defines to prism_packets.php (example: LANG_EN, LANG_FR, LANG_PL, LANG_DE)
Update translateEngine to use the defines(The previous version was technically done wrong) NOTES ON USE HERE
Updated IS_SSH packet. Renamed property BMP to Name (Backwards Compatible breaking for anyone who used IS_SSH)
Added TINY_ALC and SMALL_ALC to get and set allowed cars (replaces /cars)
Many thanks to Povo for helping with adding the new packets
PHPInSimMod (PRISM) 0.5.0.1
Version changed to 0.5.0.1
Move betterButtonManager readme to docs folder
Fixes by FlameCZE
Added Rockingham PTH files
Updated docs/insim.md to version 0.6M
Updated IS_OCO documentation according to InSim.txt version 0.6M
PHPInSimMod (PRISM) 0.5.0.2
Version changed to 0.5.0.2
Fixes PHP 7 compatibility
fixes MST, MSX, MSL, & MTC multi-line color issues mentioned in Issue #4
PHPInSimMod (PRISM) 0.5.0.3
Version changed to 0.5.0.3
Fixes TCP Connection crashes
Fixes the occasional crash caused when isRelay() is called when $host is equal to null
PHPInSimMod (PRISM) 0.5.0.4
Version changed to 0.5.0.4
Fixes LFS Errors when insim tries to send ISP_MTC and TINY_NCI while ISF_LOCAL is set
Forces ISF_REQ_JOIN query in initial setup to only accept yes or no
PHPInSimMod (PRISM) 0.5.0.5
Version changed to 0.5.0.5
Adds ability to select text/background colors when printing to console(Thanks cargame.nl/Dave)
Example:
<?php console("this is my example text", true, "light_green", "black") ?>
To use this on Windows you will need to download and install ANSICon. To install, extract the zipped download, open command prompt, and cd to the x64 or x86 depending on your OS. and run ansicon.exe -i
This should work out of the box on Linux if you use /bin/bash or even /bin/sh
Fixes Minor issue with the translation engine
Fixes another issue with PHP 7 compatibility(PLC Packet Values aren't treated correctly as they were previously defined. worked fine in PHP 5.6)
PHPInSimMod (PRISM) 0.5.0.6
Version changed to 0.5.0.6
Add Missing variable to PlayerHandler so getPlayerbyUName actually works now
PHPInSimMod (PRISM) 0.5.0.7
Version changed to 0.5.0.7
Move GUI Folder into the data directory for Dygear
Add LANG defines to prism_packets.php (example: LANG_EN, LANG_FR, LANG_PL, LANG_DE)
Update translateEngine to use the defines(The previous version was technically done wrong) NOTES ON USE HERE
@cargame, I'll have a look at cleanly/properly implementing it within the next day or so (If you don't hear anything from me by Tuesday mid-day then I probably got side-tracked).
Edit: Do we have the struct from insim.txt I could look at? what LFS version has this packet?
I assume it could potentially have to do with the way PHP now handles variables. When accessing variables in PHP classes does $class->Variable still work, or do you need to now do $class->$Variable? I haven't had a chance to do any work with PHP7 yet sadly, been busy with work, school, and general life stuff.
The only way to acheive this is by creating a 2nd button, if you want them to visually appear as the same button, you'll need to make 3 buttons, 1 being the background, and 1 being the first line, and another being the second line. kinda like this:
Was reading an article today on the new release of PHP 7. It looks like it might be a somewhat major overhaul for PRISM. I think that moving forward with this project(although I have one more planned release before I start this stuff, considering PHP 7 RC isn't even out till June) and starting to look over code, and debugging stuff to make sure it'll work on PHP 7, How ever, the big question here is backwards compatibility. Due to the fact that PHP 7 is moving to Uniform Variable Syntax, which changes how PHP interprets things like
<?php $obj->$properties['name'] ?>
Now this could potentially be avoided and can be made to work on both old and new versions of PHP(which might need to be done). So the main question here is, Are you planning on moving to PHP 7? Once I am able to test PRISM with php 7, I'll have an idea if anything actually needs to be recoded or if it will just work. Hopefully I will have a better idea of what needs to be done to PRISM soon.
One thing I'm kind of looking forward to, which will help greatly with the conversion to using name spacing is the new "Group Use Declarations"
<?php #where you will be able to do this: use Framework\Component\{ SubComponent\ClassA, SubComponent\ClassB as ClassC, OtherComponent\ClassD }; ?>
I think overall PHP 7 is going to offer many great features that could potentially help with PRISM's future... including the improved performance.
Gonna have to spend some time fixing that up since my button manager kind of uses the current one. Shouldn't be too much of an issue. I'll make that release 0.4.7.0
I didn't think they were supposed to be case sensitive, I might need to double check the other command functions and make sure those aren't case sensitive.
Edit: @Dygear, do you think this would actually be better as 0.4.7? or just another minor version of 0.4.6?
Edit 2: Thinking of some small changes to improve the translation engine. probably gonna change it so you don't have to specify the $lang_subdirectory every time, and also be able to specify the fallback instead of having to have an extra file.
Edit 3: Went ahead and did those updates, tested them and they work well. I've updated the zip.
Due to some LFS limitations, if you want to actually send any translations on connect(or in my case I had an account class that was spawned on Client Connect)
Notes:
on your __construct of your plugin do this
<?php $this->setTranslationSettings('plugin_name'); # if your default fallback language is english(en) $this->setTranslationSettings('plugin_name', 'fr'); # if you'd rather specify a different fallback # Translations will fail if this isn't ran. ?>
Your fallback language is the language the translation engine will go to if the users language is missing.
Due to some limitations of implementation in LFS, if you want to use translations, you'll need to do stuff you would normally do in NCN, in an NCI packet.
<?php public function onClientConnect(IS_NCI $NCI) { $NCN = $this->getClientByUCID($NCI->UCID); #Continue on with rest of NCN packet the way you would in the IS_NCN packet ?>
Example usage(These can not be used in NCN or any packets before the NCI connection):
<?php public function onPlayerJoin(IS_NPL $NPL) { $client = $this->getClientByUCID($NPL->UCID); $this->translatePrivateMessage($NPL->UCID, 'User_Welcome', array($client->PName)); $this->translateGlobalMessage('Global_Message'); # You can also specify an argument array here aswell } ?>
File setup:
; PRISM/data/langs/plugin_name/en.ini Global_Message = "^7This is a global message!" User_Welcome = "^7Hello, %s^7!"
; PRISM/data/langs/plugin_name/fr.ini Global_Message = "^7Ce est un message global!" User_Welcome = "^7Bonjour, %s^7!"
Pushed new code update which fixed issues with some packets(such as IS_REO). doing some testing, if everything still works properly, I will release a new update.
Edit: It looks like IS_REO might be the only one that uses said pack method. Gonna go ahead and get this ready for release.
I figured it out... I had to change the PRISM code slightly. Don't know why I didn't think of this earlier. but if you send the TINY_NCI request first, it fixes the order. therefor fixing the original issue.
Edit: And Apparently not. Although I can request it that way when insim starts, when a client connects, it still sends NCN first then NCI... need to look into this further I guess.
Dygear, I pushed 3 new code pushes to your repo(I really should start using mine to update code, not sure if it really matters...). I have gotten translations working pretty well. It could probably use some cleanup though. Not sure if there is a better way to do what I did or not.
Edit: Just did some testing(With insim half way across the world too), I'm able to send 2000 translated global messages to 3 clients(which are also half way across the world from the LFS server), in less then 5 seconds[no visual lag] only had minor CPU impact aswell, but what do you expect for sending 6000 packets.
Edit 2: Now we've hit a road block... Since the LanguageID is in the NCI packet, which comes after the NCN packet, you're unable to use any Translations in the NCN Packet(or until the NCI packet is recieved). This is really annoying -_-
Edit 3: I ended up temporarily working around the function by doing this:
<?php public function onClientConnect(IS_NCI $NCI) { $Client = $this->getClientByUCID($NCI->UCID); #Continue on with rest of NCN packet using $Client instead of $NCN #You could probably just save yourself some time by just naming the $Client variable $NCN ?>
That way, I still have access to all the data from NCN packet in the NCI packet. While this isn't the best solution. it does work.
Edit 4: Testing an update now. I changed the order of NCI and NCN, so far it seems good, but I want to make sure it won't break anything.
Edit 5: Nope. That ran into issues. it worked great for people already on the server. but Can't get NCI to come before NCN for when a client connects after insim is started. Went back to solution in Edit 3 for now.
Just curious, Since this was a originally HTML+JS, was kinda curious why you added in PHP, the stuff that was done with PHP could have easily been done with something like AngularJS(probably regular JS too)
Fixed that error. I guess I'll need to make a new update soon.
My Thursdays are usually really busy, so I more then likely I'll be doing some some testing tomorrow as I am starting spring break here at work, and don't have classes on Fridays. I'm gonna be doing some thorough tests and make sure everything works right, if all goes well, I'll have a new update out by tomorrow night.
Edit: I at least have PRISM starting, and running on my dedi. I have to wait till I get home to actually test if the NCI packet is working or not. Hopefully I'll be able to get NCI working with ease. I'll update this once I get home to test.
Edit 2: I just tested and NCI works fine, I did find a minor issue earlier with a missing comma in prism_statehandler.php, but it does work, haven't tested yet if it actually sets variables right or not. testing that next.
Edit 3: I also found a typo in betterButtonManager
Eehhh.. How can NCI info be @NCN now? If there is a NCN (new connection) the NCN packet is send but there doesn't automatically follows a NCI packet, only when you request it with TINY_NCI so Statehandler contains empty info for every new NCN which is there after startup of the InSim?
Right? ... I was realizing that myself yesterday and went to bed but after every NCN now needs to follow a TINY_NCI.