XNET Multiplayer Network Engine

Blitz3D Forums/Blitz3D Userlibs/XNET Multiplayer Network Engine

Hi Blitzers,

XNET for BlitzBasic3D and Blitz+ you can download Now !

If you Interrest on it please feel free to try it or use it for noncommercial stuff for free.

More infos and a Playe for Questions about XNET you can find at www.c64.feuerware.com



DOWNLOAD XNET

Sincere regards C64

The link supplied to your web site does not work. Also, with the amount of hacking that has taken place on the blitzbasic site recently, I am very weary of running anything without being totally sure it is authentic. Unfortunately most users are going to feel the same way.

Hi CodeGit,

The link to my website is working !

Or did you mean there are some Security fails ?!.

(sry my english isn't the best ! )

regars C64

Downloaded the rar file from C64 site and unpacked it.. No virus detected in the contents.

C64. If you add more B3D sample code , ill buy the commercial version. I would like to see sample client and host. Currently the package contains just client example for local host.

Hehe :) Thx RifRaf,

No problem i write more Samples but this one you can use as Host and Client i write my NetStuff codes allways in this way that you can use one programm as host or as client, try it. Start it 1 times it will be a Host and all other next opened Instances from you APP would be connect as Client.

But the next days i think i can put some more Examples on my Website.

Sincere regards C64.

Hi,

Downloded.
Very simple to use and fast.Good job. ;-)

JP

Hi C64

The link is working now. I will take a look as I am interested in a solid fast network package.

@ZJP and CodeGit sounds good Thx !

;-)

Looking for Blitz3d examples of these commands:

XNETCreateMessage%(object%)
XNETSendMessage%(messageobject%)
XNETSendSecureMessage%(messageobject%)
XNETMessageObject%(messageobject%)

JP

Hi ZJP,

I try it to put a Message example today on my Forum, but it looks that something don't work atm. Sry ! I will Fix this !!

regards C64

I think i've found a mistake in your .decls:
XNETSendSeureMessage%(messageobject%):"XNETSendSecureMessage"

Might be
XNETSendSecureMessage%(messageobject%):"XNETSendSecureMessage"


Hi ZJP,

its done :)

Oh oh hard work, i think in the next time it is better when i don't release anythig if i feel me tired. I hope all bugs are kill'd now ! The Samples run without any error.

@LO-TEKK :) thx

please download the V1.023r !!

Some lines code ....
(change nick with "/nick NICKNAME")
Graphics 500,600,32,2

SetBuffer (BackBuffer())

XNETConfigServerDialog ("www.c64.feuerware.com","xnet/scripts/hostmanager") 

Global  Session
Global  Timer		= CreateTimer (30)
Global  Name$		="No Named"+MilliSecs()								
Global  InputLine$	
Global  LocalObject 
Global  rY =0
Global  NetSession = False ; TRUE FOR REGISTER HOST OR JOIN AVAIBLE XNET-CHATS
				

Port=52001
IP$ ="127.0.0.1"

If NETSESSION=True 

			  XNETGetHostList ()

		While XNETHostFromList () And Session=0

		IP$		=XNETHostIP	 	()
		Port	=XNETHostPort	()
		Info	=XNETHostInfo   ()
	
						
		Wend
		
EndIf 

	   Session=XNETJoinSession (IP,Port)	
		
		AppTitle ("CLIENT")

If Not Session 
		AppTitle ("HOST")
	   Session=XNETHostSession  (Port)
	
If NETSESSION=True XNETRegisterHost (Session,"XNET-TEST-CHAT")

EndIf 				
	
Const name_slot=1
Const chat_slot=2
			
	
If Not Session RuntimeError    ("ANYTHING WAS WRONG !!!")		

LocalObject = XNETCreateObject (Session)
	  		  XNETSetString    (LocalObject,name_slot,Name)

							
;__________________________________________________________________________________

While Not KeyHit (1)
		
		Cls
		

XNETUpdateSession  (Session)
		
		ControlChat()
		ControlXNET()

		
		
		Flip 0


WaitTimer (timer)

Wend 

;__________________________________________________________________________________


Function ControlChat ()


	Local char=GetKey()



		If char

		Select char

			Case 13
			
			
			If Not Instr (Mid(Lower(inputline),1,5),"/nick")
						 
				If Trim (inputline)>"" addline Name+"> "+inputline
			
				MSG=XNETCreateMessage 		(LocalObject		  		  )
					XNETSetString 	  		(MSG,chat_slot,inputline	  )
					XNETSendSecureMessage   (MSG,0  			  		  )

				Else

			
				   NEWNAME$ =Trim(Mid (inputline,7))
				If NEWNAME>""
				  
				   inputline= "CHANGED NICK TO >"+NEWNAME 
				   ADDLINE NAME+" >"+inputline				    
				   Name=NewName
				
				EndIf
				
				MSG=XNETCreateMessage 		(LocalObject		  		  )
					XNETSetString 	  		(MSG,chat_slot,inputline	  )
					XNETSendSecureMessage   (MSG,0  			  		  )
			
			
					XNETSetString 	  		(LocalObject,name_slot,name	  )
				
				EndIf 
			
			
				inputline=""
	
	
	
	
			Case 32
			inputline=inputline+" "
			
	
	
	
			Case 8

			inputline=Mid(inputline,1,Len(inputline)-1)
			
	
	
	
			Default 
	
			inputline=inputline+Trim (Chr(char))
	
			End Select 

		EndIf
		

	        inputline_$=Inputline


  If MilliSecs() Mod 500 < 300 inputline_=inputline+"_"

  Color 200,200,200

  Rect 2,GraphicsHeight ()-22,GraphicsWidth ()-4,1

  Color 250,250,250

  Text 2,GraphicsHeight ()-20,inputline_	




If ry =>  600 chat.row = First row : Delete chat.row 
ry = 2

For chat.row = Each row
If ry<580 Text 2,ry,chat\txt
ry=ry+20

Next



End Function 


Function addLine (txt$)

	If Trim (txt) >""
	Chat.row=New row
	chat\txt=txt
	EndIf 

End Function 

Global Chat.row
		
Type row
Field txt$
End Type 

;__________________________________________________________________________________

Function ControlXnet()


			 XNETGetObjects  (Session)
  				
   			 While XNETCountList    () 

					OBJ=XNETObjectFromList ()
	
				If XNETObjectRemote   (OBJ)
				
					If XNETGetObjectState (Obj) = 1
				
					ADDLINE XNETGetString (obj,name_slot)+" has joined"
				
				EndIf 
	
				EndIf 
					
					 

			 Wend
					
					
						
			 XNETGetMessages (Session)
   				
   			 While XNETCountList    () 

					 Msg	=XNETObjectFromList  (	 )			 
				   Sender	=XNETMessageObject	 (MSG)
					
			 MSGString$		=XNETGetString 		 (Sender,name_slot)+">"
								
			 MSGString =MsgString+ XNETGetString (MSG,chat_slot	   )
			 		 
			 ADDLINE MSGSTRING
	
		     Wend
		


End Function




Sincere Regards

hi C64, i searching for something for use multiplayer mode in my racecar game....

i want to have multiplayer LAN, IP, and online server...

the game use ode physics.. and i have like 12 cars for race.

can works your xnet for my game?, i download the demo, but, you don't have a demo using something like cars to see how works?

regards..
santiago

blitz forum for the car game :
http://blitzbasic.com/Community/posts.php?topic=83490

Hi Latatoy,

I think it's possible, i have test this with 40 Objects (20 for each session 2 Sessions = 40 Objects ) in 3D where each Object sends PosX,PosY,PosZ,Pitch,Yaw,Roll without any timingstuff i think this is a very imortent part for NetGames but this is only a Example how XNET can works for you. So i think i don't need this part in a Example ;) .

Look at my website, i hope you can and you want use XNET !!!

3D - Sample

http://www.c64.feuerware.com/page/?q=node/98

Holocube nE. this use XNET.

http://www.c64.feuerware.com/page/?q=node/76



Sincere regards C64

(Sry for my Bad English, i hope you understand all)