2 registered members (AndrewAMD, Quad),
843
guests, and 1
spider. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: [GSTNet] 0.5.9 released
[Re: Slin]
#133889
08/06/07 20:21
08/06/07 20:21
|
Joined: Jan 2003
Posts: 4,305
Damocles
Expert
|
Expert
Joined: Jan 2003
Posts: 4,305
|
I understand, you want to see what the dll is capable of handeling... Always good, to check the funtionality and post probable bugs.
Last edited by Damocles; 08/06/07 20:22.
|
|
|
Re: [GSTNet] 0.5.9 released
[Re: Slin]
#133890
08/06/07 22:29
08/06/07 22:29
|
Joined: Jun 2001
Posts: 1,004 Dossenbach
nfs42
OP
Serious User
|
OP
Serious User
Joined: Jun 2001
Posts: 1,004
Dossenbach
|
hi slin,
i cannot confirm that with 0.5.9. but there's still some other issue with GSTNet_ent_remove, so i have a closer look.
Andreas GSTools - Home of GSTScript 0.9.8: lua scripting for A6/7/8 GSTNet 0.7.9.20: network plugin for A6/7/8 GSTsqlite 1.3.7: sql database plugin for A6/7/8 3DGS Codebase: 57 snippets || 3DGS Downloads: 248 files
|
|
|
Re: [GSTNet] 0.5.9 released
[Re: Samb]
#133892
08/09/07 22:14
08/09/07 22:14
|
Joined: Jun 2001
Posts: 1,004 Dossenbach
nfs42
OP
Serious User
|
OP
Serious User
Joined: Jun 2001
Posts: 1,004
Dossenbach
|
Andreas GSTools - Home of GSTScript 0.9.8: lua scripting for A6/7/8 GSTNet 0.7.9.20: network plugin for A6/7/8 GSTsqlite 1.3.7: sql database plugin for A6/7/8 3DGS Codebase: 57 snippets || 3DGS Downloads: 248 files
|
|
|
Re: [GSTNet] 0.5.9 released
[Re: Samb]
#133894
08/09/07 22:50
08/09/07 22:50
|
Joined: May 2005
Posts: 2,713 Lübeck
Slin
Expert
|
Expert
Joined: May 2005
Posts: 2,713
Lübeck
|
Da du (nfs42) mich darum batest ihn zu posten: Code:
var video_mode = 6; var video_screen = 2;
var fps_max = 60;
font Arial = "arial",1,20;
bmap Mauszeiger = <Mouse.tga>; bmap = DrawPart_bmap = <PointGelb.tga>;
var TempPos[3];
string Temp_str1[100]; string Client_Nick[100]; string ConnectedNicks;
string Chat_input[100]; string Chat_send_str; string Chat_str1; string Chat_str2; string Chat_str3; string Chat_str4; string Chat_str5; string Chat_str6; string Chat_str7; text ChatDisplay { red = 0; green = 0; blue = 0; font = Arial; strings = 8; string = Chat_str1,Chat_str2,Chat_str3,Chat_str4,Chat_str5,Chat_str6,Chat_str7,Chat_input; }
plugindir = "."; include <GSTNet.wdl>;
function main() { vec_set(screen_color,vector(255,255,255)); vec_set(sky_color,vector(255,255,255)); Menu(); level_load(""); }
function NewClient_event(vType,sMessage) { str_cat(ConnectedNicks,sMessage); str_cat(ConnectedNicks,"\n"); GSTNet_SendString(0,"ConnectedNicks"); }
function LeaveClient_event(vType,sMessage) { var Pos1; var Length1 = 1; Length1 += str_len(sMessage); Pos1 = str_stri(ConnectedNicks,sMessage)-1; str_cpy(Temp_str1,ConnectedNicks); str_trunc(ConnectedNicks,str_len(ConnectedNicks)-Pos1); str_clip(Temp_str1,Pos1+Length1); str_cat(ConnectedNicks,Temp_str1); GSTNet_SendString(0,"ConnectedNicks"); }
function endless_part_event() { my.lifespan = 1; } function DrawnPointPart_func() { my.bmap = DrawPart_bmap; my.function = endless_part_event; } function ClientDraw_event(vType,sMessage) { effect(DrawnPointPart_func,1,TempPos.x,NULL); }
function EnterString(str) { inkey(str); }
function Chat_update() { while(1) { if(!str_cmp(ChatDisplay.string[6],Chat_send_str)) { str_cpy(ChatDisplay.string[0],ChatDisplay.string[1]); str_cpy(ChatDisplay.string[1],ChatDisplay.string[2]); str_cpy(ChatDisplay.string[2],ChatDisplay.string[3]); str_cpy(ChatDisplay.string[3],ChatDisplay.string[4]); str_cpy(ChatDisplay.string[4],ChatDisplay.string[5]); str_cpy(ChatDisplay.string[5],ChatDisplay.string[6]); str_cpy(ChatDisplay.string[6],Chat_send_str); } wait(1); } }
function Chat() { inkey(Chat_input); if(GSTNet_Connection() == 1) { str_cpy(Chat_send_str,"Server"); }else { str_cpy(Chat_send_str,Client_Nick); } str_cat(Chat_send_str,": "); str_cat(Chat_send_str,Chat_input); str_cpy(Chat_input,""); GSTNet_SendString(0,"Chat_send_str"); }
function ClientDraw() { mouse_map = Mauszeiger; mouse_mode = 2; while(1) { vec_set(mouse_pos,mouse_cursor); if(mouse_left) { vec_set(temp.x,mouse_pos); temp.z = 100; vec_for_screen(temp.x,camera); vec_set(TempPos.x,temp.x); ClientDraw_event(0,0); GSTNet_SendArray(0,"TempPos",0,2); GSTNet_ClientSend(0,13,""); } wait(1); } }
entity* Temp_ent; function RemoveLine() { while(1) { if(num_entities > 990) { you = ent_next(null); while(you) { temp_ent = you; you = ent_next(you); GSTNet_ent_remove(temp_ent); } } wait(1); } }
function Menu() { while(!key_1 && !key_2) { draw_text("To start as a server press 1, \nto start as a client press 2.",10,10,nullvector); wait(1); } if(key_1) { GSTNet_StartServer(2300,1); str_cat(ConnectedNicks,"Server\n"); GSTNet_Events(11,"NewClient_event"); GSTNet_Events(12,"LeaveClient_event"); }else { if(key_2) { EnterString(Temp_str1); while(!key_enter) { draw_text("Enter the server IP-adress:",10,10,nullvector); draw_text(Temp_str1,300,10,nullvector); wait(1); } GSTNet_StartClient(Temp_str1,2300,1); str_cpy(Temp_str1,""); while(key_enter || GSTNet_Connection() == 0 || GSTNetId == 0){wait(1);} EnterString(Client_Nick); while(!key_enter) { draw_text("Enter a Nickname:",10,10,nullvector); draw_text(Client_Nick,300,10,nullvector); wait(1); } GSTNet_ClientSend(0,11,Client_Nick); ClientDraw(); } } GSTNet_Events(13,"ClientDraw_event"); ChatDisplay.visible = on; on_enter = Chat; Chat_update(); while(1) { draw_text(ConnectedNicks,300,10,nullvector); wait(1); } }
function Quit() { GSTNet_ClientSend(0,12,Client_Nick); wait(-1); sys_exit(""); } on_esc = Quit;
|
|
|
Re: [GSTNet] 0.5.9 released
[Re: Slin]
#133895
08/10/07 07:33
08/10/07 07:33
|
Joined: Jun 2001
Posts: 1,004 Dossenbach
nfs42
OP
Serious User
|
OP
Serious User
Joined: Jun 2001
Posts: 1,004
Dossenbach
|
Hi Slin, event functions has changed, there are two new parameters Code:
// set this in main();
GSTNet_Events(21,"receivechatmessage");
//------------------------------------------------------------------
// function for event: receivechatmessage
//------------------------------------------------------------------
function evFunction(vTyp, sMsg, vSender, vReceiver)
{
if(GSTNet_Connection() == 2 || GSTNet_Connection() == 3 ) { //I am a client
Parse_Function(sMsg); // parse and execute ...
}
if(vSender>0){GSTNet_ServerSend(vSender-1, vTyp, sMsg);} // send the message to the preceeding clientid
}
GSTNet_ClientSend(0,21,"chatmessage");
GSTNet_ClientSend(1,21,"whisperchatmessage");
Code:
GSTNet_SendArray(0,"TempPos",0,2); GSTNet_ClientSend(0,13,"");
Andreas GSTools - Home of GSTScript 0.9.8: lua scripting for A6/7/8 GSTNet 0.7.9.20: network plugin for A6/7/8 GSTsqlite 1.3.7: sql database plugin for A6/7/8 3DGS Codebase: 57 snippets || 3DGS Downloads: 248 files
|
|
|
|