MSCPP Beta 0.1

Mirage Source ported into C++

Re: MSCPP Beta 0.1

Postby Dragoons Master » Wed Aug 13, 2008 6:58 am

I think this is more like a good way for people who wants to learn C++, to learn it. If they know the code in VB6, they'll surely understand it in this conversion. The only "complicated" things here are the inheritances, but they just make the code cleaner simpler. I think you have to agree with me at this point xD
http://www.blackages.com.br
Image
Dave wrote:
GameBoy wrote:www.FreeMoney.com
I admit I clicked. I immediately closed upon realizing there was, in fact, no free money.
Robin wrote:I love you and your computer.Marry me.
User avatar
Dragoons Master
Pro
 
Posts: 493
Joined: Mon May 29, 2006 3:26 pm
Location: São Paulo, Brasil
Google Talk: blackagesbr@gmail.com

Re: MSCPP Beta 0.1

Postby DarkX » Tue Sep 02, 2008 3:37 pm

Hey Dragoon, when you get this more thoroughly working in full 2d I will send you my code, from a scraped engine I was writting in C++ I made 2 different versions, one with 2d characters on 3d backgrounds and the other one was like FF7 - 9 prerendered 2d backgrounds with 3d characters, but it is not MS based at all so there would be some major conversion needed.
shut your manpleaser
http://www.kazmostech.com
User avatar
DarkX
Knowledgeable
 
Posts: 346
Joined: Tue May 30, 2006 1:42 am
Location: Florida

Re: MSCPP Beta 0.1

Postby rydinophor » Sun Feb 01, 2009 10:08 pm

i tested it and i get an error on the player id after i login.
rydinophor
Newbie
 
Posts: 8
Joined: Thu Jan 22, 2009 1:20 am

Re: MSCPP Beta 0.1

Postby DarkC » Mon Feb 09, 2009 3:12 am

Whenever I try logging in with my character I created, VB6 just gives me an error on the client. :shock: Anyone know why? I'd like to try to get the C++ version of this to work...
User avatar
DarkC
Regular
 
Posts: 55
Joined: Tue Jun 17, 2008 12:39 pm

Re: MSCPP Beta 0.1

Postby Dragoons Master » Sun Feb 15, 2009 9:10 pm

WARNING: This is NOT a release yet, it is just a preview, since I have the code and it compiles, but does NOT work yet.

¬¬
I said this is not a working version.
I will re-make the hole networking when I have the time.
http://www.blackages.com.br
Image
Dave wrote:
GameBoy wrote:www.FreeMoney.com
I admit I clicked. I immediately closed upon realizing there was, in fact, no free money.
Robin wrote:I love you and your computer.Marry me.
User avatar
Dragoons Master
Pro
 
Posts: 493
Joined: Mon May 29, 2006 3:26 pm
Location: São Paulo, Brasil
Google Talk: blackagesbr@gmail.com

Re: MSCPP Beta 0.1

Postby Dragoons Master » Fri Feb 27, 2009 8:21 pm

I'm re-developing the network :D
It's going great.
I'm on a little doubt about how I'll handle more than 64 connections xD but it's going great.
I think I'll have a releasable version soon ^^
http://www.blackages.com.br
Image
Dave wrote:
GameBoy wrote:www.FreeMoney.com
I admit I clicked. I immediately closed upon realizing there was, in fact, no free money.
Robin wrote:I love you and your computer.Marry me.
User avatar
Dragoons Master
Pro
 
Posts: 493
Joined: Mon May 29, 2006 3:26 pm
Location: São Paulo, Brasil
Google Talk: blackagesbr@gmail.com

Re: MSCPP Beta 0.1

Postby Doomy » Fri Feb 27, 2009 8:47 pm

awesome
╔╗╔═╦═╦══╦═══╗
║║║║║║║╔╗║╔═╗║
║║║║║║║╚╝║║║║║
║╚╣║║║║╔╗║╚═╝║
╚═╩╩═╩╩╝╚╩═══╝


╔╦═╦╦════╦═══╗
║║║║╠═╗╔═╣╔══╝
║║║║║║║║╚═╗
║║║║║║║║╔═╝
╚═╩═╝╚╝╚╝ ?
User avatar
Doomy
Persistant Poster
 
Posts: 633
Joined: Fri Aug 15, 2008 3:11 pm

Re: MSCPP Beta 0.1

Postby Dragoons Master » Mon Mar 02, 2009 1:07 pm

It's going great! I just need to make a better client side buffer to handle the almost 3kbs of the mapdata packet xD
Then I'll test a few things more and release beta 0.2, SEMI-WORKING version ^^
http://www.blackages.com.br
Image
Dave wrote:
GameBoy wrote:www.FreeMoney.com
I admit I clicked. I immediately closed upon realizing there was, in fact, no free money.
Robin wrote:I love you and your computer.Marry me.
User avatar
Dragoons Master
Pro
 
Posts: 493
Joined: Mon May 29, 2006 3:26 pm
Location: São Paulo, Brasil
Google Talk: blackagesbr@gmail.com

Re: MSCPP Beta 0.1

Postby Pbcrazy » Mon Mar 02, 2009 10:25 pm

sweet! im trying to learn C++ at the moment, i'm curious as to how this would work.
User avatar
Pbcrazy
Pro
 
Posts: 597
Joined: Tue Apr 22, 2008 2:15 am

Re: MSCPP Beta 0.1

Postby Dragoons Master » Tue Mar 03, 2009 12:41 am

It is almost working. I can send/receive data, but not when the packets are too large. MapData is fucking things up xD But I'll fix it soon.
http://www.blackages.com.br
Image
Dave wrote:
GameBoy wrote:www.FreeMoney.com
I admit I clicked. I immediately closed upon realizing there was, in fact, no free money.
Robin wrote:I love you and your computer.Marry me.
User avatar
Dragoons Master
Pro
 
Posts: 493
Joined: Mon May 29, 2006 3:26 pm
Location: São Paulo, Brasil
Google Talk: blackagesbr@gmail.com

Re: MSCPP Beta 0.1

Postby Tony » Tue Mar 03, 2009 5:56 am

What are you using for network communication?
Image
User avatar
Tony
Persistant Poster
 
Posts: 860
Joined: Wed Nov 29, 2006 11:25 pm
Location: Ayer

Re: MSCPP Beta 0.1

Postby Lea » Tue Mar 03, 2009 6:00 am

pull the maps over ftp/http
User avatar
Lea
Community Leader
 
Posts: 1762
Joined: Sun May 28, 2006 10:29 pm
Location: Salt Lake City, UT, USA
Google Talk: Darunada@gmail.com

Re: MSCPP Beta 0.1

Postby Dragoons Master » Tue Mar 03, 2009 12:17 pm

Tony wrote:What are you using for network communication?

WinSocket2.2, tcp
Lea wrote:pull the maps over ftp/http
Not a bad idea, but I'm trying to make it simple. If you don't have a web site then I'll be totally screwed. MS is supposed to be simple(no offense). All it's needed it a better buffering system xD.
http://www.blackages.com.br
Image
Dave wrote:
GameBoy wrote:www.FreeMoney.com
I admit I clicked. I immediately closed upon realizing there was, in fact, no free money.
Robin wrote:I love you and your computer.Marry me.
User avatar
Dragoons Master
Pro
 
Posts: 493
Joined: Mon May 29, 2006 3:26 pm
Location: São Paulo, Brasil
Google Talk: blackagesbr@gmail.com

Re: MSCPP Beta 0.1

Postby Dragoons Master » Tue Mar 03, 2009 2:13 pm

FIXEEEEEED!!!!!!!
IT'S ALIVE!!!!!!!!!!!!!!!
DAMN YOU VERRIGAN xD
Pay attention when you code!!!(jk)
AddToBuffer function is the bitch!
It was:
Call CopyMemory(tBytes(aLen(Buffer)), Additional(0), aLen(Additional))
and should be:
Call CopyMemory(tBytes(aLen(Buffer)), Additional(0), ByteLen)

AAAAAAAAAAA, I'M YELLING OF HAPPINESS!
Image
Not a verry nice photo, but it passes the idea...
http://www.blackages.com.br
Image
Dave wrote:
GameBoy wrote:www.FreeMoney.com
I admit I clicked. I immediately closed upon realizing there was, in fact, no free money.
Robin wrote:I love you and your computer.Marry me.
User avatar
Dragoons Master
Pro
 
Posts: 493
Joined: Mon May 29, 2006 3:26 pm
Location: São Paulo, Brasil
Google Talk: blackagesbr@gmail.com

Re: MSCPP Beta 0.1

Postby Robin » Tue Mar 03, 2009 2:17 pm

Dragoons Master wrote:FIXEEEEEED!!!!!!!
IT'S ALIVE!!!!!!!!!!!!!!!
DAMN YOU VERRIGAN xD
Pay attention when you code!!!(jk)
AddToBuffer function is the bitch!
It was:
Call CopyMemory(tBytes(aLen(Buffer)), Additional(0), aLen(Additional))
and should be:
Call CopyMemory(tBytes(aLen(Buffer)), Additional(0), ByteLen)

AAAAAAAAAAA, I'M YELLING OF HAPPINESS!
Image
Not a verry nice photo, but it passes the idea...


Fuuuuck. This explains why my code kept on fucking up at AddtoBuffer. Fuck. Ah, christ.

I'll just use Dugor's buffer class instead. Verrigan's system was far too confusing.

Glad you got it working though. I spent ages trying to found out why my aLen function kept erroring there.
Robin:
Why aren't maps and shit loaded up in a dynamic array?
Jacob:
the 4 people that know how are lazy
Robin:
Who are those 4 people?
Jacob:
um
you, me, and 2 others?


Image
User avatar
Robin
Submit-Happy
 
Posts: 2768
Joined: Fri Jun 16, 2006 7:01 am
Location: Yorkshire, UK

Re: MSCPP Beta 0.1

Postby Dragoons Master » Tue Mar 03, 2009 2:32 pm

The real error is the CopyMemory. It tried to copy too much memory to tBytes, but tBytes is defined as tBytes(tLen - 1), so we don't have that much memory allocated, and then VB6 just bugs like hell.
http://www.blackages.com.br
Image
Dave wrote:
GameBoy wrote:www.FreeMoney.com
I admit I clicked. I immediately closed upon realizing there was, in fact, no free money.
Robin wrote:I love you and your computer.Marry me.
User avatar
Dragoons Master
Pro
 
Posts: 493
Joined: Mon May 29, 2006 3:26 pm
Location: São Paulo, Brasil
Google Talk: blackagesbr@gmail.com

Re: MSCPP Beta 0.1

Postby Robin » Tue Mar 03, 2009 2:46 pm

Dragoons Master wrote:The real error is the CopyMemory. It tried to copy too much memory to tBytes, but tBytes is defined as tBytes(tLen - 1), so we don't have that much memory allocated, and then VB6 just bugs like hell.


xD

Ah well, Dugor's code is so much easier to understand.
Robin:
Why aren't maps and shit loaded up in a dynamic array?
Jacob:
the 4 people that know how are lazy
Robin:
Who are those 4 people?
Jacob:
um
you, me, and 2 others?


Image
User avatar
Robin
Submit-Happy
 
Posts: 2768
Joined: Fri Jun 16, 2006 7:01 am
Location: Yorkshire, UK

Re: MSCPP Beta 0.1

Postby Tony » Tue Mar 03, 2009 10:26 pm

Doesn't Winsock handle one request at a time?

and UGH byte arrays.. looks so confusing.
Image
User avatar
Tony
Persistant Poster
 
Posts: 860
Joined: Wed Nov 29, 2006 11:25 pm
Location: Ayer

Re: MSCPP Beta 0.1

Postby Robin » Tue Mar 03, 2009 10:31 pm

Tony wrote:Doesn't Winsock handle one request at a time?

and UGH byte arrays.. looks so confusing.


It's really not.

You use the functions to add bytes, integers, strings etc. to the array, then peel them off in the opposite order in the server.

Easy shit.
Robin:
Why aren't maps and shit loaded up in a dynamic array?
Jacob:
the 4 people that know how are lazy
Robin:
Who are those 4 people?
Jacob:
um
you, me, and 2 others?


Image
User avatar
Robin
Submit-Happy
 
Posts: 2768
Joined: Fri Jun 16, 2006 7:01 am
Location: Yorkshire, UK

Re: MSCPP Beta 0.1

Postby Tony » Tue Mar 03, 2009 10:44 pm

Robin wrote:
Tony wrote:Doesn't Winsock handle one request at a time?

and UGH byte arrays.. looks so confusing.


It's really not.

You use the functions to add bytes, integers, strings etc. to the array, then peel them off in the opposite order in the server.

Easy shit.


Yeah I understood a bit of that part by reading up on Verrigan's tutorial but took a peek at his code and his functions
I did not understand one bit of it.

Okay his code here

Code: Select all
nLen = GetIntegerFromBuffer(Buffer, True)
    nBytes = GetFromBuffer(Buffer, nLen, True)
    Sex = GetByteFromBuffer(Buffer, True)
    Class = GetByteFromBuffer(Buffer, True)
    CharNum = GetByteFromBuffer(Buffer, True)


If there types of bytes in order, and it took that byte from the order, how does it know what's what?
Image
User avatar
Tony
Persistant Poster
 
Posts: 860
Joined: Wed Nov 29, 2006 11:25 pm
Location: Ayer

Re: MSCPP Beta 0.1

Postby Robin » Tue Mar 03, 2009 10:54 pm

Tony wrote:
Robin wrote:
Tony wrote:Doesn't Winsock handle one request at a time?

and UGH byte arrays.. looks so confusing.


It's really not.

You use the functions to add bytes, integers, strings etc. to the array, then peel them off in the opposite order in the server.

Easy shit.


Yeah I understood a bit of that part by reading up on Verrigan's tutorial but took a peek at his code and his functions
I did not understand one bit of it.

Okay his code here

Code: Select all
nLen = GetIntegerFromBuffer(Buffer, True)
    nBytes = GetFromBuffer(Buffer, nLen, True)
    Sex = GetByteFromBuffer(Buffer, True)
    Class = GetByteFromBuffer(Buffer, True)
    CharNum = GetByteFromBuffer(Buffer, True)


If there types of bytes in order, and it took that byte from the order, how does it know what's what?


The first line calculates the length of the buffer, then it gets the Sex by reading the first byte in the buffer, and removes it. Then, when it get's the class, it'll be the first byte in the buffer.

"It" doesn't know what's what, but the person who programs the packet knows what order the data is in.
Robin:
Why aren't maps and shit loaded up in a dynamic array?
Jacob:
the 4 people that know how are lazy
Robin:
Who are those 4 people?
Jacob:
um
you, me, and 2 others?


Image
User avatar
Robin
Submit-Happy
 
Posts: 2768
Joined: Fri Jun 16, 2006 7:01 am
Location: Yorkshire, UK

Re: MSCPP Beta 0.1

Postby Dragoons Master » Tue Mar 03, 2009 11:16 pm

Robin wrote:"It" doesn't know what's what, but the person who programs the packet knows what order the data is in.

Just like you where doing with Parse().
http://www.blackages.com.br
Image
Dave wrote:
GameBoy wrote:www.FreeMoney.com
I admit I clicked. I immediately closed upon realizing there was, in fact, no free money.
Robin wrote:I love you and your computer.Marry me.
User avatar
Dragoons Master
Pro
 
Posts: 493
Joined: Mon May 29, 2006 3:26 pm
Location: São Paulo, Brasil
Google Talk: blackagesbr@gmail.com

Re: MSCPP Beta 0.1

Postby Tony » Tue Mar 03, 2009 11:19 pm

Oh shit. For some reason I was thinking the packets would look all crambed together..

Then I remembered they look like 2 3 45 32 or something.

[edit] Wait now I'm confused.. so basically doing byte arrays, we receive all the data as bytes
then we change them accordingly when we receive them?
Image
User avatar
Tony
Persistant Poster
 
Posts: 860
Joined: Wed Nov 29, 2006 11:25 pm
Location: Ayer

Re: MSCPP Beta 0.1

Postby Robin » Tue Mar 03, 2009 11:58 pm

Tony wrote:Oh shit. For some reason I was thinking the packets would look all crambed together..

Then I remembered they look like 2 3 45 32 or something.

[edit] Wait now I'm confused.. so basically doing byte arrays, we receive all the data as bytes
then we change them accordingly when we receive them?


The data is stored in an array of bytes.

The packet sends the entire array. When the server recieves the array, it reads the start of the array to find out how long the packet is, then it takes the data you put into the array, out of the array, piece by piece. 'AddIntegerToBuffer' lets you place an 'Integer' variable into the byte array. 'GetIntegerFromBuffer' reads the integer you put in.
Robin:
Why aren't maps and shit loaded up in a dynamic array?
Jacob:
the 4 people that know how are lazy
Robin:
Who are those 4 people?
Jacob:
um
you, me, and 2 others?


Image
User avatar
Robin
Submit-Happy
 
Posts: 2768
Joined: Fri Jun 16, 2006 7:01 am
Location: Yorkshire, UK

Re: MSCPP Beta 0.1

Postby Dragoons Master » Wed Mar 04, 2009 1:58 am

There are two headers I'm using. The packet length and the packet id(playerhp, attacknpc, etc(enum)). So a valid packet would be(IN DEC):
5 2 3 'h' 'i' '!'
That can be interpreted as a packet with 5 bytes, with the id = 2(can be a msg of anything) and a string with 3 bytes(" 3 'h' 'i' '!' " can indicate a string of 3 characters). The number 3 means that the next 3 bytes are the string I want to read. So strings have variable sizes. 2+lenght(string) bytes.
http://www.blackages.com.br
Image
Dave wrote:
GameBoy wrote:www.FreeMoney.com
I admit I clicked. I immediately closed upon realizing there was, in fact, no free money.
Robin wrote:I love you and your computer.Marry me.
User avatar
Dragoons Master
Pro
 
Posts: 493
Joined: Mon May 29, 2006 3:26 pm
Location: São Paulo, Brasil
Google Talk: blackagesbr@gmail.com

PreviousNext

Return to MSCPP 0.1 Beta

Who is online

Users browsing this forum: No registered users and 1 guest

cron