View Full Version : DLFSS Project, OpenSource
Greenseed
27th July 2008, 22:35
Removed from here...
Please follow this link to get onto Drive_LSSS forum Page.
http://www.aleajecta.com/forum/index.php?showtopic=6022&st=0
Trac Drive_LFSS WWW Page
http://maya.aleajecta.com/trac/dlfss/wiki
ForceMagic
28th July 2008, 05:50
Hi Greenseed,
I'm glad to add a patch to the project. :D
The patch allow the user to type a message announcement in the console command. He can specify on which server the message will appear or simply send it to all of them.
P.S. It could be great if I could upload a ".patch" file, I renamed this one in .txt. :tilt:
Greenseed
28th July 2008, 06:26
Hehe! very happy to see you there my friend!
Your patch as been applyed: revision 26, thx you!
I had to add a "try,catch" on the string conversion! apparentely is the way to check if a string is from a certain numeric type!
Ho! and i added some Syntax help! i think your forget that! haha!
traxxion
28th July 2008, 07:16
I had to add a "try,catch" on the string conversion! apparentely is the way to check if a string is from a certain numeric type!
private bool isNumeric(string val, System.Globalization.NumberStyles NumberStyle)
{
Double result;
System.Globalization.CultureInfo c = new System.Globalization.CultureInfo("en-US");
c.NumberFormat.CurrencyDecimalSeparator = ".";
return Double.TryParse(val, NumberStyle, c, out result);
}
Try that? :)
Greenseed
28th July 2008, 07:41
Try that? :)
this is doing same thing, i mean a Try,Catch , but in fact i think there is maybe more,for sure "TryParse" has a "try,catch" inside somewhere.
Have to read on the Globalization, but you know playing with "String Format", is allways A very slow thing... so i prefer keeping the simple "try,catch". but many thx for your input! i learned something that can be usefull somewhere else :)
Diff between Convert and Parse, are, Parse can Format and Convert no, so im pretty sure if we tick time a while loop for 1000000 time, she will reveal, Convert faster! and both report Exception on Overflow!
i have to tell my self that a exception is not allways a bad thing into a "Safe Environement" as c# use to be! i just terribly fear try,catch! i was thinked there where slow! but since i found that they exist a "Unhandled Exception Event" so mean everything is into a BIG try,catch! It only my poinr of view not fact!
On this, i continue to talk too much!
see ya! ;)
ForceMagic
28th July 2008, 08:10
Try that? :)
Well, in our case we need the fastest way to check if the variable fit as a serverId, if not we don't need it at all.
ForceMagic
29th July 2008, 09:37
- Adding a console command called "status". Used to return the session Status between servers.
- Move the Ping processing from server.cs to session.cs and completed the code.
- Adding a processpacket(packetTyny) Method to manage incomming Ping.
Greenseed
29th July 2008, 19:29
Hello Forcemagic, thx for your patch.
Added revision 30.
ForceMagic
30th July 2008, 04:39
This patch allow the user to change the settings of his server in a ".cfg" file.
For the moment, this patch only collect and store the data from ".cfg" file, it doesn't use it yet.
The data collecting is executed after the Log is initialized in the Main loop.
Greenseed
30th July 2008, 05:25
Added to revision 33. :) Thx! dude!
ForceMagic
30th July 2008, 06:01
- Adding properties and corrected mistakes. :thumb:
Greenseed
30th July 2008, 21:14
Added: to Revision: 35, Thx ForceMagic.
Your patch pose me a good question, since we will Make the config Dynamic, i mean during run operation, will be possible to change config, without restarting the application.
So all config variable must be access the fastes way. so Here is my question:
Witch is the more faster between:
private int config = 0;
int Config{get config;} OR
int GetConfig(){return config;}, Personaly i prefer this one, since im not very use to proprety.
Witch one is Faster?
Do have have to benchmark my self?, let see! :)
ForceMagic
1st August 2008, 06:32
[...]
Witch is the more faster between:
private int config = 0;
int Config{get config;} OR
int GetConfig(){return config;}, Personaly i prefer this one, since im not very use to proprety.
Witch one is Faster?
Do have have to benchmark my self?, let see! :)
Hey Green !
I just tested both way and it gave me the same result ! So I guess the VS compilator interprets and compile both the same way :thumb:
There is the console result of the tests :
Benchmarking 2 way to Get a value
Using Function :
1st tick : 633531543717656250
2nd tick : 633531543717656250
difference between them : 0
Port Number I Got : 29999
Using Property :
1st tick : 633531543717656250
2nd tick : 633531543717656250
difference between them :0
Port Number I Got : 29999
And there is the code I use to do it.
long tickbefore = 0;
long tickAfter = 0;
long tickResult = 0;
ushort _portNumber = 0;
log.normal("2 way of Get benchmark \r\n" + "Using Function : ");
tickbefore = DateTime.Now.Ticks;
_portNumber = Config.ServerConfigStruct.GetPortNumber();
tickAfter = DateTime.Now.Ticks;
tickResult = tickAfter - tickbefore;
log.normal("\r\n" + Convert.ToString(tickbefore) +
"\r\n" + Convert.ToString(tickAfter) +
"\r\n" + Convert.ToString(tickResult) +
"\r\n" + Convert.ToString(_portNumber));
log.normal("\r\n Using Property : ");
tickbefore = DateTime.Now.Ticks;
_portNumber = Config.ServerConfigStruct.PortNumber;
tickAfter = DateTime.Now.Ticks;
tickResult = tickAfter - tickbefore;
log.normal("\r\n" + Convert.ToString(tickbefore) +
"\r\n" + Convert.ToString(tickAfter) +
"\r\n" + Convert.ToString(tickResult) +
"\r\n" + Convert.ToString(_portNumber));
:smileypul
So you decide what we use ! but personnaly I think I prefer Property.
First it was made for that :nod: Also it's more compact and clean in the code.
Don't you think ?
public static ushort PortNumber
{
get { return portNumber; }
set { portNumber = value; }
}
public static ushort GetPortNumber()
{
return portNumber;
}
public static void SetPortNumber(ushort value)
{
portNumber = value;
}
I also tested the Set and I had the same result
master_lfs.5101
1st August 2008, 19:05
ok greensed told me here. So do you suggest i download the source and start playing around with it?
ForceMagic
1st August 2008, 19:53
ok greensed told me here. So do you suggest i download the source and start playing around with it?
Hello, first I'm glad you decided to try out in our project ! :)
I know I'm not Greenseed haha ! but what you've proposed is an excellent idea. You will be able to read the code and look how it works. So the SVN part it's a good start.
In open source project the communication is very important and we follow some coding standards of course.
I think the main points are to :
- write a code talking by itself
- when you write a comment about the code, if it's necessary, then write why instead of how.
- we try to use same kind of declaration everywhere.
Exemple : Constant declaration in caps lock with underscore between word.
- have fun doing this and we take our time to provide best code we can. It's not a race, lol, but you'll see, when you're in it grow pretty fast :thumb:
It's a learning project, so like I said let's have fun doing it during we improve our skill.
For faster and easier communication, of course we will use program like Spark (a kind of MSN) or anything else.
I'll let Greenseed say something else and complete what I said.
Have a nice day !
master_lfs.5101
1st August 2008, 21:15
hmm. how about you guys use googletalk? i will make u guys accounts. and then downlaod google talk and login. itll be a private server. running off of my googleapps account
Greenseed
1st August 2008, 21:39
We allready have solution for Chat/Talk/Phone and Video.
Here is:
Jabber XMPP(IM, VOIP, Video) network:
I sugest you use this client -> http://www.igniterealtime.org/downloads/index.jsp#spark , who si free and openSource.
Server: jabber.aleajecta.com , just have to create your self a account with Spark. P.S. my jabber network Accept Transport for: XMPP, MSN, Yahoo, ICQ, BuddyChat, Google Talk(Alpha) and more.
It free simple and have a lot of cool feature.
I also have a Forum: www.aleajecta.com/forum , this is more about World Of Warcraft, but on the need i can create Section for this project! if ever he need it.
Asterisk Aleajecta PSTN/VOIP/Video -> Private -> voip.aleajecta.com
MIRC Chat -> irc.aleajecta.com port: 41410
If you connect on with Spark, just do a search for "*" as username, he will show you the complete list! from there choses your friend :)
master_lfs.5101
1st August 2008, 21:48
uh. one question. where do i get irc + jabber servers
edit: may i use a diferent jabber client? i've had a bd expierence with spark.
Greenseed
1st August 2008, 22:21
Server: jabber.aleajecta.com , just have to create your self a account with Spark.
MIRC Chat -> irc.aleajecta.com port: 41410
Most popular jabber client will work, but i don't permit custom Client working, only popular one! for secure reason.
"PSi" is a good example of another Jabber popular client working on my network.
ForceMagic
6th August 2008, 06:14
- Change the serverId for the serverName everywhere.
- Remove InSimSettings class to use the data from the config class.
P.S. I mess up a bit with the dictionnary in Config.cs. I got a KeyNotFoundException when I add a key to the dictionnary. Hope you will be better than me to arrange that, I'm kinda confuse!
Greenseed
9th August 2008, 07:15
Im pretty questioning my self about config system, do we go Specific aproch that run very good on this project and had some rock and roll to it. or do we create a generic config system.
So as you know Forcemagic, i was working on another project and i needed a config system too, i was about to try your system, but i found it was very much design to work only with DLFSS, with some modification i can be able to manage, but since i wan to answer to the first question, i created a generic config system.
I call it "4dot" config.
Here is the config File with explanation how to use.
63468
And here is the source code of the config reader, class implementation are not that good or bad... i don't know.... im still learning how is best with c#.
63469
And here is a bit of code showing how i use it.
public static class TransferInterface
{
private static List<Table> ...
private static void Initialize()
{
List<string> odbcFormat = ConfigReader.GetIdentifierList("ODBC","TableFormat");
List<string> mysqlQuery = ConfigReader.GetIdentifierList("MySQL", "TableInsertQuery");
List<string>.Enumerator itr_f = odbcFormat.GetEnumerator();
List<string>.Enumerator itr_i = odbcFormat.GetEnumerator();
while (itr_f.MoveNext() && itr_i.MoveNext())
{
tableList.Add(new Table
(
itr_f.Current,
ConfigReader.GetStringValue("ODBC", "TableFormat", itr_f.Current),
ConfigReader.GetStringValue("MySQL", "TableInsertQuery", itr_i.Current)
));
...
This example show how i call to Custom Config Identifier... So i ask for the list first and then iterate it. Into the example i do 2 into the same time.
I will wait you see my code, before doing any action to the SVN... i think we must discuct that into private will be best!
P.S. The Regex into the configReader can be much better, allready got another one. :) Ho! and Don't bother to try password "dexxa" on mysql server ;)
Greenseed
15th August 2008, 23:22
Ok, i added this Generic Config, removed Server Class and readded MySQL since MONO has 100% support for it, tested and working as a charm!
So next task will be getting SQLite and MySQL online.
P.S. read the SVN log , sice i changed a lot of thing when removing InSImSetting and Server Class.
Greenseed
15th August 2008, 23:31
About your benchmark ForceMagic, is not good , since your are using a ConsoleWrite with it... so in fact your are benchmarking the ConsoleWrite.
Inside the loop must has nothing except what you wan to benchmark... and do it as into real life is duration is about 5 seconde not too more and too less and do absolute nothing with your computer during thoses 5 seconde... event like this thoses are very poor test... but can gave a good idea!
while(<5second)
{
count++
string temp = Getvalue();
}
How many can we count?
you can too do it with a specified count like 1000000 and calculate the time, it about same!
ForceMagic
10th September 2008, 17:16
I tested the lastest version, which is pretty cool. :)
There are a lot of more news features really usefull for a racer in game. I'm a bit busy with university right now, but I will find something cool to add for sure ;)
Nice job Greenseed ! :thumb:
Greenseed
10th September 2008, 17:31
Thx! for you encouragement! hihi!
Yes! i found too, that the project is now into a upper level of usage! i can't event go now without some Event, like the Vote system or the simple Track Prefix.
Im planning Statistique output, from InGame and HTML/CSS, im still evoluating my idea of how i present this, and what i presente!
And for other feature, seriously, i think i have a big miss! i mean i don't think about good idea! ;)
So it maybe time for me to release a revision into unofficial addons, so i can get User review and user Sugestion... this is pure gold at this point.
Why i did not make that, is i don't wan to explain how to install MySQL and is still too Soon to build the SQLIte DB, i can but will be loose of time!
So im separated, i need thoses user review and sugestion, but...
Maybe you will find thoses word, that will motivate me! :)
bunder9999
17th September 2008, 09:35
can't get it to start here.
snip................FINISH
Critical Error, Auto Shutdown in 20 Seconde...
Exception Was: System.InvalidOperationException: Bind has already been called for this socket
at System.Net.Sockets.Socket.set_ExclusiveAddressUse (Boolean value) [0x00000]
at System.Net.Sockets.TcpClient.set_ExclusiveAddressU se (Boolean value) [0x00000]
at Drive_LFSS.InSim_.InSimClient.InitTcpSocket () [0x00000]
at Drive_LFSS.InSim_.InSimClient.Connect () [0x00000]
Exiting Requested, Please Wait For All Thread Too Exit...
LFSServer.bunbunFBM.ConnectionInfo = 127.0.0.1;29999;mypassword;!;Drive_LFSS;40;20;20
Database.MySQL.ConnectionInfo = 192.168.1.11;3306;drive_lfss;mypassword;drive_lfss ;no
Vote.bunbunFBM.TrackChange = Auto
Vote.bunbunFBM.RaceMap = 11
as far as i know, it looks okay. thanks for your help in advance
edit: this was the only insim app running at the time.
MaKaKaZo
17th September 2008, 09:55
Exception Was: System.InvalidOperationException: Bind has already been called for this socket
Looks like it's trying to connect twice. The socket has been bound in a first attemp to connect, and then it's performing the same connection procedure again and it tries to bind the same socket. There's also the possibility that they're two different sockets, but the arguments in the bind() calls are wrong and they're trying to bind the same socket.
Greenseed
17th September 2008, 18:28
I created the ticket #3 (http://maya.aleajecta.com/trac/dlfss/ticket/3)
I've made a work around into r107.
I can get into that crash if i do this: set ExclusiveAddressUse and then Dispose the Object and Do it Again... The same error will occur, cause the Object is not yet Collected by the Garbage Collector.
But this is not your case, since you got this at the Start.
This was reported as a Bug under MONO and Security Purpose under Windows.
So at that point making a patch that will Garbage Collect, im completely again. So i simply Commented this line, since this is not very important for us after all.
Let me know if better!
bunder9999 , to answer to your PM, if you already know SVN , just do what patch you feel for! i will look at and maybe add it to the project!
And the SVN is really open to get more dev into is List ;)
Any help you need on what is already done, just ask will be a pleasure to answer! Im trying to keep most of the needed information into the Trac Wiki (http://maya.aleajecta.com/trac/dlfss/wiki)
bunder9999
17th September 2008, 19:01
i get:
Initializating PubStats...
and a popup box "fatal error in gc" with the contents "GetThreadContext failed", and it decides to consume 100% cpu.
Greenseed
17th September 2008, 20:31
I just tested the DLFSS on the same computer as the LFS server, something i never done before, since im not developing it on the same computer LFS server is running on.
I found some probleme into the Connection procedure when running like this.
UDP was never able to Bind correctely.
When IRC was disable got a crash into sending a chat message.
So both are now fixed into r109 ... But still the Ticket #3 , was not able to reproduce the problem :( only way i reproduce it, is with modifying the core.
So really hope problem is solved! hurry to ear your comment bunder9999.
Bye bye have a good day.
Greenseed
18th September 2008, 08:32
To make think simple, i tested my self under linux
here is my configuration:
CentOs , Mono 1.9.1.i586
Started from the command line: "mono Drive_LFSS.exe" was 100% As expected! everything i tested where working as they should be with rev111
I don't think is a good idea to run this configuration:
i didn't not test it
Linux->Wine->Mono(Win32)->Drive_LFSS.exe
bunder9999
18th September 2008, 11:16
looks like both methods work with rv 111, but i agree, why use mono via wine when mono is available for linux. :D
vBulletin® v3.8.6, Copyright ©2000-2012, Jelsoft Enterprises Ltd.