[Open-Source]Conquer Online PServer Project

09/04/2016 15:17 Super Aids#1
So as I'm currently expanding my knowledge in network programming / database usage using D, I thought this might be a good project for now to experiment with it.

The project will be completely open-source, so feel free to contribute if you want to.

As of now there's not really anything in other, other than being able to receive connections.

I will be updating this thread with more information later, as well changes that happens.

The project is written in D using cheetah (Uses vibe.d behind the scene) for network (Will be using MySql for database, once I get to that.)

You can read more about cheetah here: [Only registered and activated users can see links. Click Here To Register...]

You can read more about vibe.d here: [Only registered and activated users can see links. Click Here To Register...]

It should be able to compile on any platform that can compile D using both ldc, gdc or dmd. Which means it can be run on Windows, Linux and OSX.

The project is hosted on github as an organization for simplicity. The plan is to later have different projects tied to the current one.

It will be targeted at patch 5017 for a start, but I may branch out later to create higher patched versions.

The server can be run on any platform that can compile D using both DMD or LDC (LLVM). Which means it can be run on Windows, Linux, OSX etc. without any complications or configuration changes.

[Only registered and activated users can see links. Click Here To Register...]

Anyway, that's all for now.

Database download: (Coming with next update.)
09/10/2016 19:03 Super Aids#2
Update:
Switched from raw vibe.d tcp sockets to using my own library that wraps around vibe.d
Implement auth crypto, as well able to receive packets now.
Packet handling has been added as well started handling packet 1051.
Database integration has been done to with MySql.

Upcoming:
Login

Other:
Also added continuous-integration to the repository.

Check this for all commits:
[Only registered and activated users can see links. Click Here To Register...]
09/13/2016 23:03 Super Aids#3
Just finished auth server basic login, added dynamic database models, logging and upgraded cheetah to v0.2.4
09/14/2016 15:45 wadadli#4
Why D?
09/14/2016 16:58 Best Coder 2014#5
Quote:
Originally Posted by wadadli View Post
Why D?
Because he loves the D :rolleyes:.
09/14/2016 21:39 Super Aids#6
Quote:
Originally Posted by wadadli View Post
Why D?
To name a few things:
  • CTFE (Compile-time function evaluation)
  • Dynamic code generation at compile-time
  • Easy cross-platform development.
  • Unittesting, debugging things like asserts, contractions etc. build-in
  • Metaprogramming / Templates ... because not even C++ competes with that
  • Not forced to do oop everywhere, unlike shit like C#...
  • Concurrency and fibers are gold in D.
  • Thread-local by default, synchronization without deadlocks, thread-safety made non-complex
  • Ranges and the whole algorithm module.
  • Performance.
  • Being able to write statically typed dynamic code.
  • Native.
  • Because it's not Go.

And could go on....

If there's one language I would have chosen otherwise it would be Nim.

Quote:
Originally Posted by Best Coder 2014 View Post
Because he loves the D :rolleyes:.
Kun din <3

---
#Update:
Added type/mutability safety around a few places and created the skeleton of the world server.

[Only registered and activated users can see links. Click Here To Register...]
09/15/2016 07:59 Best Coder 2014#7
Quote:
Originally Posted by Super Aids View Post
#Update:
Added type/mutability safety around a few places and created the skeleton of the world server.

[Only registered and activated users can see links. Click Here To Register...]
Why did you suddenly add "inout" for some parameters? Inout should only be used, as far as I know, to create functions that have a return type with the same "mutability" as the inout parameter, which seems not to be what you're using it for.
09/15/2016 09:09 Super Aids#8
Quote:
Originally Posted by Best Coder 2014 View Post
Why did you suddenly add "inout" for some parameters? Inout should only be used, as far as I know, to create functions that have a return type with the same "mutability" as the inout parameter, which seems not to be what you're using it for.
inout accepts both mutable, immutable and const values for parameters.

[Only registered and activated users can see links. Click Here To Register...]

Unless there's a behavior I misunderstood.
09/15/2016 09:41 KraHen#9
Quote:
Originally Posted by Super Aids View Post
To name a few things:
  • CTFE (Compile-time function evaluation)
  • Dynamic code generation at compile-time
  • Easy cross-platform development.
  • Unittesting, debugging things like asserts, contractions etc. build-in
  • Metaprogramming / Templates ... because not even C++ competes with that
  • Not forced to do oop everywhere, unlike shit like C#...
  • Concurrency and fibers are gold in D.
  • Thread-local by default, synchronization without deadlocks, thread-safety made non-complex
  • Ranges and the whole algorithm module.
  • Performance.
  • Being able to write statically typed dynamic code.
  • Native.
  • Because it's not Go.
So... C++17?
09/15/2016 09:47 Super Aids#10
Quote:
Originally Posted by KraHen View Post
So... C++17?
No.

[Only registered and activated users can see links. Click Here To Register...]

And

[Only registered and activated users can see links. Click Here To Register...]
09/15/2016 09:49 Best Coder 2014#11
Quote:
Originally Posted by Super Aids View Post
inout accepts both mutable, immutable and const values for parameters.

[Only registered and activated users can see links. Click Here To Register...]

Unless there's a behavior I misunderstood.
Yes, but so does:
Code:
void write(T)(T value) { }
The use-case for "inout", I believe, is when you want a function whose return type "mutability" matches the mutability of a passed in parameter - aka the part in bold:
Quote:
The inout forms a wildcard that stands in for any of mutable, const, immutable, inout, or inout const. When the function is called, the inout of the return type is changed to whatever the mutable, const, immutable, inout, or inout const status of the argument type to the parameter inout was.
I don't think there's ever a reason to use "inout" on a function that doesn't have an inout(T) return type.
09/15/2016 10:17 Super Aids#12
Quote:
Originally Posted by Best Coder 2014 View Post
Yes, but so does:
Code:
void write(T)(T value) { }
The use-case for "inout", I believe, is when you want a function whose return type "mutability" matches the mutability of a passed in parameter - aka the part in bold:


I don't think there's ever a reason to use "inout" on a function that doesn't have an inout(T) return type.
Thanks, had no idea it would just accept whatever
09/15/2016 10:29 KraHen#13
Quote:
Originally Posted by Super Aids View Post
No.

[Only registered and activated users can see links. Click Here To Register...]

And

[Only registered and activated users can see links. Click Here To Register...]
This is an interesting read, however I'd like to add my few (opinion-heavy) cents on it. Overall D seems nice, I'm gonna try to make some lil thing in it to see it for myself.
  • No more header files. IMO this is a bad thing, header files are great.
  • Faster compiles. This is indeed great, but with C++ there's always the option of compilation units, or other methods to speed up compilation. Though yeah, even with these, compile times could be WAY better.
  • D STL is actually readable. IMO the C++ STL is perfectly readable (but that might be due to extensive use, and getting used to it, rather than good design)
  • GC - good for some things, bad for other things. In my area of work we despise it, great microfreezes in performance heavy games are caused by it, but again, this is a very specific example that doesn't invalidate the other cases.
  • DUB - this is great indeed
  • No more preprocessor - but I like the preprocessor, especially when targeting multiplatform :(
  • No more order of declaration - stone me but I dislike this, enforced order gives you a logical hierarchy when reading through someone elses code
  • C++ multiple inheritance - yea if you inherit more than one thing that usually is the sign of bad design
  • Streamlined operator overloading - this is such a minor thing I'm just gonna ignore it, it's nice but it doesn't matter
  • No need for C++ template heroes - really? C++17 template programming has gotten extremely simple IMO. Again, a matter of getting used to it I guess.
  • Range based iterators - I don't see how this is different than for(auto needle : haystack), might be my ignorance
09/15/2016 10:47 Super Aids#14
Quote:
Originally Posted by KraHen View Post
This is an interesting read, however I'd like to add my few (opinion-heavy) cents on it. Overall D seems nice, I'm gonna try to make some lil thing in it to see it for myself.

...
Here are a few clarifications.

Quote:
Originally Posted by KraHen View Post
  • GC - good for some things, bad for other things. In my area of work we despise it, great microfreezes in performance heavy games are caused by it, but again, this is a very specific example that doesn't invalidate the other cases.
You have control over the GC in D though and it isn't always forced upon you.

Quote:
Originally Posted by KraHen View Post
  • No more preprocessor - but I like the preprocessor, especially when targeting multiplatform :(
D has built-in stuff for things like that.

The version keyword for an example:
Code:
version (Windows) {
	void doStuffOnWindows() { ... }

	alias myFunction = doStuffOnWindows();
}
else version (Posix) {
	void doStuffOnPosix() { ... }

	alias myFunction = doStuffOnPosix();
}
else {
	static assert(0); // platform not supported ...
}

// call myFunction as you wish ...
And with DUB you can easily setup platforms and versions for different compilation configurations.

Ex. look:
[Only registered and activated users can see links. Click Here To Register...]

Quote:
Originally Posted by KraHen View Post
  • No need for C++ template heroes - really? C++17 template programming has gotten extremely simple IMO. Again, a matter of getting used to it I guess.
Yeah, but ....

[Only registered and activated users can see links. Click Here To Register...]
[Only registered and activated users can see links. Click Here To Register...]
[Only registered and activated users can see links. Click Here To Register...]

Quote:
Originally Posted by KraHen View Post
  • Range based iterators - I don't see how this is different than for(auto needle : haystack), might be my ignorance
[Only registered and activated users can see links. Click Here To Register...]
09/15/2016 11:19 Best Coder 2014#15
Quote:
Originally Posted by KraHen View Post
No more header files. IMO this is a bad thing, header files are great.
What kind of drugs are you on?

Quote:
Originally Posted by KraHen View Post
D STL is actually readable. IMO the C++ STL is perfectly readable (but that might be due to extensive use, and getting used to it, rather than good design)
There's still some abominations in the D std lib, IMO, for instance:
[Only registered and activated users can see links. Click Here To Register...]
[Only registered and activated users can see links. Click Here To Register...]
[Only registered and activated users can see links. Click Here To Register...]

(I used a URL shortener on the links, since apparently epvp removes the # part of the URL ...)

Quote:
Originally Posted by KraHen View Post
GC - good for some things, bad for other things. In my area of work we despise it, great microfreezes in performance heavy games are caused by it, but again, this is a very specific example that doesn't invalidate the other cases.
Like Bauss said, it's easy to turn off the GC in D. The hard part is using the standard library / language features without a GC (arrays/slices, strings, etc. all use the GC)

Quote:
Originally Posted by KraHen View Post
Range based iterators - I don't see how this is different than for(auto needle : haystack), might be my ignorance
It's not really any different from C++'s range-based for loop. It's just that the whole D standard library has been designed with ranges in mind from the start.