Hello,
it's time for another update. As stated >here earlier we've decided to release smaller patches but more often. This version is called 1.1 since we've proven ourselves to know the alphabet quite well by now I guess. Among various fixes (detailed changelog at the end of this posting), we also want to share some great news with you.
After a lot of consideration we've decided to make our early netcode, we implemented during development of 1.0 but never finished, available through the API. We've also polished it a little so clients can connect automatically using our master server. Clients can still use net_connect IP[:port] to connect to servers manually in case there are issues with the automatic connection.
What does it offer?
Very very basic things like syncing blip creation for peds and vehicles (changes to blips except for deleting are not synced btw) and callout messages. Search areas during pursuits are also synced. I hope you aren't disappointed, this is how it is and how far we got back then and we decided it would be better to at least give you basic functionality (which you can extend!) instead of never releasing it at all. Callouts are host only.
How does it work?
Put simply, we establish a UDP connection between the client and server. This is completely independent of your game session, so yes, in theory you could also connect to a host's IP from another GTA game session. But we don't really encourage you to do so...
So what to do as a host?
If you are hosting the game, LCPDFR will recognize this automatically. Sometimes scripts are loaded in the lobby already and detection of network game might fail, so either check if you get the helpbox stating you are in a network session or simply reload scripts once in-game.
Also make sure to forward UDP port 1337 (or whatever you set it to from the ini file) so clients can actually reach you. If you have a UPnP cabable router, LCPDFR will try to automatically forward ports for you.
So what to do as a client?
Join a game and see if you get a helpbox stating you are in a network game. If not, reload scripts. Once LCPDFR has detected your network session, it will try to retrieve the host's IP and port from our masterserver. If that works, you don't have to do anything, you will be connected automatically. If it fails (you will get notified), you can still use net_connect IP[:port] to connect. Note that port is optional.
I'm an API developer, what can I do?
I will update the GitHub repo with a basic example. Also check the new Networking class which provides access to our functions. You may have to add the LCPDFR.Networking lib to your project. For more questions, please use the dedicated API forums.
Appendix
On a final note I have to thank LukeD and ineseri for their efforts in helping me testing our networking code.
From the early attempts of just establishing a connection to ironing out issues with the master server the two of you never hesitated to join me for a session when I asked. Thanks for that!
Also big thanks to Cyan for finishing the master server to allow automatic connecting now.
Change log
API
Added SetPursuitTactics and SetPursuitHelicopterTactics
Added GetArrestedPeds to get all peds the player is currently taking care of
LVehicle: Added SirenMuted
CheckpointControl
Added back QAM entries (sorry!)
Pullover
Fixed stats glitch (thanks to EvilJackCarver for reporting)
Networking
Basic network engine syncing blips (no attributes), callout messages and search areas.
Better detection of network players
Misc
A few crash fixes
Reduced obfuscation level to please AV software