Menu

Network capability

2007-07-12
2012-09-17
1 2 > >> (Page 1 of 2)
  • Nobody/Anonymous

    who wants KS engine to have a network capability thru DXPlay? suggestion on class-name...

     
    • Mj Mendoza IV

      Mj Mendoza IV - 2008-09-07

      Thanks. Will check from time to time.

       
    • Nobody/Anonymous

      how about as simple as Net? then the sample below should make a simple KS app to connect and send "hello".

      Var:Number netTest;
      Net:New(netTest)
      Net:Connect("192.168.1.5", netTest) or Net:Connect("pc_name", netTest)
      Net:Send("hello", netTest)
      Net:Close()

       
    • Mj Mendoza IV

      Mj Mendoza IV - 2008-03-24

      Net sounds good.

      We're planning to use WinSocket instead.

      ~~creek23

       
    • Nobody/Anonymous

      i thought you guys are using fb?

      ~[hero]~

       
    • Nobody/Anonymous

      winsocket can do. whats fb?

       
    • Mj Mendoza IV

      Mj Mendoza IV - 2008-03-25

      @hero: the dev team is focused on FreeKE (see wiki). I am currently dealing with FB and the pointers.

      @anonymous: FB is FreeBASIC. Much like of Visual Basic plus pointer (and I hate it :D)

      I tried to look at the tutorial of Lucky last night. I've been having problem with the pop-up dialog asking for IP/pc_name. Right now I'm googling for a work-around.

      creek23

       
    • Nobody/Anonymous

      pointers in BASIC? really?

      i've seen some forum discussing same problem. try http://www.vbforums.com/archive/index.php/t-117327.html

      podgod
      ps: now i'm not anonymous ^_^

       
      • Nobody/Anonymous

        how stupid can i get? i just realized that VB uses ByVal.

        podgod

         
        • Nobody/Anonymous

          Yes but, FB uses pointers extensively as C/C++. That makes you not stupid. :D

           
    • Mj Mendoza IV

      Mj Mendoza IV - 2008-03-30

      Oh. Hey podgod, sorry about the anonymous thing. :D

      How about making an SF account?

      BTW, thanks for the link. The dev team will have a look. A Net class could be born soon (hopefully). :P

       
    • Nobody/Anonymous

      welcome. let me know if the Net class is ready. ill be making a simple chat demo.

      podgod

       
    • Nobody/Anonymous

      The FB project developers discussed that ByVal in not technically the same with pointers. I really didn't get the explanation really well. -- I really thought it was the same.

       
    • Mj Mendoza IV

      Mj Mendoza IV - 2008-04-05

      don't you mean ByRef?

      btw, the FB peeps say, that referrence is not the same with pointers. well they are the ASM guys, so they should know. :|

       
    • Nobody/Anonymous

      Oh! right, it's ByRef

      I don't think ASM uses ByVal and ByRef.

       
    • Mj Mendoza IV

      Mj Mendoza IV - 2008-04-07

      enough about that. here's the tech specification:

      Team Plan

      Net:New(netHandler)
      - allocates a Net buffer

      Net:Host("session_name",max_member,netHandler)
      - user acts as server

      Net:Join("session_name","host_name",netHandler)
      - joins a host

      Net:Kick("pc_name",netHandler)
      - remove client from session
      - for server use only

      Net:Ban("pc_name","msg",netHandler) ?
      - prohibit client from joining

      Net:Send("msg",netHandler)
      - sends text to all members

      Net:SendTo("msg","pc_name",netHandler)
      - sends text to one/selected member(s)

      Proposal II

      Net:New(netHandler)
      - allocates a Net buffer

      Net:Host("session_name",max_member,b_success)
      - user acts as server

      Net:Join("session_name","host_name",b_success)
      - joins a host

      Net:Kick("pc_name",b_success)
      - remove client from session
      - for server use only

      Net:Ban("pc_name","msg",b_success) ?
      - prohibit client from joining

      Net:Send("msg",b_success)
      - sends text to all members

      Net:SendTo("msg","pc_name",b_success)
      - sends text to one/selected member(s)

      NOTE that b_success will be use for command execution success status (phew).

      There will be no need to make a Net buffer.

      Comments anyone?

       
    • Nobody/Anonymous

      sounds good to me. can't wait to try it out.

       
    • Nobody/Anonymous

      revision on

      • Net:Host("session_name",max_member,b_success)
      • Net:Join("session_name","host_name",b_success)

      now, it's

      • Net:Host("host_player_name", max_member, "session_name", b_success)
      • Net:Join("client_player_name", "session_name", "host_name", b_success)

      also added network-event listener:

      • for host:
      • {session_name}_onClientJoin
      • {session_name}_onClientQuit

      • for join:

      • {session_name}_onReceive
       
      • Nobody/Anonymous

        if {session_name}_onReceive is only for users who "join"-ed, what about the host?

        podgod

         
    • Nobody/Anonymous

      good to hear that Net class is in progress. what about DBase?

      ~[hero]~

       
    • Mj Mendoza IV

      Mj Mendoza IV - 2008-04-14

      Oh, sorry about that. {session_name}_onReceive is also for the host. :D

      BTW, I added GetData, and GetMessage. Also {session_name}_onReceiveData. Check the CVS.

       
      • Nobody/Anonymous

        whats the difference of GetMessage and and GetData? any day can also be sent as message. you just have to a parse the message to get the data.

        podgod

         
        • Mj Mendoza IV

          Mj Mendoza IV - 2008-04-24

          We thought of simplifying things for users. See sample below.

          //provided there is already a connectionfunction mygame_onReceiveData() {
          Var:String sender,data;Var:Number code;
          Var:Boolean got_data;Net:GetData(sender,data,got_data)
          if (got_data EQ true) {
          //react on the data received based on the codeif (code EQ 1) { //the sender chooses a character
          if (data EQ "ck") { `````````//sender chooses Creek} else if (data EQ "dk") {
          //sender chooses Dork ```````} `````} else if (code EQ 2) { //the sender chooses a map ```````if (data EQ "ph") {//sender chooses Philippines
          } else if (data EQ "us") { `````````//sender chooses America}
          } else { //handles unknown data ```````Konsol:Log(sender + " is sending unknown data: " + data)}
          ``}}

          This makes parsing easier on users part.

           
          • Mj Mendoza IV

            Mj Mendoza IV - 2008-04-29

            The KonsolScript language-design mantra is "Simplify when possible".

             
    • Nobody/Anonymous

      what is Net:New for?

      ~[hero]~

       
1 2 > >> (Page 1 of 2)

Anonymous
Anonymous

Add attachments
Cancel