PDA

View Full Version : Regnum Online source code!!


surak
04-02-2009, 02:02 AM
#include "regnum.h"

int main()
{
:guitar:
}

Ohhh I love april 1st

lord_dvl
04-02-2009, 02:30 AM
Ja ja ja ja.

I think you meant this........

#include "regnum.h"

int main()
{
:fsm:
}

ArcticWolf
04-02-2009, 02:36 AM
#include "regnum.h"

int main()
{
:guitar:
}

Ohhh I love april 1st


YOU BIG BLOODY... That's a trade secret!





Happy April Fool's Day xD

Miraculix
04-02-2009, 02:42 AM
ATTENTION! SURAK IS LYING!

Kailer told me that the 1st line of code is:

/******************

So surak is lying.

Busted, noob :p

ArcticWolf
04-02-2009, 03:11 AM
ATTENTION! SURAK IS LYING!

Kailer told me that the 1st line of code is:

/******************

So surak is lying.

Busted, noob :p

Klingons do not comment the code.

Arafails
04-02-2009, 07:33 AM
Klingons do not comment the code.



Call that a comment?

...

In Soviet Russia, the source code comments you!

Eli2
04-02-2009, 09:17 AM
In my mind it has always been looking like this.

#include "regnum.h"

int main()
{
for( ;; ) {
http://www.sajjadzaidi.com/2007/jan/fixing_a_mess_of_cables/cable_mess.jpg
}
}

Where yellow is network code and white is client one.

ArcticWolf
04-02-2009, 03:13 PM
The EngineCore of libedb (part of rolgps):

http://code.google.com/p/rolgps/source/browse/experimental/libedb/src/org/rolgps/libedb/engine/sqlite3/zentus/EngineCore.java

theotherhiveking
04-02-2009, 05:10 PM
In my mind it has always been looking like this.

#include "regnum.h"

int main()
{
for( ;; ) {
http://www.sajjadzaidi.com/2007/jan/fixing_a_mess_of_cables/cable_mess.jpg
}
}

Where yellow is network code and white is client one.


I lol'd:metal:

Eli2
04-02-2009, 06:54 PM
The EngineCore of libedb (part of rolgps):

http://code.google.com/p/rolgps/source/browse/experimental/libedb/src/org/rolgps/libedb/engine/sqlite3/zentus/EngineCore.java

public DataResult[] executeStatement(String sqlStatement, String[]... fields) throws QueryException
Line 149 (http://code.google.com/p/rolgps/source/browse/experimental/libedb/src/org/rolgps/libedb/engine/sqlite3/zentus/EngineCore.java#149)

What does this "..." do ?

ArcticWolf
04-02-2009, 10:50 PM
public DataResult[] executeStatement(String sqlStatement, String[]... fields) throws QueryException Line 149 (http://code.google.com/p/rolgps/source/browse/experimental/libedb/src/org/rolgps/libedb/engine/sqlite3/zentus/EngineCore.java#149)

What does this "..." do ?
Well, nothing really interesting... It's just some syntactic sugar. :P

It makes an array with the arguments. You can cast the code with 2, 3 or more arguments. Some sample code:


Database database = DatabaseFactory.getDatabase(
DatabaseFactory.SQLITE3, "/tmp/test.db", null, null);
String[] data = {"xephandor", "19"};
String[] data2 = {"saskia", "19"};
String[] data3 = {"erland", "19"};
DataResult[] result = database.executeStatement("delete from users where name='?' and age=?",data, data2, data3);

This will return the error state of the query.

I know, the implementation sucks big time, but it may work.

arlick
04-02-2009, 11:13 PM
This will return the error state of the query.

I know, the implementation sucks big time, but it may work.

may, should... all in live is relative (?) :sifflote:

For Eli2:


String... === String[]


And


String[]... === String[][]

Mattdoesrock
04-02-2009, 11:28 PM
String... === http://img21.imageshack.us/img21/766/insetballofstring.jpg (?)

:p

ArcticWolf
04-02-2009, 11:45 PM
String... === http://img21.imageshack.us/img21/766/insetballofstring.jpg (?)

:p
Wait, you haven't seen the new Thread() yet!

Eli2
04-03-2009, 01:28 AM
Ah ok :)
I have never seen this syntax, and never needed to use it.
Although it seems to be really common.

http://en.wikipedia.org/wiki/Variadic_function

Mattdoesrock
04-03-2009, 01:29 AM
Wait, you haven't seen the new Thread() yet!

http://img16.imageshack.us/img16/4273/seriousthread.jpg

?

ArcticWolf
04-03-2009, 01:59 AM
Ah ok :)
I have never seen this syntax, and never needed to use it.
Although it seems to be really common.

http://en.wikipedia.org/wiki/Variadic_function

A lot of people like it, and I use it from time to time...

Another improvement in Java 1.5 were the for-each loops. REALLY useful when you just want to iterate a list, it saves a lot of typing (and you know that most of the bugs come from typos).

Miraculix
04-03-2009, 02:45 AM
Ah ok :)
I have never seen this syntax, and never needed to use it.
Although it seems to be really common.

http://en.wikipedia.org/wiki/Variadic_function

printf() is a variadic function, as is any function that takes a variable amount of arguments. It's really common :p

ArcticWolf
04-03-2009, 03:59 AM
printf() is a variadic function, as is any function that takes a variable amount of arguments. It's really common :p

I don't know why, but I don't like printf.

arlick
04-03-2009, 11:23 AM
I don't know why, but I don't like printf.

printf rules noob! (?)

I have discovered the java's printf (this is real, and i like it!) xD

String.format()

Eli2
04-03-2009, 11:25 AM
I don't know why, but I don't like printf.
I dont like it either.
http://www.ibm.com/developerworks/library/s-buffer-defend.html

Arafails
04-03-2009, 02:50 PM
Uh.... printf is buffer safe. Also the best way to format strings for output. (Certainly beats the hell out of C++'s iostream bs)

I dont like it either.
http://www.ibm.com/developerworks/library/s-buffer-defend.html

Eli2
04-03-2009, 04:11 PM
Uh.... printf is buffer safe. Also the best way to format strings for output. (Certainly beats the hell out of C++'s iostream bs)

My personal favorite is.
Qt :metal:
http://doc.trolltech.com/4.5/qstring.html#arg

ArcticWolf
04-03-2009, 09:31 PM
iostream FTW!!! cout is nice. xD

There's something about printf() that I don't like, I don't know why.

Angel_de_Combate
04-04-2009, 11:19 AM
#include "regnum.h"

int main()
{
:guitar:
}

Ohhh I love april 1st

Mighty Surak is you posted on the 04-02-2009, thats means that your the fool as its after 12pm 04-01-09 :p <tis the rules of April Fool's day>:biggrin:

ArcticWolf
04-04-2009, 03:30 PM
It was 1st of April here. :P

-Edge-
04-04-2009, 05:56 PM
Here too,

Screw you Meco :P

ArcticWolf
04-04-2009, 06:50 PM
Hereby, I declare the creation of the new Surak Meridional Time, which is to be the replacement to the more Awkward and less universal GMT.

DkySven
04-04-2009, 06:57 PM
Hereby, I declare the creation of the new Surak Meridional Time, which is to be the replacement to the more Awkward and less universal GMT.
We could make Regnum time SMT :) (With 2 hour days)

ArcticWolf
04-04-2009, 07:31 PM
We could make Regnum time SMT :) (With 2 hour days)

Hey, that's a good idea!! We could have our own time and date! We could use Unix time to make the conversion less traumatic.



New Year would be May 25th. The Zero is 2006-05-25
A day would last 7200 seconds. Hence, we're on 12549 days (12549.7106944 to be exact) since the Zero, which is 34.3827690259 Regnum years.

DkySven
04-04-2009, 07:36 PM
Hey, that's a good idea!! We could have our own time and date! We could use Unix time to make the conversion less traumatic.



New Year would be May 25th. The Zero is 2006-05-25
A day would last 7200 seconds. Hence, we're on 12549 days (12549.7106944 to be exact) since the Zero, which is 34.3827690259 Regnum years.
At first I was a bit confused, but then I realized in English you use a . to define decimals XD(in Dutch we use it in things like 1.000.000=a million). So we have had 34 Regnum years. This could be nice for players to see how old their characters are :)

Maybe if Surak has a bit free time he could implement it. :D Go go, Surak!

ArcticWolf
04-04-2009, 08:13 PM
In Spanish we also use comma as the decimal point, so 1.000.000 would be one million... :P

Snoid
04-04-2009, 08:22 PM
Hey, that's a good idea!! We could have our own time and date! We could use Unix time to make the conversion less traumatic.



New Year would be May 25th. The Zero is 2006-05-25
A day would last 7200 seconds. Hence, we're on 12549 days (12549.7106944 to be exact) since the Zero, which is 34.3827690259 Regnum years.

I support that.
Regnum date and history line is a must. I made my own regnum clock once, btw, but it always get bad time at every server reboot.

let me find it and i post a pic.

Edit: i cant find it. :( i will make a new one soon.

Angel_de_Combate
04-09-2009, 11:13 AM
Here too,

Screw you Meco :P

Screw you, right back lol

dejan
04-14-2009, 09:41 AM
I think it is more like:

int main(int argc, char** argv) {
startGame(randomTime()); /* randomTime() function returns time between 1 and 60 minutes */
randomCrash();
return 0; /* this line is never reached */
}

ArcticWolf
04-14-2009, 12:16 PM
Of course it will never return 0 if you're crashing the game on purpose before returning 0.