The online racing simulator
Searching in All forums
(535 results)
misiek08
S3 licensed
@pitted - players on pits. (with PLID but not on track)
##x (player on pos "x")
misiek08
S3 licensed
Quote from DarkTimes :
  • I really hope no one is running InSimSniffer 24/7

I had for 72hours...

Without break of course.
misiek08
S3 licensed
What was wrong with the buttons?
misiek08
S3 licensed
Great example, thanks. I didn't know about the colors other than ^1-8.

But maybe developers should allow programmers to send RGB/HSV color code to set it. It would be very helpful in new projects.
misiek08
S3 licensed
Can you show example, how to send it. In C# or PHP?
misiek08
S3 licensed
Ok. Now I understand.

It's great idea.

Thanks for this what is done. I saw a new part of using __call(). It's great example. I know PHP only by reading others people codes. The PHPInSim Mod was written not good way. I've rewritten it. Now if the PRISM will have DB support before start of November I'll use it. If not: I will make PHPInSim easier to use. I started making AJAX live data from LFS but on PHPInSim Mod.
Now I'm waiting. If you'll add the support for MySQL I'll make a plugin for PRISM.
misiek08
S3 licensed
I think there can be built in singleton(single instace of class in Polish - I don't know how to say it in English?) for DB.

I personally prefer PDO because it support's every database system (most popular of course).

You say about huge update. If PRISM is going to be an PHP InSim system it has a lot of basic, required functionalities and I think, it don't need too much (buttons, gui tables), to be done as PHP InSim.
Database support
misiek08
S3 licensed
Hi!
Maybe you can add the built in DB support. I think MySQL will be ok but with PDO is easy to develop every DB. I have class to use database but it's external thing and it tooks few lines to much I think.

In 0.3.1 or 0.4 it can be done. I think, the DB support and full support for multi-host is the last thing needed now in PRISM to make it the best.
misiek08
S3 licensed
Is there any chance for RSH and/or RSV?
misiek08
S3 licensed
Send IS_BTN to server?
misiek08
S3 licensed
I'm using it too.
There is no forum that can be more helpful than SO.
Last edited by misiek08, .
misiek08
S3 licensed
It's working good. Thank you @morpha. A lot of ppl don't know about how to do it.
misiek08
S3 licensed
Yes, I mean ingame name on connection list. I'll try it tommorow and I'll tell you.
Hostname over Linux
misiek08
S3 licensed
Hi!
It is possible to change host nick on Linux? I saw server like for example [TC] CityDriving Montana. It was hosted on Windows but servers with Windows are "eating" to much resources. It is possible to change server nick on Debian wine?
misiek08
S3 licensed
I was just kidding about your post. I was using Apache for 3 years. Then friend told me about nginx..... and everything started to work faster and my servers are now bored because of free RAM and CPU.
misiek08
S3 licensed
@Dygear, better delete your post :P

You didn't hear about nginx? It's (like for me) best alternative for Apache. It support something like mod_rewrite and you can easy migrate from Apache to nginx setting nginx as proxy.
misiek08
S3 licensed
I don't know which file is executed by default but you can try adding (after <?) this code:
ini_set('display_errors', 'true');
error_reporting(E_ALL);

misiek08
S3 licensed
@juniox_dias - Permission denied. Change chmod's to visit.dat file. Maybe make it temporary 777.
misiek08
S3 licensed
And the clone of Chudy is sending to ppl keygens and hacks for game. I heard it's illegal but I see it is 100% legal. If it isn't legal why the clone isn't banned.

In offence, real Chudy is not sending anything to ppl. Every hack he made is used only by himself.
misiek08
S3 licensed
Going back to Chudy_2oo1, real Chudy_2001 was banned for link posted by Chudy_2oo1.
Maybe devs should ban Chudy_2oo1 in world of LFS? (not only the forum but on servers too!)
Last edited by misiek08, .
misiek08
S3 licensed
I can use Spark but tell me how to run it on Debian Lenny via Command Line? It's VPS server.
misiek08
S3 licensed
Oh. I found. 2.8 or 3.0 should support 4.0. Now we have 2.6 so it can take a lot of time. So I have to use external lib (not Spark). wine isn't supporting any .NET.
misiek08
S3 licensed
Someone told me it supports 4.0 from 2.4 version (I had it) and few ppl said it's 2.6 mono version for 4.0 .NET . I can't find one, strictly answer.
Spark, C# and mono
misiek08
S3 licensed
Hi!
I started coding with Spark library but I need to run it on mono on my Debian VPS for InSim's.
Main program code (this is modified example):

using System;
using System.Collections.Generic;
using Spark;
using Spark.Helpers;
using Spark.Packets;

namespace Spark.Example4
{
/// <summary>
/// Example 4: Helpers. Connects to InSim, requests all players to be sent, the prints out
/// the time of each player that completes a lap.
/// </summary>
class Program
{
// We store the players in a dictionary with the PLID as the key.
static InSim insim;
static Dictionary<int, IS_NPL> _players = new Dictionary<int, IS_NPL>();
static Dictionary<int, IS_NCN> _conns = new Dictionary<int, IS_NCN>();

static void Main()
{
// Create new InSim object.
using (insim = new InSim())
{
// Bind handlers.
insim.Bind<IS_NCN>(NewConn);
insim.Bind<IS_CNL>(ConnLeft);
insim.Bind<IS_NPL>(NewPlayer);
insim.Bind<IS_PLL>(PlayerLeft);
insim.Bind<IS_MCI>(MultiCarInfo);

// Establish the InSim connection.
insim.Connect("62.75.388.55", 65948);

// Initialize InSim.
insim.Send(new IS_ISI { IName = "^3MP 2010 DEMO", Admin="youwonnait", Prefix = '@', Flags = InSimFlags.ISF_MCI, Interval = 1000});

// Request connections.
insim.Send(new IS_TINY { SubT = TinyType.TINY_NCN, ReqI = 255});

// Request players.
insim.Send(new IS_TINY { SubT = TinyType.TINY_NPL, ReqI = 255});

//insim.Bind<IS_MCI>(MultiCarInfo);

// Prevent program from exiting.
insim.Run();
}
}

static void NewConn(IS_NCN ncn)
{
if(_conns.ContainsKey(ncn.UCID)){
_conns[ncn.UCID] = ncn;
}
else{
_conns.Add(ncn.UCID, ncn);
}
Console.WriteLine("New connection: {0} ({1}) #{2}", ncn.PName, ncn.UName, ncn.UCID);
}

static void ConnLeft(IS_CNL cnl)
{
Console.WriteLine("Connection left: {0} ({1}) #{2} Reason: {3}", getConn(cnl.UCID).PName, getConn(cnl.UCID).UName, cnl.UCID, cnl.Reason);
_conns.Remove(cnl.UCID);
}

static void NewPlayer(IS_NPL npl)
{
if (_players.ContainsKey(npl.PLID))
{
// Leaving pits, just update NPL object.
_players[npl.PLID] = npl;
}
else
{
// Add new player.
_players.Add(npl.PLID, npl);
}
Console.WriteLine("New player: {0} (#{1})", npl.PName, npl.UCID);
}

static void PlayerLeft(IS_PLL pll)
{
// Remove player.
_players.Remove(pll.PLID);
}

static void MessageOut(IS_MSO mso)
{
if(mso.Msg == "something"){

}
}

static IS_NPL getPlayer(byte PLID){
Int32 szukaj = Convert.ToInt32(PLID);
return _players[szukaj];
}

static IS_NCN getConn(byte UCID)
{
Int32 szukaj = Convert.ToInt32(UCID);
return _conns[szukaj];
}

static void spectatePlayer(byte PLID) {
Console.WriteLine("Speeding: {0}", getConn(getPlayer(PLID).UCID).UName);
if (getConn(getPlayer(PLID).UCID).UName == "misiek08")
{
insim.Send(new IS_MST { Msg = ("/spec " + getConn(getPlayer(PLID).UCID).UName) });
}
}

static void NodeLapPacket(IS_NLP nlp)
{
foreach (var nlpp in nlp.NodeLaps){
Console.WriteLine("" + nlpp.Lap);
}
}

static void MultiCarInfo(IS_MCI mci)
{
// Loop through each car on track.
foreach (var car in mci.CompCars)
{
IS_NPL npl;
// Get the NPL packet if it exists...
if (_players.TryGetValue(car.PLID, out npl))
{
// Convert LFS speed into Mph.
var kph = MathHelper.SpeedToKph(car.Speed);
// Print nicely formatted string to console.
Console.WriteLine("Speed: {0} {1:F2}", npl.PName, kph);
if (kph > 100)
{
spectatePlayer(car.PLID);
}
}

}
}
}
}

On windows it's working good but on mono it throws:

WARNING: The runtime version supported by this application is unavailable.
Using default runtime: v1.1.4322

** (Spark.Example4.exe:11622): WARNING **: The class System.Collections.Generic.Dictionary`2 could not be loaded, used in mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089

Unhandled Exception: System.TypeLoadException: Could not load type 'Spark.Example4.Program' from assembly 'Spark.Example4, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'.

misiek08
S3 licensed
So I have to take time at night and try it. Thanks @the_angry_angel. I'll test it and post here working code. The table is kierowcy

EDIT:
I need Mysql Connector for C#, yes?
FGED GREDG RDFGDR GSFDG