I agree that which style you prefer doesn't matter, but you should pick a style and stick to it. Nothing uglier than a codebase where different contributors use different conventions. If the PHP language has an official style-guide you should use that.
No one disputes that he made a mistake, or that he's made similar mistakes before, but the idea that he is a bad driver or undeserving of a place in F1 is not a fact, just your opinion.
What on earth are you on? Sure, Vettel has made a few clumsy mistakes this year, but no one can deny that he's absolutely mighty behind the wheel. I know we keep saying this, but he is only 23 and this is only his third year of F1. He simply doesn't have the experience of Button, Webber, Alonso et al.. Of course he's going to make some mistakes.
I think that's a really interesting point. Every driver has weaknesses, but the more experienced know what they are and can drive around them. For the lesser experienced (Vettel is still only 23!), they are finding out where they are weak for the first time.
Ah OK, that's cool. As I say, it just stuck out in the code as looking weird.
I've got the framework up and running here now and it seems to work great. My PHP skills are terrible, so I don't think I'll be able to contribute anything useful, but I might try to write a plugin when it's more complete.
I think that's cause McLaren built their car around it, while the other teams have had to tack it onto their existing designs. Also it seems most of the other drivers have to operate it with their hand, whereas the McLaren guys are able to use their braking leg, which would seem like another advantage.
I don't know PHP, but it looks to me like you are just reading the first packet from the buffer on each receive call, so if multiple packets arrive in a single call only the first is getting processed. You need to read out all the completed packets from the buffer in turn, then store any incomplete packets so they can be completed on the next call. Basically you're treating TCP like UDP, instead of as a constant stream of data.
Would it be possible to include a simple 'Hello, world!' example for nonces like me who don't know how it works? I know you're planning on writing full documentation, but just a snippet to get started would be useful.
I had a bit of a fiddle and uploaded another new version with some more features.
Added bonus and health
Made the onscreen display look cooler
Added !top command which shows a list of the top ten users
Changed !give to !send, and added new !give <username> <car> command
Added !stats <username> command, which will show you another users stats
Improved !showoff command output
I think I need to refactor the commands next, it's becoming a bit of an if-fest, I thought it was more readable at first, but now obviously I was wrong.
Well I like the LGPL license, as it allows anyone to make a closed source program that links to your library, but any changes (bug fixes or features) they add to the library itself need to be made public. That's the license I use and I think it's a happy medium.
I think Greedy Programmers License is unfair. Using GPL or LGPL isn't about being greedy (and greedy how?), it's about making sure the programs you release as open-source stay open-source. I have released my libraries under LGPL, not because I'm greedy, but because I want to make sure that any improvements or changes people make stay within the community. I open-source my programs as I want everyone to benefit from them, and I release them as GPL because I want everyone to benefit from the changes made to them as well. I don't see how that could classify me as a greedy programmer.
This bug has arisen because of the change to using a database to store user info. In the previous XML version cars were stored as a collection of strings, but to work with the database I had to change them to a collection of Car objects. I did not catch the bug as it caused no compilation errors, the C# compiler decided to call the Car objects ToString() method instead, which is why it printed SparkCruise.Car.
To fix the bug you can update the CommandGarage method to this:
private void CommandGarage(User user, string[] args) { if (user.Cars.Any()) { MessageTo(user, "Garage:"); foreach (var car in user.Cars) { var price = Dealer.GetCarPrice(car.Name); MessageTo(user, "{0}: ${1}", car.Name, price); } } else { MessageTo(user, "You do not own any cars"); } }
I have ported my cruise server example from Python over to C#. It is a very simple cruise server, where you drive around earning cash, which you can then spend on buying and selling cars.
This is not intended to be the worlds best cruise server, it's designed as an example of how to carry out lots of different InSim related tasks. Here is a rough list of the topics covered, in no particular order and from the top of my head.
Tracking users and players on a host
Persisting users between sessions using a SQL Compact database
Displaying user information using on-screen buttons
Handling commands of differing complexity (!buy, !sell, !give etc..)
Tracking the distance a user has travelled
Using timers to trigger events
Using LINQ to query user data
I wrote the code this morning, it isn't perfect and I've not had time to test it thoroughly, but it seems to work OK.