Changeset 25
- Timestamp:
- 11/25/05 18:02:08 (6 years ago)
- Files:
-
- trunk/raknet/Makefile (deleted)
- trunk/raknet/Makefile.linux (added)
- trunk/raknet/Makefile.win (added)
- trunk/raknet/README.txt (modified) (1 diff)
- trunk/raknet/chat.bat (added)
- trunk/raknet/chat.d (modified) (2 diffs)
- trunk/raknet/compile.sh (modified) (1 diff)
- trunk/raknet/cppSource (added)
- trunk/raknet/cppSource/README.txt (added)
- trunk/raknet/cppSource/raknet_2.412_dmc_hack_win.zip (added)
- trunk/raknet/cppSource/raknet_2.412_linux.zip (added)
- trunk/raknet/lib (added)
- trunk/raknet/lib/libraknet.a (added)
- trunk/raknet/lib/raknet.lib (added)
- trunk/raknet/line.bat (added)
- trunk/raknet/line.d (modified) (2 diffs)
- trunk/raknet/lineserver.bat (added)
- trunk/raknet/lineserver.d (modified) (1 diff)
- trunk/raknet/otherfiles (added)
- trunk/raknet/rakglue/rakbitstream.cpp (deleted)
- trunk/raknet/rakglue/rakbitstream.h (modified) (1 diff)
- trunk/raknet/rakglue/rakbitstreamglue.cpp (added)
- trunk/raknet/rakglue/rakclient.cpp (deleted)
- trunk/raknet/rakglue/rakclientglue.cpp (added)
- trunk/raknet/rakglue/rakserver.cpp (deleted)
- trunk/raknet/rakglue/rakserverglue.cpp (added)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/raknet/README.txt
r23 r25 1 1 Original Author: Clay Smith (clayasaurus@gmail.com) 2 2 3 Windows porter: mystery_guy_from_the_future_who_is_the_best_hacker_ever_and_i_owe_a_million_dollars_to_;) 3 This code works was tested both windows and linux and works. I've included the raknet source I based my code off of 4 for both windows and linux. 4 5 5 If anyone gets this code working for windows, PLEASE email me and update this repo. Thx. 6 Allows use of bitstreams and RPC, comes with a chat sample and a networked opengl 7 line drawing sample using my 2D game framework & derelict, based upon irrlicht's Raknet example. 6 8 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. 9 I started this 'binding' in order to get the C++ version of raknet to work with D. 9 10 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. 11 These should please both windows and linux users. 28 12 29 13 Have a nice day, trunk/raknet/chat.d
r23 r25 158 158 } 159 159 160 160 /* 161 161 version(Windows) 162 162 { … … 167 167 extern(C): 168 168 } 169 */ 170 171 extern(C): 172 169 173 170 174 char *gets( char *str ); trunk/raknet/compile.sh
r23 r25 1 1 make 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++ 5 5 6 6 trunk/raknet/line.d
r23 r25 161 161 int main() 162 162 { 163 ClientConnection clientConnect = new ClientConnection("1 27.0.0.1", "60000");163 ClientConnection clientConnect = new ClientConnection("192.168.2.3", "6881"); 164 164 165 165 int lineCount = 0; … … 210 210 211 211 212 version(Windows) 213 { 214 extern(Windows): 215 } 216 else 217 { 218 extern(C): 219 } 212 213 extern(C): 214 220 215 221 216 char *gets( char *str ); 222 217 int atoi( char *str ); 223 218 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 68 68 Packet * packet = null; 69 69 70 int port = 6 0000;70 int port = 6881; 71 71 72 72 if(raknet.server.start(32, 0, 0, port)) trunk/raknet/rakglue/rakbitstream.h
r23 r25 2 2 #include <stdio.h> // Printf and gets 3 3 #include <string.h> // strcpy 4 #include <raknet/RakClientInterface.h>4 #include "RakClientInterface.h" 5 5 #include "RakNetworkFactory.h" 6 6 #include "BitStream.h"
