Added packet length check to ensure data integrity.
Memory efficient improved in handlePacket function.
Added emergency defaults for the cvars array.
Made a generic connections.ini file.
Implemented GeForz's error handling system.
Implemented GeForz's __toString function in structs class.
Implemented GeForz's printPacketStructure in strufts class, with some edits.
Implemented GeForz's some other edits.
Neater default cvars handling.
Fixed a duplicate entry in default cvars and added a missing one.
Fixed small udpPort bug in case duplicate udpPort was found in connections config causing prism to listen to a nonexistent socket (would throw php error).
Fixed the prefix var being staticly set to '!', can now be anything as long as you provide it's value in hosts.ini, falls back to '!' tho, or what ever the prefix value found in cvars.ini.
Fixed `the time` & `thetime` command not displaying when you've not been a player yet.
Fixed information being printed to console not chat.
Fixed the way text is sent to the screen when you go past the limit of the packet, now smartly spans muliple messages where available.
Fixed buttons only being sent to local client.
Callback say commands now only accept the command and ucid of the client, plid is no longer given.
Plugin::getUserNameByUCID() is depcracated along with some other functions and are no longer defined. Use Plugin::get[Client/Player]By[UCID,PLID,UName,PName]()->[UName,PName,UCID,PLID,ect] to get the value of the user.
Changed the debug level so that packets are not reported to the PRISM console.
Tweaked the output of some say commands to make them look better.
Rewrite of the index.php file for the www server to make it cleaner, and more useful.
Added G-Meter plugin.
Added a distance plugin to show people how to get the total distance of a client, in the most accurate way.
Added method plugins::getStateByID().
Added CSS for index.php.
Added many docs about the API, please read over them, I've also added url's for the source materal of these docs as we are going to start using their API syntax alot more.
Timers work correctly for both one off events and repeating events.
Syntax change for the createTimer function, the callback function name is to be the first argument, and the second argument is to be the interval between the timed event and it's firing.
The consts Plugin::TIMER_CLOSE, Plugin::TIMER_REPEAT, Plugin::TIMER_NOTRACK are gone.
They where replaced with Timer::CLOSE & Timer::REPEAT, there is no Timer::NOTRACK because it's not implemented here.
Fixed minor crash when running a the `prism reo` command.
Fixed a bug in the Reorder plugin by requesting information about the clients & players before anything else. This should also avoid a bug in other plugins, even if the packet requests are redundant.
Updated colorButtons, distance, gmeter, LVS, reorder, theTime, & welcome plugins to use simple packet syntax.
Simple syntax for packets is now here. You can now have one line both create and send a packet. No more $MTC = new IS_MTC; You can now do it all in one line like, IS_MTC()->UCID(0)->Text('Hello')->Send(); If you need a refrence, you can still edit the object right away like so, $MTC = IS_MTC()->UCID($UCID); This is pretty useful when you know your going to send a message, but it has many possilbe text values. Or you might be sending a diffrent line to the same person.
Fixed bug in `prism exit`, now works correctly.
`prism help` will only show commands available at that clients level. Also made changes in prep for loading and unloading plugins at run time.
Added more detail to ClientHandler about the PRISM admin level of the client. New methods include isPRISMAdmin, isTemporaray, getConnection & getAccessFlags. isAdmin now reports TRUE in the case that the client is a PRISM or LFS admin on the host.
Ensured that UNames are handled as case insenstive throughout the admin module.
Admin plugin updated so that Kick, Ban, Spec & Pit commands are all handled by one method. Basis of loading & unloading plugins at runtime was added.
Removed debug code from IS_MTC class.
Demo Plugin to show Button/ButtonManager usage (plugins/buttonTest.php)
Button class and button manager are now in a usable state.
Fixed pylons plugin (include statement).
Moved packet-dispatching for buttonmanager to statehandler to avoid multiple calls for one packet
Logging improvements. Packets in now show <, packets out now show > in front.
Updated to Version 0.4.3. Updates to support PHP 5.4.0.
Fixed parse error when used with PHP 5.4 RC1.
Fixed fatal error when used with PHP 5.4 RC1.
Fixed STRICT warning when calling the interactive query method in a static context on PHP 5.4.0.
State Handler Fixes and Improvements
Massive update to state handler, the classes are now much better devided into their roles, lots of redundant code removed, still need to check TOC packet, and for 5.3.x compatability.
Added some functions to the Client & Player Hanlder.
ISP_TOC handling done.
PTH & SMX module fixes and improvements
Added the Data Directory, that includes the PTH files used for the LVS plugin, and by the PTH module.
Moved the inPoly method into the pth parser, and added some new methods to use that can be found in the LVS example plugin.
Completly rewrote the PTH parer (twice).
Fixed PTH parser, was using l, but needed V because some numbers where too large.
Fixed small errors in the pth parser.
Completly rewrote the SMX parer.
Fixed SMX parser, was using l, but needed V because some numbers where too large.
OutGuage Support
First draft of OutGauge support. Has config and network facilities and parses packet. Needs a method to actually do something with it.
Added OSP & OGP consts, and added their ID's to the TYPEs array.
Updates the OutSimPack's & OutGuagePack's PACK, UNPACK and added LENGTH and added a special unpack method to both.
Made OutGuage code cross refrence the information from the OutGuagePack class. That also made the code much more concise.
General Fixes and Corrections
Fixed crash on player pitting.
Made the dedicated or listen server, answer choices make sense.
Slight Change for T3, to allow for plugin defined parameters to be received by the onClick handler.
Changed the string type for the Plate's from a NULL Padded (a) string to a SPACE Padded string (A), in response to a bug report 29 by PoVo. This effects, CPR, NPL and RES packets.
Fixes issue 26, reported by PoVo, where a client presses Shift + I PRISM would crash.
PoVo confirmed fix for the button interface, un-commented ButtonManager::buttonsForHost();
Fixed bug when pitting due to the handling of the Tyres.
Added some questions to the interactive start for the hosts, so we can find out what flags to set. I've also added default ports to both HTTP and Telnet.
Fixed bug where no plugins are loaded when PRISM_DEBUG_CORE is not set.
Fixed duplicate port-check.
Fixed data types for ints in the packests, where their signed long machine byte order variant, now they all are unsigned long little endian byte order as they should be.
Fixed PACK/UNPACK in IS_RST
Fixed PACK string of IS_MTC, so that sound does work.
Fixed a capital K in parent::unpack in the IS_HLV class.
Fixed missing semi-colon after class for IS_TINY.
Plugin Update, Changes and Improvements
Added iTunes control plugin (Works only on Windows)
Added Timing & Scoring plugin.
Removed some testing plugins that are no longer needed. (AutoX, Button Test, Color Buttons, Contact, Distance, Gap Monitor & GapMon, and Pylons.
Fixed a bug with the PLL, CNL & CPR packets going to the state handler first, removing inforemoving information from the plugin's scope before they have had a chance to use it.
Added IS_CPR (Client Player Rename) to list of packets that are sent to the plugin before they are handled by the State Handler.
Fixed E_STRICT warning with InsimConnection::writeUDP()
Fixed up timer bug, which caused another timer with same timestamp to be removed.
Merge pull request #30 from LFSPovo/master Fixed timer stop issue reported by Povo.
Fixed merge conflicts with messaging branch.
Adds IS_NPL fix (Thanks the_angry_angel)
Adds IS_TOC fix (Thanks the_angry_angel)
Added DarkTime's timer fix for timer's smaller then 1 second. (Thanks DarkTimes)
PTH & LVS fixes and improvements
First attempt at using custom pth files with PRISM, pth files must be in the same dir as the normal pth files (/data/pth/) to load correctly. The layout name must match that of the pth file to load the layout correctly.
LVS now reports on / off track events for all players.
LVS Plugin now works, with some modifications to the PTH parser as well.
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
Translations are now stored to a static variable for caching
To clear cache for your plugin call $this->clearTranslationCache();
if you ever called directly called the TranslateEngine function in your plugin(which was not how it was originally intended, but could have been used that way, you'll need to update your code to use translateEngine::translate)
Add param to betterButtonManager initButton function that prevents the text from looping
This could be really useful in situations such as coundowns so you could do something like:
In this situation, it would count down from 5 to 1 and then say go for 3 seconds
For help setting up betterButtonManager, there is a readme available here(though it currently doesn't list all of the functions that are available in the betterButtonManager.)
Fix situations when using betterButtonManager and addClickEventToBtn and no param array is specified(so it defaulted to null as a result as seen below)
<?php public function AddClickEventToBtn($Name, $Class, $Function, $Params=null) ?>
PRISM was treating the null as the parameter intended to send to the function. When there is no params the following is expected:
<?php function ClickEvent ($BTC, $BTN) { #BTC has the structure of the BTC packet PRISM receives from the host #BTN is the original button that caused the click } ?>
PHPInSimMod (PRISM) 0.6.1
Fix issue left over from when moving translateEngine to it's own class
Add MessageAllHost Plugin function.
<?php # Sends a message to all servers including the one that called the function $this->messageAllHosts('This is sent to all PRISM connected hosts!');
# Sends a message to all servers but the one that called the function $this->messageAllHosts('Message to other host!', true); ?>