Changeset 25

Show
Ignore:
Timestamp:
11/25/05 18:02:08 (6 years ago)
Author:
clayasaurus
Message:

raknet now works on windows, sources, minibugfix

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/raknet/README.txt

    r23 r25  
    11Original Author: Clay Smith (clayasaurus@gmail.com) 
    22 
    3 Windows porter: mystery_guy_from_the_future_who_is_the_best_hacker_ever_and_i_owe_a_million_dollars_to_;) 
     3This code works was tested both windows and linux and works. I've included the raknet source I based my code off of  
     4for both windows and linux. 
    45 
    5 If anyone gets this code working for windows, PLEASE email me and update this repo. Thx. 
     6Allows use of bitstreams and RPC, comes with a chat sample and a networked opengl  
     7line drawing sample using my 2D game framework & derelict, based upon irrlicht's Raknet example. 
    68 
    7 Basic Raknet bindings for linux. Allows use of bitstreams and RPC, comes with a chat sample and a networked opengl  
    8 line drawing sample using my 2D game framework for warbots & derelict, based upon irrlicht's Raknet example. 
     9I started this 'binding' in order to get the C++ version of raknet to work with D.  
    910 
    10 I started this 'binding' in order to get the C++ version of raknet to work with D. I got it to work with D on  
    11 linux, however, to my dismay, I learned that it is /impossible/ to get it to work for the windows version. Here's  
    12 the list of things I have tried, and solutions that might be available for the future. 
    13  
    14 What doesn't work... 
    15 1) Building Raknet with DMC (not supported)  
    16 2) using coff2omf to convert microsoft lib to D's lib format... doesn't work. 
    17 3) using cygwin with gdc, too many issues, plus slow as molasses, and not windows native. 
    18  
    19  
    20 Future solutions... 
    21 1) If anyone can figure out how to load the raknet DLL/shared lib at runtime 
    22 2) If an alternate D compiler is available for windows that has a linker that can link either Microsofts .lib files  
    23 or GCC's .a files 
    24 3) Raknet decides to support DMC compiler 
    25  
    26 Anyways, the bindings are very straight forward and as close to the Raknet metal as possible. I'm not going to use  
    27 them until I or someone else figures out how to get it to work for windows.  
     11These should please both windows and linux users. 
    2812 
    2913Have a nice day, 
  • trunk/raknet/chat.d

    r23 r25  
    158158} 
    159159 
    160  
     160/* 
    161161version(Windows) 
    162162{ 
     
    167167        extern(C): 
    168168} 
     169*/ 
     170 
     171extern(C): 
     172 
    169173 
    170174char *gets( char *str ); 
  • trunk/raknet/compile.sh

    r23 r25  
    11make 
    2 ./build chat.d -CFPATH/etc/ -g -Rn -full -cleanup -debug -Llibrakglue.a -L../Lib/linux/libraknet.a -L-lstdc++ 
    3 ./build lineserver.d -L-ldl -CFPATH/etc/ -g -Rn -full -cleanup -debug -Llibrakglue.a -L../Lib/linux/libraknet.a -L-lstdc++ 
    4 ./build line.d -L-ldl -CFPATH/etc/ -g -Rn -full -cleanup -debug -Llibrakglue.a -L../Lib/linux/libraknet.a -L-lstdc++   
     2./build chat.d -CFPATH/etc/ -g -Rn -full -cleanup -debug -Llibrakglue.a -Llibraknet.a -L-lstdc++ 
     3./build lineserver.d -L-ldl -CFPATH/etc/ -g -Rn -full -cleanup -debug -Llibrakglue.a -L/libraknet.a -L-lstdc++ 
     4./build line.d -L-ldl -CFPATH/etc/ -g -Rn -full -cleanup -debug -Llibrakglue.a -Llibraknet.a -L-lstdc++   
    55 
    66 
  • trunk/raknet/line.d

    r23 r25  
    161161int main() 
    162162{ 
    163    ClientConnection clientConnect = new ClientConnection("127.0.0.1", "60000"); 
     163   ClientConnection clientConnect = new ClientConnection("192.168.2.3", "6881"); 
    164164 
    165165   int lineCount = 0; 
     
    210210 
    211211 
    212 version(Windows) 
    213 
    214     extern(Windows): 
    215 
    216 else 
    217 
    218     extern(C): 
    219 
     212 
     213extern(C): 
     214 
    220215 
    221216char *gets( char *str ); 
    222217int atoi( char *str ); 
    223218 
    224 void PrintMessage(char *input, int numberOfBitsOfData, PlayerID sender) 
    225 
    226   printf("%s\n",input); 
    227  
    228   if (raknet.server.isServer()) 
    229   { 
    230      raknet.server.RPC("PrintMessage", input, numberOfBitsOfData, PacketPriority.HIGH_PRIORITY, PacketReliability.RELIABLE_ORDERED, 0, sender, true, false); 
    231   } 
    232 
    233  
    234  
    235  
     219 
     220 
     221 
  • trunk/raknet/lineserver.d

    r23 r25  
    6868   Packet * packet = null; 
    6969     
    70    int port = 60000
     70   int port = 6881
    7171 
    7272   if(raknet.server.start(32, 0, 0, port))  
  • trunk/raknet/rakglue/rakbitstream.h

    r23 r25  
    22#include <stdio.h> // Printf and gets 
    33#include <string.h> // strcpy 
    4 #include <raknet/RakClientInterface.h> 
     4#include "RakClientInterface.h" 
    55#include "RakNetworkFactory.h" 
    66#include "BitStream.h"