Re: Looking for someone to give a quick one on one tutorial

2015-08-16 Thread AudioGames . net Forum — Developers room : Victorious via Audiogames-reflector


  


Re: Looking for someone to give a quick one on one tutorial

It looks like what youre asking is for an introduction to networking.

URL: http://forum.audiogames.net/viewtopic.php?pid=228016#p228016




___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: Looking for someone to give a quick one on one tutorial

2015-08-16 Thread AudioGames . net Forum — Developers room : arbuz via Audiogames-reflector


  


Re: Looking for someone to give a quick one on one tutorial

Hello,I want to instantly say sorry for my bad English, but I feel that I can to help you phigure this out:I dont use BGT, but I can tell the general idea of networking.TCP / UDP sends the packets to the client or to the server. It can send for instance a simple text, like Hello, or something else. By splitting that text your client or the server might decide what to do.Imagine a situation, that you need to create an application that allows you to chat with someone else. So basic idea is this one:Someone needs to connect to the other one, so that one is connecting are called a client. Other one that accepts the connections is called a server. Server should handle with that client (it should decide whether to accept the client or just disconnect it if its isnt suitable (for example your chatting program requires a correct password to be entered if you want to start to communicate).When server completes to check if password
  that was entered is right one, it accepts the client. Otherwise, it must to close the clients socket and continue to scan if someone else wants to connect to it. If client entered the right password, it should allow to start chatting. When the client types a message, server should catch it and print it on the screen for the user that client is chatting with. Also client should scan for the servers messages to catch them as well.Lets take a look more deeply into this:I will not write any valid code for that, but I just try to show you the basic idea:// global constantsconstant SERVER_IP_ADDR = 127.0.0.1 // just for exampleconstant SERVER_PORT = 12232constant MAX_CLIENTS_AT_ONCE = 1// create a variable for determine weather its a server or clientconnection_state =  // it is declared as a blank string for nowserver_socket = -1 // variable that holds info about the server socketclient_socket = -1
  // the same, but it holds the data bout the client socketlogin_name = login_password = my_name = Now imagine that we need to create a GUI for the selection, so we will make a form within the function:function main_screen()window_handle = create_GUI(Chatting GUI)button1 = create_button(Create a server)button2 = create_button(Join the server)while 1 = 1 // Forever loopform_messages_catcher = catch_form_messages()if form_messages_catcher == button1 // create a server button was clickedlogin(server)else if form_messages_catcher == button2 // join server button was clickedlogin(client)else if form_messages_catcher == GUI_CLOSED // if user wants to close the GUIexitend if end while // end forever loopend functionfunction login(state)delete_previous_gui()window_h
 andle = create_GUI(Chatting GUI)label1 = create_label(Please type your nickname: )edit1 = create_edit()label2 = create_label(Please enter your password for connection: )edit2 = create_edit()button1 = create_button(Submit)button2 = create_button(Cancel)while 1 = 1form_messages_catcher = catch_form_messages()if form_messages_catcher == button1 // submit was clickedmy_name = read_gui_element(edit1)login_password = read_gui_element(edit2)delete_previous_gui()if state == serverstart_server()elsejoin_server()end ifelse if form_messages_catcher == button2 // cancel was clickeddelete_previous_gui()main_screen() else if form_messages_catcher == GUI_CLOSED // if user wants to close the GUIexitend if end whileend functionfunction start_server()<
 br />TCP_startup() // some function to start the tcp servicesserver_socket = TCP_listen(SERVER_IP_ADDR, SERVER_PORT, MAX_CLIENTS_AT_ONCE) // an example of function that creates a server socketmessage_from_client = repeat // starting a repeat loop to wait for the clientif client_socket == -1client_socket = TCP_scan_for_clients(server_socket) // server_socket goes as a argument / parameterelse if client_socket != -1 // if someone connected. We determine that, because our client_socket ID has been changedmessage_from_client = TCP_receive_message(client_socket) // we give a client_socket as an argument to determine, from which client we are getting this message (at this time we use only one client, but in the future, we will may need more)if message_from_client !=  // if message isnt blank, then splitted_message_from_client = string_split_to_array(message_from_client, ,) // we determine, how 
 to split the message, at this time by commasif splitted_message_from_client[2] == login_password // if password is correct, thenlogin_name = splitted_message_from_client[1]else // if password is wrongTCP_send_message(client_socket, wrong password) // we send a message to the client, that entered password was wrongTCP_close_socket(client_socket)client_socket = -1 // reset the variableend ifend ifend ifuntil client_socket != -1 // we set to do this lloop until someone is connected successfullyTCP_send_message(client_socket, my_name) // server sends its users nicknamechat_window() // someone gets connected, so we can show the main chatting windowend 

Re: Looking for someone to give a quick one on one tutorial

2015-08-16 Thread AudioGames . net Forum — Developers room : arbuz via Audiogames-reflector


  


Re: Looking for someone to give a quick one on one tutorial

No, you cant just send a function to the client or to the server. As you can see in my previously given example, you can only send some text, which can be interpreted as some sort of command. Your program should handle what the text that server sent to client means. For instance, you have a server, that sends a command to the client and then client program understands that command and does whatever it takes.As for AutoIt it looks something like this:;ServerTCPSend($client_socket, play_sound|mysound1.wav);Clientlocal $message_from_server = do$message_from_server = TCPRecv($server_socket, 1024) ; we accept max 1 kilobyte of datauntil $message_from_server  $message_from_server = stringSplit($message_from_server, |) ;in this case we just split our given string into an array, that $message_from_server[0] = number, which represents how many items this new array has, $mes
 sage_from_server[1] = our command, in this particular variant its play_sound, and $message_from_server[2] = sound that should be played, so further it looks like thisswitch $message_from_server[1] ; we use switch to determine which command to performcase play_soundif fileExists($message_from_server[2]) thensoundPlay($message_from_server[2])endifcase something_elsedo something...endSwitchI hope this helps.

URL: http://forum.audiogames.net/viewtopic.php?pid=228049#p228049




___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: Looking for someone to give a quick one on one tutorial

2015-08-16 Thread AudioGames . net Forum — Developers room : momo7807 via Audiogames-reflector


  


Re: Looking for someone to give a quick one on one tutorial

hiBut my question is, can I send a function as a packet like this?tcpsend $socket1, soundplaylol.oggIf the lol.ogg is exist in the client, the client plays the lol.ogg file? or just print an error messageAnd if Ive send a user function to the client, the client can call this function?I saw an autoit example, I think I can send a function as a packet like I said, because in autoit example, the client just sent a function, fileopenAnd the server recived the file

URL: http://forum.audiogames.net/viewtopic.php?pid=228046#p228046




___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: Looking for someone to give a quick one on one tutorial

2015-08-15 Thread AudioGames . net Forum — Developers room : momo7807 via Audiogames-reflector


  


Re: Looking for someone to give a quick one on one tutorial

I thought You are better than me about bgt.And try this idea.I dont remember the actual code , so I will put my idea onlyIf you pressed up arrow, The client sends a value, and the value will be assigned in the servers variable. You can use the if statement to call moveforward function.For example, if the variable lol is 0, the moveforward function will stay there. If the lol variable is 1, the moveforward function will be called.But if you making an actual game, Dont do it. Maybe you should make up to 1000 variables or much more.

URL: http://forum.audiogames.net/viewtopic.php?pid=227984#p227984




___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: Looking for someone to give a quick one on one tutorial

2015-08-15 Thread AudioGames . net Forum — Developers room : sneak via Audiogames-reflector


  


Re: Looking for someone to give a quick one on one tutorial

Im pretty sure the best way to go about what youre asking is to have the function written up in the server portion, then have the client accept the keystrokes, so you press up arrow, then the client sends that information to the server and the server is like, if(key_pressed(KEY_UP){moveForward();}or something. I dont know why youre asking me if I said I dont know how the networking object actually works though lol. Its all theory and speculation in my case.

URL: http://forum.audiogames.net/viewtopic.php?pid=227981#p227981




___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: Looking for someone to give a quick one on one tutorial

2015-08-15 Thread AudioGames . net Forum — Developers room : momo7807 via Audiogames-reflector


  


Re: Looking for someone to give a quick one on one tutorial

hi sneakIm sorry I havent manage packets in bgt, So I cant help you.And I have a question. If Im in server mode, Can I send a function as a packet in bgt?It means like thisIn stw, you will walk around, step by stepIf you press up arrow, your client will send a packet to the server, telling it to increase a value that stored in int variable.and the client will play a step sounds.I think it is like thissend_reliable lol, int corrdinates - 1And if you died, The server will send a packet that tells your client to play the dying sounds.Is it like this?Send_reliable rofl, play die.oggIf I was wrong, please let me know about it.And please note, Im a newbie in the bgt.Thanks

URL: http://forum.audiogames.net/viewtopic.php?pid=227980#p227980




___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Looking for someone to give a quick one on one tutorial

2015-08-15 Thread AudioGames . net Forum — Developers room : sneak via Audiogames-reflector


  


Looking for someone to give a quick one on one tutorial

Hello, so Im currently working on several projects. I work on one till I get sick of it, then pick up another or start one up, then go back. Its not a good work ethic, but at least Im learning as I go. LOL. Ive been trying to learn to use BGTs networking object, but Im having a bit of an issue wrapping my head around it. I just have questions that I cant seem to be able to find answers to on my own. Id very much appreciate it if someone would take the time and sit down one on one with me on Skype and walk me through the process and help answer some questions. Im not asking for help in coding my project, just to help get a general idea of how to have the client send packets to the server and have the server react in kind. Thanks in advance.

URL: http://forum.audiogames.net/viewtopic.php?pid=227971#p227971




___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector