Type player Field r Field g Field b Field x Field y Field name$ Field hndl End Type Local hh_player.player Graphics(800,600,32,2) SetBuffer(BackBuffer()) Global chose=Input$("Server(0) oder Client(1): "),stream Select chose Case 0 Local host=CreateTCPServer(3000) If host=0 Then RuntimeError("Can't open TCP Server") stream=OpenTCPStream("127.0.0.1",3000) End Select Local r=Input$("Rotanteil (0-255): ") Local g=Input$("Gruenanteil (0-255): ") Local b=Input$("Blauanteil (0-255): ") If chose=0 Then Local h_player.player=New player h_player\r=r h_player\g=g h_player\b=b h_player\name$=Input$("Name: ") h_player\hndl=stream Local local_name$=h_player\name$ Else Local temp_name$=Input$("Name: ") Local p_ip$=Input$("PartnerIP: ") stream=OpenTCPStream(p_ip$,3000) If stream=0 Then RuntimeError("Can't connect!") WriteString(stream,temp_name$) WriteInt(stream,r) WriteInt(stream,g) WriteInt(stream,b) EndIf Local timer=CreateTimer(30) Repeat Cls If chose=0 Then Local n_stream=AcceptTCPStream(host) If n_stream<>0 Then hh_player.player=New player hh_player\hndl=n_stream hh_player\name$=ReadString$(n_stream) hh_player\r=ReadInt(n_stream) hh_player\g=ReadInt(n_stream) hh_player\b=ReadInt(n_stream) h_player.player=First player For h_player.player=Each player If h_player\name$=local_name$ Then Goto scip1 WriteInt(h_player\hndl,300) WriteString(h_player\hndl,hh_player\name$) WriteInt(h_player\hndl,hh_player\r) WriteInt(h_player\hndl,hh_player\g) WriteInt(h_player\hndl,hh_player\b) .scip1 Next h_player.player=First player For h_player.player=Each player WriteInt(hh_player\hndl,300) WriteString(hh_player\hndl,h_player\name$) WriteInt(hh_player\hndl,h_player\r) WriteInt(hh_player\hndl,h_player\g) WriteInt(hh_player\hndl,h_player\b) Next EndIf If KeyDown(203)=1 Then If chose=0 Then h_player.player=First player h_player\x=h_player\x-1 Else WriteInt(stream,203) EndIf EndIf If KeyDown(205)=1 Then If chose=0 Then h_player.player=First player h_player\x=h_player\x+1 Else WriteInt(stream,205) EndIf EndIf If KeyDown(200)=1 Then If chose=0 Then h_player.player=First player h_player\y=h_player\y-1 Else WriteInt(stream,200) EndIf EndIf If KeyDown(208)=1 Then If chose=0 Then h_player.player=First player h_player\y=h_player\y+1 Else WriteInt(stream,208) EndIf EndIf h_player.player=First player If chose=0 Then For h_player.player=Each player If ReadAvail(h_player\hndl)<>0 Then Select ReadInt(h_player\hndl) Case 203 h_player\x=h_player\x-1 hh_player.player=First player For hh_player.player=Each player If hh_player\name$=local_name$ Then Goto scip2 WriteString(hh_player\hndl,h_player\name$) WriteInt(hh_player\hndl,h_player\x) WriteInt(hh_player\hndl,h_player\y) .scip2 Next Case 205 h_player\x=h_player\x+1 hh_player.player=First player For hh_player.player=Each player If hh_player\name$=local_name$ Then Goto scip3 WriteString(hh_player\hndl,h_player\name$) WriteInt(hh_player\hndl,h_player\x) WriteInt(hh_player\hndl,h_player\y) .scip3 Next Case 200 h_player\y=h_player\y-1 hh_player.player=First player For hh_player.player=Each player If hh_player\name$=local_name$ Then Goto scip4 WriteString(hh_player\hndl,h_player\name$) WriteInt(hh_player\hndl,h_player\x) WriteInt(hh_player\hndl,h_player\y) .scip4 Next Case 208 h_player\y=h_player\y+1 hh_player.player=First player For hh_player.player=Each player If hh_player\name$=local_name$ Then Goto scip5 WriteString(hh_player\hndl,h_player\name$) WriteInt(hh_player\hndl,h_player\x) WriteInt(hh_player\hndl,h_player\y) .scip5 Next End Select EndIf Next Else If ReadAvail(stream)<>0 Then Local to_find$=ReadString$(stream) Local temp_x=ReadInt(stream) Local temp_y=ReadInt(stream) For h_player.player=Each player If h_player\name$=to_find$ Then h_player\x=ReadInt(stream) h_player\y=ReadInt(stream) Exit EndIf Next EndIf EndIf ;~IDEal Editor Parameters: ;~C#Blitz Plus