Linux version of ManaWorld0.4

Where game and project announcements are made.
User avatar
Sull
Novice
Novice
Posts: 163
Joined: 26 Apr 2004, 16:56
Location: Quebec,Montreal

Linux version of ManaWorld0.4

Post 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
User avatar
ElvenProgrammer
Founder
Founder
Posts: 2526
Joined: 13 Apr 2004, 19:11
Location: Italy
Contact:

Post 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...
User avatar
Sull
Novice
Novice
Posts: 163
Joined: 26 Apr 2004, 16:56
Location: Quebec,Montreal

.

Post 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?
User avatar
ElvenProgrammer
Founder
Founder
Posts: 2526
Joined: 13 Apr 2004, 19:11
Location: Italy
Contact:

Post 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.
User avatar
Sull
Novice
Novice
Posts: 163
Joined: 26 Apr 2004, 16:56
Location: Quebec,Montreal

.

Post by Sull »

just got connected on the server ! =)
i see blue square in a map

i dont think we can move right?
User avatar
ElvenProgrammer
Founder
Founder
Posts: 2526
Joined: 13 Apr 2004, 19:11
Location: Italy
Contact:

Post 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)
User avatar
Sull
Novice
Novice
Posts: 163
Joined: 26 Apr 2004, 16:56
Location: Quebec,Montreal

.

Post by Sull »

yea but how we move? lol
User avatar
Sull
Novice
Novice
Posts: 163
Joined: 26 Apr 2004, 16:56
Location: Quebec,Montreal

.

Post by Sull »

thats ok i just found i think my socket doesnt work at 100%
User avatar
natsuki
Novice
Novice
Posts: 105
Joined: 22 May 2004, 20:35
Contact:

Post 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..

^^
^^いつも笑顔でもっとよろこび。。^^
-- shimokawa natsuki --
User avatar
natsuki
Novice
Novice
Posts: 105
Joined: 22 May 2004, 20:35
Contact:

Post by natsuki »

it was big file because i think font freetype and masking (maybe for unix) were included^^
^^いつも笑顔でもっとよろこび。。^^
-- shimokawa natsuki --
User avatar
Sull
Novice
Novice
Posts: 163
Joined: 26 Apr 2004, 16:56
Location: Quebec,Montreal

.

Post 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?
User avatar
ElvenProgrammer
Founder
Founder
Posts: 2526
Joined: 13 Apr 2004, 19:11
Location: Italy
Contact:

Post 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...
User avatar
Sull
Novice
Novice
Posts: 163
Joined: 26 Apr 2004, 16:56
Location: Quebec,Montreal

.

Post 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
User avatar
natsuki
Novice
Novice
Posts: 105
Joined: 22 May 2004, 20:35
Contact:

Post by natsuki »

nice^^
^^いつも笑顔でもっとよろこび。。^^
-- shimokawa natsuki --
neonlight
Peon
Peon
Posts: 1
Joined: 04 Jun 2004, 09:23

Post 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
Post Reply