Page 1 of 2

Linux version of ManaWorld0.4

Posted: 30 May 2004, 19:24
by Sull
Download
http://sull.homelinux.net/mana0.4linux.tar.gz

Screenshot
Image

New Thing Added
1-MakeFile
2-created a win2linux.h header
3-the ALFONT and the modified MASking library are included into the .tar
i created some easy script to install alfont and masking,yu need these library to compile
4-come with the map and the skin

the source just compile fine

PS.if someone could test it i will be happy
PS.if someone could help me with the win2linux header because im not sure about it

thx yu
Sull

Posted: 30 May 2004, 19:35
by ElvenProgrammer
I have to say another time: good work Sull! Maybe 3,9 MB it's a little big for the 0.0.4 version.
What's the problem in win2linux.h? Maybe I can help...

.

Posted: 30 May 2004, 19:48
by Sull
thats because he come with the masking and alfont library they are already precompiled for easy
use

im not sure about the win2linux header because i cant test it now,the socket look like to work
but i still have to verify

thats the code

Code: Select all

#include <stdio.h>
#include <stdlib.h>
#include <malloc.h>
#include <stdlib.h>
#include <malloc.h>
#include <string.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <stdio.h>
#include <unistd.h>
#include <arpa/inet.h>
#include <netdb.h>

typedef unsigned char BYTE;
typedef unsigned short WORD;
#define MAKEWORD(low,high) \
        ((WORD)(((BYTE)(low)) | ((WORD)((BYTE)(high))) << 8))
#define  closesocket(a)  close(a)
#define SOCKET int
#define SOCKET_ERROR -1
#define SOCKADDR_IN struct sockaddr_in
typedef struct	sockaddr                SOCKADDR;
typedef	SOCKADDR *      LPSOCKADDR;
#define WSACleanup() ;



typedef unsigned short                  WORD;
typedef unsigned long int LWORD;
typedef unsigned char BYTE;
#define LOBYTE(w)                       ((BYTE)          (w)            )
#define HIBYTE(w)                       ((BYTE)  (((WORD)(w)) >> 8)     )
#define LOWORD(l)                       ((WORD)          (l)            )
#define HIWORD(l)                       ((WORD) (((LWORD)(l)) >> 16)    )
#define HANDLE int
#define HANDLE int
#define PHANDLE int
#define SMALL_RECT int
//#define WORD int
#define DWORD int
#define PDWORD int
#define BOOL int
#define LPBOOL int
#define LPSTR int
#define LPTSTR int
#define LPCTSTR int
#define LPDWORD int
#define LPVOID int
#define WINAPI

#define LOBYTE(w)                       ((BYTE)          (w)            )
#define HIBYTE(w)                       ((BYTE)  (((WORD)(w)) >> 8)     )
#define LPTHREAD_START_ROUTINE void *(*)(void *)
#define CloseHandle close
thats how i define it

and for

Code: Select all

//recv_thread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE) &receive, (LPVOID) 0, 0, NULL);
line 161 map.cpp (for me)
what they used to,is it nesesary?

Posted: 30 May 2004, 20:00
by ElvenProgrammer
win2linux code seems correct

the recv_thread is used because win32 socket function "recv" is blocking so the main game loop will wait to recieve some data from the server. This is not acceptable, but using a thread recieving data will be asynchronous.

.

Posted: 30 May 2004, 20:36
by Sull
just got connected on the server ! =)
i see blue square in a map

i dont think we can move right?

Posted: 30 May 2004, 21:06
by ElvenProgrammer
the problem is if you go too far on rgith you get into the warp point so it's better to stay on the left part (on the isle)

.

Posted: 30 May 2004, 21:40
by Sull
yea but how we move? lol

.

Posted: 30 May 2004, 21:49
by Sull
thats ok i just found i think my socket doesnt work at 100%

Posted: 30 May 2004, 22:23
by natsuki
createthread is (in win32) to handle the packets better,
but i think it might block?
but i think unix has some other function for it..

^^

Posted: 30 May 2004, 23:01
by natsuki
it was big file because i think font freetype and masking (maybe for unix) were included^^

.

Posted: 31 May 2004, 01:08
by Sull
some news
1-modified some file in the tar
the map server didnt work at begin but i modified

Code: Select all

recv_thread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE) &receive, (LPVOID) 0, 0, NULL);
by

Code: Select all

pthread_create(&p_thread, NULL,receive, NULL);
and replaced the command "receive" by

Code: Select all

void *receive(void *unknown) {
2-got a new screenshot see up

3-2 meg less

the interaction with the server work nice but i dont know about the chat system
and is it normal then i move very slowly?

Posted: 31 May 2004, 06:24
by ElvenProgrammer
Good Sull, go on this way!
I'll improve the chat system in the next realease.
Yes it's normal that you move very slow because the server on my pc is running only for testing purposes. My pc as a slow connection and is already running a web server and a file sharing apllication.

For the moment that's the max I can offer, when I'll have a playable version of the client the things will change or if someone of you has soma spare connection to share...

.

Posted: 31 May 2004, 22:12
by Sull
resorved a error on line 156,71 and 72 from game.cpp
replacing

Code: Select all

len = MAKEWORD(data+2, data+3);
by

Code: Select all

len = MAKEWORD(*(int *)data+2, *(int *)data+3);
and the use of textprintf are deprecrated and beeing replaced by textprintf_ex

Code: Select all

textprintf(buffer, font, 0, 0, makecol(255,255,255), "%i %i %i %i", x, y, map_x, map_y);
if(speech!=NULL)textprintf(buffer, font, 10, makecol(255,255,255), 0, "%s", speech);
by

Code: Select all

textprintf_ex(buffer, font, 0, 0, makecol(255,255,255), 0, "%i %i %i %i", x, y, map_x, map_y);
if(speech!=NULL)textprintf_ex(buffer, font, 0, 10, makecol(255,255,255), 0, "%s", speech);
and i just started to code on the sound system and searching some sound

Posted: 31 May 2004, 22:54
by natsuki
nice^^

Posted: 04 Jun 2004, 09:25
by neonlight
Hey Guys,
i read your post on the gentoo forums, Sull, im interested in helping you, if needed. I did some little c++ programming on win32 earlier, now converted to linux but had nothing to do with programming so far. I read your source a little, i think with a little time to get used to it, i could understand it, perhaps it would be good, if you explain it to me, im finding it very hard to read others code. At the moment, i have spare time in the evening (im from germany, dont know where you guys come from), but in about a month or two, theres plenty of time id like to contribute to this project.
I will study your code more detailed and follow the discussion to get an overview, if i can manage the work. Id like to be glad, if i could help you with this project.
My email address is neonlight (at) imap (dot) cc.

cya neon